/* ============================================================
   Consisto Teacher Engine — assets/css/te.css
   Premium editorial design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Newsreader:ital,opsz,wght@0,6..72,300;0,6..72,400;0,6..72,500;1,6..72,300;1,6..72,400&family=DM+Mono:wght@300;400;500&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:        #F5F1EA;
  --cream-deep:   #EDE8DF;
  --cream-border: #D9D3C7;
  --ink:          #1A1814;
  --ink-mid:      #4A453E;
  --ink-light:    #8A847A;
  --ink-ghost:    #C4BDB4;
  --accent:       #2A2420;
  --gold:         #B8964A;
  --gold-light:   #F0E4C4;
  --sage:         #4A6741;
  --sage-light:   #E4EDE3;
  --rose:         #8C4A42;
  --rose-light:   #F0E4E3;
  --sky:          #3A5F7A;
  --sky-light:    #E3EDF4;
  --r:            3px;
  --r-lg:         8px;
  --r-xl:         14px;
  --sidebar-w:    230px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Newsreader', Georgia, serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4, .syne { font-family: 'Inter', Arial, sans-serif, sans-serif; }
.mono { font-family: 'DM Mono', monospace; }
.italic { font-style: italic; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes slideRight {
  from { transform: translateX(-8px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.fade-up   { animation: fadeUp  0.5s cubic-bezier(.2,.8,.3,1) both; }
.fade-in   { animation: fadeIn  0.4s ease both; }
.delay-1   { animation-delay: 0.08s; }
.delay-2   { animation-delay: 0.16s; }
.delay-3   { animation-delay: 0.24s; }
.delay-4   { animation-delay: 0.32s; }
.delay-5   { animation-delay: 0.40s; }
.delay-6   { animation-delay: 0.48s; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  display:         inline-flex;
  align-items:     center;
  justify-content: center;
  gap:             8px;
  padding:         13px 28px;
  background:      var(--ink);
  color:           var(--cream);
  font-family:     'Inter', Arial, sans-serif, sans-serif;
  font-size:       14px;
  font-weight:     600;
  letter-spacing:  0.03em;
  border:          none;
  border-radius:   var(--r-lg);
  cursor:          pointer;
  transition:      background 0.2s, transform 0.15s;
  text-decoration: none;
}
.btn-primary:hover   { background: #2e2a26; transform: translateY(-1px); }
.btn-primary:active  { transform: translateY(0); }
.btn-primary:disabled{ opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-outline {
  display:        inline-flex;
  align-items:    center;
  gap:            6px;
  padding:        9px 18px;
  background:     transparent;
  color:          var(--ink-mid);
  font-family:    'Inter', Arial, sans-serif, sans-serif;
  font-size:      13px;
  font-weight:    500;
  border:         1px solid var(--cream-border);
  border-radius:  var(--r-lg);
  cursor:         pointer;
  transition:     all 0.2s;
  text-decoration:none;
}
.btn-outline:hover { border-color: var(--ink-ghost); color: var(--ink); background: var(--cream-deep); }

.btn-ghost {
  background:     none;
  border:         none;
  cursor:         pointer;
  color:          var(--ink-light);
  font-family:    'Inter', Arial, sans-serif, sans-serif;
  font-size:      13px;
  padding:        6px 10px;
  border-radius:  var(--r);
  transition:     color 0.2s;
}
.btn-ghost:hover { color: var(--ink); }

/* ── Form elements ────────────────────────────────────────── */
.input-field {
  width:          100%;
  padding:        13px 16px;
  background:     white;
  color:          var(--ink);
  font-family:    'DM Mono', monospace;
  font-size:      14px;
  letter-spacing: 0.04em;
  border:         1.5px solid var(--cream-border);
  border-radius:  var(--r-lg);
  outline:        none;
  transition:     border-color 0.2s;
}
.input-field:focus        { border-color: var(--ink); }
.input-field::placeholder { color: var(--ink-ghost); font-size: 13px; }
.input-field.err          { border-color: var(--rose); }

