/* ============================================================
   SignOn 2000 CRM — Demo V5
   Design language: signon-apps dashboards (niv/transport)
   RTL Hebrew · RagSans · NO backdrop-filter (iOS GPU rule)
   ============================================================ */

@font-face {
  font-family: 'RagSans';
  src: url('../fonts/RagSans-1.4-Regular.woff2') format('woff2'),
       url('../fonts/RagSans-1.4-Regular.woff') format('woff');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'RagSans';
  src: url('../fonts/RagSans-1.4-Bold.woff2') format('woff2'),
       url('../fonts/RagSans-1.4-Bold.woff') format('woff');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --dark: #364153;
  --gray: #6A7282;
  --blue: #0A85ED;
  --blue-brand: #006FFF;
  --blue-ix: #2D7BF3;           /* interactive blue: hovers, halos */
  --blue-light: #8DC1FF;
  --green: #28CDA5;
  --green-bg: #ECFDF5;
  --red: #F9513F;
  --red-bg: #FEF2F2;
  --purple: #7C3AED;
  --purple-bg: #EDE9FE;
  --bg: #F5F5F5;
  --bg-soft: #F8FAFF;
  --card: #ffffff;
  --text: #364153;
  --text-secondary: #4D4D4E;
  --text-light: #6A7282;
  --border: #E5E7EB;
  --border-card: #ECECEE;
  --shadow: 0 1px 3px rgba(54,65,83,0.06), 0 1px 2px rgba(54,65,83,0.04);
  --shadow-md: 0 4px 12px rgba(54,65,83,0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: 'RagSans', 'Noto Sans Hebrew', sans-serif;
  --sidebar-w: 252px;
  --topbar-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font-family: var(--font); color: var(--text); }
h1,h2,h3,h4 { font-weight: 700; }
img { max-width: 100%; }
a { color: var(--blue-brand); text-decoration: none; }

/* ============ App shell ============ */
.app-shell { display: flex; min-height: 100vh; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ============ Sidebar ============ */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--card);
  border-left: 1px solid var(--border-card);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  z-index: 50;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
}
.sidebar-brand img { width: 40px; height: 40px; object-fit: contain; }
.sidebar-brand .brand-name { font-size: 17px; font-weight: 700; line-height: 1.2; }
.sidebar-brand .brand-sub { font-size: 11px; color: var(--text-light); font-weight: 500; }

.sidebar-nav { padding: 4px 12px 20px; display: flex; flex-direction: column; gap: 2px; }
.nav-group-label {
  font-size: 10.5px; font-weight: 700; color: #A0A7B4;
  letter-spacing: .04em; padding: 14px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; border: none; background: none; width: 100%; text-align: right;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--bg-soft); color: var(--blue-brand); }
.nav-item.active { background: var(--blue-brand); color: #fff; }
.nav-item.active .nav-count { background: rgba(255,255,255,0.22); color: #fff; }
.nav-item.active img { filter: brightness(0) invert(1); }
.nav-item img { width: 18px; height: 18px; opacity: .85; }
.nav-item .nav-label { flex: 1; }
.nav-count {
  min-width: 24px; padding: 2px 7px; border-radius: 999px; text-align: center;
  font-size: 11px; font-weight: 700; background: var(--bg-soft); color: var(--text-light);
  border: 1px solid var(--border-card);
}
.nav-count.hot { background: #F0F6FF; color: var(--blue-brand); border-color: #D6E7FF; }

.sidebar-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--border-card); }
.demo-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--purple-bg); color: var(--purple);
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.sidebar-foot .foot-note { font-size: 10.5px; color: #A0A7B4; margin-top: 6px; line-height: 1.5; }

/* ============ Topbar ============ */
.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  background: var(--card); border-bottom: 1px solid var(--border-card);
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 40;
}
.hamburger {
  display: none; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-soft);
  align-items: center; justify-content: center; cursor: pointer; font-size: 17px;
}
.topbar-title { font-size: 17px; font-weight: 700; white-space: nowrap; }
.topbar-sub { font-size: 11.5px; color: var(--text-light); font-weight: 500; }

