/* ===================================================================
   Shishyams SaaS — Shared Theme
   Extracted & extended from the supplied Dreams LMS UI design
   =================================================================== */

:root {
  --primary: #FF6B35;
  --primary-light: #fff3ef;
  --primary-dark: #e55a24;
  --secondary: #392C7D;
  --accent: #00C9A7;
  --bg: #F8F9FC;
  --sidebar-bg: #fff;
  --card-bg: #fff;
  --text-dark: #1a1a2e;
  --text-mid: #4b5563;
  --text-light: #9ca3af;
  --border: #e9ecef;
  --shadow: 0 4px 24px rgba(0,0,0,0.07);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --radius: 14px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
  --header-h: 68px;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
}

a { color: inherit; }

/* ── TOP NAV ───────────────────────────────── */
.topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  box-shadow: var(--shadow-sm);
}
.topnav-left { display: flex; align-items: center; gap: 18px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #ff9a5c);
  display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 20px; height: 20px; fill: #fff; }
.logo-text { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1.25rem; color: var(--text-dark); }
.logo-text span { color: var(--primary); }

.hamburger {
  background: none; border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  transition: background .2s;
}
.hamburger:hover { background: var(--bg); }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text-mid); border-radius: 2px; transition: .3s; }

.topnav-right { display: flex; align-items: center; gap: 12px; }

.nav-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 14px;
}
.nav-search input {
  border: none; background: none; outline: none;
  font-size: .875rem; color: var(--text-dark); width: 180px;
  font-family: inherit;
}
.nav-search i { color: var(--text-light); font-size: .85rem; }

.nav-icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s; text-decoration: none;
}
.nav-icon-btn:hover { background: var(--primary-light); }
.nav-icon-btn i { color: var(--text-mid); font-size: .95rem; }
.nav-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--primary); color: #fff;
  font-size: .65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 14px 5px 5px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 40px; cursor: pointer; transition: background .2s;
  text-decoration: none;
  position: relative;
}
.user-pill:hover { background: var(--primary-light); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg,#FF6B35,#392C7D);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: #fff;
}
.user-name { font-size: .82rem; font-weight: 600; color: var(--text-dark); }
.user-pill i { font-size: .7rem; color: var(--text-light); }

.user-dropdown {
  position: absolute; top: 48px; right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  min-width: 180px; display: none; z-index: 200; overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; font-size: .82rem; text-decoration: none;
  color: var(--text-mid);
}
.user-dropdown a:hover { background: var(--primary-light); color: var(--primary); }

/* ── LAYOUT ────────────────────────────────── */
.layout { display: flex; padding-top: var(--header-h); min-height: 100vh; }

