/* ═══════════════════════════════════════════════════════════════
   REPAIR SHOP MANAGEMENT - COMPLETE STYLESHEET
   ═══════════════════════════════════════════════════════════════ */

:root {
  --c-primary: #1e40af;
  --c-primary-h: #1e3a8a;
  --c-primary-l: #dbeafe;
  --c-accent: #2563eb;
  --c-success: #16a34a;
  --c-success-l: #dcfce7;
  --c-warning: #b45309;
  --c-warning-l: #fef3c7;
  --c-danger: #dc2626;
  --c-danger-l: #fee2e2;
  --c-info: #0369a1;
  --c-info-l: #e0f2fe;
  --c-bg: #f1f5f9;
  --c-surface: #ffffff;
  --c-border: #e2e8f0;
  --c-border-h: #cbd5e1;
  --c-text: #1e293b;
  --c-text-s: #64748b;
  --c-text-xs: #94a3b8;
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  --trans: .18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Portrait lock */
@media screen and (orientation: landscape) and (max-width: 900px) {
  body::before { content: 'Please rotate your device to portrait mode'; position: fixed; inset: 0; background: #1e40af; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; z-index: 99999; text-align: center; padding: 2rem; }
  #app { display: none !important; }
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif; background: var(--c-bg); color: var(--c-text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--c-accent); text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; }
input, textarea, select { font-family: inherit; font-size: 14px; }

/* ── Splash ─────────────────────────────────────────────────── */
.splash { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 1rem; }
.splash-icon { font-size: 3rem; color: var(--c-primary); animation: pulse 1.5s infinite; }
.splash-text { color: var(--c-text-s); font-size: .9rem; }

/* ── Utilities ──────────────────────────────────────────────── */
.flex { display: flex; } .flex-col { flex-direction: column; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; } .justify-center { justify-content: center; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; } .mb-3 { margin-bottom: .75rem; } .mb-4 { margin-bottom: 1rem; }
.p-2 { padding: .5rem; } .p-3 { padding: .75rem; } .p-4 { padding: 1rem; }
.w-full { width: 100%; } .text-center { text-align: center; } .text-right { text-align: right; }
.text-sm { font-size: .8rem; } .text-xs { font-size: .72rem; } .font-bold { font-weight: 700; } .font-semibold { font-weight: 600; }
.text-muted { color: var(--c-text-s); } .text-danger { color: var(--c-danger); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.hidden { display: none !important; }
.divider { border: none; border-top: 1px solid var(--c-border); margin: 1rem 0; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .35rem; padding: .5rem 1rem; border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600; transition: all var(--trans); line-height: 1.4; white-space: nowrap; border: 1.5px solid transparent; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover:not(:disabled) { background: var(--c-primary-h); border-color: var(--c-primary-h); }
.btn-success { background: var(--c-success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover:not(:disabled) { background: #b45309; }
.btn-outline { background: transparent; border-color: var(--c-border-h); color: var(--c-text); }
.btn-outline:hover:not(:disabled) { background: var(--c-bg); border-color: var(--c-primary); color: var(--c-primary); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--c-text-s); }
.btn-ghost:hover:not(:disabled) { background: var(--c-bg); color: var(--c-text); }
.btn-sm { padding: .3rem .65rem; font-size: .78rem; }
.btn-lg { padding: .65rem 1.4rem; font-size: .95rem; }
.btn-xl { padding: .8rem 1.6rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: .4rem .5rem; aspect-ratio: 1; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .8rem; font-weight: 600; color: var(--c-text-s); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em; }
.form-ctrl { display: block; width: 100%; padding: .55rem .8rem; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); font-size: .9rem; color: var(--c-text); background: var(--c-surface); transition: border-color var(--trans), box-shadow var(--trans); }
.form-ctrl:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-ctrl::placeholder { color: var(--c-text-xs); }
.form-ctrl:disabled { background: var(--c-bg); color: var(--c-text-s); cursor: not-allowed; }
textarea.form-ctrl { resize: vertical; min-height: 80px; }
select.form-ctrl { cursor: pointer; }
.form-err { color: var(--c-danger); font-size: .8rem; margin-top: .25rem; }
.form-hint { color: var(--c-text-s); font-size: .78rem; margin-top: .2rem; }
.input-group { display: flex; gap: .5rem; align-items: stretch; }
.input-group .form-ctrl { flex: 1; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; }

/* ── Cards ──────────────────────────────────────────────────── */
.card { background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--c-border); }
.card-hd { padding: 1rem 1.25rem .75rem; border-bottom: 1px solid var(--c-border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-hd h3 { font-size: .95rem; font-weight: 700; color: var(--c-text); }
.card-bd { padding: 1.25rem; }
.card-ft { padding: .75rem 1.25rem; border-top: 1px solid var(--c-border); background: var(--c-bg); border-radius: 0 0 var(--radius) var(--radius); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-UNDER_REPAIR { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.badge-REPAIRED { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.badge-RETURN { background: #fef08a; color: #854d0e; border: 1px solid #fde047; }
.badge-DELIVERED { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }
.badge-admin { background: var(--c-primary-l); color: var(--c-primary); }
.badge-staff { background: #f0fdf4; color: #15803d; }
.badge-PENDING { background: #fef3c7; color: #92400e; }
.badge-APPROVED { background: #dcfce7; color: #16a34a; }
.badge-DENIED { background: #fee2e2; color: #dc2626; }

/* ── Login ──────────────────────────────────────────────────── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 50%, #2563eb 100%); padding: 1rem; }
.login-card { background: var(--c-surface); border-radius: 1.25rem; padding: 2.5rem 2rem; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); }
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--c-primary-l); display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 2rem; color: var(--c-primary); }
.login-logo h1 { font-size: 1.3rem; font-weight: 800; color: var(--c-text); margin-bottom: .25rem; }
.login-logo p { color: var(--c-text-s); font-size: .85rem; }

/* ── Layout ─────────────────────────────────────────────────── */
.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99; display: none; }
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: var(--c-surface); border-right: 1px solid var(--c-border); display: flex; flex-direction: column; z-index: 100; transition: transform var(--trans); overflow-y: auto; }
.sidebar-head { padding: 1rem; display: flex; align-items: center; gap: .75rem; border-bottom: 1px solid var(--c-border); }
.sidebar-logo { width: 38px; height: 38px; border-radius: 9px; background: var(--c-primary); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.1rem; flex-shrink: 0; }
.sidebar-brand h2 { font-size: .88rem; font-weight: 800; color: var(--c-text); line-height: 1.2; }
.sidebar-brand p { font-size: .68rem; color: var(--c-text-s); }
.sidebar-close-btn { margin-left: auto; display: none; background: none; border: none; color: var(--c-text-s); font-size: 1.1rem; padding: .25rem; }
.sidebar-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }
.nav-section { padding: .4rem 1rem .2rem; font-size: .65rem; font-weight: 700; color: var(--c-text-xs); text-transform: uppercase; letter-spacing: .08em; }
.nav-item { display: flex; align-items: center; gap: .65rem; padding: .6rem 1rem; cursor: pointer; color: var(--c-text-s); font-weight: 500; font-size: .88rem; transition: all var(--trans); position: relative; border-radius: 6px; margin: 1px 8px; }
.nav-item:hover { background: var(--c-bg); color: var(--c-text); }
.nav-item.active { background: var(--c-primary-l); color: var(--c-primary); font-weight: 700; }
.nav-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: var(--c-primary); border-radius: 0 3px 3px 0; }
.nav-item i { width: 16px; text-align: center; font-size: .9rem; }
.nav-badge { background: var(--c-danger); color: #fff; font-size: .62rem; font-weight: 700; padding: .1rem .35rem; border-radius: 999px; margin-left: auto; }
.sidebar-foot { padding: .75rem; border-top: 1px solid var(--c-border); }
.user-pill { display: flex; align-items: center; gap: .65rem; padding: .5rem .75rem; background: var(--c-bg); border-radius: var(--radius-sm); }
.user-av { width: 32px; height: 32px; border-radius: 50%; background: var(--c-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; flex-shrink: 0; }
.user-meta { flex: 1; min-width: 0; }
.user-nm { font-size: .82rem; font-weight: 700; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .68rem; color: var(--c-text-s); text-transform: capitalize; }
.logout-btn { background: none; border: none; color: var(--c-text-s); padding: .25rem; font-size: .95rem; }
.logout-btn:hover { color: var(--c-danger); }

/* ── Main wrap ──────────────────────────────────────────────── */
.main-wrap { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); background: var(--c-surface); border-bottom: 1px solid var(--c-border); display: flex; align-items: center; gap: .75rem; padding: 0 1rem; position: sticky; top: 0; z-index: 50; }
.topbar-menu-btn { display: none; background: none; border: none; font-size: 1.2rem; color: var(--c-text-s); padding: .35rem; border-radius: var(--radius-sm); }
.topbar-title { font-weight: 700; font-size: .95rem; color: var(--c-text); white-space: nowrap; }
.topbar-search { flex: 1; max-width: 340px; position: relative; }
.topbar-search i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--c-text-xs); font-size: .85rem; }
.topbar-search input { width: 100%; padding: .4rem .8rem .4rem 2rem; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); font-size: .85rem; background: var(--c-bg); color: var(--c-text); }
.topbar-search input:focus { outline: none; border-color: var(--c-accent); background: var(--c-surface); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-success); flex-shrink: 0; }
.online-dot.offline { background: var(--c-danger); }
.notif-btn { background: none; border: 1.5px solid var(--c-border); border-radius: var(--radius-sm); padding: .35rem .55rem; font-size: .9rem; color: var(--c-text-s); position: relative; }
.notif-btn:hover { background: var(--c-bg); color: var(--c-text); }
.notif-dot { position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; background: var(--c-danger); border-radius: 50%; border: 1.5px solid white; }

/* ── Page body ──────────────────────────────────────────────── */
.page-body { flex: 1; padding: 1.5rem; }
.page-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem; }
.page-hd h1 { font-size: 1.35rem; font-weight: 800; color: var(--c-text); }
.page-hd .subtitle { color: var(--c-text-s); font-size: .82rem; margin-top: .15rem; }

/* ── Dashboard ──────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: 1.25rem; }
.stat-card { background: var(--c-surface); border-radius: var(--radius-sm); padding: .6rem .7rem; border: 1px solid var(--c-border); cursor: pointer; transition: all var(--trans); position: relative; overflow: hidden; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card::after { content: ''; position: absolute; right: -8px; bottom: -8px; width: 55px; height: 55px; border-radius: 50%; opacity: .06; }
.stat-card.blue::after { background: var(--c-primary); }
.stat-card.red::after { background: var(--c-danger); }
.stat-card.green::after { background: var(--c-success); }
.stat-card.yellow::after { background: #d97706; }
.stat-icon { width: 28px; height: 28px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: .8rem; margin-bottom: .35rem; flex-shrink: 0; }
.stat-icon.blue { background: var(--c-primary-l); color: var(--c-primary); }
.stat-icon.red { background: #fee2e2; color: var(--c-danger); }
.stat-icon.green { background: #dcfce7; color: var(--c-success); }
.stat-icon.yellow { background: #fef3c7; color: #b45309; }
.stat-icon.purple { background: #f3e8ff; color: #7e22ce; }
.stat-icon.orange { background: #fff7ed; color: #ea580c; }
.stat-num { font-size: 1.35rem; font-weight: 800; color: var(--c-text); line-height: 1; }
.stat-label { font-size: .6rem; color: var(--c-text-s); margin-top: .15rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

/* ── Job cards ──────────────────────────────────────────────── */
.job-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; }
.job-card { background: var(--c-surface); border-radius: var(--radius); border: 1px solid var(--c-border); overflow: hidden; transition: all var(--trans); cursor: pointer; }
.job-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--c-border-h); }
.job-card-img { height: 110px; background: var(--c-bg); overflow: hidden; position: relative; }
.job-card-img img { width: 100%; height: 100%; object-fit: cover; }
.job-card-img-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--c-text-xs); font-size: 1.8rem; }
.job-card-status { position: absolute; top: .5rem; right: .5rem; }
.job-card-body { padding: 1rem; }
.job-card-num { font-size: .78rem; font-weight: 700; color: var(--c-text-s); letter-spacing: .04em; margin-bottom: .25rem; }
.job-card-customer { font-size: .93rem; font-weight: 700; color: var(--c-text); margin-bottom: .2rem; }
.job-card-phone { font-size: .78rem; color: var(--c-text-s); }
.job-card-meta { display: flex; align-items: center; justify-content: space-between; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--c-border); }
.job-card-amount { font-size: .82rem; color: var(--c-text); }
.job-card-amount strong { color: var(--c-success); font-size: .9rem; }
.job-card-actions { display: flex; gap: .35rem; }
.quick-status { display: flex; gap: .35rem; margin-top: .5rem; flex-wrap: wrap; }

