@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=DM+Sans:wght@400;500;600&display=swap');

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

:root {
  --navy:   #0a1f44;
  --blue:   #1565c0;
  --cyan:   #00b8d9;
  --white:  #ffffff;
  --off:    #f4f8fd;
  --text:   #1a2b4a;
  --muted:  #5c728a;
  --border: #d0e4f7;
  --green:  #00c853;
  --gold:   #f5a623;
  --red:    #e53935;
  --sidebar-w: 220px;
}

html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--off); color: var(--text); overflow-x: hidden; }
h1,h2,h3,h4 { font-family: 'Sora', sans-serif; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ── LOGIN ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--navy); padding: 20px;
}
.login-box {
  background: white; border-radius: 20px; padding: 48px 40px;
  width: 100%; max-width: 400px; text-align: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
}
.login-logo { font-size: 40px; margin-bottom: 12px; }
.login-box h2 { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.login-box p  { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.login-box input {
  width: 100%; padding: 12px 16px; border-radius: 10px;
  border: 1.5px solid var(--border); font-family: 'DM Sans', sans-serif;
  font-size: 15px; outline: none; margin-bottom: 14px;
  transition: border-color .2s;
}
.login-box input:focus { border-color: var(--cyan); }
.login-btn {
  width: 100%; padding: 13px; border-radius: 10px;
  background: linear-gradient(135deg, #00b8d9, #1565c0);
  color: white; border: none; font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: 15px; cursor: pointer; transition: opacity .2s;
}
.login-btn:hover { opacity: .88; }
.login-error {
  background: rgba(229,57,53,0.1); border: 1px solid rgba(229,57,53,0.3);
  color: var(--red); border-radius: 8px; padding: 10px 14px;
  font-size: 13px; font-weight: 600; margin-bottom: 16px;
}

/* ── LAYOUT ── */
.admin-wrap { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w); background: var(--navy); flex-shrink: 0;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
  transition: transform .3s;
}
.sidebar-logo {
  padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo span { font-size: 24px; }
.sidebar-logo-text strong { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 800; color: white; display: block; }
.sidebar-logo-text small  { font-size: 11px; color: rgba(255,255,255,0.4); }
.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px; color: rgba(255,255,255,0.65);
  font-size: 14px; font-weight: 500; transition: all .2s; cursor: pointer;
}
.nav-item:hover  { background: rgba(255,255,255,0.07); color: white; }
.nav-item.active { background: rgba(0,184,217,0.15); color: var(--cyan); }
.nav-item .ni-icon { font-size: 18px; min-width: 22px; text-align: center; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.logout-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px; color: rgba(255,255,255,0.5);
  font-size: 14px; font-weight: 500; transition: all .2s; cursor: pointer; width: 100%;
  background: none; border: none; font-family: 'DM Sans', sans-serif;
}
.logout-btn:hover { background: rgba(229,57,53,0.15); color: var(--red); }

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column;
}

/* TOPBAR */
.topbar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 99;
  box-shadow: 0 1px 8px rgba(0,100,200,0.06);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.ham-btn {
  display: none; background: none; border: none; cursor: pointer; padding: 4px;
  flex-direction: column; gap: 4px;
}
.ham-btn span { display: block; width: 20px; height: 2px; background: var(--navy); border-radius: 2px; }
.topbar-title { font-family: 'Sora', sans-serif; font-size: 17px; font-weight: 700; color: var(--navy); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-badge {
  background: var(--off); border: 1px solid var(--border); border-radius: 100px;
  padding: 5px 14px; font-size: 13px; color: var(--muted); font-weight: 600;
}
.topbar-live { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green); font-weight: 600; }
.topbar-live span { width: 8px; height: 8px; background: var(--green); border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* PAGE BODY */
.page-body { padding: 24px; flex: 1; }

/* ── STAT CARDS ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white; border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,100,200,0.08); }
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.blue::before   { background: linear-gradient(90deg, var(--cyan), var(--blue)); }
.stat-card.green::before  { background: linear-gradient(90deg, #00c853, #00897b); }
.stat-card.gold::before   { background: linear-gradient(90deg, #f5a623, #e65100); }
.stat-card.red::before    { background: linear-gradient(90deg, #e53935, #c62828); }
.stat-card.purple::before { background: linear-gradient(90deg, #7c4dff, #4527a0); }
.sc-stat-icon { font-size: 28px; margin-bottom: 10px; }
.sc-stat-num  { font-family: 'Sora', sans-serif; font-size: 32px; font-weight: 800; color: var(--navy); line-height: 1; }
.sc-stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ── TABLE ── */
.table-card {
  background: white; border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; margin-bottom: 24px;
}
.table-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.table-header h3 { font-family: 'Sora', sans-serif; font-size: 16px; font-weight: 700; color: var(--navy); }
.table-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* filter/search bar */
.filter-bar {
  padding: 12px 20px; border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: var(--off);
}
.filter-bar input, .filter-bar select {
  padding: 8px 12px; border-radius: 8px; border: 1.5px solid var(--border);
  font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text);
  background: white; outline: none; transition: border-color .2s;
}
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--cyan); }
.filter-bar input { flex: 1; min-width: 180px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: var(--off); padding: 12px 16px; text-align: left;
  font-family: 'Sora', sans-serif; font-size: 12px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafcff; }

