/* ============================================================
   PARTY TICKETING SYSTEM — style.css (fully responsive rewrite)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tiro+Devanagari+Hindi&family=Noto+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --saffron:     #FF6B00;
  --saffron-lt:  #FF8C38;
  --saffron-dk:  #CC5500;
  --saffron-bg:  #FFF4EC;
  --green:       #138808;
  --green-lt:    #DCFCE7;
  --navy:        #1a2744;
  --navy-lt:     #243357;
  --white:       #FFFFFF;
  --off-white:   #F5F6FA;
  --gray-50:     #F9FAFB;
  --gray-100:    #F3F4F6;
  --gray-200:    #E5E7EB;
  --gray-300:    #D1D5DB;
  --gray-400:    #9CA3AF;
  --gray-500:    #6B7280;
  --gray-600:    #4B5563;
  --gray-700:    #374151;
  --gray-800:    #1F2937;
  --red:         #DC2626;
  --red-lt:      #FEE2E2;
  --yellow:      #F59E0B;
  --yellow-lt:   #FEF3C7;
  --blue:        #2563EB;
  --blue-lt:     #DBEAFE;
  --purple:      #7C3AED;
  --purple-lt:   #EDE9FE;

  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  16px;
  --radius-xl:  20px;

  --shadow-xs:  0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow:     0 4px 20px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.14);
  --shadow-saffron: 0 4px 16px rgba(255,107,0,.25);

  --sidebar-w:  240px;
  --topbar-h:   58px;

  --font-body:  'Noto Sans', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
  --font-disp:  'Tiro Devanagari Hindi', serif;
  --ease:       0.2s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img, audio, video { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

/* ── Layout helpers ─────────────────────────────────────────── */
.page-wrapper   { min-height: 100vh; display: flex; flex-direction: column; }
.container      { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.container-sm   { width: 100%; max-width: 700px;  margin: 0 auto; padding: 0 1.25rem; }

/* ── Utility ────────────────────────────────────────────────── */
.d-none    { display: none !important; }
.d-block   { display: block !important; }
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.w-100 { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-sm  { font-size: .875rem; }
.text-xs  { font-size: .75rem; }
.text-muted   { color: var(--gray-500); }
.text-danger  { color: var(--red); }
.text-success { color: var(--green); }
.font-mono    { font-family: var(--font-mono); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.separator { border: none; border-top: 1px solid var(--gray-200); margin: 1.25rem 0; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ================================================================
   BUTTONS
================================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .875rem; font-weight: 600;
  line-height: 1.2; white-space: nowrap;
  cursor: pointer; border: 1.5px solid transparent;
  text-decoration: none;
  transition: all var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary  { background: var(--saffron);  color: #fff; border-color: var(--saffron); }
.btn-primary:hover:not(:disabled)  { background: var(--saffron-dk); border-color: var(--saffron-dk); box-shadow: var(--shadow-saffron); transform: translateY(-1px); }
.btn-secondary { background: var(--navy);    color: #fff; border-color: var(--navy); }
.btn-secondary:hover:not(:disabled) { background: var(--navy-lt); border-color: var(--navy-lt); }
.btn-outline  { background: transparent; color: var(--gray-700); border-color: var(--gray-300); }
.btn-outline:hover:not(:disabled) { border-color: var(--saffron); color: var(--saffron); background: var(--saffron-bg); }
.btn-danger   { background: var(--red);  color: #fff; border-color: var(--red); }
.btn-danger:hover:not(:disabled)  { background: #B91C1C; }
.btn-success  { background: var(--green); color: #fff; border-color: var(--green); }
.btn-sm  { padding: .4rem .85rem; font-size: .8rem; }
.btn-lg  { padding: .8rem 1.75rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* ================================================================
   CARDS — universal polished card style
================================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.card + .card  { margin-top: 1rem; }

.card-header {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}
.card-header h3 {
  font-size: 1rem; font-weight: 700; color: var(--gray-800);
  flex: 1; min-width: 0;
}
.card-header .icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--saffron); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}
.card-body { padding: 1.25rem; }
.card-footer {
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* mb-3 spacing helper for cards */
.mb-3 { margin-bottom: 1.5rem; }

/* ================================================================
   FORMS
================================================================ */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block; font-size: .85rem; font-weight: 600;
  color: var(--gray-700); margin-bottom: .35rem;
}
.required { color: var(--red); margin-left: .15rem; }
.form-control {
  width: 100%; padding: .65rem .9rem;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .9rem;
  color: var(--gray-800); background: var(--white);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
  /* iOS safari font-size fix: 16px prevents zoom */
  font-size: 16px;
}
.form-control:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(255,107,0,.12);
}
.form-control::placeholder { color: var(--gray-400); font-size: .875rem; }
.form-control:disabled, .form-control[readonly] {
  background: var(--gray-50); color: var(--gray-500); cursor: not-allowed;
}
select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2.2rem; }
textarea.form-control { resize: vertical; min-height: 90px; font-size: .9rem; }

.form-hint  { font-size: .78rem; color: var(--gray-500); margin-top: .3rem; }
.form-error { font-size: .78rem; color: var(--red); margin-top: .3rem; display: none; }
.form-control.is-invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.form-control.is-invalid + .form-error { display: block; }

/* 2-column form row — stacks on mobile */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Phone + OTP */
.phone-verify-wrap { display: flex; gap: .5rem; align-items: flex-start; }
.phone-verify-wrap .form-control { flex: 1; min-width: 0; }
.otp-group { display: flex; gap: .5rem; }
.otp-group .form-control {
  letter-spacing: .3em; text-align: center;
  font-family: var(--font-mono); font-size: 1.1rem;
  flex: 1;
}
.verified-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--green-lt); color: var(--green);
  padding: .3rem .75rem; border-radius: 99px;
  font-size: .8rem; font-weight: 600;
}

/* Alert */
.alert { padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .875rem; }
.alert-info { background: var(--blue-lt); color: var(--blue); border-left: 3px solid var(--blue); }

/* Flash */
.flash { padding: .85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .9rem; font-weight: 500; }
.flash-ok    { background: var(--green-lt); color: #166534; border-left: 4px solid var(--green); }
.flash-error { background: var(--red-lt);   color: var(--red);  border-left: 4px solid var(--red); }
.flash-warn  { background: var(--yellow-lt);color: #92400E; border-left: 4px solid var(--yellow); }

/* ================================================================
   VOICE RECORDER
================================================================ */
.voice-recorder {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--gray-50);
}
.voice-controls {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.voice-visualizer {
  flex: 1; min-width: 80px; height: 48px;
  background: var(--gray-100); border-radius: var(--radius-sm);
  overflow: hidden;
}
.voice-visualizer canvas { width: 100% !important; height: 100% !important; display: block; }
.voice-timer { font-family: var(--font-mono); font-size: .85rem; color: var(--gray-600); min-width: 44px; text-align: center; }
.voice-status { font-size: .8rem; color: var(--gray-500); margin-top: .4rem; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); display: inline-block; margin-right: .3rem; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.25} }
.voice-playback { margin-top: .75rem; }
.voice-playback audio { width: 100%; height: 40px; display: block; }

/* ================================================================
   FILE UPLOAD
================================================================ */
.file-drop {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--gray-50);
  cursor: pointer;
  position: relative;
  transition: border-color var(--ease), background var(--ease);
}
.file-drop:hover, .file-drop.drag-over {
  border-color: var(--saffron);
  background: var(--saffron-bg);
}
.file-drop input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-drop-icon { font-size: 2rem; margin-bottom: .4rem; }
.file-drop p { font-size: .85rem; color: var(--gray-500); margin: .15rem 0; }
.file-drop strong { color: var(--saffron); }

.file-list { margin-top: .75rem; display: flex; flex-direction: column; gap: .4rem; }
.file-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .85rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}
.file-item-icon { font-size: 1.2rem; flex-shrink: 0; }
.file-item-info { flex: 1; min-width: 0; }
.file-item-name { font-size: .83rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item-size { font-size: .73rem; color: var(--gray-500); }
.file-item-remove { cursor: pointer; color: var(--gray-400); font-size: 1rem; padding: .2rem; flex-shrink: 0; }
.file-item-remove:hover { color: var(--red); }

/* ================================================================
   BADGES & STATUS
================================================================ */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .7rem; border-radius: 99px;
  font-size: .72rem; font-weight: 700; text-transform: capitalize;
  white-space: nowrap; letter-spacing: .01em;
}
.badge-open        { background: var(--blue-lt);   color: #1D4ED8; }
.badge-inspection  { background: var(--purple-lt); color: #6D28D9; }
.badge-in_progress { background: var(--yellow-lt); color: #B45309; }
.badge-completed   { background: var(--green-lt);  color: #166534; }
.badge-hold        { background: var(--red-lt);    color: #B91C1C; }
.badge-superadmin  { background: #FFF0E6; color: var(--saffron-dk); }
.badge-admin       { background: var(--blue-lt);   color: var(--blue); }
.badge-member      { background: var(--gray-100);  color: var(--gray-600); }

/* ================================================================
   PUBLIC HEADER
================================================================ */
.pub-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-lt) 100%);
  color: var(--white);
  padding: .875rem 0;
  position: sticky; top: 0; z-index: 200;
  box-shadow: var(--shadow-sm);
}
.pub-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.pub-logo {
  display: flex; align-items: center; gap: .7rem;
  text-decoration: none; color: var(--white); flex-shrink: 0;
}
.pub-logo-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--saffron);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; font-family: var(--font-disp);
  flex-shrink: 0;
}
.pub-logo-text h1 { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.pub-logo-text small { font-size: .68rem; opacity: .7; display: block; }
.pub-nav { display: flex; gap: .35rem; align-items: center; flex-shrink: 0; }
.pub-nav a {
  color: rgba(255,255,255,.85); text-decoration: none;
  padding: .4rem .8rem; border-radius: var(--radius-sm);
  font-size: .82rem; font-weight: 500;
  transition: background var(--ease);
  white-space: nowrap;
}
.pub-nav a:hover, .pub-nav a.active { background: rgba(255,255,255,.15); color: #fff; }
.pub-nav a.btn-accent { background: var(--saffron); color: #fff; }
.pub-nav a.btn-accent:hover { background: var(--saffron-dk); }

/* ================================================================
   HERO
================================================================ */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-lt) 55%, var(--saffron-dk) 100%);
  color: var(--white);
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}
.hero h2 { font-family: var(--font-disp); font-size: clamp(1.5rem, 4vw, 2.4rem); margin-bottom: .65rem; }
.hero p  { font-size: .95rem; opacity: .85; max-width: 500px; margin: 0 auto 1.25rem; }
.hero-badges { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.hero-badge {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  padding: .3rem .75rem; border-radius: 99px;
  font-size: .75rem; font-weight: 500;
}

/* ================================================================
   STATUS RESULT (public)
================================================================ */
.status-result {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  background: var(--white);
}
.status-result-header {
  padding: 1rem 1.25rem;
  background: var(--navy); color: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem;
}
.status-result-body { padding: 1.25rem; }

/* ================================================================
   TIMELINE
================================================================ */
.timeline { position: relative; padding-left: 1.75rem; }
.timeline::before {
  content: ''; position: absolute; left: .6rem; top: .5rem; bottom: 0; width: 2px;
  background: linear-gradient(to bottom, var(--saffron), var(--gray-200));
}
.timeline-item { position: relative; margin-bottom: 1.25rem; }
.timeline-dot {
  position: absolute; left: -1.75rem;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--saffron);
  border: 2.5px solid var(--white);
  box-shadow: 0 0 0 2px var(--saffron);
  top: .35rem;
}
.timeline-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--gray-200); padding: .9rem 1.1rem;
  box-shadow: var(--shadow-xs);
}
.timeline-meta {
  display: flex; align-items: center; gap: .65rem;
  flex-wrap: wrap; margin-bottom: .5rem;
}
.timeline-time { font-size: .73rem; color: var(--gray-400); }

/* ================================================================
   TICKET DETAIL
================================================================ */
.ticket-number { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 700; color: var(--saffron); }
.ticket-detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ticket-meta { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .84rem; color: var(--gray-600); margin-top: .4rem; }
.ticket-meta-item { display: flex; align-items: center; gap: .3rem; }

/* Two-col layout for ticket detail — collapses to 1 col on tablet */
.ticket-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* ================================================================
   ATTACHMENT GRID
================================================================ */
.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: .65rem;
  margin-top: .5rem;
}
.attachment-thumb {
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; position: relative;
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--gray-50);
  transition: border-color var(--ease), transform var(--ease);
  text-decoration: none;
}
.attachment-thumb:hover { border-color: var(--saffron); transform: scale(1.03); }
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-thumb .doc-icon { font-size: 2rem; }
.attachment-thumb .att-name {
  font-size: .62rem; padding: .2rem .3rem;
  color: var(--gray-600); text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-img { max-width: 92vw; max-height: 88vh; border-radius: var(--radius); object-fit: contain; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,.15); border: none; color: var(--white);
  width: 44px; height: 44px; border-radius: 50%; font-size: 1.4rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--ease);
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ================================================================
   ADMIN LAYOUT — sidebar + main
