* { margin:0; padding:0; box-sizing:border-box; }
:root {
  --red:#CC0000; --red-dark:#990000; --red-light:#E63030;
  --bg:#FFFFFF; --bg2:#F7F7F7; --bg3:#F0F0F0; --bg4:#E8E8E8;
  --border:#E0E0E0; --border2:#D0D0D0;
  --text:#111111; --text2:#444444; --text3:#888888;
  --green:#16A34A; --yellow:#D97706; --blue:#1D4ED8; --purple:#7C3AED;
  --shadow:0 1px 4px rgba(0,0,0,0.08);
  --shadow-md:0 4px 16px rgba(0,0,0,0.12);
}
body { font-family:'Heebo',sans-serif; background:var(--bg); color:var(--text); min-height:100vh; min-height:100dvh; direction:rtl; overscroll-behavior-y:none; -webkit-text-size-adjust:100%; }

/* HEADER */
.header { background:#111111; padding:0 28px; display:flex; align-items:center; justify-content:space-between; height:64px; position:sticky; top:0; z-index:100; box-shadow:0 2px 8px rgba(0,0,0,0.3); }
.logo { display:flex; align-items:center; gap:12px; }
.logo-fallback { display:flex; align-items:center; gap:10px; }
.logo-icon { height:38px; display:flex; align-items:center; }
.logo-icon span { font-family:'Heebo',sans-serif; font-weight:900; font-size:22px; color:white; letter-spacing:-1px; }
.logo-icon em { color:var(--red); font-style:normal; }
.crm-tag { background:var(--red); color:white; font-size:10px; font-weight:700; padding:2px 8px; border-radius:4px; letter-spacing:1px; }
.header-right { display:flex; align-items:center; gap:12px; }
.notif-btn { width:38px; height:38px; background:rgba(255,255,255,0.1); border:1px solid rgba(255,255,255,0.15); border-radius:8px; display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:17px; position:relative; transition:background 0.15s; }
.notif-btn:hover { background:rgba(255,255,255,0.18); }
.notif-dot { position:absolute; top:7px; right:7px; width:8px; height:8px; background:var(--red); border-radius:50%; border:2px solid #111; }
.user-avatar { width:38px; height:38px; background:var(--red); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; color:white; cursor:pointer; }

/* LAYOUT */
.layout { display:flex; min-height:calc(100vh - 64px); }

/* SIDEBAR */
.sidebar { width:230px; background:var(--bg); border-left:1px solid var(--border); padding:20px 0; flex-shrink:0; box-shadow:var(--shadow); }
.nav-section { padding:0 14px; margin-bottom:12px; }
.nav-label { font-size:10px; color:var(--text3); text-transform:uppercase; letter-spacing:1.5px; padding:8px 10px 6px; font-weight:600; }
.nav-item { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; cursor:pointer; font-size:14px; font-weight:500; color:var(--text2); transition:all 0.15s; margin-bottom:2px; }
.nav-item:hover { background:var(--bg2); color:var(--text); }
.nav-item.active { background:rgba(204,0,0,0.08); color:var(--red); font-weight:600; }
.nav-item .icon { font-size:17px; width:22px; text-align:center; }
.nav-badge { margin-right:auto; background:var(--red); color:white; font-size:11px; font-weight:700; padding:1px 8px; border-radius:20px; }
.nav-divider { height:1px; background:var(--border); margin:8px 14px; }

/* MAIN */
.main { flex:1; padding:28px; background:var(--bg2); overflow-x:hidden; }
.page { display:none; }
.page.active { display:block; }

/* PAGE HEADER */
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; flex-wrap:wrap; gap:12px; }
.page-title { font-size:24px; font-weight:800; color:var(--text); }
.page-sub { font-size:13px; color:var(--text3); margin-top:3px; font-weight:400; }
.btn { padding:10px 20px; border-radius:10px; border:none; cursor:pointer; font-size:13px; font-weight:600; font-family:'Heebo',sans-serif; transition:all 0.15s; display:inline-flex; align-items:center; gap:7px; }
.btn-primary { background:var(--red); color:white; box-shadow:0 2px 8px rgba(204,0,0,0.3); }
.btn-primary:hover { background:var(--red-dark); }
.btn-secondary { background:white; color:var(--text); border:1.5px solid var(--border2); box-shadow:var(--shadow); }
.btn-secondary:hover { background:var(--bg3); border-color:var(--text3); }
.btn-group { display:flex; gap:8px; }

/* STATS */
.stats { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:24px; }
.stat-card { background:white; border:1px solid var(--border); border-radius:14px; padding:20px; box-shadow:var(--shadow); }
.stat-icon { font-size:24px; margin-bottom:10px; }
.stat-label { font-size:12px; color:var(--text3); font-weight:500; margin-bottom:6px; }
.stat-value { font-size:30px; font-weight:800; line-height:1; }
.stat-sub { font-size:12px; color:var(--text3); margin-top:6px; }
.stat-card.red .stat-value { color:var(--red); }
.stat-card.green .stat-value { color:var(--green); }
.stat-card.yellow .stat-value { color:var(--yellow); }
.stat-card.blue .stat-value { color:var(--blue); }
.stat-card.purple .stat-value { color:var(--purple); }

/* FILTERS */
.filters { background:white; border:1px solid var(--border); border-radius:14px; padding:16px 20px; margin-bottom:16px; display:flex; gap:12px; align-items:center; flex-wrap:wrap; box-shadow:var(--shadow); }
.filter-input { flex:1; min-width:200px; background:var(--bg2); border:1.5px solid var(--border); border-radius:8px; padding:9px 14px; color:var(--text); font-size:13px; outline:none; font-family:'Heebo',sans-serif; transition:border 0.15s; }
.filter-input:focus { border-color:var(--red); background:white; }
.filter-select { background:var(--bg2); border:1.5px solid var(--border); border-radius:8px; padding:9px 14px; color:var(--text); font-size:13px; outline:none; cursor:pointer; font-family:'Heebo',sans-serif; }
.filter-select:focus { border-color:var(--red); }

/* TABLE */
.table-wrapper { background:white; border:1px solid var(--border); border-radius:14px; overflow:hidden; box-shadow:var(--shadow); }
.table-header { padding:16px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; background:white; }
.table-title { font-size:15px; font-weight:700; }
table { width:100%; border-collapse:collapse; }
thead th { background:var(--bg2); padding:12px 16px; text-align:right; font-size:11px; font-weight:700; color:var(--text3); text-transform:uppercase; letter-spacing:0.8px; border-bottom:1px solid var(--border); white-space:nowrap; font-family:'Heebo',sans-serif; }
tbody tr { border-bottom:1px solid var(--border); transition:background 0.1s; cursor:pointer; }
tbody tr:hover { background:#FFF5F5; }
tbody tr:last-child { border-bottom:none; }
tbody td { padding:14px 16px; font-size:13px; white-space:nowrap; color:var(--text); }
.td-name { font-weight:700; color:var(--text); }
.td-sub { font-size:11px; color:var(--text3); margin-top:2px; font-weight:400; }

/* BADGES */
.badge { display:inline-flex; align-items:center; gap:5px; padding:4px 10px; border-radius:20px; font-size:11px; font-weight:700; font-family:'Heebo',sans-serif; }
.badge-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.badge.pending { background:#FEF3C7; color:#92400E; border:1px solid #FDE68A; }
.badge.pending .badge-dot { background:#F59E0B; }
.badge.cancelled { background:#FEE2E2; color:#991B1B; border:1px solid #FECACA; }
.badge.cancelled .badge-dot { background:#EF4444; }
.badge.done { background:#DBEAFE; color:#1E40AF; border:1px solid #BFDBFE; }
.badge.done .badge-dot { background:#3B82F6; }

/* ACTION BUTTONS */
.action-btns { display:flex; gap:5px; }
.action-btn { width:30px; height:30px; border-radius:7px; border:1.5px solid var(--border); background:white; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:13px; transition:all 0.15s; color:var(--text3); }
.action-btn:hover { border-color:var(--text3); color:var(--text); }
.action-btn.approve:hover { background:#F0FDF4; border-color:#22c55e; color:#16a34a; }
.action-btn.cancel:hover { background:#FFF1F2; border-color:#f43f5e; color:#be123c; }

/* MODAL */
.modal-overlay { display:none; position:fixed; inset:0; width:100%; height:100%; background:rgba(0,0,0,0.5); z-index:200; align-items:center; justify-content:center; backdrop-filter:blur(2px); overflow:hidden; }
.modal-overlay.open { display:flex; }
.modal { background:white; border:1px solid var(--border); border-radius:18px; width:700px; max-width:95vw; max-height:90vh; overflow-y:auto; box-shadow:var(--shadow-md); position:relative; margin:auto; }
.modal-header { padding:22px 26px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; background:white; border-radius:18px 18px 0 0; position:sticky; top:0; z-index:1; }
.modal-title { font-size:18px; font-weight:800; }
.modal-close { width:34px; height:34px; background:var(--bg2); border:1.5px solid var(--border); border-radius:8px; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:15px; color:var(--text3); transition:all 0.15s; }
.modal-close:hover { background:var(--bg3); color:var(--text); }
.modal-body { padding:26px; }
.modal-section { margin-bottom:24px; }
.modal-section-title { font-size:11px; color:var(--red); text-transform:uppercase; letter-spacing:1.5px; font-weight:700; margin-bottom:14px; padding-bottom:8px; border-bottom:2px solid #FEE2E2; }
.modal-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.modal-field { background:var(--bg2); border-radius:10px; padding:12px 14px; }
.modal-field label { font-size:11px; color:var(--text3); display:block; margin-bottom:4px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; }
.modal-field span { font-size:14px; color:var(--text); font-weight:600; }
.modal-footer { padding:18px 26px; border-top:1px solid var(--border); display:flex; gap:8px; justify-content:flex-end; background:var(--bg2); border-radius:0 0 18px 18px; position:sticky; bottom:0; }
.expired { color:var(--red) !important; }

/* CUSTOMER CARDS */
.cards-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; }
.customer-card { background:white; border:1.5px solid var(--border); border-radius:14px; padding:22px; cursor:pointer; transition:all 0.2s; box-shadow:var(--shadow); }
.customer-card:hover { border-color:var(--red); box-shadow:0 4px 20px rgba(204,0,0,0.1); transform:translateY(-2px); }
.cust-avatar { width:48px; height:48px; border-radius:50%; background:#111; display:flex; align-items:center; justify-content:center; font-size:17px; font-weight:800; color:white; margin-bottom:14px; }
.cust-name { font-size:16px; font-weight:800; margin-bottom:5px; }
.cust-info { font-size:12px; color:var(--text3); margin-bottom:3px; font-weight:400; }
.cust-tags { display:flex; gap:6px; margin-top:12px; flex-wrap:wrap; }
.tag { font-size:11px; padding:3px 9px; border-radius:20px; background:var(--bg2); color:var(--text2); border:1px solid var(--border); font-weight:500; }

/* CALENDAR */
.cal-nav { display:flex; gap:8px; align-items:center; }
.cal-nav-btn { width:34px; height:34px; background:white; border:1.5px solid var(--border); border-radius:8px; cursor:pointer; display:flex; align-items:center; justify-content:center; color:var(--text); font-size:14px; transition:all 0.15s; }
.cal-nav-btn:hover { border-color:var(--red); color:var(--red); }
.cal-month { font-size:18px; font-weight:800; min-width:140px; text-align:center; }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.cal-day-label { text-align:center; font-size:11px; color:var(--text3); padding:8px 0; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; }
.cal-day { min-height:84px; background:white; border:1.5px solid var(--border); border-radius:10px; padding:10px; cursor:pointer; transition:all 0.15s; }
.cal-day:hover { border-color:var(--red); }
.cal-day.today { border-color:var(--red); border-width:2px; background:#FFF5F5; }
.cal-day.other-month { opacity:0.3; background:var(--bg3); }
.cal-day-num { font-size:13px; font-weight:700; margin-bottom:5px; }
.cal-event { font-size:10px; background:#FEE2E2; color:var(--red-dark); padding:2px 6px; border-radius:4px; margin-bottom:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:600; }
.cal-event.done { background:#DBEAFE; color:#1E40AF; }

/* CHARTS */
.charts-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:24px; }
.chart-card { background:white; border:1px solid var(--border); border-radius:14px; padding:22px; box-shadow:var(--shadow); }
.chart-title { font-size:13px; font-weight:700; margin-bottom:18px; color:var(--text2); text-transform:uppercase; letter-spacing:0.5px; }
.bar-chart { display:flex; flex-direction:column; gap:10px; }
.bar-row { display:flex; align-items:center; gap:10px; }
.bar-label { font-size:12px; color:var(--text2); width:120px; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-weight:500; }
.bar-track { flex:1; background:var(--bg2); border-radius:6px; height:22px; overflow:hidden; }
.bar-fill { height:100%; border-radius:6px; display:flex; align-items:center; padding-right:10px; font-size:11px; font-weight:700; color:white; transition:width 0.6s cubic-bezier(0.4,0,0.2,1); }
.donut-wrap { display:flex; align-items:center; gap:24px; }
.donut-legend { display:flex; flex-direction:column; gap:10px; }
.legend-item { display:flex; align-items:center; gap:8px; font-size:13px; font-weight:500; }
.legend-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }

/* SETTINGS */
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.settings-card { background:white; border:1px solid var(--border); border-radius:14px; padding:22px; box-shadow:var(--shadow); }
.settings-card-title { font-size:13px; font-weight:700; margin-bottom:18px; color:var(--text2); text-transform:uppercase; letter-spacing:0.5px; border-bottom:1px solid var(--border); padding-bottom:12px; }
.setting-row { display:flex; align-items:center; justify-content:space-between; padding:12px 0; border-bottom:1px solid var(--border); }
.setting-row:last-child { border-bottom:none; }
.setting-label { font-size:14px; font-weight:600; }
.setting-sub { font-size:11px; color:var(--text3); margin-top:2px; }
.toggle { width:44px; height:26px; background:var(--bg3); border-radius:13px; cursor:pointer; position:relative; transition:background 0.2s; border:2px solid var(--border2); }
.toggle.on { background:var(--red); border-color:var(--red-dark); }
.toggle::after { content:''; position:absolute; width:18px; height:18px; background:white; border-radius:50%; top:2px; right:2px; transition:transform 0.2s; box-shadow:0 1px 3px rgba(0,0,0,0.2); }
.toggle.on::after { transform:translateX(-18px); }
.settings-input { background:var(--bg2); border:1.5px solid var(--border); border-radius:8px; padding:8px 12px; color:var(--text); font-size:13px; outline:none; width:190px; font-family:'Heebo',sans-serif; }
.settings-input:focus { border-color:var(--red); background:white; }

/* AVAILABILITY */
.av-slot { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; border:1px solid var(--border); border-radius:8px; margin-bottom:8px; font-size:13px; }
.av-slot.open { border-color:#86efac; background:#f0fdf4; }
.av-slot.booked { border-color:#93c5fd; background:#eff6ff; }
.av-slot.blocked { border-color:#fca5a5; background:#fef2f2; opacity:0.7; }
.av-slot-time { font-weight:700; font-size:14px; }
.av-slot-actions { display:flex; gap:6px; }
.av-slot-btn { padding:4px 10px; border-radius:6px; border:1px solid var(--border); background:white; cursor:pointer; font-size:11px; font-weight:600; font-family:'Heebo',sans-serif; transition:all 0.15s; }
.av-slot-btn:hover { background:var(--bg3); }
.av-slot-btn.del { color:var(--red); border-color:#fca5a5; }
.av-slot-btn.del:hover { background:#fef2f2; }
.av-cal-day { min-height:unset; padding:8px 4px; text-align:center; font-size:13px; font-weight:500; }
.av-cal-day-av { background:#dcfce7 !important; border-color:#86efac !important; }
.av-cal-day-partial { background:#fef9c3 !important; border-color:#fde047 !important; }
.av-cal-day-blocked { background:#fee2e2 !important; border-color:#fca5a5 !important; }
.av-cal-day-selected { background:var(--red) !important; border-color:var(--red) !important; color:white !important; }

/* BOTTOM NAV */
.bottom-nav { display:none; position:fixed; bottom:0; left:0; right:0; background:white; border-top:1px solid var(--border); z-index:150; box-shadow:0 -4px 16px rgba(0,0,0,0.08); }
.bottom-nav-items { display:flex; justify-content:space-around; padding:8px 0 env(safe-area-inset-bottom,8px); }
.bottom-nav-item { display:flex; flex-direction:column; align-items:center; gap:3px; padding:6px 10px; cursor:pointer; color:var(--text3); font-size:10px; font-weight:600; border-radius:10px; transition:all 0.15s; font-family:'Heebo',sans-serif; }
.bottom-nav-item.active { color:var(--red); }
.bottom-nav-item .icon { font-size:22px; }

/* TOAST */
.toast { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); background:#111; color:white; border-radius:12px; padding:12px 22px; font-size:13px; font-weight:600; z-index:999; display:none; align-items:center; gap:8px; box-shadow:var(--shadow-md); font-family:'Heebo',sans-serif; }
.toast.show { display:flex; }
.toast.success { background:#15803D; }
.toast.error { background:var(--red); }

/* PAGE SIZE BUTTONS */
.sz-btn {
  padding:7px 16px;
  border-radius:8px;
  border:1.5px solid var(--border);
  background:white;
  color:var(--text2);
  font-size:13px;
  font-weight:600;
  font-family:'Heebo',sans-serif;
  cursor:pointer;
  transition:all 0.15s;
}
.sz-btn:hover {
  border-color:var(--red);
  color:var(--red);
}
.sz-btn.active {
  background:var(--red);
  border-color:var(--red);
  color:white;
}

/* PAGINATION */
.pg-btn { min-width:30px; height:30px; border-radius:7px; border:1.5px solid var(--border); background:white; cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:600; font-family:'Heebo',sans-serif; color:var(--text2); transition:all 0.15s; padding:0 6px; }
.pg-btn:hover { border-color:var(--red); color:var(--red); }
.pg-btn.active { background:var(--red); border-color:var(--red); color:white; }

/* RESPONSIVE */
@media(max-width:768px) {
  .sidebar { display:none; }
  .bottom-nav { display:block; }
  .main { padding:16px 16px 84px; }
  .stats { grid-template-columns:1fr 1fr; }
  .charts-grid { grid-template-columns:1fr; }
  .settings-grid { grid-template-columns:1fr; }
  .modal-grid { grid-template-columns:1fr; }
  .btn-group { flex-wrap:wrap; }
  .filters { flex-direction:column; }
  .filter-input { min-width:unset; width:100%; }
  .modal { border-radius:18px 18px 0 0; width:100%; max-width:100%; max-height:90vh; position:fixed; bottom:0; left:0; right:0; margin:0; }
  .modal-overlay.open { align-items:flex-end; }
}




#col-modal-overlay {
  z-index: 9999 !important;
}





/* ── Paid order row indicator ─────────────────────────────────────────── */
tr.row-paid {
  background: linear-gradient(to left, rgba(22,163,74,0.04), transparent 40%);
  border-right: 3px solid #16a34a;
}
tr.row-paid:hover {
  background: linear-gradient(to left, rgba(22,163,74,0.08), transparent 40%) !important;
}

/* ── Track Day settings — day chips ───────────────────────────────────── */
.td-day-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  transition: all 0.15s;
  user-select: none;
}
.td-day-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.td-day-chip:hover {
  border-color: var(--red);
  color: var(--red);
}
.td-day-chip.active {
  background: var(--red);
  border-color: var(--red);
  color: white;
}