.select-field {
  width:          100%;
  padding:        13px 40px 13px 16px;
  background:     white;
  color:          var(--ink);
  font-family:    'DM Mono', monospace;
  font-size:      14px;
  letter-spacing: 0.04em;
  border:         1.5px solid var(--cream-border);
  border-radius:  var(--r-lg);
  outline:        none;
  transition:     border-color 0.2s;
  appearance:     none;
  cursor:         pointer;
}
.select-field:focus { border-color: var(--ink); }

.select-wrap { position: relative; }
.select-wrap::after {
  content:        '▾';
  position:       absolute;
  right:          14px;
  top:            50%;
  transform:      translateY(-50%);
  pointer-events: none;
  color:          var(--ink-light);
  font-size:      12px;
}

label.field-label {
  display:        block;
  font-family:    'Inter', Arial, sans-serif, sans-serif;
  font-size:      11px;
  font-weight:    600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--ink-light);
  margin-bottom:  8px;
}

.field-hint {
  font-family:   'Newsreader', serif;
  font-size:     12px;
  color:         var(--ink-light);
  margin-top:    6px;
  font-style:    italic;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background:    white;
  border-radius: var(--r-xl);
  border:        1px solid var(--cream-border);
  padding:       24px;
}
.card-sm {
  background:    white;
  border-radius: var(--r-lg);
  border:        1px solid var(--cream-border);
  padding:       16px 20px;
}
.card-dark {
  background:    var(--ink);
  border-radius: var(--r-xl);
  border:        1px solid var(--ink);
  padding:       24px;
}

/* ── Chips & Tags ─────────────────────────────────────────── */
.chip {
  display:        inline-flex;
  align-items:    center;
  gap:            6px;
  padding:        4px 12px;
  font-family:    'Inter', Arial, sans-serif, sans-serif;
  font-size:      11px;
  font-weight:    600;
  letter-spacing: 0.08em;
  border-radius:  100px;
  text-transform: uppercase;
}
.chip-gold { background: var(--gold-light); color: var(--gold); }
.chip-sage { background: var(--sage-light); color: var(--sage); }
.chip-sky  { background: var(--sky-light);  color: var(--sky);  }
.chip-rose { background: var(--rose-light); color: var(--rose); }
.chip-ink  { background: var(--cream-deep); color: var(--ink-mid); }

.tag {
  display:        inline-flex;
  align-items:    center;
  padding:        3px 10px;
  font-family:    'DM Mono', monospace;
  font-size:      11px;
  border-radius:  3px;
  letter-spacing: 0.03em;
}
.tag-gold { background: var(--gold-light); color: var(--gold); }
.tag-sage { background: var(--sage-light); color: var(--sage); }
.tag-sky  { background: var(--sky-light);  color: var(--sky);  }
.tag-rose { background: var(--rose-light); color: var(--rose); }
.tag-ink  { background: var(--cream-deep); color: var(--ink-mid); }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  display:     flex;
  align-items: center;
  gap:         16px;
  color:       var(--ink-ghost);
  font-family: 'DM Mono', monospace;
  font-size:   11px;
}
.divider::before, .divider::after {
  content:    '';
  flex:       1;
  height:     1px;
  background: var(--cream-border);
}

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  width:        18px;
  height:       18px;
  border:       2px solid rgba(245,241,234,0.3);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation:    spin 0.7s linear infinite;
  flex-shrink:  0;
}
.spinner-dark {
  border:           2px solid rgba(26,24,20,0.15);
  border-top-color: var(--ink);
}
/* ── Button Loading States ── */
.btn-busy{position:relative;pointer-events:none;opacity:.85}
.btn-spinner{display:inline-block;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:spin .55s linear infinite;vertical-align:middle;margin-right:6px;opacity:.7}
@media(prefers-reduced-motion:reduce){
  .spinner,.spinner-dark,.btn-spinner,.loading-dot,.fade-up{animation:none!important}
}

/* ── Alert boxes ──────────────────────────────────────────── */
.alert {
  border-radius: var(--r-lg);
  padding:       10px 14px;
  font-family:   'Newsreader', serif;
  font-size:     14px;
  display:       none;
}
.alert.show { display: block; }
.alert-error   { background: var(--rose-light); border: 1px solid rgba(140,74,66,0.2); color: var(--rose); }
.alert-success { background: var(--sage-light); border: 1px solid rgba(74,103,65,0.2); color: var(--sage); }

