/* ═══════════════════════════════════════════════════════════════
   Talavietis — Application Design System
   Forest-Green / White / Gold palette, Tabler Icons, Inter font
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ── Alpine.js: hide elements until Alpine has initialised ──── */
[x-cloak] { display: none !important; }

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Brand */
  --navy:        #1B4332;
  --navy-hover:  #2D6A4F;
  --gold:        #C9A84C;
  --gold-light:  #F0C97A;

  /* Surfaces */
  --bg:          #F4F8F5;
  --bg-primary:  #ffffff;
  --bg-secondary:#f9f8f5;
  --bg-info:     #dbeafe;
  --bg-success:  #dcfce7;
  --bg-warning:  #fef9c3;
  --bg-danger:   #fee2e2;

  /* Text */
  --text:        #111827;
  --text-sec:    #6b7280;
  --text-muted:  #9ca3af;
  --text-info:   #1e40af;
  --text-success:#166534;
  --text-warning:#92400e;
  --text-danger: #991b1b;

  /* Borders */
  --border:      #e5e7eb;
  --border-lt:   #f3f4f6;

  /* Layout */
  --sidebar-w:   220px;
  --topbar-h:    52px;

  /* Radii */
  --r-sm: 4px;
  --r:    8px;
  --r-lg: 12px;

  /* Typography */
  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font-family: var(--font); }

/* ════════════════════════════════════════════════════════════
   APP SHELL
   ════════════════════════════════════════════════════════════ */
.app-shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; position: relative; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width .2s ease;   /* smooth desktop collapse */
}

/* ── Collapsed sidebar (desktop/tablet toggle) ─────────────── */
.sb-is-collapsed .sidebar          { width: 64px; }
.sb-is-collapsed .sb-name,
.sb-is-collapsed .sb-sub           { display: none; }
.sb-is-collapsed .sb-section       { display: none; }
.sb-is-collapsed .sb-link          { padding: 10px; justify-content: center; gap: 0; }
.sb-is-collapsed .sb-link span     { display: none; }
.sb-is-collapsed .sb-link i        { font-size: 20px; }
.sb-is-collapsed .sb-badge         { display: none; }
.sb-is-collapsed .sb-user          { padding: 10px; justify-content: center; }
.sb-is-collapsed .sb-uname,
.sb-is-collapsed .sb-urole         { display: none; }
.sb-is-collapsed .sb-logo          { padding: 14px 14px 10px; }
.sb-is-collapsed .sb-monogram      { margin-bottom: 0; }

/* Sidebar toggle button (topbar, desktop/tablet) */
.sb-toggle-btn {
  display: flex;
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-sec); padding: 6px; border-radius: var(--r);
  flex-shrink: 0;
}
.sb-toggle-btn:hover { background: var(--bg-secondary); }
.sb-toggle-btn i { font-size: 20px; }
.sb-logo {
  padding: 18px 16px 14px;
  border-bottom: 0.5px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
.sb-monogram {
  width: 36px;
  height: auto;
  display: block;
  margin-bottom: 8px;
}
.sb-name      { font-size: 13px; color: rgba(255,255,255,.9); font-weight: 500; display: block; }
.sb-sub       { font-size: 11px; color: rgba(255,255,255,.4); }

.sb-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.sb-section {
  font-size: 10px; color: rgba(255,255,255,.3);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 12px 16px 4px;
}
.sb-link {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px;
  color: rgba(255,255,255,.6);
  font-size: 13px;
  text-decoration: none;
  position: relative;
  transition: background .15s, color .15s;
}
.sb-link i { font-size: 16px; flex-shrink: 0; }
.sb-link:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.sb-link.active { background: rgba(200,151,58,.18); color: var(--gold-light); }
.sb-link.active::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gold); border-radius: 0 2px 2px 0;
}
.sb-badge {
  margin-left: auto;
  background: var(--gold); color: var(--navy);
  font-size: 10px; font-weight: 700;
  border-radius: 10px; padding: 1px 6px;
}
.sb-user {
  padding: 12px 16px;
  border-top: 0.5px solid rgba(255,255,255,.1);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  transition: background .15s;
}
.sb-user:hover { background: rgba(255,255,255,.05); }
.sb-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--navy);
  flex-shrink: 0; overflow: hidden;
}
.sb-av img { width: 100%; height: 100%; object-fit: cover; }
.sb-uname { font-size: 12px; color: rgba(255,255,255,.85); font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-urole { font-size: 11px; color: rgba(255,255,255,.38); }

/* ── Main area ─────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; background: var(--bg-primary); overflow: hidden; min-width: 0; }

.topbar {
  border-bottom: 0.5px solid var(--border);
  padding: 0 24px; height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-primary); flex-shrink: 0;
}
.topbar-title { font-size: 15px; font-weight: 500; flex: 1; }
.topbar-search { position: relative; }
.topbar-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--text-muted); pointer-events: none; }
.topbar-search input {
  padding: 6px 12px 6px 34px;
  border: 0.5px solid var(--border); border-radius: var(--r);
  font-size: 13px; background: var(--bg-secondary);
  color: var(--text); width: 280px; font-family: var(--font);
}
.topbar-search input:focus { outline: none; border-color: var(--navy); }
.topbar-search input::placeholder { color: var(--text-muted); }

.content { flex: 1; overflow-y: auto; padding: 24px; }

/* ════════════════════════════════════════════════════════════
   COMMON COMPONENTS
   ════════════════════════════════════════════════════════════ */

/* Messages */
.msg-list { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.msg { padding: 10px 14px; border-radius: var(--r); font-size: 13px; border: 0.5px solid transparent; }
.msg.success { background: var(--bg-success); color: var(--text-success); border-color: #bbf7d0; }
.msg.error   { background: var(--bg-danger);  color: var(--text-danger);  border-color: #fecaca; }
.msg.warning { background: var(--bg-warning); color: var(--text-warning); border-color: #fde68a; }
.msg.info    { background: var(--bg-info);    color: var(--text-info);    border-color: #bfdbfe; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 0.5px solid var(--border); border-radius: var(--r);
  font-size: 13px; font-family: var(--font); cursor: pointer;
  background: var(--bg-primary); color: var(--text);
  text-decoration: none; transition: background .15s; line-height: 1;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-secondary); }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); }
.btn-gold { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 600; }
.btn-gold:hover { background: #b8892e; border-color: #b8892e; }
.btn-danger { background: var(--bg-danger); color: var(--text-danger); border-color: #fecaca; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0.5px solid var(--border-lt); border-radius: var(--r-sm);
  background: transparent; padding: 5px 8px;
  cursor: pointer; color: var(--text-sec); transition: background .15s;
}
.btn-icon:hover { background: var(--bg-secondary); }
.btn-icon i { font-size: 14px; }

/* Section header */
.section-top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-top h2 { font-size: 14px; font-weight: 500; flex: 1; }

/* Pills */
.pill { display: inline-block; font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 500; white-space: nowrap; }
.pill-admin   { background: var(--bg-danger);  color: var(--text-danger); }
.pill-member  { background: var(--bg-success); color: var(--text-success); }
.pill-pending { background: var(--bg-warning); color: var(--text-warning); }
.pill-editor  { background: var(--bg-info);    color: var(--text-info); }
.pill-navy    { background: var(--navy);        color: #fff; }
.pill-gold    { background: var(--gold);        color: var(--navy); font-weight: 700; }
.pill-open    { background: var(--bg-success);  color: var(--text-success); }
.pill-upcoming{ background: var(--bg-info);     color: var(--text-info); }
.pill-cancelled{ background: var(--bg-danger);  color: var(--text-danger); }

/* Tabs */
.tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 0.5px solid var(--border-lt); }
.tab { padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--text-sec); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; transition: color .15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--navy); border-bottom-color: var(--navy); font-weight: 500; }

/* Avatar helpers */
.av-info    { background: var(--bg-info);    color: var(--text-info); }
.av-success { background: var(--bg-success); color: var(--text-success); }
.av-warning { background: var(--bg-warning); color: var(--text-warning); }
.av-danger  { background: var(--bg-danger);  color: var(--text-danger); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; font-size: 13px; }
.pagination a { padding: 6px 12px; border: 0.5px solid var(--border); border-radius: var(--r); text-decoration: none; color: var(--text); transition: background .15s; }
.pagination a:hover { background: var(--bg-secondary); }
.pagination .pg-current { color: var(--text-muted); }

/* Empty state */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state i { font-size: 40px; display: block; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 13px; }

/* ════════════════════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════════════════════ */
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 12px; color: var(--text-sec); margin-bottom: 4px; font-weight: 500; }
.form-control {
  width: 100%; padding: 8px 12px;
  border: 0.5px solid var(--border); border-radius: var(--r);
  font-size: 13px; color: var(--text); background: var(--bg-secondary);
  font-family: var(--font); transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--navy); background: var(--bg-primary); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 80px; }
