/* Modern Stickers ERP — hand-written CSS. Same palette mechanism as before (data-theme
   attribute + prefers-color-scheme), no build step — just elevated further:
   refined type, softer layered shadows, subtle motion, a more premium feel. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --background: #f5f6fb;
  --surface: #ffffff;
  --surface-muted: #f1f2f8;
  --foreground: #16182a;
  --muted-foreground: #6b7089;
  --border: #e7e8f2;

  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-foreground: #ffffff;
  --primary-soft: #eef0ff;

  --accent: #0ea5a3;
  --accent-soft: #e9fbf9;

  --success: #16a34a;
  --success-soft: #f0fdf4;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  --radius-sm: 0.55rem;
  --radius-md: 0.9rem;
  --radius-lg: 1.1rem;
  --radius-xl: 1.5rem;

  --shadow-sm: 0 1px 2px 0 rgb(23 24 50 / 0.05);
  --shadow-md: 0 8px 24px -8px rgb(23 24 50 / 0.14), 0 2px 6px -2px rgb(23 24 50 / 0.06);
  --shadow-lg: 0 20px 48px -12px rgb(23 24 50 / 0.20), 0 4px 12px -4px rgb(23 24 50 / 0.08);
  --shadow-glow: 0 8px 28px -6px rgb(79 70 229 / 0.35);

  --chart-series-1: #2a78d6;
  --chart-series-2: #eb6834;
  --chart-series-3: #1baf7a;
  --chart-series-4: #eda100;
  --chart-good: #0ca30c;
  --chart-warning: #fab219;
  --chart-critical: #d03b3b;
  --chart-grid: #e1e0d9;
  --chart-axis: #898781;
}

/* Light is the unconditional primary theme — dark only ever applies via an
   explicit data-theme="dark" attribute (set by the toggle), never from the
   OS's prefers-color-scheme, so there's no flash-of-dark on dark-OS machines. */
