:root {
    --navy: #0b2b4c;
    --navy-2: #123d66;
    --blue: #1976d2;
    --blue-dark: #125ea8;
    --canvas: #f4f7fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172433;
    --muted: #6b7b8f;
    --border: #dce4ec;
    --success: #217a5b;
    --success-bg: #e8f6f0;
    --warning: #9a6500;
    --warning-bg: #fff4d6;
    --danger: #a33434;
    --danger-bg: #fff0f0;
    --shadow: 0 12px 32px rgba(11, 43, 76, .08);
    --radius: 12px;
    --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--text);
    background: var(--canvas);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.container { width: min(calc(100% - 32px), var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.header-row { min-height: 72px; display: flex; align-items: center; gap: 24px; }
.brand-mark { display: inline-flex; align-items: center; gap: 10px; min-width: max-content; }
.brand-mark > span:last-child { display: grid; line-height: 1.05; }
.brand-mark strong { color: var(--navy); font-size: 18px; letter-spacing: -.02em; }
.brand-mark small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.brand-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 800; }
.main-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.main-nav a { color: #425267; font-size: 14px; font-weight: 650; }
.main-nav a:hover { color: var(--blue); }
.header-search { display: flex; width: 320px; }
.header-search input, .hero-search input, .filter-bar input, .inline-search input, .form-stack input {
    min-width: 0;
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    outline: none;
}
.header-search input { height: 40px; border-radius: 9px 0 0 9px; padding: 0 12px; }
.header-search button { height: 40px; border: 0; border-radius: 0 9px 9px 0; padding: 0 16px; background: var(--blue); color: #fff; font-weight: 750; }
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 8px 12px; color: var(--navy); font-weight: 700; }

.hero-section { background: linear-gradient(180deg, #fff 0%, #f2f7fb 100%); border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 48px; align-items: center; min-height: 480px; padding-block: 64px; }
.eyebrow { display: inline-block; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; color: var(--navy); font-size: clamp(34px, 5vw, 58px); line-height: 1.06; letter-spacing: -.045em; }
h2 { margin-bottom: 0; color: var(--navy); font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -.025em; }
.hero-grid > div > p { max-width: 720px; margin-bottom: 26px; color: var(--muted); font-size: 17px; }
.hero-search { display: flex; max-width: 760px; box-shadow: var(--shadow); }
.hero-search input { height: 58px; border-radius: 12px 0 0 12px; padding: 0 18px; font-size: 15px; }
.hero-search button { min-width: 150px; border: 0; border-radius: 0 12px 12px 0; background: var(--blue); color: #fff; font-weight: 800; padding: 0 22px; }
.hero-search button:hover, .header-search button:hover, .filter-bar button:hover, .inline-search button:hover, .button-primary:hover { background: var(--blue-dark); }
.hero-links { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.hero-links a { color: var(--blue); font-weight: 750; }
.hero-panel { border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { display: flex; align-items: center; gap: 9px; padding: 18px 20px; border-bottom: 1px solid var(--border); color: var(--navy); font-weight: 800; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #27a274; box-shadow: 0 0 0 5px #e8f6f0; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 20px; border-bottom: 1px solid #edf1f5; font-size: 13px; }
.status-row:last-child { border-bottom: 0; }
.status-row span { color: var(--muted); }
.status-row strong { color: var(--navy); font-size: 12px; }

.stats-section { margin-top: -1px; background: #fff; border-bottom: 1px solid var(--border); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat-card { padding: 24px; text-align: center; border-right: 1px solid var(--border); }
.stat-card:first-child { border-left: 1px solid var(--border); }
.stat-card strong { display: block; color: var(--navy); font-size: 28px; line-height: 1; }
.stat-card span { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }

.section-block { padding-block: 58px; background: #fff; }
.section-muted { background: var(--canvas); border-top: 1px solid var(--border); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.text-link { color: var(--blue); font-weight: 750; font-size: 13px; }
.text-link:hover { text-decoration: underline; }
.brand-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.brand-card { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.brand-card:hover { transform: translateY(-2px); border-color: #b9cee2; box-shadow: 0 10px 24px rgba(11,43,76,.07); }
.brand-logo { flex: 0 0 auto; width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); display: grid; place-items: center; overflow: hidden; color: var(--navy); font-size: 14px; font-weight: 850; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.brand-card > div:nth-child(2) { min-width: 0; display: grid; }
.brand-card strong { color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.brand-card small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-arrow { margin-left: auto; color: var(--blue); font-weight: 800; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.product-card { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 8px; min-height: 145px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.product-card:hover { transform: translateY(-2px); border-color: #b9cee2; box-shadow: 0 10px 24px rgba(11,43,76,.07); }
.product-brand { color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.product-card strong { color: var(--navy); font-size: 15px; line-height: 1.3; }
.product-card small { color: var(--muted); font-size: 11px; }
.product-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: auto; color: var(--muted); font-size: 11px; }

.page-hero { background: linear-gradient(180deg, #fff, #f5f8fb); border-bottom: 1px solid var(--border); }
.compact-hero .container { padding-block: 44px; }
.compact-hero h1, .product-hero h1 { font-size: clamp(32px, 4vw, 46px); margin: 8px 0 10px; }
.compact-hero p, .product-hero p { color: var(--muted); margin-bottom: 0; }
.filter-bar, .inline-search { display: flex; max-width: 620px; margin-top: 22px; }
.filter-bar input, .inline-search input { height: 46px; border-radius: 9px 0 0 9px; padding: 0 14px; }
.filter-bar button, .inline-search button { border: 0; border-radius: 0 9px 9px 0; padding: 0 20px; background: var(--blue); color: #fff; font-weight: 800; }
.alphabet-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.alphabet-filter a { min-width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: #53647a; font-size: 11px; font-weight: 750; }
.alphabet-filter a:hover, .alphabet-filter a.active { border-color: var(--blue); background: var(--blue); color: #fff; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 28px; }
.pagination a { min-width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--navy); font-size: 12px; font-weight: 700; }
.pagination a.active, .pagination a:hover { border-color: var(--blue); background: var(--blue); color: #fff; }
.brand-heading-row { display: flex; align-items: center; gap: 20px; padding-block: 40px; }
.brand-logo-large { width: 76px; height: 76px; border-radius: 16px; font-size: 22px; }
.brand-heading-copy h1 { margin: 6px 0 6px; font-size: clamp(32px, 4vw, 46px); }
.brand-heading-copy p { color: var(--muted); margin: 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { color: var(--blue); }
.product-hero .container { padding-block: 38px; }
.product-hero-row { display: flex; justify-content: space-between; gap: 30px; align-items: end; margin-top: 16px; }
.key-card { min-width: 220px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 16px; box-shadow: var(--shadow); }
.key-card small { display: block; color: var(--muted); font-size: 11px; }
.key-card strong { display: block; margin: 5px 0 10px; color: var(--navy); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; }
.status-pill { display: inline-flex; align-items: center; width: max-content; border-radius: 999px; padding: 5px 9px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-online { background: var(--success-bg); color: var(--success); }
.status-warning { background: var(--warning-bg); color: var(--warning); }
.empty-state { padding: 36px; border: 1px dashed #bdcad7; border-radius: var(--radius); background: var(--surface-soft); text-align: center; }
.empty-state strong { display: block; color: var(--navy); font-size: 18px; }
.empty-state p { margin: 8px auto 0; max-width: 650px; color: var(--muted); font-size: 13px; }
.wide-empty { padding-block: 60px; }
.file-table-wrap, .admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.file-table, .admin-table { width: 100%; border-collapse: collapse; }
.file-table th, .admin-table th { padding: 12px 14px; background: var(--surface-soft); border-bottom: 1px solid var(--border); color: #5d6d80; font-size: 10px; letter-spacing: .05em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.file-table td, .admin-table td { padding: 14px; border-bottom: 1px solid #edf1f5; font-size: 12px; vertical-align: middle; }
.file-table tbody tr:last-child td, .admin-table tbody tr:last-child td { border-bottom: 0; }
.file-table td:first-child { max-width: 430px; }
.file-table td strong { display: block; color: var(--navy); overflow-wrap: anywhere; }
.file-table td small { display: block; margin-top: 4px; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border: 0; border-radius: 9px; padding: 0 16px; font-weight: 800; font-size: 12px; }
.button-primary { background: var(--blue); color: #fff; }
.button-ghost { border: 1px solid var(--border); background: #fff; color: var(--navy); }
.button-disabled { background: #edf2f6; color: #8794a4; cursor: not-allowed; white-space: nowrap; }
.button-full { width: 100%; }
.mobile-file-list { display: none; }
.search-page-form { margin-top: 22px; }
.search-results { display: grid; gap: 44px; }
.result-group { display: grid; gap: 0; }
.search-file-list { display: grid; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.search-file-list a { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; border-bottom: 1px solid var(--border); background: #fff; }
.search-file-list a:last-child { border-bottom: 0; }
.search-file-list a:hover { background: var(--surface-soft); }
.search-file-list strong { display: block; color: var(--navy); overflow-wrap: anywhere; }
.search-file-list small, .search-file-list > a > span { color: var(--muted); font-size: 11px; }
.error-page { min-height: 65vh; display: grid; place-items: center; text-align: center; background: #fff; }
.error-code { display: block; color: var(--blue); font-size: 72px; font-weight: 900; line-height: 1; }
.error-page h1 { margin: 10px 0; font-size: 36px; }
.error-page p { color: var(--muted); margin-bottom: 24px; }
.site-footer { padding-block: 34px; border-top: 1px solid var(--border); background: var(--navy); color: #dbe7f2; }
.footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.footer-grid strong { color: #fff; }
.footer-grid p { margin: 5px 0 0; color: #aebfd0; font-size: 12px; }
.footer-links { display: flex; gap: 20px; font-size: 12px; font-weight: 700; }
.footer-links a:hover { color: #fff; }

/* Admin */
.admin-body { background: #eef3f7; }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 245px 1fr; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; background: var(--navy); color: #fff; }
.admin-brand { padding: 0 8px 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.admin-brand strong { color: #fff; }
.admin-brand small { color: #a8bdd0; }
.admin-brand .brand-icon { background: #fff; color: var(--navy); }
.admin-sidebar nav { display: grid; gap: 5px; margin-top: 20px; }
.admin-sidebar nav a { padding: 11px 12px; border-radius: 8px; color: #c7d5e3; font-size: 13px; font-weight: 700; }
.admin-sidebar nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.sidebar-logout { margin-top: auto; }
.sidebar-logout .button { width: 100%; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.06); color: #fff; }
.admin-main { min-width: 0; }
.admin-topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 28px; border-bottom: 1px solid var(--border); background: #fff; }
.admin-topbar > div { display: grid; }
.admin-topbar small { color: var(--muted); font-size: 10px; }
.admin-topbar strong { color: var(--navy); }
.admin-content { padding: 28px; }
.admin-welcome { display: flex; justify-content: space-between; gap: 24px; align-items: start; margin-bottom: 22px; }
.admin-welcome h1 { margin: 6px 0 8px; font-size: 34px; }
.admin-welcome p { max-width: 760px; color: var(--muted); margin: 0; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.admin-stat { display: grid; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.admin-stat small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.admin-stat strong { color: var(--navy); font-size: 26px; line-height: 1; }
.admin-stat-link:hover { border-color: var(--blue); }
.admin-panel { margin-top: 18px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.panel-title-row { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 16px; }
.admin-table code { padding: 4px 7px; border-radius: 6px; background: #eef3f7; color: var(--navy); }
.panel-note { margin: 15px 0 0; color: var(--muted); font-size: 12px; }
.roadmap-panel { background: linear-gradient(120deg, #fff, #f4f8fc); }
.roadmap-panel p { margin: 8px 0 0; color: var(--muted); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #edf4f9, #fff); }
.auth-card { width: min(100%, 430px); padding: 30px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.auth-brand { margin-bottom: 28px; }
.auth-copy h1 { margin: 8px 0 8px; font-size: 32px; }
.auth-copy p { color: var(--muted); font-size: 13px; }
.form-stack { display: grid; gap: 15px; margin-top: 22px; }
.form-stack label { display: grid; gap: 7px; color: var(--navy); font-size: 12px; font-weight: 750; }
.form-stack input { height: 46px; border-radius: 9px; padding: 0 13px; }
.form-stack input:focus, .header-search input:focus, .hero-search input:focus, .filter-bar input:focus, .inline-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(25,118,210,.12); }
.alert { padding: 12px 14px; border-radius: 9px; font-size: 12px; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #f0c8c8; }
.auth-back { display: block; margin-top: 18px; text-align: center; }

@media (max-width: 1050px) {
    .header-search { width: 250px; }
    .brand-grid, .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .admin-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .header-row { min-height: 64px; flex-wrap: wrap; padding-block: 10px; }
    .nav-toggle { display: block; }
    .main-nav { display: none; order: 3; width: 100%; margin: 0; padding: 10px 0; border-top: 1px solid var(--border); }
    .main-nav.open { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .main-nav a { padding: 10px; border-radius: 8px; background: var(--surface-soft); }
    .header-search { display: none; }
    .hero-grid { grid-template-columns: 1fr; min-height: auto; gap: 28px; padding-block: 44px; }
    .hero-grid > div > p { font-size: 15px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card:nth-child(2) { border-right: 0; }
    .stat-card:nth-child(3), .stat-card:nth-child(4) { border-top: 1px solid var(--border); }
    .brand-grid, .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .section-block { padding-block: 42px; }
    .product-hero-row { align-items: stretch; flex-direction: column; }
    .key-card { min-width: 0; }
    .file-table-wrap { display: none; }
    .mobile-file-list { display: grid; gap: 10px; }
    .mobile-file-card { display: grid; gap: 10px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
    .mobile-file-card > strong { color: var(--navy); overflow-wrap: anywhere; }
    .mobile-file-card > div { display: flex; flex-wrap: wrap; gap: 7px 13px; color: var(--muted); font-size: 11px; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; height: auto; }
    .admin-sidebar nav { grid-template-columns: repeat(3, 1fr); }
    .sidebar-logout { margin-top: 15px; }
    .admin-topbar { padding: 14px 18px; }
    .admin-content { padding: 18px; }
}

@media (max-width: 560px) {
    .container { width: min(calc(100% - 22px), var(--container)); }
    h1 { font-size: 36px; }
    .hero-search { display: grid; box-shadow: none; }
    .hero-search input { border-radius: 10px; }
    .hero-search button { min-height: 48px; margin-top: 8px; border-radius: 10px; }
    .hero-links { gap: 10px; flex-direction: column; }
    .stats-grid { margin-inline: -11px; }
    .stat-card { padding: 18px 10px; }
    .stat-card strong { font-size: 23px; }
    .brand-grid, .product-grid { grid-template-columns: 1fr; }
    .brand-card { padding: 13px; }
    .product-card { min-height: 130px; }
    .section-heading { align-items: start; }
    .section-heading-stack-mobile { flex-direction: column; }
    .inline-search { width: 100%; margin-top: 0; }
    .brand-heading-row { align-items: flex-start; }
    .brand-logo-large { width: 62px; height: 62px; }
    .search-file-list a { align-items: flex-start; flex-direction: column; gap: 6px; }
    .footer-grid { align-items: flex-start; flex-direction: column; }
    .admin-sidebar nav { grid-template-columns: 1fr; }
    .admin-topbar { align-items: flex-start; }
    .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-welcome, .panel-title-row { flex-direction: column; }
    .admin-content { padding: 14px; }
    .admin-panel { padding: 14px; }
    .auth-card { padding: 22px; }
}