/* ── SIDEBAR ───────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  position: fixed; top: var(--header-h); left: 0; bottom: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-y: auto; z-index: 50;
  transition: transform .3s ease;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-profile {
  margin: 20px 16px 16px;
  background: linear-gradient(135deg, var(--secondary) 0%, #6a3de8 100%);
  border-radius: var(--radius);
  padding: 22px 18px 18px;
  color: #fff;
  position: relative; overflow: hidden;
}
.sidebar-profile::before {
  content: ''; position: absolute; top: -20px; right: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.sidebar-profile::after {
  content: ''; position: absolute; bottom: -30px; right: 20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.sp-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg,#FF6B35,#ffbd8a);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800; color: #fff;
  border: 3px solid rgba(255,255,255,.3);
  margin-bottom: 10px; position: relative; z-index: 1;
}
.sp-name { font-weight: 700; font-size: 1rem; margin-bottom: 2px; position: relative; z-index: 1; }
.sp-role { font-size: .75rem; opacity: .75; margin-bottom: 14px; position: relative; z-index: 1; }
.sp-btns { display: flex; gap: 8px; position: relative; z-index: 1; }
.sp-btn {
  flex: 1; padding: 7px 6px; border-radius: 8px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: .72rem; font-weight: 600;
  cursor: pointer; text-align: center; transition: background .2s;
  text-decoration: none; display: block;
  font-family: inherit;
}
.sp-btn:hover { background: rgba(255,255,255,.3); }
.sp-btn.primary { background: var(--primary); border-color: var(--primary); }
.sp-btn.primary:hover { background: var(--primary-dark); }

.sidebar-section { padding: 10px 16px 4px; }
.sidebar-section-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  color: var(--text-light); text-transform: uppercase; margin-bottom: 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-mid);
  font-size: .875rem; font-weight: 500;
  transition: all .2s; margin-bottom: 2px;
  cursor: pointer;
}
.nav-item i { width: 18px; text-align: center; font-size: .9rem; }
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-item.active i { color: var(--primary); }
.nav-item .nav-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); margin-left: auto;
  animation: pulse 2s infinite;
}
.nav-item .nav-count {
  margin-left: auto; background: var(--primary); color: #fff;
  font-size: .68rem; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 20px;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }

.sidebar-divider { height: 1px; background: var(--border); margin: 10px 16px; }

/* ── MAIN CONTENT ──────────────────────────── */
.main {
  flex: 1; margin-left: var(--sidebar-w);
  padding: 28px 28px 60px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 22px;
}
.breadcrumb a { text-decoration: none; color: var(--text-light); font-size: .82rem; transition: color .2s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb i { font-size: .6rem; color: var(--text-light); }
.breadcrumb span { font-size: .82rem; font-weight: 600; color: var(--text-dark); }

.page-title-row { display:flex; align-items:center; justify-content:space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title {
  font-size: 1.5rem; font-weight: 800;
  font-family: 'Nunito', sans-serif;
  color: var(--text-dark);
}
.page-subtitle { font-size: .85rem; color: var(--text-light); margin-top: 4px; }

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: .84rem; font-weight: 700; font-family: inherit;
  cursor: pointer; border: 1px solid transparent; text-decoration: none;
  transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text-mid); border-color: var(--border); }