/* ── Sidebar navigation ───────────────────────────────────── */
.sidebar {
  width:      var(--sidebar-w);
  background: white;
  border-right: 1px solid var(--cream-border);
  display:    flex;
  flex-direction: column;
  padding:    24px 16px;
  position:   fixed;
  top:        0;
  left:       0;
  bottom:     0;
  z-index:    10;
  overflow-y: auto;
}
.sidebar-logo  { margin-bottom: 32px; padding-left: 4px; }
.sidebar-badge { margin-top: 6px; padding-left: 2px; }

.nav-item {
  display:        flex;
  align-items:    center;
  gap:            10px;
  padding:        9px 14px;
  border-radius:  var(--r-lg);
  font-family:    'Inter', Arial, sans-serif, sans-serif;
  font-size:      13px;
  font-weight:    500;
  color:          var(--ink-mid);
  cursor:         pointer;
  transition:     all 0.18s;
  text-decoration: none;
}
.nav-item:hover   { background: var(--cream-deep); color: var(--ink); }
.nav-item.active  { background: var(--ink); color: var(--cream); }
.nav-item .icon   { font-size: 14px; width: 16px; text-align: center; }

.sidebar-footer {
  border-top:  1px solid var(--cream-border);
  padding-top: 16px;
  margin-top:  auto;
  display:     flex;
  align-items: center;
  gap:         10px;
}

/* ── Avatar ───────────────────────────────────────────────── */
.avatar {
  width:           36px;
  height:          36px;
  border-radius:   50%;
  background:      var(--ink);
  color:           var(--cream);
  font-family:     'Inter', Arial, sans-serif, sans-serif;
  font-size:       13px;
  font-weight:     700;
  display:         flex;
  align-items:     center;
  justify-content: center;
  flex-shrink:     0;
}

/* ── Main layout ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  padding:     36px 40px;
  min-height:  100vh;
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display:         flex;
  align-items:     flex-start;
  justify-content: space-between;
  margin-bottom:   36px;
}
.page-title   { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.page-sub     { font-family: 'Newsreader', serif; font-size: 16px; color: var(--ink-mid); margin-top: 6px; font-style: italic; }
.page-datestamp {
  font-family:    'DM Mono', monospace;
  font-size:      11px;
  color:          var(--ink-light);
  letter-spacing: 0.06em;
  margin-bottom:  6px;
}

/* ── Stats grid ───────────────────────────────────────────── */
.stats-grid {
  display:               grid;
  grid-template-columns: repeat(4, 1fr);
  gap:                   16px;
  margin-bottom:         32px;
}
.stat-number {
  font-family:  'DM Mono', monospace;
  font-size:    28px;
  font-weight:  500;
  color:        var(--ink);
  line-height:  1;
}
.stat-label {
  font-family:    'Inter', Arial, sans-serif, sans-serif;
  font-size:      11px;
  font-weight:    500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--ink-light);
  margin-top:     6px;
}

/* ── DPP rows ─────────────────────────────────────────────── */
.dpp-row {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         14px 0;
  border-bottom:   1px solid var(--cream-deep);
  animation:       slideRight 0.3s ease both;
}
.dpp-row:last-child { border-bottom: none; }
.dpp-row-meta {
  display:     flex;
  align-items: center;
  gap:         8px;
  margin-top:  4px;
}
.dpp-title {
  font-family: 'Inter', Arial, sans-serif, sans-serif;
  font-size:   13px;
  font-weight: 600;
  color:       var(--ink);
  margin-bottom: 4px;
}

/* ── Completion bar ───────────────────────────────────────── */
.bar-bg   { height: 4px; background: var(--cream-deep); border-radius: 100px; overflow: hidden; width: 64px; }
.bar-fill { height: 100%; background: var(--sage); border-radius: 100px; transition: width 1s cubic-bezier(.2,.8,.3,1); }

