/* Material Symbols (로컬 폰트) */
@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 400;
    src: url(/css/material-symbols.ttf) format('truetype');
}
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* Primary */
    --primary: #3B82F6;
    --primary-dark: #2563EB;

    /* Neutrals */
    --white: #FFFFFF;
    --gray-50: #F8F9FA;
    --gray-200: #E5E7EB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --gray-900: #1F2937;

    /* Accent */
    --success: #10B981;
    --success-bg: #ECFDF5;
    --warning: #F59E0B;
    --warning-bg: #FFFBEB;
    --error: #EF4444;
    --error-bg: #FEF2F2;

    --radius: 8px;
    --radius-sm: 4px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);

    --header-h: 52px;
    --nav-h: 56px;
    --font: -apple-system, 'Pretendard', 'Malgun Gothic', 'Helvetica Neue', sans-serif;
}

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-700);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===== Header ===== */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding: 0 20px;
    max-width: 1100px;
    margin: 0 auto;
}
.header-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--gray-900);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-text {
    line-height: 1;
}
.header-main {
    padding-top: 2px;
}
.header-sub {
    font-size: 11px;
    font-weight: 400;
    color: var(--gray-400);
    letter-spacing: 0;
    margin-top: 1px;
}
.header-logo {
    height: 32px;
    border-radius: 4px;
    object-fit: contain;
}
.header-actions { display: flex; gap: 2px; }
.btn-icon {
    background: none;
    border: none;
    color: var(--gray-400);
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover { color: var(--gray-700); background: var(--gray-50); }
.btn-icon svg { display: block; }

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: var(--white);
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
    gap: 0;
    border-bottom: 1px solid var(--gray-200);
}
.tab-item {
    flex: none;
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
}
.tab-item:hover { color: var(--gray-700); }
.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Search */
.search-bar {
    padding: 8px 16px 12px;
    background: var(--white);
    max-width: 1100px;
    margin: 0 auto;
}
.search-bar input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    color: var(--gray-700);
    outline: none;
    transition: border-color 0.15s;
}
.search-bar input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.search-bar input::placeholder { color: var(--gray-400); }

/* ===== Main ===== */
.main {
    padding-top: calc(var(--header-h) + 42px);
    padding-bottom: 60px;
    min-height: 100vh;
    max-width: 1100px;
    margin: 0 auto;
}
/* 모바일: 좁은 화면 */
@media (max-width: 768px) {
    .main { max-width: 100%; }
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 24px 16px;
    font-size: 11px;
    color: var(--gray-400);
    letter-spacing: 0.2px;
}

/* Install Guide */
.install-section { margin-bottom: 14px; }
.install-platform {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 6px;
}
.install-steps {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.8;
}

/* ===== Cards ===== */
.card-list {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--gray-200);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin: 0 16px;
    overflow: hidden;
}