================================================================ */
.admin-wrap { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy); color: var(--white);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 300;
  overflow-y: auto;
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s;
  /* Mobile: hidden by default */
}
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  z-index: 299;
}
.sidebar-brand {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: .7rem;
  flex-shrink: 0;
}
.sidebar-brand-logo {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--saffron);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; flex-shrink: 0;
}
.sidebar-brand-text h2 { font-size: .88rem; font-weight: 700; line-height: 1.2; }
.sidebar-brand-text small { font-size: .68rem; opacity: .55; }
.sidebar-nav { flex: 1; padding: .75rem 0; overflow-y: auto; }
.nav-section {
  padding: .5rem 1rem .2rem;
  font-size: .62rem; text-transform: uppercase; letter-spacing: .09em;
  opacity: .4; font-weight: 700;
}
.nav-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem 1rem;
  color: rgba(255,255,255,.72);
  text-decoration: none; font-size: .875rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--ease);
}
.nav-link:hover  { background: rgba(255,255,255,.07); color: #fff; }
.nav-link.active { background: rgba(255,107,0,.18); color: var(--saffron-lt); border-left-color: var(--saffron); }
.nav-link .nav-icon { font-size: 1.05rem; width: 1.2rem; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-size: .63rem; font-weight: 700;
  padding: .1rem .45rem; border-radius: 99px;
}
.sidebar-footer {
  padding: .875rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-user { display: flex; align-items: center; gap: .6rem; }
.sidebar-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--saffron); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700; flex-shrink: 0;
}
.sidebar-user-info .name  { font-size: .83rem; font-weight: 600; }
.sidebar-user-info .role  { font-size: .68rem; opacity: .5; text-transform: capitalize; }
.sidebar-logout { margin-left: auto; color: rgba(255,255,255,.4); text-decoration: none; font-size: .95rem; padding: .2rem; }
.sidebar-logout:hover { color: var(--red); }