/* ── Question type cards ──────────────────────────────────── */
.qtype-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   14px;
}
.qtype-card {
  background:     white;
  border-radius:  var(--r-xl);
  border:         1.5px solid var(--cream-border);
  padding:        20px;
  cursor:         pointer;
  transition:     border-color 0.2s, transform 0.18s, box-shadow 0.18s;
  position:       relative;
  overflow:       hidden;
}
.qtype-card:hover {
  border-color: var(--ink-ghost);
  transform:    translateY(-2px);
  box-shadow:   0 8px 24px rgba(26,24,20,0.08);
}
.qtype-card.featured { background: var(--ink); border-color: var(--ink); }
.qtype-icon  { font-size: 22px; margin-bottom: 10px; }
.qtype-name  { font-family: 'Inter', Arial, sans-serif, sans-serif; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.qtype-desc  { font-family: 'Newsreader', serif; font-size: 12px; color: var(--ink-light); }
.qtype-auto  {
  position:       absolute;
  top:            12px;
  right:          12px;
  font-family:    'DM Mono', monospace;
  font-size:      9px;
  font-weight:    500;
  letter-spacing: 0.06em;
  color:          var(--sage);
}
.qtype-card.featured .qtype-auto { color: rgba(168,212,160,0.9); }
.qtype-card.featured .qtype-name { color: var(--cream); }
.qtype-card.featured .qtype-desc { color: rgba(245,241,234,0.6); }
.qtype-card.featured .qtype-icon { color: var(--cream); }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position:        fixed;
  inset:           0;
  background:      rgba(26,24,20,0.5);
  display:         flex;
  align-items:     center;
  justify-content: center;
  z-index:         100;
  animation:       fadeIn 0.2s ease;
  padding:         20px;
}
.modal-box {
  background:    var(--cream);
  border-radius: var(--r-xl);
  border:        1px solid var(--cream-border);
  padding:       32px;
  width:         100%;
  max-width:     480px;
  animation:     fadeUp 0.3s cubic-bezier(.2,.8,.3,1) both;
  position:      relative;
}
.modal-header {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  margin-bottom:   24px;
}
.modal-title { font-family: 'Inter', Arial, sans-serif, sans-serif; font-size: 18px; font-weight: 700; }
.modal-close {
  background:    none;
  border:        none;
  cursor:        pointer;
  font-size:     18px;
  color:         var(--ink-light);
  line-height:   1;
  padding:       4px;
  transition:    color 0.2s;
}
.modal-close:hover { color: var(--ink); }

/* ── Login / Auth pages ───────────────────────────────────── */
.auth-wrap {
  min-height:      100vh;
  display:         flex;
}
.auth-left {
  flex:            1;
  display:         flex;
  flex-direction:  column;
  padding:         48px 56px;
  max-width:       580px;
}
.auth-right {
  flex:            1;
  background:      var(--ink);
  position:        relative;
  display:         flex;
  align-items:     center;
  justify-content: center;
  overflow:        hidden;
}
.auth-grid {
  position:         absolute;
  inset:            0;
  opacity:          0.06;
  background-image: linear-gradient(var(--cream) 1px,transparent 1px),
                    linear-gradient(90deg,var(--cream) 1px,transparent 1px);
  background-size:  48px 48px;
}
.auth-preview {
  position:  relative;
  z-index:   1;
  padding:   48px;
  max-width: 420px;
}
.auth-center {
  min-height:      100vh;
  display:         flex;
  align-items:     center;
  justify-content: center;
  padding:         24px;
}

/* ── Progress dots (onboarding) ───────────────────────────── */
.progress-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 24px; }
.progress-dot  { width: 6px; height: 6px; border-radius: 50%; background: var(--cream-border); transition: background 0.3s; }
.progress-dot.active { background: var(--ink); }

/* ── Q-type pill selectors ────────────────────────────────── */
.qtype-pill {
  padding:        7px 16px;
  font-family:    'Inter', Arial, sans-serif, sans-serif;
  font-size:      12px;
  font-weight:    600;
  border-radius:  var(--r-lg);
  cursor:         pointer;
  border:         1px solid var(--cream-border);
  background:     white;
  color:          var(--ink-mid);
  transition:     all 0.15s;
}
.qtype-pill.sel { border: none; background: var(--ink); color: var(--cream); }

