/* ── Variables ────────────────────────────────── */
:root {
  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;
  --surface-3:    #e9eef5;
  --border:       #e2e8f0;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --text-xmuted:  #94a3b8;
  --primary:      #6366f1;
  --primary-h:    #4f46e5;
  --primary-bg:   #eef2ff;
  --danger:       #ef4444;
  --danger-h:     #dc2626;
  --danger-bg:    #fef2f2;
  --success:      #10b981;
  --success-bg:   #ecfdf5;
  --warning:      #f59e0b;
  --warning-bg:   #fffbeb;
  --radius:       8px;
  --radius-lg:    14px;
  --radius-xl:    20px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.1);
  --shadow:       0 2px 8px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.1);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.08);
  --nav-h:        60px;
  --transition:   0.18s ease;
}

[data-theme="dark"] {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --surface-2:    #162032;
  --surface-3:    #243044;
  --border:       #334155;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --text-xmuted:  #64748b;
  --primary:      #818cf8;
  --primary-h:    #6366f1;
  --primary-bg:   #1e1b4b;
  --danger:       #f87171;
  --danger-h:     #ef4444;
  --danger-bg:    #1f0a0a;
  --success:      #34d399;
  --success-bg:   #022c22;
  --warning:      #fbbf24;
  --warning-bg:   #1c1200;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.4);
  --shadow:       0 4px 12px rgba(0,0,0,.4);
  --shadow-lg:    0 12px 32px rgba(0,0,0,.5);
}

/* Transparent — for dark host backgrounds (white text & lines) */
[data-theme="transparent-dark"] {
  --bg:           transparent;
  --surface:      transparent;
  --surface-2:    rgba(255,255,255,.04);
  --surface-3:    rgba(255,255,255,.08);
  --border:       rgba(255,255,255,.18);
  --text:         #f0f0f0;
  --text-muted:   rgba(255,255,255,.6);
  --text-xmuted:  rgba(255,255,255,.35);
  --primary:      #818cf8;
  --primary-h:    #6366f1;
  --primary-bg:   rgba(129,140,248,.15);
  --danger:       #f87171;
  --danger-h:     #ef4444;
  --danger-bg:    rgba(248,113,113,.15);
  --success:      #34d399;
  --success-bg:   rgba(52,211,153,.12);
  --warning:      #fbbf24;
  --warning-bg:   rgba(251,191,36,.12);
  --shadow-sm:    none;
  --shadow:       none;
  --shadow-lg:    none;
}

/* Transparent — for light host backgrounds (black text & lines) */
[data-theme="transparent-light"] {
  --bg:           transparent;
  --surface:      transparent;
  --surface-2:    rgba(0,0,0,.03);
  --surface-3:    rgba(0,0,0,.06);
  --border:       rgba(0,0,0,.12);
  --text:         #111111;
  --text-muted:   rgba(0,0,0,.5);
  --text-xmuted:  rgba(0,0,0,.3);
  --primary:      #6366f1;
  --primary-h:    #4f46e5;
  --primary-bg:   rgba(99,102,241,.1);
  --danger:       #ef4444;
  --danger-h:     #dc2626;
  --danger-bg:    rgba(239,68,68,.1);
  --success:      #10b981;
  --success-bg:   rgba(16,185,129,.1);
  --warning:      #f59e0b;
  --warning-bg:   rgba(245,158,11,.1);
  --shadow-sm:    none;
  --shadow:       none;
  --shadow-lg:    none;
}