.card {
    background: var(--white);
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.1s;
    border-left: 3px solid transparent;
}
.card:active { background: var(--gray-50); }
.card.risk-high { border-left-color: var(--error); }
.card.risk-medium { border-left-color: var(--warning); }
.card.risk-low { border-left-color: var(--gray-200); }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}
.card-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge-danger { background: #FEE2E2; color: #DC2626; }
.badge-warning { background: #FEF3C7; color: #B45309; }
.badge-caution { background: var(--gray-50); color: var(--gray-500); }
.badge-success { background: #D1FAE5; color: #059669; }
.badge-cmr { background: #EDE9FE; color: #7C3AED; }

.card-tags { display: flex; gap: 4px; flex-shrink: 0; }

.card-code {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}
.card-code-lg {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    letter-spacing: -0.3px;
}
.card-sub {
    display: flex;
    gap: 8px;
    font-size: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
    align-items: center;
}
.card-cas {
    color: var(--gray-400);
}
/* 호버 시 상세 표시 */
.card-hover-detail {
    display: none;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--gray-200);
    font-size: 12px;
}
.card-hover:hover .card-hover-detail,
.card-hover:active .card-hover-detail {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.card-hover-name {
    color: var(--gray-500);
}
/* 모바일: 탭으로 상세 표시 */
.card-hover.touched .card-hover-detail {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.card-meta {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--gray-500);
    flex-wrap: wrap;
}

/* ===== Detail Page ===== */
.detail-page { padding: 16px; }

.detail-header {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 8px;
    border: 1px solid var(--gray-200);
}
.detail-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
}
.detail-subtitle {
    color: var(--gray-500);
    font-size: 13px;
    margin-bottom: 14px;
}
.detail-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 16px;
    font-size: 13px;
}
.detail-meta dt { color: var(--gray-500); }
.detail-meta dd { color: var(--gray-700); font-weight: 500; }

.detail-section {
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}
.detail-section-title {
    font-size: 14px;
    font-weight: 700;
    padding: 12px 20px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.detail-section-title .sec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.detail-section-body {
    font-size: 13px;
    line-height: 1.7;
    color: var(--gray-700);
}
.detail-section-body .field,
.detail-section-body .info-card-plain {
    padding: 14px 20px;
}
.detail-section-body > .info-grid {
    /* info-grid handles its own padding */
}
.detail-section-body .field + .field {
    border-top: 1px solid var(--gray-200);
}
.detail-section-body .field-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
}
.detail-section-body .field-value {
    font-size: 13px;
    color: var(--gray-700);
    line-height: 1.7;
}

/* Pictograms (v1.1.0 — 실제 GHS 그림문자 이미지) */
.pictogram-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
}
.pictogram-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    background: var(--error-bg);
    color: var(--error);
}
/* GHS 실제 이미지 */
.ghs-img-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ghs-img-item img {
    display: block;
}
.ghs-img-cap {
    font-size: 11px;
    color: #7F1D1D;
    margin-top: 3px;
    text-align: center;
    line-height: 1.2;
    font-weight: 600;
}
.ghs-text {
    display: inline-block;
    padding: 4px 10px;
    background: var(--error-bg);
    color: var(--error);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

/* ===== Buttons ===== */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: var(--white); color: var(--gray-700); border: 1px solid var(--gray-200); }
.btn-outline:hover { border-color: var(--gray-400); }
.btn-full { width: 100%; }

