/* =========================================
   FLEETSIGNALASSETS — styles.css
   Brand: Deep Navy + Electric Orange
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand */
  --primary:        #F97316;
  --primary-dark:   #EA580C;
  --primary-glow:   rgba(249,115,22,0.18);
  --accent:         #22D3EE;
  --accent-glow:    rgba(34,211,238,0.15);

  /* Navy palette */
  --bg:     #080D18;
  --bg2:    #0E1525;
  --bg3:    #141E33;
  --bg4:    #1C2840;

  /* Surfaces */
  --surface:   #111927;
  --surface2:  #192236;

  /* Borders */
  --border:    #1E2D48;
  --border2:   #263A58;
  --border3:   #2E4570;

  /* Text */
  --text:   #F0F4FF;
  --text2:  #C8D3E8;
  --text3:  #8A9BB8;
  --text4:  #5A6E8A;

  /* Semantic */
  --success:  #22C55E;
  --danger:   #F43F5E;
  --warning:  #FBBF24;

  /* Layout */
  --header-h:    58px;
  --bnav-h:      68px;
  --sidebar-w:   268px;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   18px;
  --radius-xl:   24px;
  --transition:  0.2s ease;

  /* Shadows */
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.4);
  --shadow:    0 6px 30px rgba(0,0,0,0.55);
  --shadow-lg: 0 16px 60px rgba(0,0,0,0.7);
  --glow-primary: 0 0 24px rgba(249,115,22,0.25);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; line-height: 1; }

input, select, textarea {
  font: inherit;
  background: var(--bg3);
  color: var(--text);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  width: 100%;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
input::placeholder, textarea::placeholder { color: var(--text4); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%235A6E8A' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

/* =====================
   LAYOUT
===================== */
#app { position: relative; min-height: 100dvh; }

.screen { display: none; flex-direction: column; min-height: 100dvh; }
.screen.active { display: flex; }

.screen-content {
  flex: 1;
  overflow-y: auto;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--bnav-h) + 12px);
  -webkit-overflow-scrolling: touch;
}
.screen-content::-webkit-scrollbar { width: 4px; }
.screen-content::-webkit-scrollbar-thumb { background: var(--border3); border-radius: 99px; }

.container { width: 100%; max-width: 700px; margin: 0 auto; padding: 18px 16px; }

/* =====================
   HEADER
===================== */
.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(8,13,24,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 14px; gap: 10px;
  z-index: 100;
}

.hdr-brand {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 700;
  justify-content: center;
  color: var(--text);
}

.hdr-actions { display: flex; gap: 6px; }

.hdr-menu {
  width: 38px; height: 38px;
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  padding: 6px; border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.hdr-menu:hover { background: var(--bg3); }
.hdr-menu span { display: block; height: 2px; background: var(--text2); border-radius: 2px; }

.hdr-back {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.hdr-back:hover { background: var(--bg3); }

.hdr-icon-btn {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text2);
  background: var(--bg3);
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.hdr-icon-btn:hover { background: var(--bg4); color: var(--text); }

.notif-btn .notif-dot {
  position: absolute; top: 7px; right: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  border: 1.5px solid var(--bg);
}

/* =====================
   SIDEBAR
===================== */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.65); z-index: 200;
  backdrop-filter: blur(4px);
}
.sidebar-overlay.open { display: block; }

.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100dvh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  z-index: 201;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.26s cubic-bezier(0.4,0,0.2,1);
}
.sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }

.sidebar-brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}
.sb-logo { display: flex; align-items: center; gap: 10px; }
.sb-name { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.sb-sub { font-size: 10px; color: var(--text4); font-weight: 500; }
.sb-close-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text4); font-size: 15px;
  transition: background var(--transition), color var(--transition);
}
.sb-close-btn:hover { background: var(--bg3); color: var(--text); }

.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.sb-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: white; flex-shrink: 0;
  box-shadow: var(--glow-primary);
}
.sb-user-name { font-size: 13px; font-weight: 700; color: var(--text); }
.sb-user-role { font-size: 11px; color: var(--text4); }
.sb-online-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  position: absolute; top: 14px; right: 16px;
  box-shadow: 0 0 6px var(--success);
}

.sb-nav { flex: 1; padding: 10px 10px; overflow-y: auto; }
.sb-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text4);
  padding: 8px 10px 4px;
}
.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text3); font-size: 13.5px; font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  position: relative;
  width: 100%;
}
.sb-link:hover, .sb-link.active {
  background: var(--primary-glow); color: var(--primary); text-decoration: none;
}
.sb-link-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg3); flex-shrink: 0;
  transition: background var(--transition);
}
.sb-link:hover .sb-link-icon, .sb-link.active .sb-link-icon { background: var(--primary-glow); }
.sb-badge {
  margin-left: auto;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700;
  border-radius: 99px; padding: 1px 6px;
}
.sb-logout {
  margin: 10px 10px 24px;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--danger); font-size: 13px; font-weight: 600;
  width: calc(100% - 20px);
  border: 1px solid rgba(244,63,94,0.2);
  transition: background var(--transition);
}
.sb-logout:hover { background: rgba(244,63,94,0.08); }

/* =====================
   BOTTOM NAV
===================== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--bnav-h);
  background: rgba(8,13,24,0.95);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; z-index: 100;
  padding: 0 4px;
}
.bnav-btn {
  flex: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text4); font-size: 10.5px; font-weight: 500;
  transition: color var(--transition);
}
.bnav-btn.active { color: var(--primary); }
.bnav-btn:hover { color: var(--text2); }

.bnav-center-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin: 0 8px;
  box-shadow: var(--glow-primary);
  transition: transform 0.15s, box-shadow var(--transition);
}
.bnav-center-btn:hover { transform: scale(1.06); box-shadow: 0 0 32px rgba(249,115,22,0.4); }
.bnav-center-btn:active { transform: scale(0.96); }

/* =====================
   AUTH / LOGIN
===================== */
.auth-wrap {
  min-height: 100dvh;
  display: flex;
  background: var(--bg);
}

.auth-panel {
  flex: 1; max-width: 480px;
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 32px;
  background: var(--bg);
  position: relative; z-index: 2;
}

.auth-visual {
  flex: 1;
  display: none;
  background: linear-gradient(135deg, #0E1525 0%, #111E38 50%, #0A1628 100%);
  position: relative; overflow: hidden;
  align-items: center; justify-content: center;
}

.av-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(249,115,22,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(249,115,22,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
}

.av-content {
  position: relative; z-index: 2;
  padding: 40px; display: flex; flex-direction: column; gap: 20px;
}

.av-stat-card {
  background: rgba(14,21,37,0.8);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 16px;
  backdrop-filter: blur(12px);
}
.av-stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary-glow);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.av-stat-icon.green { background: var(--accent-glow); }
.av-stat-val { font-size: 24px; font-weight: 800; color: var(--primary); }
.av-stat-lbl { font-size: 12px; color: var(--text3); }

.av-tagline {
  font-size: 22px; font-weight: 800; color: var(--text);
  line-height: 1.3; letter-spacing: -0.5px;
}

.auth-logo {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 32px;
}
.auth-logo-text { display: flex; flex-direction: column; }
.auth-brand { font-size: 20px; font-weight: 900; color: var(--text); letter-spacing: -0.5px; }
.auth-tagline { font-size: 11px; color: var(--primary); font-weight: 600; }

.auth-title { font-size: 28px; font-weight: 800; color: var(--text); margin-bottom: 6px; letter-spacing: -0.5px; }
.auth-sub { font-size: 14px; color: var(--text3); margin-bottom: 28px; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.field-wrap { display: flex; flex-direction: column; gap: 7px; }
.field-wrap label { font-size: 13px; font-weight: 600; color: var(--text2); }

.input-icon-wrap { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 13px; color: var(--text4); pointer-events: none; flex-shrink: 0; }
.input-icon-wrap input { padding-left: 40px; }
.input-icon-right {
  position: absolute; right: 10px;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text4); border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.input-icon-right:hover { color: var(--text2); }

.auth-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text3); cursor: pointer;
}
.checkbox-label input { width: auto; }
.auth-link { font-size: 13px; color: var(--primary); font-weight: 600; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0;
  color: var(--text4); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border2);
}

.auth-footer-text { font-size: 13px; color: var(--text3); text-align: center; }
.auth-version { font-size: 11px; color: var(--text4); text-align: center; margin-top: 24px; }

/* Input group */
.input-group { display: flex; gap: 8px; }
.input-group input, .input-group select { flex: 1; }

/* =====================
   BUTTONS
===================== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity var(--transition), transform 0.12s, box-shadow var(--transition);
  border: none;
  box-shadow: var(--glow-primary);
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 0 32px rgba(249,115,22,0.4); }
.btn-primary:active { transform: scale(0.97); }

.btn-outline {
  background: transparent;
  color: var(--text2);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--transition), border-color var(--transition);
}
.btn-outline:hover { background: var(--bg3); border-color: var(--border3); }

.btn-full { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

/* =====================
   DASHBOARD
===================== */
.dash-welcome {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px; padding-top: 4px;
}
.dash-greeting { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.4px; }
.dash-date { font-size: 13px; color: var(--text3); margin-top: 2px; }