.search-wrapper { position: relative; flex: 1; max-width: 430px; margin-inline-start: auto; }
.search-input {
  width: 100%; height: 38px; padding: 0 16px 0 40px;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13.5px; direction: rtl; background: var(--bg-soft); outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search-input::placeholder { color: #A0A7B4; }
.search-input:focus { border-color: var(--blue-brand); background: #fff; box-shadow: 0 0 0 3px rgba(0,111,255,0.1); }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; opacity: .4; pointer-events: none;
}
.search-results {
  position: absolute; top: calc(100% + 6px); right: 0; left: 0;
  background: #fff; border: 1px solid var(--border-card); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15,24,52,0.14); z-index: 200;
  max-height: 380px; overflow-y: auto; display: none;
}
.search-results.open { display: block; }
.search-result-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  cursor: pointer; border-bottom: 1px solid #F1F3F5;
}
.search-result-row:last-child { border-bottom: none; }
.search-result-row:hover { background: var(--bg-soft); }
.search-result-row .sr-name { font-weight: 700; font-size: 13.5px; }
.search-result-row .sr-meta { font-size: 11.5px; color: var(--text-light); }
.search-empty { padding: 16px; text-align: center; color: var(--text-light); font-size: 13px; }

.notif-bell-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px;
  background: var(--bg-soft); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  overflow: visible; font-size: 16px;
}
.notif-bell-btn:hover { background: #ECF3FF; }
.notif-badge {
  position: absolute; top: -6px; right: -6px; left: auto; bottom: auto;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: #F9513F; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 3px 8px rgba(249,81,63,0.32);
}
.notif-badge:empty { display: none; }

/* user switcher chip */
.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-soft);
  cursor: pointer; transition: all .15s;
}
.user-chip:hover { border-color: var(--blue-brand); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; flex-shrink: 0;
}
.user-chip .uc-name { font-size: 12.5px; font-weight: 700; line-height: 1.1; }
.user-chip .uc-role { font-size: 10.5px; color: var(--text-light); }
.user-menu {
  position: absolute; top: calc(100% + 8px); left: 22px;
  background: #fff; border: 1px solid var(--border-card); border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(15,24,52,0.16); z-index: 300;
  width: 265px; padding: 8px; display: none;
}
.user-menu.open { display: block; }
.user-menu .um-title { font-size: 11px; font-weight: 700; color: #A0A7B4; padding: 8px 10px 4px; }
.um-user {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 10px; border: none; background: none;
  cursor: pointer; text-align: right;
}
.um-user:hover { background: var(--bg-soft); }
.um-user.active { background: #F0F6FF; }
.um-user .um-name { font-size: 13px; font-weight: 700; }
.um-user .um-role { font-size: 11px; color: var(--text-light); }
.um-user .um-check { margin-inline-start: auto; color: var(--blue-brand); font-weight: 700; }
.um-divider { height: 1px; background: var(--border-card); margin: 8px 4px; }
.um-reset {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 10px; border-radius: 10px; border: none; background: none;
  cursor: pointer; text-align: right; font-size: 12.5px; font-weight: 600; color: var(--red);
}
.um-reset:hover { background: var(--red-bg); }

/* ============ Content ============ */
.content { padding: 24px 26px 60px; max-width: 1280px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; }
.page-count-badge {
  background: var(--blue-brand); color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px; line-height: 1.4;
}
.page-head .page-actions { margin-right: auto; display: flex; gap: 8px; }

/* greeting card (dashboard) */
.greeting-card {
  background: var(--card); border: 1px solid var(--border-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 16px;
}
.greeting-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--blue-brand); color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue-brand);
}
.greeting-text .gt-hello { font-size: 13px; color: var(--text-light); font-weight: 500; }
.greeting-text .gt-title { font-size: 21px; font-weight: 700; }
.greeting-date {
  margin-right: auto; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--text-secondary);
}

/* dashboard layout */
.dash-grid { display: grid; grid-template-columns: 1fr 316px; gap: 20px; align-items: start; }
.dash-side { display: flex; flex-direction: column; gap: 20px; }