/* ── Admin Main ── */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-width: 0; /* prevent overflow */
}

/* ── Topbar ── */
.admin-topbar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 1.25rem;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-xs);
}
.topbar-title { font-size: 1.05rem; font-weight: 700; color: var(--gray-800); flex: 1; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; color: var(--gray-600); padding: .2rem;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.admin-content { flex: 1; padding: 1.5rem; }

/* ================================================================
   STATS GRID
================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .875rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  border-top: 3px solid var(--saffron);
  display: flex; flex-direction: column; gap: .2rem;
}
.stat-card.green  { border-top-color: var(--green); }
.stat-card.blue   { border-top-color: var(--blue); }
.stat-card.red    { border-top-color: var(--red); }
.stat-card.purple { border-top-color: var(--purple); }
.stat-card.yellow { border-top-color: var(--yellow); }
.stat-num   { font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--gray-800); }
.stat-label { font-size: .78rem; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

/* ================================================================
   DATA TABLE
================================================================ */
.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: .865rem;
  min-width: 500px; /* forces scroll on small screens */
}
.data-table th {
  background: var(--gray-50); color: var(--gray-600); font-weight: 700;
  padding: .75rem 1rem; text-align: left;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
}
.data-table td {
  padding: .75rem 1rem; border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--saffron-bg); }