.signal-indicator {
  display: flex; align-items: flex-end; gap: 3px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 20px; padding: 6px 10px 6px 8px;
  font-size: 10.5px; color: var(--success); font-weight: 600;
  gap: 3px;
}
.sig-bar {
  width: 4px; border-radius: 2px;
  background: var(--border3);
}
.sig-bar.active { background: var(--success); box-shadow: 0 0 6px var(--success); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color var(--transition), transform 0.15s;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); }

.stat-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.stat-icon.orange { background: var(--primary-glow); color: var(--primary); }
.stat-icon.cyan   { background: var(--accent-glow); color: var(--accent); }
.stat-icon.green  { background: rgba(34,197,94,0.12); color: var(--success); }
.stat-icon.red    { background: rgba(244,63,94,0.12); color: var(--danger); }

.stat-value { font-size: 28px; font-weight: 900; color: var(--text); letter-spacing: -1px; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text3); margin-top: 4px; font-weight: 500; }
.stat-trend { font-size: 11px; margin-top: 6px; font-weight: 600; }
.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

.section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--text4);
  margin-bottom: 12px; margin-top: 4px;
}

.quick-actions {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 24px;
}
.qa-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 600; color: var(--text3);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.qa-btn:hover { background: var(--bg3); border-color: var(--border2); color: var(--primary); }
.qa-icon {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: var(--bg3); display: flex; align-items: center; justify-content: center;
  color: var(--primary); transition: background var(--transition);
}
.qa-btn:hover .qa-icon { background: var(--primary-glow); }

.recent-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.recent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius);
  padding: 13px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.recent-card.flagged { border-left-color: var(--danger); }
.recent-card.cleared { border-left-color: var(--success); }
.recent-card.pending { border-left-color: var(--warning); }
.recent-card:hover { background: var(--bg3); border-color: var(--border2); }

.rc-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--bg3); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--text3); flex-shrink: 0;
}
.rc-icon.flagged { background: rgba(244,63,94,0.12); color: var(--danger); }
.rc-icon.cleared { background: rgba(34,197,94,0.12); color: var(--success); }

.rc-body { flex: 1; min-width: 0; }
.rc-title { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-meta { font-size: 11.5px; color: var(--text3); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.rc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.rc-time { font-size: 11px; color: var(--text4); }

.status-pill {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 2px 8px; border-radius: 99px;
}
.status-pill.flagged { background: rgba(244,63,94,0.15); color: var(--danger); border: 1px solid rgba(244,63,94,0.25); }
.status-pill.cleared { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.status-pill.pending { background: rgba(251,191,36,0.15); color: var(--warning); border: 1px solid rgba(251,191,36,0.25); }

.view-all-btn {
  width: 100%; padding: 11px;
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text3); font-size: 13px; font-weight: 600;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.view-all-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); }

/* =====================
   REPORTS LIST
===================== */
.summary-bar {
  display: flex; align-items: center; justify-content: space-around;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  margin-bottom: 14px;
}
.sum-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sum-num { font-size: 22px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.sum-lbl { font-size: 11px; color: var(--text4); font-weight: 500; }
.sum-divider { width: 1px; height: 36px; background: var(--border2); }

.toolbar {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 10px;
}
.search-box {
  flex: 1;
  display: flex; align-items: center; gap: 0;
  background: var(--bg3); border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); padding: 0 12px;
  transition: border-color var(--transition);
}
.search-box:focus-within { border-color: var(--primary); }
.search-box svg { flex-shrink: 0; }
.search-box input {
  background: transparent; border: none;
  padding: 10px 8px; font-size: 13.5px;
  box-shadow: none; border-radius: 0;
}
.search-box input:focus { border: none; box-shadow: none; }

.tool-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3); border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text2);
  flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.tool-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); }

.filter-tabs {
  display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.ftab {
  padding: 6px 16px; border-radius: 99px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--bg3); color: var(--text3);
  border: 1.5px solid var(--border2);
  transition: all var(--transition);
  flex-shrink: 0;
}
.ftab.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: var(--glow-primary); }

.reports-list { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.reports-list.grid-view { grid-template-columns: 1fr 1fr; }

/* Report Card */
.report-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid transparent;
  border-radius: var(--radius); padding: 14px 14px 14px 12px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 0.12s;
  position: relative;
}
.report-card:hover { background: var(--bg3); transform: translateX(2px); }
.report-card.flagged { border-left-color: var(--danger); }
.report-card.cleared { border-left-color: var(--success); }
.report-card.pending { border-left-color: var(--warning); }

.rcard-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 8px; }
.rcard-ref { font-size: 11px; color: var(--text4); font-weight: 600; }
.rcard-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.rcard-type { font-size: 12px; color: var(--text3); margin-bottom: 8px; }
.rcard-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.rcard-footer { display: flex; justify-content: space-between; align-items: center; }
.rcard-tech { font-size: 11.5px; color: var(--text3); display: flex; align-items: center; gap: 5px; }
.rcard-tech-avatar {
  width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 800; color: white;
}
.rcard-time { font-size: 11px; color: var(--text4); }

.tag { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.tag-group { background: rgba(30,45,72,0.8); color: var(--text3); border: 1px solid var(--border2); }

/* Grid card mode */
.grid-view .report-card { border-left-width: 0; border-top: 3px solid transparent; }
.grid-view .report-card.flagged { border-top-color: var(--danger); }
.grid-view .report-card.cleared { border-top-color: var(--success); }
.grid-view .rcard-title { max-width: unset; white-space: normal; font-size: 13px; }

/* =====================
   PAGINATION
===================== */
.pagination-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; flex-wrap: wrap;
}
.pg-info { font-size: 12px; color: var(--text3); flex: 1; }
.pg-btns { display: flex; gap: 4px; }
.pg-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg3); border: 1.5px solid var(--border2);
  color: var(--text2); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.pg-btn:hover:not(:disabled) { background: var(--primary); border-color: var(--primary); color: white; }
.pg-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pg-select {
  width: auto; padding: 6px 10px; font-size: 12px; height: 34px;
  background: var(--bg3); border: 1.5px solid var(--border2); color: var(--text2);
}

/* =====================
   WIZARD
===================== */
.wizard-steps {
  display: flex; align-items: center;
  margin-bottom: 24px; gap: 0;
}
.wstep {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1; cursor: default;
}
.wstep-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg3); border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--text4);
  transition: all var(--transition);
}
.wstep span { font-size: 11px; color: var(--text4); font-weight: 600; white-space: nowrap; }
.wstep.active .wstep-num { background: var(--primary); border-color: var(--primary); color: white; box-shadow: var(--glow-primary); }
.wstep.active span { color: var(--primary); }
.wstep.done .wstep-num { background: var(--success); border-color: var(--success); color: white; }
.wstep.done span { color: var(--success); }

.wstep-line { flex: 1; height: 2px; background: var(--border2); margin: 0 6px; margin-bottom: 14px; transition: background var(--transition); }
.wstep-line.done { background: var(--success); }

.wiz-step { display: flex; flex-direction: column; gap: 16px; }
.wiz-step.hidden { display: none; }
.wiz-heading { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }

.asset-picker-list { display: flex; flex-direction: column; gap: 8px; }
.asset-option {
  background: var(--bg3); border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm); padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.asset-option:hover { border-color: var(--primary); background: var(--primary-glow); }
.asset-option.selected { border-color: var(--primary); background: var(--primary-glow); }
.ao-id { font-size: 13px; font-weight: 700; color: var(--text); }
.ao-type { font-size: 11.5px; color: var(--text3); }
.ao-status { margin-left: auto; }

.report-type-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.rtype-card {
  background: var(--bg3); border: 2px solid var(--border2);
  border-radius: var(--radius); padding: 16px 14px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  cursor: pointer;
  transition: all var(--transition);
}
.rtype-card:hover { border-color: var(--primary); background: var(--primary-glow); }
.rtype-card.selected { border-color: var(--primary); background: var(--primary-glow); }
.rtype-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--bg4); display: flex; align-items: center; justify-content: center; color: var(--primary); }
.rtype-name { font-size: 13px; font-weight: 700; color: var(--text); }
.rtype-desc { font-size: 11px; color: var(--text4); }

.wizard-nav { display: flex; gap: 10px; }
.wizard-nav .btn-outline, .wizard-nav .btn-primary { flex: 1; }

/* Checklist */
.checklist-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.cl-section-hdr {
  background: var(--bg3); border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text2);
}
.cl-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.cl-item:last-child { border-bottom: none; }
.cl-item-info { flex: 1; min-width: 0; }
.cl-item-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.cl-item-hint { font-size: 11px; color: var(--text4); margin-top: 1px; }
.cl-result-btns { display: flex; gap: 5px; flex-shrink: 0; }