/* ── Job detail ─────────────────────────────────────────────── */
.job-detail-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.job-detail-num { font-size: .8rem; color: var(--c-text-s); font-weight: 600; letter-spacing: .04em; }
.job-detail-title { font-size: 1.4rem; font-weight: 800; color: var(--c-text); }
.machine-item { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); margin-bottom: .75rem; overflow: hidden; }
.machine-item-hd { display: flex; align-items: center; gap: .5rem; padding: .6rem .875rem; background: var(--c-bg); border-bottom: 1px solid var(--c-border); cursor: pointer; }
.machine-item-hd .machine-icon { display: none; }
.machine-info { flex: 1; min-width: 0; }
.machine-info .name { font-weight: 700; font-size: .9rem; color: var(--c-text); }
.machine-info .sub { font-size: .75rem; color: var(--c-text-s); }
.machine-item-bd { padding: 1rem; display: none; }
.machine-item-bd.open { display: block; }
.machine-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 1rem; cursor: pointer; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1rem; }
.detail-row { display: flex; flex-direction: column; gap: .15rem; }
.detail-row .dl { font-size: .72rem; text-transform: uppercase; color: var(--c-text-xs); font-weight: 700; letter-spacing: .04em; }
.detail-row .dv { font-size: .88rem; color: var(--c-text); font-weight: 500; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--c-border); }
table { width: 100%; border-collapse: collapse; background: var(--c-surface); font-size: .86rem; }
thead th { background: var(--c-bg); padding: .65rem 1rem; text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c-text-s); white-space: nowrap; border-bottom: 1px solid var(--c-border); }
tbody td { padding: .8rem 1rem; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--c-bg); }
tbody tr { transition: background var(--trans); }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 200; display: none; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(2px); }
.modal-overlay.show { display: flex; }
.modal { background: var(--c-surface); border-radius: var(--radius); width: 100%; max-width: 540px; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: scaleIn .18s ease; }
.modal.lg { max-width: 750px; }
.modal.xl { max-width: 980px; }
.modal.sm { max-width: 380px; }
.modal-hd { padding: 1rem 1.25rem; border-bottom: 1px solid var(--c-border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-shrink: 0; }
.modal-hd h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--c-text-s); font-size: 1.1rem; padding: .25rem; border-radius: var(--radius-sm); }
.modal-close:hover { background: var(--c-bg); color: var(--c-text); }
.modal-bd { padding: 1.25rem; overflow-y: auto; flex: 1; }
.modal-ft { padding: .875rem 1.25rem; border-top: 1px solid var(--c-border); display: flex; justify-content: flex-end; gap: .75rem; background: var(--c-bg); flex-shrink: 0; }