.section { margin-bottom: 26px; }
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-title { font-size: 19px; font-weight: 700; }
.section-title.danger { color: var(--red); }
.section-more { margin-right: auto; font-size: 12px; font-weight: 600; color: var(--blue-brand); cursor: pointer; background:none; border:none; }
.section-more:hover { text-decoration: underline; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; }
.kpi-card {
  background: #fff; border-radius: var(--radius-lg); padding: 20px 14px 18px;
  box-shadow: var(--shadow); border: 1px solid var(--border-card);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 7px; min-height: 118px; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.kpi-card.highlight { background: linear-gradient(135deg, #F0F6FF, #CCE5FF); border-color: var(--blue-light); }
.kpi-circle {
  width: 44px; height: 44px; border-radius: 50%; background: var(--blue-brand);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kpi-circle img { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.kpi-circle.green { background: var(--green); }
.kpi-circle.red { background: var(--red); }
.kpi-circle.gray { background: #94A3B8; }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--text-light); }
.kpi-value { font-size: 33px; font-weight: 800; line-height: 1; color: var(--blue-brand); }
.kpi-value.green { color: var(--green); }
.kpi-value.red { color: var(--red); }
.kpi-value.zero { color: #C2C8D2; }
.kpi-value.dark { color: var(--text); }

/* delayed-by-dept mini cards */
.kpi-grid.mini { grid-template-columns: repeat(3, 1fr); }
.kpi-card.mini { min-height: 96px; padding: 15px 12px 13px; }
.kpi-card.mini .kpi-value { font-size: 27px; }

/* quick panel (side) */
.side-card {
  background: var(--card); border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px;
}
.side-card .sc-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
}
.sc-title::before { content: ''; width: 3.5px; height: 17px; border-radius: 3px; background: var(--blue-brand); }
.quick-actions { display: flex; flex-direction: column; gap: 9px; }
.qa-btn {
  width: 100%; padding: 11px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card);
  font-size: 13.5px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; gap: 9px;
  transition: all .15s;
}
.qa-btn:hover { border-color: var(--blue-brand); color: var(--blue-brand); }
.qa-btn.primary { background: var(--blue-brand); border-color: var(--blue-brand); color: #fff; justify-content: center; }
.qa-btn.primary:hover { background: #0059CC; }

/* activity feed */
.activity-list { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 11px; padding: 11px 2px; border-bottom: 1px solid #F1F3F5; }
.activity-item:last-child { border-bottom: none; }
.act-ico {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: #F0F6FF;
}
.act-ico.new { background: #F0F6FF; }
.act-ico.status { background: var(--green-bg); }
.act-ico.note { background: #FEF3C7; }
.act-ico.cancel { background: var(--red-bg); }
.act-body { flex: 1; min-width: 0; }
.act-text { font-size: 12.5px; line-height: 1.45; color: var(--text-secondary); }
.act-text b { color: var(--text); }
.act-time { font-size: 11px; color: #A0A7B4; margin-top: 2px; }

/* ============ Vehicle list (reports) ============ */
.vehicle-list {
  background: var(--card); border: 1px solid var(--border-card);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.vehicle-row {
  display: flex; align-items: center; gap: 16px;
  padding: 15px 22px; border-bottom: 1px solid #F1F3F5;
  cursor: pointer; transition: background .12s;
}
.vehicle-row:last-child { border-bottom: none; }
.vehicle-row:hover { background: var(--bg-soft); }
.v-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: #F0F6FF; color: var(--blue-brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
}
.v-main { flex: 1; min-width: 0; }
.v-name-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.v-name { font-size: 15px; font-weight: 700; }
.v-num { font-size: 11.5px; color: #A0A7B4; font-weight: 600; }
.v-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-light); margin-top: 3px; flex-wrap: wrap; }
.v-meta .dot { color: #C9CFD8; }
.v-plate { font-weight: 700; color: var(--text-secondary); direction: ltr; unicode-bidi: embed; }
.v-phone { direction: ltr; unicode-bidi: embed; }
.v-side { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.days-badge {
  min-width: 34px; padding: 4px 9px; border-radius: 10px; text-align: center;
  font-size: 11.5px; font-weight: 700; background: #F1F3F5; color: var(--text-light);
  white-space: nowrap;
}
.days-badge.warn { background: #FEF3C7; color: #92400E; }
.days-badge.danger { background: #FEE2E2; color: #991B1B; }
.advance-btn {
  background: rgba(65,130,235,0.14); color: #2C55FB; border: none;
  border-radius: 16px; padding: 7px 15px; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.advance-btn:hover { background: rgba(65,130,235,0.25); }

/* status pills */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.status-pill .sdot { width: 7px; height: 7px; border-radius: 50%; }
.st-01 { background: #F0F6FF; color: #1E40AF; } .st-01 .sdot { background: #60A5FA; }
.st-02 { background: #F0FDFA; color: #115E59; } .st-02 .sdot { background: #14B8A6; }
.st-03 { background: #EEF2FF; color: #3730A3; } .st-03 .sdot { background: #6366F1; }
.st-04 { background: #F5F3FF; color: #5B21B6; } .st-04 .sdot { background: #8B5CF6; }
.st-05 { background: #ECFEFF; color: #155E75; } .st-05 .sdot { background: #06B6D4; }
.st-06 { background: #F0F9FF; color: #075985; } .st-06 .sdot { background: #0EA5E9; }
.st-07 { background: #F0F6FF; color: #1E3A5F; } .st-07 .sdot { background: #3B82F6; }
.st-08 { background: #F0FDF4; color: #166534; } .st-08 .sdot { background: #22C55E; }
.st-09 { background: #ECFDF5; color: #065F46; } .st-09 .sdot { background: #28CDA5; }
.st-10 { background: #F8FAFC; color: #475569; } .st-10 .sdot { background: #94A3B8; }
.st-X  { background: #F3F4F6; color: #6B7280; } .st-X  .sdot { background: #9CA3AF; }

/* list toolbar */
.list-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search-mini { position: relative; }
.search-mini input {
  padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; width: 230px; direction: rtl; background: var(--card); outline: none;
}
.search-mini input:focus { border-color: var(--blue-brand); }
.filter-select {
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 13px; background: var(--card); min-width: 140px; outline: none; cursor: pointer;
}
.empty-state {
  padding: 52px 20px; text-align: center; color: var(--text-light);
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-state .es-icon { font-size: 34px; margin-bottom: 10px; }
.empty-state .es-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 4px; }
.empty-state .es-sub { font-size: 12.5px; }

/* ============ Client modal ============ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(54,65,83,0.55); z-index: 1000;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; animation: overlayIn .22s ease; }
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
.client-modal {
  background: var(--card); border-radius: var(--radius-lg);
  width: 760px; max-width: 96vw; max-height: 88vh; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp .28s ease-out; display: flex; flex-direction: column;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-overlay.closing { animation: overlayOut .22s ease forwards; }
.modal-overlay.closing .client-modal { animation: cardOut .22s ease forwards; }
@keyframes overlayOut { to { opacity: 0; } }
@keyframes cardOut { to { opacity: 0; transform: scale(.96) translateY(8px); } }

.cm-header {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 13px; flex-shrink: 0;
}
.cm-header .v-avatar { width: 46px; height: 46px; font-size: 17px; }
.cm-head-main { flex: 1; min-width: 0; }
.cm-name { font-size: 17px; font-weight: 700; }
.cm-sub { font-size: 12.5px; color: var(--text-light); margin-top: 2px; }
.cm-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text-light); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.cm-close:hover { background: var(--border); }
.cm-body { padding: 22px; overflow-y: auto; flex: 1; }

/* current status banner */
.cm-status-banner {
  background: linear-gradient(135deg, #F0F6FF, #CCE5FF);
  border: 1px solid var(--blue-light); border-radius: var(--radius);
  padding: 15px 18px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.cm-status-banner.done { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); border-color: #6EE7B7; }
.cm-status-banner.cancelled { background: #F3F4F6; border-color: var(--border); }
.csb-main { flex: 1; min-width: 180px; }
.csb-label { font-size: 11.5px; font-weight: 600; color: var(--text-light); }
.csb-status { font-size: 17px; font-weight: 700; margin-top: 2px; }
.csb-days { font-size: 12px; color: var(--text-secondary); font-weight: 600; margin-top: 2px; }
.csb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  padding: 9px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 700; cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 7px;
  transition: all .15s;
}
.btn-primary { background: var(--blue-brand); color: #fff; }
.btn-primary:hover { background: #0059CC; }
.btn-primary:disabled { background: var(--border); color: #A0A7B4; cursor: not-allowed; }
.btn-ghost { background: var(--card); border-color: var(--border); color: var(--text-secondary); }
.btn-ghost:hover { border-color: var(--blue-brand); color: var(--blue-brand); }
.btn-danger-ghost { background: var(--card); border-color: var(--border); color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-bg); border-color: var(--red); }
.btn-wa { background: #25D366; color: #fff; }
.btn-wa:hover { background: #1DA851; }

/* details grid */
.cm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 8px; }
.cm-section { margin-bottom: 18px; }
.cm-sec-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; margin-bottom: 10px;
}
.cm-sec-title::before { content: ''; width: 3.5px; height: 15px; border-radius: 3px; background: var(--blue-brand); }
.info-box { background: var(--bg-soft); border: 1px solid var(--border-card); border-radius: var(--radius); padding: 4px 14px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid #EEF1F5; font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row .ir-label { color: var(--text-light); font-weight: 500; flex-shrink: 0; }
.info-row .ir-val { font-weight: 700; text-align: left; word-break: break-word; }
.info-row .ir-val.ltr { direction: ltr; unicode-bidi: embed; }

/* timeline */
.timeline { position: relative; padding-right: 26px; margin-top: 4px; }
.timeline::before { content: ''; position: absolute; right: 8px; top: 6px; bottom: 6px; width: 2px; background: #E3E8EF; border-radius: 2px; }
.tl-item { position: relative; padding: 0 0 16px; }
.tl-item:last-child { padding-bottom: 2px; }
.tl-dot {
  position: absolute; right: -26px; top: 3px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--blue-brand); border: 2.5px solid #fff;
  box-shadow: 0 0 0 1.5px var(--blue-light);
}
.tl-item.future .tl-dot { background: #D6DBE3; box-shadow: 0 0 0 1.5px #E5E7EB; }
.tl-item.cancel .tl-dot { background: var(--red); box-shadow: 0 0 0 1.5px #FECACA; }
.tl-title { font-size: 13px; font-weight: 700; }
.tl-item.future .tl-title { color: #A0A7B4; font-weight: 600; }
.tl-time { font-size: 11.5px; color: var(--text-light); margin-top: 1px; }
.tl-note {
  margin-top: 6px; background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 8px;
  padding: 7px 10px; font-size: 12px; color: #92400E; line-height: 1.5; white-space: pre-wrap;
}
.tl-photos { margin-top: 6px; font-size: 11.5px; color: var(--blue-brand); font-weight: 600; }

/* note editor */
.note-editor textarea {
  width: 100%; min-height: 74px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; resize: vertical; outline: none; background: var(--card);
}
.note-editor textarea:focus { border-color: var(--blue-brand); box-shadow: 0 0 0 2px rgba(10,133,237,0.12); }
.note-editor .ne-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ============ Forms (new client) ============ */
.form-card {
  background: var(--card); border: 1px solid var(--border-card);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 20px;
}
.form-sec-title { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.form-sec-title::before { content: ''; width: 4px; height: 17px; border-radius: 3px; background: var(--blue-brand); }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.form-field label .req { color: var(--red); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 12px; font-size: 13.5px; direction: rtl; background: var(--card); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-field textarea { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 2px rgba(10,133,237,0.15);
}
.form-field input.ltr { direction: ltr; text-align: right; }
.form-field input.invalid, .form-field select.invalid { border-color: var(--red); box-shadow: 0 0 0 2px rgba(249,81,63,0.12); }
.field-hint { font-size: 11px; color: #A0A7B4; margin-top: 4px; }
.radio-row { display: flex; gap: 8px; }
.radio-btn {
  flex: 1; padding: 9px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--card);
  font-size: 13px; font-weight: 600; color: var(--text-light); cursor: pointer;
  text-align: center; transition: all .15s;
}
.radio-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 2px 8px rgba(10,133,237,0.25); }

.fetch-row { display: flex; gap: 8px; align-items: flex-end; }
.fetch-row .form-field { flex: 1; }
.mini-btn {
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-soft);
  font-size: 12.5px; font-weight: 700; color: var(--blue-brand); cursor: pointer;
  white-space: nowrap; transition: all .15s;
}
.mini-btn:hover { border-color: var(--blue-brand); background: #F0F6FF; }
.vehicle-fetch-box {
  background: var(--bg-soft); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-top: 14px; font-size: 12.5px; color: var(--text-light);
}
.vehicle-fetch-box.filled { border-style: solid; border-color: #BBF7D0; background: #F0FDF4; color: #166534; }
.upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center; background: var(--bg-soft);
  cursor: pointer; transition: all .2s; font-size: 12.5px; color: var(--text-light);
}
.upload-area:hover { border-color: var(--blue-brand); background: #F0F6FF; }
.form-foot { display: flex; gap: 10px; justify-content: flex-start; padding: 4px 2px 30px; }
.form-foot .btn { padding: 12px 34px; font-size: 14.5px; }

/* ============ Confirm dialog ============ */
.confirm-box {
  background: var(--card); border-radius: var(--radius-lg);
  width: 400px; max-width: 92vw; padding: 26px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center;
  animation: slideUp .25s ease-out;
}
.confirm-box .cb-icon { font-size: 34px; margin-bottom: 10px; }
.confirm-box .cb-title { font-size: 16.5px; font-weight: 700; margin-bottom: 6px; }
.confirm-box .cb-text { font-size: 13.5px; color: var(--text-light); line-height: 1.55; margin-bottom: 18px; }
.confirm-box .cb-text b { color: var(--text); }
.cb-actions { display: flex; gap: 10px; justify-content: center; }
.cb-actions .btn { min-width: 96px; justify-content: center; }
.confirm-box select, .confirm-box textarea {
  width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 13px; margin-bottom: 10px; outline: none; background: var(--card);
}
.confirm-box textarea { min-height: 64px; resize: vertical; }

/* ============ Toast ============ */
.toast-wrap {
  position: fixed; bottom: 26px; right: 50%; transform: translateX(50%);
  z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--dark); color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(15,24,52,0.3);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .25s ease-out;
}
.toast.success { background: #0B9E7D; }
.toast.error { background: #D53B2C; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.toast.hide { animation: toastOut .25s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ============ Activity page ============ */
.activity-page-list {
  background: var(--card); border: 1px solid var(--border-card);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 20px;
}
.activity-page-list .activity-item { padding: 13px 2px; }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-side { order: -1; }
  .kpi-grid, .kpi-grid.mini { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; right: 0; top: 0; bottom: 0; height: 100vh;
    transform: translateX(100%); transition: transform .28s cubic-bezier(.22,.61,.36,1);
    box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(15,24,52,0.25); }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(54,65,83,0.45); z-index: 45;
  }
  .sidebar-backdrop.open { display: block; }
  .hamburger { display: flex; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar-title-wrap { display: none; }
  .content { padding: 18px 14px 60px; }
  .kpi-grid, .kpi-grid.mini { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: span 2; }
  .cm-grid { grid-template-columns: 1fr; }
  .vehicle-row { padding: 13px 14px; gap: 11px; }
  .v-side { flex-direction: column; align-items: flex-end; gap: 6px; }
  .user-chip .uc-text { display: none; }
  .user-menu { left: 12px; }
}
@media (max-width: 540px) {
  .kpi-grid, .kpi-grid.mini { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: span 1; }
  .greeting-date { display: none; }
  .search-wrapper { max-width: none; }
}
