/* GL Motors theme — colours & fonts taken from glmotors.net */
:root {
  --blue-50: #f3f8fd;
  --blue-100: #e7f0fa;
  --blue-200: #cfe3f7;
  --blue-400: #4f97d8;
  --blue-500: #1f7cc6;
  --blue-600: #0664ae;
  --blue-700: #04528f;
  --blue-800: #033f6e;
  --cloud: #f5f4f0;
  --paper: #fbfaf7;
  --white: #ffffff;
  --ink: #0b1628;
  --ink-2: #3a4658;
  --muted: #677386;
  --line: #0b16281a;
  --green: #0f8a4f;
  --green-bg: #e6f6ee;
  --amber: #a15c00;
  --amber-bg: #fff4e0;
  --red: #c62828;
  --red-bg: #fef3f2;
  --r-md: 16px;
  --r-lg: 24px;
  --shadow: 0 24px 60px -36px #0b162873;
  --shadow-blue: 0 16px 34px -16px #0664aeb3;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* role tokens (redefined for dark below) */
  --link: var(--blue-600);
  --tint-ink: var(--blue-700);
  --input-border: #c9c4b9;
  --gray-bg: #eceae4;
  --success-ink: #006300;
  --critical-ink: #c62828;
  --critical: #d03b3b;
  /* charts — single-series brand blue; ordinal ramp for aging; 3 validated categorical slots for plan mix */
  --chart-1: #0664ae;
  --chart-1-soft: #9cc6ee;
  --chart-grid: #e8e6df;
  --chart-axis: #c3c2b7;
  --seq-1: #86b6ef; --seq-2: #3987e5; --seq-3: #256abf; --seq-4: #184f95;
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a;
  --tooltip-bg: #0b1628;
  --tooltip-ink: #ffffff;
  color-scheme: light;
}

/* ---------- dark theme (OS preference, unless the user picked light) ---------- */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --cloud: #0a111d; --white: #111a2a; --paper: #162134;
    --ink: #e8eef7; --ink-2: #b9c5d6; --muted: #8796ab; --line: #ffffff1a;
    --blue-50: #10243d; --blue-100: #173252; --blue-200: #9cc6ee;
    --link: #6cb4ff; --tint-ink: #a8d2ff; --input-border: #2c3b52; --gray-bg: #232f42;
    --green: #4cd08a; --green-bg: #0f2e22; --amber: #f5b84a; --amber-bg: #33260e; --red: #ff7b72; --red-bg: #3a1618;
    --success-ink: #4cd08a; --critical-ink: #ff7b72;
    --shadow: 0 24px 60px -36px #000000cc;
    --chart-1: #3d9be9; --chart-1-soft: #24496f; --chart-grid: #1f2a3b; --chart-axis: #34445c;
    --seq-1: #1c5cab; --seq-2: #2a78d6; --seq-3: #5598e7; --seq-4: #9ec5f4;
    --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70;
    --tooltip-bg: #e8eef7; --tooltip-ink: #0b1628;
  }
}
/* ---------- dark theme (picked with the toggle) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --cloud: #0a111d; --white: #111a2a; --paper: #162134;
  --ink: #e8eef7; --ink-2: #b9c5d6; --muted: #8796ab; --line: #ffffff1a;
  --blue-50: #10243d; --blue-100: #173252; --blue-200: #9cc6ee;
  --link: #6cb4ff; --tint-ink: #a8d2ff; --input-border: #2c3b52; --gray-bg: #232f42;
  --green: #4cd08a; --green-bg: #0f2e22; --amber: #f5b84a; --amber-bg: #33260e; --red: #ff7b72; --red-bg: #3a1618;
  --success-ink: #4cd08a; --critical-ink: #ff7b72;
  --shadow: 0 24px 60px -36px #000000cc;
  --chart-1: #3d9be9; --chart-1-soft: #24496f; --chart-grid: #1f2a3b; --chart-axis: #34445c;
  --seq-1: #1c5cab; --seq-2: #2a78d6; --seq-3: #5598e7; --seq-4: #9ec5f4;
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70;
  --tooltip-bg: #e8eef7; --tooltip-ink: #0b1628;
}
:root[data-theme="dark"] .logo, :root[data-theme="dark"] .receipt img { filter: brightness(0) invert(1); }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .logo { filter: brightness(0) invert(1); }
}

* { box-sizing: border-box; }
/* `hidden` always wins over a class's own display (e.g. a closed dropdown panel is display:flex):
   without this a hidden element stays on the page, invisible but still catching clicks. */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  background: var(--cloud);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--tint-ink); text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 18px; font-weight: 700; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--white);
  border-right: 1px solid var(--line);
  padding: 24px 16px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 500;
}
.nav-link:hover { background: var(--blue-50); color: var(--tint-ink); text-decoration: none; }
.nav-link.active { background: var(--blue-600); color: #fff; box-shadow: var(--shadow-blue); }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; }

.main { padding: 32px 40px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }


/* ---------- cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 24px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-family: var(--font-display); font-weight: 800; font-size: 28px; margin-top: 4px; }
.stat .sub { color: var(--muted); font-size: 12px; }
.stat.primary { background: linear-gradient(135deg, var(--blue-600), var(--blue-800)); color: #fff; border: 0; box-shadow: var(--shadow-blue); }
.stat.primary .label, .stat.primary .sub { color: var(--blue-200); }
.stat.danger .value { color: var(--red); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  font: 600 14px var(--font-body); cursor: pointer;
  border: 1px solid transparent; transition: background .15s, transform .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: var(--shadow-blue); }
.btn-primary:hover { background: var(--blue-700); color: #fff; }
.btn-light { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn-light:hover { background: var(--blue-50); color: var(--tint-ink); }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: #f5c2c0; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--paper); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-blue { background: var(--blue-100); color: var(--tint-ink); }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-gray { background: var(--gray-bg); color: var(--ink-2); }

/* ---------- forms ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.input {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--input-border); border-radius: 12px; background: var(--white);
  font: 15px var(--font-body); color: var(--ink);
}
textarea.input { height: auto; padding: 10px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px var(--blue-100); }
.toolbar .input { width: auto; min-width: 240px; flex: 1; max-width: 380px; }
.toolbar select.input, .toolbar input[type=date].input { min-width: 0; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--ink-2); }
.field.full { grid-column: 1 / -1; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.field .error, .errorlist { color: var(--red); font-size: 13px; margin: 4px 0 0; padding: 0; list-style: none; }
.field.check { display: flex; align-items: center; gap: 10px; }
.field.check label { margin: 0; }
.checkbox { width: 18px; height: 18px; accent-color: var(--blue-600); }
.form-actions { display: flex; gap: 8px; margin-top: 24px; }
.hint { background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--tint-ink); padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; }

/* ---------- uploads ---------- */
.form-section { grid-column: 1 / -1; padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }
.form-section h3 { font-size: 15px; font-weight: 700; }
.form-section p { margin: 2px 0 0; }
.grid > .card { margin-top: 0; }
.field .dropzone, .dropzone {
  position: relative; display: flex; margin: 0; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 150px; padding: 14px; border: 2px dashed var(--input-border); border-radius: 14px; background: var(--paper);
  cursor: pointer; text-align: center; transition: border-color .15s, background .15s; overflow: hidden;
}
.dropzone:hover { border-color: var(--blue-500); background: var(--blue-50); }
.dropzone.has-error { border-color: var(--red); background: var(--red-bg); }
.dropzone--multi { min-height: 96px; }
.dropzone__preview { max-width: 100%; max-height: 160px; border-radius: 10px; object-fit: contain; }
.dropzone__icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-100); color: var(--link); }
.dropzone__icon svg { width: 20px; height: 20px; }
.dropzone__text { font-size: 13px; font-weight: 600; color: var(--tint-ink); word-break: break-all; }
.dropzone__pdf { display: inline-grid; place-items: center; width: 52px; height: 64px; border-radius: 8px; background: var(--red-bg); color: var(--red); font-weight: 800; font-size: 13px; border: 1px solid #f5c2c0; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.person-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.avatar--lg { width: 72px; height: 72px; }
.avatar--xl { width: 112px; height: 112px; font-size: 42px; }
.avatar--initials { background: var(--blue-100); color: var(--tint-ink); font-weight: 700; font-family: var(--font-display); }
.avatar--lg.avatar--initials { font-size: 28px; }
.thumb { width: 56px; height: 42px; border-radius: 8px; object-fit: cover; flex: none; background: var(--paper); border: 1px solid var(--line); }
.thumb--empty { display: inline-block; background: repeating-linear-gradient(45deg, var(--gray-bg) 0 6px, var(--paper) 6px 12px); }

.docs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.doc__label { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.doc__box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 150px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); overflow: hidden; }
.doc__box img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.doc__box:hover img { transform: scale(1.04); }
.doc__box--empty { color: var(--muted); font-size: 13px; border-style: dashed; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.gallery__item { margin: 0; }
.gallery__item a { display: block; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gallery__item a:hover img { transform: scale(1.05); }
.gallery__empty { display: grid !important; place-items: center; border-style: dashed !important; color: var(--link); font-weight: 600; }
.gallery__empty:hover { background: var(--blue-50); text-decoration: none; }
.gallery__item figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; margin-top: 6px; color: var(--ink-2); }

/* ---------- details ---------- */
dl.info { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; margin: 0; }
dl.info dt { color: var(--muted); font-size: 13px; }
dl.info dd { margin: 0; font-weight: 500; }
.progress { height: 10px; background: var(--blue-100); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue-500), var(--blue-600)); border-radius: 999px; }

