:root {
  --ink: #142033;
  --muted: #718096;
  --line: #e7ebf1;
  --surface: #fff;
  --canvas: #f4f6f9;
  --nav: #07111f;
  --nav-soft: #101d2e;
  --blue: #2864dc;
  --blue-dark: #184bb6;
  --green: #0d9f72;
  --amber: #e69219;
  --red: #dc4c5a;
  --violet: #7958d6;
  --shadow-sm: 0 2px 10px rgba(31, 45, 67, .045);
  --shadow-md: 0 18px 45px rgba(31, 45, 67, .11);
  --radius: 18px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: 250px; padding: 27px 18px 19px;
  display: flex; flex-direction: column; color: #c8d2df; overflow: hidden;
  background:
    radial-gradient(circle at 10% 5%, rgba(61, 106, 180, .2), transparent 28%),
    linear-gradient(155deg, #0b1728 0%, #06101d 62%, #081423 100%);
}
.sidebar::after { content: ""; position: absolute; width: 220px; height: 220px; right: -140px; bottom: 80px; border: 1px solid rgba(255,255,255,.04); border-radius: 50%; box-shadow: 0 0 0 38px rgba(255,255,255,.018), 0 0 0 78px rgba(255,255,255,.012); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; border-bottom: 1px solid rgba(255,255,255,.075); }
.brand-mark, .mobile-brand span { width: 42px; height: 42px; display: grid; place-items: center; color: #dce8ff; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; background: linear-gradient(145deg, rgba(56,108,211,.5), rgba(38,72,136,.25)); box-shadow: inset 0 1px rgba(255,255,255,.15), 0 8px 22px rgba(0,0,0,.18); }
.brand-mark svg { font-size: 22px; }
.brand strong { display: block; color: #f6f9ff; font-size: 16px; letter-spacing: .03em; }
.brand span { display: block; margin-top: 4px; color: #687992; font-size: 9px; font-weight: 700; letter-spacing: .18em; }
.nav-list { display: grid; gap: 7px; margin-top: 28px; }
.nav-link { position: relative; width: 100%; height: 48px; padding: 0 13px; display: flex; align-items: center; gap: 13px; color: #8190a5; border: 0; border-radius: 13px; background: transparent; text-align: left; font-size: 14px; font-weight: 600; transition: color .22s ease, background .22s ease, transform .22s ease; }
.nav-link svg { font-size: 19px; transition: transform .28s cubic-bezier(.2,.8,.2,1); }
.nav-link:hover { color: #dce6f5; background: rgba(255,255,255,.045); transform: translateX(2px); }
.nav-link:hover svg { transform: scale(1.09); }
.nav-link.active { color: #fff; background: linear-gradient(100deg, rgba(46,104,218,.96), rgba(45,92,181,.7)); box-shadow: 0 10px 28px rgba(18, 67, 156, .3), inset 0 1px rgba(255,255,255,.12); }
.nav-link.active::before { content: ""; position: absolute; left: -18px; width: 3px; height: 24px; border-radius: 0 4px 4px 0; background: #71a3ff; box-shadow: 0 0 15px #4c89ff; }
.nav-link b { min-width: 21px; margin-left: auto; padding: 2px 6px; color: #eaf1ff; border-radius: 20px; background: rgba(255,255,255,.12); text-align: center; font-size: 10px; }
.sidebar-note { margin: auto 8px 18px; padding: 13px; display: flex; align-items: flex-start; gap: 10px; border: 1px solid rgba(255,255,255,.07); border-radius: 13px; background: rgba(255,255,255,.025); }
.pulse-dot { position: relative; width: 8px; height: 8px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: #33d39b; box-shadow: 0 0 0 4px rgba(51,211,155,.1); }
.pulse-dot::after { content: ""; position: absolute; inset: -4px; border: 1px solid #33d39b; border-radius: 50%; animation: pulse 2s infinite; }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { color: #afbdd0; font-size: 11px; }
.sidebar-note small { margin-top: 4px; color: #65758b; font-size: 9px; }
.account-card { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 12px 9px 0; border-top: 1px solid rgba(255,255,255,.075); }
.avatar { width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; color: #90a9d2; border: 1px solid rgba(255,255,255,.09); border-radius: 11px; background: #122238; }
.avatar svg { font-size: 17px; }
.account-copy { min-width: 0; flex: 1; }
.account-copy strong, .account-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { color: #dce5f1; font-size: 12px; }
.account-copy span { margin-top: 3px; color: #617189; font-size: 10px; }

.workspace { min-height: 100vh; margin-left: 250px; }
.main-content { width: min(1500px, 100%); min-height: 100vh; margin: 0 auto; padding: 37px 38px 24px; }
.mobile-header, .mobile-nav { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 27px; animation: reveal .45s ease both; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: #93a0b2; font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.eyebrow span { width: 18px; height: 2px; background: var(--blue); }
.page-head h1 { margin: 7px 0 5px; color: #111d30; font-size: clamp(26px, 2.2vw, 36px); line-height: 1.12; letter-spacing: -.04em; }
.page-head p { max-width: 620px; margin: 0; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; gap: 10px; }

.button { min-height: 40px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); font-size: 12px; font-weight: 700; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button svg { font-size: 15px; }
.button:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(37,48,71,.1); }
.button:active { transform: translateY(0) scale(.98); }
.button.primary { color: #fff; border-color: var(--blue); background: linear-gradient(135deg, #326de0, #1e55c2); box-shadow: 0 8px 20px rgba(40,100,220,.22); }
.button.primary:hover { background: linear-gradient(135deg, #3b76e8, #1b4fb7); box-shadow: 0 12px 25px rgba(40,100,220,.3); }
.button.danger { color: #fff; border-color: var(--red); background: var(--red); }
.button.ghost { color: #526075; }
.button.small { min-height: 31px; padding: 0 10px; border-radius: 9px; font-size: 11px; box-shadow: none; }
.button.success { color: #087c59; border-color: #c8eddf; background: #edfaf5; }
.button.warning { color: #a86105; border-color: #f5deb8; background: #fff7e8; }
.button.soft-danger { color: #b63141; border-color: #f4cdd2; background: #fff2f3; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.icon-button { width: 35px; height: 35px; padding: 0; display: grid; place-items: center; color: #7a8799; border: 1px solid transparent; border-radius: 10px; background: transparent; transition: background .2s ease, color .2s ease, transform .2s ease; }
.icon-button:hover { color: var(--blue); background: #edf3ff; transform: rotate(3deg); }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { --accent: var(--blue); position: relative; min-height: 130px; padding: 20px; overflow: hidden; border: 1px solid rgba(224,229,237,.9); border-radius: var(--radius); background: rgba(255,255,255,.92); box-shadow: var(--shadow-sm); animation: card-in .48s cubic-bezier(.2,.8,.2,1) both; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.stat-card:nth-child(2) { animation-delay: .05s; }.stat-card:nth-child(3) { animation-delay: .1s; }.stat-card:nth-child(4) { animation-delay: .15s; }
.stat-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 24%, white); box-shadow: 0 16px 36px rgba(31,45,67,.09); }
.stat-card::after { content: ""; position: absolute; right: -34px; bottom: -48px; width: 110px; height: 110px; border: 18px solid color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 50%; transition: transform .4s ease; }
.stat-card:hover::after { transform: scale(1.16) rotate(12deg); }
.stat-card.violet { --accent: var(--violet); }.stat-card.green { --accent: var(--green); }.stat-card.amber { --accent: var(--amber); }
.stat-card > span { display: block; margin-bottom: 7px; color: #78869a; font-size: 11px; font-weight: 650; }
.stat-card > strong { display: block; color: #182337; font-size: 30px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-card > small { display: block; margin-top: 10px; color: #a0abb9; font-size: 9px; }
.stat-icon { position: absolute; top: 17px; right: 17px; width: 34px; height: 34px; display: grid; place-items: center; color: var(--accent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 9%, white); }
.stat-icon svg { font-size: 17px; }

.content-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); animation: reveal .5s .1s ease both; }
.panel-toolbar { min-height: 70px; padding: 14px 17px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.search-box { min-width: 240px; max-width: 420px; flex: 1; height: 40px; padding: 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid #e2e7ee; border-radius: 11px; background: #f8fafc; transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.search-box:focus-within { border-color: #9ab8f0; background: #fff; box-shadow: 0 0 0 3px rgba(40,100,220,.08); }
.search-box svg { flex: 0 0 auto; color: #9aa6b5; font-size: 16px; }
.search-box input { width: 100%; height: 100%; padding: 0; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #a5afbc; }
.filter-group { display: flex; align-items: center; gap: 8px; }
select { height: 38px; padding: 0 32px 0 12px; color: #536176; border: 1px solid #e2e7ee; border-radius: 10px; outline: 0; background: #fff; font-size: 11px; transition: border .2s ease, box-shadow .2s ease; }
select:focus { border-color: #9ab8f0; box-shadow: 0 0 0 3px rgba(40,100,220,.07); }
.segmented { height: 38px; padding: 3px; display: flex; border: 1px solid #e2e7ee; border-radius: 10px; background: #f5f7fa; }
.segmented button { min-width: 57px; padding: 0 9px; color: #8995a5; border: 0; border-radius: 7px; background: transparent; font-size: 10px; font-weight: 700; }
.segmented button.active { color: #285dc1; background: #fff; box-shadow: 0 2px 7px rgba(31,45,67,.1); }
.refresh-button { border-color: var(--line); background: #fff; }
.refresh-button.loading svg { animation: spin .7s linear infinite; }
.content-stage { min-height: 390px; }

.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.data-table th { height: 43px; padding: 0 13px; color: #8a96a7; border-bottom: 1px solid var(--line); background: #fafbfc; text-align: left; font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.data-table td { height: 67px; padding: 10px 13px; border-bottom: 1px solid #eef1f5; color: #526075; font-size: 11px; vertical-align: middle; }
.data-table tbody tr { transition: background .18s ease, transform .18s ease; }
.data-table tbody tr:hover { background: #f9fbff; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.cell-primary { color: #1a273b; font-size: 12px; font-weight: 750; }
.cell-secondary { display: block; margin-top: 4px; color: #9aa5b3; font-size: 9px; }
.cell-actions { display: flex; justify-content: flex-end; gap: 5px; }
.quantity { color: #1e2c41; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 20px; font-size: 9px; font-weight: 750; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px currentColor; opacity: .75; }
.status.in { color: #087b59; background: #eaf8f3; }.status.out { color: #b46d0a; background: #fff5e3; }.status.new { color: #315fbd; background: #edf3ff; }.status.return { color: #7850bd; background: #f5efff; }
.thumbs { display: flex; align-items: center; }
.thumb { width: 34px; height: 34px; margin-right: -7px; object-fit: cover; border: 2px solid #fff; border-radius: 9px; background: #edf0f4; box-shadow: 0 2px 7px rgba(31,45,67,.12); transition: transform .2s ease, z-index .2s; cursor: zoom-in; }
.thumb:hover { position: relative; z-index: 2; transform: translateY(-3px) scale(1.08); }
.photo-count, .no-photo { margin-left: 10px; color: #9ba6b4; font-size: 9px; }
.no-photo { margin-left: 0; display: inline-flex; align-items: center; gap: 5px; }
.no-photo svg { font-size: 14px; }
.mobile-cards { display: none; }

.record-list { padding: 4px 18px 12px; }
.record-row { display: grid; grid-template-columns: 40px minmax(160px, 1.1fr) minmax(130px,.7fr) minmax(130px,.7fr) auto; gap: 12px; align-items: center; min-height: 69px; padding: 8px 4px; border-bottom: 1px solid #edf0f4; }
.record-row:last-child { border-bottom: 0; }
.record-index { width: 29px; height: 29px; display: grid; place-items: center; color: #8794a5; border-radius: 9px; background: #f2f5f8; font-size: 9px; font-weight: 800; }
.record-meta { min-width: 0; }
.record-meta strong, .record-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-meta strong { color: #253247; font-size: 11px; }.record-meta span { margin-top: 4px; color: #99a4b2; font-size: 9px; }

.batch-list { padding: 14px; display: grid; gap: 11px; }
.batch-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: #fff; transition: border-color .2s ease, box-shadow .2s ease; }
.batch-card:hover, .batch-card.open { border-color: #cfdcf2; box-shadow: 0 9px 25px rgba(31,45,67,.07); }
.batch-head { min-height: 79px; padding: 14px 16px; display: flex; align-items: center; gap: 13px; cursor: pointer; }
.batch-type-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; color: #315fbd; border-radius: 11px; background: #edf3ff; }
.batch-type-icon.borrow { color: #a86105; background: #fff5e3; }.batch-type-icon.return { color: #7850bd; background: #f4efff; }
.batch-copy { min-width: 0; flex: 1; }.batch-copy strong { display: block; overflow: hidden; color: #1c293d; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }.batch-copy span { display: block; margin-top: 5px; color: #94a0ae; font-size: 9px; }
.batch-actions { display: flex; align-items: center; gap: 6px; }
.batch-toggle { transition: transform .25s ease; }.batch-card.open .batch-toggle { transform: rotate(90deg); }
.batch-items { padding: 0 15px 15px; animation: unfold .3s ease both; }
.batch-items-inner { overflow: hidden; border: 1px solid #e7ebf1; border-radius: 11px; background: #fafbfc; }
.batch-item-row { min-height: 56px; padding: 9px 11px; display: grid; grid-template-columns: minmax(130px,1fr) 75px 90px minmax(110px,.8fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid #e9edf2; font-size: 10px; }
.batch-item-row:last-child { border: 0; }
.batch-item-row strong { color: #28364a; }.batch-item-row span { color: #8491a3; }

.recycle-groups { padding: 15px; display: grid; gap: 13px; }
.recycle-group { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; }
.recycle-group h3 { margin: 0; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; color: #29374b; border-bottom: 1px solid var(--line); background: #fafbfc; font-size: 11px; }
.recycle-group h3 span { min-width: 22px; padding: 3px 7px; color: #7e8b9c; border-radius: 20px; background: #edf0f4; text-align: center; font-size: 9px; }
.recycle-row { min-height: 55px; padding: 9px 14px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #eef1f4; font-size: 10px; }.recycle-row:last-child { border: 0; }.recycle-row > div:first-child { min-width: 0; flex: 1; }.recycle-row strong, .recycle-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.recycle-row strong { color: #344157; }.recycle-row small { margin-top: 3px; color: #9aa5b3; }

.empty-state { min-height: 350px; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-visual { position: relative; width: 88px; height: 88px; display: grid; place-items: center; color: #8ca5d5; border-radius: 28px; background: linear-gradient(145deg, #f0f5ff, #e8eef9); box-shadow: inset 0 1px white; }
.empty-visual::before, .empty-visual::after { content: ""; position: absolute; border: 1px solid #dce6f8; border-radius: 50%; }.empty-visual::before { inset: -12px; }.empty-visual::after { inset: -25px; opacity: .45; }
.empty-visual svg { font-size: 34px; }
.empty-state h3 { margin: 25px 0 7px; color: #2b384c; font-size: 14px; }.empty-state p { max-width: 340px; margin: 0; color: #97a2b0; font-size: 10px; line-height: 1.7; }
.skeleton { padding: 16px; display: grid; gap: 10px; }.skeleton-row { height: 56px; border-radius: 12px; background: linear-gradient(90deg,#f3f5f8 25%,#fafbfc 42%,#f3f5f8 60%); background-size: 400% 100%; animation: shimmer 1.2s infinite; }

.site-footer { padding: 23px 5px 0; display: flex; justify-content: center; align-items: center; gap: 11px; color: #a0a9b6; font-size: 9px; }.site-footer a { text-decoration: none; transition: color .2s; }.site-footer a:hover { color: var(--blue); }.site-footer i { width: 3px; height: 3px; border-radius: 50%; background: #c5ccd5; }

dialog { padding: 0; color: var(--ink); border: 0; outline: 0; }
dialog::backdrop { background: rgba(4,11,22,.62); backdrop-filter: blur(5px); animation: fade .18s ease both; }
.form-dialog { width: min(570px, calc(100vw - 30px)); max-height: min(790px, calc(100vh - 35px)); overflow: hidden; border-radius: 20px; background: #fff; box-shadow: 0 32px 80px rgba(2,11,25,.28); }
.form-dialog[open] { animation: dialog-in .3s cubic-bezier(.2,.8,.2,1) both; }
.form-dialog form { max-height: inherit; display: flex; flex-direction: column; }
.form-dialog header { padding: 21px 23px 17px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.form-dialog header span { color: var(--blue); font-size: 8px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }.form-dialog h2 { margin: 5px 0 0; color: #18253a; font-size: 20px; letter-spacing: -.025em; }.form-dialog header p { margin: 5px 0 0; color: #8f9baa; font-size: 10px; }
.dialog-body { padding: 20px 23px 8px; overflow-y: auto; overscroll-behavior: contain; }
.form-dialog footer { padding: 14px 23px 19px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px 13px; }
.field { min-width: 0; display: grid; gap: 6px; }.field.full { grid-column: 1 / -1; }.field label { color: #516075; font-size: 10px; font-weight: 750; }.field label em { margin-left: 3px; color: var(--red); font-style: normal; }
.field input, .field textarea, .field select { width: 100%; min-width: 0; height: 42px; padding: 0 12px; color: #27354a; border: 1px solid #dfe5ed; border-radius: 10px; outline: none; background: #fff; font-size: 12px; transition: border .2s, box-shadow .2s; }.field textarea { min-height: 75px; padding: 11px 12px; resize: vertical; line-height: 1.5; }.field input:focus, .field textarea:focus, .field select:focus { border-color: #8aadee; box-shadow: 0 0 0 3px rgba(40,100,220,.08); }.field small { color: #98a3b1; font-size: 9px; line-height: 1.45; }
.photo-field { position: relative; min-height: 86px; padding: 12px; display: flex; align-items: center; gap: 11px; overflow: hidden; border: 1px dashed #cdd7e5; border-radius: 12px; background: #fafcff; }
.photo-field > svg { flex: 0 0 auto; color: #7e9dd3; font-size: 24px; }.photo-field div { min-width: 0; }.photo-field strong, .photo-field span { display: block; }.photo-field strong { color: #435168; font-size: 10px; }.photo-field span { margin-top: 4px; color: #98a4b3; font-size: 8px; }.photo-field input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.compression-status { margin-top: 9px; padding: 10px 12px; display: grid; gap: 4px; color: #536176; border: 1px solid #dfe7f2; border-radius: 10px; background: #f7faff; font-size: 9px; line-height: 1.5; }
.compression-status strong { color: #2d405c; font-size: 10px; }.compression-status span { color: #8491a3; }
.compression-status.processing { color: #285dc1; border-color: #cadbf9; background: #f2f6ff; }.compression-status.complete { color: #087b59; border-color: #cdeadd; background: #f0faf6; }
.compression-status i { height: 4px; margin-top: 3px; overflow: hidden; border-radius: 10px; background: #dce7f8; }.compression-status i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3975e6, #27b687); transition: width .2s ease; }
.photo-strip { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 8px; }.photo-chip { position: relative; width: 59px; height: 59px; }.photo-chip img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }.photo-chip button { position: absolute; top: -5px; right: -5px; width: 19px; height: 19px; padding: 0; display: grid; place-items: center; color: #fff; border: 2px solid #fff; border-radius: 50%; background: var(--red); font-size: 10px; }
.form-notice { grid-column: 1 / -1; padding: 10px 12px; color: #655023; border: 1px solid #f4e2ba; border-radius: 10px; background: #fff9ec; font-size: 9px; line-height: 1.55; }

.photo-dialog { width: 100vw; max-width: none; height: 100vh; max-height: none; overflow: hidden; background: transparent; }.photo-dialog[open] { display: grid; place-items: center; }.photo-dialog img { max-width: 92vw; max-height: 90vh; object-fit: contain; border-radius: 13px; box-shadow: 0 25px 80px rgba(0,0,0,.5); animation: photo-in .3s ease both; }.photo-close { position: fixed; top: 18px; right: 18px; width: 42px; height: 42px; display: grid; place-items: center; color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: rgba(0,0,0,.25); backdrop-filter: blur(8px); }.photo-close svg { font-size: 20px; }
.confirm-dialog { width: min(390px, calc(100vw - 30px)); padding: 27px; border-radius: 20px; text-align: center; box-shadow: var(--shadow-md); }.confirm-dialog[open] { animation: dialog-in .25s ease both; }.confirm-icon { width: 50px; height: 50px; margin: 0 auto; display: grid; place-items: center; color: var(--red); border-radius: 15px; background: #fff0f2; }.confirm-icon svg { font-size: 21px; }.confirm-dialog h2 { margin: 16px 0 7px; font-size: 17px; }.confirm-dialog p { margin: 0; color: #7e8b9d; font-size: 10px; line-height: 1.65; }.confirm-dialog > div:last-child { margin-top: 21px; display: flex; justify-content: center; gap: 9px; }
.toast-stack { position: fixed; z-index: 100; top: 19px; right: 19px; width: min(350px, calc(100vw - 30px)); display: grid; gap: 9px; pointer-events: none; }.toast { padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; color: #2e3b4f; border: 1px solid #e1e7ef; border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 15px 40px rgba(17,32,55,.17); backdrop-filter: blur(12px); animation: toast-in .3s cubic-bezier(.2,.8,.2,1) both; font-size: 11px; line-height: 1.45; }.toast.success { border-left: 3px solid var(--green); }.toast.error { border-left: 3px solid var(--red); }.toast.hide { animation: toast-out .25s ease both; }

@keyframes reveal { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(13px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes photo-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pulse { 0% { transform: scale(.7); opacity: .8; } 80%,100% { transform: scale(1.7); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -135% 0; } }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

@media (max-width: 1100px) {
  .sidebar { width: 216px; }.workspace { margin-left: 216px; }.main-content { padding-inline: 23px; }
  .brand { padding-inline: 4px; }.stats-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-toolbar { flex-wrap: wrap; }.search-box { max-width: none; }.filter-group { order: 2; flex: 1 0 100%; }.refresh-button { margin-left: auto; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }.workspace { margin-left: 0; }
  .mobile-header { position: sticky; top: 0; z-index: 18; height: 62px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(228,233,240,.85); background: rgba(248,250,253,.88); backdrop-filter: blur(18px); }
  .mobile-brand { display: flex; align-items: center; gap: 9px; }.mobile-brand span { width: 34px; height: 34px; border-radius: 10px; }.mobile-brand strong { color: #172438; font-size: 14px; }.mobile-avatar { color: #6d81a2; border-color: #dce3ee; background: #fff; }
  .main-content { min-height: calc(100vh - 62px); padding: 21px 13px 12px; }
  .page-head { align-items: flex-start; margin-bottom: 18px; }.page-head h1 { margin-top: 5px; font-size: 25px; }.page-head p { max-width: 260px; margin-top: 4px; font-size: 10px; line-height: 1.55; }.eyebrow { font-size: 7px; }.head-actions { display: none; }
  .stats-grid { grid-template-columns: repeat(4, 145px); gap: 10px; margin-inline: -13px; padding: 0 13px 5px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }.stats-grid::-webkit-scrollbar { display: none; }
  .stat-card { min-height: 112px; padding: 15px; border-radius: 15px; scroll-snap-align: start; }.stat-card > strong { font-size: 26px; }.stat-card > span { font-size: 9px; }.stat-card > small { margin-top: 8px; font-size: 8px; }.stat-icon { width: 29px; height: 29px; top: 13px; right: 13px; }
  .content-panel { border-radius: 16px; }
  .panel-toolbar { min-height: auto; padding: 11px; gap: 8px; }.search-box { min-width: 0; height: 39px; }.filter-group { width: 100%; overflow-x: auto; scrollbar-width: none; }.filter-group select { flex: 0 0 auto; }.segmented { flex: 0 0 auto; }.refresh-button { width: 39px; height: 39px; }
  .content-stage { min-height: 310px; }.data-table { display: none; }.mobile-cards { padding: 10px; display: grid; gap: 9px; }
  .tool-card { padding: 13px; border: 1px solid #e7ebf1; border-radius: 14px; background: #fff; box-shadow: 0 2px 8px rgba(31,45,67,.035); animation: card-in .3s ease both; }
  .tool-card-head { display: flex; align-items: flex-start; gap: 10px; }.tool-card-title { min-width: 0; flex: 1; }.tool-card-title strong { display: block; overflow: hidden; color: #1d2a3f; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }.tool-card-title span { display: block; margin-top: 4px; color: #96a1af; font-size: 9px; }.tool-card .quantity { font-size: 17px; }
  .tool-card-meta { margin-top: 12px; padding: 10px 0; display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; border-top: 1px solid #eff2f5; border-bottom: 1px solid #eff2f5; }.tool-card-meta div span, .tool-card-meta div strong { display: block; }.tool-card-meta span { color: #9ba6b4; font-size: 8px; }.tool-card-meta strong { margin-top: 3px; overflow: hidden; color: #536075; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 650; }
  .tool-card-bottom { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }.tool-card-actions { display: flex; gap: 5px; }.tool-card-actions .button { min-height: 30px; padding-inline: 9px; }
  .record-list { padding: 5px 11px 10px; }.record-row { grid-template-columns: 30px minmax(110px,1fr) auto; min-height: 62px; gap: 8px; }.record-row > :nth-child(3), .record-row > :nth-child(4) { display: none; }
  .batch-list { padding: 10px; }.batch-head { min-height: 72px; padding: 11px; }.batch-actions .button span { display: none; }.batch-items { padding: 0 10px 10px; }.batch-item-row { grid-template-columns: 1fr 45px auto; }.batch-item-row > :nth-child(3), .batch-item-row > :nth-child(4) { display: none; }
  .site-footer { padding-bottom: 10px; flex-wrap: wrap; font-size: 8px; }.site-footer span, .site-footer i { display: none; }
  .mobile-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; height: calc(65px + env(safe-area-inset-bottom)); padding: 7px 14px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5,1fr); align-items: center; border-top: 1px solid rgba(220,227,236,.8); background: rgba(255,255,255,.94); box-shadow: 0 -8px 30px rgba(23,35,54,.08); backdrop-filter: blur(18px); }
  .mobile-nav button { height: 50px; padding: 3px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #9aa5b4; border: 0; background: none; font-size: 8px; font-weight: 750; }.mobile-nav button svg { font-size: 19px; }.mobile-nav button.active { color: var(--blue); }.mobile-nav .mobile-create { position: relative; padding: 0; }.mobile-nav .mobile-create > span { position: absolute; bottom: 8px; width: 48px; height: 48px; display: grid; place-items: center; color: #fff; border: 5px solid #fff; border-radius: 17px; background: linear-gradient(145deg,#3975e6,#1c50bc); box-shadow: 0 9px 22px rgba(40,100,220,.32); }.mobile-nav .mobile-create svg { font-size: 20px; }
  .form-dialog { width: 100vw; max-width: none; max-height: calc(100vh - 12px); margin: auto 0 0; border-radius: 22px 22px 0 0; }.form-dialog[open] { animation-name: sheet-in; }.form-dialog header { padding: 17px 17px 14px; }.dialog-body { padding: 17px 17px 5px; }.form-dialog footer { padding: 12px 17px calc(15px + env(safe-area-inset-bottom)); }.form-dialog footer .button { flex: 1; }.form-grid { grid-template-columns: 1fr; gap: 13px; }.field.full, .form-notice { grid-column: auto; }.field input, .field textarea, .field select { height: 45px; font-size: 14px; }.field textarea { min-height: 78px; }
  .toast-stack { top: 70px; right: 10px; width: calc(100vw - 20px); }
}

@keyframes sheet-in { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }

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

.status.site-active { color:#087b59; background:#eaf8f3; }.status.site-returned { color:#315fbd; background:#edf3ff; }.status.site-lost { color:#b4233d; background:#fff0f2; }.status.site-damaged { color:#b46d0a; background:#fff5e3; }

.site-tool-group{margin:8px 0;border:1px solid #e6ebf1;border-radius:10px;overflow:hidden}.site-tool-alert{border-color:#f0b6bd;background:#fff8f8}.site-state-row{padding-left:20px;background:#fafcff}.site-tool-remark{min-width:0;overflow:hidden;color:#65758a!important;text-overflow:ellipsis;white-space:nowrap}.site-tool-remark.muted{color:#aab4c1!important}
.site-search { min-width: 112px; }.site-search input { width: 100%; height: 36px; padding: 0 10px; color: #354257; border: 1px solid #dfe5ed; border-radius: 9px; background: #fff; outline: none; font-size: 11px; }.site-search input:focus { border-color: #8aadee; box-shadow: 0 0 0 3px rgba(40,100,220,.08); }.outgoing-sites { padding: 0 8px 8px; color: #8090a2; font-size: 10px; }
.content-actions { padding: 12px; display: flex; justify-content: flex-end; border-bottom: 1px solid var(--line); }.check-filter { min-height: 36px; padding: 0 10px; display: inline-flex; align-items: center; gap: 5px; color: #556276; white-space: nowrap; font-size: 10px; }

@media (max-width: 760px) { .site-search { flex: 0 0 130px; }.site-search input { height: 39px; font-size: 12px; }.site-filters { align-items: center; } .site-tool-group .batch-item-row { grid-template-columns: minmax(105px,1fr) auto auto; } .site-tool-group .batch-item-row > :nth-child(4) { display: none; } }

@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin: 0; padding: 0; overflow: visible; }
  .filter-group { flex-wrap: wrap; overflow: visible; }.filter-group select { flex: 1 1 125px; min-width: 0; }.segmented { width: 100%; flex: 1 1 100%; overflow-x: auto; }.segmented button { flex: 1 0 auto; }
  .batch-copy { min-width: 0; }.batch-copy strong, .batch-copy span { overflow-wrap: anywhere; white-space: normal; }
  .site-tool-group .batch-item-row { grid-template-columns: minmax(0,1fr) auto; }.site-tool-group .batch-item-row > :nth-child(3), .site-tool-group .batch-item-row > :nth-child(4) { display: block; grid-column: 1 / -1; }.site-tool-group .batch-item-row strong { min-width: 0; overflow-wrap: anywhere; white-space: normal; }.site-tool-group .cell-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .mobile-nav button.hidden { display:none; }.mobile-nav:has(button:not(.hidden):only-child) { grid-template-columns:1fr; }.mobile-nav:has(button:not(.hidden):only-child) button { max-width:120px; justify-self:center; }
  .content-panel, .content-stage, .mobile-cards, .tool-card { min-width: 0; max-width: 100%; }
  .tool-card-head { min-width: 0; flex-wrap: wrap; }.tool-card-title { min-width: 0; flex: 1 1 150px; }.tool-card-title strong { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }.tool-card-title span { overflow-wrap: anywhere; white-space: normal; }
  .tool-card-meta { grid-template-columns: 1fr; }.tool-card-meta strong { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
  .tool-card-bottom { align-items: flex-start; flex-wrap: wrap; min-width: 0; }.tool-card-bottom small { min-width: 0; overflow-wrap: anywhere; }.tool-card-actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  .mobile-header-actions { display:flex; align-items:center; gap:8px; }.mobile-add-button { width:34px; height:34px; display:grid; place-items:center; color:#fff; border:0; border-radius:10px; background:linear-gradient(145deg,#3975e6,#1c50bc); box-shadow:0 6px 14px rgba(40,100,220,.26); }.mobile-add-button svg { font-size:19px; }
}
