/* =====================================================================
   Mojeplatby — mobile-first styly.
   Pořadí: mobil (základ) -> tablet (48rem) -> desktop (64rem).
   ===================================================================== */

:root {
    --c-bg: #f4f5f7;
    --c-surface: #ffffff;
    --c-text: #1f2937;
    --c-muted: #6b7280;
    --c-border: #e5e7eb;
    --c-primary: #0f766e;     /* teal */
    --c-expense: #b91c1c;     /* červená */
    --c-income: #15803d;      /* zelená */
    --c-due: #f59e0b;         /* oranžová — v den splatnosti */
    --c-overdue: #dc2626;     /* červená — po splatnosti */
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --gap: .75rem;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-text-size-adjust: 100%;
}

/* --- Header / nav --------------------------------------------------- */
.app-header {
    position: sticky; top: 0; z-index: 30;
    background: var(--c-primary); color: #fff;
    padding: .6rem 1rem;
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.brand { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; display: inline-flex; align-items: center; gap: .5rem; }
.brand-logo { width: 32px; height: 32px; display: block; flex: none; }
.nav-toggle { display: inline-flex; background: none; border: 0; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: .1rem .3rem; }

.app-nav { display: none; }
.app-nav.is-open { display: flex; }
.nav-link, .nav-credits, .nav-user-btn, .dropdown-form button { color: rgba(255,255,255,.88); text-decoration: none; }
.nav-link { padding: .55rem .2rem; border-radius: 6px; }
.nav-link.is-active { color: #fff; font-weight: 700; box-shadow: inset 0 -2px 0 #fff; }
.nav-msg { position: relative; }
.badge-count { display: inline-block; min-width: 1.05rem; height: 1.05rem; line-height: 1.05rem; text-align: center; font-size: .68rem; font-weight: 700; color: #fff; background: var(--c-overdue); border-radius: 999px; padding: 0 .25rem; margin-left: .2rem; vertical-align: top; }

.nav-user-menu { position: relative; }
.nav-user-btn { background: rgba(255,255,255,.14); border: 0; border-radius: 999px; padding: .35rem .8rem; cursor: pointer; font: inherit; font-weight: 600; }
.nav-user-btn .caret { font-size: .7rem; }
.nav-user-dropdown { display: flex; flex-direction: column; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 12rem; padding: .35rem; margin-top: .35rem; }
.nav-user-dropdown[hidden] { display: none; }
.nav-user-dropdown a, .dropdown-form button { display: block; width: 100%; text-align: left; color: var(--c-text); padding: .5rem .6rem; border-radius: 8px; border: 0; background: none; cursor: pointer; font: inherit; text-decoration: none; }
.nav-user-dropdown a:hover, .dropdown-form button:hover { background: var(--c-bg); }
.dropdown-form { margin: 0; }
.dropdown-danger { color: var(--c-expense) !important; }

/* Mobil: nav je rozbalovací panel pod hlavičkou */
.app-nav.is-open {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--c-primary); padding: .5rem 1rem 1rem; gap: .15rem;
    box-shadow: var(--shadow); font-size: 1rem;
}
.app-nav.is-open .nav-credits { align-self: flex-start; margin: .3rem 0; }
.app-nav.is-open .nav-user-menu { margin-top: .3rem; }
.app-nav.is-open .nav-user-dropdown { position: static; margin-top: .3rem; width: 100%; }

/* --- Dark mode ----------------------------------------------------- */
[data-theme="dark"] {
    --c-bg: #0f172a;
    --c-surface: #1e293b;
    --c-text: #e5e7eb;
    --c-muted: #94a3b8;
    --c-border: #334155;
    --c-primary: #0f766e;
    --shadow: 0 1px 3px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.4);
}
[data-theme="dark"] body { background: var(--c-bg); color: var(--c-text); }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
    background: #0b1220; color: var(--c-text); border-color: var(--c-border);
}
[data-theme="dark"] .info-panel, [data-theme="dark"] .qr-reader { background: #0b1220; }
[data-theme="dark"] .qr-canvas { background: #fff; }   /* QR musí zůstat na bílém */
[data-theme="dark"] .seg, [data-theme="dark"] .sortform select { background: var(--c-surface); }
[data-theme="dark"] .btn--ghost { background: var(--c-surface); color: var(--c-text); }
[data-theme="dark"] .badge--ok { background: #064e3b; color: #d1fae5; }
[data-theme="dark"] .badge--off { background: #7f1d1d; color: #fee2e2; }
[data-theme="dark"] .badge--warn { background: #78350f; color: #fef3c7; }
[data-theme="dark"] .alert--success { background: #064e3b; color: #d1fae5; border-color: #065f46; }
[data-theme="dark"] .alert--error { background: #7f1d1d; color: #fee2e2; border-color: #991b1b; }
[data-theme="dark"] .alert--info { background: #1e3a8a; color: #dbeafe; border-color: #1e40af; }
[data-theme="dark"] .chip, [data-theme="dark"] .chip-del button { background: var(--c-surface); }
[data-theme="dark"] .chip--active { background: #134e4a; }

.app-main { padding: 1rem; max-width: 70rem; margin: 0 auto; }
.app-footer { text-align: center; color: var(--c-muted); padding: 1.5rem; }

.section-title { font-size: 1rem; margin: 1.25rem 0 .5rem; }

/* --- Karty sum ------------------------------------------------------ */
.cards { display: grid; grid-template-columns: 1fr; gap: var(--gap); }
.card {
    background: var(--c-surface); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1rem;
    border-left: 4px solid var(--c-border);
}
.card--expense { border-left-color: var(--c-expense); }
.card--income  { border-left-color: var(--c-income); }
.card--result  { border-left-color: var(--c-primary); }
.card--paid, .card--received { border-left-color: #94a3b8; }
.card--paid .card__value, .card--received .card__value { color: var(--c-muted); }
.card__label { color: var(--c-muted); font-size: .8rem; }
.card__value { font-size: 1.5rem; font-weight: 700; margin: .25rem 0; }
.card__sub { color: var(--c-muted); font-size: .75rem; }

/* --- Milestones (chips) -------------------------------------------- */
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
    display: inline-flex; flex-direction: column;
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 999px; padding: .4rem .8rem; text-decoration: none; color: var(--c-text);
    box-shadow: var(--shadow);
}
.chip--active { border-color: var(--c-primary); background: var(--c-primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .2); }
.chip--active .chip__label { color: #fff; }
.chip--active .chip__date { color: rgba(255, 255, 255, .85); }
.chip__label { font-weight: 600; font-size: .85rem; }
.chip__date { color: var(--c-muted); font-size: .72rem; }
.chip-wrap { position: relative; display: inline-flex; }
.chip-del { position: absolute; top: -.4rem; right: -.4rem; margin: 0; }
.chip-del button { width: 1.1rem; height: 1.1rem; line-height: 1; border-radius: 50%; border: 1px solid var(--c-border); background: #fff; color: var(--c-expense); cursor: pointer; font-size: .8rem; padding: 0; }
.muted-inline { color: var(--c-muted); font-weight: 400; font-size: .8rem; }
.milestone-add { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; align-items: center; }
.milestone-add input, .milestone-add select { padding: .45rem .6rem; border: 1px solid var(--c-border); border-radius: 8px; font-size: .9rem; background: #fff; }
.milestone-add input[type="text"] { flex: 1; min-width: 10rem; }

/* --- Ovládání tabulky ---------------------------------------------- */
.controls { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.seg { display: inline-flex; border: 1px solid var(--c-border); border-radius: var(--radius); overflow: hidden; background: var(--c-surface); }
.seg__btn { flex: 1; text-align: center; padding: .5rem .75rem; text-decoration: none; color: var(--c-text); font-size: .85rem; }
.seg__btn.is-active { background: var(--c-primary); color: #fff; font-weight: 600; }
.sortform { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.sortform select { padding: .4rem; border-radius: 8px; border: 1px solid var(--c-border); background: #fff; }
.rangeform { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: .85rem; }
.rangeform input[type="date"] { padding: .4rem; border-radius: 8px; border: 1px solid var(--c-border); background: #fff; font-size: .85rem; }
.filter-state { display: flex; align-items: center; gap: .75rem; font-size: .8rem; color: var(--c-muted); }
.btn-reset { background: #fff; border: 1px solid var(--c-border); border-radius: 8px; padding: .25rem .6rem; text-decoration: none; color: var(--c-primary); }

/* --- Tabulky ------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.paytable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.paytable th, .paytable td { padding: .6rem .75rem; text-align: left; border-bottom: 1px solid var(--c-border); }
.paytable th { color: var(--c-muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .02em; }
.paytable tr:last-child td { border-bottom: 0; }
.pay-row--clickable { cursor: pointer; transition: background-color .12s ease; }
.pay-row--clickable:hover td { background: var(--c-row-hover, rgba(99, 102, 241, .08)); }
/* Akční ikony: výchozí barva textu (v dark mode bílá), on hover zelená; mazání červená. */
.icon-action { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; margin: 0 .25rem; color: var(--c-text); cursor: pointer; line-height: 0; vertical-align: middle; transition: color .12s ease, transform .12s ease; }
.icon-action svg { display: block; }
.icon-action:hover { color: var(--c-income); transform: scale(1.12); }
.icon-action--danger:hover { color: var(--c-expense); }
.pay-row--settled td { opacity: .6; }
.pay-row--settled td:first-child { opacity: 1; }
.tag--paid { background: #dcfce7; color: var(--c-income); }
.ta-right { text-align: right; } .ta-center { text-align: center; }
.empty { color: var(--c-muted); text-align: center; padding: 1.25rem; }
.muted { color: var(--c-muted); font-size: .8rem; display: block; }

.dir-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }
.dir-dot--expense { background: var(--c-expense); }
.dir-dot--income  { background: var(--c-income); }
.tag { display: inline-block; font-size: .68rem; background: #eef2ff; color: #3730a3; border-radius: 6px; padding: .05rem .4rem; margin-left: .35rem; }

/* Barvení výnosů dle splatnosti */
.row--due    { background: #fff7ed; }   /* oranžová */
.row--due    td:first-child { box-shadow: inset 3px 0 0 var(--c-due); }
.row--overdue{ background: #fef2f2; }    /* červená */
.row--overdue td:first-child { box-shadow: inset 3px 0 0 var(--c-overdue); }

/* Drag handle pro budoucí přeřazení priority */
.pay { cursor: default; }

/* --- Navigace: uživatel + odhlášení -------------------------------- */
.nav-user { color: #fff; font-weight: 600; font-size: .85rem; opacity: .95; }
.logout-form { display: inline; margin: 0; }
.link-btn { background: none; border: 0; color: rgba(255,255,255,.9); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

/* --- Flash / alert ------------------------------------------------- */
.alert { border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; font-size: .9rem; border: 1px solid transparent; }
.alert--success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert--error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert--info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* --- Auth formuláře ------------------------------------------------ */
.auth { display: flex; justify-content: center; padding: 1rem 0; }
.auth-card { background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; width: 100%; max-width: 24rem; }
.auth-title { margin: 0 0 .25rem; font-size: 1.4rem; }
.auth-sub { margin: 0 0 1.25rem; color: var(--c-muted); font-size: .9rem; }
.auth-alt { margin-top: 1rem; font-size: .85rem; color: var(--c-muted); text-align: center; }
.field { display: block; margin-bottom: .9rem; }
.field > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.field > span small { font-weight: 400; color: var(--c-muted); }
.field input, .field select, .field textarea { width: 100%; padding: .6rem .7rem; border: 1px solid var(--c-border); border-radius: 8px; font-size: 1rem; line-height: 1.3; box-sizing: border-box; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--c-primary); outline-offset: 1px; border-color: var(--c-primary); }
.err { display: block; color: var(--c-expense); font-size: .78rem; margin-top: .3rem; font-style: normal; }
.btn { display: inline-block; width: 100%; padding: .7rem 1rem; border: 0; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; text-align: center; text-decoration: none; }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: #0b5d56; }

/* --- Platby: seznam + formulář ------------------------------------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.btn--inline { width: auto; display: inline-block; padding: .55rem .9rem; }
.btn--ghost { width: auto; display: inline-block; background: #fff; border: 1px solid var(--c-border); color: var(--c-text); padding: .7rem 1rem; }
.nowrap { white-space: nowrap; }
.inline-form { display: inline; margin: 0; }
.row-actions { display: inline-flex; gap: .35rem; align-items: center; }
.row-actions .inline-form { display: inline-flex; }
.link-action { background: none; border: 0; color: var(--c-primary); cursor: pointer; font: inherit; text-decoration: underline; padding: 0 .15rem; }
.link-action--danger { color: var(--c-expense); }

.formwrap { display: flex; justify-content: center; }
.form-card { background: var(--c-surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; width: 100%; max-width: 46rem; }
.form-section { font-size: .95rem; margin: 1.25rem 0 .5rem; padding-top: .75rem; border-top: 1px solid var(--c-border); }
.form-section small { color: var(--c-muted); font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
.grid3 { display: grid; grid-template-columns: 1fr; gap: 0 1rem; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.25rem; }
.check { display: flex; gap: .5rem; align-items: flex-start; margin-top: 1rem; font-size: .9rem; }
.check input { margin-top: .2rem; }
.check--err span { color: var(--c-expense); }

/* --- Účtenka (příloha) + OCR --------------------------------------- */
.ocr-row { display: block; margin-top: .5rem; }
.ocr-row .btn--ghost { padding: .35rem .7rem; }
#ocr-status { margin-left: .5rem; }
.receipt-chip { text-decoration: none; margin-left: .25rem; }
.receipt-current { display: block; margin-top: .4rem; font-size: .85rem; color: var(--c-muted); }
.receipt-remove { margin-left: .75rem; }

/* --- Přeřazení priority (drag/šipky) ------------------------------- */
.reorder-cell { white-space: nowrap; width: 3.5rem; }
.drag-handle { cursor: grab; color: var(--c-muted); user-select: none; font-size: 1.1rem; }
.drag-handle:active { cursor: grabbing; }
.move-arrows { display: inline-flex; flex-direction: column; vertical-align: middle; line-height: .7; margin-left: .25rem; }
.move-arrows .link-action { font-size: .7rem; text-decoration: none; padding: 0; }
.move-arrows .link-action[disabled] { color: var(--c-border); cursor: default; }
.sortable-ghost { opacity: .4; }
.sortable-chosen { background: #ecfdf5; }

/* --- Admin: stavové odznaky ---------------------------------------- */
.badge { display: inline-block; font-size: .7rem; padding: .1rem .45rem; border-radius: 999px; font-weight: 600; }
.badge--ok { background: #ecfdf5; color: #065f46; }
.badge--off { background: #fef2f2; color: #991b1b; }
.badge--warn { background: #fffbeb; color: #92400e; }
.nav-admin { font-weight: 700; }
.nav-credits { color: #fff; font-weight: 700; background: rgba(255,255,255,.16); padding: .1rem .5rem; border-radius: 999px; }
.nav-credits--low { background: var(--c-due); color: #1f2937; }
.info-panel { background: #f8fafc; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; font-size: .9rem; }
.credit-cell { display: flex; align-items: center; gap: .5rem; }
.credit-balance { display: inline-block; min-width: 3.4rem; text-align: right; font-weight: 700; }
.credit-adjust { display: inline-flex; gap: .35rem; align-items: center; margin: 0; }
.credit-adjust input { width: 4rem; padding: .35rem .4rem; border: 1px solid var(--c-border); border-radius: 6px; }

/* --- Soukromí: rozmazání karet po nečinnosti ----------------------- */
.privacy-wrap { position: relative; }
.privacy-wrap .cards { transition: filter .6s ease, opacity .6s ease; }
.privacy-wrap.is-blurred .cards { filter: blur(14px); opacity: .85; pointer-events: none; user-select: none; }
.cards-cover {
    position: absolute; inset: 0; z-index: 2;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    width: 100%; background: transparent; border: 0; cursor: pointer;
    color: var(--c-text); font: inherit; font-weight: 600;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .6s ease, visibility .6s ease;
}
.privacy-wrap.is-blurred .cards-cover { opacity: 1; visibility: visible; pointer-events: auto; }
.cards-cover:hover { color: var(--c-income); }

/* Oddělovač „nebo" na přihlašovací stránce */
.auth-or { display: flex; align-items: center; gap: .6rem; margin: 1rem 0 .75rem; color: var(--c-muted, #888); font-size: .85rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }

/* --- Overlay (QR k zaplacení) -------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.overlay[hidden] { display: none; }
.overlay__backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.55); }
.overlay__box { position: relative; background: var(--c-surface); border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.25); padding: 1.5rem; width: 100%; max-width: 22rem; text-align: center; }
.overlay__close { position: absolute; top: .5rem; right: .6rem; border: 0; background: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--c-muted); }
.payqr-info { margin-top: .75rem; font-size: .95rem; }
.payqr-integrity { margin-top: .5rem; font-size: .78rem; color: var(--c-income); }

/* --- Sdílení ------------------------------------------------------- */
.share-list { list-style: none; padding: 0; margin: .25rem 0; }
.share-list li { display: flex; align-items: center; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid var(--c-border); }
.share-list li:last-child { border-bottom: 0; }

/* --- QR čtečka (formulář platby) ----------------------------------- */
.qr-reader { background: #f8fafc; border: 1px dashed var(--c-border); border-radius: var(--radius); padding: .9rem; margin-bottom: 1rem; }
.qr-reader__row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
/* Řada tlačítek sekce Automatizace — na mobilu se přirozeně zalomí (flex-wrap). */
.autorow { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.autobtn { cursor: pointer; }
.qr-spayd-in { width: 100%; padding: .5rem .6rem; border: 1px solid var(--c-border); border-radius: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; resize: vertical; }

/* --- QR platba ----------------------------------------------------- */
.qr-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; align-items: start; }
.qr-box { display: flex; justify-content: center; }
.qr-canvas { width: 220px; height: 220px; background: #fff; padding: .5rem; border: 1px solid var(--c-border); border-radius: var(--radius); }
.qr-canvas svg { width: 100%; height: 100%; display: block; }
.qr-info p { margin: .35rem 0; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.break { word-break: break-all; }
.qr-spayd { font-size: .8rem; color: var(--c-muted); margin-top: 1rem; }
.qr-form { margin-top: 1rem; }

/* --- Tablet -------------------------------------------------------- */
@media (min-width: 48rem) {
    /* Desktop navigace: vodorovně, bez hamburgeru, dropdown jako překryv */
    .nav-toggle { display: none; }
    .app-nav { display: flex !important; align-items: center; gap: .85rem; font-size: .9rem; position: static; padding: 0; background: none; box-shadow: none; }
    .nav-user-dropdown { position: absolute; right: 0; top: 100%; }
    .nav-credits { margin-left: .35rem; margin-right: .15rem; }   /* menší mezera ke kreditu */
    .qr-grid { grid-template-columns: 260px 1fr; }
    .grid2 { grid-template-columns: 1fr 1fr; }
    .grid3 { grid-template-columns: 1fr 1fr 1fr; }
    .app-header { flex-direction: row; align-items: center; justify-content: space-between; }
    .cards { grid-template-columns: repeat(3, 1fr); }
    .controls { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
    .seg { max-width: 22rem; }
}

/* --- Desktop ------------------------------------------------------- */
@media (min-width: 64rem) {
    .app-main { padding: 1.5rem; }
    .card__value { font-size: 1.7rem; }
}

/* --- Profil + Zprávy ----------------------------------------------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem .8rem; margin: 0; }
.kv dt { color: var(--c-muted); }
.kv dd { margin: 0; font-weight: 600; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: .35rem 0; border-bottom: 1px solid var(--c-border); }
.plain-list li:last-child { border-bottom: 0; }

.msg-list { list-style: none; margin: 0; padding: 0; }
.msg {
    display: flex; flex-direction: column; gap: .2rem;
    padding: .7rem .85rem; border: 1px solid var(--c-border);
    border-radius: .5rem; background: var(--c-surface); margin-bottom: .5rem;
}
.msg--unread { border-left: 3px solid var(--c-primary); font-weight: 600; }
.msg-body a { color: inherit; }
.msg-time { font-size: .8rem; color: var(--c-muted); font-weight: 400; }

/* --- Dark mode: doladění prvků s pozdější/stejnou specificitou -------- */
[data-theme="dark"] .milestone-add input,
[data-theme="dark"] .milestone-add select,
[data-theme="dark"] .rangeform input[type="date"],
[data-theme="dark"] .sortform select { background: #0b1220; color: var(--c-text); }
[data-theme="dark"] .btn-reset { background: var(--c-surface); color: #5eead4; }
[data-theme="dark"] .chip-del button { background: var(--c-surface); }
[data-theme="dark"] .tag { background: #1e3a8a; color: #dbeafe; }
[data-theme="dark"] .row--due    { background: #3a2a12; }   /* tlumená oranžová */
[data-theme="dark"] .row--overdue{ background: #3a1620; }   /* tlumená červená */