.rb-ok, .rb-flag, .rb-na {
  padding: 5px 10px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700;
  transition: all var(--transition); border: 1.5px solid transparent;
}
.rb-ok { background: rgba(34,197,94,0.1); color: var(--success); border-color: rgba(34,197,94,0.25); }
.rb-ok:hover, .rb-ok.active { background: var(--success); color: white; border-color: var(--success); }
.rb-flag { background: rgba(244,63,94,0.1); color: var(--danger); border-color: rgba(244,63,94,0.25); }
.rb-flag:hover, .rb-flag.active { background: var(--danger); color: white; border-color: var(--danger); }
.rb-na { background: var(--bg3); color: var(--text4); border-color: var(--border2); }
.rb-na:hover, .rb-na.active { background: var(--bg4); color: var(--text2); border-color: var(--border3); }

.sig-box {
  background: var(--bg3); border: 2px dashed var(--border2);
  border-radius: var(--radius-sm); padding: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text4); font-size: 13px; font-style: italic;
  transition: border-color var(--transition), color var(--transition);
}
.sig-box:hover { border-color: var(--primary); color: var(--primary); }
.sig-box.signed {
  border-color: var(--success); border-style: solid;
  background: rgba(34,197,94,0.07); color: var(--success);
  font-style: normal; font-weight: 700;
}

/* =====================
   REPORT DETAIL
===================== */
.detail-banner {
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 14px;
  border: 1px solid;
}
.detail-banner.flagged {
  background: rgba(244,63,94,0.07);
  border-color: rgba(244,63,94,0.25);
}
.detail-banner.cleared {
  background: rgba(34,197,94,0.07);
  border-color: rgba(34,197,94,0.25);
}
.db-status {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--danger); margin-bottom: 4px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.red { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.status-dot.green { background: var(--success); box-shadow: 0 0 8px var(--success); }
.db-ref { font-size: 12px; color: var(--text3); }

.score-ring {
  width: 62px; height: 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 4px solid transparent;
  font-size: 15px; font-weight: 800;
}
.score-ring.flagged { border-color: var(--danger); color: var(--danger); }
.score-ring.cleared { border-color: var(--success); color: var(--success); }
.score-lbl { font-size: 10px; color: var(--text4); text-align: center; margin-top: 4px; }

.detail-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 12px;
}
.ds-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text4);
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg3);
}
.ds-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 16px;
  border-bottom: 1px solid var(--border);
}
.ds-row:last-child { border-bottom: none; }
.ds-label { font-size: 13px; color: var(--text3); font-weight: 500; }
.ds-value { font-size: 13px; color: var(--text); font-weight: 600; text-align: right; }
.ds-value.mono { font-family: 'Courier New', monospace; color: var(--accent); }
.ds-value.italic { font-style: italic; }

.tag-pill { background: var(--bg3); color: var(--text2); border: 1px solid var(--border2); font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px; }

.result-timeline { padding: 8px 16px; display: flex; flex-direction: column; gap: 0; }
.rt-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.rt-item:last-child { border-bottom: none; }
.rt-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.rt-dot.ok { background: var(--success); box-shadow: 0 0 6px var(--success); }
.rt-dot.flag { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.rt-content { flex: 1; min-width: 0; }
.rt-name { font-size: 13px; font-weight: 600; color: var(--text); }
.rt-note { font-size: 11.5px; color: var(--text3); margin-top: 1px; }
.rt-status { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; flex-shrink: 0; }
.rt-status.ok { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.rt-status.flag { background: rgba(244,63,94,0.15); color: var(--danger); border: 1px solid rgba(244,63,94,0.3); }

.detail-actions {
  display: flex; gap: 10px; padding: 8px 0 16px;
}
.rd-section-lbl {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text4);
  padding: 10px 0 4px; border-top: 1px solid var(--border); margin-top: 4px;
}
.rd-section-lbl:first-child { border-top: none; margin-top: 0; }
.rd-photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px; padding: 4px 0;
}
.rd-photo-thumb {
  width: 100%; aspect-ratio: 1/1; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border);
  display: block; transition: opacity 0.18s;
}
.rd-photo-thumb:hover { opacity: 0.85; }

/* Admin Review Panel */
.admin-review-panel {
  background: rgba(249,115,22,0.06);
  border: 1.5px solid rgba(249,115,22,0.25);
  border-radius: var(--radius); padding: 16px;
  margin-top: 8px; margin-bottom: 16px;
}
.arp-header {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--primary);
  margin-bottom: 14px;
}
.arp-field { margin-bottom: 12px; }
.arp-status-btns { display: flex; gap: 8px; margin-top: 6px; }
.arp-status-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--border); background: var(--bg3);
  color: var(--text4); cursor: pointer; transition: all 0.18s;
}
.arp-status-btn:hover { border-color: var(--border2); color: var(--text); }
.arp-status-btn.active.cleared {
  background: rgba(34,197,94,0.12); border-color: var(--success);
  color: var(--success);
}
.arp-status-btn.active.flagged {
  background: rgba(244,63,94,0.12); border-color: var(--danger);
  color: var(--danger);
}
.arp-two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (max-width: 480px) { .arp-two-col { grid-template-columns: 1fr; } }
.arp-reviewed {
  font-size: 12px; color: var(--text4); margin-bottom: 10px;
  padding: 8px 12px; background: var(--bg3); border-radius: 6px;
  border: 1px solid var(--border);
}
.detail-actions .btn-outline, .detail-actions .btn-primary { flex: 1; }

/* =====================
   PROFILE
===================== */
.profile-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 20px 20px;
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 16px; text-align: center;
}
.ph-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 900; color: white;
  box-shadow: var(--glow-primary); margin-bottom: 12px;
}
.ph-name { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 3px; }
.ph-role { font-size: 13px; color: var(--primary); font-weight: 600; margin-bottom: 2px; }
.ph-email { font-size: 12px; color: var(--text4); margin-bottom: 18px; }
.ph-stats {
  display: flex; align-items: center; gap: 0;
  width: 100%; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); overflow: hidden;
}
.phs-item { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.phs-val { font-size: 18px; font-weight: 800; color: var(--text); }
.phs-lbl { font-size: 11px; color: var(--text4); }
.phs-div { width: 1px; height: 40px; background: var(--border2); }

.settings-group { margin-bottom: 14px; }
.sg-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text4); padding: 0 2px 6px; }
.sg-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sg-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 14px; font-weight: 500; color: var(--text2);
  transition: background var(--transition);
}
.sg-item:last-child { border-bottom: none; }
.sg-item:hover { background: var(--bg3); }
.sg-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sg-icon.orange { background: var(--primary-glow); color: var(--primary); }
.sg-icon.cyan { background: var(--accent-glow); color: var(--accent); }
.sg-icon.red { background: rgba(244,63,94,0.12); color: var(--danger); }
.sg-arrow { color: var(--text4); margin-left: auto; }
.sg-item.danger { color: var(--danger); }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--bg3); border: 1.5px solid var(--border2);
  border-radius: 99px; transition: all var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text4); left: 3px; top: 50%;
  transform: translateY(-50%);
  transition: all var(--transition);
}
.toggle input:checked + .toggle-slider { background: var(--primary-glow); border-color: var(--primary); }
.toggle input:checked + .toggle-slider::before { background: var(--primary); transform: translateY(-50%) translateX(18px); box-shadow: var(--glow-primary); }

.profile-version { font-size: 11px; color: var(--text4); text-align: center; padding: 16px 0; }

/* =====================
   SUPER ADMIN PROFILE
===================== */
.ph-avatar-wrap {
  position: relative; display: inline-block; margin-bottom: 12px;
}
.ph-admin-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2.5px solid var(--primary);
  box-shadow: 0 0 16px rgba(249,115,22,0.4), inset 0 0 12px rgba(249,115,22,0.08);
  animation: adminPulse 3s ease-in-out infinite;
}
@keyframes adminPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(249,115,22,0.4), inset 0 0 12px rgba(249,115,22,0.08); }
  50%       { box-shadow: 0 0 28px rgba(249,115,22,0.65), inset 0 0 12px rgba(249,115,22,0.08); }
}

.ph-badges {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; justify-content: center;
}

.admin-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, rgba(249,115,22,0.2), rgba(234,88,12,0.2));
  color: var(--primary);
  border: 1px solid rgba(249,115,22,0.4);
  border-radius: 99px; padding: 3px 12px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.3px; text-transform: uppercase;
}

.ph-org-badge {
  background: var(--bg3); color: var(--text3);
  border: 1px solid var(--border2);
  border-radius: 99px; padding: 3px 10px;
  font-size: 11px; font-weight: 600;
}

/* Permissions */
.perm-banner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(249,115,22,0.08); border: 1px solid rgba(249,115,22,0.25);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 12.5px; font-weight: 600; color: var(--primary);
  margin-bottom: 12px;
}

.perm-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.perm-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 12.5px; font-weight: 600; color: var(--text2);
}
.perm-item.granted {
  color: var(--success);
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.2);
}
.perm-item.granted svg { color: var(--success); flex-shrink: 0; }

/* Permission module groups */
.perm-module { margin-bottom: 14px; }
.perm-module:last-child { margin-bottom: 0; }
.perm-module-hdr {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text3);
  padding: 0 2px 8px 2px; margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Profile system overview grid */