/* ── BADGES ── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.badge-pending  { background: rgba(245,166,35,0.12); color: #8a5a00; }
.badge-new      { background: rgba(0,184,217,0.1);   color: #0077a3; }
.badge-confirmed{ background: rgba(0,200,83,0.1);    color: #007c38; }
.badge-done     { background: rgba(21,101,192,0.1);  color: var(--blue); }
.badge-cancelled{ background: rgba(229,57,53,0.1);   color: var(--red); }
.badge-index    { background: rgba(124,77,255,0.1);  color: #4527a0; }
.badge-contact  { background: rgba(0,150,136,0.1);   color: #00695c; }
.badge-upi      { background: rgba(0,184,217,0.1);   color: #0077a3; }
.badge-onservice{ background: rgba(245,166,35,0.12); color: #8a5a00; }

/* ── ACTION BUTTONS ── */
.btn-sm {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: none; font-family: 'DM Sans', sans-serif;
  transition: opacity .2s; white-space: nowrap;
}
.btn-sm:hover { opacity: .82; }
.btn-blue   { background: rgba(21,101,192,0.1);  color: var(--blue); }
.btn-green  { background: rgba(0,200,83,0.1);    color: #007c38; }
.btn-red    { background: rgba(229,57,53,0.1);   color: var(--red); }
.btn-export {
  background: var(--navy); color: white; padding: 8px 16px; border-radius: 8px;
  font-size: 13px; font-weight: 600; border: none; cursor: pointer; font-family: 'DM Sans', sans-serif;
  display: inline-flex; align-items: center; gap: 6px; transition: opacity .2s;
}
.btn-export:hover { opacity: .85; }

/* ── DETAIL MODAL ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,31,68,0.6);
  backdrop-filter: blur(4px); z-index: 999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-box {
  background: white; border-radius: 18px; padding: 32px; max-width: 560px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  transform: scale(.95); transition: transform .25s;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
}
.modal-overlay.open .modal-box { transform: scale(1); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: var(--off); border: none; border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.modal-close:hover { background: var(--border); }
.modal-title { font-family: 'Sora', sans-serif; font-size: 19px; font-weight: 800; color: var(--navy); margin-bottom: 20px; }
.detail-row { display: flex; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.detail-label { color: var(--muted); min-width: 120px; flex-shrink: 0; font-weight: 600; }
.detail-value { color: var(--text); font-weight: 500; }
.detail-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.status-select {
  padding: 8px 12px; border-radius: 8px; border: 1.5px solid var(--border);
  font-family: 'DM Sans', sans-serif; font-size: 13px; outline: none; width: 100%;
  transition: border-color .2s; margin-top: 6px;
}
.status-select:focus { border-color: var(--cyan); }
.save-status-btn {
  width: 100%; margin-top: 12px; padding: 11px; border-radius: 9px;
  background: linear-gradient(135deg, #00b8d9, #1565c0);
  color: white; border: none; font-family: 'Sora', sans-serif;
  font-weight: 700; font-size: 14px; cursor: pointer; transition: opacity .2s;
}
.save-status-btn:hover { opacity: .88; }

/* ── PAGINATION ── */
.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px 20px; flex-wrap: wrap; }
.page-btn {
  padding: 7px 13px; border-radius: 8px; border: 1.5px solid var(--border);
  background: white; font-size: 13px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: all .2s;
}
.page-btn.active { background: var(--navy); color: white; border-color: var(--navy); }
.page-btn:hover:not(.active) { border-color: var(--cyan); color: var(--cyan); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state span { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ── RESPONSIVE ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 99; cursor: pointer;
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main-content { margin-left: 0; }
  .ham-btn { display: flex; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .detail-row { flex-direction: column; gap: 2px; }
  .detail-label { min-width: unset; }
  thead th:nth-child(n+5) { display: none; }
  tbody td:nth-child(n+5) { display: none; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}
