:root {
  color-scheme: light;
  --canvas: #f4f8ff;
  --surface: #fff;
  --ink: #122642;
  --muted: #556a84;
  --line: #dee7f2;
  --blue: #245ac5;
  --blue-pale: #edf4ff;
  --shadow: 0 10px 36px #1c3d7220;
  font-family: "Noto Sans SC Variable", "PingFang SC", sans-serif;
}
@keyframes panel-in {
  from { opacity: .75; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); line-height: 1.6; font-size: 14px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .17em; }
button, input { font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #6d9afd; outline-offset: 3px; }
input[type=checkbox] { width: 16px; height: 16px; vertical-align: middle; accent-color: var(--blue); }
input:not([type=checkbox]):not([type=hidden]) { width: 100%; min-width: 0; border: 1px solid #cbd8e9; border-radius: 9px; padding: 10px 12px; background: white; color: var(--ink); }
.app-shell { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 100vh; }
.workspace { min-width: 0; }
.sidebar { border-right: 1px solid var(--line); background: linear-gradient(180deg,#fff 71%,#f8fbff); padding: 28px 17px; display: flex; flex-direction: column; position: sticky; top: 0; min-height: 100vh; height: fit-content; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 19px; font-weight: 750; color: var(--ink); line-height: 1.18; }
.sidebar .brand { margin: 0 8px 42px; }
.brand:hover { text-decoration: none; }
.brand-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; font-weight: 550; }
.brand-mark { display: block; width: 42px; height: 42px; background: transparent; object-fit: contain; flex: none; }
.nav-link { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; border-radius: 9px; margin-bottom: 5px; padding: 10px 12px; color: var(--muted); background: transparent; font-weight: 600; white-space: nowrap; }
.nav-link span { width: 20px; color: var(--blue); text-align: center; font-size: 18px; line-height: 1; }
.nav-icon { display: inline-block; width: 20px; height: 20px; flex: none; color: var(--blue); position: relative; }
.nav-icon::before, .nav-icon::after { content: ""; position: absolute; }
.nav-icon--collection::before { inset: 3px 4px 2px; border: 1.5px solid currentColor; border-radius: 3px; }
.nav-icon--collection::after { inset: 2px 7px auto; height: 4px; border: 1.5px solid currentColor; border-radius: 2px; background: #fff; box-shadow: 0 5px 0 -1px currentColor, 0 8px 0 -1px currentColor; }
.nav-icon--listings::before { inset: 4px 2px 2px; border: 1.5px solid currentColor; border-radius: 3px; }
.nav-icon--listings::after { inset: 7px 3px auto; height: 1.5px; background: currentColor; }
.nav-link:hover, .nav-link.is-current { color: var(--blue); background: var(--blue-pale); text-decoration: none; }
.nav-link.is-current { box-shadow: inset 3px 0 #477ddd; }
.sidebar-bottom { margin-top: auto; padding-top: 22px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(18px, 3vw, 44px); min-height: 64px; background: #fff; border-bottom: 1px solid var(--line); }
.breadcrumb { color: var(--muted); font-weight: 600; }
.account { display: flex; gap: 9px; align-items: center; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-pale); color: var(--blue); font-weight: 750; }
.content { max-width: 1560px; margin: 0 auto; padding: 24px clamp(18px, 3vw, 44px) 60px; }
.hero { border: 1px solid #d6e6fb; border-radius: 21px; background: radial-gradient(ellipse at 86% 2%, #d6e9ff 0, transparent 65%), linear-gradient(105deg,#fbfdff,#eff6ff); display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 146px; padding: 27px clamp(20px, 3vw, 38px); position: relative; isolation: isolate; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: -190px -100px auto auto; width: 420px; aspect-ratio: 1; border-radius: 50%; border: 1px solid #b7d2f6; box-shadow: 0 0 0 28px #c2dcfb61, 0 0 0 56px #daeafe99; z-index: -1; pointer-events: none; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(27px, 4vw, 37px); letter-spacing: -.032em; line-height: 1.27; overflow-wrap: anywhere; }
h2 { font-size: 17px; letter-spacing: -.012em; }
.hero p { color: var(--muted); margin-top: 8px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin: 17px 0 23px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); min-width: 0; border-radius: 15px; padding: 15px 19px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 5px 18px #213e6610; }
.stat-card i { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; background: #eaf3ff; color: #245ac5; font-size: 21px; font-style: normal; }
.stat-card span, .muted { color: var(--muted); }
.stat-card strong { display: block; font-size: clamp(20px, 3.5vw, 30px); font-variant-numeric: tabular-nums; line-height: 1.45; letter-spacing: -.04em; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 17px; margin-top: 18px; box-shadow: 0 6px 24px #27497110; overflow: hidden; }
.panel-heading { padding: 18px 20px; min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.search-form { display: flex; gap: 8px; align-items: center; width: min(100%, 400px); }
.button { display: inline-flex; justify-content: center; align-items: center; background: white; color: var(--ink); border: 1px solid transparent; border-radius: 9px; padding: 9px 13px; font-weight: 650; min-height: 38px; white-space: nowrap; }
.button:hover { text-decoration: none; filter: brightness(.97); }
.button, .nav-link, input, tr { transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { cursor: default; opacity: .5; }
.primary { background: var(--blue); color: white; }
.secondary { background: var(--blue-pale); color: var(--blue); border-color: #d9e6fc; }
.subtle { background: transparent; color: var(--muted); padding-inline: 8px; }
.table-scroll { overflow-x: auto; }
table { border-spacing: 0; width: 100%; text-align: center; }
td, th { padding: 12px 14px; border-top: 1px solid #e7eef6; }
td, th { text-align: center; vertical-align: middle; }
th { white-space: nowrap; background: #f7f9fd; font-size: 12px; font-weight: 700; color: #526782; }
tbody tr:hover { background: #f9fbff; }
.number, .time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.time { color: var(--muted); }
.product-link { display: flex; gap: 10px; align-items: center; min-width: 125px; font-weight: 660; overflow-wrap: anywhere; }
.product-link small, td small { display: block; margin-top: 3px; color: var(--muted); font-weight: 430; font-size: 11px; }
.source-link, .small-link { font-weight: 620; white-space: nowrap; }
.small-link { display: block; font-size: 11px; }
.records-table th, .records-table td { padding-inline: 10px; }
.intake-table { min-width: 570px; }
.product-table { min-width: 950px; }
.device-name { border: 0; background: transparent; border-radius: 7px; color: var(--blue); padding: 4px 7px; font-weight: 580; overflow-wrap: anywhere; }
.device-name:hover { background: var(--blue-pale); }
.row-actions, .selection-bar > div { display: flex; gap: 8px; align-items: center; justify-content: center; }
.thumb { display: block; width: 36px; height: 36px; border-radius: 7px; object-fit: cover; border: 1px solid var(--line); }
.empty { height: 140px; text-align: center; color: var(--muted); }
.status { display: inline-block; border-radius: 999px; padding: 3px 9px; background: #edf1f7; color: #4a5d75; font-size: 12px; font-weight: 650; white-space: nowrap; }
.status.accepted, .status.published { background: #e8f7ef; color: #176349; }
.status.duplicate, .status.review { background: #fff0db; color: #855107; }
.status.listed, .status.reserved { background: #eaf2ff; color: #184eab; }
.status.allowed { background: #e9f5ff; color: #174e9b; }
.status.rejected { background: #ffefef; color: #963c49; }
.status.manual { background: #f7effa; color: #78438d; }
.selection-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px 12px; color: var(--muted); font-size: 12px; }
.selection-bar label { display: inline-flex; align-items: center; gap: 6px; }
.selection-bar button { min-height: 34px; padding: 5px 10px; }
.row-delete:hover { color: #a42f3c; background: #fff0f0; }
.danger { background: #b63c48; color: #fff; }
.confirm-dialog { width: min(440px, 90vw); border: 1px solid var(--line); border-radius: 18px; padding: 24px; color: var(--ink); box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: #263e5b48; backdrop-filter: blur(3px); }
.confirm-dialog p { color: var(--muted); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast { padding: 11px 15px; border: 1px solid #c4e5d8; border-radius: 10px; background: #ebf8f1; color: #235c45; margin-bottom: 12px; }
.table-actions, .pagination { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.form-stack, .entry-form, form label { display: grid; gap: 8px; }
.form-stack { gap: 16px; }
.table-actions label { display: inline; }
.entry-form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 16px; padding: 0 20px 22px; }
.back-link { display: inline-block; margin-bottom: 13px; }
.detail-hero { justify-content: flex-start; }
.detail-hero .button { margin-left: auto; }
.detail-hero h1 { font-size: clamp(23px, 3vw, 33px); }
.hero-thumb { width: 82px; height: 82px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; padding: 0 20px 22px; margin: 0; }
.fields div { border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; padding: 0 20px 20px; }
.gallery img { display: block; width: 100%; aspect-ratio: 1; border-radius: 9px; object-fit: contain; border: 1px solid var(--line); background: #fafcff; }
.login-page { display: grid; justify-items: center; align-items: center; min-height: 100vh; padding: 30px; background: radial-gradient(ellipse at 18% 12%,#d8e9ff,transparent 52%), radial-gradient(ellipse at 95% 82%,#e6f1ff,transparent 62%), #f6f9ff; }
.login-frame { display: grid; grid-template-columns: 1.14fr 1fr; width: min(100%, 980px); min-height: 533px; background: white; border: 1px solid #e6eefb; border-radius: 29px; overflow: hidden; box-shadow: 0 30px 80px #12377225; }
.login-brand { position: relative; overflow: hidden; padding: 40px; background: radial-gradient(circle at 55% 44%,#f9fcff,#e2efff 60%,#d8eaff); color: var(--ink); display: grid; align-content: space-between; gap: 16px; }
.login-brand .brand, .login-intro { z-index: 1; }
.login-intro p { margin-top: 8px; color: var(--muted); }
.hero, .login-frame { animation: panel-in 160ms ease-out both; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 720; letter-spacing: .05em; margin-bottom: 6px; }
.login-art { position: relative; display: grid; place-items: center; min-height: 220px; isolation: isolate; }
.orbit { position: absolute; width: 205px; aspect-ratio: 1; border: 1px solid #bbd5f9; border-radius: 50%; box-shadow: 0 0 0 29px #c7defa46, 0 0 0 57px #f3f8ff8c, 0 0 0 60px #d2e7ff; z-index: -1; }
.login-logo { width: 186px; height: 168px; object-fit: contain; background: transparent; filter: drop-shadow(0 12px 18px #4075bb2b); }
.login-form { align-self: center; padding: clamp(27px, 5vw, 58px); }
.login-form h2 { font-size: 29px; line-height: 1.35; }
.login-help { color: var(--muted); margin: 9px 0 26px; }
.login-form .form-stack { gap: 12px; }
.login-form .form-stack label { font-weight: 610; }
.password-field { display: flex; align-items: center; position: relative; margin-top: -5px; }
.password-field input:not([type=hidden]) { padding-right: 56px; }
.password-field button { position: absolute; right: 4px; font-size: 12px; min-height: 33px; }
.sign-in { justify-content: space-between; width: 100%; margin-top: 9px; padding-inline: 14px; min-height: 45px; background: linear-gradient(105deg,#234fae,#2864d6); }
.alert { background: #fff0ed; color: #9b3f28; border-radius: 8px; margin-bottom: 12px; padding: 8px 10px; }
@media (max-width: 850px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; min-height: unset; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 18px; display: grid; gap: 10px; }
  .sidebar .brand { margin: 0; }
  .sidebar nav { overflow-x: auto; display: flex; gap: 2px; }
  .sidebar-bottom { padding: 0; }
  .sidebar-bottom .nav-link { width: auto; margin: 0; }
  .entry-form, .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 550px) {
  .hero { flex-wrap: wrap; min-height: auto; padding: 20px; }
  .stat-card { padding: 12px 8px; }
  .stats-grid { gap: 7px; }
  .stat-card span { font-size: 12px; }
  .login-frame { grid-template-columns: 1fr; }
  .login-brand, .login-form { padding: 24px; }
  .login-art { display: none; }
  .detail-hero .button { margin-left: 0; }
  .stat-card i { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