.prof-overview-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pov-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
}
.pov-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.pov-val { font-size: 22px; font-weight: 800; color: var(--text1); line-height: 1; }
.pov-lbl { font-size: 11.5px; color: var(--text4); font-weight: 500; }

/* =====================
   USER MANAGEMENT
===================== */
.user-summary-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.usm-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 10px;
  text-align: center; cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.usm-card:hover { background: var(--bg3); }
.usm-val { font-size: 20px; font-weight: 800; color: var(--text1); line-height: 1; margin-bottom: 4px; }
.usm-lbl { font-size: 10.5px; color: var(--text4); font-weight: 500; }

.user-card {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  margin-bottom: 8px;
}
.uc-left  { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.uc-avatar {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
}
.uc-info  { flex: 1; min-width: 0; }
.uc-name  { font-size: 14px; font-weight: 700; color: var(--text1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-email { font-size: 11.5px; color: var(--text4); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-meta  { display: flex; gap: 6px; flex-wrap: wrap; }
.uc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; margin-left: 10px; }
.uc-status { font-size: 11px; font-weight: 600; color: var(--text3); display: flex; align-items: center; }
.uc-toggle-btn {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px; padding: 6px; color: var(--text3);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.uc-toggle-btn:hover { background: var(--bg4); }

/* Add User modal role picker */
.user-role-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.urole-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 12px 8px;
  text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.urole-card:hover { background: var(--bg3); }
.urole-card.selected { border-color: var(--primary); background: rgba(249,115,22,0.06); }
.urole-icon {
  width: 36px; height: 36px; border-radius: 10px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
}
.urole-name { font-size: 11px; font-weight: 700; color: var(--text2); margin-bottom: 2px; }
.urole-desc { font-size: 10px; color: var(--text4); font-weight: 500; }

/* =====================
   FLEET ASSETS
===================== */
.assets-list { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }

.asset-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid transparent;
  border-radius: var(--radius); padding: 14px 14px 14px 12px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 0.12s;
}
.asset-card:hover { background: var(--bg3); transform: translateX(2px); }
.asset-card.cleared { border-left-color: var(--success); }
.asset-card.flagged { border-left-color: var(--danger); }
.asset-card.pending { border-left-color: var(--warning); }

.ac-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 10px; gap: 10px;
}
.ac-id {
  font-size: 16px; font-weight: 800; color: var(--text);
  font-family: 'Courier New', monospace; letter-spacing: 0.5px;
}
.ac-type { font-size: 12px; color: var(--text3); margin-top: 2px; }

.ac-body { display: flex; flex-direction: column; gap: 8px; }

.ac-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.ac-stats {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.ac-stat {
  display: flex; flex-direction: column; gap: 1px;
}
.ac-stat-lbl { font-size: 10px; color: var(--text4); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.ac-stat-val { font-size: 13px; color: var(--text2); font-weight: 600; }

.ac-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ac-vin { font-size: 11px; color: var(--text4); font-family: 'Courier New', monospace; }
.ac-inspect { font-size: 11px; color: var(--text4); }

/* =====================
   MODAL
===================== */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 300;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }

.modal-sheet {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%; max-width: 500px;
  max-height: 88dvh;
  display: flex; flex-direction: column;
  animation: sheetUp 0.28s cubic-bezier(0.4,0,0.2,1);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: var(--border2); margin: 12px auto 0; flex-shrink: 0;
}
.modal-title { font-size: 17px; font-weight: 800; color: var(--text); padding: 14px 20px; }
.modal-body { flex: 1; overflow-y: auto; padding: 0 20px 8px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { padding: 16px 20px 28px; border-top: 1px solid var(--border); display: flex; gap: 10px; }
.modal-footer .btn-outline, .modal-footer .btn-primary { flex: 1; }

.filter-row { display: flex; flex-direction: column; gap: 8px; }
.filter-label { font-size: 12px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip {
  padding: 6px 14px; border-radius: 99px;
  font-size: 13px; font-weight: 600;
  background: var(--bg3); color: var(--text3); border: 1.5px solid var(--border2);
  transition: all var(--transition);
}
.fchip.active { background: var(--primary); color: white; border-color: var(--primary); }
.date-row { display: flex; align-items: center; gap: 8px; }
.date-row span { color: var(--text4); font-size: 13px; flex-shrink: 0; }
.date-row input { flex: 1; }

/* Add Asset Modal */
.add-asset-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--primary);
  padding: 4px 0 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.field-required { color: var(--danger); font-size: 12px; }
.field-hint { font-size: 11px; color: var(--text4); margin-top: 3px; }

.field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-row-3 { display: grid; grid-template-columns: 80px 1fr 1fr; gap: 10px; }

.status-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.spick {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text3);
  background: var(--bg3); border: 1.5px solid var(--border2);
  transition: all var(--transition); flex: 1;
}
.spick:hover { border-color: var(--border3); color: var(--text2); }
.spick.active { background: var(--primary-glow); border-color: var(--primary); color: var(--primary); }
.spick-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.spick-dot.cleared { background: var(--success); box-shadow: 0 0 6px var(--success); }
.spick-dot.flagged { background: var(--danger);  box-shadow: 0 0 6px var(--danger); }
.spick-dot.pending { background: var(--warning); box-shadow: 0 0 6px var(--warning); }

/* =====================
   ASSET DETAIL
===================== */
.ad-hero {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px; margin-bottom: 14px;
}
.ad-hero-icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: rgba(249,115,22,0.12); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.ad-hero-info { flex: 1; min-width: 0; }
.ad-asset-id   { font-size: 11px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.ad-asset-name { font-size: 17px; font-weight: 800; color: var(--text1); line-height: 1.2; margin-bottom: 3px; }
.ad-asset-type { font-size: 12.5px; color: var(--text4); font-weight: 500; }

.ad-stat-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 14px;
}
.ad-stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 10px; text-align: center;
}
.ad-stat-lbl { font-size: 10.5px; color: var(--text4); font-weight: 500; margin-bottom: 5px; }
.ad-stat-val  { font-size: 13px; font-weight: 700; color: var(--text1); }

.ad-info-grid { display: flex; flex-direction: column; gap: 0; }
.ad-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.ad-info-row:last-child { border-bottom: none; }
.ad-info-lbl { font-size: 13px; color: var(--text4); font-weight: 500; }
.ad-info-val  { font-size: 13px; color: var(--text1); font-weight: 600; text-align: right; }
.ad-vin       { font-family: monospace; font-size: 12px; letter-spacing: 0.5px; }

.ad-issues-box {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(244,63,94,0.08); border: 1px solid rgba(244,63,94,0.25);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13px; color: var(--danger); font-weight: 600;
}
.ad-no-issues {
  display: flex; align-items: center; gap: 8px;
  background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13px; color: var(--success); font-weight: 600;
}

.ad-insp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.ad-insp-row:last-child { border-bottom: none; }
.ad-insp-left  { display: flex; align-items: center; gap: 10px; }
.ad-insp-dot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ad-insp-dot.cleared { background: var(--success); }
.ad-insp-dot.flagged  { background: var(--danger); }
.ad-insp-dot.pending  { background: var(--warning); }
.ad-insp-name  { font-size: 13px; font-weight: 600; color: var(--text1); }
.ad-insp-meta  { font-size: 11.5px; color: var(--text4); margin-top: 2px; }

.ad-actions { margin-top: 6px; margin-bottom: 16px; }

/* =====================
   DRIVER CARDS
===================== */
.drivers-list { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }

.driver-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 0.12s;
}
.driver-card:hover { background: var(--bg3); border-color: var(--border2); transform: translateY(-1px); }

.dc-top {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 14px 12px;
}

.dc-avatar-wrap { position: relative; flex-shrink: 0; }
.dc-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bg3), var(--bg4));
  border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: var(--text2);
}
.dc-status-dot {
  position: absolute; bottom: 1px; right: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--surface);
}
.dc-status-dot.on-route { background: var(--accent);   box-shadow: 0 0 6px var(--accent); }
.dc-status-dot.active   { background: var(--success);  box-shadow: 0 0 6px var(--success); }
.dc-status-dot.off-duty { background: var(--warning);  box-shadow: 0 0 4px var(--warning); }
.dc-status-dot.inactive { background: var(--text4); }

