:root {
  --violet: #6366f1;
  --violet-600: #4f46e5;
  --violet-50: #eef2ff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e9edf3;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --green: #16a34a;
  --amber: #d97706;
  --sky: #0284c7;
  --rose: #e11d48;
  --emerald: #059669;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 20px rgba(15, 23, 42, .07);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
a { text-decoration: none; color: inherit; }

/* ── Shell ─────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  overflow-y: auto; overscroll-behavior: contain;
}
/* Keep the sidebar's own scrollbar subtle so the panel reads as one solid column. */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #d7dee8; border-radius: 20px; }
.sidebar { scrollbar-width: thin; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; text-decoration: none; border-radius: 12px; margin: 6px 8px 0; transition: background .15s; }
.sidebar-brand:hover { background: #f4f6fb; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.brand-mark svg { display: block; }
.brand-mark img { display: block; width: 24px; height: 21px; }
.brand-text { font-weight: 800; font-size: 17px; line-height: 1; display: flex; flex-direction: column; color: var(--ink); letter-spacing: .02em; }
.brand-text small { font-weight: 500; font-size: 10.5px; color: var(--muted); margin-top: 4px; letter-spacing: 0; }

.sidebar-nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 16px 12px 6px; font-weight: 600; }
.nav-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: #475569; font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.nav-link svg { width: 18px; height: 18px; stroke-width: 2; }
.nav-link:hover { background: #f1f3f9; color: var(--ink); }
.nav-link.active { background: var(--violet-50); color: var(--violet-600); font-weight: 600; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--violet-600); }
.nav-badge { margin-left: auto; background: var(--violet-600); color: #fff; font-size: 11px; font-weight: 600; border-radius: 20px; padding: 1px 7px; }
.nav-badge-warn { background: var(--amber); }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }

/* ── Main / topbar ─────────────────────────────────── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 22px; position: sticky; top: 0; z-index: 30;
}
.icon-btn {
  width: 38px; height: 38px; border: none; background: transparent; border-radius: 10px;
  display: grid; place-items: center; color: var(--muted); cursor: pointer; position: relative;
}
.icon-btn:hover { background: #f1f3f9; color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 4px; right: 4px; background: var(--rose); color: #fff; font-size: 9px; min-width: 15px; height: 15px; border-radius: 10px; display: grid; place-items: center; padding: 0 3px; }

/* ── Global search ─────────────────────────────────── */
.global-search { position: relative; flex: 1; max-width: 620px; }
.global-search form { position: relative; display: flex; align-items: center; }
.gs-icon { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.gs-input {
  width: 100%; height: 42px; border: 1px solid var(--line); background: #f8fafc;
  border-radius: 11px; padding: 0 40px 0 42px; font-size: 14px; color: var(--ink); outline: none;
  transition: border .15s, box-shadow .15s, background .15s;
}
.gs-input::placeholder { color: #94a3b8; }
.gs-input:focus { border-color: var(--violet); background: #fff; box-shadow: 0 0 0 4px rgba(99,102,241,.12); }
.gs-kbd { position: absolute; right: 12px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; font-size: 12px; color: var(--muted); background: #fff; }

.search-suggest { position: absolute; top: 50px; left: 0; right: 0; z-index: 60; }
.suggest-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.suggest-group-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; padding: 10px 14px 4px; }
.suggest-item { display: flex; align-items: center; gap: 11px; padding: 9px 14px; cursor: pointer; }
.suggest-item:hover, .suggest-item.is-active { background: var(--violet-50); }
.suggest-item .si-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--violet-50); color: var(--violet-600); display: grid; place-items: center; flex-shrink: 0; }
.suggest-item .si-icon svg { width: 16px; height: 16px; }
.suggest-item .si-main { min-width: 0; }
.suggest-item .si-title { font-weight: 600; font-size: 13.5px; }
.suggest-item .si-sub { color: var(--muted); font-size: 12px; }
.suggest-item .si-meta { margin-left: auto; font-size: 11px; color: var(--muted); }
.suggest-foot { border-top: 1px solid var(--line); padding: 9px 14px; font-size: 12.5px; color: var(--violet-600); font-weight: 600; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.suggest-empty { padding: 22px 16px; text-align: center; color: var(--muted); }
.hl { background: #fff3bf; border-radius: 3px; }

.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: 9px; padding-left: 8px; }
/* Notification dropdown */
.notif-wrap { position: relative; }
.notif-menu { position: absolute; top: 46px; right: 0; width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .15s; z-index: 60; }
.notif-wrap:hover .notif-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.notif-head { padding: 11px 14px; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--line); }
.notif-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f1f5f9; }
.notif-item:hover { background: #fafbff; }
.notif-item.unread { background: #f5f7ff; }
.notif-item .ni-main { display: flex; flex-direction: column; min-width: 0; }
.notif-item .ni-main small { color: var(--muted); }
.notif-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.notif-foot { display: block; text-align: center; padding: 10px; color: var(--violet-600); font-weight: 600; font-size: 13px; }
.ni-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.ni-ico svg { width: 15px; height: 15px; }
.ni-info { background: #eef2ff; color: var(--violet-600); }
.ni-success { background: #dcfce7; color: #15803d; }
.ni-warning { background: #fef3c7; color: #b45309; }
.ni-critical { background: #ffe4e6; color: #be123c; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--violet-600); color: #fff; display: grid; place-items: center; font-weight: 600; }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta small { color: var(--muted); font-size: 11px; }

/* ── Content ───────────────────────────────────────── */
.content { padding: 24px 26px; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 700; margin: 0; }
.page-sub { color: var(--muted); margin: 3px 0 0; }

.btn-primary-ams { background: var(--violet-600); border: none; color: #fff; font-weight: 600; border-radius: 10px; padding: 9px 16px; display: inline-flex; align-items: center; gap: 7px; }
.btn-primary-ams:hover { background: var(--violet); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 500; border-radius: 10px; padding: 8px 14px; display: inline-flex; align-items: center; gap: 7px; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; border-top: 3px solid var(--violet); }
.kpi-card .kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.kpi-card .kpi-value { font-size: 26px; font-weight: 700; margin-top: 6px; padding-right: 46px; line-height: 1.15; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; word-break: break-word; }
.kpi-card .kpi-ico { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; }
.kpi-card .kpi-ico svg { width: 20px; height: 20px; }
.kpi-link { transition: transform .12s, box-shadow .12s; }
.kpi-link:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.10); }
.tone-violet { border-top-color: var(--violet); } .tone-violet .kpi-ico { background: #eef2ff; color: var(--violet-600); }
.tone-green { border-top-color: var(--green); } .tone-green .kpi-ico { background: #dcfce7; color: var(--green); }
.tone-amber { border-top-color: var(--amber); } .tone-amber .kpi-ico { background: #fef3c7; color: var(--amber); }
.tone-sky { border-top-color: var(--sky); } .tone-sky .kpi-ico { background: #e0f2fe; color: var(--sky); }
.tone-rose { border-top-color: var(--rose); } .tone-rose .kpi-ico { background: #ffe4e6; color: var(--rose); }
.tone-emerald { border-top-color: var(--emerald); } .tone-emerald .kpi-ico { background: #d1fae5; color: var(--emerald); }

/* Cards & tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 15px; font-weight: 700; margin: 0; }
.panel-body { padding: 6px 0; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
@media (max-width: 992px) { .grid-2 { grid-template-columns: 1fr; } .sidebar { position: fixed; z-index: 100; left: -260px; transition: left .2s; } .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(15,23,42,.25); } }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 90; }
.sidebar-backdrop.show { display: block; }

.table-ams { width: 100%; border-collapse: collapse; }
.table-ams th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.table-ams td { padding: 12px 18px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table-ams tr:last-child td { border-bottom: none; }
.table-ams tbody tr:hover { background: #fafbff; }
.code-link { color: var(--violet-600); font-weight: 600; }
.muted { color: var(--muted); }
.cell-title { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12px; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; border: 1px solid transparent; }
.pill-green { background: #dcfce7; color: #15803d; }
.pill-amber { background: #fef3c7; color: #b45309; }
.pill-sky { background: #e0f2fe; color: #0369a1; }
.pill-gray { background: #f1f5f9; color: #475569; }
.pill-rose { background: #ffe4e6; color: #be123c; }
.pill-violet { background: #eef2ff; color: #4f46e5; }
.pri-p0 { background: #ffe4e6; color: #be123c; } .pri-p1 { background: #fef3c7; color: #b45309; } .pri-p2 { background: #e0f2fe; color: #0369a1; } .pri-p3 { background: #f1f5f9; color: #475569; }

/* Accordion (categories) */
.acc-item { border: 1px solid var(--line); border-radius: 12px; margin: 10px 16px; overflow: hidden; }
.acc-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; }
.acc-head .acc-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--violet-50); color: var(--violet-600); display: grid; place-items: center; }
.acc-head .acc-ico svg { width: 17px; height: 17px; }
.acc-count { background: var(--violet-600); color: #fff; border-radius: 20px; font-size: 11.5px; font-weight: 600; padding: 1px 9px; }
.acc-chev { margin-left: auto; color: var(--muted); transition: transform .2s; }
.acc-item.open .acc-chev { transform: rotate(180deg); }
.acc-body { display: none; padding: 0 16px 12px; }
.acc-item.open .acc-body { display: block; }
.acc-stats { display: flex; gap: 18px; padding: 6px 0 10px; color: var(--muted); font-size: 12.5px; }

/* Filters row */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; font-size: 13.5px; outline: none; }
.filters input:focus, .filters select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.filters-search { position: relative; display: inline-flex; align-items: center; }
.filters-search svg { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.filters-search input { padding-left: 34px; min-width: 240px; }

/* Category chips (taxonomy browse) */
.cat-chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 500; color: #334155; }
.cat-chip:hover { border-color: var(--violet); color: var(--violet-600); background: var(--violet-50); }
.cat-chip-n { background: #eef2ff; color: var(--violet-600); border-radius: 20px; font-size: 11px; font-weight: 600; padding: 0 7px; }

/* Form controls (add-asset / assign) */
.form-input-ams, .form-select-ams { width: 100%; height: 44px; border: 1.5px solid #dbe2ec; border-radius: 10px; padding: 0 12px; font-size: 14px; outline: none; background: #fff; }
.form-input-ams:focus, .form-select-ams:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

/* Allocation drill-down */
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; font-size: 13.5px; }
.crumb { color: var(--violet-600); font-weight: 600; padding: 3px 8px; border-radius: 8px; }
.crumb:hover { background: var(--violet-50); }
.crumb.active { color: var(--ink); background: transparent; }
.crumb-sep { width: 15px; height: 15px; color: #cbd5e1; }
.drill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.drill-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); transition: border .15s, transform .05s; }
.drill-card:hover { border-color: var(--violet); transform: translateY(-1px); box-shadow: var(--shadow); }
.drill-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--violet-50); color: var(--violet-600); display: grid; place-items: center; flex-shrink: 0; }
.drill-ico svg { width: 22px; height: 22px; }
.drill-main { flex: 1; min-width: 0; }
.drill-title { font-weight: 700; font-size: 15px; }
.drill-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.drill-metric { text-align: right; }
.drill-metric b { font-size: 20px; font-weight: 700; display: block; line-height: 1; }
.drill-metric span { color: var(--muted); font-size: 11px; }
.drill-chev { color: #cbd5e1; width: 18px; height: 18px; }

/* Bulk action bar — clean light floating toolbar */
.bulk-bar { position: fixed; bottom: -120px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; background: #fff; color: var(--ink);
  padding: 9px 10px 9px 8px; border-radius: 16px; border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(15,23,42,.16); z-index: 80;
  transition: bottom .28s cubic-bezier(.16,1,.3,1), opacity .2s; flex-wrap: wrap; max-width: 96vw;
  opacity: 0; visibility: hidden; pointer-events: none; }
.bulk-bar.show { bottom: 22px; opacity: 1; visibility: visible; pointer-events: auto; }
.bulk-count { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 12px 0 8px; }
.bulk-count b { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; background: var(--violet-600); color: #fff; border-radius: 20px; font-size: 12.5px; }
.bulk-combo { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.bulk-combo:focus-within { border-color: var(--violet-600); box-shadow: var(--ring); }
.bulk-input { height: 36px; border: none; padding: 0 10px; font-size: 13px; background: transparent; color: var(--ink); outline: none; max-width: 150px; }
.bulk-apply { border: none; border-left: 1px solid var(--line); background: #f8fafc; color: var(--violet-600); width: 34px; display: grid; place-items: center; cursor: pointer; transition: background .15s; }
.bulk-apply:hover { background: var(--violet-50); }
.bulk-apply svg { width: 16px; height: 16px; }
.bulk-btn { padding: 8px 12px; background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: 10px; font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; transition: background .15s, border-color .15s; }
.bulk-btn:hover { background: #f8fafc; border-color: #cfd8e6; color: var(--ink); }
.bulk-div { width: 1px; align-self: stretch; background: var(--line); margin: 4px 2px; }
.bulk-x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; }
.bulk-x:hover { background: #fef2f2; color: #dc2626; }
.bulk-x svg { width: 17px; height: 17px; }

/* Activity timeline */
.timeline { list-style: none; margin: 0; padding: 6px 4px; }
.timeline li { display: flex; gap: 12px; padding: 8px 12px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 27px; top: 34px; bottom: -8px; width: 2px; background: #eef2f7; }
.timeline li:last-child::before { display: none; }
.tl-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; z-index: 1; }
.tl-ico svg { width: 15px; height: 15px; }
.tl-main { min-width: 0; }
.tl-main .tl-title { font-weight: 600; font-size: 13.5px; }
.tl-main .tl-sub { color: var(--muted); font-size: 12px; }
.tl-violet { background: #eef2ff; color: var(--violet-600); }
.tl-green { background: #dcfce7; color: #15803d; }
.tl-amber { background: #fef3c7; color: #b45309; }
.tl-sky { background: #e0f2fe; color: #0369a1; }

/* Dialog (report issue) */
.ams-dialog { border: none; border-radius: 16px; padding: 22px; width: 420px; max-width: 92vw; box-shadow: var(--shadow); }
.ams-dialog::backdrop { background: rgba(15,23,42,.45); }
.ams-dialog h3 { font-size: 17px; font-weight: 700; }

/* Document / photo thumbnails */
.doc-thumb { width: 84px; height: 84px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: #f8fafc; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-file { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); }
.doc-file svg { width: 22px; height: 22px; }
.doc-file small { font-size: 9px; }

/* Scan page */
.scan-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
@media (max-width: 992px) { .scan-wrap { grid-template-columns: 1fr; } }
.scan-methods { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.scan-chip { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.scan-chip.active { border-color: var(--violet); color: var(--violet-600); background: var(--violet-50); }
#reader { border-radius: 12px; overflow: hidden; border: 1px dashed var(--line); min-height: 240px; display: grid; place-items: center; color: var(--muted); }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: #cbd5e1; margin-bottom: 8px; }

/* ── Login (split panel, Vinsum brand) ─────────────────── */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(180deg, #eef2fb, #e7ecf6);
}
.auth-card {
  display: flex; width: 1040px; max-width: 100%; min-height: 600px;
  background: #fff; border-radius: 24px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(15, 23, 42, .18);
}
.auth-left {
  flex: 1; padding: 52px 48px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(155deg, #1e3a8a 0%, #2451c4 55%, #3b82f6 100%);
  display: flex; flex-direction: column;
}
.auth-left::before, .auth-left::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}
.auth-left::before { width: 320px; height: 320px; top: -90px; right: -80px; }
.auth-left::after { width: 220px; height: 220px; bottom: -70px; left: -60px; }
.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.auth-logo { height: 46px; width: auto; max-width: 260px; }
.auth-wordmark { display: flex; flex-direction: column; line-height: 1; }
.auth-wordmark span { font-weight: 800; font-size: 22px; letter-spacing: .04em; }
.auth-wordmark small { font-size: 8px; letter-spacing: .14em; opacity: .8; margin-top: 4px; }
.auth-left h1 { font-size: 34px; font-weight: 800; margin: 44px 0 14px; line-height: 1.12; position: relative; z-index: 1; }
.auth-lead { font-size: 15px; opacity: .9; margin: 0 0 30px; max-width: 400px; position: relative; z-index: 1; }
.auth-features { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-direction: column; gap: 18px; position: relative; z-index: 1; }
.auth-features li { display: flex; align-items: center; gap: 14px; font-size: 14.5px; font-weight: 500; }
.af-ico {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: rgba(255, 255, 255, .14); display: grid; place-items: center;
}
.af-ico svg { width: 19px; height: 19px; }
.af-ico .lucide-shield-check, .af-ico [data-lucide="shield-check"] { color: #fdba74; }

.auth-right { flex: 1; padding: 56px 52px; display: flex; flex-direction: column; justify-content: center; }
.auth-right h2 { font-size: 30px; font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.auth-sub { color: var(--muted); margin: 0 0 26px; }
.auth-alert { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 16px; }
.auth-label { display: block; font-weight: 600; font-size: 13.5px; color: #334155; margin: 14px 0 7px; }
.auth-input {
  width: 100%; height: 50px; border: 1.5px solid #dbe2ec; border-radius: 11px;
  padding: 0 15px; font-size: 15px; color: var(--ink); outline: none; background: #fff;
  transition: border .15s, box-shadow .15s;
}
.auth-input::placeholder { color: #9aa6b8; }
.auth-input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.auth-pass { position: relative; }
.auth-pass .auth-input { padding-right: 74px; }
.auth-show {
  position: absolute; right: 8px; top: 8px; height: 34px; padding: 0 12px;
  border: 1px solid #dbe2ec; background: #f8fafc; color: #2563eb; font-weight: 600;
  font-size: 13px; border-radius: 8px; cursor: pointer;
}
.auth-show:hover { background: #eff4ff; }
.auth-remember { display: flex; align-items: center; gap: 9px; margin: 18px 0 22px; font-size: 14px; color: #334155; cursor: pointer; }
.auth-remember input { width: 17px; height: 17px; accent-color: #2563eb; }
.auth-submit {
  width: 100%; height: 52px; border: none; border-radius: 11px; cursor: pointer;
  background: #2451c4; color: #fff; font-weight: 700; font-size: 16px;
  transition: background .15s, transform .05s;
}
.auth-submit:hover { background: #1e3a8a; }
.auth-submit:active { transform: translateY(1px); }
.auth-demo { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 20px; }

@media (max-width: 820px) {
  .auth-left { display: none; }
  .auth-card { min-height: auto; max-width: 460px; }
  .auth-right { padding: 40px 32px; }
}

/* ── Dashboard dimension toggle + drill-down ─────────────────────────── */
.dim-toggle { display: inline-flex; background: #f1f5f9; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.dim-btn { border: none; background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px; padding: 5px 13px; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s; }
.dim-btn:hover { color: var(--ink); }
.dim-btn.active { background: #fff; color: var(--violet-600); box-shadow: var(--shadow-sm); }

.drill-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.drill-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin: 0; }
.drill-title svg { width: 17px; height: 17px; color: var(--violet-600); }
.drill-tools { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.drill-search { position: relative; display: inline-flex; align-items: center; }
.drill-search svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.drill-search input { border: 1px solid var(--line); border-radius: 9px; padding: 7px 12px 7px 32px; font-size: 13px; min-width: 190px; background: #fff; }
.drill-search input:focus { outline: none; border-color: var(--violet-600); box-shadow: 0 0 0 3px #eef2ff; }
.drill-select { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font-size: 13px; background: #fff; color: var(--ink); font-weight: 500; cursor: pointer; }
.drill-select:focus { outline: none; border-color: var(--violet-600); box-shadow: 0 0 0 3px #eef2ff; }
.drill-table-wrap { max-height: 480px; overflow-y: auto; }
.drill-more { padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12.5px; }

/* ── Technician work queue ───────────────────────────────────────────── */
.seg-tabs { display: inline-flex; gap: 4px; background: #f1f5f9; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.seg-tab { padding: 7px 16px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.seg-tab:hover { color: var(--ink); }
.seg-tab.active { background: #fff; color: var(--violet-600); box-shadow: var(--shadow-sm); }
.seg-badge { background: var(--violet-600); color: #fff; font-size: 11px; border-radius: 20px; padding: 0 7px; }
.seg-tab:not(.active) .seg-badge { background: #cbd5e1; color: #475569; }
.wo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.wo-card { padding: 16px 18px; }
.wo-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wo-card-title { font-weight: 600; font-size: 15px; margin-bottom: 3px; }
.wo-card-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn-sm { padding: 6px 12px !important; font-size: 12.5px !important; }

/* ── Budget bars ─────────────────────────────────────────────────────── */
.bud-bar { height: 8px; background: #eef2f7; border-radius: 20px; overflow: hidden; }
.bud-fill { display: block; height: 100%; background: var(--green); border-radius: 20px; }
.bud-fill.warn { background: var(--amber); }
.bud-fill.over { background: var(--rose); }

/* ── Inspection run rows ─────────────────────────────────────────────── */
.ins-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; align-items: center; }
.ins-text { font-weight: 500; font-size: 14px; }
.ins-toggle { display: inline-flex; gap: 6px; }
.ins-pass, .ins-fail { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.ins-pass { color: #15803d; } .ins-fail { color: #be123c; }
.ins-note { grid-column: 1 / -1; }
.pill-select { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; background: #fff; cursor: pointer; }

/* ── Kiosk ──────────────────────────────────────────────────── */
.kiosk-ico { width: 68px; height: 68px; border-radius: 50%; background: #eef2ff; color: var(--violet-600); display: grid; place-items: center; margin: 0 auto 16px; }
.kiosk-ico svg { width: 34px; height: 34px; }
.kiosk-msg { border-radius: 12px; padding: 16px; font-size: 14px; }
.kiosk-msg.ok { background: #f0fdf4; border: 1px solid #bbf7d0; }
.kiosk-msg.err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.kiosk-msg svg { width: 26px; height: 26px; display: block; margin: 0 auto 6px; color: var(--green); }
.kiosk-msg.err svg { color: #dc2626; }

/* ── "i" stage-tracker button + modal + stepper ──────────────────────── */
.i-btn { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--violet-600); display: inline-grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.i-btn:hover { background: #eef2ff; border-color: var(--violet-600); }
.i-btn svg { width: 16px; height: 16px; }

.ams-modal { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 200; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; }
.ams-modal.show { display: flex; }
.ams-modal-card { position: relative; background: #fff; border-radius: 16px; width: 100%; max-width: 460px; box-shadow: 0 24px 60px rgba(15,23,42,.35); padding: 20px 22px 16px; max-height: 84vh; overflow-y: auto; }
.ams-modal-close { position: absolute; top: 10px; right: 14px; border: none; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.ams-modal-close:hover { color: var(--ink); }

.stages-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-right: 20px; }
.stages-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; margin: 0 0 2px; }
.stages-title svg { width: 18px; height: 18px; color: var(--violet-600); }
.stages-foot { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }

.stepper { list-style: none; margin: 0; padding: 0; }
.step { position: relative; display: flex; gap: 14px; padding: 0 0 20px 0; }
.step::before { content: ""; position: absolute; left: 15px; top: 30px; bottom: -2px; width: 2px; background: #e2e8f0; }
.step:last-child::before { display: none; }
.step-dot { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; border: 2px solid #e2e8f0; color: #94a3b8; z-index: 1; }
.step-dot svg { width: 15px; height: 15px; }
.step-body { padding-top: 4px; }
.step-label { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.step-meta { display: flex; gap: 10px; align-items: center; font-size: 12.5px; margin-top: 2px; }
.step-when { color: var(--ink); font-weight: 500; }
.step-note { color: var(--muted); }
.step-check { width: 15px; height: 15px; color: var(--green); }
.step-now { font-size: 10.5px; padding: 1px 8px; }
/* States */
.step-done .step-dot { background: #dcfce7; border-color: var(--green); color: #15803d; }
.step-current .step-dot { background: #eef2ff; border-color: var(--violet-600); color: var(--violet-600); box-shadow: 0 0 0 4px #eef2ff; }
.step-current .step-label { color: var(--violet-600); }
.step-pending .step-when, .step-pending .step-label { color: #94a3b8; }

/* ── Move (assign/transfer) modal ────────────────────────────────────── */
.move-current { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.move-tabs { width: 100%; margin-bottom: 14px; }
.move-tabs .seg-tab { flex: 1; justify-content: center; }
.mv-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.w-100 { width: 100%; justify-content: center; }

/* ══════════════════════════════════════════════════════════════════════
   PROFESSIONAL POLISH PASS
   Accessibility, micro-interactions, refined components & typography.
   ══════════════════════════════════════════════════════════════════════ */

/* Crisp text rendering + tokens */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
:root { --ring: 0 0 0 3px rgba(99,102,241,.35); --shadow-md: 0 8px 24px rgba(15,23,42,.08); --shadow-lg: 0 18px 44px rgba(15,23,42,.14); }
::selection { background: #dfe3ff; color: #1e1b4b; }

/* Keyboard focus ring only (never on mouse click) — WCAG friendly.
   Form fields keep a single soft ring; only links/buttons get the crisp outline. */
a:focus, button:focus, input:focus, select:focus, textarea:focus { outline: none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid rgba(99,102,241,.55); outline-offset: 2px; border-radius: 8px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* Refined scrollbars */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #cdd5e1; border-radius: 20px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #b3bccb; }
*::-webkit-scrollbar-track { background: transparent; }

/* Buttons — depth, press feedback, disabled state */
.btn-primary-ams {
  box-shadow: 0 1px 2px rgba(79,70,229,.35), inset 0 1px 0 rgba(255,255,255,.14);
  transition: background .15s, box-shadow .15s, transform .08s;
}
.btn-primary-ams:hover { box-shadow: 0 4px 14px rgba(79,70,229,.32); }
.btn-primary-ams:active { transform: translateY(1px); box-shadow: 0 1px 2px rgba(79,70,229,.3); }
.btn-primary-ams:disabled, .btn-ghost:disabled { opacity: .55; pointer-events: none; }
.btn-ghost { transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.btn-ghost:hover { background: #f8fafc; border-color: #cfd8e6; box-shadow: var(--shadow-sm); }
.btn-ghost:active { transform: translateY(1px); }
.btn-ghost.active { background: var(--violet-50); border-color: #c7cdfa; color: var(--violet-600); }

/* Icon buttons */
.i-btn { transition: background .15s, border-color .15s, color .15s, box-shadow .15s; }
.i-btn:hover { box-shadow: var(--shadow-sm); }

/* Panels — soft, consistent elevation */
.panel { box-shadow: var(--shadow-sm); transition: box-shadow .2s, border-color .2s; }
.panel:hover { box-shadow: 0 4px 18px rgba(15,23,42,.06); }
.panel-head h3 { letter-spacing: -.2px; }

/* KPI cards — unified lift + polished icon */
.kpi-card { transition: transform .14s, box-shadow .14s, border-color .14s; }
.kpi-card:hover { box-shadow: var(--shadow-md); }
.kpi-card .kpi-ico { box-shadow: inset 0 0 0 1px rgba(15,23,42,.04); }
.kpi-card .kpi-value { color: #0b1220; }

/* Tables — sticky headers inside scroll wraps, softer zebra hover */
.drill-table-wrap thead th, .table-scroll thead th { position: sticky; top: 0; z-index: 1; background: #fbfcfe; }
.table-ams th { background: #fbfcfe; }
.table-ams tbody tr { transition: background .12s; }
.table-ams tbody tr:hover { background: #f5f7ff; }
.table-ams td, .table-ams th { padding-left: 20px; }
.table-ams td:last-child, .table-ams th:last-child { padding-right: 20px; }
.code-link { transition: color .12s; }
.code-link:hover { color: #3730a3; text-decoration: underline; text-underline-offset: 2px; }

/* Pills — subtle definition */
.pill { border-color: rgba(15,23,42,.05); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); line-height: 1.4; }

/* Inputs — consistent focus ring across every control */
.form-input-ams:focus, .form-select-ams:focus,
.filters input:focus, .filters select:focus,
.drill-select:focus, .drill-search input:focus, .pill-select:focus {
  border-color: var(--violet-600); box-shadow: var(--ring);
}
.form-input-ams, .form-select-ams { transition: border-color .15s, box-shadow .15s; }
.form-input-ams::placeholder { color: #94a3b8; }

/* Alerts / flash messages — clean, dismissible-looking toasts */
.alert { border-radius: 12px; border: 1px solid var(--line); padding: 11px 15px !important;
  font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-sm); display: flex; align-items: center;
  gap: 9px; margin-bottom: 12px; animation: ams-slidein .25s ease; }
.alert::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: currentColor; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.alert-error, .alert-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.alert-info, .alert-debug { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* Empty states */
.empty { padding: 40px 20px; }
.empty svg { color: #cbd5e1; }
.empty div { font-size: 13.5px; }

/* Page enter animation */
.main > .content { animation: ams-fadein .28s ease; }
@keyframes ams-fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes ams-slidein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* Topbar refinement */
.topbar { box-shadow: 0 1px 0 rgba(15,23,42,.03); }
.icon-btn { transition: background .15s, color .15s; }
.user-chip { border-left: 1px solid var(--line); padding-left: 12px; margin-left: 4px; }

/* Segmented tabs & dim-toggle crispness */
.seg-tab, .dim-btn { transition: background .15s, color .15s, box-shadow .15s; }

/* Nav polish */
.nav-link { transition: background .15s, color .15s; }
.nav-link.active { box-shadow: inset 0 0 0 1px #e0e3fb; }