:root[data-theme="dark"] {
  --background: #0b0c14; --surface: #14151f; --surface-muted: #1b1d2b;
  --foreground: #f0f1f8; --muted-foreground: #9498b0; --border: #262841;
  --primary: #6366f1; --primary-dark: #818cf8; --primary-foreground: #ffffff; --primary-soft: #21223d;
  --accent: #2dd4bf; --accent-soft: #102a2a;
  --success: #4ade80; --success-soft: #10231a;
  --warning: #fbbf24; --warning-soft: #2a2110;
  --danger: #f87171; --danger-soft: #2a1414;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.35);
  --shadow-md: 0 8px 24px -8px rgb(0 0 0 / 0.55), 0 2px 6px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 20px 48px -12px rgb(0 0 0 / 0.65), 0 4px 12px -4px rgb(0 0 0 / 0.4);
  --shadow-glow: 0 8px 32px -4px rgb(99 102 241 / 0.45);
  --chart-series-1: #3987e5; --chart-series-2: #d95926; --chart-series-3: #199e70; --chart-series-4: #c98500;
  --chart-good: #0ca30c; --chart-warning: #fab219; --chart-critical: #e66767;
  --chart-grid: #2c2c2a; --chart-axis: #898781;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 1.5rem; }
p { margin: 0; }
a { color: inherit; }
.muted { color: var(--muted-foreground); font-size: 0.875rem; }
.error-text { color: var(--danger); font-size: 0.8125rem; margin: 0.25rem 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* View content fades in gently each time the router swaps it */
@keyframes viewFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.view > * { animation: viewFadeIn 0.28s ease both; }

/* ---- shared building blocks -------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.input, select.input, textarea.input {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--foreground);
  padding: 0.55rem 0.8rem;
  font-size: 0.875rem;
  outline: none;
  width: 100%;
  margin: 0.25rem 0 0.75rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input:hover:not(:focus) { border-color: color-mix(in srgb, var(--border) 60%, var(--muted-foreground)); }
label { font-size: 0.8125rem; font-weight: 600; color: var(--muted-foreground); letter-spacing: 0.01em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  border: none; border-radius: var(--radius-sm); padding: 0.55rem 1rem;
  font-size: 0.875rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background 0.15s ease;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--primary-foreground);
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 32px -6px rgb(79 70 229 / 0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: var(--surface-muted); color: var(--foreground); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { filter: brightness(0.97); }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--muted-foreground); font-size: 0.875rem; cursor: pointer; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); transition: background 0.15s ease, color 0.15s ease; }
.btn-link:hover { background: var(--surface-muted); color: var(--foreground); }
.btn-whatsapp { background: color-mix(in srgb, #25d366 18%, var(--surface)); color: #1a7a43; }
.btn-whatsapp:hover { background: color-mix(in srgb, #25d366 28%, var(--surface)); transform: translateY(-1px); }
:root[data-theme="dark"] .btn-whatsapp { color: #4ade80; }

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 2.15rem; height: 2.15rem; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--muted-foreground);
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { background: var(--surface-muted); color: var(--primary); border-color: var(--primary-soft); transform: rotate(8deg); }

.pill { display: inline-flex; align-items: center; gap: 0.3rem; border-radius: 999px; padding: 0.2rem 0.65rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.01em; }
.pill-primary { background: var(--primary-soft); color: var(--primary); }
.pill-warning { background: var(--warning-soft); color: var(--warning); }
.pill-success { background: var(--success-soft); color: var(--success); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-secondary { background: var(--surface-muted); color: var(--muted-foreground); }

/* Whole-card stage coloring for job cards (Process Manager board etc.) */
.stage-card-primary { background: linear-gradient(180deg, var(--primary-soft), var(--surface) 65%); border-left: 4px solid var(--primary); }
.stage-card-accent { background: linear-gradient(180deg, var(--accent-soft), var(--surface) 65%); border-left: 4px solid var(--accent); }
.stage-card-warning { background: linear-gradient(180deg, var(--warning-soft), var(--surface) 65%); border-left: 4px solid var(--warning); }
.stage-card-success { background: linear-gradient(180deg, var(--success-soft), var(--surface) 65%); border-left: 4px solid var(--success); }
.stage-card-danger { background: linear-gradient(180deg, var(--danger-soft), var(--surface) 65%); border-left: 4px solid var(--danger); }
.job-card { cursor: pointer; }
.job-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.job-card .btn, .job-card select, .job-card input { cursor: auto; }
.job-card-thumb { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; border: 1.5px solid var(--border); flex-shrink: 0; }

.ready-banner {
  background: linear-gradient(135deg, var(--success-soft), var(--surface));
  border: 1px solid var(--success); border-radius: var(--radius-md); padding: 0.9rem 1.1rem; margin: 1rem 0;
  box-shadow: var(--shadow-sm);
}
.ready-banner strong { color: var(--success); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 11, 20, 0.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem;
  animation: fadeIn 0.18s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.96) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-card { max-width: 480px; width: 100%; max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modalIn 0.22s cubic-bezier(0.16,1,0.3,1) both; }
.modal-close { float: right; background: none; border: none; font-size: 1.35rem; line-height: 1; cursor: pointer; color: var(--muted-foreground); transition: color 0.15s ease; }
.modal-close:hover { color: var(--danger); }

/* ---- Drag-and-drop reference image upload -------------------------- */
.dropzone {
  position: relative; border: 2px dashed var(--border); border-radius: var(--radius-md);
  padding: 0.85rem; text-align: center; cursor: pointer; min-height: 84px;
  display: flex; align-items: center; justify-content: center; background: var(--surface-muted);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.dropzone-drag { border-color: var(--primary); background: var(--primary-soft); transform: scale(1.015); box-shadow: var(--shadow-sm); }
.dropzone-empty { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; color: var(--muted-foreground); font-size: 0.76rem; pointer-events: none; }
.dropzone-icon { font-size: 1.4rem; }
.dropzone-preview-wrap { position: relative; pointer-events: none; }
.dropzone-preview { max-height: 90px; max-width: 100%; border-radius: var(--radius-sm); object-fit: contain; display: block; }
.dropzone-replace-hint { font-size: 0.68rem; color: var(--muted-foreground); margin-top: 0.3rem; }
.dropzone-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone-uploading { font-size: 0.78rem; color: var(--primary); font-weight: 500; pointer-events: none; }

.data-tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }

.approval-thumb {
  width: 3.25rem; height: 3.25rem; object-fit: cover; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); cursor: pointer; transition: transform 0.15s ease, border-color 0.15s ease;
}
.approval-thumb:hover { transform: scale(1.08); border-color: var(--primary); }

/* ---- Payment follow-up (Receptionist) ------------------------------ */
.followup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.followup-card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.followup-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.followup-avatar {
  width: 2.25rem; height: 2.25rem; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem;
}
.followup-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px dashed var(--border); }
.followup-actions .btn { padding: 0.4rem 0.7rem; font-size: 0.78rem; }