.dc-info { flex: 1; min-width: 0; }
.dc-name { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.dc-emp-id { font-size: 11px; color: var(--text4); font-family: 'Courier New', monospace; margin-bottom: 6px; }
.dc-tags { display: flex; gap: 5px; flex-wrap: wrap; }

.dc-status-pill {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 3px 9px; border-radius: 99px; flex-shrink: 0;
  align-self: flex-start;
}
.dc-status-pill.on-route { background: rgba(34,211,238,0.15); color: var(--accent);   border: 1px solid rgba(34,211,238,0.3); }
.dc-status-pill.active   { background: rgba(34,197,94,0.15);  color: var(--success);  border: 1px solid rgba(34,197,94,0.3); }
.dc-status-pill.off-duty { background: rgba(251,191,36,0.15); color: var(--warning);  border: 1px solid rgba(251,191,36,0.3); }
.dc-status-pill.inactive { background: rgba(90,110,138,0.15); color: var(--text4);    border: 1px solid rgba(90,110,138,0.3); }

.tag-license {
  background: rgba(249,115,22,0.12); color: var(--primary);
  border: 1px solid rgba(249,115,22,0.25);
}

.dc-body {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  border-top: 1px solid var(--border);
}
.dc-stat {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 8px;
  border-right: 1px solid var(--border);
}
.dc-stat:last-child { border-right: none; }
.dc-stat-val { font-size: 16px; font-weight: 800; color: var(--text); line-height: 1; }
.dc-stat-lbl { font-size: 10px; color: var(--text4); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.dc-stat-val.danger { color: var(--danger); }
.dc-stat-val.accent { color: var(--primary); }

.dc-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg3);
}
.dc-vehicle {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text3);
}
.dc-phone {
  font-size: 12px; color: var(--text4);
  display: flex; align-items: center; gap: 5px;
}

/* =====================
   DRIVER INSPECTION
===================== */
.insp-driver-banner {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, var(--surface), var(--bg3));
  border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 20px;
}
.idb-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: white;
  box-shadow: var(--glow-primary);
}
.idb-info { flex: 1; }
.idb-name { font-size: 14px; font-weight: 700; color: var(--text); }
.idb-meta { font-size: 11.5px; color: var(--text3); margin-top: 2px; }
.idb-time {
  font-size: 22px; font-weight: 800; color: var(--primary);
  font-variant-numeric: tabular-nums; letter-spacing: -1px;
}

.insp-type-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.itype-card {
  background: var(--bg3); border: 2px solid var(--border2);
  border-radius: var(--radius-sm); padding: 12px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: all var(--transition);
}
.itype-card:hover  { border-color: var(--primary); background: var(--primary-glow); }
.itype-card.selected { border-color: var(--primary); background: var(--primary-glow); }
.itype-icon { color: var(--primary); flex-shrink: 0; }
.itype-name { font-size: 13px; font-weight: 700; color: var(--text); }
.itype-desc { font-size: 10.5px; color: var(--text4); margin-top: 1px; }

/* Inspection summary */
.insp-summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 16px;
}
.is-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.is-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text4); }
.is-score { font-size: 18px; font-weight: 900; }
.is-score.pass { color: var(--success); }
.is-score.fail { color: var(--danger); }
.is-counts {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
}
.is-count {
  flex: 1; padding: 10px 8px; text-align: center;
  border-right: 1px solid var(--border);
}
.is-count:last-child { border-right: none; }
.is-count-val { font-size: 20px; font-weight: 800; }
.is-count-lbl { font-size: 10px; color: var(--text4); font-weight: 600; text-transform: uppercase; }
.is-flagged-list { padding: 8px 16px 12px; }
.is-flag-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--danger);
}
.is-flag-row:last-child { border-bottom: none; }
.is-flag-row svg { flex-shrink: 0; }

/* ── Inspection photo section ── */
.insp-photo-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-top: 16px;
}
.ips-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ips-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: var(--text);
}
.ips-title svg { color: var(--accent); flex-shrink: 0; }
.ips-count {
  font-size: 12px; font-weight: 600; color: var(--text4);
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 10px;
}
.ips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.ips-thumb {
  position: relative; border-radius: 8px; overflow: hidden;
  aspect-ratio: 1 / 1; background: var(--bg3);
  border: 1px solid var(--border);
}
.ips-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ips-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: #fff;
  border: none; cursor: pointer; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.ips-remove:hover { background: var(--danger); }
.ips-thumb-num {
  position: absolute; bottom: 3px; left: 5px;
  font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.ips-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 10px;
  background: var(--bg3); border: 1.5px dashed var(--border2);
  border-radius: 8px; color: var(--accent);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}
.ips-add-btn:hover { background: var(--bg2); border-color: var(--accent); }
.ips-hint {
  font-size: 11px; color: var(--text4); text-align: center;
  margin-top: 8px; line-height: 1.4;
}

/* Shake validation animation */
@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.field-shake {
  animation: fieldShake 0.45s ease;
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(244,63,94,0.18) !important;
}

/* =====================
   ANALYTICS
===================== */
.an-kpi-row {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin-bottom: 12px;
}
.an-kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 12px; text-align: center;
}
.an-kpi-val { font-size: 24px; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.an-kpi-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text4); }

.an-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px;
}
.an-card-hdr {
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text4); margin-bottom: 12px;
}
.an-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 0; }
.an-two-col .an-card { margin-bottom: 12px; }

/* Donut */
.an-donut-wrap { display: flex; align-items: center; gap: 16px; }
.an-donut-chart { position: relative; flex-shrink: 0; }
.an-donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.an-donut-pct { font-size: 20px; font-weight: 900; color: var(--success); }
.an-donut-sub { font-size: 10px; color: var(--text4); font-weight: 600; text-transform: uppercase; }
.an-donut-legend { display: flex; flex-direction: column; gap: 8px; }
.an-leg-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text3); }
.an-leg-row strong { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--text); }
.an-leg-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Asset status bars */
.an-asset-status { display: flex; flex-direction: column; gap: 10px; }
.an-ast-row { display: flex; align-items: center; gap: 8px; }
.an-ast-lbl { font-size: 12px; color: var(--text3); width: 90px; flex-shrink: 0; }
.an-ast-bar-wrap { flex: 1; height: 8px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.an-ast-bar { height: 100%; border-radius: 99px; transition: width 0.4s; }
.an-ast-val { font-size: 12px; font-weight: 700; color: var(--text4); width: 24px; text-align: right; flex-shrink: 0; }

/* Issues bars */
.an-issue-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.an-issue-row:last-child { margin-bottom: 0; }
.an-issue-lbl { font-size: 12px; color: var(--text3); min-width: 120px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.an-issue-bar-wrap { flex: 1; height: 8px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.an-issue-bar { height: 100%; background: var(--danger); border-radius: 99px; transition: width 0.4s; }
.an-issue-count { font-size: 12px; font-weight: 700; color: var(--text4); width: 24px; text-align: right; flex-shrink: 0; }

/* Driver rows */
.an-drv-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer;
  transition: opacity 0.15s;
}
.an-drv-row:last-child { border-bottom: none; }
.an-drv-row:hover { opacity: 0.75; }
.an-drv-av {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.an-drv-info { flex: 1; min-width: 0; }
.an-drv-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.an-drv-bar-wrap { height: 6px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.an-drv-bar { height: 100%; background: var(--accent); border-radius: 99px; }
.an-drv-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.an-drv-trips { font-size: 11px; font-weight: 700; color: var(--text3); }
.an-drv-viol  { font-size: 11px; font-weight: 600; }

/* ── Analytics: small phones < 360px ── */
@media (max-width: 359px) {
  .an-kpi-row       { grid-template-columns: repeat(2,1fr); gap: 6px; }
  .an-kpi-val       { font-size: 18px; }
  .an-kpi-lbl       { font-size: 9px; }
  .an-two-col       { grid-template-columns: 1fr; }
  .an-donut-wrap    { flex-direction: column; align-items: center; }
  .an-donut-legend  { width: 100%; }
  .an-leg-row       { justify-content: space-between; }
  .an-issue-lbl     { min-width: 90px; max-width: 100px; font-size: 11px; }
  .an-ast-lbl       { width: 70px; font-size: 11px; }
  .an-drv-stats     { display: none; }
  .an-card          { padding: 12px 12px; }
  .an-card-hdr      { font-size: 11px; }
}

/* ── Analytics: phones 360–479px ── */
@media (min-width: 360px) and (max-width: 479px) {
  .an-kpi-row       { grid-template-columns: repeat(2,1fr); gap: 8px; }
  .an-kpi-val       { font-size: 20px; }
  .an-two-col       { grid-template-columns: 1fr; }
  .an-donut-wrap    { flex-direction: column; align-items: center; }
  .an-donut-legend  { width: 100%; }
  .an-leg-row       { justify-content: space-between; }
  .an-issue-lbl     { min-width: 100px; max-width: 120px; }
  .an-ast-lbl       { width: 80px; }
}

/* ── Analytics: phones 480–619px ── */
@media (min-width: 480px) and (max-width: 619px) {
  .an-kpi-row       { grid-template-columns: repeat(4,1fr); gap: 8px; }
  .an-kpi-val       { font-size: 20px; }
  .an-kpi-lbl       { font-size: 9px; }
  .an-two-col       { grid-template-columns: 1fr; }
  .an-donut-wrap    { flex-direction: row; }
  .an-issue-lbl     { min-width: 110px; max-width: 130px; }
}

/* ── Analytics: tablet portrait 620–767px ── */
@media (min-width: 620px) and (max-width: 767px) {
  .an-kpi-row       { grid-template-columns: repeat(4,1fr); gap: 10px; }
  .an-two-col       { grid-template-columns: 1fr 1fr; }
  .an-donut-wrap    { flex-direction: column; align-items: center; }
  .an-donut-legend  { width: 100%; }
  .an-issue-lbl     { min-width: 120px; max-width: 150px; }
  .an-card          { padding: 14px 16px; }
}

/* ── Analytics: tablet landscape 768–919px ── */
@media (min-width: 768px) and (max-width: 919px) {
  .an-kpi-row       { grid-template-columns: repeat(4,1fr); gap: 12px; }
  .an-kpi-val       { font-size: 26px; }
  .an-two-col       { grid-template-columns: 1fr 1fr; }
  .an-card          { padding: 16px 18px; }
  .an-issue-lbl     { min-width: 130px; max-width: 160px; }
  .an-ast-lbl       { width: 100px; }
  .an-drv-name      { font-size: 14px; }
}

/* ── Analytics: desktop 920–1199px ── */
@media (min-width: 920px) {
  .an-kpi-row       { grid-template-columns: repeat(4,1fr); gap: 14px; }
  .an-kpi-val       { font-size: 28px; }
  .an-two-col       { grid-template-columns: 1fr 1fr; gap: 14px; }
  .an-card          { padding: 18px 20px; margin-bottom: 14px; }
  .an-card-hdr      { font-size: 13px; margin-bottom: 14px; }
  .an-issue-lbl     { min-width: 160px; max-width: 200px; font-size: 13px; }
  .an-ast-lbl       { width: 110px; font-size: 13px; }
  .an-ast-bar-wrap,
  .an-drv-bar-wrap,
  .an-issue-bar-wrap { height: 10px; }
  .an-drv-av        { width: 38px; height: 38px; font-size: 12px; }
  .an-drv-name      { font-size: 14px; }
  .an-drv-trips     { font-size: 12px; }
  .an-drv-viol      { font-size: 12px; }
  .an-leg-row       { font-size: 13px; }
  .an-leg-row strong { font-size: 15px; }
  .an-donut-pct     { font-size: 24px; }
}

/* ── Analytics: wide desktop 1200px+ ── */
@media (min-width: 1200px) {
  .an-kpi-row       { gap: 16px; }
  .an-kpi-val       { font-size: 32px; }
  .an-kpi-lbl       { font-size: 11px; }
  .an-two-col       { gap: 16px; }
  .an-card          { padding: 20px 24px; margin-bottom: 16px; }
  .an-issue-lbl     { min-width: 180px; max-width: 220px; font-size: 13px; }
  .an-ast-lbl       { width: 120px; font-size: 13px; }
  .an-drv-av        { width: 40px; height: 40px; }
  .an-drv-name      { font-size: 14px; }
}

/* =====================
   DRIVER PROFILE
===================== */
.dp-hero {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 16px; margin-bottom: 12px;
}
.dp-avatar {
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 900; color: #fff; flex-shrink: 0;
}
.dp-hero-info { flex: 1; min-width: 0; }
.dp-name { font-size: 17px; font-weight: 800; color: var(--text); }
.dp-sub  { font-size: 12px; color: var(--text4); margin-top: 2px; }
.dp-status-badge { font-size: 12px; font-weight: 700; flex-shrink: 0; }

.dp-stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 12px;
}
.dp-stat {
  padding: 14px 8px; text-align: center;
  border-right: 1px solid var(--border);
}
.dp-stat:last-child { border-right: none; }
.dp-stat-val { font-size: 22px; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.dp-stat-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text4); }

.dp-insp-list { display: flex; flex-direction: column; }
.dp-insp-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border); cursor: pointer;
  transition: opacity 0.15s;
}
.dp-insp-row:last-child { border-bottom: none; }
.dp-insp-row:hover { opacity: 0.75; }
.dp-insp-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dp-insp-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.dp-insp-dot.ok   { background: var(--success); }
.dp-insp-dot.flag { background: var(--danger); }
.dp-insp-name { font-size: 13px; font-weight: 600; color: var(--text); }
.dp-insp-meta { font-size: 11px; color: var(--text4); margin-top: 2px; }