/* ── My DPPs page table ───────────────────────────────────── */
.dpps-table { width: 100%; border-collapse: collapse; }
.dpps-table th {
  font-family:    'Inter', Arial, sans-serif, sans-serif;
  font-size:      10px;
  font-weight:    600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--ink-light);
  padding:        0 0 12px;
  text-align:     left;
  border-bottom:  1px solid var(--cream-border);
}
.dpps-table td {
  padding:       14px 0;
  border-bottom: 1px solid var(--cream-deep);
  vertical-align: middle;
}
.dpps-table tr:last-child td { border-bottom: none; }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align:  center;
  padding:     60px 24px;
  color:       var(--ink-light);
  font-family: 'Newsreader', serif;
  font-size:   16px;
  font-style:  italic;
}
.empty-icon { font-size: 36px; margin-bottom: 16px; opacity: 0.4; }

/* ── Loading screen ───────────────────────────────────────── */
.loading-screen {
  min-height:      100vh;
  display:         flex;
  align-items:     center;
  justify-content: center;
  flex-direction:  column;
  gap:             16px;
  background:      var(--cream);
}
.loading-dots { display: flex; gap: 6px; }
.loading-dot  {
  width:        5px;
  height:       5px;
  border-radius:50%;
  background:   var(--ink-ghost);
}
.loading-dot:nth-child(1) { animation: pulse 1.2s 0.0s ease-in-out infinite; }
.loading-dot:nth-child(2) { animation: pulse 1.2s 0.2s ease-in-out infinite; }
.loading-dot:nth-child(3) { animation: pulse 1.2s 0.4s ease-in-out infinite; }

