/* ═══════════════════════════════════════════════════════════════
   DASHBOARD.CSS
   Page-specific styles for the student dashboard (topbar, profile
   banner, stats, activity tabs, quiz history, cart widget, streak,
   edit-profile modal, checkout modal, etc).

   REQUIRES styles.css to be loaded FIRST. This file omits anything
   that was an exact (or value-equivalent) duplicate of styles.css:
   the reset, html/body/a/img/button base rules, and the ENTIRE
   header/nav component — .nav-inner, .nav-logo*, .nav-search-*,
   .nav-links, .nav-link*, .nav-btn*, .nav-bell*, .notif-*,
   .nav-user-*, .nav-avatar*, .nav-dropdown-*, .mobile-bottom-nav,
   .mbn-*, and the slideDown dropdown-open animation trigger — all
   of that already exists in styles.css and needs no re-declaration.

   The one real header difference is called out below.
═══════════════════════════════════════════════════════════════ */

:root {
  /* New tokens — not present in styles.css */
  --purple:       #7C3AED;
  --purple-light: #F5F3FF;
  --danger-light: #FEF2F2;
  --shadow:       0 2px 12px rgba(37,99,235,0.08);

  /* Values differ from styles.css's token of the same name, so kept
     as page-local overrides (used by the new dashboard components
     below, e.g. .activity-cat, .feed-icon--green, .checkout-state) */
  --green-light: #ECFDF5;  /* styles.css: #D1FAE5 */
  --amber-light: #FFFBEB;  /* styles.css: #FEF3C7 */
  --radius-lg:   16px;     /* styles.css: 18px */

  /* Alias: same 12px value as styles.css's --radius-md, kept under
     the shorter name this file's rules already use */
  --radius: var(--radius-md);

  /* --blue, --blue-dark, --blue-light, --blue-mid, --green,
     --green-dark, --amber, --ink, --ink-2, --ink-3, --muted,
     --muted-2, --border, --surface, --white, --danger, --nav-h,
     --topbar-h, --shadow-sm, --shadow-md, --font-sans,
     --font-display are used directly from styles.css's :root. */
}

/* Only the differences from styles.css's body — background and text
   color are darker/cooler on this page, plus a min-height so short
   dashboards don't clip. font-family/line-height/font-smoothing are
   unchanged and inherited from styles.css's body rule. */
body {
  background: var(--surface);
  color: var(--ink-2);
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; }

/* ── Auth loader ── */
.auth-loader { position: fixed; inset: 0; background: var(--surface); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.auth-loader.hide { display: none; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════════════════
   TOP ANNOUNCEMENT BAR
   New — styles.css only reserves the --topbar-h token, it doesn't
   define this component.
════════════════════════════════════════════════════════ */
#edukated-topbar {
  background: linear-gradient(90deg, var(--blue) 0%, #1E40AF 100%);
  color: white; font-size: 0.78rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 16px; height: var(--topbar-h); position: relative; z-index: 1001;
}
#edukated-topbar a { color: #BAE6FD; text-decoration: underline; text-underline-offset: 2px; }
#edukated-topbar a:hover { color: white; }
#topbarClose {
  position: absolute; right: 16px; background: none; border: none; color: rgba(255,255,255,.7);
  font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 4px; transition: color .15s;
}
#topbarClose:hover { color: white; }

/* ════════════════════════════════════════════════════════
   MAIN NAVBAR — override only
   styles.css defines #edukated-header as position: fixed. This page
   needs position: sticky instead, so the header sits in normal flow
   directly under #edukated-topbar (which isn't fixed/sticky) and
   only sticks to the viewport top once you scroll past the topbar.
   Everything else (background, border, box-shadow, z-index) is
   identical to styles.css and is inherited, not redeclared.

   IMPORTANT: this sticky/fixed split is per-page, on purpose — pages
   with a topbar need sticky; pages without one should keep styles.css's
   fixed version. Mixing them (sticky header + styles.css's fixed-header
   .page-wrapper padding, or the reverse) is exactly the kind of thing
   that produces a stray gap around the header, so don't load this
   override on a page that doesn't also have #edukated-topbar.
════════════════════════════════════════════════════════ */
#edukated-header { position: sticky; top: 0; }

/* ════════════════════════════════════════════════════════
   PAGE LAYOUT
════════════════════════════════════════════════════════ */
.dash-wrap { max-width: 1200px; margin: 0 auto; padding: 28px 20px 40px; }

/* ── Profile banner ── */
.profile-banner {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 55%, #1E1B4B 100%);
  border-radius: var(--radius-lg); padding: 26px 30px; display: flex; align-items: center; gap: 22px;
  margin-bottom: 22px; position: relative; overflow: hidden;
}
.profile-banner::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%232563EB' fill-opacity='0.07'%3E%3Ccircle cx='20' cy='20' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.profile-avatar-lg {
  width: 76px; height: 76px; border-radius: 50%; background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800;
  color: white; flex-shrink: 0; overflow: visible; border: 3px solid rgba(255,255,255,.2); position: relative; z-index: 3;
}
.profile-avatar-lg img.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; position: absolute; inset: 0; }
.avatar-camera-btn {
  position: absolute; bottom: -2px; right: -2px; width: 26px; height: 26px; border-radius: 50%; overflow: hidden;
  background: var(--blue); color: #fff; border: 2.5px solid #fff; display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s; z-index: 5;
}
.avatar-camera-btn:hover { background: var(--blue-dark); transform: scale(1.06); }
.avatar-camera-btn:disabled { background: var(--muted-2); cursor: not-allowed; transform: none; }
.avatar-camera-btn.uploading svg { display: none; }
.avatar-camera-btn.uploading::after { content: ""; width: 12px; height: 12px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }

.profile-info { flex: 1; position: relative; z-index: 1; min-width: 0; }
.profile-name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: white; margin-bottom: 4px; }
.profile-bio-line { font-size: 0.82rem; color: rgba(255,255,255,.7); margin-bottom: 8px; max-width: 520px; }
.profile-meta { font-size: 0.82rem; color: rgba(255,255,255,.65); display: flex; flex-wrap: wrap; gap: 12px; }
.profile-meta-item { display: flex; align-items: center; gap: 5px; }
.profile-actions { display: flex; gap: 10px; flex-shrink: 0; position: relative; z-index: 1; }
.btn-edit-profile {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 9px;
  background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.25); color: white; font-size: 0.84rem; font-weight: 700;
  transition: background .15s;
}
.btn-edit-profile:hover { background: rgba(255,255,255,.22); }

/* ── Stats bar ── */
.stats-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat-card-label { font-size: 0.7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.stat-card-value { font-family: var(--font-display); font-size: 1.45rem; font-weight: 800; color: var(--ink); }
.stat-card--blue   .stat-card-value { color: var(--blue); }
.stat-card--green  .stat-card-value { color: var(--green-dark); }
.stat-card--amber  .stat-card-value { color: var(--amber); }
.stat-card--purple .stat-card-value { color: var(--purple); }

/* ── Grid ── */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.dash-grid > div:first-child { min-width: 0; }
.sidebar-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ── Section card ── */
.section-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.section-card-head { padding: 16px 20px 14px; border-bottom: 1.5px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.section-card-title { font-family: var(--font-display); font-size: 0.95rem; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.section-card-link { font-size: 0.78rem; font-weight: 700; color: var(--blue); background: none; border: none; }
.section-card-link:hover { text-decoration: underline; }

/* ── My Activity tabs (Posts / Comments / Purchases / Saved / Groups) ── */
.tabs { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.tab-btn { flex: 0 0 auto; min-width: 110px; padding: 14px 10px; background: none; border: none; font-weight: 700; font-size: 0.82rem; color: var(--muted-2); white-space: nowrap; border-bottom: 3px solid transparent; transition: color 0.15s, border-color 0.15s; }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-btn .count { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 0.7rem; margin-left: 4px; font-weight: 700; }
.tab-btn.active .count { background: var(--blue-light); color: var(--blue); }
.tab-panels { padding: 18px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.activity-card { border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 12px; transition: box-shadow 0.15s; }
.activity-card:hover { box-shadow: var(--shadow); }
.activity-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.activity-cat { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #047857; background: var(--green-light); padding: 3px 9px; border-radius: 6px; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.activity-time { font-size: 0.76rem; color: var(--muted-2); white-space: nowrap; }
.activity-content { font-size: 0.9rem; color: var(--ink-2); line-height: 1.6; margin-bottom: 10px; white-space: pre-wrap; word-break: break-word; }
.activity-footer { display: flex; align-items: center; gap: 16px; font-size: 0.78rem; color: var(--muted-2); flex-wrap: wrap; }
.activity-footer .actions { margin-left: auto; display: flex; gap: 14px; }
.activity-footer button, .activity-footer a { background: none; border: none; color: var(--muted-2); font-size: 0.78rem; font-weight: 700; }
.activity-footer button:hover, .activity-footer a:hover { color: var(--blue); }
.activity-footer .danger:hover { color: var(--danger); }

.saved-card, .group-card { display: flex; gap: 14px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.saved-thumb, .group-icon { width: 52px; height: 52px; border-radius: 10px; background: var(--blue-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.4rem; color: var(--blue); overflow: hidden; font-weight: 800; font-family: var(--font-display); }
.saved-thumb img { width: 100%; height: 100%; object-fit: cover; }
.saved-info, .group-info { flex: 1; min-width: 0; }
.title-link { color: inherit; text-decoration: none; display: block; }
.title-link:hover h4 { color: var(--blue); text-decoration: underline; }
.saved-info h4, .group-info h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.saved-info p, .group-info p { font-size: 0.78rem; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-actions { display: flex; gap: 10px; flex-shrink: 0; }
.link-btn { font-size: 0.8rem; font-weight: 700; color: var(--blue); background: none; border: none; }
.link-btn.danger { color: var(--danger); }

.state-box { text-align: center; padding: 48px 20px; color: var(--muted-2); }
.state-box .icon { font-size: 2.4rem; margin-bottom: 12px; }
.state-box h4 { font-size: 1rem; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.state-box p { font-size: 0.85rem; margin-bottom: 18px; max-width: 320px; margin-left: auto; margin-right: auto; }
.btn-primary { background: var(--blue); color: #fff; padding: 11px 20px; border-radius: 10px; font-weight: 700; font-size: 0.85rem; border: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn-primary:hover { background: var(--blue-dark); }

/* ── Quiz history ── */
.quiz-result-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); transition: background .12s; }
.quiz-result-item:last-child { border-bottom: none; }
.quiz-result-item:hover { background: var(--surface); }
.quiz-ring { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: conic-gradient(var(--blue) calc(var(--pct, 0) * 1%), var(--border) 0); position: relative; }
.quiz-ring::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; background: white; }
.quiz-ring-text { position: relative; z-index: 1; font-family: var(--font-display); font-size: 0.68rem; font-weight: 800; color: var(--ink); }
.quiz-result-info { flex: 1; min-width: 0; }
.quiz-result-title { font-size: 0.88rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quiz-result-meta { font-size: 0.73rem; color: var(--muted-2); margin-top: 2px; }
.quiz-score-badge { font-family: var(--font-display); font-size: 0.85rem; font-weight: 800; flex-shrink: 0; }
.score--high { color: var(--green-dark); }
.score--mid  { color: var(--amber); }
.score--low  { color: var(--danger); }

/* ── Recent activity feed ── */
.feed-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.feed-icon--blue   { background: var(--blue-light); }
.feed-icon--green  { background: var(--green-light); }
.feed-icon--purple { background: var(--purple-light); }
.feed-body { flex: 1; }
.feed-text { font-size: 0.84rem; color: var(--ink-2); line-height: 1.45; }
.feed-time { font-size: 0.72rem; color: var(--muted-2); margin-top: 3px; }

/* ── Cart widget ── */
.cart-widget { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.cart-widget-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cart-widget-title { font-family: var(--font-display); font-size: 0.92rem; font-weight: 800; display: flex; align-items: center; gap: 7px; }
.cart-widget-count { background: var(--blue-light); color: var(--blue); font-size: 0.74rem; font-weight: 800; padding: 2px 10px; border-radius: 20px; white-space: nowrap; }
.cart-widget-empty { font-size: 0.82rem; color: var(--muted-2); margin-bottom: 14px; line-height: 1.6; }
.cart-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-item:last-of-type { border-bottom: none; }
.cart-item-thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--blue-light); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; overflow: hidden; }
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h5 { font-size: 0.82rem; font-weight: 700; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 2px; }
.cart-item-info span { font-size: 0.76rem; color: var(--muted-2); }
.cart-item-remove { background: none; border: none; color: var(--muted-2); padding: 4px; border-radius: 6px; font-size: 1rem; line-height: 1; flex-shrink: 0; transition: color .15s, background .15s; }
.cart-item-remove:hover { color: var(--danger); background: var(--danger-light); }
.cart-divider { height: 1px; background: var(--border); margin: 12px 0; }
.cart-total-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.cart-total-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.cart-total-amt { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.btn-checkout { display: block; text-align: center; width: 100%; padding: 11px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 700; font-size: 0.85rem; border: none; transition: background .15s; margin-bottom: 8px; }
.btn-checkout:hover { background: var(--blue-dark); }
.btn-checkout:disabled { background: var(--muted-2); cursor: not-allowed; }
.btn-clear-cart { display: block; text-align: center; width: 100%; padding: 9px; border-radius: 10px; background: none; color: var(--muted); font-size: 0.8rem; font-weight: 600; border: 1.5px solid var(--border); transition: border-color .15s, color .15s; }
.btn-clear-cart:hover { border-color: var(--danger); color: var(--danger); }
.btn-browse { display: block; text-align: center; width: 100%; padding: 10px; border-radius: 10px; background: var(--surface); color: var(--muted); border: 1.5px solid var(--border); font-weight: 700; font-size: 0.85rem; text-decoration: none; transition: background .15s, color .15s; }
.btn-browse:hover { background: var(--border); color: var(--ink-2); }

/* ── Streak card ── */
.streak-card { background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%); border-radius: var(--radius); padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.streak-fire { font-size: 2rem; flex-shrink: 0; }
.streak-info { flex: 1; }
.streak-num { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: white; }
.streak-label { font-size: 0.78rem; color: rgba(255,255,255,.8); font-weight: 600; }
.streak-days { display: flex; gap: 5px; margin-top: 8px; }
.streak-day { width: 26px; height: 26px; border-radius: 5px; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 700; color: rgba(255,255,255,.7); }
.streak-day.done { background: rgba(255,255,255,.9); color: #92400E; }
.streak-day.today { background: white; color: #92400E; outline: 2px solid white; }

/* ── Progress ring ── */
.progress-ring-wrap { padding: 20px; text-align: center; }
.big-ring { width: 130px; height: 130px; border-radius: 50%; margin: 0 auto 14px; background: conic-gradient(var(--blue) calc(var(--pct, 0) * 1%), var(--border) 0); position: relative; display: flex; align-items: center; justify-content: center; }
.big-ring::before { content: ''; position: absolute; inset: 14px; border-radius: 50%; background: white; }
.big-ring-inner { position: relative; z-index: 1; }
.big-ring-pct { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--ink); line-height: 1; }
.big-ring-label { font-size: 0.68rem; color: var(--muted); font-weight: 600; }
.progress-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.progress-stat { text-align: center; }
.progress-stat-num { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--ink); }
.progress-stat-label { font-size: 0.66rem; color: var(--muted-2); font-weight: 600; margin-top: 1px; }

/* ── Competitions ── */
.upcoming-item { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--border); }
.upcoming-item:last-child { border-bottom: none; }
.upcoming-date { width: 44px; height: 44px; border-radius: 10px; background: var(--blue-light); flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.upcoming-date-day { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--blue); line-height: 1; }
.upcoming-date-mo  { font-size: 0.6rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.upcoming-info { flex: 1; min-width: 0; }
.upcoming-title { font-size: 0.84rem; font-weight: 700; color: var(--ink); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-sub   { font-size: 0.72rem; color: var(--muted-2); }
.upcoming-join { padding: 6px 12px; border-radius: 7px; background: var(--blue); color: white; font-size: 0.74rem; font-weight: 700; border: none; transition: background .15s; flex-shrink: 0; }
.upcoming-join:hover { background: var(--blue-dark); }

/* ── My Subjects pills ── */
.subject-pill { display: inline-block; padding: 5px 12px; background: var(--blue-light); color: var(--blue); border-radius: 99px; font-size: 0.78rem; font-weight: 700; }

/* ── Empty state (mini) ── */
.empty-state { text-align: center; padding: 36px 20px; color: var(--muted-2); }
.empty-state-icon { font-size: 2.1rem; margin-bottom: 10px; }
.empty-state h4 { font-size: 0.9rem; font-weight: 700; color: var(--ink-3); margin-bottom: 5px; }
.empty-state p { font-size: 0.8rem; }

/* ════════════════════════════════════════════════════════
   MODALS — shared overlay
════════════════════════════════════════════════════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.55); display: none; align-items: center; justify-content: center; z-index: 3000; padding: 16px; }
.modal-overlay.show { display: flex; }

/* Edit Profile modal box */
.modal-box { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; border-bottom: 1.5px solid var(--border); position: sticky; top: 0; background: white; z-index: 1; }
.modal-title { font-family: var(--font-display); font-size: 1rem; font-weight: 800; color: var(--ink); }
.modal-close { background: none; border: none; font-size: 1.1rem; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--surface); }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1.5px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--ink-3); margin-bottom: 6px; }
.form-input, .form-select, textarea.form-input { width: 100%; height: 42px; padding: 0 12px; border: 1.5px solid var(--border); border-radius: 9px; font-family: var(--font-sans); font-size: 0.86rem; color: var(--ink); background: white; outline: none; transition: border-color .15s, box-shadow .15s; appearance: none; }
textarea.form-input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.form-input:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-hint { font-size: 0.74rem; color: var(--muted-2); margin-top: 4px; text-align: right; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 20px; border-radius: 9px; font-size: 0.86rem; font-weight: 700; border: none; transition: background .15s; }
.btn-primary-modal { background: var(--blue); color: white; }
.btn-primary-modal:hover { background: var(--blue-dark); }
.btn-ghost { background: var(--surface); color: var(--muted); border: 1.5px solid var(--border); }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink-2); }
.avatar-upload-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.avatar-preview { width: 68px; height: 68px; border-radius: 50%; background: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: white; overflow: hidden; flex-shrink: 0; }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-upload-btn { display: inline-block; padding: 7px 14px; border: 1.5px dashed var(--blue-mid); border-radius: 8px; background: var(--blue-light); color: var(--blue); font-size: 0.78rem; font-weight: 700; transition: background .15s; }
.avatar-upload-btn:hover { background: var(--blue-mid); }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.84rem; font-weight: 500; margin-bottom: 16px; display: none; align-items: flex-start; gap: 10px; }
.alert.show { display: flex; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

/* Checkout modal (distinct box style, reuses .modal-overlay) */
.checkout-modal .modal-card { background: #fff; border-radius: 14px; max-width: 460px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 28px; }
.checkout-modal .modal-card h2 { font-size: 1.3rem; font-weight: 800; margin-bottom: 18px; }
.checkout-step { display: none; }
.checkout-step.active { display: block; }
.checkout-summary-list { max-height: 220px; overflow-y: auto; margin-bottom: 4px; }
.checkout-summary-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.checkout-summary-row:last-child { border-bottom: none; }
.checkout-summary-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 600; }
.checkout-summary-row .price { color: var(--muted); white-space: nowrap; font-weight: 600; }
.checkout-grand-total { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1.5px solid var(--border); margin-top: 8px; margin-bottom: 18px; }
.checkout-grand-total .lbl { font-size: 0.9rem; font-weight: 700; color: var(--ink-2); }
.checkout-grand-total .amt { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.checkout-state { text-align: center; padding: 30px 10px; }
.checkout-state .icon-circle { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.checkout-state.success .icon-circle { background: var(--green-light); color: #047857; }
.checkout-state.error .icon-circle { background: #FEE2E2; color: #B91C1C; }
.checkout-state h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 6px; }
.checkout-state p { font-size: 0.86rem; color: var(--muted); margin-bottom: 18px; }
.checkout-state .ref { font-size: 0.76rem; color: var(--muted-2); margin-top: -10px; margin-bottom: 18px; word-break: break-all; }
.btn-submit { flex: 1; padding: 13px; background: var(--blue); color: #fff; border: none; border-radius: 10px; font-size: 0.92rem; font-weight: 700; position: relative; overflow: hidden; }
.btn-submit:hover { background: var(--blue-dark); }
.btn-submit.loading { pointer-events: none; }
.btn-submit .btn-text { transition: opacity 0.2s; }
.btn-submit.loading .btn-text { opacity: 0; }
.btn-spinner { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn-submit.loading .btn-spinner { display: block; }
.btn-back { flex: 1; padding: 12px; background: transparent; color: var(--muted); border: 1.5px solid var(--border); border-radius: 10px; font-size: 0.9rem; font-weight: 600; transition: border-color 0.15s; }
.btn-back:hover { border-color: var(--ink-2); color: var(--ink-2); }

/* ════════════════════════════════════════════════════════
   RESPONSIVE — only the rules not already in styles.css.
   (styles.css's 900px/640px breakpoints already handle
   .nav-search-wrap, .nav-links, #navRegisterBtn, #navLoginBtn,
   .mobile-bottom-nav, and .nav-actions for this page too.)
════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dash-wrap { padding-bottom: 90px; }
  .profile-banner { flex-direction: column; text-align: center; padding: 22px 20px; }
  .profile-meta { justify-content: center; }
  .profile-actions { justify-content: center; }
}
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .modal-box { max-width: 100%; }
}