/* =====================
   SETTINGS
===================== */
.sett-section { margin-bottom: 20px; }
.sett-section-hdr {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.7px; color: var(--text4);
  margin-bottom: 8px; padding: 0 2px;
}
.sett-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.sett-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.sett-row:last-of-type { border-bottom: none; }
.sett-lbl { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; min-width: 140px; }
.sett-input {
  flex: 1; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 13px;
  color: var(--text); outline: none; min-width: 0;
  transition: border-color 0.18s;
}
.sett-input:focus { border-color: var(--accent); }
.sett-save-btn {
  display: block; width: calc(100% - 32px); margin: 12px 16px;
  padding: 10px; background: var(--accent); color: #fff;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: opacity 0.18s;
}
.sett-save-btn:hover { opacity: 0.88; }

/* Toggle switch */
.sett-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border);
}
.sett-toggle-row:last-child { border-bottom: none; }
.sett-toggle-info { flex: 1; }
.sett-toggle-title { font-size: 13px; font-weight: 600; color: var(--text); }
.sett-toggle-sub   { font-size: 11px; color: var(--text4); margin-top: 2px; }
.sett-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.sett-toggle input { opacity: 0; width: 0; height: 0; }
.sett-toggle-slider {
  position: absolute; inset: 0; background: var(--bg4);
  border-radius: 24px; cursor: pointer; transition: background 0.2s;
  border: 1px solid var(--border2);
}
.sett-toggle-slider::before {
  content: ""; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text4); bottom: 2px; left: 2px;
  transition: transform 0.2s, background 0.2s;
}
.sett-toggle input:checked + .sett-toggle-slider { background: var(--accent); border-color: var(--accent); }
.sett-toggle input:checked + .sett-toggle-slider::before { transform: translateX(20px); background: #fff; }

/* Info card */
.sett-info-card { padding: 4px 0; }
.sett-info-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
}
.sett-info-row:last-child { border-bottom: none; }
.sett-info-lbl { font-size: 12px; color: var(--text4); font-weight: 600; }
.sett-info-val  { font-size: 12px; color: var(--text3); }

/* Light mode override */
body.light-mode {
  --bg: #f4f6fa; --bg2: #eef0f5; --bg3: #e8eaf0; --bg4: #dde0ea;
  --surface: #ffffff; --text: #0f172a; --text2: #1e293b;
  --text3: #334155; --text4: #64748b; --border: #e2e8f0;
  --border2: #cbd5e1; --border3: #94a3b8;
}
/* Compact mode */
body.compact-mode .container { --gap: 8px; }
body.compact-mode .sett-row,
body.compact-mode .sett-toggle-row { padding: 8px 14px; }
body.compact-mode .drr-card,
body.compact-mode .report-card { padding: 10px 12px; margin-bottom: 7px; }

/* =====================
   DRIVERS REPORT
===================== */
.dr-summary-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 16px;
}
.dr-sum-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 10px; text-align: center;
}
.dr-sum-val { font-size: 22px; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.dr-sum-lbl { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text4); }

/* Inspection card */
.drr-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 10px; cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.drr-card:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(0,0,0,0.18); }

.drr-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.drr-asset { display: flex; align-items: center; gap: 10px; min-width: 0; }
.drr-asset-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0;
}
.drr-asset-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2; }
.drr-asset-vin  { font-size: 11px; color: var(--text4); margin-top: 2px; }

.drr-status {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 3px 10px; border-radius: 20px;
  flex-shrink: 0;
}
.drr-status.cleared { background: rgba(34,197,94,0.12); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.drr-status.flagged { background: rgba(244,63,94,0.12); color: var(--danger);  border: 1px solid rgba(244,63,94,0.25); }

.drr-meta { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.drr-meta-row {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text4); flex-wrap: wrap;
}
.drr-meta-row svg { flex-shrink: 0; color: var(--text4); }
.drr-sep { color: var(--border2); }

.drr-issues { margin-bottom: 8px; }
.drr-issues-lbl { font-size: 11px; font-weight: 700; color: var(--danger); margin-bottom: 5px; }
.drr-issues-list { display: flex; flex-wrap: wrap; gap: 5px; }
.drr-issue-tag {
  font-size: 11px; background: rgba(244,63,94,0.1); color: var(--danger);
  border: 1px solid rgba(244,63,94,0.2); border-radius: 4px; padding: 2px 8px;
}

.drr-notes {
  font-size: 12px; color: var(--text3); font-style: italic;
  border-left: 2px solid var(--border2); padding-left: 8px; margin-bottom: 8px;
  line-height: 1.4;
}

.drr-footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px;
}
.drr-duration { font-size: 12px; color: var(--text4); font-weight: 600; }
.drr-view { font-size: 12px; color: var(--accent); font-weight: 700; }

@media (max-width: 480px) {
  .dr-summary-row { grid-template-columns: repeat(2, 1fr); }
}

/* =====================
   TOAST
===================== */
.toast {
  position: fixed;
  bottom: calc(var(--bnav-h) + 14px); left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--bg3); color: var(--text);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  z-index: 500; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =====================
   PLACEHOLDER SCREEN
===================== */
.placeholder-screen {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 60px 20px; gap: 14px;
}
.ph-icon { color: var(--text4); margin-bottom: 4px; }
.placeholder-screen h3 { font-size: 20px; font-weight: 700; color: var(--text2); }
.placeholder-screen p { font-size: 14px; color: var(--text4); max-width: 300px; line-height: 1.6; }