/* ── Reset ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background var(--transition), color var(--transition);
  padding-top: var(--nav-h);
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
ul, ol { list-style: none; }

/* ── Navbar ───────────────────────────────────── */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.nav-brand {
  font-size: 1.2rem; font-weight: 700;
  color: var(--primary); text-decoration: none;
  letter-spacing: -0.5px; margin-right: auto;
}
.nav-brand:hover { text-decoration: none; opacity: .85; }
.nav-menu {
  display: flex; align-items: center; gap: 4px;
}
.nav-link {
  padding: 6px 12px; border-radius: var(--radius);
  color: var(--text-muted); font-size: .9rem; font-weight: 500;
  text-decoration: none; display: flex; align-items: center; gap: 6px;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav-link-admin { color: var(--primary); }
.nav-link-muted { color: var(--text-xmuted); }
.nav-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700;
}
.theme-toggle {
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: var(--radius);
  color: var(--text-muted); display: flex; align-items: center;
  transition: background var(--transition), color var(--transition);
}
.theme-toggle:hover { background: var(--surface-3); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ── Layout ───────────────────────────────────── */
.main-wrap {
  max-width: 1200px; margin: 0 auto;
  padding: 24px 16px 80px;
  min-height: calc(100vh - var(--nav-h));
}
.container { max-width: 640px; margin: 0 auto; }
.container-wide { max-width: 900px; margin: 0 auto; }
.site-footer {
  text-align: center; padding: 20px;
  color: var(--text-xmuted); font-size: .85rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── Page header ──────────────────────────────── */
.page-header {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 12px; margin-bottom: 24px;
}
.page-header h1 { font-size: 1.6rem; font-weight: 700; flex: 1; }
.page-header .page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb {
  font-size: .875rem; color: var(--text-muted); margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span::before { content: ' / '; padding: 0 4px; color: var(--border); }

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius); font-weight: 600;
  font-size: .9rem; cursor: pointer; border: none; text-decoration: none;
  transition: background var(--transition), opacity var(--transition), transform .1s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: .9; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-h); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn svg { width: 16px; height: 16px; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }

/* ── Forms ────────────────────────────────────── */
.form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow);
}
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label, .form-label {
  display: block; font-size: .875rem; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.form-hint { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.form-textarea { resize: vertical; min-height: 90px; }
.form-check {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: .9rem;
}
.form-check input[type="checkbox"] {
  width: 18px; height: 18px; border-radius: 4px;
  accent-color: var(--primary); cursor: pointer;
}
.form-error { color: var(--danger); font-size: .8rem; margin-top: 4px; }

/* Color swatches */
.color-swatches {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.color-swatch {
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; position: relative;
  border: 3px solid transparent;
  transition: transform .15s, border-color .15s;
}
.color-swatch input[type="radio"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.color-swatch.selected,
.color-swatch:has(input:checked) {
  border-color: var(--text);
  transform: scale(1.15);
}

/* ── Cards / Grid ─────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); }
.card-link { text-decoration: none; color: inherit; display: block; }
.card-link:hover { text-decoration: none; transform: translateY(-2px); }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.card-header {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px;
}
.card-dot {
  width: 14px; height: 14px; border-radius: 50%;
  flex-shrink: 0; margin-top: 3px;
}
.card-title { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.card-desc { font-size: .875rem; color: var(--text-muted); margin-bottom: 12px; }
.card-meta { font-size: .8rem; color: var(--text-xmuted); }
.card-actions {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; opacity: .4; margin-bottom: 16px; }
.empty-state h2 { font-size: 1.2rem; margin-bottom: 8px; }

/* ── Alerts ───────────────────────────────────── */
.alert {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 20px; font-size: .9rem;
  border: 1px solid transparent;
}
.alert-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; margin-left: auto; opacity: .6; color: inherit;
}
.alert-close:hover { opacity: 1; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: currentColor; }
.alert-error   { background: var(--danger-bg);  color: var(--danger);  border-color: currentColor; }
.alert-info    { background: var(--primary-bg); color: var(--primary); border-color: currentColor; }
.alert-warning { background: var(--warning-bg); color: var(--warning); border-color: currentColor; }

/* ── Auth pages ───────────────────────────────── */
.auth-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - var(--nav-h) - 60px);
  padding: 20px;
}
.auth-box {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 36px;
  box-shadow: var(--shadow-lg);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo a {
  font-size: 1.5rem; font-weight: 800;
  color: var(--primary); text-decoration: none;
}
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.auth-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .875rem; color: var(--text-muted); }
.auth-divider {
  text-align: center; position: relative;
  color: var(--text-xmuted); font-size: .8rem; margin: 20px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%;
  width: 42%; height: 1px; background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ── Calendar view ────────────────────────────── */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-month-label {
  font-size: 1.15rem; font-weight: 700;
  min-width: 160px; text-align: center;
}
.cal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-grid {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.cal-day-headers {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--surface-2);
}
.cal-day-name {
  text-align: center; padding: 10px 4px;
  font-size: .75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); border-right: 1px solid var(--border);
}
.cal-day-name:last-child { border-right: none; }
.cal-cells {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: var(--border); gap: 1px;
}
.cal-cell {
  background: var(--surface); min-height: 110px;
  padding: 6px; position: relative;
  overflow: hidden;
}
.cal-cell.other-month { background: var(--surface-2); }
.cal-cell.today .cal-day-num {
  background: var(--primary); color: #fff;
  border-radius: 50%; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.cal-day-num {
  font-size: .8rem; font-weight: 600; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px; color: var(--text);
  transition: background var(--transition);
  cursor: default;
}
.other-month .cal-day-num { color: var(--text-xmuted); }
.cal-add-btn {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: none; border: none; cursor: pointer;
  color: var(--text-xmuted); font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
  opacity: 0;
}
.cal-cell:hover .cal-add-btn { opacity: 1; }
.cal-add-btn:hover { background: var(--primary); color: #fff; }
.event-chip {
  display: block; font-size: .7rem; font-weight: 600;
  padding: 2px 7px; border-radius: 4px; margin-bottom: 2px;
  color: #fff; cursor: pointer; text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: opacity var(--transition);
}
.event-chip:hover { opacity: .85; text-decoration: none; color: #fff; }
.event-chip.all-day { border-radius: 0; padding: 2px 5px; }
.event-dots { display: flex; gap: 4px; flex-wrap: wrap; padding: 2px 0; }
.event-dot {
  width: 8px; height: 8px; border-radius: 50; display: block;
}
.cal-more {
  font-size: .65rem; color: var(--text-muted); cursor: pointer;
  padding: 1px 4px; font-weight: 600;
}
.cal-more:hover { color: var(--primary); }

/* ── Event view / detail ──────────────────────── */
.event-detail {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow);
}
.event-detail-banner {
  height: 8px;
}
.event-detail-body { padding: 24px; }
.event-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 16px; }
.event-meta-row {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 12px; font-size: .9rem;
}
.event-meta-icon { color: var(--text-muted); flex-shrink: 0; width: 20px; height: 20px; }
.event-meta-row a { color: var(--primary); word-break: break-all; }
.event-section-title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: var(--text-muted); margin: 20px 0 8px;
}
.link-list { display: flex; flex-direction: column; gap: 6px; }
.link-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .875rem;
}
.link-item a { color: var(--primary); word-break: break-all; }