.field-error { font-size: 11px; color: var(--text-danger); margin-top: 4px; }
.field-help  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; cursor: pointer; }
.form-check input[type=checkbox] { width: 14px; height: 14px; cursor: pointer; accent-color: var(--navy); }
.form-check span { font-size: 13px; }

/* Auto-style Django form fields inside .form-field */
.form-field input[type=text],
.form-field input[type=email],
.form-field input[type=password],
.form-field input[type=date],
.form-field textarea,
.form-field select {
  width: 100%; padding: 8px 12px;
  border: 0.5px solid var(--border); border-radius: var(--r);
  font-size: 13px; color: var(--text); background: var(--bg-secondary);
  font-family: var(--font); transition: border-color .15s;
  display: block;
}
.form-field input[type=text]:focus,
.form-field input[type=email]:focus,
.form-field input[type=password]:focus,
.form-field input[type=date]:focus,
.form-field textarea:focus,
.form-field select:focus { outline: none; border-color: var(--navy); background: var(--bg-primary); }
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   AUTH PAGES  (login / register)
   ════════════════════════════════════════════════════════════ */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 24px; }
.auth-card { background: var(--bg-primary); border-radius: var(--r-lg); padding: 32px 28px; width: 100%; max-width: 360px; border: 0.5px solid var(--border); }
.auth-logo { width: 36px; height: 54px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.auth-logo img { width: 100%; height: auto; display: block; }
.auth-card h2 { font-size: 16px; font-weight: 600; text-align: center; margin-bottom: 4px; }
.auth-card .auth-org { font-size: 12px; color: var(--text-sec); text-align: center; margin-bottom: 20px; }
.auth-footer { font-size: 13px; text-align: center; color: var(--text-sec); margin-top: 16px; }
.auth-footer a { color: var(--navy); font-weight: 500; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.auth-divider { font-size: 11px; color: var(--text-muted); text-align: center; margin: 10px 0; }
.role-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.role-btn { padding: 10px 8px; border: 0.5px solid var(--border); border-radius: var(--r); cursor: pointer; background: transparent; text-align: center; font-size: 12px; color: var(--text-sec); transition: all .15s; font-family: var(--font); }
.role-btn i { font-size: 20px; display: block; margin-bottom: 4px; }
.role-btn:hover { background: var(--bg-secondary); }
.role-btn.selected { border-color: var(--navy); background: rgba(26,43,74,.06); color: var(--navy); }

/* ════════════════════════════════════════════════════════════
   DASHBOARD
   ════════════════════════════════════════════════════════════ */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--bg-secondary); border-radius: var(--r); padding: 14px 16px; }
