/* ============================================================
   डैशबोर्ड (स्टाफ + एडमिन) + लॉगिन
   ============================================================ */
:root {
  --red: #b3261e;
  --red-dark: #8b1a1a;
  --saffron: #e8590c;
  --gold: #d4a017;
  --bg: #f6f1ea;
  --card: #ffffff;
  --ink: #2b2118;
  --ink-soft: #6b5d4f;
  --line: #e7dcc9;
  --green: #15803d;
  --wa: #25d366;
  --font: 'Noto Sans Devanagari', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.6; }
a { color: var(--saffron); text-decoration: none; }
h1, h2, h3 { color: var(--red-dark); }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
code { background: #f1e8d8; padding: .12rem .42rem; border-radius: 5px; font-size: .9em; }

/* ---------- लॉगिन ---------- */
.auth-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(212,160,23,.25), transparent 60%),
    linear-gradient(160deg, #fff7ec, #ffe3c4);
  padding: 1.25rem;
}
.auth-card {
  width: min(430px, 100%); background: #fff; border-radius: 20px;
  padding: 2.15rem 1.85rem; box-shadow: 0 22px 55px rgba(80,40,10,.16);
}
.auth-brand { text-align: center; margin-bottom: 1.55rem; }
.brand-mark-sm { font-size: 2.65rem; }
.auth-brand h1 { margin: .35rem 0 .15rem; font-size: 1.55rem; }
.auth-brand p { margin: 0; color: var(--ink-soft); font-size: .93rem; }
.auth-form .field { margin-bottom: 1.05rem; }
.auth-foot { text-align: center; margin: 1.35rem 0 0; font-size: .92rem; }

/* ---------- फ़ील्ड ---------- */
.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-weight: 700; font-size: .93rem; }
.field input, .field select, .field textarea {
  font-family: var(--font); font-size: 1rem; padding: .68rem .92rem;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fffdf9; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--saffron); box-shadow: 0 0 0 3px rgba(232,89,12,.14);
}

