/* ============================================================
   MotoPro CRM — Main Stylesheet (Enhanced Design v2)
   ============================================================ */

/* --- Root Variables ----------------------------------------- */
:root {
  --sidebar-width: 270px;
  --sidebar-collapsed: 70px;
  --topbar-height: 68px;
  --primary: #f59e0b;
  --primary-dark: #d97706;
  --primary-light: #fef3c7;
  --sidebar-bg1: #0f172a;
  --sidebar-bg2: #1e293b;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg-light: #f8fafc;
  --bg-body: #f1f5f9;
  --card-shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 24px rgba(0,0,0,.04);
  --card-shadow-hover: 0 8px 32px rgba(0,0,0,.1);
  --card-radius: 16px;
  --font: var(--font-family, 'Inter', sans-serif);
  --transition: all .25s cubic-bezier(.4,0,.2,1);
  --transition-fast: all .15s ease;
}

/* --- Base ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-dark);
  margin: 0;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.rtl { font-family: 'Tajawal', sans-serif; }

a { color: inherit; text-decoration: none; }

.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-sm { font-size: 0.78rem; }

/* Selection */
::selection {
  background: rgba(245,158,11,.2);
  color: var(--text-dark);
}

/* --- Sidebar ------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--sidebar-bg1) 0%, var(--sidebar-bg2) 100%);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: var(--transition);
  overflow: hidden;
  box-shadow: 4px 0 32px rgba(0,0,0,.2);
}

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
  box-shadow: -4px 0 32px rgba(0,0,0,.2);
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  min-height: 84px;
  background: rgba(0,0,0,.1);
}

.brand-icon {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(245,158,11,.3);
}

.garage-logo-img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.15);
}

.brand-name {
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  color: rgba(255,255,255,.4);
  font-size: 0.68rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: .03em;
}

/* Navigation */
.sidebar-nav-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 0;
}

.sidebar-nav-wrap::-webkit-scrollbar { width: 3px; }
.sidebar-nav-wrap::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-section-label {
  padding: 20px 22px 6px;
  color: rgba(255,255,255,.25);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 10px 18px;
  color: rgba(255,255,255,.55);
  border-radius: 12px;
  margin: 2px 12px;
  transition: var(--transition);
  font-weight: 500;
  font-size: 0.84rem;
  white-space: nowrap;
  position: relative;
}

.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
  transform: translateX(2px);
}

[dir="rtl"] .sidebar-nav .nav-link:hover {
  transform: translateX(-2px);
}

.sidebar-nav .nav-link.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(245,158,11,.35);
  font-weight: 600;
}

.sidebar-nav .nav-link.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

[dir="rtl"] .sidebar-nav .nav-link.active::before {
  left: auto;
  right: -12px;
  border-radius: 4px 0 0 4px;
}

.nav-icon {
  width: 22px;
  text-align: center;
  font-size: 0.92rem;
  flex-shrink: 0;
  opacity: .85;
}

.sidebar-nav .nav-link.active .nav-icon {
  opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,.08);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245,158,11,.25);
}

.sidebar-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.sidebar-user-name { color: #fff; font-weight: 600; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: rgba(255,255,255,.35); font-size: 0.68rem; white-space: nowrap; }

.sidebar-logout {
  color: rgba(255,255,255,.4);
  padding: 7px 10px;
  border-radius: 10px;
  transition: var(--transition);
}
.sidebar-logout:hover { background: rgba(239,68,68,.15); color: #ef4444; }

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
  backdrop-filter: blur(4px);
}

/* --- Main Wrapper -------------------------------------------- */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  background: var(--bg-body);
}

[dir="rtl"] .main-wrapper {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

/* --- Topbar -------------------------------------------------- */
.topbar {
  height: var(--topbar-height);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226,232,240,.6);
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 12px rgba(0,0,0,.04);
}

.topbar-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-dark);
  letter-spacing: -.01em;
}

.sidebar-toggle-btn {
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
  transition: var(--transition);
}

.sidebar-toggle-btn:hover {
  background: var(--bg-light);
  color: var(--text-dark);
  border-color: #cbd5e1;
}