/* ── Toast ──────────────────────────────────────────────────── */
#toast-ct { position: fixed; bottom: 1.25rem; right: 1.25rem; display: flex; flex-direction: column; gap: .5rem; z-index: 9999; pointer-events: none; }
.toast { display: flex; align-items: center; gap: .65rem; padding: .7rem 1rem; background: var(--c-surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); border-left: 4px solid var(--c-success); font-size: .85rem; font-weight: 500; pointer-events: all; animation: slideIn .2s ease; min-width: 240px; max-width: 340px; }
.toast.error { border-left-color: var(--c-danger); }
.toast.warning { border-left-color: #d97706; }
.toast.info { border-left-color: var(--c-info); }
.toast.success i { color: var(--c-success); }
.toast.error i { color: var(--c-danger); }
.toast.warning i { color: #d97706; }
.toast.info i { color: var(--c-info); }
.t-msg { flex: 1; }
.t-close { background: none; border: none; color: var(--c-text-xs); font-size: .8rem; padding: .1rem; pointer-events: all; }
.toast.removing { animation: slideOut .26s ease forwards; }

/* ── Notifications panel ────────────────────────────────────── */
.notif-panel { position: fixed; top: var(--topbar-h); right: 0; width: 320px; max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; background: var(--c-surface); border-left: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); box-shadow: var(--shadow-lg); z-index: 80; display: none; border-radius: 0 0 0 var(--radius); }
.notif-panel.open { display: block; animation: slideInRight .18s ease; }
.notif-item { padding: .8rem 1rem; border-bottom: 1px solid var(--c-border); cursor: pointer; transition: background var(--trans); }
.notif-item:hover { background: var(--c-bg); }
.notif-item.unread { background: var(--c-primary-l); }
.notif-title { font-size: .85rem; font-weight: 700; }
.notif-msg { font-size: .78rem; color: var(--c-text-s); margin-top: .15rem; }
.notif-time { font-size: .7rem; color: var(--c-text-xs); margin-top: .25rem; }

/* ── Offline banner ─────────────────────────────────────────── */
.offline-banner { background: #fef3c7; border-bottom: 1px solid #fbbf24; padding: .5rem 1rem; font-size: .82rem; color: #92400e; display: flex; align-items: center; gap: .5rem; }

/* ── Loaders ────────────────────────────────────────────────── */
.loading-center { display: flex; align-items: center; justify-content: center; padding: 3rem; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--c-border); border-top-color: var(--c-primary); border-radius: 50%; animation: spin .7s linear infinite; }
.spinner-sm { width: 20px; height: 20px; border-width: 2.5px; }

/* ── Empty state ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--c-text-s); }
.empty-state i { font-size: 3rem; opacity: .3; display: block; margin-bottom: 1rem; }
.empty-state p { font-size: .9rem; }
.empty-state .btn { margin-top: 1rem; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-top: 1.25rem; }
.pagination .btn { min-width: 36px; justify-content: center; }
.page-info { font-size: .82rem; color: var(--c-text-s); }

/* ── Search / filter bar ────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.filter-bar .form-ctrl { max-width: 260px; }
.status-filter { display: flex; gap: .35rem; flex-wrap: wrap; }
.status-chip { padding: .3rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 600; cursor: pointer; border: 1.5px solid var(--c-border); background: var(--c-surface); color: var(--c-text-s); transition: all var(--trans); white-space: nowrap; }
.status-chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.status-chip.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* ── Photo upload ───────────────────────────────────────────── */
.photo-upload-area { border: 2px dashed var(--c-border); border-radius: var(--radius); padding: 1.5rem; text-align: center; cursor: pointer; transition: all var(--trans); background: var(--c-bg); }
.photo-upload-area:hover { border-color: var(--c-primary); background: var(--c-primary-l); }
.photo-upload-area i { font-size: 2rem; color: var(--c-text-xs); display: block; margin-bottom: .5rem; }
.photo-upload-area p { font-size: .82rem; color: var(--c-text-s); }
.photo-preview-wrap { position: relative; display: inline-block; }
.photo-preview-wrap img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius-sm); border: 2px solid var(--c-border); }
.photo-preview-wrap .remove-photo { position: absolute; top: -6px; right: -6px; background: var(--c-danger); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: .7rem; display: flex; align-items: center; justify-content: center; }

