/*
 * AStA Mitgliederverwaltung - Oberfläche (2026)
 * Liegt über bootstrap.min.css. Farben angelehnt an die Westküste:
 * Priel (tiefes Blau), Deich (Grün), Watt (Grau), Leuchtturm (Rot, nur für Löschen).
 * Bewusst Systemschriften: keine Google Fonts (Datenschutz).
 */

:root {
    --priel: #0F4C5C;
    --priel-dark: #0A3642;
    --priel-light: #E3EEF1;
    --deich: #3E7B4F;
    --deich-light: #E4F0E7;
    --watt: #EEF2F3;
    --schlick: #1F2D33;
    --grau: #5E6E75;
    --linie: #CDD7DA;
    --leuchtturm: #B8352A;
    --sand: #F6EFD9;
}

html, body {
    background: var(--watt);
    color: var(--schlick);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

body { padding-top: 56px; }

a { color: var(--priel); }
a:hover, a:focus { color: var(--priel-dark); }

:focus-visible { outline: 3px solid #F2B84B; outline-offset: 2px; }

/* ---------- Navigation ---------- */

.navbar-inverse {
    background: var(--priel);
    border: 0;
    border-bottom: 4px solid var(--deich);
    min-height: 52px;
}
.navbar-inverse .navbar-brand {
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.navbar-inverse .navbar-brand:hover { color: #fff; }
.navbar-inverse .navbar-nav > li > a { color: rgba(255, 255, 255, 0.82); }
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus { color: #fff; background: var(--priel-dark); }
.navbar-inverse .navbar-nav > li.active > a,
.navbar-inverse .navbar-nav > li.active > a:hover { color: #fff; background: var(--priel-dark); }
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus { background: var(--priel-dark); }
.navbar-inverse .navbar-toggle { border-color: rgba(255,255,255,.4); }

/* ---------- Seitenkopf ---------- */

.page-header {
    border: 0;
    margin: 28px 0 6px;
    padding: 0;
    font-size: 28px;
    font-weight: 600;
}
.page-header small { color: var(--grau); font-size: 60%; font-weight: 400; margin-left: 6px; }

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 22px;
    font-size: 13px;
}

hr { border-top-color: var(--linie); }

footer { color: var(--grau); font-size: 13px; margin: 40px 0 30px; }

/* ---------- Flächen ---------- */

.panel-asta {
    background: #fff;
    border: 1px solid var(--linie);
    border-radius: 6px;
    padding: 20px 22px;
    margin-bottom: 22px;
}
.panel-asta > h2, .panel-asta > h3 { margin-top: 0; }
.panel-asta h2 { font-size: 20px; font-weight: 600; }
.panel-asta h3 { font-size: 17px; font-weight: 600; }

.muted { color: var(--grau); }
.lead-small { font-size: 16px; color: var(--grau); margin-top: -4px; }

/* ---------- Buttons ---------- */

.btn { border-radius: 4px; font-weight: 500; }
.btn-primary { background: var(--priel); border-color: var(--priel); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-primary.active, .open > .dropdown-toggle.btn-primary { background: var(--priel-dark); border-color: var(--priel-dark); }
.btn-success { background: var(--deich); border-color: var(--deich); }
.btn-success:hover, .btn-success:focus { background: #2F6340; border-color: #2F6340; }
.btn-danger { background: var(--leuchtturm); border-color: var(--leuchtturm); }
.btn-link-danger { color: var(--leuchtturm); background: none; border: 0; padding: 0; }
.btn-link-danger:hover { text-decoration: underline; color: #8E2820; }
.btn-plain { background: none; border: 0; padding: 0; color: var(--priel); }
.btn-plain:hover { text-decoration: underline; }

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 18px;
}
.toolbar .spacer { flex: 1 1 auto; }
.toolbar .form-control { width: auto; display: inline-block; }

/* ---------- Status ---------- */

.status {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}
.status-aktiv { background: var(--deich-light); color: #2A5A38; }
.status-inaktiv { background: #E7EBED; color: #56656C; }
.status-neu { background: var(--priel-light); color: var(--priel-dark); }
.status-fehler { background: #F7E1DF; color: #8E2820; }
.status-gleich { background: #E7EBED; color: #56656C; }

.ref-chip { white-space: nowrap; }
.ref-chip.inaktiv { color: var(--grau); }

/* ---------- Dashboard ---------- */

.hello { font-size: 30px; font-weight: 600; margin: 8px 0 4px; }

.action-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin: 18px 0 26px;
}
.action-tile {
    display: block;
    background: #fff;
    border: 1px solid var(--linie);
    border-left: 5px solid var(--priel);
    border-radius: 6px;
    padding: 16px 18px;
    color: var(--schlick);
}
.action-tile:hover, .action-tile:focus { text-decoration: none; border-color: var(--priel); color: var(--schlick); background: #FBFDFD; }
.action-tile .fa { color: var(--priel); font-size: 20px; margin-bottom: 6px; display: block; }
.action-tile strong { display: block; font-size: 16px; }
.action-tile span { color: var(--grau); font-size: 13.5px; }
.action-tile.green { border-left-color: var(--deich); }
.action-tile.green .fa { color: var(--deich); }

.numbers { display: flex; flex-wrap: wrap; gap: 28px; margin: 4px 0 6px; }
.numbers div { font-size: 13.5px; color: var(--grau); }
.numbers b { display: block; font-size: 26px; color: var(--schlick); font-weight: 600; font-variant-numeric: tabular-nums; }

.ref-card {
    background: #fff;
    border: 1px solid var(--linie);
    border-top: 4px solid var(--deich);
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 16px;
}
.ref-card h3 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }

/* ---------- Schritte (Import) ---------- */

.steps { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 6px 22px; counter-reset: step; }
.steps li { counter-increment: step; color: var(--grau); font-size: 14px; }
.steps li::before {
    content: counter(step);
    display: inline-block;
    width: 24px; height: 24px; line-height: 24px;
    text-align: center; border-radius: 50%;
    background: #DDE4E6; color: var(--grau);
    font-weight: 600; margin-right: 7px; font-size: 13px;
}
.steps li.current { color: var(--schlick); font-weight: 600; }
.steps li.current::before { background: var(--priel); color: #fff; }
.steps li.done::before { background: var(--deich); color: #fff; content: "\2713"; }

.dropzone {
    border: 2px dashed #A9B8BD;
    border-radius: 8px;
    background: #fff;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--priel); background: #F6FAFB; }
.dropzone .fa { font-size: 34px; color: var(--priel); }
.dropzone input[type=file] { margin: 12px auto 0; }
.dropzone .filename { font-weight: 600; margin-top: 8px; }

.mapping-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 16px; }
.mapping-grid label { font-size: 13px; color: var(--grau); font-weight: 600; margin-bottom: 2px; }

.preview-table td, .preview-table th { font-size: 13.5px; vertical-align: top !important; }
.preview-table tr.row-error td { background: #FCF3F2; }
.preview-table .notes { font-size: 12.5px; color: #7A5B12; }
.preview-table tr.row-error .notes { color: #8E2820; }

.sticky-actions {
    position: sticky; bottom: 0; z-index: 5;
    background: rgba(238, 242, 243, 0.96);
    border-top: 1px solid var(--linie);
    padding: 12px 0;
    margin-top: 10px;
}

/* ---------- Schnell-Eintragen ---------- */

.quick-grid { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.quick-grid th { font-size: 12.5px; color: var(--grau); font-weight: 600; padding: 0 4px; white-space: nowrap; }
.quick-grid td { padding: 0 4px; }
.quick-grid .form-control { height: 36px; padding: 5px 9px; }
.quick-grid td.row-no { width: 26px; color: var(--grau); font-size: 13px; text-align: right; }
.quick-grid .remove-row { color: var(--grau); font-size: 18px; line-height: 1; }
.quick-grid .remove-row:hover { color: var(--leuchtturm); text-decoration: none; }
.quick-grid tr.has-error .form-control.missing { border-color: var(--leuchtturm); background: #FDF5F4; }
.paste-hint { background: var(--sand); border-radius: 4px; padding: 8px 12px; font-size: 13.5px; margin-bottom: 12px; }

/* ---------- Formulare ---------- */

label { font-weight: 600; }
.form-control { border-color: #B9C6CA; box-shadow: none; }
.form-control:focus { border-color: var(--priel); box-shadow: 0 0 0 3px rgba(15, 76, 92, 0.15); }
.required-mark { color: var(--leuchtturm); }

.ref-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.ref-row .ref-name { min-width: 180px; font-weight: 600; }
.ref-row select { width: auto; }

.form-narrow { max-width: 620px; }

/* ---------- Tabellen ---------- */

.table > thead > tr > th { border-bottom-width: 1px; font-size: 13.5px; color: var(--grau); }
table.dataTable { background: #fff; }
table.dataTable thead th { border-bottom: 1px solid var(--linie) !important; }
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #B9C6CA; border-radius: 4px; padding: 5px 9px; margin-left: 6px; min-width: 220px;
}
.dataTables_wrapper .dataTables_length select { border: 1px solid #B9C6CA; border-radius: 4px; padding: 3px; }
.table-wrap { overflow-x: auto; }

/* ---------- Login ---------- */

.login-page { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; }
body.login-body { padding-top: 0; background: var(--priel); }
.login-box {
    background: #fff;
    width: 100%; max-width: 380px;
    border-radius: 8px;
    padding: 30px 30px 26px;
    border-bottom: 5px solid var(--deich);
}
.login-box h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.login-box p { color: var(--grau); margin-bottom: 20px; }
.login-box .form-control { height: 42px; }

@media (max-width: 767px) {
    .page-header { font-size: 23px; }
    .hello { font-size: 24px; }
    .toolbar .form-control { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* ---------- Mitglieder: Referate-Übersicht ---------- */

.member-search { position: relative; flex: 1 1 280px; max-width: 420px; margin: 0; }
.member-search .fa { position: absolute; left: 12px; top: 11px; color: var(--grau); }
.member-search input.form-control { width: 100%; padding-left: 34px; height: 38px; }

.ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 6px;
}
.ref-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--linie);
    border-radius: 6px;
    padding: 16px 18px 14px;
    color: var(--schlick);
}
.ref-tile:hover, .ref-tile:focus { text-decoration: none; color: var(--schlick); border-color: var(--priel); box-shadow: inset 0 0 0 1px var(--priel); }
.ref-tile strong { font-size: 18px; font-weight: 600; line-height: 1.25; }
.ref-counts { display: flex; gap: 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.ref-counts .n-aktiv { color: #2A5A38; font-weight: 600; }
.ref-counts .n-inaktiv { color: var(--grau); }
.ref-bar { display: block; height: 4px; background: #E3E8EA; border-radius: 2px; overflow: hidden; }
.ref-bar span { display: block; height: 100%; background: var(--deich); }
.ref-lead { font-size: 13px; color: var(--grau); }
.ref-tile-muted { background: transparent; border-style: dashed; }

.back-link { margin: -6px 0 10px; font-size: 14px; }
.ref-title { font-size: 26px; font-weight: 600; line-height: 1.2; }
.section-title { font-size: 20px; font-weight: 600; margin: 4px 0 14px; }

.seg { display: inline-flex; border: 1px solid #B9C6CA; border-radius: 6px; overflow: hidden; margin-bottom: 16px; background: #fff; }
.seg a { padding: 7px 16px; color: var(--schlick); border-right: 1px solid #B9C6CA; font-size: 14px; }
.seg a:last-child { border-right: 0; }
.seg a b { font-weight: 600; color: var(--grau); margin-left: 4px; font-variant-numeric: tabular-nums; }
.seg a:hover { background: var(--priel-light); text-decoration: none; }
.seg a.on { background: var(--priel); color: #fff; }
.seg a.on b { color: rgba(255,255,255,.85); }

a.ref-chip { color: var(--schlick); }
a.ref-chip.inaktiv { color: var(--grau); }

/* Tabellenkopf-Zeile für Gruppen (Vorlagenliste) */
table.table-card { background: #fff; }
tr.group-row th { background: #EEF2F3; color: #1F2D33; font-size: 15px; }

/* ---------- Navigation ----------
   Viele Menüpunkte: unter 1200px wird das Menü eingeklappt (Bootstrap tut das sonst erst unter 768px),
   darüber passt alles in eine Zeile. */
.navbar-inverse .navbar-nav > li > a { padding-left: 12px; padding-right: 12px; font-size: 14px; }
@media (min-width: 768px) and (max-width: 1199px) {
    .navbar-header { float: none; }
    .navbar-toggle { display: block; }
    .navbar-collapse { border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,.1); }
    .navbar-collapse.collapse { display: none !important; }
    .navbar-collapse.collapse.in { display: block !important; overflow-y: auto; }
    .navbar-fixed-top .navbar-collapse { max-height: 70vh; }
    .navbar-nav { float: none !important; margin: 7px -15px; }
    .navbar-nav > li { float: none; }
    .navbar-nav > li > a { padding-top: 10px; padding-bottom: 10px; }
    .navbar-right { float: none !important; }
    .navbar-nav .open .dropdown-menu { position: static; float: none; width: auto; margin-top: 0; background-color: transparent; border: 0; box-shadow: none; }
    .navbar-inverse .navbar-nav .open .dropdown-menu > li > a { color: #dbe9ec; }
}

/* Mehrfachauswahl: Anzahl in der Aktionsleiste */
.sticky-actions .bulk-count { display: inline-block; margin-right: 14px; font-weight: 700; }
.sticky-actions .btn { margin-right: 6px; }

/* Breiterer Inhaltsbereich auf großen Bildschirmen: die Mitgliedertabellen haben viele Spalten */
@media (min-width: 1200px) {
    .container { width: 96%; max-width: 1400px; }
}

/* Importvorschau: Tabelle liegt schon in einem Kasten, braucht keinen zweiten Rahmen */
.preview-scroll { overflow-x: auto; }
.preview-table > thead > tr > th, .preview-table > tbody > tr > td { padding: 6px 6px; }
.preview-table td:last-child { min-width: 240px; }
.preview-table .status { white-space: normal; }

/* Logo als Aushängeschild an der Navigationsleiste (klassisches und Pixel-Design) */
.navbar-inverse .navbar-brand.brand-logo { position: relative; width: 150px; padding: 0; }
.brand-sign {
    position: absolute; left: 15px; top: 0; display: block; background: var(--ink, #0F4C5C); padding: 0 3px 3px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px), calc(100% - 3px) 100%, 3px 100%, 3px calc(100% - 3px), 0 calc(100% - 3px));
}
.brand-sign img { display: block; height: 70px; width: auto; box-sizing: border-box; padding: 5px 11px 7px; background: #fffdf8; }
.navbar-inverse .navbar-brand.brand-ref { color: #fff; font-size: 14px; }
@media (max-width: 1199px) {
    .navbar-inverse .navbar-brand.brand-logo { width: 120px; }
    .brand-sign img { height: 52px; padding: 3px 8px 4px; }
}

/* Design-Auswahl im Profil */
.theme-option { margin: 0 0 10px; }
.theme-option .btn { min-width: 270px; text-align: left; margin-right: 8px; }
.theme-option .muted { display: block; margin: 4px 0 0 3px; font-size: 12px; }

/* Referatsleitung: Tabellen ohne zweiten Rahmen; die Aktionen dürfen umbrechen, damit "Entfernen" immer sichtbar ist */
.plain-scroll { overflow-x: auto; }
td.row-actions { min-width: 230px; line-height: 1.9; }
.quick-grid select.form-control { min-width: 92px; }

/* Merch-Bestand (nur Büro). Farben kommen aus dem jeweiligen Design (Variablen), mit Ersatzwerten für das schlichte Design. */
.merch-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 0 3px 22px; }
.merch-stat { margin: 0 !important; padding: 10px 14px !important; text-align: left; }
.merch-stat b { display: block; font-family: var(--font-px, inherit); font-weight: normal; font-size: 40px; line-height: 1.1; -webkit-font-smoothing: none; }
.merch h2 { margin-top: 0; }
.merch h2 .fa { color: var(--accent, var(--pink, #0F4C5C)); margin-right: 6px; }
.merch-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 22px; align-items: start; }
.merch-cols > div > .panel-asta { margin-bottom: 22px; }
.merch-row2 { display: grid; grid-template-columns: 1fr 1.3fr; gap: 22px; align-items: start; }
.merch-row2 > .panel-asta { margin-bottom: 22px; }
.merch-matrix { width: 100%; border-collapse: collapse; font-size: 14px; }
.merch-matrix th { font-weight: 700; color: var(--link, var(--cyan, #0F4C5C)); padding: 7px 12px; border-bottom: 3px solid var(--edge, #0F4C5C); text-align: left; white-space: nowrap; }
.merch-matrix th.num { text-align: right; }
.merch-matrix th.sz { border-bottom: 1px solid var(--line, var(--card2, #d8e0e0)); color: var(--text, #1c2b2b); width: 110px; }
.merch-matrix td { padding: 5px 12px; border-bottom: 1px solid var(--line, var(--card2, #d8e0e0)); }
.merch-matrix td.num { text-align: right; font-variant-numeric: tabular-nums; }
.merch-matrix td.z { color: var(--dim, #9aa); opacity: .7; }
.merch-matrix td.lo, .merch-matrix b.lo { background: #fff3cf; color: #8a5f00; font-weight: 700; }
.merch-matrix b.z { color: var(--dim, #9aa); font-weight: 400; }
.merch-matrix td.rs { color: var(--dim, #5b7370); font-weight: 700; border-left: 3px dotted var(--edge-soft, var(--edge, #b9c7c7)); }
.merch-matrix tr.tot th, .merch-matrix tr.tot td { border-top: 3px solid var(--edge, #0F4C5C); border-bottom: 0; background: var(--card2, #eef3f3); font-weight: 700; }
.merch-matrix td.grand, .merch-matrix tr.tot td.grand { background: var(--accent, var(--pink, #0F4C5C)); color: #fff; font-weight: 700; }
.merch-matrix td.flat { text-align: left; white-space: normal; }
.merch-matrix td.flat .lo { background: #fff3cf; color: #8a5f00; font-weight: 700; padding: 0 6px; }
.merch-matrix td.flat .z { color: var(--dim, #9aa); }
.merch-matrix .vitem { display: inline-flex; align-items: center; gap: 8px; margin: 3px 18px 3px 0; }
.merch-matrix .vitem b { padding: 0 6px; }
.merch-matrix .vlab { white-space: nowrap; }
.sw { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--text, #1c2b2b); vertical-align: -2px; margin-right: 7px; }
.sw-x { background: repeating-linear-gradient(45deg, #fff, #fff 2px, #cfc9bd 2px, #cfc9bd 4px); }
.lo-key { background: #fff3cf; color: #8a5f00; font-weight: 700; padding: 0 6px; }
.stp { display: inline-flex; align-items: center; gap: 4px; }
.stp button { width: 34px; height: 34px; border: 3px solid var(--field, #0F4C5C); background: var(--card2, #eef3f3); color: var(--text, #1c2b2b); font-weight: 700; font-size: 18px; line-height: 1; padding: 0; cursor: pointer; }
.stp input { width: 58px; height: 34px; text-align: center; border: 3px solid var(--field, #0F4C5C); background: #fff; color: #1c1c28; font-family: var(--font-mono, monospace); font-size: 15px; padding: 0; border-radius: 0; }
.stp input:focus, .stp button:focus { outline: 3px solid var(--accent, var(--pink, #0F4C5C)); outline-offset: 1px; }
td.chg .stp input, .vitem.chg .stp input { background: #fff3cf; border-color: #e0a800; }
td.chg .stp button, .vitem.chg .stp button { border-color: #e0a800; }
.merch-matrix input.price { display: inline-block; width: 84px; height: 34px; text-align: right; font-family: var(--font-mono, monospace); font-size: 15px; padding: 0 8px; border: 3px solid var(--field, #0F4C5C); background: #fff; color: #1c1c28; border-radius: 0; }
.merch-matrix input.price.chg { background: #fff3cf; border-color: #e0a800; }
.merch .value { margin-top: 14px; padding-top: 12px; border-top: 3px dotted var(--edge-soft, var(--edge, #b9c7c7)); color: var(--dim, #5b7370); }
.merch .value b { display: block; font-family: var(--font-px, inherit); font-weight: normal; font-size: 36px; color: var(--text, #1c2b2b); -webkit-font-smoothing: none; }
@media (max-width: 991px) { .merch-cols, .merch-row2 { grid-template-columns: 1fr; } }
.merch-bar { flex-wrap: nowrap; align-items: center; }
.merch-bar .merch-note { flex: 1 1 auto; min-width: 0; }
.merch-bar .spacer { flex: 0 0 12px; }
.merch-bar .btn { white-space: nowrap; flex: 0 0 auto; margin-left: 6px; }
@media (max-width: 767px) { .merch-bar { flex-wrap: wrap; } }
/* Merch im Nacht-Design: dunkle Eingabefelder wie im übrigen Nacht-Design */
html.th-nacht .stp input, html.th-nacht .merch-matrix input.price { background: #0a0826; color: #dcd9ff; }
html.th-nacht td.chg .stp input, html.th-nacht .vitem.chg .stp input, html.th-nacht .merch-matrix input.price.chg { background: #4a3a00; color: #fff3cf; }
@media (prefers-color-scheme: dark) {
    html.th-system .stp input, html.th-system .merch-matrix input.price { background: #0a0826; color: #dcd9ff; }
    html.th-system td.chg .stp input, html.th-system .vitem.chg .stp input, html.th-system .merch-matrix input.price.chg { background: #4a3a00; color: #fff3cf; }
}

/* StuPa-Übersicht (nur ansehen) */
.stupa-bar { flex-wrap: nowrap; align-items: center; }
.stupa-bar .stupa-note { flex: 1 1 auto; min-width: 0; }
.stupa-bar .spacer { flex: 0 0 12px; }
.stupa-bar .seg, .stupa-bar .btn { flex: 0 0 auto; margin-left: 8px; white-space: nowrap; }
.stupa-search { max-width: 420px; margin: 0 3px 20px; }
.stupa-card { margin-bottom: 22px; }
.stupa-card h2 { margin-top: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stupa-card h2 .fa { color: var(--accent, var(--pink, #0F4C5C)); margin-right: 4px; }
.stupa-count { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--dim, #5b7370); }
.stupa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 22px; align-items: start; }
.stupa-grid .stupa-card { margin-bottom: 0; }
.stupa-ref[data-ref] { border-top: 6px solid var(--ra); }
.stupa-ref[data-ref] .stupa-count { color: var(--rt, var(--dim)); font-weight: 700; }
.stupa-table { width: 100%; margin: 0; }
.stupa-table th { color: var(--link, var(--cyan, #0F4C5C)); font-size: 12.5px; }
.stupa-table td { vertical-align: middle; }
.stupa-table tr.stupa-off td { opacity: .6; }
.stupa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.stupa-chip { display: inline-block; padding: 5px 14px; background: var(--card2, #eef3f3); border: 3px solid var(--edge, #0F4C5C); font-weight: 700; }
@media (max-width: 767px) { .stupa-grid { grid-template-columns: 1fr; } .stupa-bar { flex-wrap: wrap; } }
