:root {
  --ink: #20293a;
  --ink-soft: #697386;
  --paper: #f2f4f8;
  --surface: #ffffff;
  --surface-soft: #f6f7fa;
  --line: #e0e4eb;
  --line-strong: #cbd2dd;
  --brand: #39b98a;
  --brand-dark: #238263;
  --brand-pale: #e4f6ef;
  --navy: #22335d;
  --navy-soft: #2b4072;
  --amber: #ad6b11;
  --amber-pale: #fff0d6;
  --red: #b8443a;
  --red-pale: #fae5e2;
  --blue: #326aa5;
  --blue-pale: #e4edf8;
  --shadow: 0 12px 32px rgba(31, 45, 79, .14);
  --radius-sm: 3px;
  --radius: 4px;
  --radius-lg: 5px;
  --font-body: "Aptos", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: "Aptos Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; color: var(--ink); font-family: var(--font-body); background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--brand); }
[hidden] { display: none !important; }

.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; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 1000; padding: 12px 18px; color: white; background: var(--navy); border-radius: 0 0 8px 8px; }
.skip-link:focus { top: 0; }

.brand-mark { position: relative; display: inline-flex; align-items: end; gap: 3px; width: 30px; height: 30px; padding: 5px; border-radius: 9px; color: white; background: var(--brand); }
.brand-mark i { display: block; width: 4px; border-radius: 3px; background: currentColor; transform: skew(-14deg); }
.brand-mark i:nth-child(1) { height: 10px; opacity: .65; }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3) { height: 13px; opacity: .82; }

.button { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; font-weight: 700; letter-spacing: .01em; cursor: pointer; transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, .icon-button:focus-visible, .nav-item:focus-visible, .page-button:focus-visible { outline: 3px solid rgba(29, 144, 112, .3); outline-offset: 2px; }
.button:disabled { cursor: not-allowed; opacity: .56; transform: none; }
.button-primary { color: white; background: var(--brand); box-shadow: 0 8px 20px rgba(22, 119, 95, .17); }
.button-primary:hover { background: var(--brand-dark); box-shadow: 0 11px 24px rgba(22, 119, 95, .23); }
.button-secondary { color: var(--ink); background: white; border-color: var(--line-strong); }
.button-secondary:hover { border-color: var(--brand); }
.button-tertiary { color: var(--ink-soft); background: transparent; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px; color: var(--ink-soft); background: transparent; font-size: 24px; cursor: pointer; transition: background .16s ease, color .16s ease; }
.icon-button:hover { color: var(--ink); background: var(--surface-soft); }

.field { display: grid; gap: 8px; }
.field label { font-size: 14px; font-weight: 700; color: var(--ink); }
.field label span { color: var(--red); font-size: 12px; font-weight: 600; }
.field input, .field select, .compact-select select { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: white; outline: none; transition: border-color .16s ease, box-shadow .16s ease; }
.field input::placeholder { color: #96a09c; }
.field input:focus, .field select:focus, .compact-select select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22, 119, 95, .12); }
.field small { color: var(--ink-soft); line-height: 1.5; }
.section-kicker, .eyebrow { margin: 0 0 7px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .16em; }