/* ── Machine form in new job ────────────────────────────────── */
.machine-form-block { background: var(--c-bg); border: 1.5px solid var(--c-border); border-radius: var(--radius); padding: 1rem; margin-bottom: .75rem; position: relative; }
.machine-form-block .machine-block-num { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: var(--c-text-xs); margin-bottom: .75rem; }
.machine-form-block .remove-machine { position: absolute; top: .75rem; right: .75rem; }

/* ── Payment summary ────────────────────────────────────────── */
.payment-summary { background: linear-gradient(135deg, #f8fafc, #f1f5f9); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1.25rem; }
.payment-row { display: flex; align-items: center; justify-content: space-between; padding: .35rem 0; }
.payment-row:not(:last-child) { border-bottom: 1px solid var(--c-border); }
.payment-label { font-size: .82rem; color: var(--c-text-s); font-weight: 600; }
.payment-value { font-size: .95rem; font-weight: 700; }
.payment-value.pending { color: var(--c-danger); }
.payment-value.received { color: var(--c-success); }

/* ── Job card for print/share ───────────────────────────────── */
#job-card-canvas { display: none; }
/* The card itself is 480px, defined inline. Modal scrolls it on small screens. */
#job-card-print-area { border-radius: 8px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.1); }
/* modal xl on mobile: allow scroll */
.modal.xl { overflow: hidden; }
.modal.xl .modal-bd { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: .75rem; background: #e2e8f0; }
/* Center the card in the modal body */
.modal.xl .modal-bd > div { margin: 0 auto; }

/* Legacy classes kept for backward compat */
.jcp-header { display: flex; justify-content: space-between; align-items: flex-start; }
.jcp-logo { font-size: 18px; font-weight: 900; color: #1e40af; }
.jcp-tagline { font-size: 10px; color: #999; margin-top: 2px; }
.jcp-jobno { font-size: 12px; font-weight: 700; color: #1e40af; }
.jcp-section { margin-bottom: 12px; }
.jcp-section-title { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin-bottom: 6px; padding-bottom: 3px; border-bottom: 1px solid #e2e8f0; font-weight: 700; }
.jcp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.jcp-item .lbl { font-size: 9px; color: #94a3b8; text-transform: uppercase; }
.jcp-item .val { font-size: 12px; font-weight: 600; color: #1e293b; }
.jcp-machine { background: #f8f9fa; border-radius: 6px; padding: 10px; margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start; }
.jcp-machine-photo { width: 70px; height: 70px; object-fit: cover; border-radius: 5px; flex-shrink: 0; border: 1px solid #ddd; }
.jcp-machine-info { flex: 1; min-width: 0; }
.jcp-payment { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 6px; padding: 10px; }
.jcp-pay-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; }
.jcp-footer { border-top: 2px solid #1e40af; padding-top: 8px; margin-top: 8px; font-size: 9px; color: #94a3b8; text-align: center; }
.jcp-status { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 10px; font-weight: 700; }
.jcp-status.UNDER_REPAIR { background: #fee2e2; color: #b91c1c; }
.jcp-status.REPAIRED { background: #dcfce7; color: #15803d; }
.jcp-status.RETURN { background: #fef08a; color: #854d0e; }
.jcp-status.DELIVERED { background: #dbeafe; color: #1e3a8a; }

/* ── Track page ─────────────────────────────────────────────── */
.track-page { min-height: 100vh; background: var(--c-bg); padding: 1.5rem; }
.track-header { text-align: center; margin-bottom: 2rem; }
.track-header .logo { font-size: 2.5rem; color: var(--c-primary); margin-bottom: .5rem; }
.track-header h1 { font-size: 1.5rem; font-weight: 800; }
.track-header p { color: var(--c-text-s); }
.track-result { background: var(--c-surface); border-radius: var(--radius); padding: 1.25rem; margin-top: 1rem; border: 1px solid var(--c-border); }
.track-status-bar { display: flex; align-items: center; gap: .5rem; margin: 1rem 0; }
.track-step { flex: 1; text-align: center; position: relative; }
.track-step::after { content: ''; position: absolute; top: 14px; left: 60%; width: 80%; height: 2px; background: var(--c-border); z-index: 0; }
.track-step:last-child::after { display: none; }
.track-step-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--c-border); background: var(--c-surface); display: flex; align-items: center; justify-content: center; margin: 0 auto; font-size: .75rem; position: relative; z-index: 1; }
.track-step.done .track-step-dot { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.track-step.active .track-step-dot { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.track-step-label { font-size: .68rem; color: var(--c-text-xs); margin-top: .35rem; }

/* ── Barcode ────────────────────────────────────────────────── */
.barcode-wrap { text-align: center; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: 1rem; display: inline-block; }
.barcode-wrap svg { display: block; }
.barcode-label { font-family: monospace; font-size: .8rem; font-weight: 700; margin-top: .4rem; }

/* ── Audio recorder ─────────────────────────────────────────── */
.audio-recorder { display: flex; align-items: center; gap: .75rem; padding: .75rem; background: var(--c-bg); border-radius: var(--radius-sm); border: 1px solid var(--c-border); }
.rec-btn { width: 40px; height: 40px; border-radius: 50%; border: none; font-size: .9rem; display: flex; align-items: center; justify-content: center; }
.rec-btn.idle { background: var(--c-danger); color: #fff; }
.rec-btn.recording { background: var(--c-danger); color: #fff; animation: pulse 1s infinite; }
.rec-timer { font-size: .82rem; font-weight: 700; color: var(--c-text-s); font-variant-numeric: tabular-nums; }
audio { height: 36px; flex: 1; border-radius: var(--radius-sm); }

/* ── CSV Import preview ─────────────────────────────────────── */
.import-preview { max-height: 300px; overflow-y: auto; border: 1px solid var(--c-border); border-radius: var(--radius-sm); }

/* ── Misc ───────────────────────────────────────────────────── */
.dd { position: relative; display: inline-block; }
.dd-menu { position: absolute; right: 0; top: calc(100% + .35rem); background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); min-width: 160px; z-index: 100; display: none; }
.dd-menu.open { display: block; animation: fadeIn .12s ease; }
.dd-item { padding: .6rem 1rem; cursor: pointer; font-size: .84rem; color: var(--c-text); transition: background var(--trans); display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.dd-item:hover { background: var(--c-bg); }
.dd-item.danger { color: var(--c-danger); }
.dd-item:not(:last-child) { border-bottom: 1px solid var(--c-border); }
.section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-s); margin-bottom: .75rem; }
.tag { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .5rem; border-radius: 4px; font-size: .72rem; font-weight: 600; background: var(--c-bg); color: var(--c-text-s); border: 1px solid var(--c-border); }
.chip-group { display: flex; flex-wrap: wrap; gap: .35rem; }
.highlight { background: #fef9c3; padding: 0 2px; border-radius: 2px; }

/* ── Animations ─────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:.5; } }
@keyframes scaleIn { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(60px); opacity: 0; } }
@keyframes slideInRight { from { transform: translateX(60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* ── Flex wrap ──────────────────────────────────────────────── */
.flex-wrap { flex-wrap: wrap; }

/* ── Section title ──────────────────────────────────────────── */
.section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-text-s); margin-bottom: .5rem; }

/* ── Status filter chips ────────────────────────────────────── */
.status-filter-wrap { display: flex; gap: .35rem; flex-wrap: wrap; overflow-x: auto; padding-bottom: .25rem; -webkit-overflow-scrolling: touch; }
.status-chip[data-s="UNDER_REPAIR"].active,.status-chip[data-s="UNDER_REPAIR"]:hover { background:#fee2e2;color:#b91c1c;border-color:#fca5a5; }
.status-chip[data-s="REPAIRED"].active,.status-chip[data-s="REPAIRED"]:hover { background:#dcfce7;color:#15803d;border-color:#86efac; }
.status-chip[data-s="RETURN"].active,.status-chip[data-s="RETURN"]:hover { background:#fef08a;color:#854d0e;border-color:#fde047; }
.status-chip[data-s="DELIVERED"].active,.status-chip[data-s="DELIVERED"]:hover { background:#dbeafe;color:#1e3a8a;border-color:#93c5fd; }

/* ── Scrollable table ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--c-border); background: var(--c-surface); -webkit-overflow-scrolling: touch; }

/* ── Import preview ─────────────────────────────────────────── */
.import-preview-area { max-height: 220px; overflow-y: auto; border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: .75rem; background: var(--c-bg); margin-top: .75rem; }

/* ── Job detail ─────────────────────────────────────────────── */
.job-detail-num { font-size: .72rem; text-transform: uppercase; color: var(--c-text-xs); font-weight: 700; letter-spacing: .06em; margin-bottom: .25rem; }

/* ── Machine form block collapse ────────────────────────────── */
.machine-form-block { transition: all .2s ease; }

/* ── Barcode print center ───────────────────────────────────── */
.barcode-center { display: flex; justify-content: center; padding: 1rem; }

/* ── PWA Install prompt ─────────────────────────────────────── */
.install-prompt { position: fixed; bottom: 0; left: 0; right: 0; background: var(--c-primary); color: white; padding: 1rem; display: flex; align-items: center; gap: 1rem; z-index: 999; justify-content: space-between; }
.install-prompt p { font-size: .88rem; flex: 1; }
.install-prompt .actions { display: flex; gap: .5rem; }

/* ── Search highlight ───────────────────────────────────────── */
mark { background: #fef9c3; padding: 0 2px; border-radius: 2px; }

/* ── Soft card (no border) ──────────────────────────────────── */
.card-soft { background: var(--c-surface); border-radius: var(--radius); padding: 1.25rem; }

/* ── Status pills inline ────────────────────────────────────── */
.status-pills { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* ── Quick action row ───────────────────────────────────────── */
.quick-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed var(--c-border); }

/* ── Customer lookup hint ───────────────────────────────────── */
.cust-found { background: var(--c-success-l); border: 1px solid var(--c-success); border-radius: var(--radius-sm); padding: .5rem .75rem; font-size: .82rem; display: flex; align-items: center; gap: .5rem; }
.cust-new { background: var(--c-info-l); border: 1px solid var(--c-info); border-radius: var(--radius-sm); padding: .5rem .75rem; font-size: .82rem; }

/* ── Mobile responsive ──────────────────────────────────────── */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close-btn { display: flex; align-items: center; justify-content: center; }
  .main-wrap { margin-left: 0; }
  .topbar-menu-btn { display: flex; align-items: center; justify-content: center; }
  .topbar-search { display: none; }
  .page-body { padding: .75rem; }
  /* Dashboard: always 4 tiles per row on mobile */
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: .35rem; }
  .stat-num { font-size: 1.15rem; }
  .stat-card { padding: .5rem .4rem; }
  .stat-icon { width: 24px; height: 24px; font-size: .72rem; margin-bottom: .25rem; }
  .stat-label { font-size: .55rem; letter-spacing: 0; }
  .job-list { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .modal { max-width: 100%; max-height: 95vh; border-radius: var(--radius) var(--radius) 0 0; margin-top: auto; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal.lg, .modal.xl, .modal.sm { max-width: 100%; }
  #toast-ct { left: 1rem; right: 1rem; bottom: 1rem; }
  .notif-panel { width: 100%; }
  .topbar-actions .btn span { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .page-hd { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: .28rem; }
  .stat-card { padding: .45rem .3rem; }
  .stat-icon { width: 22px; height: 22px; font-size: .68rem; margin-bottom: .2rem; }
  .stat-num { font-size: 1rem; }
  .stat-label { font-size: .5rem; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* ── Enhanced Mobile & Touch ────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 42px; }
  .btn-sm { min-height: 34px; }
  .form-ctrl { min-height: 44px; font-size: 16px; }  /* prevents iOS zoom */
  select.form-ctrl { min-height: 44px; }
  .nav-item { padding: .8rem 1rem; min-height: 44px; }
  .topbar-menu-btn { min-height: 44px; min-width: 44px; }
  .notif-btn { min-height: 38px; min-width: 38px; }
}

/* ── Improved scrolling ─────────────────────────────────────── */
.page-body { -webkit-overflow-scrolling: touch; }
.modal-bd { -webkit-overflow-scrolling: touch; }
.sidebar-nav { -webkit-overflow-scrolling: touch; }

/* ── Better focus states ────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

/* ── Machine item body open fix ─────────────────────────────── */
.machine-item-bd.open { display: block; animation: fadeIn .15s ease; }

/* ── Better job card on mobile ──────────────────────────────── */
@media (max-width: 480px) {
  .job-list { grid-template-columns: 1fr; }
  .job-card-img { height: 100px; }
  .quick-status .btn { flex: 1; justify-content: center; }
}

/* ── Status bar fix ─────────────────────────────────────────── */
.track-status-bar { overflow-x: auto; padding-bottom: .5rem; }

/* ── Print styles ───────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .notif-panel, .offline-banner,
  .install-prompt, #toast-ct, .modal-ft { display: none !important; }
  .main-wrap { margin-left: 0 !important; }
  .page-body { padding: 0 !important; }
  .job-card-print { width: 100%; }
}

/* ── Skeleton loader ────────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--c-bg) 25%, var(--c-border) 50%, var(--c-bg) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ── Section headers ────────────────────────────────────────── */
.section-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-hd h2 { font-size: 1rem; font-weight: 700; }

/* ── Customer detail tabs ───────────────────────────────────── */
.tab-bar { display: flex; border-bottom: 2px solid var(--c-border); margin-bottom: 1rem; }
.tab-item { padding: .6rem 1rem; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--c-text-s); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-item.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }

/* ── Staff job section ──────────────────────────────────────── */
.job-section { overflow: hidden; }

/* ── Extra mobile fixes ─────────────────────────────────────── */
@media (max-width: 768px) {
  /* Prevent flex buttons from overflowing */
  .machine-item-hd { flex-wrap: wrap; }
  /* Job sections in staff view */
  .job-section > div { flex-wrap: wrap; }
  /* Quick actions in tables should wrap */
  table .flex { flex-wrap: wrap; }
  /* Topbar title truncation */
  .topbar-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
  /* Filter bar chips scrollable */
  .status-filter { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; -webkit-overflow-scrolling: touch; }
  .status-chip { flex-shrink: 0; }
  /* Page header wrap */
  .page-hd { gap: .5rem; }
  /* Card header wrap */
  .card-hd { flex-wrap: wrap; gap: .5rem; }
  /* Notif panel inline buttons */
  .notif-item .flex { margin-top: .5rem; }
  /* Wider touch targets for record button */
  .rec-btn { min-width: 44px; min-height: 44px; }
  /* Audio on small screens */
  .audio-recorder { flex-wrap: wrap; }
  /* Better modal footer on mobile */
  .modal-ft { flex-wrap: wrap; justify-content: stretch; }
  .modal-ft .btn { flex: 1; justify-content: center; min-width: 80px; }
}

@media (max-width: 480px) {
  /* Keep 4 tiles per row even on very small screens */
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: .25rem; }
  .job-list { grid-template-columns: 1fr; }
  .job-card-img { height: 90px; }
  .quick-status .btn { flex: 1; justify-content: center; }
  /* Topbar - hide title on very small, show hamburger */
  .topbar-title { display: none; }
  /* Buttons text in topbar */
  .topbar-actions .btn { padding: .35rem .5rem; }
  /* Form rows always 1 col */
  .form-row { grid-template-columns: 1fr !important; }
  /* Detail grid always 1 col */
  .detail-grid { grid-template-columns: 1fr !important; }
  /* Better job card layout */
  .job-card-body { padding: .75rem; }
  /* Staff machine list row */
  .job-section div[style*="padding:.75rem 1rem"] { padding: .5rem .75rem !important; }
}

/* ── No horizontal scroll guarantee ────────────────────────── */
html, body { overflow-x: hidden; max-width: 100vw; }
.main-wrap { overflow-x: hidden; max-width: 100%; }
.page-body { overflow-x: hidden; }

/* ── Stats for staff view ───────────────────────────────────── */
.staff-stat { background: var(--c-surface); border-radius: var(--radius); padding: 1.5rem; text-align: center; border: 1px solid var(--c-border); }
.staff-stat .num { font-size: 2.5rem; font-weight: 800; color: var(--c-primary); }
.staff-stat .lbl { font-size: .78rem; color: var(--c-text-s); text-transform: uppercase; font-weight: 600; letter-spacing: .04em; margin-top: .25rem; }

/* ── Improved payment section ───────────────────────────────── */
.payment-summary .payment-row:last-child { border-top: 2px solid var(--c-border); padding-top: .5rem; font-size: 1rem; }

/* ── Job detail sections ────────────────────────────────────── */
.jd-section { margin-bottom: 1.5rem; }

/* ── Dropdown arrow ─────────────────────────────────────────── */
.chevron-toggle { transition: transform .2s ease; }
.chevron-toggle.open { transform: rotate(180deg); }

/* ── Machine item better look ───────────────────────────────── */
.machine-item-hd:hover { background: var(--c-primary-l); }

/* ── Textarea resize handle ─────────────────────────────────── */
textarea.form-ctrl { resize: vertical; min-height: 80px; max-height: 300px; }

/* ── Notification badge ─────────────────────────────────────── */
.nav-badge { background: var(--c-danger); color: #fff; font-size: .62rem; font-weight: 700; padding: .1rem .4rem; border-radius: 999px; margin-left: auto; min-width: 18px; text-align: center; }

/* ── Smooth transitions ─────────────────────────────────────── */
.page-body > * { animation: fadeIn .22s ease; }

/* ── Number formatting ──────────────────────────────────────── */
.amount-large { font-size: 1.6rem; font-weight: 800; }
.amount-positive { color: var(--c-success); }
.amount-negative { color: var(--c-danger); }

/* ── Offline indicator ──────────────────────────────────────── */
.connection-bar { padding: .4rem 1rem; font-size: .8rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; }
.connection-bar.offline { background: #fee2e2; color: #dc2626; }
.connection-bar.syncing { background: #fef3c7; color: #b45309; }
.connection-bar.synced { background: #dcfce7; color: #16a34a; }

/* ── Better scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border-h); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-xs); }

/* ── Loading overlay ────────────────────────────────────────── */
.loading-overlay { position: absolute; inset: 0; background: rgba(255,255,255,.7); display: flex; align-items: center; justify-content: center; z-index: 10; border-radius: inherit; backdrop-filter: blur(2px); }

/* ── QR code canvas ─────────────────────────────────────────── */
#qr-canvas { max-width: 100%; height: auto; }

/* ── Track page fix ─────────────────────────────────────────── */
.track-page { background: linear-gradient(135deg, #f0f4ff 0%, #e8f5e9 100%); min-height: 100vh; }
.track-header { padding: 2.5rem 1.5rem 1.5rem; }

/* ── WhatsApp button ────────────────────────────────────────── */
.btn-whatsapp { background: #25D366; color: #fff; border-color: #25D366; }
.btn-whatsapp:hover:not(:disabled) { background: #128C7E; border-color: #128C7E; }

/* ── Sticky top bar ─────────────────────────────────────────── */
.topbar { box-shadow: 0 1px 3px rgba(0,0,0,.07); }

/* ── Tooltip ────────────────────────────────────────────────── */
[title] { position: relative; }

/* ── Required label ─────────────────────────────────────────── */
.required::after { content: ' *'; color: var(--c-danger); }

/* ── Accessibility ──────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Dark mode support (future) ─────────────────────────────── */
@media (prefers-color-scheme: dark) {
  /* Reserved for future dark mode implementation */
}