/* ── Today status mini-cards ──────────────────────────────── */
.status-mini {
  flex:          1;
  text-align:    center;
  padding:       14px 10px;
  border-radius: var(--r-lg);
}
.status-num { font-family: 'DM Mono', monospace; font-size: 22px; line-height: 1; }
.status-lbl { font-family: 'Inter', Arial, sans-serif, sans-serif; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar     { width: 60px; padding: 16px 10px; }
  .sidebar .nav-item span:last-child,
  .sidebar .sidebar-logo .logo-text,
  .sidebar .sidebar-footer .footer-text { display: none; }
  .main-content { margin-left: 60px; padding: 24px 20px; }
  .stats-grid   { grid-template-columns: repeat(2, 1fr); }
  .auth-right   { display: none; }
  .auth-left    { max-width: 100%; padding: 32px 24px; }
  .qtype-grid   { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .main-content { padding: 20px 16px; }
  .page-header  { flex-direction: column; gap: 16px; }
}
/* ── Mobile top bar (visible on small screens) ───────────── */
.mobile-topbar {
  display:         none;
  position:        fixed;
  top:             0; left: 0; right: 0;
  height:          56px;
  background:      white;
  border-bottom:   1px solid var(--cream-border);
  padding:         0 16px;
  align-items:     center;
  justify-content: space-between;
  z-index:         200;
}
.mobile-topbar-brand {
  display:     flex;
  align-items: center;
  gap:         8px;
  font-family: 'Inter', Arial, sans-serif, sans-serif;
  font-weight: 700;
  font-size:   14px;
  color:       var(--ink);
}
.hamburger {
  display:         flex;
  flex-direction:  column;
  justify-content: center;
  gap:             5px;
  width:           40px;
  height:          40px;
  border:          none;
  background:      none;
  cursor:          pointer;
  padding:         8px;
  border-radius:   var(--r-lg);
  transition:      background 0.15s;
}
.hamburger:hover { background: var(--cream-deep); }
.hamburger span {
  display:       block;
  height:        2px;
  width:         100%;
  background:    var(--ink);
  border-radius: 2px;
  transition:    transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Sidebar overlay (mobile drawer) ─────────────────────── */
.sidebar-overlay {
  display:    none;
  position:   fixed;
  inset:      0;
  background: rgba(26,24,20,0.5);
  backdrop-filter: blur(2px);
  z-index:    150;
  animation:  fadeIn 0.2s ease;
}
.sidebar-overlay.show, .sidebar-overlay.open { display: block !important; }

/* ── Full mobile & tablet drawer (screens <= 768px) ────────────────── */
@media (max-width: 768px) {
  .mobile-topbar { display: flex !important; }

  .sidebar {
    position:   fixed !important;
    top:        0 !important; left: 0 !important; bottom: 0 !important;
    width:      260px !important;
    padding:    72px 16px 24px !important;
    transform:  translateX(-100%);
    transition: transform 0.28s cubic-bezier(.2,.8,.3,1);
    z-index:    160;
    box-shadow: 4px 0 24px rgba(26,24,20,0.12);
  }
  .sidebar.open { transform: translateX(0) !important; visibility: visible !important; opacity: 1 !important; }

  .sidebar .nav-item span:last-child,
  .sidebar .sidebar-logo .logo-text,
  .sidebar .sidebar-footer .footer-text { display: block !important; }

  .nav-item { padding: 12px 16px; font-size: 14px; }
  .nav-item .icon { font-size: 16px; width: 20px; }

  .main-content {
    margin-left: 0 !important;
    padding:     72px 16px 24px !important;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .page-title  { font-size: 22px; }
  .btn-primary, .btn-outline { width: 100%; justify-content: center; }
  .qtype-grid { grid-template-columns: 1fr 1fr; }
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 520px; }
  .card { padding: 18px; }
  .card-sm { padding: 14px 16px; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    border-radius: var(--r-xl) var(--r-xl) 0 0 !important;
    padding:       28px 20px 36px !important;
    max-width:     100% !important;
    animation:     slideUp 0.3s cubic-bezier(.2,.8,.3,1) both !important;
  }
  @keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  .auth-right { display: none !important; }
  .auth-left  { max-width: 100% !important; padding: 24px 20px !important; }
  .input-field, .select-field { padding: 14px 16px; font-size: 16px; }
  .dpp-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* ── Submit bar mobile fix ────────────────────────────────── */
@media (max-width: 480px) {
  .submit-bar, .sub-bar {
    left: 0 !important;
    padding: 12px 16px !important;
    flex-wrap: wrap;
    gap: 10px;
  }
  .submit-bar .btn-primary,
  .submit-bar .btn-outline,
  .sub-bar .btn-primary,
  .sub-bar .btn-outline {
    flex: 1;
  }
  /* Header card grids go single-column */
  .header-grid   { grid-template-columns: 1fr !important; }
  .header-grid-3 { grid-template-columns: 1fr 1fr !important; }
  /* Q-meta row: 2 cols then 1 */
  .q-meta-row { grid-template-columns: 1fr 1fr !important; }
  /* AR grid single column */
  .ar-grid { grid-template-columns: 1fr !important; }
  /* Q-type tabs wrap nicely */
  .q-type-tabs { gap: 4px; }
  .qt-tab { padding: 4px 10px; font-size: 11px; }
  /* Form page padding */
  .form-page { padding: 0 0 100px !important; }
  /* DPP header card padding */
  .dpp-header-card { padding: 20px !important; }
}

/* ── Dashboard / Analytics mobile responsive fixes ─────────────── */
@media (max-width: 700px) {
  /* Dashboard 2-col main grid → stack */
  .dash-main-grid { grid-template-columns: 1fr !important; }
  /* Analytics 2-col grid → stack */
  .analytics-grid { grid-template-columns: 1fr !important; }
  /* Content overview 4-col → 2-col */
  .content-overview-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 480px) {
  /* Dashboard/analytics inline grids (not class-based, targeted via data attr) */
  [data-mg] { grid-template-columns: 1fr !important; }
  /* DPP list row → column on mobile */
  .dpp-list-row { flex-direction: column !important; align-items: flex-start !important; }
  /* community-bans table → scrollable */
  .bans-table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
  /* Analytics card grid 4-col → 2-col */
  .analytics-4 { grid-template-columns: 1fr 1fr !important; }
}

/* Comprehensive Mobile Responsiveness Enhancements */
@media (max-width: 640px) {
  .glass-table th, .glass-table td { padding: 10px 12px; font-size: 13px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stat-number { font-size: 24px !important; }
  .stat-label { font-size: 11px !important; }
  .filter-select, .input-field, #searchInput { font-size: 16px !important; min-height: 44px; }
  .tab-btn { font-size: 11px !important; padding: 6px 12px !important; flex-shrink: 0; }
  div[style*="display: flex; gap: 10px; border-bottom"] { overflow-x: auto !important; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; }
}