/* ---- Notes -------------------------------------------------------- */
.note-composer { position: relative; overflow: hidden; }
.note-composer::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.note-card {
  position: relative; padding-left: 1.1rem; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.note-card::before {
  content: ''; position: absolute; left: 0; top: 0.85rem; bottom: 0.85rem; width: 4px; border-radius: 999px;
  background: var(--note-accent, var(--primary));
}
.note-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.note-card-body { white-space: pre-wrap; font-size: 0.875rem; line-height: 1.5; }
.note-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px dashed var(--border); }

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1rem; }
.filter-bar #fbSearch { flex: 2 1 220px; margin: 0; }
.filter-bar #fbFrom, .filter-bar #fbTo { flex: 1 1 140px; margin: 0; }
.filter-bar-sep { flex: 0 0 auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); font-weight: 700; padding: 0.8rem 1rem; border-bottom: 1.5px solid var(--border); }
td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--surface-muted); }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; margin-top: 1rem; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.stat-value.danger { color: var(--danger); }
.stat-label { margin-top: 0.3rem; font-size: 0.75rem; color: var(--muted-foreground); font-weight: 500; }

/* ---- hand-rolled charts (Admin Overview) ------------------------------ */
.chart-track { flex: 1; background: var(--surface-muted); border-radius: 999px; height: 0.85rem; overflow: hidden; }
.chart-fill-h { height: 100%; border-radius: 999px; transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.chart-fill-v { border-radius: 6px 6px 0 0; transition: height 0.7s cubic-bezier(0.16, 1, 0.3, 1); margin: 0 auto; }
.donut-ring { width: 130px; height: 130px; border-radius: 50%; position: relative; flex-shrink: 0; box-shadow: var(--shadow-sm); transition: background 0.4s ease; }
.donut-center { position: absolute; inset: 20px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: inset 0 1px 4px rgb(0 0 0 / 0.08); }
.donut-center strong { font-size: 1.15rem; letter-spacing: -0.01em; }
.legend-dot { width: 0.65rem; height: 0.65rem; border-radius: 3px; display: inline-block; flex-shrink: 0; }

/* ---- floating 3D-ish gradient blobs — used behind the login and tracking hero --- */
.blob-field { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(50px); opacity: 0.55;
  animation: blobFloat 16s ease-in-out infinite; will-change: transform;
}
.blob-1 { width: 340px; height: 340px; top: -100px; left: -80px; background: radial-gradient(circle at 30% 30%, var(--primary), transparent 70%); animation-duration: 17s; }
.blob-2 { width: 280px; height: 280px; bottom: -80px; right: -60px; background: radial-gradient(circle at 30% 30%, var(--accent), transparent 70%); animation-duration: 13s; animation-delay: -3s; }
.blob-3 { width: 220px; height: 220px; top: 45%; right: 8%; background: radial-gradient(circle at 30% 30%, var(--success), transparent 70%); animation-duration: 19s; animation-delay: -7s; opacity: 0.35; }
.blob-4 { width: 190px; height: 190px; bottom: 12%; left: 6%; background: radial-gradient(circle at 30% 30%, var(--warning), transparent 70%); animation-duration: 21s; animation-delay: -10s; opacity: 0.3; }
@keyframes blobFloat {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  33% { transform: translate3d(24px, -34px, 0) rotate(8deg) scale(1.06); }
  66% { transform: translate3d(-18px, 22px, 0) rotate(-6deg) scale(0.96); }
}
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }

/* ---- floating 3D geometric shapes — glassy gradient polygons that tumble in 3D space --- */
.shapes-3d-field { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; perspective: 1000px; }
.shape-3d {
  position: absolute; opacity: 0.8; backdrop-filter: blur(1px);
  transform-style: preserve-3d; animation-name: float3d; animation-timing-function: ease-in-out; animation-iteration-count: infinite;
}
.shape-3d::after {
  /* a soft glossy highlight, like light glancing off glass — this is what sells the "premium" 3D read */
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(135deg, color-mix(in srgb, white 55%, transparent) 0%, transparent 55%);
  mix-blend-mode: overlay;
}
.shape-circle { border-radius: 50%; }
.shape-square { border-radius: 22%; }
.shape-triangle { clip-path: polygon(50% 0%, 0% 100%, 100% 100%); }
.shape-hexagon { clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }
.shape-ring { border-radius: 50%; background: none !important; border: 5px solid; opacity: 0.5; }
.shape-ring::after { content: none; }

/* Looping "field lines" that orbit the whole interface from every side, like a team's
   workflow cycling continuously through the system — sits between the glow blobs and
   the floating shapes for depth. Each loop is a full ellipse, not a point-to-point link. */
.shapes-3d-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.shapes-3d-lines ellipse { fill: none; stroke: url(#shapes3dLineGrad); opacity: 0.4; }
.loop-a { stroke-width: 1.6; stroke-dasharray: 14 16; animation: dashFlow 22s linear infinite; }
.loop-b { stroke-width: 1.3; stroke-dasharray: 10 14; opacity: 0.3; animation: dashFlowReverse 28s linear infinite; }
.loop-c { stroke-width: 1.8; stroke-dasharray: 18 20; opacity: 0.32; animation: dashFlow 34s linear infinite; }
@keyframes dashFlow { to { stroke-dashoffset: -1000; } }
@keyframes dashFlowReverse { to { stroke-dashoffset: 1000; } }
@media (prefers-reduced-motion: reduce) { .shapes-3d-lines ellipse { animation: none; } }
@keyframes float3d {
  0%   { transform: translateY(0) translateZ(0) rotateX(0deg) rotateY(0deg); }
  25%  { transform: translateY(-26px) translateZ(40px) rotateX(18deg) rotateY(22deg); }
  50%  { transform: translateY(2px) translateZ(-10px) rotateX(-12deg) rotateY(-18deg); }
  75%  { transform: translateY(22px) translateZ(-30px) rotateX(10deg) rotateY(14deg); }
  100% { transform: translateY(0) translateZ(0) rotateX(0deg) rotateY(0deg); }
}
@media (prefers-reduced-motion: reduce) { .shape-3d { animation: none; } }

/* ---- login screen --------------------------------------------------- */
.login-screen {
  position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem; overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 45%),
    radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 45%),
    var(--background);
}
/* Liquid-glass login card — translucent frosted panel so the floating shapes/blobs
   behind it stay visible (softly) through the glass, with a glossy specular sheen
   and a light-refraction edge, like Apple's "liquid glass" material. */
.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 380px; text-align: center;
  padding: 2.25rem 2rem; overflow: hidden; isolation: isolate;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid color-mix(in srgb, white 40%, transparent);
  box-shadow: var(--shadow-lg), inset 0 1px 0 color-mix(in srgb, white 55%, transparent), inset 0 0 40px color-mix(in srgb, white 8%, transparent);
  animation: modalIn 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
:root[data-theme="dark"] .login-card {
  background: color-mix(in srgb, var(--surface) 45%, transparent);
  border-color: color-mix(in srgb, white 12%, transparent);
  box-shadow: var(--shadow-lg), inset 0 1px 0 color-mix(in srgb, white 10%, transparent);
}
.login-card::before {
  /* the glossy sheen — a diagonal streak of light across the glass */
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(125deg, color-mix(in srgb, white 45%, transparent) 0%, transparent 30%, transparent 70%, color-mix(in srgb, white 15%, transparent) 100%);
}
@media (max-width: 400px) { .login-card { padding: 1.75rem 1.25rem; } }
.login-track-link { margin-top: 1rem; }
.login-theme-toggle { position: absolute; top: 1.25rem; right: 1.25rem; z-index: 2; background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(8px); }

