/* Moschee-Verwaltung – ruhiges Grün, warmer Sandton, Gold als Akzent */
:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --ink: #1c2622;
  --muted: #64706a;
  --line: #e2ddd1;
  --primary: #1e5a43;
  --primary-ink: #ffffff;
  --primary-soft: #e3efe8;
  --gold: #b8892a;
  --gold-soft: #f6ecd2;
  --ok: #217a4b;   --ok-soft: #dcf0e3;
  --warn: #9a6400; --warn-soft: #fbedcc;
  --bad: #b3312b;  --bad-soft: #f8dedb;
  --info: #2c5f8a; --info-soft: #deeaf5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 38, 34, .06), 0 2px 8px rgba(28, 38, 34, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121815; --surface: #1a221e; --ink: #e8ece9; --muted: #9aa69f; --line: #2c3631;
    --primary: #3f9b74; --primary-ink: #0b130f; --primary-soft: #1f3a2e;
    --gold: #e0b75a; --gold-soft: #3a3020;
    --ok: #5cc48b; --ok-soft: #173826; --warn: #e3a94a; --warn-soft: #3a2d14;
    --bad: #ef7b72; --bad-soft: #3d1d1b; --info: #7fb2de; --info-soft: #1c2c3a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--primary-soft); padding: .05em .35em; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pre { white-space: pre-line; }
.text-bad { color: var(--bad); }
.text-warn { color: var(--warn); }
[hidden] { display: none !important; }