.data-table .actions { display: flex; gap: .35rem; flex-wrap: wrap; }

/* ================================================================
   FILTER BAR
================================================================ */
.filter-bar {
  display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end;
  background: var(--white); padding: 1rem 1.25rem;
  border-radius: var(--radius); border: 1px solid var(--gray-200);
  margin-bottom: 1rem; box-shadow: var(--shadow-xs);
}
.filter-item { display: flex; flex-direction: column; gap: .25rem; min-width: 130px; }
.filter-label { font-size: .73rem; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: .04em; }

/* ================================================================
   MODAL
================================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  width: 100%; max-width: 600px; max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.97);
  transition: transform var(--ease);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; min-width: 0; flex: 1; }
.modal-close {
  background: none; border: none; font-size: 1.3rem; cursor: pointer;
  color: var(--gray-400); line-height: 1; padding: .2rem; flex-shrink: 0;
}
.modal-close:hover { color: var(--gray-700); }
.modal-body   { padding: 1.25rem; }
.modal-footer {
  padding: 1rem 1.25rem; border-top: 1px solid var(--gray-100);
  display: flex; justify-content: flex-end; gap: .65rem; flex-wrap: wrap;
}

/* ================================================================
   PAGINATION
================================================================ */
.pagination { display: flex; gap: .3rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: .5rem 0; }
.page-btn {
  min-width: 36px; height: 36px; padding: 0 .5rem;
  border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  background: var(--white); color: var(--gray-600);
  font-size: .84rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--ease); text-decoration: none;
}
.page-btn.active { background: var(--saffron); border-color: var(--saffron); color: #fff; }
.page-btn:hover:not(.active):not(:disabled) { border-color: var(--saffron); color: var(--saffron); }

/* ================================================================
   LOGIN PAGE
================================================================ */
.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-lt) 55%, var(--saffron-dk) 100%);
  padding: 1.5rem;
}
.login-card {
  background: var(--white); border-radius: var(--radius-xl);
  padding: 2.5rem 2rem; width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 1.75rem; }
