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

:root {
  --primary: #5b4fcf;
  --primary-dark: #4338a8;
  --accent: #f97316;
  --success: #10b981;
  --error: #ef4444;
  --bg: #0f0e1a;
  --bg2: #181728;
  --bg3: #1e1d33;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.08);
  --text: #f1f0ff;
  --text-muted: #9492b8;
  --font: 'Vazirmatn', Tahoma, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  direction: rtl;
}

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  height: 64px;
  background: rgba(15,14,26,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex; align-items: center; gap: 12px;
  font-size: 17px; font-weight: 700; color: var(--text);
}

.nav-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), #7c6fdb);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 4px 14px rgba(91,79,207,0.35);
}

.nav-actions { display: flex; gap: 10px; }

.nav-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  background: linear-gradient(135deg, var(--primary), #7c6fdb);
  color: white;
  font-family: var(--font);
  font-size: 13px; font-weight: 600;
  border: none; border-radius: 9px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(91,79,207,0.35);
}
.nav-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(91,79,207,0.45); }
.nav-btn.secondary {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  box-shadow: none;
}
.nav-btn.secondary:hover { background: var(--surface-hover); color: var(--text); }

/* ===== MAIN ===== */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap; gap: 12px;
}
.page-header h2 { font-size: 22px; font-weight: 800; }
.page-desc { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.stats-badge {
  background: rgba(91,79,207,0.15);
  border: 1px solid rgba(91,79,207,0.3);
  color: #a89ff5;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
}

/* ===== STATES ===== */
.loading-state, .empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.spinner-wrap { margin-bottom: 16px; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty-icon { font-size: 52px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; }

/* ===== DAY SECTION ===== */
.day-section { margin-bottom: 32px; animation: fadeIn 0.4s ease both; }
@keyframes fadeIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }

.day-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.day-pill {
  background: linear-gradient(135deg, var(--primary), #7c6fdb);
  color: white;
  font-size: 13px; font-weight: 700;
  padding: 5px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(91,79,207,0.3);
}
.day-count {
  color: var(--text-muted);
  font-size: 12px;
}
.day-line { flex: 1; height: 1px; background: var(--border); }

/* ===== BOOKING CARD ===== */
.booking-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 18px;
  transition: border-color 0.2s, background 0.2s;
  flex-wrap: wrap;
}
.booking-card:hover { border-color: rgba(91,79,207,0.3); background: rgba(255,255,255,0.06); }
.customer-card { cursor: pointer; }
.customer-card:focus-visible { outline: 3px solid rgba(168,159,245,0.8); outline-offset: 3px; }

.time-badge {
  background: rgba(91,79,207,0.15);
  border: 1px solid rgba(91,79,207,0.25);
  color: #a89ff5;
  font-size: 20px; font-weight: 800;
  padding: 10px 16px;
  border-radius: 10px;
  min-width: 78px;
  text-align: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.booking-info { flex: 1; min-width: 180px; }

.info-name {
  display: flex;
  align-items: center;
  direction: rtl;
  gap: 0;
  font-size: 17px; font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.customer-phone {
  display: inline-block;
  direction: ltr;
  font-size: 17px;
  font-weight: 800;
  color: #a89ff5;
  background: rgba(91,79,207,0.17);
  border: 1px solid rgba(91,79,207,0.28);
  border-radius: 6px;
  padding: 4px 9px;
  margin-right: 10px;
  vertical-align: 1px;
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
}

.info-row {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 13px; color: var(--text-muted);
}

.info-tag {
  display: flex; align-items: center; gap: 6px;
}

.info-tag a {
  color: #a89ff5;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  direction: ltr;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}
.info-tag a:hover { color: #c4bdfb; text-decoration: underline; }

.info-service, .info-address {
  background: var(--surface);
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.archive-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border);
  border-radius: 9px; cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.archive-btn:hover {
  background: rgba(249,115,22,0.12);
  border-color: rgba(249,115,22,0.3);
  color: #fdba74;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  text-align: center;
  max-width: 320px; width: 100%;
  transform: scale(0.9);
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
.modal-overlay.show .modal { transform: scale(1); }
.modal-icon { font-size: 42px; margin-bottom: 16px; }
.modal h2 { font-size: 19px; margin-bottom: 10px; }
.modal p  { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.modal-btns { display: flex; gap: 10px; }
.btn-cancel, .btn-confirm {
  flex: 1; padding: 12px;
  font-family: var(--font); font-size: 14px; font-weight: 700;
  border: none; border-radius: 10px; cursor: pointer;
  transition: transform 0.15s;
}
.btn-cancel { background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.btn-cancel:hover { background: var(--surface-hover); color: var(--text); }
.btn-confirm { background: linear-gradient(135deg, var(--accent), #fb923c); color: white; box-shadow: 0 4px 14px rgba(249,115,22,0.35); }
.btn-confirm:hover { transform: translateY(-2px); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .navbar { padding: 0 16px; }
  .nav-brand span { display: none; }
  .nav-actions { gap: 6px; }
  .nav-btn { padding: 8px 9px; font-size: 12px; }
  .nav-btn svg { display: none; }
  .main-content { padding: 20px 14px 50px; }
  .booking-card { flex-direction: column; align-items: flex-start; }
  .archive-btn { width: 100%; justify-content: center; }
  .time-badge { font-size: 17px; padding: 8px 14px; }
  .info-row { width: 100%; }
  .info-tag a { font-size: 15px; }
}

@media (max-width: 380px) {
  .info-tag a { font-size: 14px; }
}