/* ---------- Kopf & Navigation ---------- */
.top { background: var(--primary); color: var(--primary-ink); }
@media (prefers-color-scheme: dark) { .top { background: #16241d; color: var(--ink); } }
.top-inner { max-width: 1120px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.top > .top-inner { min-height: 56px; justify-content: space-between; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.brand img { border-radius: 7px; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.top-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .9rem; }
.who small { opacity: .75; margin-left: 4px; }
.top .link-sm, .top .link-sm:visited { color: inherit; opacity: .85; }
.lang { display: flex; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; overflow: hidden; }
.lang a { color: inherit; text-decoration: none; padding: 2px 10px; font-size: .8rem; font-weight: 600; opacity: .8; }
.lang a.on { background: var(--gold); color: #1c1608; opacity: 1; }
.main-nav { background: rgba(0,0,0,.14); }
.main-nav .top-inner { overflow-x: auto; gap: 2px; scrollbar-width: none; }
.main-nav .top-inner::-webkit-scrollbar { display: none; }
.main-nav a {
  color: inherit; text-decoration: none; padding: 10px 12px; white-space: nowrap; font-size: .94rem;
  opacity: .82; border-bottom: 3px solid transparent;
}
.main-nav a:hover { opacity: 1; }
.main-nav a.on { opacity: 1; border-bottom-color: var(--gold); font-weight: 600; }

.wrap { max-width: 1120px; width: 100%; margin: 0 auto; padding: 24px 16px 64px; flex: 1; }
.foot { color: var(--muted); font-size: .8rem; border-top: 1px solid var(--line); }
.foot .wrap { padding: 16px; }

/* ---------- Seitenkopf ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.crumb { font-size: .85rem; margin-bottom: 2px; }
.crumb a { color: var(--muted); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2 { margin: 0; }
section { margin-bottom: 24px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: .94rem; font-weight: 600; line-height: 1.2;
  padding: 9px 16px; border-radius: 10px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: .84rem; border-radius: 8px; }
.btn.big { padding: 13px 28px; font-size: 1rem; }
button.link-sm { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
form.inline { display: inline; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Karten & Raster ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.narrow { max-width: 640px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid .card { margin: 0; }
.class-card h3 { font-size: 1.1rem; }
.class-card h3 a { color: var(--ink); text-decoration: none; }
.class-card h3 a:hover { color: var(--primary); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
.stat b { font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .86rem; }
a.stat:hover { border-color: var(--primary); }
.stat.ok b { color: var(--ok); }
.stat.warn b { color: var(--warn); }

progress.bar { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border: 0; border-radius: 999px; background: var(--primary-soft); overflow: hidden; margin: 6px 0 12px; }
progress.bar::-webkit-progress-bar { background: var(--primary-soft); border-radius: 999px; }
progress.bar::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
progress.bar::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
progress.bar.sm { width: 90px; height: 7px; margin: 0 6px 0 0; vertical-align: middle; }
.fee-summary { display: flex; gap: 20px; flex-wrap: wrap; font-size: .95rem; }
.fee-summary a { text-decoration: none; }

/* ---------- Badges, Listen ---------- */
.badge { display: inline-block; font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.muted { background: var(--line); color: var(--muted); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.role-admin { background: var(--bad-soft); color: var(--bad); }
.badge.role-hoca { background: var(--gold-soft); color: var(--gold); }
.badge.role-lehrkraft { background: var(--info-soft); color: var(--info); }
.badge.role-schueler { background: var(--line); color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 0; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 10px 0 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.kv.big dd { font-size: 1.1rem; }
.empty { color: var(--muted); padding: 24px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state { text-align: center; padding: 60px 16px; }
.empty-state h1 { font-size: 3rem; color: var(--primary); }

.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.flash.error { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.note { padding: 10px 14px; border-radius: 10px; background: var(--info-soft); color: var(--info); font-size: .92rem; }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.note.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-wrap { box-shadow: none; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--bg); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 40%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.c, th.c { text-align: center; padding: 8px 4px; }
td.actions { white-space: nowrap; }
tr.inactive td { opacity: .55; }
.grid-table td, .grid-table th { border-right: 1px solid var(--line); }
.grid-table td:last-child, .grid-table th:last-child { border-right: 0; }

/* ---------- Formulare ---------- */
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; }
label small { font-weight: 400; }
input, select, textarea {
  font: inherit; font-weight: 400; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; width: 100%; min-height: 42px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--primary); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 0; }
legend { font-size: .9rem; font-weight: 600; padding: 0 6px; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; }
.checks.scroll { max-height: 260px; overflow-y: auto; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.filters label { min-width: 180px; }
.filters label.check { min-width: 0; min-height: 42px; }
.picked { display: flex; flex-direction: column; gap: 2px; min-height: 42px; justify-content: flex-end; padding-bottom: 6px; }
.month-nav { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.month-nav b { min-width: 9em; text-align: center; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .9rem; }
.tabs a.on { background: var(--primary); color: var(--primary-ink); }
.danger-zone { margin-top: 10px; }
.after-table { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Segment-Schalter (Anwesenheit/Status) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; padding: 0; background: var(--surface); }
fieldset.seg { display: flex; padding: 0; }
fieldset.seg legend { padding: 0 0 6px; }
.seg-opt { flex-direction: row; position: relative; margin: 0; font-weight: 500; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: block; padding: 8px 12px; font-size: .88rem; cursor: pointer; border-left: 1px solid var(--line); user-select: none; }
.seg-opt:first-of-type span { border-left: 0; }
.seg-opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: -3px; }
.seg-opt input:checked + span { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.seg-opt.late input:checked + span, .seg-opt.t-partial input:checked + span { background: var(--warn); color: #fff; }
.seg-opt.excused input:checked + span { background: var(--info); color: #fff; }
.seg-opt.absent input:checked + span { background: var(--bad); color: #fff; }
.seg-opt.t-open input:checked + span { background: var(--muted); color: #fff; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.att-list { list-style: none; margin: 0 0 16px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.att-list li { display: grid; grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1.2fr); gap: 10px 16px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.att-list li:first-child { border-top: 0; }
.att-name { font-weight: 600; }
.att-name a { color: var(--ink); text-decoration: none; }
.att-note, .grade { min-height: 36px; padding: 6px 10px; font-size: .9rem; }
.pair { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); display: flex; justify-content: flex-end; }

/* Anwesenheitsverlauf */
.att-dots { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dot { display: flex; flex-direction: column; align-items: center; min-width: 52px; padding: 5px 6px; border-radius: 8px; font-size: .75rem; }
.dot .d { color: inherit; opacity: .8; }
.dot .s { font-weight: 700; font-size: .85rem; }
.dot.present, .cell.present { background: var(--ok-soft); color: var(--ok); }
.dot.late, .cell.late { background: var(--warn-soft); color: var(--warn); }
.dot.excused, .cell.excused { background: var(--info-soft); color: var(--info); }
.dot.absent, .cell.absent { background: var(--bad-soft); color: var(--bad); }
.dot-legend { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.dot-legend.present { background: var(--ok); } .dot-legend.late { background: var(--warn); }
.dot-legend.excused { background: var(--info); } .dot-legend.absent { background: var(--bad); }
.cell { display: inline-block; min-width: 24px; padding: 1px 4px; border-radius: 5px; font-weight: 700; font-size: .8rem; }
.legend .cell { margin-right: 2px; }

/* Beiträge */
.pay-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-right: 6px; }
.pay-form select, .pay-form input { width: auto; min-height: 32px; padding: 4px 8px; font-size: .85rem; }
.amount-edit summary { cursor: pointer; list-style: none; text-decoration: underline dotted; text-underline-offset: 3px; }
.amount-edit summary::-webkit-details-marker { display: none; }
.mini-form { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; align-items: flex-end; }
.mini-form input { width: 140px; min-height: 32px; padding: 4px 8px; font-size: .85rem; }

/* Login */
.auth-card { max-width: 400px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.auth-icon { display: block; margin-bottom: 12px; border-radius: 12px; }
.auth-card .btn { width: 100%; padding: 12px; }
.credentials .pw { font-size: 1.3rem; letter-spacing: .06em; padding: .15em .5em; }

/* ---------- Mobil ---------- */
@media (max-width: 720px) {
  h1 { font-size: 1.35rem; }
  .wrap { padding: 18px 16px 48px; }
  .two { grid-template-columns: 1fr; }
  .att-list li { grid-template-columns: 1fr; gap: 8px; }
  .seg { display: flex; width: 100%; }
  .seg-opt { flex: 1; }
  .seg-opt span { text-align: center; padding: 10px 4px; font-size: .82rem; }
  .who small { display: none; }
  .filters label { min-width: 0; flex: 1 1 140px; }
  .page-head .row-actions { width: 100%; }
}

@media print {
  .top, .foot, .row-actions, .main-nav { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* =====================================================================
   App-Ansicht: Tab-Leiste unten, „Mehr“-Menü, Installation (PWA)
   ===================================================================== */
.tabbar { display: none; }
.ico { flex-shrink: 0; }

.profile-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 700; font-size: 1.3rem; }
.menu-list { list-style: none; margin: 0 0 16px; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.menu-list li { border-top: 1px solid var(--line); }
.menu-list li:first-child { border-top: 0; }
.menu-list a, .menu-btn, .menu-lang { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); text-decoration: none; min-height: 54px; }
.menu-list a .ico:first-child, .menu-btn .ico, .menu-lang .ico { color: var(--primary); }
.menu-list a span, .menu-btn span, .menu-lang > span { flex: 1; }
.menu-list a .ico:last-child { color: var(--muted); width: 18px; }
.menu-list a:active, .menu-btn:active { background: var(--primary-soft); }
.menu-btn { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu-btn.danger, .menu-btn.danger .ico { color: var(--bad); }
.seg-link { padding: 6px 12px; font-size: .88rem; text-decoration: none; color: var(--ink); border-left: 1px solid var(--line); }
.seg-link:first-child { border-left: 0; }
.seg-link.on { background: var(--primary); color: var(--primary-ink); font-weight: 600; }
.install-hint { background: var(--gold-soft); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.install-hint p { margin: 0; }
.is-app .install-hint { display: none !important; }
.auth-icon.center { margin: 0 auto 12px; }

@media (max-width: 720px) {
  /* Kopfzeile wie in einer App: schmal und oben fixiert */
  .top { position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); }
  .top > .top-inner { min-height: 52px; flex-wrap: nowrap; }
  .main-nav, .desk { display: none !important; }
  .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
  .foot { display: none; }

  /* Tab-Leiste unten */
  body.has-tabs { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px 4px env(safe-area-inset-bottom);
    box-shadow: 0 -2px 12px rgba(28, 38, 34, .06);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 56px; padding: 4px 2px; color: var(--muted); text-decoration: none;
    font-size: .68rem; font-weight: 500; border-radius: 10px; -webkit-tap-highlight-color: transparent;
  }
  .tabbar a span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tabbar a.on { color: var(--primary); font-weight: 700; }
  .tabbar a.on .ico { background: var(--primary-soft); border-radius: 999px; padding: 2px 14px; width: 52px; height: 28px; box-sizing: border-box; }
  .tabbar a:active { background: var(--primary-soft); }

  /* Speichern-Knopf über der Tab-Leiste und volle Breite */
  .sticky-save { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .sticky-save .btn { width: 100%; }

  /* Größere Tippflächen */
  .btn { min-height: 44px; }
  .btn.sm { min-height: 36px; }
  .page-head { margin-bottom: 14px; }
  .page-head .row-actions .btn { flex: 1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat b { font-size: 1.35rem; }
  .card { padding: 14px 16px; }
  .wrap { padding-top: 16px; }
}

/* Als installierte App: kein Textmarkieren an Bedienelementen, kein Überscrollen */
.is-app body { overscroll-behavior-y: none; }
.is-app .tabbar a, .is-app .btn, .is-app .seg-opt span { -webkit-user-select: none; user-select: none; }

@media (max-width: 720px) {
  .seg-opt span { width: 100%; }
  .stats.stats-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stats.stats-3 .stat { padding: 10px 12px; }
  .stats.stats-3 .stat span { font-size: .75rem; }

  /* Beiträge als Karten statt breiter Tabelle */
  .fees-table thead { display: none; }
  .fees-table, .fees-table tbody { display: block; }
  .fees-table tr {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
    grid-template-areas: "name amount" "cls status" "act act";
    padding: 12px 14px; border-bottom: 1px solid var(--line);
  }
  .fees-table tbody tr:last-child { border-bottom: 0; }
  .fees-table td { display: block; border: 0; padding: 0; }
  .fees-table td:nth-child(1) { grid-area: name; font-weight: 600; }
  .fees-table td:nth-child(2) { grid-area: cls; color: var(--muted); font-size: .85rem; }
  .fees-table td:nth-child(3) { grid-area: amount; font-weight: 700; }
  .fees-table td:nth-child(4) { grid-area: status; text-align: right; }
  .fees-table td:nth-child(5) { grid-area: act; margin-top: 10px; white-space: normal; display: flex; flex-wrap: wrap; gap: 6px; }
  .fees-table .pay-form { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; margin: 0; }
  .fees-table .pay-form select, .fees-table .pay-form input { width: 100%; min-height: 40px; }
  .fees-table .pay-form button { grid-column: 1 / -1; min-height: 42px; }
  .fees-table form.inline { width: 100%; }
  .fees-table form.inline .btn { width: 100%; }
  .fees-table .mini-form { align-items: stretch; }
  .fees-table .mini-form input { width: 100%; }
  .fees-table tbody tr:hover { background: none; }
}

.backup-opt { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.backup-opt:first-of-type { border-top: 0; padding-top: 0; }
.backup-opt p { margin: 2px 0 0; }
.backup-opt .btn { flex-shrink: 0; }
@media (max-width: 720px) { .backup-opt { flex-direction: column; align-items: stretch; } }
