/* app-dark.css — tmavý režim ARTEMIS. Zapína ho iPhone appka podľa nastavenia telefónu (html[data-theme=dark]);
   v prehliadači na počítači sa nikdy nezapne. Dokumenty na tlač (bsf-doc, faktúry, revízie) ostávajú svetlé.
   Vrátenie späť: odstrániť <link … app-dark.css> v partials/header.php. */
html[data-theme=dark]{
  color-scheme:dark;
  --bg:#0E1024; --bg-card:#171A33; --border:#2A2F55; --text:#E6E8F5; --text-muted:#9AA3C0;
  --green-bg:#12301F; --red-bg:#3A1720; --yellow-bg:#3A2C10;
  --tbl-head-bg:#1D2140; --tbl-row-hover:#1B1F3B; --tbl-row-stripe:#141730;
  --shadow-soft:0 2px 10px rgba(0,0,0,.35); --shadow-soft-lg:0 10px 30px rgba(0,0,0,.45);
  --af-bg:#0E1024; --af-card:#171A33; --af-ink:#E6E8F5; --af-muted:#9AA3C0; --af-line:#2A2F55; --af-sk:#1D2140; --af-sk-hi:#262B52;
  --dk-card:#171A33; --dk-card2:#1D2140; --dk-line:#2A2F55; --dk-ink:#E6E8F5; --dk-muted:#9AA3C0; --dk-accent:#A5B0FF;
}
html[data-theme=dark] body:not(.bsf-pdf-doc){background:linear-gradient(165deg,#0B0D1F 0%,#0E1024 55%,#11142B 100%) fixed;color:var(--dk-ink)}
html[data-theme=dark] .topbar{background:linear-gradient(90deg,#0B0D22,#15174A 60%,#1C1F5E);box-shadow:0 1px 0 #20244A}

/* povrchy */
html[data-theme=dark] body:not(.bsf-pdf-doc) :is(.card,.stats>div,.od-card,.panel,.tile,.kpi,.stat,.modal,.modal-box,.dropdown,.popover,.tcard,.tc-detail-inner,.table-scroll,.table-wrap,.three-month-summary):not(.bsf-doc *){
  background:var(--dk-card) !important;border-color:var(--dk-line) !important;color:var(--dk-ink)}
html[data-theme=dark] .tcard.row-stav-hotova{background:linear-gradient(180deg,#132A22,#171A33) !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) :is(h1,h2,h3):not(.bsf-doc *){color:var(--dk-ink)}
html[data-theme=dark] .stats .num{color:var(--dk-accent)}
html[data-theme=dark] :is(.muted,small.muted,.text-muted){color:var(--dk-muted) !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) a:not(.btn):not(.badge):not(.bsf-doc *){color:#9FB0FF}
html[data-theme=dark] .topbar a{color:#fff}

/* tabuľky */
html[data-theme=dark] :is(table.data,.tbl):not(.bsf-doc *) th{background:var(--dk-card2) !important;color:#C7CEF5 !important}
html[data-theme=dark] :is(table.data,.tbl):not(.bsf-doc *) td{background:transparent;color:var(--dk-ink)}
html[data-theme=dark] :is(table.data,.tbl) tbody tr:hover td{background:#1B1F3B !important}
html[data-theme=dark] :is(.tbl,table.data) :is(th,td){border-color:var(--dk-line) !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) table:not(.bsf-doc *){color:var(--dk-ink)}

/* formuláre */
html[data-theme=dark] body:not(.bsf-pdf-doc) :is(input[type=text],input[type=number],input[type=date],input[type=datetime-local],input[type=time],input[type=email],input[type=password],input[type=search],input[type=tel],input[type=url],input:not([type]),select,textarea):not(.bsf-doc *){
  background:#0F1230 !important;color:var(--dk-ink) !important;border-color:#343A66 !important}
html[data-theme=dark] ::placeholder{color:#6C7599}
html[data-theme=dark] .btn:not(.primary):not(.danger):not(.bsf-doc *){background:#1D2140;color:var(--dk-ink);border-color:#343A66}
html[data-theme=dark] .btn.primary{background:linear-gradient(150deg,#4B50D6,#6366F1);box-shadow:0 4px 14px rgba(99,102,241,.35)}
html[data-theme=dark] fieldset,html[data-theme=dark] details{border-color:var(--dk-line)}

/* upozornenia */
html[data-theme=dark] .alert{border-color:var(--dk-line)}
html[data-theme=dark] :is(.alert.success,.alert.ok,.flash.ok){background:#12301F !important;color:#9BE3B4 !important}
html[data-theme=dark] :is(.alert.error,.alert.err,.flash.err){background:#3A1720 !important;color:#FFB4BF !important}
html[data-theme=dark] :is(.alert.warn,.alert.warning,.alert.info){background:#2A2710 !important;color:#F4D98B !important}

/* karty úloh (partials/_tasks_table.php) */
html[data-theme=dark] .tcard{box-shadow:0 10px 26px -18px rgba(0,0,0,.6) !important}
html[data-theme=dark] :is(.tc-title,.tc-money){color:var(--dk-ink) !important}
html[data-theme=dark] :is(.tc-chip,.tc-sub,.tc-nm){color:#B5BCDD !important}
html[data-theme=dark] .tc-chip{background:#1D2140 !important;border-color:#2A2F55 !important}
html[data-theme=dark] .tc-pill{background:color-mix(in srgb,var(--c) 22%,#171A33) !important;color:#E6E8F5 !important;border-color:transparent !important}
html[data-theme=dark] .tc-ring{--tc-track:#2A2F55}
html[data-theme=dark] .tc-toggle{background:#1D2140 !important;color:var(--dk-ink) !important;border-color:#343A66 !important}

/* vložené svetlé farby v atribútoch style="…" (bežné vzory) */
html[data-theme=dark] body:not(.bsf-pdf-doc) :is([style*="background:#fff"],[style*="background: #fff"],[style*="background:#FFF"],[style*="background:white"],[style*="background: white"],
  [style*="background:#F8FAFC"],[style*="background:#f8fafc"],[style*="background:#F1F5F9"],[style*="background:#f1f5f9"],[style*="background:#F9FAFB"],[style*="background:#f9fafb"],
  [style*="background:#FAFBFF"],[style*="background:#F4F5FB"],[style*="background:#EEF2FF"],[style*="background:#eef2ff"],[style*="background:#F3F4F6"],[style*="background:#f3f4f6"]):not(.bsf-doc *){
  background:var(--dk-card2) !important;color:var(--dk-ink) !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) :is([style*="background:#ECFDF5"],[style*="background:#ecfdf5"],[style*="background:#F0FDF4"],[style*="background:#f0fdf4"],[style*="background:#DCFCE7"],[style*="background:#dcfce7"]){background:#12301F !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) :is([style*="background:#FEF3C7"],[style*="background:#fef3c7"],[style*="background:#FFFBEB"],[style*="background:#fffbeb"],[style*="background:#FEF9C3"]){background:#2E2710 !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) :is([style*="background:#FEE2E2"],[style*="background:#fee2e2"],[style*="background:#FEF2F2"],[style*="background:#fef2f2"]){background:#3A1720 !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) :is([style*="background:#EFF6FF"],[style*="background:#eff6ff"],[style*="background:#DBEAFE"],[style*="background:#dbeafe"]){background:#172449 !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) :is([style*="color:#1E3A8A"],[style*="color:#1e3a8a"],[style*="color:#1F2937"],[style*="color:#1f2937"],[style*="color:#111827"],[style*="color:#0F172A"],[style*="color:#0f172a"],[style*="color:#1A1F36"],[style*="color:#334155"],[style*="color:#475569"],[style*="color:#2A2C77"],[style*="color:var(--navy)"],[style*="color: var(--navy)"]){color:#C9CFF5 !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) :is([style*="color:#065F46"],[style*="color:#166534"],[style*="color:#15803d"],[style*="color:#15803D"]){color:#86E0A8 !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) :is([style*="color:#92400E"],[style*="color:#92400e"],[style*="color:#78350F"],[style*="color:#7C4A03"]){color:#F4CD7A !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) :is([style*="color:#991B1B"],[style*="color:#991b1b"],[style*="color:#7F1D1D"],[style*="color:#B91C1C"]){color:#FFA3AE !important}
html[data-theme=dark] body:not(.bsf-pdf-doc) :is([style*="border:1px solid #E2E8F0"],[style*="border:1px solid #e2e8f0"],[style*="border:1px solid #E5E7EB"],[style*="border:1px solid #e5e7eb"]){border-color:var(--dk-line) !important}

/* prílohy a nahrávanie v úlohe */
html[data-theme=dark] .att-drop-zone{background:#141733 !important;border-color:#3A4170 !important}
html[data-theme=dark] .adz-title{color:#C9CFF5 !important}
html[data-theme=dark] .att-selected-item{background:#1D2140 !important;border-color:#2A2F55 !important}

/* monitoring (vložený dashboard má vlastný tmavý vzhľad) */
html[data-theme=dark] .mon-embed iframe{color-scheme:dark}

/* dokumenty na tlač ostávajú svetlé */
html[data-theme=dark] body.bsf-pdf-doc,html[data-theme=dark] .bsf-doc{color-scheme:light}

/* texty, ktoré majú v style.css natvrdo tmavomodrú farbu */
html[data-theme=dark] body:not(.bsf-pdf-doc) :is(.att-name,.big-sum,.card h2,.card h3,.chart-box h3,.collab-title,.cp-section-title,.footer-brand strong,.footer-contact,.footer-contact a,
  .map-legend strong,.payout-total,.sec-block h3,.sub-sum.total,.task-meta,.task-title,.three-month-summary th.month-head,.ws-day .ws-count,.ws-day .ws-date,button.task-toggle,
  details summary,fieldset legend,table.activity .act-what,table.activity .act-who):not(.bsf-doc *){color:#D4D9F7 !important}
html[data-theme=dark] .tg-wrap{background:transparent !important;border-color:transparent !important;box-shadow:none !important}
html[data-theme=dark] :is(.qa-menu,.onl-dd,.nav-dd-menu,.twz,.twz-foot,.abm,.abm-foot){background:var(--dk-card) !important;color:var(--dk-ink) !important;border-color:var(--dk-line) !important}
html[data-theme=dark] .qa-menu a{color:#C9CFF5 !important}
html[data-theme=dark] .qa-menu a:hover{background:#1D2140 !important}
html[data-theme=dark] :is(.twz-head,.abm-head){border-color:var(--dk-line) !important}
html[data-theme=dark] :is(.twz-q,.twz-head h3,.twz-sum .r b,.abm-head,.abm-body label){color:var(--dk-ink) !important}
html[data-theme=dark] :is(.twz-hint,.abm-hint,.twz-sum .r){color:var(--dk-muted) !important}
html[data-theme=dark] :is(.twz-btn:not(.next):not(.send),.twz-chip:not(.sel),.twz-file-drop,.twz-files .f,.abm-typ label){background:#1D2140 !important;color:var(--dk-ink) !important;border-color:#343A66 !important}
html[data-theme=dark] :is(.twz input,.twz textarea,.twz select,.abm-body input,.abm-body select){background:#0F1230 !important;color:var(--dk-ink) !important;border-color:#343A66 !important}
html[data-theme=dark] :is(#twzJoinBox,#twzDupe){background:#2E2710 !important}

/* prihlasovacia stránka: okno ostáva čisto biele (rovnaká biela ako pozadie loga), aj keď je iPhone v tmavom režime */
html[data-theme=dark] body:has(.card.auth) .card.auth{
  --text:#1A1F36; --text-muted:#64748B; --border:#E2E5F0; --bg-card:#fff; --bg:#F4F5FB; color-scheme:light;
  background:#fff !important; border-color:#fff !important; color:#1A1F36 !important}
html[data-theme=dark] body:has(.card.auth) .card.auth :is(h1,h2,label){color:#1A1F36 !important}
html[data-theme=dark] body:has(.card.auth) .card.auth :is(input[type=text],input[type=password],input:not([type]),select,textarea){
  background:#fff !important; color:#1A1F36 !important; border-color:#E2E5F0 !important}
html[data-theme=dark] body:has(.card.auth) .card.auth .btn.primary{background:linear-gradient(150deg,#2A2C77,#34379A) !important;color:#fff !important;box-shadow:0 4px 12px rgba(42,44,119,.30) !important}
html[data-theme=dark] body:has(.card.auth) .card.auth .alert.error{background:#FEE2E2 !important;color:#991B1B !important}
html[data-theme=dark] body:has(.card.auth){background:radial-gradient(85% 85% at 50% 46%, #22255c 0%, #1b1d4c 42%, #111335 100%) fixed #161942 !important}