.stat-card .s-label { font-size: 12px; color: var(--text-sec); margin-bottom: 4px; }
.stat-card .s-value { font-size: 22px; font-weight: 600; }
.stat-card .s-sub   { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.s-value.gold { color: var(--gold); }

.widgets-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.widget { background: var(--bg-primary); border: 0.5px solid var(--border); border-radius: var(--r-lg); padding: 16px; }
.widget-title { font-size: 11px; font-weight: 500; color: var(--text-sec); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.widget-title i { font-size: 14px; }
.widget-footer { margin-top: 12px; }

/* Mini event item */
.ev-mini { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-start; }
.ev-mini:last-child { margin-bottom: 0; }
.ev-mini-date { background: var(--navy); color: #fff; border-radius: 6px; padding: 4px 8px; font-size: 11px; text-align: center; min-width: 40px; line-height: 1.3; flex-shrink: 0; }
.ev-mini-date .day { font-size: 15px; font-weight: 600; display: block; }
.ev-mini-title { font-size: 13px; font-weight: 500; }
.ev-mini-meta  { font-size: 11px; color: var(--text-sec); margin-top: 2px; }

/* Mini thread item */
.thread-mini { display: flex; gap: 8px; padding: 8px 0; border-bottom: 0.5px solid var(--border-lt); text-decoration: none; color: inherit; }
.thread-mini:last-child { border-bottom: none; }
.thread-mini:hover .th-title { color: var(--navy); }
.th-av { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.th-av img { width: 100%; height: 100%; object-fit: cover; }
.th-title { font-size: 12px; font-weight: 500; }
.th-meta  { font-size: 11px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   MEMBER PROFILES
   ════════════════════════════════════════════════════════════ */
.profile-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; }
.profile-card { background: var(--bg-primary); border: 0.5px solid var(--border); border-radius: var(--r-lg); padding: 12px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.profile-card:hover { border-color: #d1d5db; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.p-av { width: 92px; height: 92px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; margin-bottom: 8px; overflow: hidden; flex-shrink: 0; }
.p-av img { width: 100%; height: 100%; object-fit: cover; }
.p-name  { font-size: 13px; font-weight: 500; }
.p-meta  { font-size: 11px; color: var(--text-sec); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.p-pills { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.pill-prezidijs { background: #7c3aed1a; color: #7c3aed; font-weight: 700; }

/* View toggle button group */
.view-toggle { display: flex; border: 0.5px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.view-toggle button { background: none; border: none; padding: 6px 10px; cursor: pointer; color: var(--text-sec); line-height: 1; font-size: 16px; }
.view-toggle button.active { background: var(--navy); color: white; }
.view-toggle button:hover:not(.active) { background: var(--bg-secondary); }

/* Members toolbar */
.members-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; }
.btn-active { background: var(--bg-secondary); border-color: var(--border); }
.filter-count { display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; border-radius: 99px; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; padding: 0 4px; margin-left: 4px; vertical-align: middle; }

/* Filter panel */
.filter-panel { background: var(--bg-primary); border: 0.5px solid var(--border); border-radius: var(--r-lg); padding: 16px; margin-bottom: 14px; }
.filter-panel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text-sec); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.filter-select { width: 100%; font-size: 13px; padding: 7px 10px; border: 0.5px solid var(--border); border-radius: var(--r-md); background: var(--bg-secondary); color: var(--text-primary); height: 34px; box-sizing: border-box; }
.filter-select:focus { outline: none; border-color: var(--navy); background: var(--bg-primary); }
.filter-panel-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 0.5px solid var(--border-lt); }
.filter-clear { font-size: 12px; color: var(--text-sec); text-decoration: none; padding: 4px 6px; }
.filter-clear:hover { color: var(--text-primary); }

/* Semester picker dropdown */
.sem-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--bg-primary); border: 0.5px solid var(--border); border-radius: var(--r-md); box-shadow: 0 4px 12px rgba(0,0,0,.1); z-index: 100; overflow: hidden; }
.sem-option { display: block; width: 100%; padding: 9px 12px; font-size: 13px; border: none; background: none; cursor: pointer; text-align: left; color: var(--text-primary); }
.sem-option:hover { background: var(--bg-secondary); }

/* Member list view */
.profile-list { display: flex; flex-direction: column; gap: 4px; }
.profile-list .profile-card { flex-direction: row; align-items: center; text-align: left; gap: 12px; padding: 10px 14px; }
.profile-list .p-av { width: 38px; height: 38px; font-size: 14px; margin-bottom: 0; flex-shrink: 0; }
.profile-list .p-name { flex: 1; min-width: 0; }
.profile-list .p-meta { justify-content: flex-start; margin-top: 0; }
.profile-list .p-pills { margin-top: 0; }

/* Profile detail page */
.profile-cover { height: 96px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-hover) 100%); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.profile-body  { padding: 0 20px 20px; }
.profile-av-row { display: flex; align-items: flex-end; gap: 14px; margin-top: -32px; margin-bottom: 10px; }
.profile-av-lg { width: 64px; height: 64px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.profile-av-lg img { width: 100%; height: 100%; object-fit: cover; }
.profile-card-wrap { background: var(--bg-primary); border: 0.5px solid var(--border-lt); border-radius: var(--r-lg); overflow: hidden; }
.profile-name { font-size: 17px; font-weight: 600; }
.profile-number { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.profile-roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.profile-bio { font-size: 13px; color: var(--text-sec); line-height: 1.65; margin: 12px 0; }
.profile-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 12px; color: var(--text-sec); }
.profile-meta-item { display: flex; align-items: center; gap: 6px; }
.profile-meta-item i { font-size: 14px; color: var(--text-muted); }
.profile-edit-btn { margin-left: auto; }

/* ════════════════════════════════════════════════════════════
   FORUM
   ════════════════════════════════════════════════════════════ */

/* Category picker dropdown (forum index "Jauna diskusija" button) */
.cat-picker-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 6px 20px rgba(0,0,0,.10);
  z-index: 60;
  padding: 4px 0;
  overflow: hidden;
}
.cat-picker-item {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  transition: background .12s;
}
.cat-picker-item:hover { background: var(--bg-secondary); }

.forum-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.forum-cat { border: 0.5px solid var(--border-lt); border-radius: var(--r-lg); padding: 14px 16px; display: flex; gap: 12px; align-items: center; transition: border-color .15s; text-decoration: none; color: inherit; }
.forum-cat:hover { border-color: var(--border); }
.forum-cat i { font-size: 22px; flex-shrink: 0; }
.fc-name  { font-size: 13px; font-weight: 500; }
.fc-desc  { font-size: 11px; color: var(--text-sec); margin-top: 2px; }
.fc-count { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.thread-list { display: flex; flex-direction: column; gap: 8px; }
.tl-item { border: 0.5px solid var(--border-lt); border-radius: var(--r); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; transition: border-color .15s; text-decoration: none; color: inherit; }
.tl-item:hover { border-color: var(--border); }
.tl-av { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.tl-av img { width: 100%; height: 100%; object-fit: cover; }
.tl-body { flex: 1; min-width: 0; }
.tl-title   { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.tl-meta    { font-size: 11px; color: var(--text-muted); }
.tl-replies { font-size: 11px; color: var(--text-sec); display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* Thread posts */
.post-item { border: 0.5px solid var(--border-lt); border-radius: var(--r-lg); margin-bottom: 10px; overflow: hidden; }
.post-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 16px; background: var(--bg-secondary); border-bottom: 0.5px solid var(--border-lt); }
.post-body { padding: 14px 16px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.post-ts   { font-size: 11px; color: var(--text-muted); margin-left: auto; }

/* ════════════════════════════════════════════════════════════
   EVENTS
   ════════════════════════════════════════════════════════════ */
.event-list { display: flex; flex-direction: column; gap: 10px; }
.ev-card { border: 0.5px solid var(--border-lt); border-radius: var(--r-lg); padding: 16px; display: flex; gap: 16px; transition: border-color .15s; text-decoration: none; color: inherit; }
.ev-card:hover { border-color: var(--border); }
.ev-cal { background: var(--navy); border-radius: var(--r); width: 52px; text-align: center; flex-shrink: 0; overflow: hidden; }
.ev-month { background: var(--gold); color: var(--navy); font-size: 10px; font-weight: 700; padding: 3px 0; text-transform: uppercase; }
.ev-day   { color: #fff; font-size: 22px; font-weight: 700; padding: 6px 0; line-height: 1; }
.ev-info  { flex: 1; min-width: 0; }
.ev-title  { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.ev-detail { font-size: 12px; color: var(--text-sec); display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.ev-detail span { display: flex; align-items: center; gap: 4px; }
.ev-detail i { font-size: 13px; }
.ev-pills  { display: flex; gap: 6px; flex-wrap: wrap; }

/* ════════════════════════════════════════════════════════════
   DOCUMENTS
   ════════════════════════════════════════════════════════════ */
.doc-search-wrap { display: flex; gap: 8px; margin-bottom: 16px; }
.doc-search-input { position: relative; flex: 1; }
.doc-search-input i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--text-muted); pointer-events: none; }
.doc-search-input input { width: 100%; padding: 8px 12px 8px 34px; border: 0.5px solid var(--border); border-radius: var(--r); font-size: 13px; background: var(--bg-secondary); color: var(--text); font-family: var(--font); }
.doc-search-input input:focus { outline: none; border-color: var(--navy); }
.doc-list { display: flex; flex-direction: column; gap: 8px; }
.doc-item { border: 0.5px solid var(--border-lt); border-radius: var(--r); padding: 12px 16px; display: flex; align-items: center; gap: 12px; transition: border-color .15s; text-decoration: none; color: inherit; }
.doc-item:hover { border-color: var(--border); }
.doc-icon { width: 36px; height: 36px; background: var(--bg-danger); border-radius: var(--r); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-icon i { font-size: 18px; color: var(--text-danger); }
.doc-name { font-size: 13px; font-weight: 500; }
.doc-desc { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.doc-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.doc-size { font-size: 11px; color: var(--text-muted); white-space: nowrap; margin-right: 8px; }

/* ════════════════════════════════════════════════════════════
   MEDIA POSTS
   ════════════════════════════════════════════════════════════ */
.media-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.media-card { border: 0.5px solid var(--border-lt); border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: inherit; display: block; transition: border-color .15s, box-shadow .15s; }
.media-card:hover { border-color: var(--border); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.media-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.media-thumb-ph { width: 100%; aspect-ratio: 16/9; background: linear-gradient(135deg,var(--bg-info),var(--bg-secondary)); display: flex; align-items: center; justify-content: center; font-size: 32px; }
.media-body { padding: 10px 12px 12px; }
.media-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.media-meta  { font-size: 11px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   SEARCH DROPDOWN
   ════════════════════════════════════════════════════════════ */
.search-result {
  display: flex;
  align-items: center;
  width: 100%; text-align: left;
  border: none; background: none;
  cursor: pointer; font-family: var(--font);
  padding: 11px 16px;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s;
}
.search-result + .search-result { border-top: 0.5px solid var(--border-lt); }
.search-result.is-active {
  background: var(--bg-secondary);
  border-left-color: var(--navy);
}

/* ════════════════════════════════════════════════════════════
   API DOCS
   ════════════════════════════════════════════════════════════ */
.api-card { border: 0.5px solid var(--border-lt); border-radius: var(--r-lg); margin-bottom: 10px; overflow: hidden; }
.api-header { padding: 12px 16px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: background .15s; }
.api-header:hover { background: var(--bg-secondary); }
.api-method { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-sm); min-width: 46px; text-align: center; }
.method-get    { background: #dcfce7; color: #166534; }
.method-post   { background: #dbeafe; color: #1e40af; }
.method-put    { background: #fef9c3; color: #92400e; }
.method-delete { background: var(--bg-danger); color: var(--text-danger); }
.api-endpoint { font-family: var(--font-mono); font-size: 12px; flex: 1; }
.api-desc { font-size: 12px; color: var(--text-sec); }
.api-body { padding: 12px 16px; border-top: 0.5px solid var(--border-lt); background: var(--bg-secondary); display: none; }
.api-body.open { display: block; }
.api-body pre { font-family: var(--font-mono); font-size: 11px; color: var(--text-sec); white-space: pre-wrap; }
.api-url-bar { background: var(--bg-secondary); border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px; font-family: var(--font-mono); font-size: 12px; color: var(--text-sec); }
.api-url-bar strong { color: var(--text); }

/* ════════════════════════════════════════════════════════════
   ADMIN TABLE
   ════════════════════════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 11px; color: var(--text-muted); font-weight: 500; border-bottom: 0.5px solid var(--border-lt); padding: 8px 10px; text-transform: uppercase; letter-spacing: .04em; }
.data-table td { padding: 10px; border-bottom: 0.5px solid var(--border-lt); font-size: 13px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-secondary); }
.av-cell { display: flex; align-items: center; gap: 8px; }
.av-sm { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.av-sm img { width: 100%; height: 100%; object-fit: cover; }
.action-btns { display: flex; gap: 4px; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE LAYOUT
   Mobile-first breakpoints:
     sm  ≥ 640px
     md  ≥ 768px   (tablet — sidebar stays visible)
     lg  ≥ 1024px  (desktop — full layout)
   ════════════════════════════════════════════════════════════ */

/* ── Hamburger button (mobile only) ─────────────────────── */
.mob-menu-btn {
  display: none;
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-sec); padding: 4px; border-radius: var(--r);
  flex-shrink: 0;
}
.mob-menu-btn:hover { background: var(--bg-secondary); }
.mob-menu-btn i { font-size: 22px; }

/* ── Sidebar backdrop (mobile only) ─────────────────────── */
.sb-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 39;
}

/* ─────────────────────────────────────────────────────────
   LG — full desktop (default, written above)
   ───────────────────────────────────────────────────────── */

/* ─────────────────────────────────────────────────────────
   MD + SM — tablet AND mobile (< 1024 px):
   Hamburger drawer replaces the persistent sidebar so that
   landscape phones and small tablets all get the same
   accessible nav. Grid columns narrow; fine spacing tweaks
   follow in the 767 px block below.
   ───────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  :root { --sidebar-w: 240px; }

  /* App shell stacks vertically; sidebar is fixed (out of flow). */
  .app-shell { flex-direction: column; }

  /* Sidebar becomes a fixed slide-in drawer */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: 240px !important;
    height: 100vh; height: 100dvh;  /* dvh for iOS Safari toolbar */
  }
  .sidebar.sb-open { transform: translateX(0); }

  /* Always show full sidebar labels (overrides .sb-is-collapsed rules) */
  .sb-name, .sb-sub           { display: block !important; }
  .sb-section                 { display: block !important; }
  .sb-link                    { padding: 8px 16px !important; justify-content: flex-start !important; gap: 9px !important; }
  .sb-link span               { display: inline !important; }
  .sb-link i                  { font-size: 16px !important; }
  .sb-badge                   { display: inline-block !important; }
  .sb-user                    { padding: 12px 16px !important; justify-content: flex-start !important; }
  .sb-uname, .sb-urole        { display: block !important; }
  .sb-logo                    { padding: 18px 16px 14px !important; }
  .sb-monogram                { margin-bottom: 8px !important; }

  /* Backdrop: x-show controls display; this rule supplies the "visible" state */
  .sb-backdrop { display: block; }

  /* Main area fills the viewport (sidebar is out of flow) */
  .main { width: 100%; }

  /* Topbar: hamburger instead of the desktop collapse toggle */
  .mob-menu-btn  { display: flex; }
  .sb-toggle-btn { display: none; }
  .topbar-search { display: none; }

  /* Content grids: 2-col on tablet, tightened further at 767 px */
  .stats-row         { grid-template-columns: repeat(2, 1fr); }
  .widgets-row       { grid-template-columns: 1fr; }
  .profile-grid      { grid-template-columns: repeat(4, 1fr); }
  .media-grid        { grid-template-columns: repeat(2, 1fr); }
  .forum-cats        { grid-template-columns: 1fr; }
  .profile-meta-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────────────────────
   SM — narrow phones (< 768 px): tighter spacing & grids.
   Layout/drawer is already handled by the 1023 px block.
   ───────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  /* Topbar */
  .topbar       { padding: 0 14px; gap: 8px; }
  .topbar-title { font-size: 14px; }

  /* Content area */
  .content { padding: 14px 12px; }

  /* Grids: tighten gaps, narrow to 2 columns */
  .stats-row    { gap: 8px; }
  .profile-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .media-grid   { grid-template-columns: 1fr 1fr; gap: 8px; }
  .widgets-row  { gap: 12px; }

  /* Event card: stack calendar + info vertically on narrow screens */
  .ev-card   { flex-wrap: wrap; }
  .ev-detail { gap: 6px; }

  /* Profile page */
  .profile-av-row { flex-wrap: wrap; }
  .section-top    { flex-wrap: wrap; }
  .stat-card .s-value { font-size: 18px; }

  /* Thread list: hide reply count to save horizontal space */
  .tl-replies { display: none; }

  /* Document list: hide file size on tiny screens */
  .doc-size { display: none; }

  /* Form grids: single column on phones */
  .form-grid-2 { display: block; }

  /* Auth card: tighter horizontal padding */
  .auth-card { padding: 24px 18px; }

  /* Hide low-priority topbar action buttons */
  .topbar-actions-hide-mobile { display: none; }
}

@media (max-width: 480px) {
  .profile-grid { grid-template-columns: 1fr; }
  .media-grid   { grid-template-columns: 1fr; }
  .stats-row    { grid-template-columns: 1fr 1fr; }
}

/* ════════════════════════════════════════════════════════════
   FILTER BAR  (horizontal tab-strip inside content area)
   Used when a page has multiple filter/tab buttons that would
   overflow the fixed-height topbar on mobile.
   ════════════════════════════════════════════════════════════ */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ════════════════════════════════════════════════════════════
   SECTION LABEL  (reusable uppercase heading with icon)
   ════════════════════════════════════════════════════════════ */
.section-label {
  font-size: 11px; font-weight: 500; color: var(--text-sec);
  text-transform: uppercase; letter-spacing: .05em;
  display: flex; align-items: center; gap: 6px;
}

/* ════════════════════════════════════════════════════════════
   AMATVĪRI TABLE  (_amativiri_section.html)
   ════════════════════════════════════════════════════════════ */
.amv-table {
  display: flex; flex-direction: column;
  border: 0.5px solid var(--border); border-radius: var(--r-lg); overflow: hidden;
}
.amv-table-hdr {
  display: grid; grid-template-columns: 180px 1fr 140px 210px;
  padding: 8px 16px; background: var(--bg-secondary);
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.amv-table-row {
  display: grid; grid-template-columns: 180px 1fr 140px 210px;
  align-items: center; padding: 12px 16px;
  background: var(--bg-primary); border-top: 0.5px solid var(--border-lt);
}
/* Role name — colour applied inline via {{ accent }} */
.amv-role { font-size: 13px; font-weight: 600; }
.amv-name-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}
/* Avatar — shared base; img vs initials differ only in content */
.amv-av {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover; border: 0.5px solid var(--border);
}
.amv-av-init {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  /* background / color / border set inline via {{ bg }} / {{ accent }} / {{ border }} */
}
.amv-name-text { font-size: 13px; font-weight: 500; }
.amv-phone     { font-size: 13px; color: var(--text-sec); }
.amv-email     { font-size: 13px; color: var(--text-info); text-decoration: none; }
.amv-empty {
  padding: 16px; border-top: 0.5px solid var(--border-lt);
  font-size: 13px; color: var(--text-muted); text-align: center; opacity: .6;
}

/* ════════════════════════════════════════════════════════════
   AMATI ROWS  (profile.html amati tab)
   ════════════════════════════════════════════════════════════ */
.amati-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: var(--r);
}
.amati-row__role { font-size: 13px; flex: 1; }
.amati-row__date { font-size: 12px; white-space: nowrap; }

/* Upcoming — dimmed */
.amati-row--prez-upcoming {
  background: #7c3aed07; border: 0.5px solid #7c3aed22; opacity: .7;
}
.amati-row--prez-upcoming .amati-row__role { color: #7c3aed; }
.amati-row--prez-upcoming .amati-row__date { color: #7c3aed; }
.amati-row--other-upcoming {
  background: var(--bg-secondary); border: 0.5px solid var(--border); opacity: .7;
}
.amati-row--other-upcoming .amati-row__role { color: var(--text-sec); }
.amati-row--other-upcoming .amati-row__date { color: var(--text-muted); }

/* Current */
.amati-row--prez-current {
  background: #7c3aed0d; border: 0.5px solid #7c3aed33;
}
.amati-row--prez-current .amati-row__role { color: #7c3aed; font-weight: 600; }
.amati-row--prez-current .amati-row__date { color: #7c3aed; opacity: .7; }
.amati-row--other-current {
  background: var(--gold-light, #f0c97a)14; border: 0.5px solid var(--gold)55;
  /* fallback — actual gold tint via CSS var */
}
.amati-row--other-current { background: #f0c97a22; border: 0.5px solid #c9a84c88; }
.amati-row--other-current .amati-row__role { color: var(--navy); font-weight: 600; }
.amati-row--other-current .amati-row__date { color: var(--text-muted); }

/* Past */
.amati-row--past {
  background: var(--bg-secondary); border: 0.5px solid var(--border);
}
.amati-row--past .amati-row__role { color: var(--text-sec); }
.amati-row--past .amati-row__date { color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   PROFILE PAGE — cover banners
   ════════════════════════════════════════════════════════════ */
.profile-cover-navy {
  height: 140px;
  background: linear-gradient(135deg, var(--navy) 0%, #2d4a7a 60%, #1a3a6a 100%);
  border-radius: var(--r-lg) var(--r-lg) 0 0; position: relative;
}
.profile-cover-navy__pattern {
  position: absolute; inset: 0; opacity: .08;
  background-image: repeating-linear-gradient(45deg,#fff 0,#fff 1px,transparent 0,transparent 50%);
  background-size: 20px 20px; border-radius: inherit;
}
.profile-cover-deceased {
  height: 140px;
  background: linear-gradient(135deg, #374151 0%, #4b5563 60%, #374151 100%);
  border-radius: var(--r-lg) var(--r-lg) 0 0; position: relative;
}
.profile-cover-deceased__label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: rgba(255,255,255,.5); font-size: 13px; font-weight: 500; letter-spacing: .05em;
}

/* ════════════════════════════════════════════════════════════
   PROFILE PAGE — avatar (large, 112 px)
   ════════════════════════════════════════════════════════════ */
.profile-av-xl {
  width: 112px; height: 112px; border-radius: 50%;
  border: 4px solid var(--bg-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  object-fit: cover; transition: transform .15s;
}
.profile-av-xl--clickable { cursor: zoom-in; }
.profile-av-xl--deceased  { filter: grayscale(100%); opacity: .7; cursor: default; }
.profile-av-xl-init {
  width: 112px; height: 112px; border-radius: 50%;
  border: 4px solid var(--bg-primary);
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 700;
}
.profile-av-xl-zoom {
  position: absolute; bottom: 6px; right: 6px;
  background: var(--bg-primary); border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.2); pointer-events: none;
}

/* ════════════════════════════════════════════════════════════
   PROFILE PAGE — family link avatars (oldermanis / tēvs / māte)
   ════════════════════════════════════════════════════════════ */
.family-btn {
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.family-av-wrap { position: relative; }
.family-av {
  width: 56px; height: 56px; border-radius: 50%;
  object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,.12);
  /* border colour set inline per person type */
}
.family-av-init {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  /* background / color / border set inline per person type */
}
.family-av-badge {
  position: absolute; bottom: -2px; right: -2px;
  border-radius: 50%; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; border: 2px solid white; font-weight: 700;
  /* background / color set inline per person type */
}
.family-label { font-size: 11px; color: var(--text-muted); }
.family-popup {
  position: fixed; transform: translateX(-50%);
  background: var(--bg-primary); border: 0.5px solid var(--border);
  border-radius: var(--r-lg); padding: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 200px; z-index: 1000; text-align: left;
}
.family-popup-hd {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.family-popup-av {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
}
.family-popup-av-init {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  /* background / color set inline per person type */
}
.family-popup-name { font-size: 13px; font-weight: 600; }
.family-popup-meta { font-size: 11px; color: var(--text-muted); }
.family-popup-link {
  font-size: 12px; color: var(--navy); font-weight: 500;
  text-decoration: none; display: flex; align-items: center; gap: 4px;
}

/* Child avatars (krāsu dēli / zēni) — slightly smaller */
.family-child-av {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,.1);
  /* border set inline per type */
}
.family-child-av-init {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  /* background / color / border set inline per type */
}
.family-child-badge {
  position: absolute; bottom: -2px; right: -2px;
  border-radius: 50%; width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; border: 2px solid white; font-weight: 700;
}
.family-child-name {
  font-size: 11px; color: var(--text-muted);
  max-width: 60px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ════════════════════════════════════════════════════════════
   LIGHTBOX  (profile.html avatar overlay)
   ════════════════════════════════════════════════════════════ */
.lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lightbox-img {
  max-width: min(480px, 90vw); max-height: 80vh;
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
  object-fit: contain;
}
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  border-radius: 50%; width: 36px; height: 36px; cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
}

/* ════════════════════════════════════════════════════════════
   PROFILE PAGE — avatar row, stats, layout utilities
   ════════════════════════════════════════════════════════════ */
.profile-av-row-xl {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-top: -56px; margin-bottom: 16px;
  flex-wrap: wrap; gap: 12px;
}
.profile-av-wrap      { position: relative; flex-shrink: 0; }
.profile-stat-row     { display: flex; gap: 20px; padding-bottom: 8px; }
.profile-stat         { text-align: center; }
.profile-stat__value  { font-size: 22px; font-weight: 700; color: var(--navy); }
.profile-stat__label  { font-size: 11px; color: var(--text-muted); }
.profile-stat-divider { width: 1px; background: var(--border-lt); }
.profile-pills        { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-bio-wrap { margin-bottom: 16px; }
.profile-bio-text {
  font-size: 13px; color: var(--text-sec); line-height: 1.7;
}
.profile-bio-text--clamped {
  max-height: 6.8em; /* 4 lines × 1.7 */
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.profile-bio-toggle {
  display: flex; align-items: center; gap: 4px;
  margin-top: 6px;
  background: none; border: none; cursor: pointer; padding: 0;
  font-size: 12px; font-weight: 500; color: var(--navy);
  font-family: var(--font);
}
.profile-bio-toggle:hover { opacity: 0.75; }
.profile-info-section {
  border-top: 0.5px solid var(--border-lt);
  padding-top: 12px; margin-bottom: 16px;
}
.profile-info-section__label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); margin-bottom: 10px;
}
.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
/* Section divider block (amati, family, forum…) */
.profile-section        { border-top: 0.5px solid var(--border-lt); padding-top: 16px; margin-bottom: 24px; }
.profile-section--forum { padding-top: 20px; margin-bottom: 0; }

/* Amati row icons never shrink */
.amati-row > i { flex-shrink: 0; }

/* ════════════════════════════════════════════════════════════
   PROFILE PAGE — forum activity thread entries
   ════════════════════════════════════════════════════════════ */
.tl-item--col   { flex-direction: column; gap: 4px; align-items: stretch; }
.tl-item-header { display: flex; align-items: center; gap: 6px; }
.tl-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 7px; border-radius: 10px; white-space: nowrap;
}
.tl-badge--thread { background: var(--bg-info);    color: var(--text-info); }
.tl-badge--reply  { background: var(--bg-success); color: var(--text-success); }
.tl-item-title  { font-size: 13px; font-weight: 500; color: var(--text); }
.tl-item-reply  { font-size: 12px; color: var(--text-sec); }
.tl-item-time   { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.tl-preview     { font-size: 13px; color: var(--text-sec); line-height: 1.55; padding-left: 2px; }
.tl-category    { font-size: 11px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   PROFILE EDIT FORM  (profile_edit.html)
   ════════════════════════════════════════════════════════════ */
.form-grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-section { border-top: 0.5px solid var(--border-lt); padding-top: 16px; margin-top: 4px; }
.form-section-hd {
  font-size: 12px; color: var(--text-sec); margin-bottom: 12px;
  font-weight: 500; display: flex; align-items: center; gap: 6px;
}
.fmt-btn {
  padding: 3px 9px;
  border: 0.5px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg-secondary); cursor: pointer;
  font-size: 13px; font-family: var(--font); color: var(--text);
}
.avatar-preview       { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.avatar-preview__img  {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--border);
}
.avatar-preview__label { font-size: 12px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   MEMBER SEARCH DROPDOWN  (member_list.html topbar)
   ════════════════════════════════════════════════════════════ */
.msearch-wrap          { position: relative; }
.msearch-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 280px;
  background: var(--bg-primary);
  border: 0.5px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 200; overflow: hidden;
}
.msearch-result        { flex: 1; min-width: 0; overflow: hidden; }
.msearch-result__name  { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msearch-result__meta  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.msearch-footer        { border-top: 0.5px solid var(--border-lt); padding: 7px 12px; }
.msearch-footer__link  { font-size: 12px; color: var(--text-sec); text-decoration: none; display: flex; align-items: center; gap: 5px; }
.msearch-empty         { padding: 14px 12px; font-size: 13px; color: var(--text-muted); text-align: center; }
.msearch-empty__icon   { font-size: 18px; display: block; margin-bottom: 4px; }

/* ════════════════════════════════════════════════════════════
   MEMBER PICKER WIDGET  (_member_picker_widget.html)
   ════════════════════════════════════════════════════════════ */
.mpicker-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border: 0.5px solid var(--border); border-radius: var(--r);
  background: var(--bg-secondary); font-size: 13px;
}
.mpicker-chip__icon  { font-size: 14px; color: var(--text-muted); flex-shrink: 0; }
.mpicker-chip__name  { flex: 1; }
.mpicker-chip__clear {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 2px; line-height: 1;
  display: flex; align-items: center;
}
.mpicker-wrap        { position: relative; }
.mpicker-input-wrap  { position: relative; }
.mpicker-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--text-muted); pointer-events: none;
}
.mpicker-input {
  width: 100%; padding: 7px 12px 7px 32px;
  border: 0.5px solid var(--border); border-radius: var(--r);
  font-size: 13px; background: var(--bg-secondary);
  color: var(--text); font-family: var(--font);
}
.mpicker-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-primary);
  border: 0.5px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 200; overflow: hidden;
}
.mpicker-result        { flex: 1; min-width: 0; overflow: hidden; }
.mpicker-result__name  { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mpicker-result__meta  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.mpicker-empty         { padding: 12px; font-size: 13px; color: var(--text-muted); text-align: center; }
.mpicker-empty__icon   { font-size: 16px; display: block; margin-bottom: 3px; }

/* ════════════════════════════════════════════════════════════
   MEMBER STATUS EDIT  (member_status_edit.html)
   ════════════════════════════════════════════════════════════ */
.member-id-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; background: var(--bg-secondary);
  border-radius: var(--r-lg); border: 0.5px solid var(--border-lt);
  margin-bottom: 20px;
}
.member-id-av {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.member-id-av img { width: 100%; height: 100%; object-fit: cover; }
.member-id-name   { font-size: 15px; font-weight: 600; }
.member-id-num    { font-size: 12px; color: var(--text-sec); }

/* Shared form utility */
.form-actions { display: flex; gap: 8px; margin-top: 20px; }

/* ════════════════════════════════════════════════════════════
   FORUM — THREAD PAGE  (thread.html)
   ════════════════════════════════════════════════════════════ */
.thread-title     { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.thread-meta      { font-size: 12px; color: var(--text-muted); display: flex; gap: 16px; }
.post-author-name { font-size: 13px; font-weight: 500; }
.post-author-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.post-author-link { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.post-author-link:hover .post-author-name { color: var(--navy); text-decoration: underline; }

/* ════════════════════════════════════════════════════════════
   EVENTS
   ════════════════════════════════════════════════════════════ */
.pill-past         { background: var(--bg-secondary); color: var(--text-muted); }
.reg-box           { background: var(--bg-secondary); border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; }
.reg-box__title    { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.reg-box__count    { font-size: 13px; color: var(--text-sec); }
.reg-box__deadline { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ════════════════════════════════════════════════════════════
   ARTICLE LAYOUT  (news/detail, news/news_post, events/detail)
   ════════════════════════════════════════════════════════════ */
.article-cover-img { width: 100%; object-fit: cover; display: block; }
.article-cover-ph  {
  height: 120px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-hover) 100%);
  display: flex; align-items: center; justify-content: center;
}
.article-pad       { padding: 24px; }
.article-meta-row  { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.article-meta-date { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.article-title     { font-size: 20px; font-weight: 600; line-height: 1.35; margin-bottom: 14px; }
.article-summary   {
  font-size: 14px; color: var(--text-sec); line-height: 1.7;
  margin-bottom: 20px; padding-bottom: 20px;
  border-bottom: 0.5px solid var(--border-lt);
}
.article-body      { font-size: 13px; line-height: 1.8; color: var(--text); }

/* ════════════════════════════════════════════════════════════
   PROFILE PAGE — name, headline, pills
   ════════════════════════════════════════════════════════════ */
.profile-name     { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.profile-headline { font-size: 13px; color: var(--text-sec); margin-bottom: 8px; }
.pill-prez-role   { background: #7c3aed1a; color: #7c3aed; }
.section-count    {
  background: var(--bg-secondary); color: var(--text-muted);
  font-size: 10px; padding: 1px 6px; border-radius: 10px;
  font-weight: 600; margin-left: 6px;
}

/* ════════════════════════════════════════════════════════════
   FAMILY AVATAR ROLE MODIFIERS  (profile.html)
   ════════════════════════════════════════════════════════════ */
/* Oldermanis — purple */
.family-av--oldermanis         { border: 3px solid #7c3aed; }
.family-av-init--oldermanis    { background: #7c3aed; color: white; border: 3px solid #7c3aed; }
.family-av-badge--oldermanis   { background: #7c3aed; color: white; }
.family-popup-av-init--oldermanis { background: #7c3aed; color: white; }
/* Krāsu tēvs — gold */
.family-av--krasu-tevs         { border: 3px solid var(--gold); }
.family-av-init--krasu-tevs    { background: var(--gold); color: var(--navy); border: 3px solid var(--gold); }
.family-av-badge--krasu-tevs   { background: var(--gold); color: var(--navy); }
.family-popup-av-init--krasu-tevs { background: var(--gold); color: var(--navy); }
/* Krāsu māte — navy */
.family-av--krasu-mate         { border: 3px solid var(--navy); }
.family-av-init--krasu-mate    { background: var(--navy); color: white; border: 3px solid var(--navy); }
.family-av-badge--krasu-mate   { background: var(--navy); color: white; }
.family-popup-av-init--krasu-mate { background: var(--navy); color: white; }
/* Children — default (no role) */
.family-child-av--default       { border: 2px solid var(--border); }
.family-child-av-init--default  { background: var(--bg-secondary); color: var(--text-sec); border: 2px solid var(--border); }
.family-popup-av-init--default  { background: var(--bg-secondary); color: var(--text-sec); }
/* Children — zens (purple) */
.family-child-av--zens          { border: 2px solid #7c3aed; }
.family-child-av-init--zens     { background: #ede9fe; color: #7c3aed; border: 2px solid #7c3aed; }
.family-child-badge--zens       { background: #7c3aed; color: white; }
.family-popup-av-init--zens     { background: #ede9fe; color: #7c3aed; }
.family-popup-meta--zens        { color: #7c3aed; font-weight: 500; margin-top: 2px; }

/* ════════════════════════════════════════════════════════════
   AUTH FORMS  (login.html, register.html)
   ════════════════════════════════════════════════════════════ */
.btn-wide { width: 100%; justify-content: center; padding: 10px; font-size: 13px; }

/* ════════════════════════════════════════════════════════════
   FORUM — THREAD LIST ICONS  (category.html, index.html)
   ════════════════════════════════════════════════════════════ */
.tl-pin-icon  { font-size: 12px; margin-right: 4px; color: var(--gold); }
.tl-lock-icon { font-size: 12px; margin-right: 4px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   SHARED UTILITIES
   ════════════════════════════════════════════════════════════ */
.empty-state--grid   { grid-column: 1 / -1; }
.doc-body            { flex: 1; min-width: 0; }
.profile-email-link  { font-size: 13px; color: var(--text-info); text-decoration: none; }

/* ════════════════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════════════════ */
[x-cloak] { display: none !important; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  background: var(--bg); border-radius: var(--r);
  width: 100%; max-width: 520px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 0.5px solid var(--border-lt);
}
.modal-header h3 { font-size: 15px; font-weight: 600; margin: 0; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px; border-radius: var(--r);
  display: flex; align-items: center; font-size: 18px;
}
.modal-close:hover { background: var(--bg-secondary); color: var(--text); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 0.5px solid var(--border-lt);
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 500; color: var(--text-sec); }
.form-group input, .form-group select, .form-group textarea {
  background: var(--bg-secondary); border: 0.5px solid var(--border);
  border-radius: var(--r); padding: 8px 10px;
  font-size: 13px; color: var(--text); font-family: inherit;
  resize: vertical;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--navy);
}

/* ════════════════════════════════════════════════════════════
   SUGGESTIONS
   ════════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
.col-id     { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.col-title  { font-weight: 500; }
.col-votes  { text-align: center; }
/* Specificity fix: th inherits text-align:left from .data-table th (class+element beats .col-votes) */
.col-votes-th { text-align: center !important; }

.suggestion-row--link { cursor: pointer; }

.vote-row { display: flex; align-items: center; justify-content: center; gap: 6px; }
.vote-btn {
  background: none; border: 0.5px solid var(--border);
  border-radius: var(--r); width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); font-size: 14px;
  transition: background .12s, color .12s, border-color .12s;
}
.vote-btn:hover         { background: var(--bg-secondary); color: var(--text); }
.vote-btn.active-up     { border-color: var(--text-success); color: var(--text-success); background: var(--bg-success); }
.vote-btn.active-down   { border-color: var(--text-danger);  color: var(--text-danger);  background: var(--bg-danger);  }
.vote-count             { font-size: 13px; font-weight: 600; min-width: 20px; text-align: center; }

/* Pill variants for suggestion type/status */
.pill-bug      { background: #fef2f2; color: #dc2626; }
.pill-feature  { background: #eff6ff; color: #2563eb; }
.pill-new      { background: var(--bg-secondary); color: var(--text-muted); }
.pill-approved { background: var(--bg-success);   color: var(--text-success); }
.pill-progress { background: var(--bg-info);      color: var(--text-info); }
.pill-done     { background: #f0fdf4; color: #16a34a; }
.pill-rejected { background: var(--bg-danger);    color: var(--text-danger); }

/* ════════════════════════════════════════════════════════════
   TICKET DETAIL PAGE
   ════════════════════════════════════════════════════════════ */
.ticket-wrap { display: flex; flex-direction: column; gap: 24px; }

.ticket-header { border-bottom: 0.5px solid var(--border-lt); padding-bottom: 16px; }
.ticket-title-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ticket-title { font-size: 18px; font-weight: 600; margin: 0; flex: 1; min-width: 0; }
.ticket-pills { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.ticket-meta  { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.ticket-meta span { display: flex; align-items: center; gap: 4px; }

.ticket-body { display: flex; gap: 24px; align-items: flex-start; }
.ticket-main { flex: 1; min-width: 0; }
.ticket-desc { font-size: 14px; line-height: 1.75; color: var(--text); white-space: pre-wrap; }

.ticket-sidebar { flex-shrink: 0; }
.ticket-vote-box {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--bg-secondary); border-radius: var(--r);
  padding: 12px 16px;
}
.vote-btn-lg  { width: 34px; height: 34px; font-size: 17px; }
.vote-count-lg { font-size: 18px; font-weight: 700; }
.ticket-vote-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.ticket-comments { border-top: 0.5px solid var(--border-lt); padding-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.comments-heading { font-size: 14px; font-weight: 600; margin: 0; }
.comments-empty   { font-size: 13px; color: var(--text-muted); margin: 0; }

.comment { display: flex; flex-direction: column; gap: 4px; }
.comment-header { display: flex; align-items: baseline; gap: 10px; }
.comment-author { font-size: 13px; font-weight: 500; }
.comment-date   { font-size: 11px; color: var(--text-muted); }
.comment-body   { font-size: 13px; line-height: 1.7; color: var(--text); }

.comment-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.comment-input {
  background: var(--bg-secondary); border: 0.5px solid var(--border);
  border-radius: var(--r); padding: 8px 10px;
  font-size: 13px; color: var(--text); font-family: inherit;
  resize: vertical; width: 100%; box-sizing: border-box;
}
.comment-input:focus { outline: none; border-color: var(--navy); }

/* ════════════════════════════════════════════════════════════
   TICKET PREFIX  (list inline + detail header)
   ════════════════════════════════════════════════════════════ */
.ticket-prefix {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 3px; letter-spacing: .02em;
  vertical-align: middle; margin-right: 5px; flex-shrink: 0;
}
.ticket-prefix--bug     { background: #fef2f2; color: #dc2626; border: 0.5px solid #fecaca; }
.ticket-prefix--feature { background: #eff6ff; color: #2563eb; border: 0.5px solid #bfdbfe; }

/* ════════════════════════════════════════════════════════════
   TICKET DETAIL TWO-COLUMN LAYOUT
   ════════════════════════════════════════════════════════════ */
.ticket-layout {
  display: grid;
  grid-template-columns: 1fr 270px;
  grid-template-areas:
    "main     sidebar"
    "comments sidebar";
  gap: 20px;
  align-items: start;
}
.ticket-main-col     { grid-area: main;     min-width: 0; display: flex; flex-direction: column; gap: 0; }
.ticket-sidebar-col  { grid-area: sidebar;  display: flex; flex-direction: column; gap: 10px; }
.ticket-comments-col { grid-area: comments; min-width: 0; }

/* Ticket header (now inside main col) */
.ticket-header     { margin-bottom: 12px; }
.ticket-title-row  { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.ticket-title      { font-size: 17px; font-weight: 600; margin: 0; }
.ticket-meta       { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.ticket-meta span  { display: flex; align-items: center; gap: 4px; }

.ticket-desc { font-size: 13px; line-height: 1.75; color: var(--text); white-space: pre-wrap; padding: 14px 16px; }

/* Vote widget in sidebar */
.ticket-vote-widget .vote-row-vert {
  display: flex; align-items: center; gap: 8px; flex-direction: row;
}
.vote-row-vert  { display: flex; align-items: center; gap: 8px; }
.vote-btn-lg    { width: 32px; height: 32px; font-size: 16px; }
.vote-count-lg  { font-size: 15px; font-weight: 700; min-width: 24px; text-align: center; }

/* Sidebar person row */
.sidebar-person {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: inherit;
}
.sidebar-person:hover .sidebar-person__name { color: var(--navy); text-decoration: underline; }
.sidebar-person__name { font-size: 13px; font-weight: 500; }
.sidebar-person__role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.sidebar-none { font-size: 12px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════
   USER HOVER POPUP  (comments + sidebar)
   ════════════════════════════════════════════════════════════ */
.user-hover-wrap { position: relative; display: inline-flex; align-items: center; }
.user-popup {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: var(--bg-primary); border: 0.5px solid var(--border);
  border-radius: var(--r-lg); padding: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 200px; white-space: nowrap;
}
.user-popup--left { left: auto; right: 0; }

/* post-ts (timestamp at end of post-head) */
.post-ts { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ════════════════════════════════════════════════════════════
   SIDEBAR INFO PANEL  (merged status / reporter / assignee)
   ════════════════════════════════════════════════════════════ */
.sb-info-panel { padding: 0; overflow: hidden; }
.sb-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.sb-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px;
}
.sb-value { }
.sb-divider { margin: 0; border: none; border-top: 0.5px solid var(--border-lt); }

/* Assignee picker */
.assignee-current { cursor: pointer; position: relative; }
.assignee-person--clickable {
  display: flex; align-items: center; gap: 8px;
}
.assignee-person--clickable:hover .sidebar-person__name { color: var(--navy); }
.assignee-clear {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; line-height: 1;
  padding: 0 2px;
  display: flex; align-items: center;
}
.assignee-clear:hover { color: var(--text-danger); }
.assignee-empty {
  background: none; border: 0.5px dashed var(--border);
  border-radius: var(--r); padding: 6px 10px;
  font-size: 12px; color: var(--text-muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font);
  transition: border-color .12s, color .12s;
}
.assignee-empty:hover { border-color: var(--navy); color: var(--navy); }

.assignee-dropdown {
  position: relative;
  margin-top: 6px;
  background: var(--bg-primary);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  overflow: hidden;
  z-index: 50;
}
.assignee-search {
  width: 100%; box-sizing: border-box;
  padding: 8px 10px;
  border: none; border-bottom: 0.5px solid var(--border-lt);
  background: var(--bg-secondary);
  font-size: 13px; color: var(--text); font-family: var(--font);
  outline: none;
}
.assignee-list { max-height: 200px; overflow-y: auto; }
.assignee-option {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  background: none; border: none; cursor: pointer;
  font-size: 12px; font-family: var(--font); color: var(--text);
  text-align: left;
  transition: background .1s;
}
.assignee-option:hover   { background: var(--bg-secondary); }
.assignee-option.is-selected { background: var(--bg-info); }
.assignee-empty-msg { padding: 10px; font-size: 12px; color: var(--text-muted); text-align: center; }

/* Status pill as clickable button */
.status-pill-btn {
  display: inline-flex; align-items: center;
  border: none; cursor: pointer; font-family: var(--font);
  font-size: 12px; font-weight: 500;
  padding: 3px 8px; border-radius: 20px;
  transition: opacity .12s;
}
.status-pill-btn:hover { opacity: .8; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES  (must come after all component rules)
   ════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* Filter panel — stack columns */
  .filter-panel-grid { grid-template-columns: 1fr; }

  /* Ticket detail — stack to single column */
  .ticket-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "main"
      "sidebar"
      "comments";
  }

  /* Suggestions list — card layout */
  .suggestions-table-wrap { overflow-x: unset; }

  .suggestions-table,
  .suggestions-table tbody { display: block; }
  .suggestions-table thead  { display: none; }

  .suggestions-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title votes"
      "meta  votes";
    gap: 4px 12px;
    align-items: center;
    padding: 12px 14px;
    border: 0.5px solid var(--border-lt);
    border-radius: var(--r-lg);
    margin-bottom: 8px;
    background: var(--bg-primary);
    cursor: pointer;
  }
  .suggestions-table tr:hover { background: var(--bg-secondary); }

  /* Reset td styles that only make sense in a real table */
  .suggestions-table td              { border-bottom: none; padding: 0; vertical-align: middle; }
  .suggestions-table tr:last-child td { border-bottom: none; }
  .suggestions-table tr:hover td    { background: transparent; }

  /* Map cells to grid areas */
  .suggestions-table td:nth-child(1) { display: none; }            /* ID */
  .suggestions-table td:nth-child(2) { grid-area: title; }         /* Title */
  .suggestions-table td:nth-child(3) { grid-area: meta; }          /* Status */
  .suggestions-table td:nth-child(4) { display: none; }            /* Submitter */
  .suggestions-table td:nth-child(5) { grid-area: votes; display: flex; align-items: center; } /* Votes */
}