/* =====================
   RESPONSIVE SYSTEM
   320 → 480 → 620 → 768 → 920 → 1200 → 1440+
===================== */

/* ── Small phones (< 360px) ── */
@media (max-width: 359px) {
  :root { --header-h: 52px; --bnav-h: 60px; }
  html { font-size: 14px; }
  .container { padding: 12px 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .perm-grid { grid-template-columns: 1fr; }
  .field-row-2, .field-row-3 { grid-template-columns: 1fr; }
  .prof-overview-grid { grid-template-columns: repeat(2, 1fr); }
  .user-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .user-role-grid { grid-template-columns: repeat(2, 1fr); }
  .bnav-btn span { display: none; }
  .auth-card { padding: 24px 16px; }
  .insp-type-grid { grid-template-columns: 1fr; }
  .dc-top { flex-wrap: wrap; gap: 8px; }
  .dc-status-pill { font-size: 10px; padding: 3px 8px; }
}

/* ── Phones 360–479px ── */
@media (min-width: 360px) and (max-width: 479px) {
  .container { padding: 14px 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .perm-grid { grid-template-columns: 1fr 1fr; }
  .user-summary-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Phones 480–619px ── */
@media (min-width: 480px) {
  .container { padding: 16px 18px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-sheet { max-width: 480px; margin: 0 auto; }
  .auth-panel { max-width: 400px; }
  .field-row-2 { grid-template-columns: 1fr 1fr; }
  .prof-overview-grid { grid-template-columns: repeat(4, 1fr); }
  .user-summary-grid { grid-template-columns: repeat(3, 1fr); }
  .user-role-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tablet portrait 620–767px ── */
@media (min-width: 620px) {
  :root { --header-h: 60px; }
  .container { padding: 20px 24px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .modal-sheet { border-radius: var(--radius-xl); max-width: 540px; margin: auto; }
  .modal-overlay { align-items: center; padding: 20px; }
  .auth-panel { max-width: 460px; }
  .auth-visual { display: flex; }
  .perm-grid { grid-template-columns: 1fr 1fr; }
  .prof-overview-grid { grid-template-columns: repeat(4, 1fr); }
  .user-summary-grid { grid-template-columns: repeat(3, 1fr); }
  .user-role-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row-3 { grid-template-columns: 1fr 1fr 1fr; }
  .reports-list.grid-view { grid-template-columns: repeat(2, 1fr); }
  .assets-list { display: grid; grid-template-columns: repeat(2, 1fr); }
  .drivers-list { grid-template-columns: repeat(2, 1fr); }
  .insp-type-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }
  .rcard-footer { flex-wrap: nowrap; }
}

/* ── Tablet landscape 768–919px ── */
@media (min-width: 768px) {
  :root { --header-h: 62px; --bnav-h: 70px; }
  .container { padding: 24px 28px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .modal-sheet { max-width: 580px; }
  .auth-panel { max-width: 480px; }
  .assets-list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .drivers-list { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .user-summary-grid { grid-template-columns: repeat(5, 1fr); }
  .user-card { padding: 16px 18px; }
  .pov-val { font-size: 26px; }
  .reports-list.grid-view { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .wiz-steps { gap: 10px; }
  .checklist-block { margin-bottom: 14px; }
}

/* ── Desktop 920–1199px ── */
@media (min-width: 920px) {
  :root { --sidebar-w: 260px; --header-h: 64px; --bnav-h: 0px; }

  /* Sidebar always visible — no hamburger needed */
  .sidebar {
    transform: translateX(0) !important;
    position: fixed; top: 0; left: 0; height: 100dvh;
    z-index: 50; box-shadow: none;
    border-right: 1px solid var(--border);
  }
  .sb-close-btn    { display: none; }
  .sidebar-overlay { display: none !important; }
  .hdr-menu        { display: none; }

  /* Push content right of sidebar */
  .app-header   { left: var(--sidebar-w); }
  .screen-content { padding-left: var(--sidebar-w); }
  .bottom-nav   { display: none; }

  .container { padding: 28px 32px; max-width: 1080px; }

  /* Cards & grids */
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .assets-list { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .drivers-list { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .reports-list.grid-view { grid-template-columns: repeat(3, 1fr); }
  .user-summary-grid { grid-template-columns: repeat(5, 1fr); gap: 12px; }
  .user-role-grid { grid-template-columns: repeat(4, 1fr); }
  .prof-overview-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .perm-grid { grid-template-columns: repeat(3, 1fr); }
  .insp-type-grid { grid-template-columns: repeat(3, 1fr); }
  .quick-actions { grid-template-columns: repeat(4, 1fr); }

  /* Buttons & actions */
  .detail-actions, .wizard-nav { justify-content: flex-end; }
  .detail-actions .btn-outline, .detail-actions .btn-primary,
  .wizard-nav .btn-outline, .wizard-nav .btn-primary { flex: unset; min-width: 150px; }
  .pagination-bar { justify-content: flex-end; }
  .pg-info { flex: unset; }

  /* Hover effects only on non-touch */
  .report-card:hover { transform: translateX(4px); }
  .asset-card:hover  { transform: translateX(2px); }
  .driver-card:hover { transform: translateY(-2px); }

  /* Modal wider on desktop */
  .modal-sheet { max-width: 620px; }
  .modal-overlay { padding: 24px; }
}

/* ── Wide desktop 1200–1439px ── */
@media (min-width: 1200px) {
  :root { --sidebar-w: 280px; }
  .container { max-width: 1200px; padding: 32px 40px; }
  .stat-grid { gap: 18px; }
  .assets-list { grid-template-columns: repeat(3, 1fr); }
  .drivers-list { grid-template-columns: repeat(3, 1fr); }
  .reports-list.grid-view { grid-template-columns: repeat(3, 1fr); }
  .perm-grid { grid-template-columns: repeat(3, 1fr); }
  .user-summary-grid { grid-template-columns: repeat(5, 1fr); }
  .prof-overview-grid { gap: 16px; }
  .modal-sheet { max-width: 680px; }
}

/* ── Ultra-wide 1440px+ ── */
@media (min-width: 1440px) {
  :root { --sidebar-w: 300px; }
  .container { max-width: 1360px; padding: 36px 48px; }
  .assets-list { grid-template-columns: repeat(4, 1fr); }
  .drivers-list { grid-template-columns: repeat(3, 1fr); }
  .reports-list.grid-view { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .user-summary-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; }
  .user-role-grid { grid-template-columns: repeat(4, 1fr); }
  .perm-module .perm-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Touch device optimisations ── */
@media (hover: none) and (pointer: coarse) {
  .report-card:hover,
  .asset-card:hover,
  .driver-card:hover { transform: none; }
  input, select, textarea { font-size: 16px; } /* prevent iOS zoom */
  .bnav-btn, .bnav-center-btn { min-height: 48px; }
  .sg-item, .sb-link { min-height: 48px; }
}

/* ── Landscape phone fix ── */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --header-h: 48px; --bnav-h: 54px; }
  .screen-content { padding-top: calc(var(--header-h) + 8px); padding-bottom: calc(var(--bnav-h) + 8px); }
  .profile-hero { padding: 16px 0 12px; }
  .ph-avatar { width: 56px; height: 56px; font-size: 18px; }
}

/* =====================
   SCROLLBAR
===================== */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border3); }

/* =====================
   AUTH SCREENS — FULL WIDTH, NO SIDEBAR
===================== */

/* Hide sidebar completely on login/register */
.sidebar-hidden {
  transform: translateX(-100%) !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Auth screens always take full viewport width */
#screen-login,
#screen-register {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: none;
}
#screen-login.active,
#screen-register.active {
  display: flex;
}

/* =====================
   APP LOADER
===================== */
.app-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  transition: opacity 0.3s;
}
.app-loader.hidden { display: none; }
.loader-spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--border2);
  border-top-color: var(--primary);
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-logo {
  width: 48px; height: 48px; margin-bottom: 4px;
}
.loader-text { font-size: 13px; color: var(--text3); font-weight: 600; }

/* =====================
   UTILITY
===================== */
.hidden { display: none !important; }

/* =====================================================================
   MAINTENANCE TICKETS
===================================================================== */

/* ---- KPI dashboard cards ---- */
.tk-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.tk-kpi-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 0.15s;
  position: relative;
  overflow: hidden;
}
.tk-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-color, var(--primary));
  opacity: 0;
  transition: opacity var(--transition);
}
.tk-kpi-card:hover { border-color: var(--border3); background: var(--surface2); }
.tk-kpi-card:hover::before { opacity: 1; }
.tk-kpi-card.active { border-color: var(--kpi-color, var(--primary)); background: var(--surface2); }
.tk-kpi-card.active::before { opacity: 1; }
.tk-kpi-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
  opacity: 0.8;
}
.tk-kpi-val {
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 4px;
}
.tk-kpi-lbl {
  font-size: 10px;
  color: var(--text4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- Critical alert banner ---- */
.tk-alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(244,63,94,0.1);
  border: 1.5px solid rgba(244,63,94,0.35);
  border-radius: var(--radius);
  padding: 11px 14px;
  color: #F43F5E;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 14px;
  transition: background var(--transition);
}
.tk-alert-banner:hover { background: rgba(244,63,94,0.16); }

/* ---- List section header ---- */
.tk-list-hdr { margin-bottom: 8px; }
.tk-list-hdr-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tk-list-hdr-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tk-list-hdr-count {
  background: var(--bg4);
  border: 1px solid var(--border2);
  color: var(--text3);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

/* ---- Priority badge ---- */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.priority-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.priority-badge.p-critical { background: rgba(244,63,94,0.15); color: #F43F5E; }
.priority-badge.p-high     { background: rgba(249,115,22,0.15); color: #F97316; }
.priority-badge.p-medium   { background: rgba(251,191,36,0.15); color: #FBBF24; }
.priority-badge.p-low      { background: rgba(34,211,238,0.15); color: #22D3EE; }

/* ---- Ticket status pill ---- */
.tk-status-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tk-status-pill.s-open        { background: rgba(244,63,94,0.12); color: #F43F5E; }
.tk-status-pill.s-in_progress { background: rgba(249,115,22,0.12); color: #F97316; }
.tk-status-pill.s-resolved    { background: rgba(34,197,94,0.12); color: #22C55E; }
.tk-status-pill.s-closed      { background: rgba(90,110,138,0.15); color: #8A9BB8; }

/* ---- Ticket card ---- */
.ticket-card {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.ticket-card:hover {
  border-color: var(--border3);
  background: var(--surface2);
}
.tc-priority-bar {
  width: 4px;
  flex-shrink: 0;
}
.tc-priority-bar.p-critical { background: #F43F5E; }
.tc-priority-bar.p-high     { background: #F97316; }
.tc-priority-bar.p-medium   { background: #FBBF24; }
.tc-priority-bar.p-low      { background: #22D3EE; }

.tc-body {
  flex: 1;
  padding: 12px 14px;
  min-width: 0;
}
.tc-header {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.tc-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.tc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-asset {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 6px;
}
.tc-vin {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--text4);
}
.tc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text4);
}
.tc-assign {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tc-arrow {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--text4);
  flex-shrink: 0;
}

/* ---- Priority filter chips ---- */
.priority-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pf-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  color: var(--text3);
  background: transparent;
  transition: all var(--transition);
  cursor: pointer;
}
.pf-chip:hover { border-color: var(--border3); color: var(--text); }
.pf-chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); }
.pf-chip.pc-critical.active { border-color: #F43F5E; color: #F43F5E; background: rgba(244,63,94,0.1); }
.pf-chip.pc-high.active     { border-color: #F97316; color: #F97316; background: rgba(249,115,22,0.1); }
.pf-chip.pc-medium.active   { border-color: #FBBF24; color: #FBBF24; background: rgba(251,191,36,0.1); }
.pf-chip.pc-low.active      { border-color: #22D3EE; color: #22D3EE; background: rgba(34,211,238,0.1); }

/* ---- Category picker in create modal ---- */
.cat-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.cat-btn {
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.3;
}
.cat-btn:hover { border-color: var(--border3); color: var(--text); }
.cat-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-glow); }

/* =====================================================================
   TICKET DETAIL
===================================================================== */
.td-hero {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.td-priority-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.td-pi-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.td-priority-indicator.p-critical { color: #F43F5E; }
.td-priority-indicator.p-high     { color: #F97316; }
.td-priority-indicator.p-medium   { color: #FBBF24; }
.td-priority-indicator.p-low      { color: #22D3EE; }

.td-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}
.td-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.td-cat-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg4);
  color: var(--text3);
  text-transform: capitalize;
  border: 1px solid var(--border2);
}
.td-hero-actions { flex-shrink: 0; }

/* ---- Workflow status ---- */
.td-workflow {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.td-workflow-btns {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.wf-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border2);
  color: var(--text3);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.wf-btn:hover { border-color: var(--border3); color: var(--text); }

/* ---- Info sections ---- */
.td-section {
  margin-bottom: 14px;
}
.td-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text4);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.td-info-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.td-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.td-info-row:last-child { border-bottom: none; }
.td-info-lbl {
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
  flex-shrink: 0;
}
.td-info-val {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  text-align: right;
}
.td-info-val.mono { font-family: 'Courier New', monospace; font-size: 12px; }

.td-description {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

/* ---- Flagged items list ---- */
.td-flagged-list {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.td-flagged-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.td-flagged-item:last-child { border-bottom: none; }
.td-fi-section {
  color: var(--text4);
  font-size: 11px;
  font-weight: 600;
  min-width: 90px;
}
.td-fi-name { color: var(--text2); }

/* ---- Notes textarea ---- */
.td-notes-input {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}
.td-notes-input:focus { outline: none; border-color: var(--primary); }

/* ---- "Create ticket from inspection" button on report detail ---- */
.btn-ticket {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid rgba(249,115,22,0.4);
  color: var(--primary);
  background: var(--primary-glow);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-ticket:hover { border-color: var(--primary); background: rgba(249,115,22,0.22); }

/* =====================================================================
   SHOP REPORT MODAL
===================================================================== */
.shop-report-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 16px;
}
.shop-report-overlay.open { display: flex; }

.shop-report-wrapper {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.shop-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 4px;
}

/* ---- The printable page itself ---- */
.sr-page {
  background: #ffffff;
  color: #111827;
  border-radius: 8px;
  padding: 32px 36px;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--shadow-lg);
}

.sr-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.sr-logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sr-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #F97316, #EA580C);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.sr-company {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}
.sr-company-sub {
  font-size: 11px;
  color: #6B7280;
}
.sr-header-right { text-align: right; }
.sr-doc-type {
  font-size: 20px;
  font-weight: 900;
  color: #111827;
  letter-spacing: 0.03em;
}
.sr-doc-num {
  font-size: 14px;
  font-weight: 700;
  color: #F97316;
  margin-top: 2px;
}
.sr-doc-date {
  font-size: 12px;
  color: #6B7280;
  margin-top: 2px;
}

.sr-divider {
  border: none;
  border-top: 2px solid #E5E7EB;
  margin: 14px 0;
}

.sr-priority-banner {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 18px;
}

.sr-section {
  margin-bottom: 18px;
}
.sr-section-title {
  font-size: 10px;
  font-weight: 800;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 6px;
  border-bottom: 1px solid #E5E7EB;
  margin-bottom: 10px;
}

.sr-table { width: 100%; }
.sr-table-row {
  display: flex;
  gap: 0;
  border: 1px solid #E5E7EB;
  border-bottom: none;
}
.sr-table-row:first-child { border-radius: 6px 6px 0 0; }
.sr-table-row:last-child  { border-bottom: 1px solid #E5E7EB; border-radius: 0 0 6px 6px; }
.sr-cell {
  flex: 1;
  padding: 8px 12px;
  border-right: 1px solid #E5E7EB;
}
.sr-cell:last-child { border-right: none; }
.sr-cell-wide { flex: 2; }
.sr-cell-full { flex: 1 1 100%; }
.sr-cell-label {
  font-size: 10px;
  color: #9CA3AF;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.sr-cell-val {
  font-size: 13px;
  color: #111827;
  font-weight: 600;
}
.sr-cell-val.sr-mono { font-family: 'Courier New', monospace; font-size: 12px; }
.sr-cell-val.sr-bold { font-weight: 700; }

/* Flagged items in report */
.sr-flagged-list {
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  overflow: hidden;
}
.sr-flagged-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid #F3F4F6;
  font-size: 12px;
  color: #374151;
}
.sr-flagged-item:last-child { border-bottom: none; }
.sr-fi-num {
  width: 18px;
  height: 18px;
  background: #FEE2E2;
  color: #DC2626;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.sr-fi-section {
  color: #6B7280;
  font-size: 11px;
  font-weight: 600;
  min-width: 100px;
}
.sr-fi-name { color: #111827; font-weight: 500; }

/* Parts & labor table */
.sr-pl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.sr-pl-table th, .sr-pl-table td {
  border: 1px solid #E5E7EB;
  padding: 7px 10px;
  text-align: left;
}
.sr-pl-table th {
  background: #F9FAFB;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6B7280;
}
.sr-pl-table td { color: #111827; min-height: 26px; height: 26px; }
.sr-total-row td { font-weight: 700; background: #F9FAFB; }

/* Signatures */
.sr-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.sr-sig { }
.sr-sig-line {
  border-bottom: 1.5px solid #374151;
  height: 40px;
  margin-bottom: 6px;
}
.sr-sig-label {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
}
.sr-sig-date {
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 2px;
}

.sr-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #E5E7EB;
  font-size: 10px;
  color: #9CA3AF;
}

/* =====================================================================
   PRINT STYLES — Shop Report
===================================================================== */
@media print {
  body > *:not(.shop-report-overlay) { display: none !important; }
  .shop-report-overlay {
    position: static !important;
    display: block !important;
    background: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  .shop-report-wrapper { max-width: 100% !important; }
  .shop-report-actions { display: none !important; }
  .sr-page {
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 20px !important;
  }
}
