:root {
  --bg-dark: #0b1120;
  --bg-sidebar: #0f172a;
  --bg-card: #ffffff;
  --bg-page: #f8fafc;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --accent: #0ea5e9;
  --emerald: #10b981;
  --emerald-dark: #059669;
  --amber: #f59e0b;
  --rose: #ef4444;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 6px 24px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px -8px rgba(15, 23, 42, 0.16);
  --radius: 12px;
}

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

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(79, 70, 229, 0.14);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
}

code {
  background: #f1f5f9;
  color: #312e81;
  padding: 0.12rem 0.38rem;
  border-radius: 5px;
  font-size: 0.85em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ============================================================================
   NAVBAR & PUBLIC LAYOUT
   ============================================================================ */
.public-navbar {
  background: rgba(11, 17, 32, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 1.5rem;
}

.nav-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.32rem;
  color: #ffffff;
  letter-spacing: -0.02em;
  cursor: pointer;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.45);
}

.brand-badge {
  font-size: 0.68rem;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
  padding: 0.15rem 0.52rem;
  border-radius: 999px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  flex-wrap: wrap;
}

.nav-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-collapse {
  display: contents;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.nav-link {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.92rem;
  cursor: pointer;
  transition: color 0.15s;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  border-radius: 7px;
}

.btn-lg {
  padding: 0.85rem 1.65rem;
  font-size: 1rem;
  border-radius: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
}

.btn-emerald:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-amber {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
}

.btn-outline {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-ghost-light {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ============================================================================
   HERO & PUBLIC SECTIONS
   ============================================================================ */
.hero-section {
  background: radial-gradient(circle at 20% 20%, #1e1b4b 0%, #0b1120 55%, #020617 100%);
  color: #ffffff;
  padding: 5rem 1.5rem 5.5rem;
}

.hero-container {
  max-width: 1120px;
  margin: 0 auto;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(79, 70, 229, 0.22);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #c7d2fe;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.2rem, 4.8vw, 3.6rem);
  font-weight: 800;
  line-height: 1.13;
  letter-spacing: -0.025em;
  margin-bottom: 1.15rem;
}

.hero-title span {
  background: linear-gradient(90deg, #38bdf8 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: #94a3b8;
  font-size: 1.12rem;
  max-width: 740px;
  margin: 0 auto 2.25rem;
}

.hero-cta-row {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
  max-width: 1020px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
}

.stat-glass-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.2rem;
}

.stat-glass-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: #ffffff;
}

.stat-glass-label {
  font-size: 0.83rem;
  color: #94a3b8;
  margin-top: 0.18rem;
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4.25rem 1.5rem;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 2.75rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 0.7rem;
}

.section-title {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
}

.grid-2 > *, .grid-3 > *, .kpi-grid > *, .quick-shortener-bar > * {
  min-width: 0;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* FAQ & PROSE PAGES */
.faq-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  margin-bottom: 0.85rem;
}

.faq-item summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--text-main);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item p {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.prose-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  max-width: 860px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}

.prose-card h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.prose-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
}

.prose-card p, .prose-card li {
  color: #334155;
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.prose-card ul {
  padding-left: 1.35rem;
}

/* ============================================================================
   MEMBER & ADMIN DASHBOARD SHELL
   ============================================================================ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: #f1f5f9;
}

.sidebar {
  width: 264px;
  background: var(--bg-sidebar);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-close-btn,
.mobile-dash-header,
.mobile-tab-strip,
.drawer-backdrop {
  display: none;
}

.sidebar-brand {
  padding: 1.2rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-user-card {
  margin: 1rem;
  padding: 0.95rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  padding: 0.4rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.95rem;
  border-radius: 9px;
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.91rem;
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.sidebar-item.active {
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.dashboard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dashboard-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

.quick-shortener-bar {
  display: grid;
  grid-template-columns: 1fr 160px 150px auto;
  gap: 0.65rem;
  align-items: center;
}

@media (max-width: 960px) {
  .quick-shortener-bar {
    grid-template-columns: 1fr;
  }
}

.price-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.price-prefix {
  position: absolute;
  left: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  pointer-events: none;
}

.dashboard-content {
  padding: 1.6rem;
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
}

/* KPI CARDS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 215px), 1fr));
  gap: 1.15rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: #ffffff;
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.kpi-card.indigo { border-left: 4px solid #4f46e5; }
.kpi-card.emerald { border-left: 4px solid #10b981; }
.kpi-card.cyan { border-left: 4px solid #0ea5e9; }
.kpi-card.amber { border-left: 4px solid #f59e0b; }
.kpi-card.rose { border-left: 4px solid #ef4444; }

.kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0.3rem 0 0.18rem;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* CARDS, TABLES, FORMS */
.card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  min-width: 0;
}

.card-auth {
  padding: 2rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.35rem;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.revenue-svg {
  width: 100%;
  min-width: 520px;
  max-height: 230px;
  display: block;
}

.filter-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-input {
  width: 220px;
}

.filter-select {
  width: 160px;
}

.break-all {
  word-break: break-all;
  overflow-wrap: anywhere;
}

.ticket-reply-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.public-footer {
  background: #0b1120;
  color: #94a3b8;
  padding: 2.75rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-top {
  align-items: flex-start;
  gap: 2rem;
}

.footer-links {
  display: flex;
  gap: 1.15rem 1.35rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
}

.footer-bottom {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  gap: 0.65rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.89rem;
}

th {
  text-align: left;
  padding: 0.78rem 0.9rem;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 0.82rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

tr:hover td {
  background: #f8fafc;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-indigo  { background: #e0e7ff; color: #4338ca; }
.badge-neutral { background: #f1f5f9; color: #475569; }

.announcement-box {
  background: linear-gradient(135deg, #eef2ff 0%, #ecfeff 100%);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 1rem;
  overflow-y: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  margin: auto;
}

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 0.85rem 1.2rem;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left-color: #ef4444;
}

.code-block {
  background: #0b1120;
  color: #7dd3fc;
  padding: 1rem 1.15rem;
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  overflow-x: auto;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.tab-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tab-pill {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}

.tab-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ============================================================================
   MOBILE & TABLET RESPONSIVE STYLES
   ============================================================================ */
@media (max-width: 960px) {
  .dashboard-layout {
    flex-direction: column;
  }

  .mobile-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    position: sticky;
    top: 0;
    z-index: 95;
    background: var(--bg-sidebar);
    color: #ffffff;
    padding: 0.72rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mobile-dash-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
  }

  .mobile-dash-menu-btn {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.15rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    touch-action: manipulation;
  }

  .mobile-dash-title {
    font-weight: 700;
    font-size: 0.96rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-dash-pill {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.28rem 0.68rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
    white-space: nowrap;
    flex-shrink: 0;
  }

  .mobile-dash-pill.admin {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.35);
  }

  .mobile-tab-strip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.62rem 1rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-tab-strip::-webkit-scrollbar {
    display: none;
  }

  .mobile-tab-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    touch-action: manipulation;
  }

  .mobile-tab-pill.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
  }

  .drawer-backdrop.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(11, 17, 32, 0.58);
    backdrop-filter: blur(2px);
    z-index: 1090;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(290px, 84vw);
    z-index: 1100;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.15rem;
    cursor: pointer;
  }

  .dashboard-topbar {
    padding: 0.9rem 1rem;
  }

  .dashboard-content {
    padding: 1rem;
  }
}

@media (max-width: 860px) {
  .public-navbar {
    padding: 0.72rem 1rem;
  }

  .nav-container {
    gap: 0.5rem;
  }

  .nav-top-row {
    width: 100%;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .nav-collapse {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-collapse.open {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
  }

  .nav-link {
    padding: 0.62rem 0.75rem;
    border-radius: 8px;
    font-size: 0.95rem;
  }

  .nav-link:hover,
  .nav-link.active {
    background: rgba(255, 255, 255, 0.08);
  }

  .nav-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
  }

  .nav-actions .btn {
    width: 100%;
    padding: 0.62rem 0.9rem;
    font-size: 0.88rem;
  }
}

@media (max-width: 768px) {
  input, select, textarea {
    font-size: 1rem;
  }

  .grid-2 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero-section {
    padding: 3rem 1rem 3.25rem;
  }

  .hero-title {
    font-size: clamp(1.75rem, 6.5vw, 2.5rem);
  }

  .hero-subtitle {
    font-size: 0.97rem;
    margin-bottom: 1.65rem;
  }

  .hide-mobile {
    display: none;
  }

  .section-container {
    padding: 2.5rem 1rem;
  }

  .section-header {
    margin-bottom: 1.75rem;
  }

  .prose-card {
    padding: 1.35rem 1.15rem;
  }

  .prose-card h2 {
    font-size: 1.45rem;
  }

  th, td {
    padding: 0.62rem 0.68rem;
    font-size: 0.82rem;
  }

  .public-footer {
    padding: 2rem 1rem;
  }

  .footer-links {
    gap: 0.85rem 1.1rem;
  }
}

@media (max-width: 640px) {
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .card {
    padding: 1.1rem;
    margin-bottom: 1rem;
  }

  .card-auth {
    padding: 1.35rem 1.1rem;
  }

  .filter-controls,
  .filter-input,
  .filter-select {
    width: 100%;
  }

  .ticket-reply-row {
    flex-direction: column;
    align-items: stretch;
  }

  .ticket-reply-row .btn {
    width: 100%;
  }

  .tab-pill {
    padding: 0.42rem 0.78rem;
    font-size: 0.8rem;
  }

  .code-block {
    font-size: 0.78rem;
    padding: 0.85rem;
  }

  .modal-card {
    padding: 1.25rem 1.1rem;
    border-radius: 14px;
  }

  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .toast {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-bottom: 1rem;
  }

  .kpi-card {
    padding: 1rem 1.1rem;
  }

  .kpi-value {
    font-size: 1.45rem;
  }

  .hero-cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-cta-row .btn-lg {
    width: 100%;
  }

  .stat-glass-card {
    padding: 0.9rem 0.75rem;
  }

  .stat-glass-value {
    font-size: 1.35rem;
  }

  .hide-xs {
    display: none;
  }
}
