:root {
  color-scheme: light;
  --green-950: #18283f;
  --green-800: #0071e3;
  --green-700: #0068d1;
  --green-100: #e8f2ff;
  --green-50: #f4f8fd;
  --ink: #1d1d1f;
  --muted: #737780;
  --line: #e5e7eb;
  --paper: #f5f5f7;
  --white: #fff;
  --amber: #976316;
  --amber-bg: #fff6e6;
  --red: #bf4145;
  --red-bg: #fff0f0;
  --blue: #0068c9;
  --blue-bg: #eaf3ff;
  --shadow: 0 8px 32px rgba(29, 29, 31, .045), 0 1px 3px rgba(29, 29, 31, .025);
  --radius: 22px;
}

/* Attendance: camera capture and monthly employee records. */
.att-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; }
.att-workspace > *, #attendance-admin > * { min-width: 0; }
.att-workspace .settings-card { padding: 26px; }
.att-notice { padding: 14px 16px; border-radius: 14px; background: var(--blue-bg); color: var(--blue); line-height: 1.7; margin: 18px 0; }
#att-clock { font-size: 36px; letter-spacing: -1px; font-variant-numeric: tabular-nums; margin: 10px 0; }
.att-camera { aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 18px; background: #eef1f6; overflow: hidden; position: relative; display: grid; place-items: center; margin: 18px 0; }
.att-camera video, .att-camera img { width: 100%; height: 100%; object-fit: contain; position: absolute; }
.att-camera video { transform: scaleX(-1); }
.att-camera p { padding: 24px; color: var(--muted); text-align: center; }
.att-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 12px; margin: 18px 0; }
.att-metrics > div { padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fafbfd; }
.att-metrics strong { display: block; font-size: 22px; letter-spacing: -.6px; }
.att-metrics span { display: block; margin-top: 7px; font-size: 11px; color: var(--muted); }
.att-records { display: grid; gap: 16px; }
.att-record { padding: 18px; border: 1px solid var(--line); border-radius: 17px; overflow-wrap: anywhere; }
.att-record .section-head { margin-bottom: 12px; }
.att-record .section-head p { margin-bottom: 0; }
.att-evidence-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.att-evidence { font-size: 12px; line-height: 1.7; min-width: 0; }
.att-evidence p { color: var(--muted); margin: 7px 0; }
.att-photo { margin-top: 12px; }
.att-photo summary { cursor: pointer; color: var(--blue); }
.att-photo img { display: block; width: 100%; border-radius: 12px; margin-top: 10px; }
.att-empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.att-filters { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; }
.att-filters .field { flex: 1; min-width: 160px; }
.att-details { margin-top: 24px; }
.att-details .att-records { grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
#att-summary-table .table-scroll { overflow-x: auto; }
#att-summary-table table { width: 100%; min-width: 610px; }
#att-more { margin-top: 20px; }
@media (max-width: 1100px) { .att-workspace { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .att-workspace .settings-card { padding: 20px; }
  .att-record { padding: 14px; }
  .att-evidence-grid { grid-template-columns: minmax(0, 1fr); }
  .att-evidence + .att-evidence { border-top: 1px solid var(--line); padding-top: 12px; }
  #attendance .section-head, #attendance-admin > .section-head { flex-wrap: wrap; gap: 14px; }
  #attendance input, #attendance-admin input, #attendance-admin select { font-size: 16px; max-width: 100%; min-width: 0; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, a, input, select { transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: .5; }
button:focus-visible, a:focus-visible { outline: 3px solid #76b6f9; outline-offset: 3px; }
button:disabled:hover { transform: none; }
a { color: var(--green-800); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 238px; padding: 32px 16px 20px; display: flex; flex-direction: column; background: rgba(251, 251, 253, .84); border-right: 1px solid rgba(210, 214, 222, .6); backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); z-index: 20; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 11px 32px; color: var(--ink); text-decoration: none; font-weight: 650; font-size: 21px; letter-spacing: -.6px; }
.brand-mark, .auth-mark { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; color: white; background: linear-gradient(145deg, #3597f9, #0067d5); border-radius: 13px; box-shadow: 0 5px 12px rgba(0, 113, 227, .17); font-size: 23px; font-weight: 700; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 550; letter-spacing: 2.4px; }
.nav { display: grid; align-content: start; gap: 4px; overflow-y: auto; scrollbar-width: thin; }
.nav a { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 11px 13px; border-radius: 11px; color: #5c616b; text-decoration: none; font-size: 12px; font-weight: 550; }
.nav a:hover { background: #ededef; color: var(--ink); }
.nav a.active { color: #0068d1; background: #e5effb; font-weight: 650; }
.nav-icon { width: 22px; height: 22px; flex-shrink: 0; }
.server-state { margin-top: auto; padding: 24px 13px 12px; color: var(--muted); font-size: 10px; }
.server-state span, .live span { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: #38a575; box-shadow: 0 0 0 3px #e8f5ee; }
.sidebar-user { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: auto; padding: 20px 9px 8px; border-top: 1px solid var(--line); }
.sidebar-user > button { grid-column: 1 / -1; min-height: 33px; margin-top: 3px; font-size: 10px; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; color: #416280; background: #e9eef5; font-size: 12px; font-weight: 650; text-transform: uppercase; }
#current-user-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 650; }
#current-user-role { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.user-menu-actions { display: flex; gap: 7px; margin-top: 10px; }
.user-menu-actions button, .user-menu-actions a { flex: 1; padding: 8px; border: 1px solid var(--line); border-radius: 9px; color: #636875; background: rgba(255, 255, 255, .7); font-size: 11px; text-align: center; text-decoration: none; }
.user-menu-actions button:hover, .user-menu-actions a:hover { background: white; color: var(--ink); }

.main { min-width: 0; margin-left: 238px; max-width: 1740px; padding: 35px clamp(26px, 3.4vw, 64px) 64px; }
.main > *, .view, .cancellation-workspace > *, .user-workspace > *, .account-grid > * { min-width: 0; }
.topbar, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.apk-chip { display: none; padding: 8px 11px; color: var(--blue); background: var(--blue-bg); border-radius: 999px; text-decoration: none; font-size: 10px; font-weight: 600; }
.topbar h1 { margin: 0; font-size: 25px; font-weight: 650; letter-spacing: -.9px; }
.kicker { margin: 0 0 8px; color: #828792; font-size: 9px; font-weight: 650; letter-spacing: 1.7px; line-height: 1.4; }
.light { color: #5c86b3; }
.live { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: #777c85; background: rgba(255, 255, 255, .8); font-size: 11px; white-space: nowrap; }
.view { display: none; animation: appear .23s ease-out; }
.view.active { display: block; }
@keyframes appear { from { opacity: .3; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.scan-view.active { display: grid; grid-template-columns: minmax(0, 1fr) minmax(310px, .98fr); align-items: center; gap: clamp(26px, 3vw, 54px); min-height: 430px; margin-top: 30px; padding: clamp(30px, 3.4vw, 52px); position: relative; overflow: hidden; border: 1px solid #dde7f3; border-radius: 28px; background: radial-gradient(ellipse at 0 0, #fff 0%, transparent 65%), linear-gradient(120deg, #eff6ff, #e8f0fc); box-shadow: var(--shadow); }
.scan-view::after { content: ''; position: absolute; right: -80px; top: -140px; width: 350px; height: 350px; border: 60px solid rgba(255, 255, 255, .27); border-radius: 50%; pointer-events: none; }
.cancellation-receive-view.active { border-color: #dcebe4; background: radial-gradient(ellipse at 0 0, #fff 0%, transparent 65%), linear-gradient(120deg, #f0f8f4, #e6f3ed); }
.cancellation-receive-view .light { color: #59816f; }
.cancellation-receive-view .scanner-head { color: #308468; }
.scan-copy, .scanner-card { position: relative; z-index: 1; min-width: 0; }
.scan-copy h2 { margin: 0 0 20px; font-size: clamp(34px, 3.55vw, 54px); font-weight: 670; line-height: 1.08; letter-spacing: -2.1px; }
.scan-copy h2 em { color: #75899f; font-style: normal; font-weight: 580; }
.cancellation-receive-view .scan-copy h2 em { color: #6b8c7c; }
.scan-copy > p:last-child { max-width: 440px; margin: 0; color: #788594; font-size: 13px; line-height: 1.75; }
.scanner-card, .lookup-card { padding: 25px; border: 1px solid rgba(255, 255, 255, .85); border-radius: 21px; background: rgba(255, 255, 255, .95); color: var(--ink); box-shadow: 0 12px 30px rgba(65, 88, 116, .065); }
.scanner-head { display: flex; align-items: center; margin-bottom: 22px; color: #478079; font-size: 11px; font-weight: 600; }
.pulse { display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: #3aac80; box-shadow: 0 0 0 4px #eaf8f1; }
form { margin: 0; }
label { display: block; color: #5c616b; font-size: 11px; font-weight: 600; }
input, select, textarea { width: 100%; min-width: 0; min-height: 42px; padding: 11px 13px; border: 1px solid #dedfe4; border-radius: 10px; background: white; color: var(--ink); outline: none; font-size: 12px; }
input::placeholder, textarea::placeholder { color: #a2a6ae; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: #7eb6ed; box-shadow: 0 0 0 3px rgba(0, 113, 227, .11); }
input[type='checkbox'], input[type='radio'] { width: 17px; min-height: 17px; height: 17px; margin: 1px 0 0; padding: 0; flex: 0 0 17px; accent-color: var(--green-800); box-shadow: none; }
.input-action { display: flex; margin-top: 9px; }
.input-action input { min-width: 0; min-height: 50px; padding: 13px 14px; border-radius: 11px 0 0 11px; font-size: 13px; }
.input-action button { width: 49px; flex: 0 0 49px; border: 0; border-radius: 0 11px 11px 0; background: var(--green-800); color: white; font-size: 21px; }
.input-action button:hover, .primary-button:hover { background: #0079ed; }
#scan-form .input-action button, #cancellation-receive-form .input-action button { width: 70px; flex-basis: 70px; font-size: 12px; }
.scanner-card > select, .scanner-card > div[id$="-delay-field"] { margin: 6px 0 14px; }
.device-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.soft-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 39px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; color: #646c78; background: #f8f9fb; font-size: 11px; font-weight: 550; text-decoration: none; }
.soft-button:hover { border-color: #d8dde5; background: #eff2f6; color: #3f556e; }
.helper { margin: 12px 0 0; color: #9399a2; font-size: 10px; line-height: 1.6; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 12px 18px; border: 0; border-radius: 11px; color: white; background: var(--green-800); text-decoration: none; text-align: center; font-size: 12px; font-weight: 600; }
.link-button { padding: 8px 0; border: 0; background: transparent; color: var(--green-800); font-size: 12px; font-weight: 550; white-space: nowrap; }

.page-card { max-width: 900px; margin: 30px auto 0; padding: clamp(28px, 3.2vw, 46px); border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.page-title h2, .section-head h2, .download-card h2, .page-heading h2 { margin: 0 0 10px; font-size: 29px; font-weight: 650; letter-spacing: -1px; }
.page-title > p:last-child, .download-card p, .page-heading > p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.page-heading { margin: 32px 0 24px; }
.lookup-card { margin-top: 25px; border: 1px solid #ecedf1; background: #f9fafc; box-shadow: none; }
.result-card { margin-top: 17px; padding: 15px 16px; border: 1px solid #d9eae3; border-radius: 12px; background: #eef8f2; color: #346d55; font-size: 12px; font-weight: 550; line-height: 1.7; overflow-wrap: anywhere; }
.result-card.neutral { border-color: #e9ebf0; background: #f5f6f8; color: #898f99; }
.result-card.error { border-color: #f5d7d7; background: var(--red-bg); color: var(--red); }
.result-card .status-title { display: block; margin-bottom: 4px; font-size: 15px; }
.section-head { margin: 35px 0 22px; }
.section-head h2 { margin-bottom: 0; }
.section-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }
.return-date-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.return-date-controls .date-control { width: 180px; }
.date-summary, .cancellation-date-summary { margin: 18px 0 12px; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.6; }
.stat, .cancellation-stat { min-width: 0; position: relative; padding: 23px 20px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: 0 3px 12px rgba(29, 29, 31, .02); }
.stat::before, .cancellation-stat::before { content: ''; display: block; width: 22px; height: 3px; margin-bottom: 18px; border-radius: 4px; background: #99a4b4; }
.stat strong, .cancellation-stat strong { display: block; margin-bottom: 7px; font-size: 31px; font-weight: 650; letter-spacing: -1.3px; font-variant-numeric: tabular-nums; }
.stat span, .cancellation-stat span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.stat.received::before, .cancellation-stat.in_warehouse::before { background: #59a98c; }
.stat.return_waiting::before { background: #d59565; }
.stat.pending::before, .cancellation-stat.unverified::before { background: #d0ad62; }
.stat.on_route::before, .cancellation-stat.total::before { background: #75a5d6; }
.stat.lost::before, .cancellation-stat.carried_away::before { background: #d48888; }
.attention { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding: 20px 23px; border: 1px solid #eddfbf; border-radius: 15px; background: var(--amber-bg); }
.attention strong { display: block; font-size: 12px; color: #775f31; }
.attention p { margin: 5px 0 0; color: #9b885f; font-size: 11px; line-height: 1.6; }
.attention a { color: #926a26; font-size: 11px; font-weight: 600; text-decoration: none; white-space: nowrap; }

.cancellation-view { max-width: 1400px; }
.cancellation-heading { align-items: flex-end; }
.cancellation-heading > div { max-width: 720px; }
.cancellation-heading h2, .cancellation-table-heading h2 { margin: 0 0 9px; font-size: 29px; font-weight: 650; letter-spacing: -1px; }
.cancellation-heading p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.cancellation-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.cancellation-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 22px; }
.cancellation-panel { padding: 25px; border: 1px solid var(--line); border-radius: 19px; background: white; box-shadow: var(--shadow); }
.cancellation-panel h3 { margin: 0 0 22px; font-size: 20px; font-weight: 650; letter-spacing: -.55px; }
.panel-copy { min-height: 43px; margin: -8px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.full-button { width: 100%; margin-top: 11px; }
.cancellation-table-heading { margin-top: 34px; }
.cancellation-filters { display: grid; grid-template-columns: minmax(180px, 1fr) 150px 150px auto; align-items: end; gap: 10px; margin-bottom: 16px; }
.cancellation-table-grid { min-width: 1280px; }
.tracking small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 400; }
.cancellation-items { min-width: 190px; max-width: 300px; line-height: 1.55; }
.cancellation-result small, .result-status { display: block; margin-top: 5px; }
.cancellation-result small { color: var(--muted); font-weight: 400; }
.decision-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 15px; }
.decision-actions button { min-height: 42px; padding: 10px 12px; border: 0; border-radius: 9px; color: white; font-size: 11px; font-weight: 600; }
.decision-actions .warehouse-button { background: #31846b; }
.decision-actions .carried-button { background: #bd5c5c; }
.decision-actions .reset-button { border: 1px solid var(--line); color: var(--muted); background: white; }
.filters { display: grid; grid-template-columns: minmax(160px, 1.4fr) minmax(160px, .8fr) minmax(140px, .7fr) auto; align-items: end; gap: 10px; margin-bottom: 16px; }
.date-control { font-size: 10px; }
.date-control input { margin-top: 6px; }
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: 16px; background: white; scrollbar-width: thin; }
table { width: 100%; min-width: 1040px; border-collapse: collapse; font-size: 11px; }
th, td { padding: 16px 15px; text-align: left; vertical-align: middle; border-bottom: 1px solid #edf0f3; }
th { background: #f9fafb; color: #979ca5; font-size: 9px; font-weight: 600; letter-spacing: .7px; text-transform: uppercase; white-space: nowrap; }
tbody tr:hover { background: #fcfdff; }
tbody tr:last-child td { border-bottom: 0; }
.table-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.table-footer > div { display: flex; align-items: center; gap: 12px; }
.tracking { font-size: 11px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.type { color: var(--muted); font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.badge { display: inline-block; padding: 6px 9px; border-radius: 99px; color: #5e6e83; background: #edf1f7; font-size: 9px; font-weight: 600; white-space: nowrap; }
.badge.received, .badge.cancellation-in_warehouse { color: #44816a; background: #eaf6ef; }
.badge.return_waiting { color: #ae7c4d; background: #fff3e9; }
.badge.pending, .badge.cancellation-unverified { color: #a78a48; background: #fdf6e7; }
.badge.on_route { color: #5c8dba; background: #ebf4ff; }
.badge.lost, .badge.cancellation-carried_away { color: #b76868; background: #fdefef; }
.status-action { display: flex; align-items: center; gap: 6px; }
.status-action select { width: 148px; min-height: 34px; padding: 7px 9px; font-size: 10px; }
.status-action button { min-height: 34px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--green-800); background: white; font-size: 10px; font-weight: 550; }
.empty, .empty-view { padding: 55px 25px; border: 1px dashed #dce0e7; border-radius: 17px; background: white; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.7; }
.empty-view { margin-top: 30px; }

.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; margin-top: 28px; }
.file-field { display: flex; flex-direction: column; min-width: 0; min-height: 165px; padding: 20px; border: 1px dashed #cbd6e4; border-radius: 14px; background: #fafcfe; cursor: pointer; }
.file-field > span { display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 15px; border-radius: 9px; color: #5f8dc0; background: #e9f1fb; font-size: 12px; }
.file-field b, .file-field small { display: block; }
.file-field b { font-size: 12px; font-weight: 600; }
.file-field small { margin: 6px 0 15px; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.5; }
.file-field input { min-height: 37px; padding: 6px; margin-top: auto; background: white; font-size: 10px; }
input::file-selector-button { padding: 5px 9px; margin-right: 8px; border: 0; border-radius: 6px; background: #eef3fa; color: #5e7899; font: inherit; cursor: pointer; }
.compact-file { min-height: 111px; padding: 15px; }
.compact-file small { margin-bottom: 10px; }
.import-grid .primary-button { grid-column: 1 / -1; margin-top: 3px; }
.download-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 24px; }
.download-card > .primary-button { grid-column: 2; justify-self: start; }
.android-mark { display: grid; place-items: center; width: 65px; height: 65px; border-radius: 19px; color: #5588c3; background: #eaf2ff; font-size: 27px; font-weight: 650; }

body.auth-pending .sidebar, body.auth-pending .main, body.auth-locked .sidebar, body.auth-locked .main { display: none; }
body.auth-pending::after { content: ''; position: fixed; top: calc(50% - 12px); left: calc(50% - 12px); width: 24px; height: 24px; border: 2px solid #dce7f3; border-top-color: #0071e3; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-screen { display: none; min-height: 100vh; padding: 48px clamp(24px, 7vw, 120px); background: radial-gradient(ellipse at 12% 20%, #e6effc 0, transparent 48%), radial-gradient(ellipse at 96% 82%, #e8f4ee 0, transparent 43%), #f6f7fa; }
body.auth-locked .auth-screen { display: flex; align-items: center; justify-content: center; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(350px, 425px); align-items: center; gap: clamp(42px, 8vw, 130px); width: 100%; max-width: 1120px; }
.auth-story { max-width: 560px; }
.auth-mark { position: relative; width: 51px; height: 51px; margin-bottom: 34px; border-radius: 16px; font-size: 28px; }
.auth-mark span { position: absolute; left: 65px; top: 50%; transform: translateY(-50%); color: #3c4a5d; font-size: 23px; font-weight: 650; letter-spacing: -.7px; white-space: nowrap; }
.auth-story .kicker { margin-bottom: 16px; color: #7a8ca5; }
.auth-story h1 { margin: 0 0 25px; font-size: clamp(38px, 4.8vw, 64px); font-weight: 660; letter-spacing: -2.8px; line-height: 1.05; }
.auth-story h1 span, .auth-story h1 em { color: #6f8cac; font-style: normal; }
.auth-story > p:not(.kicker) { max-width: 390px; margin: 0; color: #7e8898; font-size: 14px; line-height: 1.75; }
.auth-features { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.auth-features span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 11px; border: 1px solid rgba(205, 216, 231, .8); border-radius: 999px; color: #7a8a9d; background: rgba(255, 255, 255, .5); font-size: 10px; }
.auth-card { min-width: 0; padding: 37px; border: 1px solid rgba(255, 255, 255, .95); border-radius: 26px; background: rgba(255, 255, 255, .9); box-shadow: 0 20px 70px rgba(50, 67, 91, .075), 0 2px 8px rgba(50, 67, 91, .025); }
.auth-card-header { margin-bottom: 26px; }
.auth-card-header h2 { margin: 0 0 10px; font-size: 25px; font-weight: 650; letter-spacing: -.8px; }
.auth-card-header p { margin: 0; color: #8c939f; font-size: 12px; line-height: 1.7; }
.auth-form { display: grid; gap: 17px; }
.field { display: flex; flex-direction: column; min-width: 0; gap: 8px; }
.field > label, .field > span:first-child { font-size: 11px; font-weight: 550; color: #616a78; }
.field > small { color: #9198a2; font-size: 10px; line-height: 1.6; }
.field input, .field select { min-height: 44px; }
.auth-form input { min-height: 46px; background: #fcfdff; }
.auth-form .primary-button { width: 100%; min-height: 45px; margin-top: 5px; }
.auth-message { margin: 0 0 17px; padding: 11px 13px; border: 1px solid #f3dede; border-radius: 10px; background: #fff6f6; color: #b86363; font-size: 11px; line-height: 1.6; }
.auth-message:empty { display: none; }
.auth-message.success { border-color: #d9eae3; background: #eef8f2; color: #346d55; }
.auth-card > .auth-message { margin-top: 17px; }
.auth-note { margin: 22px 0 0; color: #a0a6ae; font-size: 10px; line-height: 1.7; text-align: center; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 70px; }
.password-toggle { position: absolute; top: 5px; right: 5px; height: calc(100% - 10px); min-width: 53px; padding: 4px 8px; border: 0; border-radius: 7px; background: transparent; color: #8b95a3; font-size: 10px; }
.password-toggle:hover { color: var(--green-800); background: #eff5fc; }

.user-workspace { display: grid; grid-template-columns: minmax(320px, .95fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
.settings-card { padding: 27px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.settings-card h3 { margin: 0 0 8px; font-size: 19px; font-weight: 650; letter-spacing: -.45px; }
.settings-card h4 { margin: 3px 0 8px; color: #697687; font-size: 12px; font-weight: 600; }
.settings-card > h3 + .auth-form { margin-top: 23px; }
.settings-card > p { margin: 0 0 23px; color: #959ba5; font-size: 11px; line-height: 1.7; }
.settings-card .section-head { margin: 0 0 20px; }
.settings-card .section-head h3 { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 17px 14px; }
.form-grid > .full-width, .form-grid > .wide { grid-column: 1 / -1; }
.permission-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; margin: 12px 0 0; }
.permission-option { display: flex; align-items: flex-start; gap: 9px; min-width: 0; padding: 13px 11px; border: 1px solid #e9ecf1; border-radius: 11px; background: #fcfdff; cursor: pointer; }
.permission-option:has(input:checked) { border-color: #d5e6f9; background: #f5f9fe; }
.permission-option > span { min-width: 0; }
.permission-option strong { display: block; color: #636d7c; font-size: 10px; font-weight: 600; line-height: 1.5; }
.permission-option small { display: block; margin-top: 3px; color: #a0a7b1; font-size: 9px; font-weight: 400; line-height: 1.55; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.auth-form .form-actions { margin-top: 3px; }
.auth-form .form-actions .primary-button { width: auto; margin-top: 0; }
.user-list { display: grid; gap: 12px; }
.user-card { min-width: 0; padding: 19px; border: 1px solid #e8ebf0; border-radius: 15px; background: white; }
.user-card-head { display: flex; align-items: center; gap: 11px; }
.user-card-head > div { min-width: 0; }
.user-card-head h3, .user-card-head h4, .user-card-head strong { display: block; margin: 0; overflow: hidden; color: #465163; font-size: 13px; font-weight: 650; text-overflow: ellipsis; }
.user-card-head p, .user-card-head small { display: block; margin: 4px 0 0; color: #939aa6; font-size: 10px; }
.user-card-head > .badge { margin-left: auto; }
.user-card .avatar { width: 39px; height: 39px; flex-basis: 39px; }
.user-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 14px; color: #939aa5; font-size: 10px; line-height: 1.7; }
.user-card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #f0f2f5; }
.user-card-actions button { min-height: 34px; padding: 7px 11px; border: 1px solid #e6ebf2; border-radius: 8px; color: #6e86a4; background: #fafcfe; font-size: 10px; }
.user-card-actions button:hover { background: #f0f5fc; }
.user-card-actions .danger-button, .danger-button { color: #bc6c6c; background: #fff8f8; border-color: #f0dfdf; }
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 22px; }
.permission-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0 0; padding: 0; list-style: none; }
.permission-list li, .permission-list > span { padding: 7px 10px; border: 1px solid #e6ecf4; border-radius: 8px; color: #8193ab; background: #f8fbff; font-size: 10px; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(21, 30, 42, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal-card { width: min(620px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 25px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 23px; background: #202d3f; color: white; box-shadow: 0 30px 80px rgba(0, 0, 0, .2); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.modal-head h2 { margin: 0 0 20px; font-size: 23px; font-weight: 600; letter-spacing: -.7px; }
.modal-head button { width: 33px; height: 33px; padding: 0; border: 0; border-radius: 50%; color: #bcc8d6; background: rgba(255, 255, 255, .07); font-size: 25px; }
.modal video { width: 100%; max-height: 60vh; object-fit: cover; border-radius: 15px; background: black; }
.modal-card > p { margin: 14px 0 0; color: #afbdcc; font-size: 11px; }
.toast { position: fixed; right: 25px; bottom: 25px; z-index: 120; max-width: 370px; padding: 15px 19px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; color: white; background: rgba(37, 47, 62, .94); box-shadow: 0 10px 40px rgba(0, 0, 0, .13); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); font-size: 12px; line-height: 1.6; }
.toast.error { background: rgba(159, 69, 73, .95); }

@media (min-width: 1600px) {
  .main { padding-left: 68px; padding-right: 68px; }
  .scan-view.active { min-height: 470px; }
}
@media (max-width: 1150px) {
  .sidebar { width: 216px; padding-inline: 12px; }
  .main { margin-left: 216px; padding-inline: 28px; }
  .scan-view.active { grid-template-columns: 1fr; padding: 34px; gap: 28px; }
  .scan-copy h2 { max-width: 600px; font-size: 43px; }
  .scan-copy > p:last-child { max-width: 520px; }
  .scanner-card { max-width: 620px; width: 100%; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters, .cancellation-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .cancellation-workspace, .user-workspace { grid-template-columns: minmax(0, 1fr); }
  .user-workspace .permission-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-layout { gap: 45px; grid-template-columns: minmax(0, 1fr) minmax(330px, 390px); }
  .auth-screen { padding-inline: 40px; }
  .auth-story h1 { font-size: 48px; }
}
@media (max-width: 820px) {
  .sidebar { position: sticky; top: 0; inset-inline: 0; width: 100%; height: auto; display: grid; grid-template-columns: 1fr auto; gap: 13px 15px; padding: 15px 23px 0; border-right: 0; border-bottom: 1px solid rgba(215, 220, 229, .85); background: rgba(250, 251, 254, .92); }
  .brand { padding: 0; font-size: 19px; gap: 9px; }
  .brand-mark { width: 33px; height: 33px; border-radius: 11px; font-size: 20px; }
  .brand small { font-size: 8px; letter-spacing: 2px; }
  .nav { grid-row: 2; grid-column: 1 / -1; display: flex; gap: 5px; margin-inline: -23px; padding: 0 23px 12px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex-shrink: 0; min-height: 36px; padding: 8px 12px; gap: 7px; font-size: 11px; white-space: nowrap; }
  .nav-icon { width: 17px; height: 17px; }
  .server-state { display: none; }
  .sidebar-user { grid-column: 2; grid-row: 1; grid-template-columns: 30px minmax(0, 1fr); gap: 7px; max-width: 180px; margin: 0; padding: 0; border: 0; }
  .sidebar-user .avatar { width: 30px; height: 30px; font-size: 10px; }
  .sidebar-user > button { display: none; }
  #current-user-name { max-width: 100px; font-size: 10px; }
  #current-user-role { font-size: 9px; margin-top: 2px; }
  .user-menu-actions { display: none; }
  .main { margin: 0; padding: 25px 24px 48px; }
  .topbar h1 { font-size: 23px; }
  .topbar { padding-bottom: 18px; }
  .scan-view.active { grid-template-columns: minmax(0, 1fr) minmax(290px, 1fr); padding: 28px; }
  .scan-copy h2 { font-size: 33px; letter-spacing: -1.5px; }
  .scanner-card { padding: 20px; }
  .device-actions { grid-template-columns: minmax(0, 1fr); }
  .cancellation-workspace { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; }
  .cancellation-panel { padding: 20px; }
  .auth-layout { grid-template-columns: minmax(0, 410px); justify-content: center; gap: 32px; }
  .auth-story { text-align: center; }
  .auth-mark { margin: 0 0 21px calc(50% - 89px); width: 44px; height: 44px; border-radius: 14px; }
  .auth-mark span { left: 57px; font-size: 22px; }
  .auth-story .kicker { margin-bottom: 12px; }
  .auth-story h1 { margin-bottom: 15px; font-size: 40px; letter-spacing: -1.6px; }
  .auth-story > p:not(.kicker) { max-width: 350px; margin: 0 auto; font-size: 12px; }
  .auth-features { justify-content: center; margin-top: 20px; }
}
@media (max-width: 600px) {
  .sidebar { padding: 13px 17px 0; gap: 12px; }
  .nav { margin-inline: -17px; padding-inline: 17px; padding-bottom: 11px; }
  .main { padding: 22px 17px calc(34px + env(safe-area-inset-bottom)); }
  .topbar { align-items: center; gap: 10px; }
  .topbar h1 { font-size: 21px; }
  .topbar .kicker { margin-bottom: 5px; font-size: 8px; }
  .live { padding: 7px 10px; font-size: 10px; }
  .apk-chip { display: none; }
  .scan-view.active { grid-template-columns: minmax(0, 1fr); min-height: 0; margin-top: 22px; padding: 27px 19px 19px; gap: 27px; border-radius: 23px; }
  .scan-copy h2 { max-width: 370px; margin-bottom: 16px; font-size: clamp(32px, 8.8vw, 39px); letter-spacing: -1.7px; }
  .scan-copy > p:last-child { font-size: 12px; line-height: 1.7; }
  .scanner-card { padding: 19px 16px; border-radius: 17px; }
  .scanner-head { margin-bottom: 18px; }
  .input-action input { font-size: 13px; }
  .device-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .device-actions .soft-button { padding-inline: 6px; font-size: 10px; }
  .soft-button { min-height: 42px; }
  .page-card { margin: 22px 0 0; padding: 25px 19px; border-radius: 20px; }
  .page-title h2, .section-head h2, .page-heading h2, .cancellation-heading h2, .cancellation-table-heading h2 { font-size: 26px; letter-spacing: -.8px; }
  .lookup-card { padding: 17px; }
  .section-head { margin-top: 29px; gap: 12px; align-items: flex-start; }
  .section-head .link-button { font-size: 10px; }
  .cancellation-heading h2 { margin-bottom: 10px; }
  .stats, .cancellation-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat, .cancellation-stat { padding: 18px 15px; border-radius: 14px; }
  .stat strong, .cancellation-stat strong { font-size: 29px; }
  .stat::before, .cancellation-stat::before { margin-bottom: 13px; }
  .attention { flex-direction: column; align-items: flex-start; gap: 13px; padding: 19px; }
  .cancellation-workspace { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cancellation-panel { padding: 21px 18px; }
  .cancellation-filters, .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
  .cancellation-filters > input[type='search'], .filters > input[type='search'] { grid-column: 1 / -1; }
  .cancellation-filters > .soft-button, .filters > .soft-button { grid-column: 1 / -1; }
  .decision-actions { grid-template-columns: 1fr 1fr; }
  .decision-actions .reset-button { grid-column: 1 / -1; }
  .table-wrap { border-radius: 13px; }
  .import-grid { grid-template-columns: minmax(0, 1fr); }
  .file-field { min-height: 145px; }
  .download-card { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .download-card > .primary-button { grid-column: 1; width: 100%; }
  .auth-screen { padding: 32px 20px; }
  .auth-layout { gap: 28px; }
  .auth-story h1 { font-size: 34px; }
  .auth-story > p:not(.kicker) { font-size: 11px; line-height: 1.7; }
  .auth-features { gap: 6px; }
  .auth-features span { padding: 7px 9px; font-size: 9px; }
  .auth-card { padding: 27px 24px; border-radius: 23px; }
  .auth-card-header h2 { font-size: 23px; }
  .auth-form input { font-size: 16px; }
  .page-heading { margin-top: 26px; }
  .user-workspace, .account-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .settings-card { padding: 23px 18px; border-radius: 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .user-workspace .permission-grid, .permission-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .permission-option { padding: 11px 9px; gap: 7px; }
  .user-card { padding: 16px; }
  .user-card-actions { gap: 6px; }
  .form-actions > .primary-button { flex: 1; }
  .modal { padding: 12px; }
  .modal-card { padding: 18px; max-height: calc(100dvh - 24px); }
  .toast { right: 17px; bottom: calc(17px + env(safe-area-inset-bottom)); left: 17px; max-width: none; }
}
@media (max-width: 360px) {
  .main { padding-inline: 12px; }
  .scan-view.active { padding-inline: 14px; }
  .scan-copy h2 { font-size: 30px; }
  .brand { font-size: 17px; }
  .sidebar-user { grid-template-columns: 28px; }
  .sidebar-user > div:not(.avatar) { display: none; }
  .auth-card { padding-inline: 20px; }
  .permission-grid, .user-workspace .permission-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