/* ===== Filter Chips ===== */
.filter-bar {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.chip {
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-500);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.chip:hover { border-color: var(--gray-400); color: var(--gray-700); }
.chip.active { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ===== System sub-tabs ===== */
.sub-tab-nav {
    display: flex;
    gap: 0;
    padding: 0 16px;
    margin-top: 4px;
    border-bottom: 1px solid var(--gray-200);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.sub-tab {
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.sub-tab:hover { color: var(--gray-700); }
.sub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== System diagram view ===== */
.diagram-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.diagram-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.diagram-desc {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 12px;
    line-height: 1.5;
}
.diagram-host {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 8px 12px;
    overflow-x: auto;
    min-height: 240px;
}
.diagram-svg {
    width: 100%;
    text-align: center;
}
.diagram-svg svg {
    height: auto !important;
    display: block;
    margin: 0 auto;
}
/* 풀폭(arch/auth/backup): 컨테이너 100% 채움 */
.diagram-svg:not(.compact) svg {
    width: 100% !important;
    max-width: none !important;
}
/* compact(pipeline/deploy): 자연 폭 유지 (인라인 max-width 적용) */
.diagram-svg.compact svg {
    width: 100% !important;
    /* max-width은 인라인 style로 자연폭 px 지정됨 */
}
.diagram-legend {
    margin-top: 8px;
    font-size: 11px;
    color: var(--gray-400);
}

/* ===== Stats ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 0 16px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--gray-200);
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -1px;
}
.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    letter-spacing: 0.3px;
    margin-top: 2px;
}
.stat-active { border-color: var(--primary); background: rgba(59,130,246,0.04); }
.stat-active .stat-value { color: var(--primary); }
.stat-danger .stat-value { color: var(--error); }
.stat-warning .stat-value { color: var(--warning); }
.stat-primary .stat-value { color: var(--primary); }
.stat-success .stat-value { color: var(--success); }

/* Category bar (전체목록 상단) */
.cat-bar {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.cat-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 4px;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    background: var(--white);
    cursor: pointer;
    transition: all 0.15s;
}
.cat-btn:hover { border-color: var(--gray-400); }
.cat-btn.cat-active {
    border-color: var(--primary);
    background: rgba(59,130,246,0.04);
}
.cat-btn.cat-total {
    border-width: 2px;
    border-color: var(--gray-900);
    background: var(--gray-900);
}
.cat-btn.cat-total .cat-count { color: var(--white); }
.cat-btn.cat-total .cat-label { color: rgba(255,255,255,0.7); }
.cat-btn.cat-total.cat-active {
    border-color: var(--primary);
    background: var(--primary);
}
/* 법적유해 — 솔리드 레드 */
.cat-btn.cat-legal {
    border-width: 2px;
    border-color: #B91C1C;
    background: #DC2626;
    box-shadow: 0 2px 6px rgba(220,38,38,0.25);
}
.cat-btn.cat-legal .cat-count { color: #FFFFFF; font-weight: 800; }
.cat-btn.cat-legal .cat-label { color: rgba(255,255,255,0.92); font-weight: 700; }
.cat-btn.cat-legal:hover { background: #B91C1C; border-color: #991B1B; }
.cat-btn.cat-legal.cat-active {
    background: #991B1B;
    border-color: #7F1D1D;
    box-shadow: 0 3px 10px rgba(153,27,27,0.45);
}
.cat-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-700);
    line-height: 1;
}
.cat-active .cat-count { color: var(--primary); }
.cat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    white-space: nowrap;
}

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}
.modal {
    background: var(--white);
    border-radius: 12px;
    padding: 32px 28px;
    width: 100%;
    max-width: 340px;
    box-shadow: var(--shadow-lg);
}
.modal-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    margin-bottom: 12px;
}
.modal h2 { font-size: 18px; font-weight: 700; color: var(--gray-900); margin-bottom: 2px; }
.modal-subtitle { color: var(--gray-500); font-size: 13px; margin-bottom: 24px; }

/* ===== Form ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}
.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-error {
    color: var(--error);
    font-size: 13px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: var(--error-bg);
    border-radius: var(--radius);
}

/* ===== User Menu ===== */
.user-menu {
    position: fixed;
    top: calc(var(--header-h) + 4px);
    right: 12px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    width: 200px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    z-index: 150;
}
.user-info { margin-bottom: 12px; }
.user-name { font-weight: 600; font-size: 14px; color: var(--gray-900); }
.user-dept { color: var(--gray-500); font-size: 12px; }

/* ===== Loading ===== */
.loading { text-align: center; padding: 60px; color: var(--gray-400); }
.spinner {
    display: inline-block;
    width: 24px; height: 24px;
    border: 2px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 80px 24px; color: var(--gray-400); }
.empty-state-icon { margin-bottom: 16px; display: flex; justify-content: center; opacity: 0.35; }
.empty-state-icon svg { display: block; }
.empty-state-text { font-size: 14px; }

/* ===== Back Button ===== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 0;
    margin-bottom: 8px;
    cursor: pointer;
    background: none;
    border: none;
}
.back-btn:hover { color: var(--gray-900); }
.back-btn svg { display: block; }

/* ===== Tables ===== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--gray-200); }
th { font-weight: 600; color: var(--gray-500); font-size: 11px; letter-spacing: 0.3px; background: var(--gray-50); }
td { color: var(--gray-700); }

/* ===== Page Title ===== */
.page-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    padding: 16px 16px 4px;
}

/* ===== Progress ===== */
.progress-wrap {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--gray-200);
    margin: 12px 16px 0;
}
.progress-label { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: var(--gray-700); }
.progress-bar { background: var(--gray-200); border-radius: 99px; height: 6px; overflow: hidden; }
.progress-fill { background: var(--primary); height: 100%; border-radius: 99px; transition: width 0.3s; }
.progress-text { text-align: right; font-size: 11px; color: var(--gray-400); margin-top: 6px; font-weight: 600; }

/* ===== Chemical List (상세 페이지) ===== */
.chem-list {
    display: flex;
    flex-direction: column;
}
.chem-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-200);
}
.chem-item:last-child { border-bottom: none; }
.chem-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.chem-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.4;
    word-break: keep-all;
}
.chem-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 3px;
}