/* ---- customer order-tracking page ------------------------------------ */
.track-hero {
  position: relative; overflow: hidden; padding: 3rem 1.5rem 4rem;
  background:
    radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 45%),
    radial-gradient(circle at 85% 30%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 45%),
    var(--background);
  text-align: center;
}
.track-hero-content { position: relative; z-index: 1; max-width: 30rem; margin: 0 auto; }
.track-hero .brand-mark { margin: 0 auto 1rem; }
.track-hero h1 { font-size: 1.85rem; }
.track-page { max-width: 40rem; margin: -2.5rem auto 3rem; padding: 0 1.25rem; position: relative; z-index: 2; }
.track-form-card { text-align: left; }

.login-logo {
  width: 3.25rem; height: 3.25rem; margin: 0 auto 1.1rem; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--primary-foreground); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; box-shadow: var(--shadow-glow); overflow: hidden;
}
.login-logo img, .brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.login-logo:has(img), .brand-mark:has(img) { background: none; box-shadow: none; }
.login-card h1 { font-size: 1.6rem; margin-bottom: 0.3rem; }
.login-card form { text-align: left; margin-top: 1.5rem; }

/* ---- app shell -------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  display: flex; width: 15.5rem; flex-direction: column; border-right: 1px solid var(--border);
  background: var(--surface); padding: 1.5rem 1rem;
  position: fixed; inset: 0 auto 0 0; z-index: 60; transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.16,1,0.3,1); overflow-y: auto;
}
.sidebar.sidebar-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
@media (min-width: 640px) {
  .sidebar { position: static; transform: none; box-shadow: none; }
}
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(10, 11, 20, 0.5); z-index: 50;
  animation: fadeIn 0.18s ease both;
}
.sidebar-backdrop.sidebar-backdrop-open { display: block; }
@media (min-width: 640px) { .sidebar-backdrop { display: none !important; } }
.mobile-menu-toggle { display: flex; }
@media (min-width: 640px) { .mobile-menu-toggle { display: none; } }
.sidebar-brand { display: flex; align-items: center; gap: 0.6rem; padding: 0 0.5rem; margin-bottom: 2rem; }
.brand-mark { width: 2.15rem; height: 2.15rem; border-radius: 0.75rem; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: var(--primary-foreground); display: flex; align-items: center; justify-content: center; font-size: 0.8125rem; font-weight: 800; box-shadow: var(--shadow-glow); overflow: hidden; flex-shrink: 0; }
.sidebar-brand span { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.sidebar-nav a {
  display: block; position: relative; border-radius: var(--radius-sm); padding: 0.55rem 0.8rem;
  font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground); text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}
.sidebar-nav a:hover { background: var(--surface-muted); color: var(--foreground); padding-left: 1rem; }
.sidebar-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar-nav a.active::before {
  content: ''; position: absolute; left: -1rem; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--primary); border-radius: 0 3px 3px 0;
}
.sidebar-user { margin-top: auto; border-radius: var(--radius-md); background: var(--surface-muted); padding: 0.85rem; font-size: 0.75rem; }
.sidebar-user-name { font-weight: 600; color: var(--foreground); }

.main-column { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: var(--surface); padding: 0.85rem 1rem; box-shadow: var(--shadow-sm); position: relative; z-index: 5; }
@media (min-width: 640px) { .topbar { padding: 0.85rem 1.5rem; } }
.topbar-brand-mobile { font-size: 0.9375rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (min-width: 640px) { .topbar-brand-mobile { display: none; } }
.topbar-actions { display: flex; align-items: center; gap: 0.6rem; }
.sync-status { display: flex; align-items: center; gap: 0.5rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); padding: 0.4rem 0.8rem; font-size: 0.75rem; font-weight: 600; }
.sync-dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent); }
.sync-status.offline .sync-dot { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 20%, transparent); }
.sync-status.offline #syncStatusText { color: var(--danger); }

.view { flex: 1; min-width: 0; overflow-x: hidden; overflow-y: auto; padding: 1.75rem 1rem; }
@media (min-width: 640px) { .view { padding: 1.75rem 1.75rem; } }

.flex-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.payments-layout { grid-template-columns: 1fr; }
@media (min-width: 900px) { .payments-layout { grid-template-columns: 320px 1fr; } }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-foreground); }