/* Authentication */
.auth-page { min-height: 100vh; background: #e9eee7; }
.auth-shell { display: grid; grid-template-columns: minmax(440px, 47%) 1fr; min-height: 100vh; }
.auth-visual { position: relative; display: flex; flex-direction: column; min-height: 100vh; padding: 48px clamp(40px, 5.3vw, 84px); overflow: hidden; color: white; background: var(--navy); isolation: isolate; }
.auth-visual::before { content: ""; position: absolute; inset: 0; z-index: -2; opacity: .34; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(to bottom, black, transparent 90%); }
.auth-visual::after { content: ""; position: absolute; width: 620px; height: 620px; left: -220px; bottom: -300px; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(46,171,137,.22), transparent 68%); }
.auth-brand, .mobile-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 800; letter-spacing: .08em; }
.auth-copy { max-width: 580px; margin-top: clamp(90px, 14vh, 150px); }
.auth-copy .eyebrow { color: #78d0b6; }
.auth-copy h1 { margin: 0; font-family: var(--font-display); font-size: clamp(42px, 4.6vw, 70px); line-height: 1.08; letter-spacing: -.045em; }
.auth-copy > p:last-child { max-width: 470px; margin: 28px 0 0; color: #b9cdc7; font-size: 17px; line-height: 1.8; }
.auth-footnote { margin: auto 0 0; color: #86a39b; font-size: 13px; letter-spacing: .09em; }
.auth-orbit { position: absolute; width: 330px; height: 330px; right: -65px; bottom: 50px; opacity: .72; }
.orbit-ring { position: absolute; border: 1px solid rgba(146, 221, 199, .24); border-radius: 50%; }
.orbit-ring-a { inset: 38px; }
.orbit-ring-b { inset: 0; }
.orbit-core { position: absolute; inset: 104px; display: grid; place-items: center; border: 1px solid rgba(146, 221, 199, .45); border-radius: 50%; color: #c8eee2; background: rgba(22, 119, 95, .18); font-weight: 800; letter-spacing: .12em; backdrop-filter: blur(5px); }
.orbit-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #66c7aa; box-shadow: 0 0 18px #66c7aa; }
.dot-a { top: 42px; left: 85px; }.dot-b { right: 48px; top: 122px; }.dot-c { left: 56px; bottom: 58px; }
.auth-panel { position: relative; display: grid; place-items: center; min-height: 100vh; padding: 48px; background: var(--surface); }
.auth-form-wrap { width: min(100%, 420px); }
.mobile-brand { display: none; margin-bottom: 54px; color: var(--ink); }
.auth-heading { margin-bottom: 30px; }
.auth-heading h2 { margin: 0; font-family: var(--font-display); font-size: clamp(28px, 3vw, 38px); line-height: 1.2; letter-spacing: -.035em; }
.auth-heading > p:last-child { margin: 12px 0 0; color: var(--ink-soft); }
.auth-form { display: grid; gap: 20px; }
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.password-toggle { position: absolute; top: 4px; right: 5px; height: 40px; padding: 0 10px; border: 0; color: var(--brand); background: transparent; font-size: 13px; font-weight: 700; cursor: pointer; }
.auth-submit { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: 4px; padding-inline: 20px; }
.auth-switch { margin: 28px 0 0; text-align: center; color: var(--ink-soft); font-size: 14px; }
.auth-switch a { font-weight: 700; text-decoration: none; }
.auth-copyright { position: absolute; bottom: 26px; margin: 0; color: #9ba5a0; font-size: 12px; }
.auth-alerts { display: grid; gap: 8px; margin: -6px 0 20px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 9px; font-size: 14px; line-height: 1.45; }
.alert > span:first-child { display: grid; flex: none; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-weight: 800; }
.alert-error { color: #86342e; background: var(--red-pale); }.alert-error > span:first-child { color: white; background: var(--red); }
.alert-success { color: var(--brand-dark); background: var(--brand-pale); }.alert-success > span:first-child { color: white; background: var(--brand); }

/* App shell */
.app-page { min-width: 320px; background: var(--paper); }
.app-shell { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 26px 18px 20px; color: white; background: var(--navy); z-index: 30; }
.sidebar::after { content: ""; position: absolute; right: 0; bottom: 110px; width: 100%; height: 270px; pointer-events: none; opacity: .55; background: radial-gradient(circle at 100% 50%, rgba(52,166,135,.2), transparent 65%); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand > div { display: grid; gap: 2px; }
.sidebar-brand strong { font-size: 17px; letter-spacing: .08em; }
.sidebar-brand small { color: #91aaa3; font-size: 11px; }
.side-nav { display: grid; gap: 4px; margin-top: 22px; z-index: 1; }
.nav-label { margin: 16px 12px 7px; color: #6f8e86; font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 13px; border: 0; border-radius: 10px; color: #abc0ba; background: transparent; text-align: left; font-weight: 650; cursor: pointer; transition: color .16s ease, background .16s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: var(--navy-soft); }
.nav-item.active::before { content: ""; position: absolute; left: -18px; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: #50c8a5; }
.nav-icon { display: grid; place-items: center; width: 22px; height: 22px; color: #73b8a4; font-size: 20px; }
.sidebar-account { position: relative; margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); z-index: 3; }
.sidebar-user { display: grid; grid-template-columns: 40px minmax(0,1fr) 32px; align-items: center; gap: 10px; width: 100%; min-height: 64px; padding: 8px 6px; border: 0; border-radius: 12px; color: white; background: transparent; text-align: left; cursor: pointer; transition: background .16s ease; }
.sidebar-user:hover, .sidebar-user[aria-expanded="true"] { background: rgba(255,255,255,.065); }
.sidebar-user:focus-visible { outline: 3px solid rgba(80,200,165,.35); outline-offset: 2px; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--navy); background: #a5dbc9; font-weight: 800; }
.sidebar-user-meta { display: grid; gap: 3px; min-width: 0; }
.sidebar-user-meta strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-meta span { color: #86a49c; font-size: 11px; }
.account-menu-chevron { display: grid; place-items: center; width: 32px; height: 32px; color: #7ea198; font-size: 18px; transition: transform .18s ease, color .18s ease; }
.sidebar-user[aria-expanded="true"] .account-menu-chevron { color: #b3d2c9; transform: rotate(180deg); }
.account-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); display: grid; padding: 7px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: #173733; box-shadow: 0 16px 38px rgba(4,21,18,.36); animation: account-menu-in .16s ease-out; }
.account-menu::after { content: ""; position: absolute; right: 20px; bottom: -6px; width: 11px; height: 11px; border-right: 1px solid rgba(255,255,255,.12); border-bottom: 1px solid rgba(255,255,255,.12); background: #173733; transform: rotate(45deg); }
.account-menu form { margin: 0; padding-top: 5px; border-top: 1px solid rgba(255,255,255,.1); }
.account-menu-item { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 44px; padding: 0 11px; border: 0; border-radius: 8px; color: #d6e4e0; background: transparent; text-align: left; font-size: 13px; font-weight: 700; cursor: pointer; transition: color .14s ease, background .14s ease; }
.account-menu-item:hover, .account-menu-item:focus-visible { color: white; background: rgba(255,255,255,.075); outline: none; }
.account-menu-item > span:first-child { display: grid; place-items: center; width: 20px; color: #70bca6; font-size: 17px; }
.account-menu-logout { color: #d6beb9; }.account-menu-logout > span:first-child { color: #d5887d; }
@keyframes account-menu-in { from { opacity: 0; transform: translateY(6px); } }
.main-content { min-width: 0; padding: 0 34px 50px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 102px; gap: 24px; }
.topbar h1 { margin: 4px 0 0; font-family: var(--font-display); font-size: 28px; letter-spacing: -.03em; }
.breadcrumb { margin: 0; color: #8a9691; font-size: 12px; }.breadcrumb span { color: var(--ink-soft); }
.topbar-account { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #35a47f; box-shadow: 0 0 0 4px rgba(53,164,127,.12); }
.mobile-menu-button { display: none; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; }
.view-panel { animation: view-in .24s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { display: flex; align-items: center; gap: 16px; min-height: 126px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-icon { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-family: var(--font-display); font-size: 19px; font-weight: 800; }
.stat-total .stat-icon { color: var(--blue); background: var(--blue-pale); }.stat-valid .stat-icon { color: var(--brand); background: var(--brand-pale); }.stat-expiring .stat-icon { color: var(--amber); background: var(--amber-pale); }.stat-expired .stat-icon { color: var(--red); background: var(--red-pale); }
.stat-card > div:last-child { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 8px; }
.stat-card p { grid-column: 1 / -1; margin: 0 0 6px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.stat-card strong { font-family: var(--font-display); font-size: 27px; letter-spacing: -.04em; }
.stat-card span { color: #939d99; font-size: 10px; }
.data-section { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 26px 20px; }
.section-toolbar h2 { margin: 0; font-family: var(--font-display); font-size: 22px; letter-spacing: -.025em; }
.section-description { margin: 6px 0 0; color: var(--ink-soft); font-size: 13px; }
.table-toolbar { display: flex; align-items: center; gap: 12px; padding: 0 26px 18px; }
.search-box { display: flex; align-items: center; flex: 1; max-width: 480px; height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; color: #87928e; background: white; transition: border-color .16s ease, box-shadow .16s ease; }
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,119,95,.1); }
.search-box input { flex: 1; min-width: 0; height: 100%; margin-left: 8px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-box kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: #8b9691; background: var(--surface-soft); font-family: inherit; font-size: 10px; }
.compact-select { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; font-weight: 700; white-space: nowrap; }
.compact-select select { min-height: 44px; padding: 0 34px 0 12px; }
.table-frame { position: relative; min-height: 210px; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.data-table { width: 100%; min-width: 1120px; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.data-table th { position: sticky; top: 0; z-index: 2; height: 48px; padding: 0 14px; color: #6f7c77; background: #f5f7f3; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.data-table th:first-child, .data-table td:first-child { padding-left: 26px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 22px; }
.data-table td { height: 76px; padding: 10px 14px; border-bottom: 1px solid #edf0ec; vertical-align: middle; }
.data-table tbody tr { cursor: pointer; transition: background .14s ease; }
.data-table tbody tr:hover { background: #f8faf6; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.record-id { color: var(--brand-dark); font-weight: 800; font-variant-numeric: tabular-nums; }
.brand-cell { display: grid; gap: 4px; min-width: 130px; }.brand-cell strong { font-size: 14px; }.brand-cell span { color: var(--ink-soft); font-size: 11px; }
.double-line { display: grid; gap: 4px; min-width: 150px; }.double-line span:last-child { color: var(--ink-soft); font-size: 11px; }
.cell-muted { color: #7c8984; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-valid { color: var(--brand-dark); background: var(--brand-pale); }.status-expiring { color: #8a5710; background: var(--amber-pale); }.status-expired { color: #973930; background: var(--red-pale); }
.date-cell { display: grid; gap: 6px; min-width: 105px; }.date-cell time { font-variant-numeric: tabular-nums; }
.meta-cell { display: grid; gap: 4px; min-width: 120px; }.meta-cell span:last-child { color: var(--ink-soft); font-size: 11px; }
.cover-wrap { position: relative; width: 46px; height: 46px; }
.cover-thumb { display: block; width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: var(--surface-soft); }
.image-count { position: absolute; right: -7px; bottom: -5px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 2px solid white; border-radius: 999px; color: white; background: var(--navy); font-size: 9px; font-weight: 800; }
.row-action { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-soft); background: white; cursor: pointer; }
.row-action:hover { color: var(--brand); border-color: var(--brand); }
.table-loading { display: grid; gap: 16px; padding: 24px; }
.skeleton-row { height: 48px; border-radius: 8px; background: linear-gradient(90deg, #edf0ec 25%, #f7f8f5 50%, #edf0ec 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state { display: grid; justify-items: center; padding: 60px 24px; text-align: center; }
.empty-illustration { display: grid; place-items: center; width: 62px; height: 62px; margin-bottom: 14px; border-radius: 18px; color: var(--brand); background: var(--brand-pale); font-size: 28px; }
.empty-state h3 { margin: 0; font-size: 18px; }.empty-state p { max-width: 430px; margin: 9px 0 22px; color: var(--ink-soft); line-height: 1.6; }
.table-footer { display: flex; align-items: center; justify-content: space-between; min-height: 66px; padding: 10px 26px; }
.table-footer p { color: var(--ink-soft); font-size: 12px; }
.pagination, #page-numbers { display: flex; align-items: center; gap: 5px; }
.page-button { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); background: white; cursor: pointer; }
.page-button:hover:not(:disabled) { color: var(--brand); border-color: var(--brand); }.page-button.active { color: white; border-color: var(--brand); background: var(--brand); }.page-button:disabled { cursor: default; opacity: .35; }
.user-section { margin-top: 2px; }.users-table { min-width: 960px; }.user-identity { display: flex; align-items: center; gap: 10px; }.user-mini-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--navy); background: var(--brand-pale); font-weight: 800; }.role-badge { display: inline-flex; padding: 5px 9px; border-radius: 7px; color: var(--blue); background: var(--blue-pale); font-size: 11px; font-weight: 800; }.role-badge.user { color: var(--brand-dark); background: var(--brand-pale); }.user-actions { display: flex; gap: 6px; }.small-button { min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 11px; font-weight: 700; cursor: pointer; }.small-button:hover { border-color: var(--brand); color: var(--brand); }.small-button.danger:hover { border-color: var(--red); color: var(--red); }

/* Modal and drawer */
.modal-layer, .credential-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop, .drawer-backdrop { position: absolute; inset: 0; background: rgba(9, 27, 24, .54); backdrop-filter: blur(3px); animation: fade-in .18s ease; }
@keyframes fade-in { from { opacity: 0; } }
.modal { position: relative; width: min(100%, 500px); max-height: calc(100vh - 40px); overflow: auto; border-radius: 18px; background: white; box-shadow: var(--shadow); animation: modal-in .2s ease-out; }
.modal-wide { width: min(100%, 760px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.99); } }
.modal-header, .drawer-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 26px 18px; border-bottom: 1px solid var(--line); }
.modal-header h2, .drawer-header h2 { margin: 0; font-family: var(--font-display); font-size: 22px; }
.modal-form { display: grid; gap: 18px; padding: 24px 26px 0; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin: 24px -26px 0; padding: 18px 26px; border-top: 1px solid var(--line); }
.import-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 24px 26px 18px; }
.import-step { display: grid; grid-template-columns: 35px 1fr; gap: 10px; min-width: 0; }
.step-number { color: var(--brand); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.import-step h3 { margin: 0; font-size: 15px; }.import-step p { margin: 6px 0 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.file-drop { display: grid; justify-items: center; gap: 5px; min-height: 150px; padding: 24px 15px; border: 1px dashed #aebbb4; border-radius: 12px; background: #f8faf7; text-align: center; cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.file-drop:hover { border-color: var(--brand); background: #f1f8f4; }.file-drop input { position: absolute; opacity: 0; pointer-events: none; }.file-drop-icon { color: var(--brand); font-size: 28px; }.file-drop strong { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }.file-drop small { color: #8c9893; font-size: 10px; }
.image-picker-alt { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: #8c94a2; font-size: 11px; }
.folder-picker { display: inline-flex; align-items: center; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--brand-dark); background: white; font-size: 11px; font-weight: 700; cursor: pointer; }
.folder-picker:hover { border-color: var(--brand); }
.folder-picker input { position: absolute; opacity: 0; pointer-events: none; }
.image-selection-summary { max-width: 310px; margin: 9px 0 0 !important; overflow: hidden; color: #566176 !important; font-size: 10px !important; text-overflow: ellipsis; white-space: nowrap; }
.text-link { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700; text-decoration: none; }
.naming-rule { display: grid; grid-template-columns: 42px 1fr; gap: 12px; margin: 0 26px; padding: 15px; border-radius: 11px; color: #43514c; background: var(--surface-soft); }
.rule-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--brand-dark); background: white; font-size: 12px; font-weight: 900; }.naming-rule strong { font-size: 12px; }.naming-rule p { margin: 5px 0 0; font-size: 11px; }.naming-rule code { color: var(--brand-dark); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }.naming-rule small { display: block; margin-top: 7px; color: #78857f; line-height: 1.5; }
.form-errors { max-height: 170px; margin: 16px 26px 0; padding: 13px 15px; overflow: auto; border-radius: 9px; color: #86342e; background: var(--red-pale); font-size: 12px; line-height: 1.65; }.form-errors strong { display: block; margin-bottom: 5px; }.form-errors ul { margin: 0; padding-left: 20px; }
#import-form > .modal-footer { margin: 24px 0 0; }
.inline-error { padding: 11px 13px; border-radius: 8px; color: #91372f; background: var(--red-pale); font-size: 13px; }
.detail-drawer { position: fixed; inset: 0; z-index: 90; visibility: hidden; pointer-events: none; }
.detail-drawer.open { visibility: visible; pointer-events: auto; }
.drawer-panel { position: absolute; top: 0; right: 0; width: min(100%, 520px); height: 100%; overflow: auto; background: white; transform: translateX(100%); transition: transform .24s ease-out; box-shadow: -18px 0 50px rgba(17,39,33,.15); }
.detail-drawer.open .drawer-panel { transform: translateX(0); }
.drawer-content { padding: 24px 26px 40px; }
.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }.detail-hero h3 { margin: 5px 0; font-size: 25px; letter-spacing: -.03em; }.detail-id { color: var(--brand); font-size: 11px; font-weight: 900; letter-spacing: .08em; }.detail-code { color: var(--ink-soft); font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; margin: 24px 0; }.detail-field { display: grid; gap: 5px; }.detail-field span { color: #84908b; font-size: 11px; }.detail-field strong { font-size: 13px; line-height: 1.45; }
.detail-images h4 { margin: 26px 0 12px; font-size: 13px; }.image-gallery { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }.gallery-item { position: relative; display: block; aspect-ratio: 4/3; overflow: hidden; border-radius: 12px; background: var(--surface-soft); }.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }.gallery-item:hover img { transform: scale(1.025); }.gallery-item span { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 4px 7px; overflow: hidden; border-radius: 5px; color: white; background: rgba(9,29,24,.72); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }.detail-empty-images { padding: 24px; border-radius: 10px; color: var(--ink-soft); background: var(--surface-soft); text-align: center; font-size: 12px; }
.detail-loading { padding: 80px 0; color: var(--ink-soft); text-align: center; }
.credential-modal { padding: 32px; text-align: center; }.credential-check { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 16px; border-radius: 50%; color: white; background: var(--brand); font-size: 22px; font-weight: 800; }.credential-modal h2 { margin: 0; font-size: 23px; }.credential-modal > p { margin: 9px auto 22px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }.credential-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; text-align: left; }.credential-grid > div { display: grid; gap: 6px; padding: 13px; border-radius: 10px; background: var(--surface-soft); }.credential-grid span { color: var(--ink-soft); font-size: 10px; }.credential-grid strong { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }.credential-modal .button { width: 100%; margin-top: 8px; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 150; display: grid; gap: 9px; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; box-shadow: 0 12px 34px rgba(21,42,36,.17); animation: toast-in .2s ease-out; font-size: 13px; }.toast::before { content: "✓"; display: grid; flex: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: white; background: var(--brand); font-size: 11px; font-weight: 800; }.toast.error::before { content: "!"; background: var(--red); }.toast button { margin-left: auto; border: 0; color: var(--ink-soft); background: transparent; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Reference-inspired enterprise dashboard */
.app-page { background: var(--paper); }
.app-shell { grid-template-columns: 210px minmax(0, 1fr); }
.sidebar { padding: 0 14px 18px; background: var(--navy); }
.sidebar::after { display: none; }
.sidebar-brand { min-height: 64px; padding: 0 10px; border-bottom-color: rgba(255,255,255,.09); }
.sidebar-brand .brand-mark { width: 27px; height: 27px; padding: 5px; border-radius: 3px; background: var(--brand); }
.sidebar-brand strong { font-size: 15px; letter-spacing: .08em; }
.sidebar-brand small { color: #92a0c3; font-size: 10px; }
.side-nav { gap: 2px; margin-top: 15px; }
.nav-label { margin: 13px 12px 7px; color: #7f8eb5; font-size: 9px; letter-spacing: .14em; }
.nav-item { min-height: 40px; padding: 0 11px; border-radius: 3px; color: #b8c2dc; font-size: 12px; font-weight: 600; }
.nav-item:hover { background: rgba(255,255,255,.055); }
.nav-item.active { color: white; background: rgba(255,255,255,.09); }
.nav-item.active::before { left: -14px; width: 3px; height: 40px; border-radius: 0; background: var(--brand); }
.nav-icon { width: 18px; height: 18px; color: #73d3b0; font-size: 15px; }
.sidebar-account { padding-top: 10px; border-top-color: rgba(255,255,255,.1); }
.sidebar-user { grid-template-columns: 34px minmax(0,1fr) 24px; min-height: 54px; padding: 7px 6px; border-radius: 3px; }
.avatar { width: 34px; height: 34px; border-radius: 3px; color: #1f315a; background: #7dd8b7; font-size: 13px; }
.sidebar-user-meta strong { font-size: 12px; }
.sidebar-user-meta span { color: #8f9dc0; font-size: 10px; }
.account-menu { bottom: calc(100% + 7px); padding: 5px; border-color: rgba(255,255,255,.1); border-radius: 3px; background: #2b3d69; box-shadow: 0 10px 26px rgba(10,19,43,.32); }
.account-menu::after { background: #2b3d69; }
.account-menu-item { min-height: 39px; border-radius: 2px; color: #dce3f2; font-size: 12px; }

.main-content { padding: 0; background: var(--paper); }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 64px; padding: 0 24px; gap: 18px; border-bottom: 1px solid var(--line); background: white; box-shadow: 0 1px 4px rgba(27,42,75,.035); }
.topbar h1 { margin-top: 2px; font-size: 20px; letter-spacing: -.015em; }
.breadcrumb { font-size: 10px; }
.topbar-account { color: #4e5970; font-size: 12px; font-weight: 600; }
.status-dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(57,185,138,.12); }
.view-panel { padding: 22px 24px 40px; animation: none; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 4px; background: white; overflow: hidden; }
.stat-card { display: flex; align-items: center; gap: 12px; min-height: 92px; padding: 16px 20px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; }
.stat-card:last-child { border-right: 0; }
.stat-indicator { flex: none; width: 3px; height: 34px; background: #4d72b8; }
.stat-valid .stat-indicator { background: var(--brand); }
.stat-expiring .stat-indicator { background: #d9a441; }
.stat-expired .stat-indicator { background: #ce6b63; }
.stat-card > div:last-child { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 8px; }
.stat-card p { grid-column: 1 / -1; margin: 0 0 4px; color: #768095; font-size: 11px; font-weight: 600; }
.stat-card strong { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.stat-card span:not(.stat-indicator) { color: #9aa2b2; font-size: 9px; }

.data-section { border-color: var(--line); border-radius: 4px; box-shadow: 0 1px 2px rgba(25,39,70,.025); }
.section-toolbar { padding: 19px 20px 15px; }
.section-toolbar h2 { font-size: 18px; letter-spacing: -.01em; }
.section-kicker { margin-bottom: 5px; color: var(--brand-dark); font-size: 9px; letter-spacing: .08em; }
.section-description { margin-top: 4px; color: #7b8497; font-size: 11px; }
.button { min-height: 38px; padding: 0 14px; border-radius: 3px; font-size: 12px; font-weight: 650; transition: background .14s ease, border-color .14s ease; }
.button:hover { transform: none; }
.button-primary { background: #2d4a80; box-shadow: none; }
.button-primary:hover { background: #233e70; box-shadow: none; }
.table-toolbar { padding: 0 20px 14px; }
.search-box { max-width: 430px; height: 38px; padding: 0 10px; border-radius: 3px; font-size: 12px; }
.search-box:focus-within { box-shadow: 0 0 0 2px rgba(57,185,138,.1); }
.search-box kbd { border-radius: 2px; background: #f3f5f8; }
.compact-select { font-size: 11px; font-weight: 600; }
.compact-select select { min-height: 38px; padding: 0 30px 0 10px; border-radius: 3px; font-size: 12px; }
.table-frame { border-color: var(--line); scrollbar-color: #bcc5d3 #f3f5f8; scrollbar-width: thin; }
.table-frame::-webkit-scrollbar { height: 9px; }
.table-frame::-webkit-scrollbar-track { background: #f3f5f8; }
.table-frame::-webkit-scrollbar-thumb { border: 2px solid #f3f5f8; border-radius: 8px; background: #bcc5d3; }
.data-table { min-width: 1760px; font-size: 12px; }
.data-table th { height: 42px; padding: 0 12px; color: #687387; background: #f6f7fa; border-color: #dfe3ea; font-size: 10px; font-weight: 700; letter-spacing: .01em; }
.data-table th:first-child, .data-table td:first-child { padding-left: 20px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 18px; }
.data-table td { height: 64px; padding: 8px 12px; border-color: #edf0f4; }
.data-table tbody tr:hover { background: #f7faf9; }
.record-id { color: #315489; font-weight: 700; }
.brand-code { color: #3f4e67; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-variant-numeric: tabular-nums; }
.brand-cell { min-width: 120px; }
.brand-cell strong { font-size: 12px; }
.double-line { min-width: 120px; }
.date-cell { min-width: 100px; gap: 5px; }
.status-badge { gap: 4px; padding: 3px 6px; border-radius: 2px; font-size: 9px; }
.status-badge::before { width: 4px; height: 4px; }
.cover-wrap, .cover-thumb { width: 40px; height: 40px; }
.cover-thumb { border: 1px solid var(--line); border-radius: 2px; }
.image-count { right: -6px; bottom: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-width: 1px; border-radius: 8px; background: #2d416d; font-size: 8px; }
.row-action { width: 30px; height: 30px; border-radius: 2px; font-size: 12px; }
.table-footer { min-height: 56px; padding: 8px 20px; }
.page-button { min-width: 30px; height: 30px; border-radius: 2px; font-size: 11px; }
.page-button.active { border-color: #2d4a80; background: #2d4a80; }
.user-section { margin-top: 0; }
.users-table { min-width: 980px; }
.user-mini-avatar, .role-badge, .small-button { border-radius: 3px; }

.modal-backdrop, .drawer-backdrop { background: rgba(20,29,51,.5); backdrop-filter: none; }
.modal { border: 1px solid #d7dce5; border-radius: 5px; }
.modal-header, .drawer-header { padding: 20px 22px 15px; }
.modal-header h2, .drawer-header h2 { font-size: 19px; }
.modal-form { padding: 20px 22px 0; }
.modal-footer { margin: 22px -22px 0; padding: 15px 22px; }
.field input, .field select { min-height: 42px; border-radius: 3px; }
.import-steps { padding: 21px 22px 16px; }
.file-drop { min-height: 132px; border-radius: 3px; background: #f8f9fb; }
.naming-rule { margin: 0 22px; border-radius: 3px; }
.rule-icon { border-radius: 2px; }
#import-form > .modal-footer { margin-top: 21px; }
.drawer-panel { box-shadow: -10px 0 30px rgba(24,37,67,.14); }
.gallery-item { border-radius: 3px; }
.toast { border-radius: 3px; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat-card { min-height: 88px; }
  .stat-card:nth-child(2) { border-right: 0; }
  .stat-card:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .auth-orbit { right: -130px; }
}

@media (max-width: 820px) {
  .auth-shell { display: block; }.auth-visual { display: none; }.auth-panel { padding: 42px 24px 80px; }.mobile-brand { display: flex; }.auth-copyright { bottom: 20px; }
  .app-shell { display: block; }.sidebar { position: fixed; left: 0; width: 220px; transform: translateX(-100%); transition: transform .22s ease-out; box-shadow: 14px 0 35px rgba(15,27,57,.22); }.sidebar.open { transform: translateX(0); }.main-content { padding: 0; }.mobile-menu-button { display: inline-grid; place-items: center; flex: none; }.topbar { justify-content: flex-start; min-height: 64px; }.topbar-account { margin-left: auto; }.topbar-account > span:nth-child(2) { display: none; }.view-panel { padding: 16px; }.section-toolbar, .table-toolbar { padding-inline: 18px; }.table-footer { padding-inline: 18px; }
}

@media (max-width: 600px) {
  .topbar { padding-inline: 16px; }.topbar h1 { font-size: 18px; }.breadcrumb { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }.stat-card { display: flex; gap: 10px; min-height: 82px; padding: 13px; }.stat-card > div:last-child { display: block; }.stat-card strong { display: block; font-size: 21px; }.stat-card span:not(.stat-indicator) { display: block; margin-top: 2px; }.stat-indicator { height: 28px; }
  .section-toolbar { align-items: flex-start; }.section-toolbar .button { padding-inline: 12px; white-space: nowrap; }.table-toolbar { align-items: stretch; flex-direction: column; }.search-box { max-width: none; }.compact-select { justify-content: space-between; }.compact-select select { width: auto; flex: 1; }
  .table-footer { align-items: flex-start; flex-direction: column; gap: 8px; }.pagination { width: 100%; justify-content: center; }
  .folder-picker { min-height: 44px; }
  .import-steps { grid-template-columns: 1fr; }.modal-layer { padding: 0; place-items: end center; }.modal { width: 100%; max-height: 92vh; border-radius: 5px 5px 0 0; }.modal-wide { width: 100%; }.naming-rule { margin-inline: 20px; }.modal-header, .drawer-header { padding-inline: 20px; }.modal-form { padding-inline: 20px; }.modal-footer { margin-inline: -20px; padding-inline: 20px; }.credential-layer { padding: 16px; }.credential-modal { border-radius: 5px; }.credential-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; gap: 14px; }.drawer-content { padding-inline: 20px; }.image-gallery { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