/* ===== Manage Cards ===== */
.manage-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.manage-card:hover { border-color: var(--primary); background: rgba(59,130,246,0.02); }
.manage-card-alert { border-color: var(--error); }
.manage-card-alert .manage-icon { background: var(--error-bg); color: var(--error); }
.manage-card:active { background: var(--gray-50); }
.manage-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    border-radius: var(--radius);
    color: var(--gray-500);
}
.manage-icon svg { width: 20px; height: 20px; }
.manage-title { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.manage-desc { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.admin-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
}
.admin-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.admin-remove:hover { color: var(--error); }
.ldap-suggestion {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.1s;
}
.ldap-suggestion:last-child { border-bottom: none; }
.ldap-suggestion:hover { background: var(--gray-50); }
.manage-status {
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--gray-700);
}

/* 접수대장/시스템: 모바일에서 숨김 */
@media (max-width: 768px) {
    .tab-item[data-page="/registry"] { display: none !important; }
    .tab-item[data-page="/manage"] { display: none !important; }
    .tab-item[data-page="/system"] { display: none !important; }
}

/* ===== Registry Table ===== */
.registry-table { font-size: 12px; }
.registry-table th { font-size: 11px; position: sticky; top: 0; z-index: 1; user-select: none; }
.registry-table th[onclick] { cursor: pointer; }
.registry-table th[onclick]:hover { background: var(--gray-200); }
.registry-table td { padding: 6px 10px; }
.registry-table tr:hover { background: var(--gray-50); }
.td-code { font-weight: 700; color: var(--gray-900); white-space: nowrap; }
.td-kosha { font-size: 10px; color: var(--gray-500); }
.td-date { white-space: nowrap; }
.td-expired { color: var(--error); font-weight: 600; }
.row-expired { background: #FEF2F2 !important; }
.row-expired:hover { background: #FEE2E2 !important; }
.btn-edit {
    background: none;
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    color: var(--primary);
    cursor: pointer;
}
.btn-edit:hover { background: rgba(59,130,246,0.06); }
.btn-del {
    border-color: var(--error);
    color: var(--error);
}
.btn-del:hover { background: rgba(239,68,68,0.06); }
.tag-exp { font-size: 9px; padding: 1px 4px; border-radius: 3px; background: var(--error); color: #fff; font-weight: 600; }

/* ===== Material Symbol Safety Icon ===== */
.mat-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: #F1F5F9;
    border-radius: 10px;
    color: #475569;
}
.mat-icon .material-symbols-outlined { font-size: 24px; }
.info-card-icon .mat-icon { width: 40px; height: 40px; }
.info-card-icon .mat-icon .material-symbols-outlined { font-size: 24px; }
.ql-safety-icon .mat-icon { width: 48px; height: 48px; }
.ql-safety-icon .mat-icon .material-symbols-outlined { font-size: 28px; }

/* ===== Quick Lookup (현장 근로자용) ===== */
.ql-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 12px 16px 32px;
}
/* 언어 토글 */
.ql-lang {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 16px;
}
.ql-lang button {
    padding: 6px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 99px;
    background: var(--white);
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
}
.ql-lang button.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
/* 비밀번호 화면 */
.ql-pw-card { text-align: center; padding: 40px 20px; }
.ql-pw-icon { width: 56px; height: 56px; margin: 0 auto 16px; color: var(--primary); }
.ql-pw-icon svg { width: 56px; height: 56px; }
.ql-pw-title { font-size: 22px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.ql-pw-desc { font-size: 16px; color: var(--gray-500); margin-bottom: 24px; }
.ql-pw-form { max-width: 300px; margin: 0 auto; }
.ql-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 17px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.ql-input:focus { border-color: var(--primary); }
.ql-btn-primary {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--white);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.ql-btn-primary:active { background: var(--primary-dark); }
.ql-error { color: var(--error); font-size: 15px; margin-top: 10px; }
/* 검색 바 */
.ql-search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.ql-search-bar .ql-input { flex: 1; }
/* 결과 - 제품명 */
.ql-product-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-900);
    text-align: center;
    padding: 12px 0 8px;
}
/* 위험도 배지 */
.ql-risk {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 12px;
}
/* GHS (v1.1.0 — 실제 이미지 + H-코드 통합) */
.ql-ghs {
    padding: 12px;
    background: #FDFAFA;
    border: 1px solid #F2E0E0;
    border-radius: var(--radius);
    margin-bottom: 16px;
}
.ql-ghs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.ql-ghs-row .ghs-img-item { width: 72px; }
.ql-ghs-row .ghs-img-item img { width: 64px; height: 64px; }
.ql-ghs-hstmt {
    padding-top: 10px;
    margin-top: 8px;
    border-top: 1px dashed #F2E0E0;
}
.ql-ghs-hstmt > div {
    font-size: 13px;
    color: #991B1B;
    margin: 2px 0;
    line-height: 1.45;
}
.ql-ghs-badge {
    padding: 4px 10px;
    background: var(--error-bg);
    color: var(--error);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
}
/* 섹션 제목 */
.ql-section-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-900);
    padding: 14px 0 8px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 8px;
}
/* 안전 카드 */
.ql-cards { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.ql-safety-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}
.ql-safety-icon { flex-shrink: 0; width: 48px; height: 48px; }
.ql-safety-icon svg { width: 48px; height: 48px; display: block; }
.ql-safety-body { flex: 1; min-width: 0; }
.ql-safety-label { font-size: 16px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.ql-safety-text { font-size: 15px; line-height: 1.6; color: var(--gray-700); word-break: keep-all; }
.ql-empty { text-align: center; padding: 32px; font-size: 16px; color: var(--gray-500); }
/* 물리특성 */
.ql-props {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.ql-prop {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    font-size: 15px;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
}
.ql-prop:last-child { border-bottom: none; }
.ql-prop-label { font-weight: 700; color: var(--gray-700); flex-shrink: 0; min-width: 68px; }
.ql-prop-value { color: var(--gray-900); flex: 1; text-align: left; word-break: break-word; }

/* ===== Footer (v1.1.0) ===== */
.app-footer {
    text-align: center;
    padding: 16px 12px 24px;
    margin-top: 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50, #F9FAFB);
}
.app-version {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: 4px;
}
.app-copyright {
    font-size: 11px;
    color: var(--gray-400, #9CA3AF);
}

/* ===== Device Badge (화면 권한 설정) ===== */
.dev-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.dev-badge.dev-pc { background: #DBEAFE; color: #1E40AF; }
.dev-badge.dev-mo { background: #D1FAE5; color: #065F46; }

/* ===== Preview Modal ===== */
.preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.preview-wrap {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 95vw;
    height: 95vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}
.preview-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}
.preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.preview-frame {
    flex: 1;
    border: none;
    width: 100%;
}

/* ===== Infographic Cards ===== */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--gray-200);
}
.info-card {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--white);
    align-items: flex-start;
}
.info-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.info-card-icon svg {
    width: 40px;
    height: 40px;
    display: block;
}
.info-card-body {
    flex: 1;
    min-width: 0;
}
.info-card-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: 0.2px;
    margin-bottom: 3px;
}
.info-card-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.info-card-list li {
    font-size: 13px;
    line-height: 1.5;
    color: var(--gray-700);
    position: relative;
    padding-left: 8px;
}
.info-card-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--gray-400);
}
.info-card-plain {
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--gray-700);
}