/* Avatar circle */
.avatar-circle {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245,158,11,.2);
}

.user-menu-btn {
  background: transparent;
  border: none;
  padding: 6px 10px;
  border-radius: 12px;
  transition: var(--transition);
}

.user-menu-btn:hover { background: var(--bg-light); }

/* Notifications */
.notif-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: var(--transition);
  font-size: 0.95rem;
}

.notif-btn:hover { background: #e2e8f0; color: var(--text-dark); border-color: #cbd5e1; }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0 4px;
  border: 2px solid #fff;
}

.notif-dropdown {
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,.12) !important;
}

.notif-header { border-bottom: 1px solid var(--border); }
.mark-all-read { font-size: 0.75rem; color: var(--primary); font-weight: 600; }
.mark-all-read:hover { text-decoration: underline; }

.notif-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.notif-item.unread { background: #fffbeb; border-left: 3px solid var(--primary); }
.notif-item:hover { background: var(--bg-light); }
.notif-title { font-weight: 600; font-size: 0.82rem; color: var(--text-dark); }
.notif-msg { font-size: 0.76rem; margin-top: 3px; color: var(--text-muted); }
.notif-time { font-size: 0.68rem; color: #94a3b8; margin-top: 4px; }

/* --- Page Content ------------------------------------------- */
.page-content {
  flex: 1;
  padding: 28px 32px;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 14px;
}

.page-header-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0;
  letter-spacing: -.02em;
}

.page-header-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* --- Cards -------------------------------------------------- */
.card {
  border: 1px solid rgba(226,232,240,.6);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  background: #fff;
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 22px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-dark);
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
}

.card-body { padding: 22px; }

/* KPI Cards */
.kpi-card {
  padding: 16px;
  border-radius: var(--card-radius);
  background: #fff;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  border: 1px solid rgba(226,232,240,.5);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  border-radius: 3px 0 0 3px;
  transition: var(--transition);
}