.login-logo-circle {
  width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(135deg, var(--saffron), var(--saffron-dk));
  margin: 0 auto .75rem;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-disp); font-size: 1.9rem; color: #fff;
  box-shadow: 0 8px 20px rgba(255,107,0,.4);
}
.login-logo h1 { font-size: 1.25rem; font-weight: 700; color: var(--gray-800); }
.login-logo small { font-size: .8rem; color: var(--gray-500); }

/* ================================================================
   TOAST
================================================================ */
.toast-container {
  position: fixed; bottom: 1.25rem; right: 1.25rem;
  z-index: 9999; display: flex; flex-direction: column; gap: .45rem;
  max-width: calc(100vw - 2.5rem);
}
.toast {
  background: var(--gray-800); color: #fff;
  padding: .8rem 1.1rem; border-radius: var(--radius);
  font-size: .875rem; box-shadow: var(--shadow-lg);
  max-width: 320px; transform: translateX(120%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  word-break: break-word;
}
.toast.show { transform: translateX(0); }
.toast.success { border-left: 4px solid var(--green); }
.toast.error   { border-left: 4px solid var(--red); }
.toast.info    { border-left: 4px solid var(--blue); }

/* ================================================================
   SPINNER
================================================================ */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  display: inline-block; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================
   DASHBOARD GRID (2-col → 1-col)
================================================================ */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

/* ================================================================
   RESPONSIVE — Tablet (≤ 900px)
================================================================ */
@media (max-width: 900px) {
  .ticket-grid  { grid-template-columns: 1fr; }
  .dash-grid    { grid-template-columns: 1fr; }
}

/* ================================================================
   RESPONSIVE — Mobile sidebar (≤ 768px)
================================================================ */
@media (max-width: 768px) {
  /* Sidebar slides off-screen */
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay.open { display: block; }

  /* Main content takes full width */
  .admin-main { margin-left: 0; }

  /* Show hamburger */
  .hamburger { display: flex; }

  /* Content padding */
  .admin-content { padding: 1rem; }

  /* Stats: 2 columns */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }

  /* Topbar compact */
  .admin-topbar { padding: 0 1rem; }

  /* Ticket detail 1 col */
  .ticket-grid  { grid-template-columns: 1fr; }
  .dash-grid    { grid-template-columns: 1fr; }

  /* Filter bar stacked */
  .filter-bar { padding: .875rem; gap: .65rem; }
  .filter-item { min-width: 100%; }

  /* Modal full-screen on mobile */
  .modal-overlay { padding: .5rem; align-items: flex-end; }
  .modal {
    max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 95vh;
  }

  /* Hide some data-table columns */
  .data-table { min-width: 400px; }
  .hide-mobile { display: none !important; }

  /* Form row stack */
  .form-row { grid-template-columns: 1fr; }

  /* Timeline tighten */
  .timeline { padding-left: 1.5rem; }
  .timeline-dot { left: -1.5rem; }

  /* Header nav: hide text links */
  .pub-nav a:not(.btn-accent) { display: none; }
}

/* ================================================================
   RESPONSIVE — Small phones (≤ 480px)
================================================================ */
@media (max-width: 480px) {
  /* Stats: 1 col */
  .stats-grid { grid-template-columns: 1fr; }

  /* Reduce padding */
  .card-body    { padding: 1rem; }
  .card-header  { padding: .875rem 1rem; }
  .admin-content { padding: .75rem; }

  /* Buttons: smaller */
  .btn-lg { padding: .75rem 1.25rem; font-size: .9rem; }

  /* Hero compact */
  .hero { padding: 2rem 0 1.75rem; }
  .hero-badges { display: none; }

  /* Toast position */
  .toast-container { left: .75rem; right: .75rem; bottom: .75rem; }
  .toast { max-width: 100%; }

  /* Attachment grid: fewer cols */
  .attachments-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }

  /* Public nav: only admin link */
  .pub-logo-text small { display: none; }

  /* Status result header */
  .status-result-header { flex-direction: column; align-items: flex-start; }
}

/* ================================================================
   PRINT — hide nav/sidebar
================================================================ */
@media print {
  .sidebar, .admin-topbar, .pub-header, .hamburger, .btn { display: none !important; }
  .admin-main { margin-left: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