/* ---------- बटन ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .62rem 1.15rem; border-radius: 999px; border: 2px solid transparent;
  font-family: var(--font); font-weight: 700; font-size: .95rem; cursor: pointer;
  text-decoration: none !important; transition: .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--saffron); color: #fff !important; }
.btn-primary:hover { background: #c2410c; }
.btn-outline { background: #fff; color: var(--red-dark) !important; border-color: var(--red); }
.btn-outline:hover { background: var(--red); color: #fff !important; }
.btn-light { background: #fff; color: var(--red-dark) !important; }
.btn-outline-light { background: transparent; color: #fff !important; border-color: rgba(255,255,255,.55); }
.btn-danger { background: #c0392b; color: #fff !important; border: 0; }
.btn-wa { background: var(--wa); color: #fff !important; }
.btn-sm { padding: .38rem .85rem; font-size: .86rem; }
.btn-lg { padding: .85rem 1.55rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- अलर्ट ---------- */
.alert { padding: .85rem 1.15rem; border-radius: 11px; margin-bottom: 1.15rem; font-weight: 600; }
.alert-error { background: #fff0ef; color: var(--red-dark); border: 1px solid #f3c1bd; }
.alert-success { background: #e8f8ee; color: var(--green); border: 1px solid #b7e4c7; }

/* ---------- डैश हेडर ---------- */
.dash-header {
  background: linear-gradient(90deg, var(--red-dark), var(--red));
  color: #fff; position: sticky; top: 0; z-index: 50;
}
.dash-header-admin { background: linear-gradient(90deg, #1f3a5f, #2b1b12); }
.dash-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.35rem; gap: 1rem; flex-wrap: wrap;
}
.dash-brand { display: flex; align-items: center; gap: .65rem; }
.dash-brand strong { font-size: 1.12rem; }
.dash-brand small { opacity: .8; }
.dash-user { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }

/* ---------- लेआउट ---------- */
.dash-layout { display: grid; grid-template-columns: 245px 1fr; min-height: calc(100vh - 64px); }
.dash-side {
  background: #fff; border-right: 1px solid var(--line); padding: 1.15rem .85rem;
  display: flex; flex-direction: column; gap: 1.15rem;
}
.dash-side nav { display: flex; flex-direction: column; gap: .22rem; }
.dash-side nav a {
  padding: .68rem .95rem; border-radius: 10px; color: var(--ink) !important;
  font-weight: 600; font-size: .95rem;
}
.dash-side nav a:hover { background: #fff3e4; text-decoration: none; }
.dash-side nav a.active { background: var(--saffron); color: #fff !important; }
.side-note {
  background: #fff8ec; border: 1px dashed var(--gold); border-radius: 11px;
  padding: .95rem; font-size: .88rem; color: var(--ink-soft);
}
.dash-main { padding: 1.45rem 1.65rem 2.75rem; }
.dash-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.dash-head h1 { margin: 0; font-size: 1.55rem; }
.dash-head-actions { display: flex; gap: .55rem; flex-wrap: wrap; }
.live-dot {
  color: var(--green); font-weight: 700; font-size: .88rem;
  background: #e8f8ee; padding: .38rem .85rem; border-radius: 999px;
}

/* ---------- आँकड़े ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.15rem; }
.stat-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.15rem 1.25rem;
}
.stat-tile span { display: block; color: var(--ink-soft); font-size: .88rem; margin-bottom: .25rem; }
.stat-tile strong { font-size: 1.75rem; color: var(--red-dark); }
.stat-ok strong { color: var(--green); }
.stat-warn strong { color: var(--saffron); }

/* ---------- पैनल ---------- */
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 15px;
  padding: 1.25rem 1.35rem; margin-bottom: 1.15rem;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .95rem; gap: 1rem; flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 1.12rem; }

/* ---------- तालिका ---------- */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; border: 1px solid var(--line);
  border-radius: 11px; overflow: hidden; background: #fff;
}
.data-table th, .data-table td { padding: .72rem .92rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .93rem; }
.data-table th { background: #fff4e6; color: var(--red-dark); font-size: .88rem; }
.data-table tbody tr:hover { background: #fffaf2; }
.row-actions { display: flex; gap: .45rem; }
.bar { background: #f1e8d8; border-radius: 999px; height: 9px; width: 120px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, var(--green), #3cb371); height: 100%; border-radius: 999px; }

/* ---------- बैज ---------- */
.badge {
  display: inline-block; padding: .18rem .68rem; border-radius: 999px;
  font-size: .8rem; font-weight: 700;
}
.badge-pending { background: #fff3d6; color: #a15c00; }
.badge-approved { background: #e8f8ee; color: var(--green); }
.badge-rejected, .badge-cancelled { background: #ffe5e3; color: var(--red-dark); }
.badge-checked_out { background: #e6efff; color: #1f4e9c; }
.badge-admin { background: #2b1b12; color: var(--gold); }
.badge-staff { background: #e8f0ff; color: #1f4e9c; }

/* ---------- फ़िल्टर / फॉर्म ---------- */
.filter-bar {
  display: flex; gap: .65rem; flex-wrap: wrap; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 13px;
  padding: .95rem 1.15rem; margin-bottom: 1.15rem;
}
.filter-bar input, .filter-bar select {
  padding: .55rem .85rem; border: 1.5px solid var(--line); border-radius: 9px;
  font-family: var(--font); font-size: .95rem;
}
.form-grid-admin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.form-grid-admin .span-2 { grid-column: span 2; }

/* ---------- कतार ---------- */
.queue-toolbar {
  display: flex; gap: .85rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap;
}
.queue-toolbar input {
  flex: 1; min-width: 220px; padding: .72rem 1.05rem; border: 1.5px solid var(--line);
  border-radius: 11px; font-family: var(--font); font-size: 1rem;
}
.queue-count { color: var(--ink-soft); font-weight: 600; }
.queue-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(315px, 1fr)); gap: 1rem; }
.queue-card {
  background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 1.15rem 1.25rem;
  display: flex; flex-direction: column; gap: .65rem;
}
.queue-card .q-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.queue-card .q-token {
  background: var(--red-dark); color: #fff; padding: .25rem .75rem;
  border-radius: 999px; font-size: .82rem; font-weight: 700;
}
.queue-card h3 { margin: 0; font-size: 1.15rem; }
.queue-card .q-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .28rem .85rem; font-size: .9rem; color: var(--ink-soft); }
.queue-card .q-actions { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: .28rem; }
.loading-box, .queue-empty {
  grid-column: 1 / -1; text-align: center; padding: 2.25rem;
  color: var(--ink-soft); background: #fff; border-radius: 13px; border: 1px dashed var(--line);
}
.queue-card.flash-new { animation: flashIn .8s ease; }
@keyframes flashIn {
  0% { box-shadow: 0 0 0 3px rgba(232,89,12,.5); transform: translateY(-4px); }
  100% { box-shadow: none; transform: none; }
}

/* ---------- मॉडल ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(30,15,5,.55); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 1.15rem;
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  background: #fff; border-radius: 18px; width: min(560px, 100%);
  max-height: 90vh; overflow: auto; box-shadow: 0 25px 60px rgba(0,0,0,.28);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.15rem 1.35rem; border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 1.22rem; }
.modal-close {
  background: none; border: 0; font-size: 1.85rem; cursor: pointer; color: var(--ink-soft);
  line-height: 1; padding: 0 .35rem;
}
.modal-body { padding: 1.35rem; }
.modal-body .kv {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .48rem 0; border-bottom: 1px dashed var(--line);
}
.modal-body .kv:last-child { border-bottom: 0; }
.modal-body .kv span { color: var(--ink-soft); }

/* ---------- गतिविधि ---------- */
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li {
  padding: .58rem 0; border-bottom: 1px dashed var(--line); font-size: .92rem;
  display: flex; gap: .55rem; flex-wrap: wrap;
}
.act-action { background: #fff3e4; padding: .06rem .55rem; border-radius: 999px; font-size: .82rem; }
.act-time { margin-left: auto; color: var(--ink-soft); font-size: .82rem; }

/* ---------- उत्तरदायी ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .dash-side nav { flex-direction: row; flex-wrap: wrap; }
  .form-grid-admin { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .stat-grid { grid-template-columns: 1fr; }
  .form-grid-admin { grid-template-columns: 1fr; }
  .form-grid-admin .span-2 { grid-column: span 1; }
  .dash-main { padding: 1.05rem; }
}