/* ===== Responsive ===== */

/* PC */
@media (min-width: 769px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .card-list { margin: 0 16px; }
    .cat-bar { padding: 12px 16px; }
    .detail-page { padding: 16px; }
}

/* 모바일 */
@media (max-width: 768px) {
    .card-list { margin: 0; border-radius: 0; border-left: none; border-right: none; }
    .cat-bar { padding: 10px 12px; gap: 4px; }
    .cat-btn { padding: 8px 2px; }
    .cat-count { font-size: 14px; }
    .cat-label { font-size: 9px; }
    .card-code-lg { font-size: 14px; }
    .card { padding: 12px 14px; }
    .detail-page { padding: 10px; }
    .detail-header { padding: 14px; }
    .detail-title { font-size: 16px; }
    .info-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 12px; }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 22px; }
    .preview-wrap { max-width: 100vw; height: 100vh; border-radius: 0; }
}

/* ===== Autocomplete ===== */
.ac-wrap { position: relative; flex: 1; min-width: 0; }
.ac-dropdown {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 1000;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    max-height: 260px; overflow-y: auto; display: none;
}
.ac-dropdown.show { display: block; }
.ac-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; cursor: pointer; font-size: 13px;
    border-bottom: 1px solid var(--gray-50);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.ac-active { background: var(--gray-50); }
.ac-code { font-weight: 700; color: var(--primary); min-width: 50px; font-size: 12px; }
.ac-name { flex: 1; color: var(--gray-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-cas { color: var(--gray-400); font-size: 11px; }