/* Dynamic link rows in form */
.link-row {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px;
}
.link-row .form-input { flex: 1; }
.link-row .btn-remove {
  background: none; border: none; color: var(--danger);
  cursor: pointer; padding: 8px; border-radius: var(--radius);
  font-size: 1.1rem; line-height: 1; flex-shrink: 0;
}
.link-row .btn-remove:hover { background: var(--danger-bg); }
#linkFields { margin-bottom: 8px; }

/* ── Recurrence section ──────────────────────── */
.recurrence-section {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-top: 8px;
}
.recurrence-section.hidden { display: none; }
.weekday-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.weekday-label {
  padding: 5px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); cursor: pointer; font-size: .8rem;
  font-weight: 600; transition: background var(--transition), color var(--transition);
  user-select: none;
}
.weekday-label:has(input:checked) { background: var(--primary); color: #fff; border-color: transparent; }
.weekday-label input { display: none; }

/* ── Embed code box ──────────────────────────── */
.embed-code-wrap { position: relative; }
.embed-code-wrap textarea {
  width: 100%; font-family: monospace; font-size: .8rem;
  resize: none; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; color: var(--text);
}
.embed-copy-btn {
  position: absolute; top: 8px; right: 8px;
}

/* ── Admin / Dash ─────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 4px; }

.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.data-table th {
  background: var(--surface-2); text-align: left;
  padding: 10px 14px; font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .875rem; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table td.nowrap { white-space: nowrap; }
.badge {
  display: inline-flex; padding: 2px 8px; border-radius: 99px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
}
.badge-green  { background: var(--success-bg); color: var(--success); }
.badge-red    { background: var(--danger-bg);  color: var(--danger); }
.badge-blue   { background: var(--primary-bg); color: var(--primary); }
.badge-gray   { background: var(--surface-3);  color: var(--text-muted); }

.dash-nav {
  display: flex; gap: 4px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 8px;
  margin-bottom: 24px;
}
.dash-nav-link {
  padding: 8px 16px; border-radius: var(--radius); font-size: .875rem; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.dash-nav-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.dash-nav-link.active { background: var(--primary); color: #fff; }

/* ── Profile ──────────────────────────────────── */
.profile-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 28px;
}
.profile-avatar {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 700; flex-shrink: 0;
}

/* ── Embed (iframe) styles ────────────────────── */
.embed-body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  padding: 12px;
}
.embed-cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.embed-cal-title { font-weight: 700; font-size: 1rem; }
.embed-nav-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px 10px;
  cursor: pointer; color: var(--text); font-size: .85rem;
  transition: background var(--transition);
}
.embed-nav-btn:hover { background: var(--surface-3); }

/* ── Invite code display ─────────────────────── */
.invite-code-display {
  font-family: monospace; font-size: 1.1rem; font-weight: 700;
  letter-spacing: 2px; color: var(--primary);
  background: var(--primary-bg); padding: 8px 14px;
  border-radius: var(--radius); display: inline-block;
}

/* ── Utilities ────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-xmuted  { color: var(--text-xmuted); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.text-sm      { font-size: .875rem; }
.text-xs      { font-size: .75rem; }
.font-bold    { font-weight: 700; }
.mt-1  { margin-top: 4px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-2  { margin-bottom: 8px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.section-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch;
    padding: 12px; gap: 4px;
    transform: translateY(-110%); opacity: 0;
    transition: transform var(--transition), opacity var(--transition);
    box-shadow: var(--shadow-lg);
    z-index: 99;
  }
  .nav-menu.open { transform: translateY(0); opacity: 1; }
  .nav-link { padding: 10px 14px; }
  .btn-sm.nav-link { justify-content: center; }

  .main-wrap { padding: 16px 12px 60px; }
  .form-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .cal-month-label { min-width: 120px; font-size: 1rem; }

  .cal-cell { min-height: 54px; padding: 3px; }
  .event-chip { display: none; }
  .event-dots { display: flex; }
  .cal-add-btn { opacity: 1; width: 18px; height: 18px; font-size: .85rem; }
  .cal-day-name { font-size: .65rem; padding: 6px 2px; }

  .data-table { font-size: .8rem; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-nav { gap: 2px; }
  .dash-nav-link { padding: 6px 10px; font-size: .8rem; }

  .auth-box { padding: 24px 20px; }
  .form-card { padding: 20px 16px; }
}

@media (min-width: 769px) {
  .event-dots { display: none; }
}

@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .cal-cell { min-height: 44px; }
}