[dir="rtl"] .kpi-card::before {
  left: auto;
  right: 0;
  border-radius: 0 3px 3px 0;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.kpi-card:hover .kpi-icon {
  transform: scale(1.05);
}

.kpi-icon.orange  { background: rgba(245,158,11,.1);  color: #d97706; }
.kpi-icon.blue    { background: rgba(59,130,246,.1);   color: #2563eb; }
.kpi-icon.green   { background: rgba(16,185,129,.1);   color: #059669; }
.kpi-icon.red     { background: rgba(239,68,68,.1);    color: #dc2626; }
.kpi-icon.purple  { background: rgba(139,92,246,.1);   color: #7c3aed; }
.kpi-icon.cyan    { background: rgba(6,182,212,.1);    color: #0891b2; }

/* KPI card left border colors */
.kpi-card:nth-child(1) .kpi-icon.orange ~ *,
.kpi-card:has(.kpi-icon.orange)::before { background: #f59e0b; }
.kpi-card:has(.kpi-icon.green)::before  { background: #10b981; }
.kpi-card:has(.kpi-icon.blue)::before   { background: #3b82f6; }
.kpi-card:has(.kpi-icon.red)::before    { background: #ef4444; }
.kpi-card:has(.kpi-icon.purple)::before { background: #8b5cf6; }
.kpi-card:has(.kpi-icon.cyan)::before   { background: #06b6d4; }

.kpi-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1;
  letter-spacing: -.02em;
}

.kpi-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.2;
}

.kpi-change {
  font-size: 0.65rem;
  font-weight: 600;
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 4px;
}

.kpi-change.up { color: #059669; background: rgba(16,185,129,.08); }
.kpi-change.down { color: #dc2626; background: rgba(239,68,68,.08); }

/* --- Buttons ------------------------------------------------ */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: 9px 22px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(245,158,11,.25);
  font-size: 0.84rem;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #b45309 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245,158,11,.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
  border-radius: 10px;
  font-weight: 600;
  padding: 9px 22px;
  font-size: 0.84rem;
  transition: var(--transition);
}

.btn-outline-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-1px);
}

.btn-danger  { border-radius: 10px; font-weight: 600; font-size: 0.84rem; }
.btn-success { border-radius: 10px; font-weight: 600; font-size: 0.84rem; }
.btn-secondary { border-radius: 10px; font-weight: 600; font-size: 0.84rem; }
.btn-info    { border-radius: 10px; font-weight: 600; font-size: 0.84rem; }
.btn-outline-secondary { border-radius: 10px; font-weight: 600; font-size: 0.84rem; transition: var(--transition); }
.btn-outline-danger    { border-radius: 10px; font-weight: 600; font-size: 0.84rem; transition: var(--transition); }
.btn-outline-success   { border-radius: 10px; font-weight: 600; font-size: 0.84rem; transition: var(--transition); }
.btn-outline-info      { border-radius: 10px; font-weight: 600; font-size: 0.84rem; transition: var(--transition); }

.btn-sm { padding: 5px 12px; font-size: 0.78rem; border-radius: 8px; }

/* Button group for status filters */
.d-flex.gap-2.mb-4 .btn-sm {
  border-radius: 20px;
  padding: 5px 14px;
}

/* --- Tables ------------------------------------------------- */
.table { font-size: 0.84rem; }
.table thead th {
  background: var(--bg-light);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 2px solid var(--border);
  padding: 13px 18px;
  white-space: nowrap;
}

.table tbody tr {
  transition: var(--transition-fast);
  border-bottom: 1px solid rgba(226,232,240,.5);
}

.table tbody tr:hover {
  background: rgba(245,158,11,.03);
}

.table tbody tr:last-child {
  border-bottom: none;
}

.table tbody td {
  padding: 14px 18px;
  vertical-align: middle;
  border-color: transparent;
  color: var(--text-dark);
}

/* Clickable rows */
.table tbody tr[onclick],
.table tbody tr[style*="cursor:pointer"],
.table tbody tr[style*="cursor: pointer"] {
  cursor: pointer;
}

.table tbody tr[onclick]:hover,
.table tbody tr[style*="cursor:pointer"]:hover {
  background: rgba(245,158,11,.06);
}

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 6px 14px;
  font-size: 0.84rem;
}

.dataTables_wrapper .dataTables_length select {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 4px 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important;
  border: 1px solid var(--border) !important;
  margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

.dataTables_wrapper .dataTables_info {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Forms -------------------------------------------------- */
.form-label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dark);
  margin-bottom: 6px;
  letter-spacing: -.01em;
}

.form-control, .form-select {
  border-radius: 10px;
  border: 1.5px solid var(--border);
  padding: 10px 15px;
  font-size: 0.84rem;
  transition: var(--transition);
  background: #fff;
  color: var(--text-dark);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(245,158,11,.1);
  outline: none;
}

.form-control::placeholder {
  color: #94a3b8;
}

textarea.form-control { resize: vertical; min-height: 100px; }

.input-group-text {
  border-radius: 10px 0 0 10px;
  background: var(--bg-light);
  border: 1.5px solid var(--border);
  border-right: none;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

[dir="rtl"] .input-group-text {
  border-radius: 0 10px 10px 0;
  border-right: 1.5px solid var(--border);
  border-left: none;
}

.form-control-sm, .form-select-sm {
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* --- Badges ------------------------------------------------- */
.badge {
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  letter-spacing: .02em;
}

.badge.bg-success { background: rgba(16,185,129,.12) !important; color: #059669; }
.badge.bg-danger  { background: rgba(239,68,68,.12)  !important; color: #dc2626; }
.badge.bg-warning { background: rgba(245,158,11,.12) !important; color: #92400e; }
.badge.bg-info    { background: rgba(59,130,246,.12)  !important; color: #1d4ed8; }
.badge.bg-primary { background: rgba(139,92,246,.12)  !important; color: #7c3aed; }
.badge.bg-secondary { background: rgba(100,116,139,.12) !important; color: #475569; }
.badge.bg-dark    { background: rgba(30,41,59,.9)     !important; color: #fff; letter-spacing: .04em; }
.badge.bg-light   { background: var(--bg-light) !important; color: var(--text-dark); border: 1px solid var(--border); }

/* Status colors */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* --- Flash -------------------------------------------------- */
.flash-container .alert {
  border-radius: 14px;
  border: none;
  font-weight: 500;
  font-size: 0.85rem;
  backdrop-filter: blur(8px);
}

.flash-container .alert-success {
  background: linear-gradient(135deg, rgba(209,250,229,.9), rgba(167,243,208,.8));
  color: #065f46;
}

.flash-container .alert-danger {
  background: linear-gradient(135deg, rgba(254,226,226,.9), rgba(254,202,202,.8));
  color: #991b1b;
}

/* --- Empty State -------------------------------------------- */
.text-center.text-muted.py-4,
.text-center.text-muted.py-5 {
  font-size: 0.85rem;
}

.text-center.text-muted.py-4 .fas,
.text-center.text-muted.py-5 .fas {
  opacity: .3;
}

/* --- Filter Cards ------------------------------------------- */
.card.mb-4 > .card-body.py-3 {
  background: rgba(248,250,252,.5);
  border-bottom: 1px solid rgba(226,232,240,.4);
}

/* --- Voice Report (KEY FEATURE) ----------------------------- */
.voice-container {
  max-width: 800px;
  margin: 0 auto;
}

.voice-record-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #fff;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 32px rgba(239,68,68,.35);
  margin: 0 auto 24px;
  position: relative;
}

.voice-record-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 40px rgba(239,68,68,.45);
}

.voice-record-btn.recording {
  animation: pulse-record 1.5s infinite;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.voice-record-btn.stopped {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 8px 32px rgba(16,185,129,.35);
}

@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  50%       { box-shadow: 0 0 0 24px rgba(239,68,68,.0); }
}

.voice-status {
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 20px;
}

.voice-status.idle   { color: var(--text-muted); }
.voice-status.active { color: #dc2626; }
.voice-status.done   { color: #059669; }

.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 48px;
  margin-bottom: 20px;
  opacity: 0;
  transition: opacity .3s;
}

.waveform.active { opacity: 1; }

.wave-bar {
  width: 4px;
  background: var(--primary);
  border-radius: 4px;
  animation: wave 0.8s ease-in-out infinite alternate;
}

.wave-bar:nth-child(1)  { animation-delay: 0s; }
.wave-bar:nth-child(2)  { animation-delay: .1s; }
.wave-bar:nth-child(3)  { animation-delay: .2s; }
.wave-bar:nth-child(4)  { animation-delay: .3s; }
.wave-bar:nth-child(5)  { animation-delay: .4s; }
.wave-bar:nth-child(6)  { animation-delay: .3s; }
.wave-bar:nth-child(7)  { animation-delay: .2s; }
.wave-bar:nth-child(8)  { animation-delay: .1s; }

@keyframes wave {
  from { height: 8px; }
  to   { height: 40px; }
}

.voice-transcript-box {
  background: #f8fafc;
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 20px;
  min-height: 200px;
  font-size: 0.95rem;
  line-height: 1.8;
  transition: var(--transition);
  white-space: pre-wrap;
}

.voice-transcript-box.active { border-color: var(--primary); background: #fffbeb; }
.voice-interim { color: #94a3b8; font-style: italic; }

.voice-transcript-edit {
  border-radius: 14px;
  border: 2px solid var(--border);
  padding: 16px;
  font-size: 0.95rem;
  line-height: 1.8;
  min-height: 200px;
  resize: vertical;
  transition: var(--transition);
}

.voice-transcript-edit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(245,158,11,.1);
}

/* Report Print Styles */
.report-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 20px;
  overflow: hidden;
}

.report-section-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 12px 18px;
  font-weight: 700;
  font-size: 0.9rem;
}

.report-section-body {
  padding: 18px;
  background: #fff;
}

/* --- Print Styles ------------------------------------------- */
@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .sidebar-overlay, .no-print { display: none !important; }
  .main-wrapper { margin: 0 !important; }
  .page-content { padding: 0 !important; }
  .print-page { padding: 0; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }

  .print-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 3px solid #f59e0b;
    margin-bottom: 30px;
  }
}

.print-page .print-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 20px;
  border-bottom: 3px solid var(--primary);
  margin-bottom: 30px;
}

.print-garage-info h2 { font-size: 1.6rem; font-weight: 800; color: var(--text-dark); }
.print-garage-info p  { color: var(--text-muted); font-size: 0.85rem; margin: 0; }
.print-logo { width: 80px; height: 80px; object-fit: contain; }

.print-report-title {
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 24px;
  font-size: 1.2rem;
  font-weight: 800;
}

/* --- Landing Page ------------------------------------------- */
.landing-body {
  background: linear-gradient(135deg, var(--sidebar-bg1) 0%, var(--sidebar-bg2) 100%);
  min-height: 100vh;
}

.hero-section {
  padding: 100px 0 80px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(245,158,11,.15);
  color: var(--primary);
  border: 1px solid rgba(245,158,11,.3);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero-title .highlight {
  color: var(--primary);
  position: relative;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255,255,255,.7);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn-hero-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 14px 32px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  box-shadow: 0 8px 32px rgba(245,158,11,.35);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(245,158,11,.5);
  color: #fff;
}

.btn-hero-ghost {
  background: rgba(255,255,255,.08);
  color: #fff;
  padding: 14px 32px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid rgba(255,255,255,.2);
  transition: var(--transition);
  backdrop-filter: blur(8px);
}

.btn-hero-ghost:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}

/* Feature Cards on Landing */
.feature-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  height: 100%;
}

.feature-card:hover {
  background: rgba(255,255,255,.1);
  border-color: var(--primary);
  transform: translateY(-4px);
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(245,158,11,.3);
}

.feature-title { color: #fff; font-weight: 700; font-size: 1rem; margin-bottom: 8px; }
.feature-desc  { color: rgba(255,255,255,.55); font-size: 0.84rem; line-height: 1.6; }

/* Pricing Cards */
.pricing-card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  transition: var(--transition);
}

.pricing-card.featured {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-color: var(--primary);
  transform: scale(1.05);
}

.pricing-price {
  font-size: 2.5rem;
  font-weight: 900;
  color: #fff;
}

.pricing-period { color: rgba(255,255,255,.6); font-size: 0.85rem; }

/* --- Calendar (Appointments) -------------------------------- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 4px 4px;
  border-radius: 10px;
  background: var(--bg-light);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
}

.cal-day:hover { background: #e2e8f0; }
.cal-day.today { background: var(--primary); color: #fff; }
.cal-day.has-apt::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #3b82f6;
  border-radius: 50%;
  margin-top: 4px;
}

/* --- Quick Actions ----------------------------------------- */
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.84rem;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.quick-action-btn:hover {
  border-color: var(--primary);
  background: rgba(245,158,11,.04);
  color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245,158,11,.1);
}

.quick-action-btn i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

/* --- Dashboard welcome banner ------------------------------ */
.welcome-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
  border-radius: var(--card-radius);
  padding: 28px 32px;
  color: #fff;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(245,158,11,.15) 0%, transparent 70%);
  border-radius: 50%;
}

.welcome-banner h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 6px;
  position: relative;
  z-index: 1;
}

.welcome-banner p {
  color: rgba(255,255,255,.6);
  font-size: 0.88rem;
  margin: 0;
  position: relative;
  z-index: 1;
}

/* --- Info row cards (order view, etc.) ---------------------- */
.info-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* --- Inventory Low Stock Banner ----------------------------- */
.low-stock-banner {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border: 1px solid #fca5a5;
  border-radius: 14px;
  padding: 14px 22px;
  color: #dc2626;
  margin-bottom: 20px;
}

/* --- Order Kanban ------------------------------------------ */
.kanban-col {
  background: var(--bg-light);
  border-radius: 14px;
  padding: 16px;
  min-height: 300px;
}

.kanban-header {
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--card-shadow);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  border-left: 4px solid transparent;
}

.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }

/* --- Staff cards ------------------------------------------- */
.staff-card .card-body {
  padding: 24px 20px;
}

/* --- Appointment cards ------------------------------------- */
.appointment-today-card {
  transition: var(--transition);
}

.appointment-today-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

/* --- Dropdown menus ---------------------------------------- */
.dropdown-menu {
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 48px rgba(0,0,0,.1);
  padding: 6px;
}

.dropdown-item {
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.84rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-light);
}

.dropdown-item.active {
  background: rgba(245,158,11,.1);
  color: var(--primary-dark);
}

.dropdown-header {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding: 8px 14px;
}

.dropdown-divider {
  margin: 4px 0;
  border-color: var(--border);
}

/* --- Scroll to top ----------------------------------------- */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245,158,11,.35);
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
  border: none;
}

.scroll-top.show { opacity: 1; transform: translateY(0); }
.scroll-top:hover { transform: scale(1.1) translateY(0); box-shadow: 0 8px 28px rgba(245,158,11,.45); }

/* --- Section dividers in forms ----------------------------- */
.form-section-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-dark);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-title i {
  color: var(--primary);
}

/* --- Responsive --------------------------------------------- */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show { display: block; }

  .main-wrapper {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .page-content { padding: 18px; }

  .hero-title { font-size: 2.2rem; }

  .kpi-card { padding: 12px; gap: 10px; }
  .kpi-value { font-size: 1.15rem; }
  .kpi-icon { width: 36px; height: 36px; font-size: 0.9rem; }
}

@media (max-width: 576px) {
  .hero-title { font-size: 1.8rem; }
  .page-content { padding: 14px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header-title { font-size: 1.3rem; }
  .topbar { padding: 0 16px; }
  .card-body { padding: 16px; }
  .card-header { padding: 14px 16px; }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn .5s ease forwards; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in-up { animation: fadeInUp .5s ease forwards; }

/* Staggered animations */
.row.g-3 > [class*="col-"]:nth-child(1) { animation-delay: 0s; }
.row.g-3 > [class*="col-"]:nth-child(2) { animation-delay: .05s; }
.row.g-3 > [class*="col-"]:nth-child(3) { animation-delay: .1s; }
.row.g-3 > [class*="col-"]:nth-child(4) { animation-delay: .15s; }
.row.g-3 > [class*="col-"]:nth-child(5) { animation-delay: .2s; }
.row.g-3 > [class*="col-"]:nth-child(6) { animation-delay: .25s; }

/* --- Order view status timeline ----------------------------- */
.status-timeline .btn {
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- Sticky summary ----------------------------------------- */
.sticky-top { z-index: 10; }

/* Hover transitions for all action links */
.d-flex.gap-1 .btn {
  transition: var(--transition-fast);
}

.d-flex.gap-1 .btn:hover {
  transform: translateY(-1px);
}

/* --- Today cards in appointments --------------------------- */
.card[style*="border-left: 4px"] {
  transition: var(--transition);
}

.card[style*="border-left: 4px"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
}

/* --- Border items list (appointments upcoming, etc.) ------- */
.border-bottom.d-flex {
  transition: var(--transition-fast);
}

.border-bottom.d-flex:hover {
  background: rgba(245,158,11,.03) !important;
}

/* --- Custom scrollbar -------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- Checkbox & Radio improvements ------------------------- */
.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.form-check-input:focus {
  box-shadow: 0 0 0 4px rgba(245,158,11,.15);
  border-color: var(--primary);
}

/* --- HR improvements --------------------------------------- */
hr {
  border-color: var(--border);
  opacity: .5;
}

/* --- Alert improvements ------------------------------------ */
.alert {
  border-radius: 14px;
  border: none;
  font-size: 0.85rem;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(255,251,235,.95), rgba(254,243,199,.9));
  color: #92400e;
  border: 1px solid rgba(245,158,11,.2);
}

.alert-danger {
  background: linear-gradient(135deg, rgba(254,226,226,.95), rgba(254,202,202,.9));
  color: #991b1b;
  border: 1px solid rgba(239,68,68,.2);
}

.alert-success {
  background: linear-gradient(135deg, rgba(209,250,229,.95), rgba(167,243,208,.9));
  color: #065f46;
  border: 1px solid rgba(16,185,129,.2);
}