.btn-secondary:hover { background: #eef0f5; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--accent); color: #fff; }
.btn-success:hover { background: #00a889; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-sm { padding: 6px 12px; font-size: .74rem; }

/* ── STAT CARDS ─────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 18px; margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  transition: transform .25s, box-shadow .25s;
  animation: fadeUp .5s ease both;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
@keyframes fadeUp {
  from { opacity:0; transform: translateY(18px); }
  to   { opacity:1; transform: translateY(0); }
}
.stat-card:nth-child(1) { animation-delay:.05s; }
.stat-card:nth-child(2) { animation-delay:.1s; }
.stat-card:nth-child(3) { animation-delay:.15s; }
.stat-card:nth-child(4) { animation-delay:.2s; }

.stat-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.stat-icon.orange { background: #fff3ef; color: var(--primary); }
.stat-icon.purple { background: #f0ecff; color: #7c5cbf; }
.stat-icon.green  { background: #e6faf7; color: var(--accent); }
.stat-icon.blue   { background: #e8f4ff; color: #3b82f6; }
.stat-icon.pink   { background: #ffeef5; color: #e91e8c; }
.stat-icon.teal   { background: #e8fff8; color: #0d9488; }
.stat-icon.red    { background: #fef2f2; color: #ef4444; }

.stat-info { flex: 1; }
.stat-label { font-size: .78rem; color: var(--text-light); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 1.6rem; font-weight: 800; font-family: 'Nunito', sans-serif; color: var(--text-dark); }

.stat-trend {
  display: flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600; margin-top: 4px;
}
.stat-trend.up { color: #10b981; }
.stat-trend.down { color: #ef4444; }

/* ── CARD ───────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  animation: fadeUp .5s ease both;
  animation-delay: .2s;
  margin-bottom: 22px;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 10px;
}
.card-body { padding: 22px; }
.card-title {
  font-size: 1rem; font-weight: 700; color: var(--text-dark);
  font-family: 'Nunito', sans-serif;
}
.card-action {
  font-size: .78rem; font-weight: 600; color: var(--primary);
  text-decoration: none; display: flex; align-items: center; gap: 4px;
  cursor: pointer; transition: opacity .2s;
}
.card-action:hover { opacity: .75; }

/* ── TABLES ──────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead tr { background: var(--bg); }
.data-table th {
  padding: 11px 18px; text-align: left;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-light);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 18px; font-size: .84rem; color: var(--text-mid);
  border-top: 1px solid var(--border); vertical-align: middle;
}
.data-table tr { transition: background .15s; }
.data-table tbody tr:hover { background: var(--primary-light); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 700;
}
.badge-green { background: #d1fae5; color: #065f46; }
.badge-orange { background: #fff3ef; color: var(--primary); }
.badge-blue { background: #e0f2fe; color: #0369a1; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f3f4f6; color: #4b5563; }
.badge-purple { background: #f0ecff; color: #7c5cbf; }

.entity-cell { display: flex; align-items: center; gap: 12px; }
.entity-thumb {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(135deg,#f0ecff,#e8f4ff);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: .78rem; font-weight: 700; color: #7c5cbf;
}
.entity-name { font-weight: 600; color: var(--text-dark); font-size: .84rem; line-height: 1.35; }
.entity-name small { font-weight: 400; color: var(--text-light); font-size: .72rem; display: block; margin-top: 1px; }

.action-icons { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: #fff; color: var(--text-mid);
  cursor: pointer; text-decoration: none; font-size: .78rem; transition: all .15s;
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-light); }
.icon-btn.danger:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger-light); }

/* ── FORMS ──────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 18px; }
.form-group.full { grid-column: 1 / -1; }
.form-label { display: block; font-size: .8rem; font-weight: 600; color: var(--text-dark); margin-bottom: 6px; }
.form-label .req { color: var(--danger); }
.meta { display: block; font-size: .78rem; color: var(--text-light); margin: 2px 0; }

.settings-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.settings-tab-btn {
  background: none; border: none; cursor: pointer; font-family: inherit;
  padding: 12px 18px; font-size: .88rem; font-weight: 600; color: var(--text-light);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: color .2s, border-color .2s;
}
.settings-tab-btn:hover { color: var(--primary); }
.settings-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.settings-tab-panel { display: none; }
.settings-tab-panel.active { display: block; }
.form-control {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: .86rem; font-family: inherit;
  background: #fff; color: var(--text-dark); outline: none; transition: border-color .2s;
}
.form-control:focus { border-color: var(--primary); }
.form-hint { font-size: .72rem; color: var(--text-light); margin-top: 4px; }
select.form-control { cursor: pointer; }

/* ── ALERTS ──────────────────────────── */
.alert {
  padding: 13px 18px; border-radius: var(--radius-sm);
  font-size: .84rem; font-weight: 500; margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-info { background: #e0f2fe; color: #0369a1; }
.alert-warning { background: var(--warning-light); color: #92400e; }

/* ── FOOTER AREA ────────────────────────────── */
.footer-note {
  margin-top: 30px; text-align: center;
  font-size: .78rem; color: var(--text-light);
}
.footer-note a { color: var(--primary); text-decoration: none; }

/* ── SCROLLBAR ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 6px; }

/* ── AUTH PAGES ──────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--secondary) 0%, #241b57 100%);
  padding: 24px;
}
.auth-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 420px; padding: 40px 36px; animation: fadeUp .5s ease both;
}
.auth-logo { display:flex; align-items:center; gap:10px; justify-content:center; margin-bottom: 8px; }
.auth-title { text-align: center; font-family:'Nunito',sans-serif; font-weight: 800; font-size: 1.3rem; margin-bottom: 4px; }
.auth-subtitle { text-align: center; color: var(--text-light); font-size: .84rem; margin-bottom: 28px; }
.auth-demo-box {
  background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 14px; margin-top: 22px; font-size: .74rem; color: var(--text-mid); line-height: 1.7;
}
.auth-demo-box b { color: var(--text-dark); }

/* ── MODAL ─────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26,26,46,.5);
  display: none; align-items: center; justify-content: center; z-index: 300; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 420px;
  padding: 18px 22px; box-shadow: var(--shadow);
  max-height: 90vh; overflow-y: auto;
}
.modal-box.modal-box-wide { max-width: 520px; }
.modal-box.modal-box-scroll { max-height: 88vh; overflow-y: auto; }
.modal-title { font-family:'Nunito',sans-serif; font-weight: 800; font-size: 1.05rem; margin-bottom: 6px; }
.modal-text { font-size: .82rem; color: var(--text-mid); margin-bottom: 14px; line-height: 1.45; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

/* Compact form layout used inside modals with many fields */
.modal-box .form-grid { gap: 10px 16px; }
.modal-box .form-grid .form-group { margin-bottom: 10px; }
.modal-box .form-label { margin-bottom: 4px; }
.modal-box .form-control { padding: 9px 12px; }
.modal-box .form-hint { margin-top: 2px; }

/* Slim scrollbar so it doesn't eat into the compact padding */
.modal-box::-webkit-scrollbar { width: 6px; }
.modal-box::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── ADMISSION FORM WIZARD ───────────────────── */
.wizard-box { max-width: 720px; max-height: 88vh; overflow-y: auto; }
.wizard-steps {
  display: flex; gap: 4px; margin: 4px 0 22px; border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.wizard-step {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 10px 14px; font-size: .8rem; font-weight: 600; color: var(--text-light);
  border-bottom: 2px solid transparent; cursor: pointer; transition: color .2s, border-color .2s;
}
.wizard-step:hover { color: var(--primary); }
.wizard-step.active { color: var(--primary); border-bottom-color: var(--primary); }
.wizard-step.done { color: var(--accent); }
.wizard-step-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; color: var(--text-mid);
  flex-shrink: 0;
}
.wizard-step.active .wizard-step-num { background: var(--primary); border-color: var(--primary); color: #fff; }
.wizard-step.done .wizard-step-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.wizard-panel { display: none; animation: fadeUp .3s ease both; }
.wizard-panel.active { display: block; }
.photo-preview {
  width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--text-light);
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ── MOBILE BOTTOM NAV ───────────────────────
   Hidden by default (and therefore on desktop/tablet); only switched on
   inside the max-width:768px block below, so desktop is never affected. */
.bottom-nav { display: none; }

/* ── RESPONSIVE ─────────────────────────────── */
@media(max-width:1100px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

/* Sidebar backdrop overlay shown behind the off-canvas sidebar on mobile.
   Hidden entirely on desktop/tablet so it can never affect larger screens. */
.sidebar-overlay { display: none; }

@media(max-width:768px) {
  html, body { overflow-x: hidden; max-width: 100%; }

  /* Off-canvas sidebar (unchanged behaviour, kept from original) */
  .sidebar {
    transform: translateX(-100%);
    width: min(var(--sidebar-w), 82vw);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    position: fixed; inset: var(--header-h) 0 0 0;
    background: rgba(15,23,42,.45);
    z-index: 49; opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
  }
  .sidebar-overlay.open { display: block; opacity: 1; pointer-events: auto; }

  body.sidebar-locked { overflow: hidden; }

  .sidebar { z-index: 110; }
  .sidebar-overlay { z-index: 105; }

  .main { margin-left: 0; padding: 16px 14px 96px; max-width: 100vw; overflow-x: hidden; }

  /* Top navigation: keep everything on one row without clipping */
  .topnav { padding: 0 12px; gap: 8px; }
  .topnav-left { gap: 10px; }
  .topnav-right { gap: 8px; }
  .logo-text { font-size: 1.05rem; white-space: nowrap; }
  .nav-search { display: none; }
  .nav-icon-btn { width: 36px; height: 36px; }
  .user-pill { padding: 4px 8px 4px 4px; gap: 6px; }
  .user-name { display: none; }
  .user-dropdown { right: -4px; min-width: 160px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 16px; gap: 12px; }
  .stat-icon { width: 42px; height: 42px; font-size: 1.1rem; border-radius: 10px; }
  .stat-value { font-size: 1.25rem; }
  .stat-label { font-size: .72rem; }

  .card-header { padding: 16px 16px 12px; }
  .card-body { padding: 16px; }
  .page-title { font-size: 1.2rem; }
  .page-title-row { margin-bottom: 18px; }

  /* Let the page-title-row action buttons take full width and stack nicely */
  .page-title-row > div,
  .page-title-row > form { width: 100%; }
  .page-title-row .btn { flex: 1 1 auto; justify-content: center; }

  .wizard-box, .modal-box { max-width: 96vw; }
  .modal-box { padding: 16px 16px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; justify-content: center; }

  .settings-tabs { gap: 2px; }
  .settings-tab-btn { padding: 10px 12px; font-size: .82rem; }

  /* Tables: allow horizontal scroll instead of squeezing/breaking layout */
  .table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll .data-table { min-width: 640px; }

  .auth-wrap { padding: 16px; }
  .auth-card { padding: 28px 22px; }

  /* Hide the topnav hamburger on mobile — the bottom nav's "More" button
     takes over opening the full menu, keeping the top bar uncluttered. */
  .hamburger { display: none; }

  /* ── BOTTOM NAV BAR ─────────────────────── */
  .bottom-nav {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 24px rgba(0,0,0,.08);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
    align-items: stretch;
    animation: bnavSlideUp .4s cubic-bezier(.22,1,.36,1) both;
  }
  @keyframes bnavSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .bnav-item {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 6px 2px 5px; margin: 0 2px; border-radius: 12px;
    text-decoration: none; color: var(--text-light);
    background: none; border: none; font-family: inherit; cursor: pointer;
    position: relative; -webkit-tap-highlight-color: transparent;
    transition: color .25s ease, background .25s ease;
  }
  .bnav-item:active { transform: scale(.92); transition: transform .12s ease; }
  .bnav-item.active { background: var(--primary-light); }
  .bnav-icon {
    width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; color: inherit;
    transition: transform .35s cubic-bezier(.34,1.56,.64,1), color .25s ease;
  }
  .bnav-item.active .bnav-icon { color: var(--primary); transform: translateY(-1px) scale(1.14); }
  .bnav-label {
    font-size: .63rem; font-weight: 600; letter-spacing: .01em; line-height: 1;
    transition: color .25s ease, font-weight .25s ease;
  }
  .bnav-item.active .bnav-label { color: var(--primary); font-weight: 700; }
  .bnav-item.active::before {
    content: '';
    position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
    width: 18px; height: 3px; border-radius: 3px;
    background: var(--primary);
    animation: bnavDotIn .3s ease both;
  }
  @keyframes bnavDotIn {
    from { width: 0; opacity: 0; }
    to   { width: 18px; opacity: 1; }
  }
  .bnav-more .bnav-icon i { transition: transform .3s cubic-bezier(.4,0,.2,1); }
  .bnav-more.menu-open .bnav-icon i { transform: rotate(180deg); }
  .bnav-more.menu-open { background: var(--primary-light); }
  .bnav-more.menu-open .bnav-icon,
  .bnav-more.menu-open .bnav-label { color: var(--primary); }
}

@media(max-width:600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-grid { gap: 12px; }
  .breadcrumb { margin-bottom: 16px; }
  .breadcrumb span, .breadcrumb a { font-size: .76rem; }
}

@media(max-width:480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; font-size: 1rem; border-radius: 9px; }
  .stat-value { font-size: 1.05rem; }
  .stat-label { font-size: .68rem; }
  .main { padding: 14px 10px 92px; }
  .card-body { padding: 14px; }
  .card-header { padding: 14px 14px 10px; }
  .btn { padding: 9px 14px; font-size: .8rem; }
  .page-title { font-size: 1.1rem; }
  .page-subtitle { font-size: .8rem; }
  .auth-card { padding: 22px 16px; }
  .auth-title { font-size: 1.1rem; }
  .modal-box { padding: 14px; }
  .sp-btns { flex-wrap: wrap; }
}

@media(max-width:360px) {
  .topnav { padding: 0 8px; }
  .nav-icon-btn { width: 32px; height: 32px; }
  .stats-grid { gap: 8px; }
  .stat-card {
    flex-direction: column; align-items: center; text-align: center;
    padding: 10px 8px; gap: 6px;
  }
  .stat-info { width: 100%; }
  .stat-icon { width: 34px; height: 34px; font-size: .95rem; }
  .stat-value { font-size: 1rem; }
  .stat-label { font-size: .62rem; }
  .stat-trend { display: none; }
  .topnav-left { gap: 6px; }
  .topnav-right { gap: 6px; }
  .logo-text { font-size: .92rem; }
  .user-pill { padding: 3px 6px 3px 3px; gap: 4px; }
}