/* ---------- messages ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.messages li { padding: 12px 16px; border-radius: 12px; font-weight: 500; }
.messages .success { background: var(--green-bg); color: var(--green); }
.messages .warning { background: var(--amber-bg); color: var(--amber); }
.messages .error { background: var(--red-bg); color: var(--red); }
.messages .info { background: var(--blue-50); color: var(--tint-ink); }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 16px; align-items: center; }

/* ---------- login (split screen) ---------- */
.auth-split { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }

/* left: brand side */
.auth-brand {
  position: relative; overflow: hidden; color: #fff;
  display: flex; flex-direction: column; padding: 40px 48px 28px;
  background: linear-gradient(160deg, var(--blue-500) 0%, var(--blue-600) 40%, var(--blue-800) 100%);
}
.auth-brand__glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(40% 45% at 18% 15%, #78c8ff55, transparent 70%),
              radial-gradient(45% 50% at 90% 60%, #02285a99, transparent 70%);
}
.auth-brand__top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.auth-brand__logo { width: 150px; height: auto; filter: brightness(0) invert(1); }
.auth-pill { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: #ffffff1f; border: 1px solid #ffffff33; backdrop-filter: blur(6px); }
.auth-brand__copy { position: relative; margin-top: 7vh; max-width: 460px; z-index: 2; }
.auth-brand__copy h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.05; font-weight: 800; animation: rise .8s var(--ease, ease) both .2s; }
.auth-brand__copy h1 span { color: var(--blue-200); }
.auth-brand__copy p { color: #dbeafb; font-size: 16px; margin: 16px 0 0; animation: rise .8s ease both .45s; }
.auth-chips { display: flex; gap: 8px; margin-top: 20px; }
.auth-chip { font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; background: #fff; color: var(--blue-700); animation: rise .6s ease both var(--d); }
.auth-brand__foot { position: absolute; z-index: 3; left: 48px; bottom: 12px; font-size: 12px; color: #cfe3f7aa; }
.auth-brand { padding-bottom: 0; }
.auth-split > * { min-width: 0; }

/* the scene */
.scene { position: relative; flex: 1; min-height: 300px; margin: 0 -48px; }
.scene__sun { position: absolute; right: 14%; top: 8%; width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, #fff6d6 0%, #ffe9a3 45%, transparent 70%); opacity: .55; animation: pulse 5s ease-in-out infinite; }
.scene__layer { position: absolute; left: 0; width: 200%; display: flex; }
.scene__layer svg { width: 50%; height: 100%; display: block; }
.scene__city--far { bottom: 92px; height: 120px; animation: drive-bg 38s linear infinite; }
.scene__city--far svg { fill: #ffffff14; }
.scene__city--near { bottom: 92px; height: 90px; animation: drive-bg 20s linear infinite; }
.scene__city--near svg { fill: #02285a66; }
.scene__road { position: absolute; left: 0; right: 0; bottom: 0; height: 92px;
  background: linear-gradient(180deg, #0b1628 0%, #121f36 100%); border-top: 4px solid #ffffff22; }
.scene__lane { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px;
  background: repeating-linear-gradient(90deg, #ffffffcc 0 46px, transparent 46px 92px);
  animation: lane .55s linear infinite; }

.bajaj { position: absolute; bottom: 30px; left: 50%; width: min(330px, 62%); margin-left: calc(min(330px, 62%) / -2);
  animation: drive-in 1.8s cubic-bezier(.2, .8, .2, 1) both .3s; z-index: 2; }
.bajaj__body { position: relative; display: block; width: 100%; height: auto; transform-origin: 30% 95%;
  animation: bob .32s ease-in-out infinite alternate; filter: drop-shadow(0 18px 18px #00000040); }
.bajaj__shadow { position: absolute; left: 6%; right: 2%; bottom: -6px; height: 22px; border-radius: 50%;
  background: radial-gradient(closest-side, #000000aa, transparent); animation: shadow .32s ease-in-out infinite alternate; }

/* speed streaks behind (bajaj faces left, so streaks trail to the right) */
.bajaj__speed { position: absolute; left: 88%; top: 30%; width: 180px; height: 50%; pointer-events: none; }
.bajaj__speed i { position: absolute; left: 0; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #ffffffaa, transparent);
  animation: streak .9s linear infinite; }
.bajaj__speed i:nth-child(1) { top: 5%;  width: 90px;  animation-delay: 0s; }
.bajaj__speed i:nth-child(2) { top: 35%; width: 140px; animation-delay: .25s; }
.bajaj__speed i:nth-child(3) { top: 62%; width: 70px;  animation-delay: .5s; }
.bajaj__speed i:nth-child(4) { top: 88%; width: 110px; animation-delay: .7s; }

/* dust puffs from the rear wheel */
.bajaj__dust { position: absolute; right: -4%; bottom: 0; width: 60px; height: 40px; pointer-events: none; }
.bajaj__dust i { position: absolute; left: 0; bottom: 0; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle, #e8eef7cc, #e8eef700 70%);
  filter: blur(1px); animation: puff 1.1s ease-out infinite; }
.bajaj__dust i:nth-child(2) { animation-delay: .35s; width: 14px; height: 14px; }
.bajaj__dust i:nth-child(3) { animation-delay: .7s; width: 22px; height: 22px; }

@keyframes drive-in { from { transform: translateX(120vw) rotate(-2deg); } 70% { transform: translateX(-12px) rotate(1deg); } to { transform: none; } }
@keyframes bob { from { transform: translateY(0) rotate(0); } to { transform: translateY(-3px) rotate(-.6deg); } }
@keyframes shadow { from { transform: scaleX(1); opacity: .9; } to { transform: scaleX(.95); opacity: .7; } }
@keyframes drive-bg { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@keyframes lane { from { background-position-x: 0; } to { background-position-x: 92px; } }
@keyframes streak { from { transform: translateX(-20px); opacity: 0; } 20% { opacity: 1; } to { transform: translateX(160px); opacity: 0; } }
@keyframes puff { from { transform: translate(0, 0) scale(.6); opacity: .9; } to { transform: translate(55px, -22px) scale(1.8); opacity: 0; } }
@keyframes rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { transform: scale(1.12); opacity: .75; } }

/* right: form side */
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--cloud); }
.auth-form__inner { width: 100%; max-width: 380px; animation: rise .7s ease both .15s; }
.auth-form__logo { display: none; width: 150px; margin-bottom: 24px; }
.auth-form h2 { font-size: 30px; font-weight: 800; }
.auth-form__inner > p { margin: 6px 0 28px; }
.auth-fields .field { margin-bottom: 18px; }
.auth-fields .input { height: 50px; border-radius: 14px; }
.pw { position: relative; }
.pw .input { padding-right: 70px; }
.pw__toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: var(--blue-50);
  color: var(--tint-ink); font: 600 12px var(--font-body); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.auth-submit { width: 100%; height: 50px; font-size: 15px; margin-top: 6px; }
.auth-submit span { transition: transform .2s; }
.auth-submit:hover span { transform: translateX(4px); }
.auth-form__foot { margin-top: 40px; text-align: center; }

@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { padding: 24px 16px 16px; min-height: 380px; }
  .auth-brand__copy { margin-top: 20px; }
  .auth-brand__copy p, .auth-brand__foot, .auth-pill { display: none; }
  .scene { margin: 0 -16px; min-height: 220px; }
  .bajaj { width: 200px; margin-left: -100px; bottom: 26px; }
  .auth-form { padding: 32px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth *, .auth *::before, .auth *::after { animation: none !important; }
}

/* ---------- receipt / print ---------- */
.receipt { max-width: 520px; margin: 0 auto; }
.receipt img { width: 140px; }
.receipt .amount { font-family: var(--font-display); font-weight: 800; font-size: 40px; color: var(--link); }
@media print {
  .sidebar, .modbar, .sidebar-scrim, .no-print, .messages { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 40px; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  dl.info { grid-template-columns: 130px 1fr; }
  .toolbar .input { max-width: none; }
}

/* =====================================================================
   Layout switch, theme switch & dashboard
   ===================================================================== */
body { transition: background-color .2s, color .2s; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--white); color: var(--ink-2); cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.icon-btn:hover { background: var(--blue-50); color: var(--tint-ink); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.user__meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.user__meta strong { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* icon swaps: show the icon of what a click will switch TO */
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }

/* ---------- dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi__label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.kpi__value { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.15; color: var(--ink); }
.kpi__value--warn { color: var(--critical-ink); }
.kpi__sub { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi--hero { background: linear-gradient(135deg, #0b7bd0, #0664ae 45%, #033f6e); border: 0; box-shadow: var(--shadow-blue); }
.kpi--hero .kpi__label, .kpi--hero .kpi__sub { color: #cfe3f7; }
.kpi--hero .kpi__value { color: #fff; }
.kpi--hero .delta { background: #ffffff26; color: #fff; }
.delta { font-weight: 700; font-size: 12px; padding: 1px 7px; border-radius: 999px; }
.delta.up { color: var(--success-ink); background: var(--green-bg); }
.delta.down { color: var(--critical-ink); background: var(--red-bg); }
.meter { height: 6px; border-radius: 999px; background: var(--blue-100); overflow: hidden; margin: 4px 0 2px; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--chart-1); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot--critical { background: var(--critical); }

.dash-grid { display: grid; gap: 20px; margin-bottom: 20px; }
.dash-grid > .card { margin-top: 0; min-width: 0; }
.dash-grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.dash-grid--1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid--1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
.chart-card { display: flex; flex-direction: column; }
.chart-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.chart-card__head p { margin: 2px 0 0; }
.chart-box { position: relative; flex: 1 1 auto; min-height: 240px; }
.chart-box--tall { min-height: 290px; }
.chart-box--short { flex: 0 0 auto; height: 170px; min-height: 0; }
.chart-table { margin-top: 12px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: 12.5px; width: max-content; }
.chart-table table { margin-top: 8px; }
.chart-table td, .chart-table th { padding: 6px 10px; }
.chart-table > table { display: block; max-height: 220px; overflow: auto; }

.segbar { display: flex; gap: 2px; height: 14px; border-radius: 999px; overflow: hidden; margin: 4px 0 14px; }
.segbar__seg { min-width: 4px; }
.seg-1 { background: var(--cat-1); } .seg-2 { background: var(--cat-2); } .seg-3 { background: var(--cat-3); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 42px; align-items: center; gap: 10px; font-size: 14px; }
.legend__swatch { width: 12px; height: 12px; border-radius: 3px; }
.legend__name { color: var(--ink-2); font-weight: 500; }
.legend__val { font-weight: 700; font-variant-numeric: tabular-nums; }
.legend__pct { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }

.ranklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ranklist li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.ranklist li:last-child { border-bottom: 0; }
.ranklist__name { flex: 1; display: flex; flex-direction: column; font-weight: 600; min-width: 0; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.mini-stats > div { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.mini-stats strong { font-family: var(--font-display); font-size: 20px; }

@media (max-width: 1100px) {
  .dash-grid--2-1, .dash-grid--1-1, .dash-grid--1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi__value { font-size: 22px; }
}

/* ---------- logout icon ---------- */
.logout-form { display: inline-flex; margin: 0 0 0 4px; }
.icon-btn--logout:hover { background: var(--red-bg); color: var(--critical-ink); border-color: transparent; }

/* ---------- logs ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: -1px; position: relative; z-index: 1; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 14px 14px 0 0;
  color: var(--ink-2); font-weight: 600; border: 1px solid transparent; border-bottom: 0;
}
.tab svg { width: 17px; height: 17px; }
.tab:hover { color: var(--tint-ink); background: var(--blue-50); text-decoration: none; }
.tab.active { background: var(--white); color: var(--link); border-color: var(--line); }
.tab__count { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--gray-bg); color: var(--ink-2); }
.tab__count--alert { background: var(--red-bg); color: var(--critical-ink); }
.tab-panel { border-top-left-radius: 0; }
.nowrap { white-space: nowrap; }
.log-table td { vertical-align: top; }
.changes details summary { cursor: pointer; color: var(--link); font-weight: 600; font-size: 13px; }
.diff { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; font-size: 13px; max-width: 520px; }
.diff dt { color: var(--muted); }
.diff dd { margin: 0; word-break: break-word; }
.diff__old { color: var(--critical-ink); text-decoration: line-through; text-decoration-thickness: 1px; }
.diff__new { color: var(--success-ink); font-weight: 600; }
.err-type { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px; color: var(--critical-ink); }
.err-msg { max-width: 420px; word-break: break-word; }
.err-message { font-size: 15px; font-weight: 500; margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--red-bg); color: var(--critical-ink); word-break: break-word; }
.traceback {
  margin: 0; padding: 16px; border-radius: 12px; background: #0b1628; color: #d6e2f2; overflow: auto; max-height: 520px;
  font: 12.5px/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; white-space: pre;
}

/* ---------- reports ---------- */
.report-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--white); border: 1px solid var(--line); }
.seg__btn { padding: 8px 18px; border-radius: 9px; font-weight: 600; color: var(--ink-2); font-size: 14px; }
.seg__btn:hover { background: var(--blue-50); color: var(--tint-ink); text-decoration: none; }
.seg__btn.active { background: var(--blue-600); color: #fff; box-shadow: var(--shadow-blue); }
.period-nav { display: flex; align-items: center; gap: 8px; }
.period-nav .input { width: auto; height: 38px; }
.icon-btn.is-disabled { opacity: .35; cursor: default; transform: none; }
.report-breakdowns { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
table.compact th, table.compact td { padding: 8px 6px; font-size: 13.5px; }
.barlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.barlist__top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 500; }
.barlist__track { height: 8px; border-radius: 999px; background: var(--blue-100); overflow: hidden; margin: 5px 0 3px; }
.barlist__track > span { display: block; height: 100%; border-radius: 999px; background: var(--chart-1); min-width: 2px; }
.barlist__sub { font-size: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--white); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font: 600 12.5px var(--font-body); cursor: pointer; }
.chip span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.chip:hover { background: var(--blue-50); }
.chip.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.chip.active span { color: var(--blue-200); }
@media (max-width: 1100px) { .report-breakdowns { grid-template-columns: 1fr; } }
@media print {
  .report-bar, .chart-table, .chips { display: none !important; }
  .kpi--hero { background: #fff !important; box-shadow: none; border: 1px solid #ccc; }
  .kpi--hero .kpi__value, .kpi--hero .kpi__label, .kpi--hero .kpi__sub { color: #000 !important; }
  .dash-grid, .kpis { break-inside: avoid; }
}
table.compact th { letter-spacing: .03em; }
table.compact th, table.compact td { padding: 8px 4px; font-size: 13px; }
table.compact th { font-size: 10.5px; letter-spacing: .02em; }
table.compact td:first-child, table.compact th:first-child { padding-left: 0; }
table.compact td:last-child, table.compact th:last-child { padding-right: 0; }

.gallery__empty--static { display: grid; place-items: center; aspect-ratio: 4 / 3; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted) !important; }

/* ---------- users & roles ---------- */
.role-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.role-admin { background: var(--blue-600); color: #fff; }
.role-manager { background: var(--blue-100); color: var(--tint-ink); }
.role-cashier { background: var(--green-bg); color: var(--green); }
.role-viewer { background: var(--gray-bg); color: var(--ink-2); }
.roles-table th.center, .roles-table td.center { text-align: center; }
.roles-table td { padding: 9px 12px; }
.tick { color: var(--success-ink); font-weight: 800; font-size: 16px; }
.cross { color: var(--muted); }
.role-notes { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.role-notes .role-badge { margin-right: 6px; min-width: 96px; text-align: center; }
.row-disabled td { opacity: .55; }
.icon-btn--sm { width: 34px; height: 34px; vertical-align: middle; margin-left: 4px; }
.icon-btn--sm svg { width: 16px; height: 16px; }
.no-access-icon { width: 64px; height: 64px; margin: 4px auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--red-bg); color: var(--critical-ink); }
.no-access-icon svg { width: 30px; height: 30px; }

/* ---------- branch bar (which branch's data is shown) ---------- */
.scope-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.scope-bar strong { color: var(--ink); }
.scope-bar .input { width: auto; min-width: 200px; padding-top: 6px; padding-bottom: 6px; }

/* ---------- MOT checklist ---------- */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
.checklist .mark { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.checklist .ok .mark { background: var(--green-bg); color: var(--green); }
.checklist .bad .mark { background: var(--red-bg); color: var(--red); }
.checklist .bad { border-color: color-mix(in srgb, var(--red) 35%, transparent); }

.checklist .mark { color: inherit; }
.checklist .item-ico { flex: none; color: var(--muted); display: inline-flex; }
.checklist .mark svg { display: block; }

/* icons inside badges and buttons */
.mot-ico { flex: none; vertical-align: -0.2em; }
.badge .mot-ico { margin-right: 4px; vertical-align: -3px; }
.badge-icon { display: inline-flex; align-items: center; gap: 4px; }
.btn .mot-ico { margin-right: 6px; }

/* ---------- MOT form ---------- */
.mot-step { padding: 4px 0 22px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.mot-step:last-of-type { border-bottom: 0; }
.mot-step__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mot-step__title { display: flex; align-items: center; gap: 10px; font-size: 17px; margin: 0 0 14px; }
.mot-step__head .mot-step__title { margin: 0; }
.mot-step__n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--blue-500); color: #fff; font-size: 14px; font-weight: 700; }
.mot-step__tools { display: flex; gap: 8px; }
.mot-step__hint { margin: 8px 0 14px; }
.mot-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.whose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.whose__opt { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; cursor: pointer;
  border: 1.5px solid var(--input-border, var(--line)); border-radius: 14px; background: var(--white); transition: border-color .15s, box-shadow .15s, background .15s; }
.whose__opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.whose__opt:hover { border-color: var(--blue-400); }
.whose__opt.is-on, .whose__opt:has(input:checked) { border-color: var(--blue-500); background: var(--blue-50); box-shadow: 0 0 0 3px var(--blue-100); }
.whose__opt:has(input:focus-visible) { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.whose__ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--blue-100); color: var(--tint-ink); }
.whose__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.whose__text strong { font-size: 15px; }
.whose__text small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.mot-new { margin: 18px 0 0; padding: 16px 18px 18px; border: 1.5px dashed var(--input-border, var(--line)); border-radius: 14px; min-width: 0; }
.mot-new legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-weight: 700; font-size: 14px; }
.mot-new > p { margin: 0 0 12px; }

.mot-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.mot-item { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; cursor: pointer;
  border: 1.5px solid var(--input-border, var(--line)); border-radius: 14px; background: var(--white); user-select: none;
  transition: border-color .15s, background .15s, transform .1s; }
.mot-item:active { transform: scale(.98); }
.mot-item input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mot-item:has(input:focus-visible) { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.mot-item__ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--red-bg); color: var(--red); transition: background .15s, color .15s; }
.mot-item__label { font-weight: 600; font-size: 14px; line-height: 1.3; }
.mot-item__state { font-size: 12.5px; font-weight: 700; }
.mot-item__state > span { display: inline-flex; align-items: center; gap: 5px; }
.mot-item__ok { display: none !important; color: var(--green); }
.mot-item__bad { color: var(--red); }
.mot-item.is-ok, .mot-item:has(input:checked) { border-color: color-mix(in srgb, var(--green) 55%, transparent); background: var(--green-bg); }
.mot-item.is-ok .mot-item__ico, .mot-item:has(input:checked) .mot-item__ico { background: var(--green); color: #fff; }
.mot-item.is-ok .mot-item__ok, .mot-item:has(input:checked) .mot-item__ok { display: inline-flex !important; }
.mot-item.is-ok .mot-item__bad, .mot-item:has(input:checked) .mot-item__bad { display: none !important; }

.mot-result { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 18px; border-radius: 14px;
  border: 1.5px solid transparent; }
.mot-result strong { display: block; font-size: 20px; letter-spacing: .04em; }
.mot-result span[data-result-sub] { font-size: 13.5px; }
.mot-result__ico { display: none; }
.mot-result.is-pass { background: var(--green-bg); color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.mot-result.is-fail { background: var(--red-bg); color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.mot-result.is-pass .mot-result__ico--pass, .mot-result.is-fail .mot-result__ico--fail { display: inline-flex; }

/* MOT form: a photo of the problem under each checklist tile (shown only while the item is "Not OK") */
.mot-cell { display: flex; flex-direction: column; gap: 6px; }
.mot-cell .mot-item { flex: 1; }
.mot-evidence { display: none; align-items: center; gap: 6px; padding: 7px 10px; border: 1.5px dashed color-mix(in srgb, var(--red) 40%, transparent);
  border-radius: 10px; font-size: 12.5px; font-weight: 600; color: var(--red); cursor: pointer; min-width: 0; }
.mot-evidence span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mot-evidence:hover { background: var(--red-bg); }
.mot-evidence input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mot-evidence:has(input:focus-visible) { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.mot-evidence.has-files { border-style: solid; background: var(--red-bg); }
.mot-evidence.has-error { border-color: var(--red); }
.mot-cell:has(.mot-item input:not(:checked)) .mot-evidence,
.mot-evidence.has-files, .mot-evidence.has-error { display: flex; }
.mot-evidence .mot-ico { flex: none; }

/* Multi-photo uploads (static/js/multi-upload.js): thumbnails of the chosen files, × to remove, "Add more" */
.up-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.up-strip[hidden] { display: none; }
.up-tile { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.up-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-tile__doc { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 800; font-size: 13px; color: var(--red); }
.up-tile__x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0;
  background: #0b1628cc; color: #fff; font-size: 15px; line-height: 22px; cursor: pointer; }
.up-tile__x:hover, .up-tile__x:focus-visible { background: var(--red); }
.up-more { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 72px; height: 72px;
  border-radius: 10px; border: 1.5px dashed var(--input-border); background: transparent; color: var(--link); font: 600 11.5px var(--font-body); cursor: pointer; }
.up-more span { font-size: 20px; line-height: 1; }
.up-more:hover { background: var(--blue-50); border-color: var(--blue-500); }
.mot-cell .up-strip { gap: 6px; margin-top: 0; }
.mot-cell .up-tile, .mot-cell .up-more { width: 52px; height: 52px; }
.mot-cell .up-more { font-size: 10px; }

/* MOT detail: evidence */
.ev-count { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.ev-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--red-bg); color: var(--red); }
.ev-tag--general { background: var(--paper); color: var(--ink-2); }
.gallery__pdf { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 800; font-size: 22px; color: var(--red); }
.ev-upload { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.ev-upload h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }

/* MOT detail: big result */
.mot-verdict { display: flex; align-items: center; gap: 12px; }
.mot-verdict .mot-ico { width: 34px; height: 34px; }
@media (max-width: 720px) {
  .whose, .mot-grid-3 { grid-template-columns: 1fr; }
  .mot-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- small helpers for the new pages ---------- */
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.alert-list li:last-child { border-bottom: 0; }
.money-in { color: var(--green); }
.money-out { color: var(--red); }
tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
@media (max-width: 960px) {
  .scope-bar { flex-wrap: wrap; }
  .scope-bar .input { flex: 1; min-width: 0; }
}

/* ---------- my profile ---------- */
.user__link { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: inherit; border-radius: 12px; }
.user__link:hover { text-decoration: none; }
.user__link:hover strong { color: var(--tint-ink); }

/* ---------- language button ---------- */
.lang-form { display: inline-flex; margin: 0; }
.lang-btn { display: inline-flex; align-items: center; justify-content: center; width: auto; padding: 0 9px; gap: 5px; }
.lang-btn__code { font: 700 12px var(--font-body); letter-spacing: .04em; }
.auth-form { position: relative; }
.auth-form__lang { position: absolute; top: 18px; right: 18px; }

/* ---------- app loader (animated Bajaj) ---------- */
.app-loader {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center; padding: 16px;
  background:
    radial-gradient(60% 50% at 50% 40%, color-mix(in srgb, var(--blue-500) 14%, transparent), transparent 70%),
    color-mix(in srgb, var(--cloud) 92%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .35s ease, visibility 0s linear .35s;
}
.app-loader.is-active { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .25s ease; }
.app-loader__card {
  width: min(320px, 100%); padding: 28px 28px 22px; text-align: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  transform: translateY(8px) scale(.98); transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.app-loader.is-active .app-loader__card { transform: none; }
.app-loader__logo { height: 34px; width: auto; margin: 0 auto 10px; display: block; }
.app-loader__stage { position: relative; width: 200px; max-width: 100%; margin: 0 auto; }
.app-loader__shadow {
  position: absolute; left: 22%; right: 14%; bottom: 4px; height: 6px; border-radius: 50%;
  background: var(--ink); opacity: .12; filter: blur(3px);
  animation: ldr-shadow .45s ease-in-out infinite alternate;
}

.ldr { display: block; width: 100%; height: auto; overflow: visible; }
.ldr-body { animation: ldr-bounce .45s ease-in-out infinite alternate; }
.ldr-road { stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 12 9; opacity: .55; animation: ldr-road .4s linear infinite; }
.ldr-speed line { stroke: var(--blue-400); stroke-width: 2.4; stroke-linecap: round; animation: ldr-speed .7s ease-in infinite; }
.ldr-speed line:nth-child(2) { animation-delay: .2s; }
.ldr-speed line:nth-child(3) { animation-delay: .4s; }
.ldr-puff { fill: var(--muted); opacity: 0; transform-box: fill-box; transform-origin: center; animation: ldr-puff 1.2s ease-out infinite; }
.ldr-puff--2 { animation-delay: .4s; }
.ldr-puff--3 { animation-delay: .8s; }

.app-loader__bar { position: relative; height: 4px; margin: 14px auto 12px; width: 180px; max-width: 100%; border-radius: 4px; background: var(--blue-100); overflow: hidden; }
.app-loader__bar span { position: absolute; top: 0; bottom: 0; width: 40%; border-radius: 4px; background: linear-gradient(90deg, var(--blue-400), var(--blue-600)); animation: ldr-bar 1.2s cubic-bezier(.65,.05,.35,1) infinite; }
.app-loader__text { margin: 0; font: 600 13px/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.app-loader__dots i { font-style: normal; animation: ldr-dot 1.2s infinite; }
.app-loader__dots i:nth-child(2) { animation-delay: .2s; }
.app-loader__dots i:nth-child(3) { animation-delay: .4s; }

@keyframes ldr-bounce { from { transform: translateY(0); } to { transform: translateY(-2.5px); } }
@keyframes ldr-shadow { from { transform: scaleX(1); opacity: .14; } to { transform: scaleX(.92); opacity: .08; } }
@keyframes ldr-road { to { stroke-dashoffset: 21; } }
@keyframes ldr-speed { 0% { transform: translateX(14px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateX(-16px); opacity: 0; } }
@keyframes ldr-puff { 0% { transform: translate(0,0) scale(.6); opacity: .45; } 100% { transform: translate(-22px,-10px) scale(2.2); opacity: 0; } }
@keyframes ldr-bar { 0% { left: -40%; } 100% { left: 100%; } }
@keyframes ldr-dot { 0%,20% { opacity: .2; } 40% { opacity: 1; } 100% { opacity: .2; } }

@media (prefers-reduced-motion: reduce) {
  .app-loader *, .app-loader *::before, .app-loader *::after { animation-duration: 2.4s !important; }
  .ldr-body, .ldr-speed line, .ldr-puff, .app-loader__shadow, .ldr-road { animation: none !important; }
}
@media print { .app-loader { display: none !important; } }

/* ---------- setup: tax example ---------- */
.tax-preview { margin-top: 24px; padding: 16px 18px; border: 1px dashed var(--input-border); border-radius: var(--r-md); background: var(--paper); max-width: 420px; transition: opacity .2s ease; }
.tax-preview h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tax-preview.is-off { opacity: .55; }

/* =====================================================================
   Content fit — page content uses the space it has and nothing spills out
   ===================================================================== */
/* wide screens: keep lines readable instead of stretching edge to edge */
.main > * { max-width: 1560px; margin-left: auto; margin-right: auto; }

/* cards and grids that follow each other always get a gap */
.card + .grid, .grid + .card, .grid + .grid, .card + .dash-grid, .dash-grid + .card,
.kpis + .card, .stats + .card, .card + .kpis { margin-top: 20px; }
.grid > *, .dash-grid > *, .kpis > *, .stats > * { min-width: 0; }

/* label / value lists: labels take only the room they need, values wrap inside the card */
dl.info { grid-template-columns: fit-content(42%) minmax(0, 1fr); }
dl.info dt { padding-top: 1px; }
dl.info dd { min-width: 0; overflow-wrap: anywhere; }
dl.info dd .mono, dl.info dd.mono { word-break: break-all; }

/* tables: a little tighter so rows stay on one line; dates never break */
td { font-size: 14.5px; }
td.small, td .small { font-size: 13px; }
.nowrap, td.nowrap { white-space: nowrap; }
td.mono, td .mono { white-space: nowrap; }
.table-wrap { -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 100%; }

/* KPI and stat tiles: numbers shrink to fit their tile */
.kpi__value, .stat .value { font-size: clamp(20px, 1.15rem + .7vw, 28px); overflow-wrap: anywhere; }
.kpi__label { overflow-wrap: anywhere; }

/* forms fill the content width; more columns on wide screens */
.card--form { max-width: none; }
.card--form .form-grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.card--form .tax-preview { max-width: 420px; }

/* page header: long subtitles wrap, buttons stay together */
.page-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-head p { overflow-wrap: anywhere; }

@media (max-width: 960px) {
  td { font-size: 14px; }
}

/* =====================================================================
   Searchable dropdowns (static/js/select-search.js)
   ===================================================================== */
.ss { position: relative; min-width: 0; }
.ss-native { position: absolute !important; inset: auto auto 0 0; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.ss-trigger {
  display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.ss-trigger:hover:not(:disabled) { border-color: var(--blue-400); }
.ss-trigger:disabled { opacity: .6; cursor: not-allowed; }
.ss.is-open .ss-trigger { border-color: var(--blue-500); box-shadow: 0 0 0 4px var(--blue-100); }
.ss-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-trigger.is-placeholder .ss-value { color: var(--muted); }
.ss-chev { width: 16px; height: 16px; flex: none; color: var(--muted); transition: transform .2s ease; }
.ss.is-open .ss-chev { transform: rotate(180deg); color: var(--link); }
.field:has(.errorlist) .ss-trigger { border-color: var(--red); }

.ss-panel {
  position: fixed; z-index: 1000; display: flex; flex-direction: column;
  background: var(--white); color: var(--ink);
  border: 1px solid var(--input-border); border-radius: 14px;
  box-shadow: 0 18px 48px -12px #0b162859, 0 2px 6px #0b16281a;
  overflow: hidden;
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top center;
  transition: opacity .14s ease, transform .14s ease;
}
.ss-panel.is-up { transform-origin: bottom center; transform: translateY(4px) scale(.98); }
.ss-panel.is-shown { opacity: 1; transform: none; }
.ss-search { position: relative; padding: 10px; border-bottom: 1px solid var(--line); flex: none; }
.ss-search svg { position: absolute; left: 22px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ss-input {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  border: 1px solid var(--input-border); border-radius: 10px; background: var(--paper);
  font: 14px var(--font-body); color: var(--ink);
}
.ss-input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); background: var(--white); }
.ss-input::-webkit-search-cancel-button { cursor: pointer; }
.ss-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.ss-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px 9px 32px; border-radius: 9px; cursor: pointer; position: relative;
  font-size: 14px; line-height: 1.35;
}
.ss-option[hidden] { display: none; }
.ss-option.is-active { background: var(--blue-50); color: var(--tint-ink); }
.ss-option.is-selected { font-weight: 600; }
.ss-option.is-selected::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 10px; height: 6px; margin-top: -5px;
  border-left: 2px solid var(--link); border-bottom: 2px solid var(--link); transform: rotate(-45deg);
}
.ss-option.is-empty .ss-text { color: var(--muted); }
.ss-option.is-disabled { opacity: .45; cursor: not-allowed; }
.ss-text { min-width: 0; overflow-wrap: anywhere; }
.ss-text mark { background: color-mix(in srgb, var(--blue-500) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.ss-group { flex: none; font-size: 11.5px; color: var(--muted); }
.ss-empty { padding: 18px 14px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }

/* where dropdowns sit in filter bars */
.toolbar .ss { flex: none; min-width: 180px; max-width: 280px; }
.toolbar .ss .ss-trigger { min-width: 0; max-width: none; width: 100%; }
.scope-bar .ss { min-width: 220px; }
.scope-bar .ss .ss-trigger { width: 100%; height: auto; padding-top: 6px; padding-bottom: 6px; min-height: 38px; }
@media (max-width: 960px) {
  .toolbar .ss { flex: 1 1 100%; max-width: none; }
  .scope-bar .ss { flex: 1; min-width: 0; }
}
@media print { .ss-panel { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .ss-panel, .ss-chev { transition: none; } }

/* ---------- money pages ---------- */
.plain-list { margin: 0; padding-left: 18px; line-height: 1.9; }
.report-bar .seg { flex-wrap: wrap; max-width: 100%; }

/* =====================================================================
   ERP layout: modules in the top bar, the open module's pages in the sidebar
   (fleet/navigation.py, templates/base.html)
   ===================================================================== */
:root { --modbar-h: 60px; --side-w: 252px; }

/* ---- top bar */
.modbar {
  position: sticky; top: 0; z-index: 40; height: var(--modbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 20px 0 14px;
  background: color-mix(in srgb, var(--white) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.modbar__brand { flex: none; display: block; padding: 0 6px; }
.modbar__brand img { height: 30px; width: auto; display: block; }
.modbar__tools { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.modbar__user { display: flex; align-items: center; gap: 8px; padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line); }
.modbar__user .user__meta { line-height: 1.3; max-width: 150px; }

/* ---- all modules (apps grid) */
.apps { position: relative; }
.apps__panel {
  position: absolute; top: calc(100% + 10px); right: -8px; z-index: 60; width: 340px; max-width: calc(100vw - 24px);
  padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--white);
  box-shadow: 0 18px 48px -12px #0b162859, 0 2px 6px #0b16281a;
}
.apps__title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 2px 4px 10px; }
.apps__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.apps__tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border-radius: 12px;
  color: var(--ink-2); font-size: 13px; font-weight: 600; text-align: center;
}
.apps__tile:hover { background: var(--blue-50); color: var(--tint-ink); text-decoration: none; }
.apps__tile.active { background: var(--blue-50); color: var(--tint-ink); }
.apps__ico, .side-head__ico, .ws-head__ico {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px; color: #fff;
  background: var(--mod-color, var(--blue-600));
}
.apps__ico svg, .side-head__ico svg { width: 22px; height: 22px; }
/* one colour per module, used on its icon tiles */
.apps__ico--home, .side-head__ico--home, .ws--home { --mod-color: #1f7cc6; }
.apps__ico--sales, .side-head__ico--sales, .ws--sales { --mod-color: #0f8a4f; }
.apps__ico--stock, .side-head__ico--stock, .ws--stock { --mod-color: #b4690e; }
.apps__ico--mot, .side-head__ico--mot, .ws--mot { --mod-color: #7a4cc2; }
.apps__ico--finance, .side-head__ico--finance, .ws--finance { --mod-color: #0b6e99; }
.apps__ico--reports, .side-head__ico--reports, .ws--reports { --mod-color: #c2410c; }
.apps__ico--setup, .side-head__ico--setup, .ws--setup { --mod-color: #475569; }
.apps__ico--admin, .side-head__ico--admin, .ws--admin { --mod-color: #be123c; }

/* ---- the open module's sidebar */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--modbar-h)); }
.sidebar {
  position: sticky; top: var(--modbar-h); height: calc(100vh - var(--modbar-h)); padding: 16px 12px 12px;
  display: flex; flex-direction: column; gap: 4px; background: var(--white); border-right: 1px solid var(--line);
}
:root[data-sidebar="closed"] .shell { grid-template-columns: minmax(0, 1fr); }
:root[data-sidebar="closed"] .sidebar { display: none; }
.side-head { display: flex; align-items: center; gap: 12px; padding: 4px 6px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); color: var(--ink); }
.side-head:hover { text-decoration: none; }
.side-head:hover strong { color: var(--tint-ink); }
.side-head__ico { width: 40px; height: 40px; }
.side-head__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.side-head__text strong { font-family: var(--font-display); font-size: 17px; }
.side-head__text small { color: var(--muted); font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sidebar .nav { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; margin: 0 -4px; padding: 6px 4px; }
.nav-sec { display: flex; flex-direction: column; gap: 2px; }
.nav-sec__head { padding: 14px 12px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sidebar .nav-link { padding: 8px 12px; border-radius: 10px; font-size: 14.5px; }
.sidebar .nav-link.active { box-shadow: none; }
.nav-link:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 1px; }
.side-foot { display: none; }

/* ---- module home page (workspace) */
.ws-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.ws-head__ico { width: 56px; height: 56px; border-radius: 16px; }
.ws-head__ico svg { width: 28px; height: 28px; }
.ws-head p { margin: 4px 0 0; color: var(--muted); }
.ws-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.ws-shortcuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 28px; }
.ws-shortcut {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: var(--white); border: 1px solid var(--line); color: var(--ink); font-weight: 600;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.ws-shortcut:hover { text-decoration: none; border-color: var(--mod-color, var(--blue-500)); transform: translateY(-2px); box-shadow: 0 10px 24px -14px #0b162866; color: var(--ink); }
.ws-shortcut__ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; flex: none;
  background: color-mix(in srgb, var(--mod-color, var(--blue-600)) 14%, transparent); color: var(--mod-color, var(--blue-600)); }
.ws-shortcut__ico svg { width: 20px; height: 20px; }
:root[data-theme="dark"] .ws-shortcut__ico { background: color-mix(in srgb, var(--mod-color, var(--blue-600)) 30%, transparent); color: #fff; }
.ws-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.ws-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg, 18px); padding: 16px 12px 10px; }
.ws-card h2 { font-size: 15px; padding: 0 8px 8px; }
.ws-card ul { list-style: none; margin: 0; padding: 0; }
.ws-card a { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.ws-card a svg { width: 18px; height: 18px; flex: none; color: var(--mod-color, var(--muted)); }
.ws-card a span { flex: 1; }
.ws-card a:hover { background: var(--blue-50); color: var(--tint-ink); text-decoration: none; }
.ws-card a .chev { width: 16px; height: 16px; color: var(--muted); opacity: 0; transition: opacity .15s, transform .15s; }
.ws-card a:hover .chev { opacity: 1; transform: translateX(2px); }

/* ---- medium screens: icons only in the module bar (the name shows on hover) */
@media (min-width: 961px) and (max-width: 1320px) {
  .modbar__user .user__meta { display: none; }
}

/* ---- phones and small tablets: the sidebar slides in; modules are in the sidebar foot and the apps grid */
@media (max-width: 960px) {
  .modbar { padding: 0 10px; gap: 8px; }
  .modbar__brand img { height: 26px; }
  .modbar__user { padding-left: 8px; border-left: 0; }
  .modbar__user .user__meta { display: none; }
  .modbar__tools .lang-form { display: none; }
  .shell, :root[data-sidebar="closed"] .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar, :root[data-sidebar="closed"] .sidebar {
    display: flex; position: fixed; inset: 0 auto 0 0; top: 0; height: 100%; width: min(300px, 86vw); z-index: 70;
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 65; background: #0b162873; }
  .side-foot { display: block; border-top: 1px solid var(--line); padding-top: 10px; }
  .side-foot__tools { display: flex; align-items: center; gap: 10px; padding: 0 6px 10px; }
  .side-foot__modules { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .side-foot__mod { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 10px; color: var(--ink-2); font-size: 11px; font-weight: 600; text-align: center; }
  .side-foot__mod svg { width: 20px; height: 20px; }
  .side-foot__mod.active, .side-foot__mod:hover { background: var(--blue-50); color: var(--tint-ink); text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .ws-shortcut { transition: none; } }

/* ---- top-bar search (static/js/global-search.js) */
.gsearch { position: relative; flex: none; width: 220px; display: flex; align-items: center; }
.gsearch__ico { position: absolute; left: 11px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.gsearch__input {
  width: 100%; height: 38px; padding: 0 58px 0 34px; border-radius: 10px; font: 500 14px var(--font-body); color: var(--ink);
  border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 4%, var(--white)); transition: border-color .15s, box-shadow .15s, background .15s;
}
.gsearch__input::placeholder { color: var(--muted); }
.gsearch__input::-webkit-search-cancel-button { display: none; }
.gsearch__input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); background: var(--white); }
.gsearch__kbd { position: absolute; right: 8px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--white);
  font: 600 11px var(--font-body); color: var(--muted); pointer-events: none; }
.gsearch.is-open .gsearch__kbd { display: none; }
.gsearch__list {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; width: max(100%, 380px); max-height: min(440px, 70vh); overflow-y: auto;
  margin: 0; padding: 6px; list-style: none; border: 1px solid var(--line); border-radius: 14px; background: var(--white);
  box-shadow: 0 18px 48px -12px #0b162859, 0 2px 6px #0b16281a;
}
.gsearch__item a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink); }
.gsearch__item a:hover { text-decoration: none; }
.gsearch__item.is-active a { background: var(--blue-50); color: var(--tint-ink); }
.gsearch__label { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch__meta { flex: none; font-size: 12px; color: var(--muted); }
.gsearch__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--mod-color, var(--blue-600)); }
.gsearch__dot--home { --mod-color: #1f7cc6; } .gsearch__dot--sales { --mod-color: #0f8a4f; } .gsearch__dot--stock { --mod-color: #b4690e; }
.gsearch__dot--mot { --mod-color: #7a4cc2; } .gsearch__dot--finance { --mod-color: #0b6e99; } .gsearch__dot--reports { --mod-color: #c2410c; }
.gsearch__dot--setup { --mod-color: #475569; } .gsearch__dot--admin { --mod-color: #be123c; }
.gsearch__empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.icon-btn.is-on { background: var(--blue-50); color: var(--tint-ink); }

/* ---- launcher page: no tabs, no sidebar, the search in the middle of the top bar */
.is-launcher [data-toggle-sidebar] { display: none; }
@media (min-width: 961px) {
  .gsearch { position: absolute; left: 50%; transform: translateX(-50%); width: min(460px, 34vw); }
}
.is-launcher .shell { grid-template-columns: minmax(0, 1fr); }
.launcher { max-width: 1040px; margin: 0 auto; padding: 36px 0 40px; }
.launcher__hello { text-align: center; color: var(--muted); margin: 0 0 40px; font-size: 15px; }
.launcher__hello strong { color: var(--ink); }
.launcher__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 36px 12px; }
.launcher__app { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border-radius: 18px; color: var(--ink); text-align: center; }
.launcher__app:hover { text-decoration: none; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.launcher__app:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }
.launcher__ico {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 10px; border-radius: 18px; color: #fff;
  background: var(--mod-color, var(--blue-600));
  background-image: linear-gradient(160deg, #ffffff2e, transparent 55%);
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--mod-color, var(--blue-600)) 70%, transparent), inset 0 -2px 0 #0000001f;
  transition: transform .15s;
}
.launcher__ico svg { width: 30px; height: 30px; }
.launcher__app:hover .launcher__ico { transform: translateY(-3px) scale(1.04); }
.launcher__name { font-weight: 600; font-size: 15px; }
.launcher__sub { font-size: 12.5px; color: var(--muted); }
.launcher__ico--home { --mod-color: #1f7cc6; } .launcher__ico--sales { --mod-color: #0f8a4f; } .launcher__ico--stock { --mod-color: #b4690e; }
.launcher__ico--mot { --mod-color: #7a4cc2; } .launcher__ico--finance { --mod-color: #0b6e99; } .launcher__ico--reports { --mod-color: #c2410c; }
.launcher__ico--setup { --mod-color: #475569; } .launcher__ico--admin { --mod-color: #be123c; }

@media (max-width: 960px) {
  .gsearch, .is-launcher .gsearch { position: relative; left: auto; transform: none; width: 42px; margin-left: auto; }
  .gsearch__input { padding: 0 0 0 34px; }
  .gsearch__input::placeholder { color: transparent; }
  .gsearch__kbd { display: none; }
  .gsearch:focus-within, .is-launcher .gsearch:focus-within { position: absolute; left: 8px; right: 8px; width: auto; margin: 0; z-index: 5; }
  .gsearch:focus-within .gsearch__input { padding-right: 12px; }
  .gsearch:focus-within .gsearch__input::placeholder { color: var(--muted); }
  .gsearch__list { width: 100%; }
  .launcher { padding-top: 16px; }
  .launcher__hello { margin-bottom: 24px; }
  .launcher__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 4px; }
  .launcher__ico { width: 56px; height: 56px; border-radius: 16px; }
  .launcher__ico svg { width: 26px; height: 26px; }
  .launcher__name { font-size: 14px; }
}

/* ---------- roles & permissions (accounts/role_*.html) ---------- */
.role-badge:not([class*="role-admin"]):not([class*="role-manager"]):not([class*="role-cashier"]):not([class*="role-viewer"]) {
  background: var(--amber-bg); color: var(--amber);
}
.role-form .card--form { margin-bottom: 18px; }
.role-form__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.role-form__h { font-size: 17px; margin: 0 0 6px; }
.role-form__head .role-form__h { margin: 0; }
.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.perm-group { margin: 0; padding: 12px 14px 8px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.perm-group legend { padding: 0 6px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.switch-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 4px; cursor: pointer; border-radius: 8px; font-size: 14px; line-height: 1.4; }
.switch-row:hover { background: var(--blue-50); }
.switch-row input { flex: none; margin-top: 2px; width: 17px; height: 17px; accent-color: var(--blue-600); }
.switch-row input:disabled + span { opacity: .75; }
.switch-row--sm { font-size: 13.5px; padding: 5px 4px; }
.switch-row small { font-size: 11.5px; }
.menu-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.menu-mod { border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px 10px; }
.menu-mod__head { font-weight: 700; border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; padding-bottom: 9px; margin-bottom: 4px; }
.menu-mod__pages { padding-left: 18px; }
.menu-mod.is-off .menu-mod__pages { opacity: .4; pointer-events: none; }
.chip-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.role-form__save { position: sticky; bottom: 0; z-index: 5; padding: 12px 0; background: linear-gradient(to top, var(--cloud) 70%, transparent); }
.perm-matrix th.center, .perm-matrix td.center { text-align: center; }
.perm-matrix thead th { position: sticky; top: 0; background: var(--white); z-index: 1; }
.perm-matrix__group th { text-align: left; padding-top: 18px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.perm-matrix .checkbox { width: 18px; height: 18px; accent-color: var(--blue-600); }
.menu-need { color: var(--amber); }

/* ---------- A4 print for reports (wrap the report in .print-a4) ---------- */
.print-only { display: none; }
@media print {
  @page { size: A4 portrait; margin: 12mm 11mm 14mm; }
  html:has(.print-a4) {
    /* always print light, even in dark mode */
    --cloud: #fff; --white: #fff; --paper: #f6f6f4; --ink: #111; --ink-2: #333; --muted: #555; --line: #0000002a;
    --blue-50: #f1f6fb; --blue-100: #e3edf7; --link: #111; --tint-ink: #111;
    --green: #0f7a43; --green-bg: #e8f5ee; --amber: #8a4f00; --amber-bg: #fff4e0; --red: #b71c1c; --red-bg: #fdeeee;
    --chart-1: #0664ae;
  }
  body:has(.print-a4) { background: #fff !important; color: #111; font-size: 10pt;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body:has(.print-a4) .main { padding: 0 !important; }
  body:has(.print-a4) .main > * { max-width: none; }
  .print-a4 { width: 100%; }
  .print-a4 .print-only { display: block; }
  .print-a4 .btn, .print-a4 .seg { display: none !important; }
  .print-a4 a { color: inherit; text-decoration: none; }
  .print-a4 .page-head { margin: 0 0 4mm; }
  .print-a4 .page-head h1 { font-size: 16pt; margin: 0; }
  .print-a4 .page-head p { margin: 1mm 0 0; font-size: 9.5pt; }
  .print-a4 .card { padding: 3mm 0 0; margin: 0 0 4mm !important; border: 0; border-radius: 0; box-shadow: none; background: #fff; }
  .print-a4 h2 { font-size: 12pt; margin: 0 0 2mm !important; }
  .print-a4 h3 { font-size: 10.5pt; }
  .print-a4 .kpis { grid-template-columns: repeat(3, 1fr); gap: 3mm; margin-bottom: 4mm; }
  .print-a4 .kpi { padding: 3mm; border: 1px solid #ccc; box-shadow: none; border-radius: 3mm; }
  .print-a4 .kpi__value { font-size: 16pt; }
  .print-a4 .kpi__sub, .print-a4 .kpi__label { font-size: 8.5pt; }
  .print-a4 .grid { display: grid; grid-template-columns: none !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4mm; }
  .print-a4 .dash-grid { display: grid; gap: 4mm; }
  .print-a4 .dash-grid { grid-template-columns: 1fr !important; }
  .print-a4 .alert-list li { padding: 1.2mm 0; font-size: 9pt; }
  .print-a4 .barlist { grid-template-columns: 1fr 1fr; column-gap: 8mm; gap: 2mm 8mm; }
  .print-a4 .table-wrap { overflow: visible; }
  .print-a4 table { font-size: 8.5pt; }
  .print-a4 th, .print-a4 td { padding: 1.4mm 1.5mm; }
  .print-a4 thead { display: table-header-group; }   /* repeat the header on every page */
  .print-a4 tr, .print-a4 .kpi, .print-a4 .alert-list li, .print-a4 .barlist li { break-inside: avoid; }
  .print-a4 h2, .print-a4 h3 { break-after: avoid; }
  .print-a4 .badge { border: 1px solid currentColor; padding: 0 5px; font-size: 8pt; }

  .print-hd { display: flex !important; justify-content: space-between; align-items: center; gap: 6mm;
    padding-bottom: 3mm; margin-bottom: 4mm; border-bottom: 2px solid #111; }
  .print-hd img { height: 12mm; width: auto; }
  .print-hd__brand { display: flex; align-items: center; gap: 4mm; }
  .print-hd__brand strong { font-size: 13pt; display: block; }
  .print-hd__meta { text-align: right; font-size: 8.5pt; color: #444; }
  .print-ft { display: flex !important; justify-content: space-between; gap: 8mm; margin-top: 8mm; font-size: 9pt; break-inside: avoid; }
  .print-ft span { flex: 1; border-top: 1px solid #111; padding-top: 1.5mm; }
}

/* ---------- MOT screens: compact, business-style density ---------- */
.mot-form, .mot-page { --mot-radius: 10px; }
.mot-page .page-head, .main:has(.mot-form) .page-head { margin-bottom: 16px; }
.main:has(.mot-form) .page-head h1, .mot-page .page-head h1 { font-size: 22px; }
.main:has(.mot-form) .page-head p, .mot-page .page-head p { font-size: 13px; }

/* form */
.mot-form.card { padding: 20px 22px; border-radius: 16px; }
.mot-form .mot-step { padding: 0 0 16px; margin-bottom: 16px; }
.mot-form .mot-step__title { font-size: 15px; gap: 8px; margin-bottom: 12px; }
.mot-form .mot-step__n { width: 22px; height: 22px; font-size: 12px; }
.mot-form .mot-step__hint { margin: 6px 0 10px; font-size: 12.5px; }
.mot-form .form-grid { gap: 12px 16px; }
.mot-form .whose { gap: 10px; margin-bottom: 14px; }
.mot-form .whose__opt { padding: 10px 12px; gap: 10px; border-radius: var(--mot-radius); border-width: 1px; }
.mot-form .whose__opt.is-on, .mot-form .whose__opt:has(input:checked) { box-shadow: 0 0 0 2px var(--blue-100); }
.mot-form .whose__ico { width: 34px; height: 34px; border-radius: 8px; }
.mot-form .whose__ico svg { width: 20px; height: 20px; }
.mot-form .whose__text strong { font-size: 14px; }
.mot-form .whose__text small { font-size: 12px; }
.mot-form .mot-new { padding: 12px 14px 14px; border-radius: var(--mot-radius); border-width: 1px; }

/* checklist: compact rows instead of big cards */
.mot-form .mot-checks { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 8px; }
.mot-form .mot-cell { gap: 4px; }
.mot-form .mot-item { flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; border-width: 1px; border-radius: var(--mot-radius); }
.mot-form .mot-item:active { transform: none; }
.mot-form .mot-item__ico { width: 30px; height: 30px; border-radius: 7px; }
.mot-form .mot-item__ico svg { width: 17px; height: 17px; }
.mot-form .mot-item__label { flex: 1; min-width: 0; font-size: 13.5px; }
.mot-form .mot-item__state { flex: none; font-size: 12px; }
.mot-form .mot-item__state .mot-ico { width: 15px; height: 15px; }
.mot-form .mot-evidence { padding: 4px 8px; font-size: 12px; border-width: 1px; border-radius: 7px; }
.mot-form .mot-result { margin-top: 12px; padding: 10px 14px; gap: 10px; border-width: 1px; border-radius: var(--mot-radius); }
.mot-form .mot-result strong { font-size: 15px; }
.mot-form .mot-result span[data-result-sub] { font-size: 12.5px; }
.mot-form .mot-result__ico svg { width: 26px; height: 26px; }
.mot-form .btn-sm .mot-ico { width: 14px; height: 14px; }

/* upload boxes on MOT screens */
.mot-form .dropzone, .mot-page .dropzone { min-height: 0; padding: 12px; gap: 6px; border-width: 1.5px; border-radius: var(--mot-radius); flex-direction: row; }
.mot-form .dropzone__icon, .mot-page .dropzone__icon { width: 30px; height: 30px; }
.mot-form .dropzone__icon svg, .mot-page .dropzone__icon svg { width: 16px; height: 16px; }
.mot-form .dropzone__text, .mot-page .dropzone__text { font-size: 12.5px; }
.mot-form .up-tile, .mot-form .up-more, .mot-page .up-tile, .mot-page .up-more { width: 56px; height: 56px; border-radius: 8px; }
.mot-form .mot-cell .up-tile, .mot-form .mot-cell .up-more { width: 44px; height: 44px; }
.mot-form .up-tile__x, .mot-page .up-tile__x { width: 18px; height: 18px; line-height: 18px; font-size: 13px; }
.mot-form .form-actions { margin-top: 4px; }

/* check page */
.mot-page .card { padding: 18px 20px; border-radius: 16px; }
.mot-page .card h2, .mot-page .card-head h2 { font-size: 15px; margin-bottom: 12px !important; }
.mot-page .card-head { margin-bottom: 12px; }
.mot-page .stats { gap: 12px; margin-bottom: 16px; }
.mot-page .stat { padding: 12px 16px; border-radius: 12px; }
.mot-page .stat .label { font-size: 12px; }
.mot-page .stat .value { font-size: 18px; margin-top: 2px; }
.mot-page .mot-verdict { gap: 8px; }
.mot-page .mot-verdict .mot-ico { width: 24px; height: 24px; }
.mot-page .checklist { gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
.mot-page .checklist li { padding: 7px 10px; font-size: 13.5px; border-radius: 8px; }
.mot-page .checklist .item-ico svg { width: 17px; height: 17px; }
.mot-page .checklist .mark, .mot-page .checklist .mark svg { width: 18px; height: 18px; }
.mot-page .info { font-size: 13.5px; }
.mot-page .grid { gap: 16px; }
.mot-page .gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.mot-page .gallery__item a { border-radius: 8px; }
.mot-page .gallery__item a:hover img { transform: none; }
.mot-page .gallery__item figcaption { font-size: 11.5px; margin-top: 4px; line-height: 1.35; }
.mot-page .ev-tag { font-size: 11px; padding: 0 6px; }
.mot-page .ev-upload { margin-top: 14px; padding-top: 14px; }
.mot-page .ev-upload h3 { font-size: 14px; margin-bottom: 10px; }
.ev-upload__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; align-items: start; }
.ev-upload__meta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.ev-upload__meta .field { margin: 0; }
.ev-upload__meta .btn { height: 40px; }
@media (max-width: 960px) {
  .ev-upload__grid { grid-template-columns: 1fr; }
  .ev-upload__meta { grid-template-columns: 1fr 1fr; }
  .ev-upload__meta .btn { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .mot-form .mot-checks { grid-template-columns: 1fr; }
  .mot-form.card { padding: 16px; }
}
