/* ============================================================
   PULSE – design systém (flat, clean)
   Akcent #00ff91 · Dark #1a1a1a · Font Inter
   ============================================================ */

:root,
[data-bs-theme="light"] {
  --pulse-accent: #00ff91;
  --pulse-accent-600: #00e082;
  --pulse-accent-soft: rgba(0, 255, 145, .14);
  --pulse-dark: #1a1a1a;
  --autoneum: #9ec400;

  --app-bg: #e9eaec;
  --app-surface: #ffffff;
  --app-surface-2: #f2f3f5;
  --app-border: #e4e6e9;
  --app-text: #1a1a1a;
  --app-muted: #6b7280;
  --app-search-bg: #eceef0;
  --app-shadow: 0 6px 24px rgba(20, 25, 30, .06);

  --bs-primary: #00ff91;
  --bs-primary-rgb: 0, 255, 145;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-border-radius: .85rem;
  --bs-border-radius-lg: 1.1rem;
}

[data-bs-theme="dark"] {
  --pulse-accent-soft: rgba(0, 255, 145, .12);
  --app-bg: #141414;
  --app-surface: #1f1f1f;
  --app-surface-2: #2a2a2a;
  --app-border: #333333;
  --app-text: #f3f4f5;
  --app-muted: #9aa0a6;
  --app-search-bg: #2a2a2a;
  --app-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --bs-body-bg: #141414;
  --bs-body-color: #f3f4f5;
  --bs-emphasis-color: #ffffff;
}

* { -webkit-font-smoothing: antialiased; }

body {
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--bs-body-font-family);
  letter-spacing: .005em;
}

/* ---- Bootstrap tweaks ---- */
a { color: inherit; }
.text-accent { color: var(--pulse-accent) !important; }
.bg-accent { background: var(--pulse-accent) !important; color: #0a0a0a !important; }

.btn { border-radius: 50rem; font-weight: 600; }
.btn-primary {
  --bs-btn-bg: var(--pulse-accent);
  --bs-btn-border-color: var(--pulse-accent);
  --bs-btn-color: #0a120c;
  --bs-btn-hover-bg: var(--pulse-accent-600);
  --bs-btn-hover-border-color: var(--pulse-accent-600);
  --bs-btn-hover-color: #0a120c;
  --bs-btn-active-bg: var(--pulse-accent-600);
  --bs-btn-active-border-color: var(--pulse-accent-600);
  --bs-btn-active-color: #0a120c;
  --bs-btn-disabled-bg: var(--pulse-accent);
  --bs-btn-disabled-border-color: var(--pulse-accent);
  box-shadow: 0 6px 16px rgba(0, 255, 145, .25);
}
.btn-success { --bs-btn-bg: var(--pulse-accent); --bs-btn-border-color: var(--pulse-accent); --bs-btn-color:#0a120c; --bs-btn-hover-bg: var(--pulse-accent-600); --bs-btn-hover-border-color: var(--pulse-accent-600); --bs-btn-hover-color:#0a120c; }
.btn-outline-secondary { --bs-btn-color: var(--app-muted); --bs-btn-border-color: var(--app-border); --bs-btn-hover-bg: var(--app-surface-2); --bs-btn-hover-border-color: var(--app-border); --bs-btn-hover-color: var(--app-text); }

.form-control, .form-select {
  background: var(--app-surface-2);
  border-color: var(--app-border);
  border-radius: .7rem;
  color: var(--app-text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--pulse-accent);
  box-shadow: 0 0 0 .2rem var(--pulse-accent-soft);
  background: var(--app-surface);
}
.form-check-input:checked { background-color: var(--pulse-accent); border-color: var(--pulse-accent); }

/* ---- TomSelect (našeptávač na všech selectech) ---- */
.ts-wrapper { font-size: inherit; }
.ts-control {
  background: var(--app-surface-2) !important;
  border: 1px solid var(--app-border) !important;
  border-radius: .7rem !important;
  color: var(--app-text) !important;
  box-shadow: none !important;
  min-height: 38px;
}
.ts-wrapper.focus .ts-control { border-color: var(--pulse-accent) !important; box-shadow: 0 0 0 .2rem var(--pulse-accent-soft) !important; }
.ts-control input, .ts-control .item { color: var(--app-text) !important; }
.ts-control input::placeholder { color: var(--app-muted) !important; }
.ts-wrapper.single .ts-control:after { border-color: var(--app-muted) transparent transparent; }
.ts-dropdown {
  background: var(--app-surface);
  border: 1px solid var(--app-border);
  color: var(--app-text);
  border-radius: 12px;
  box-shadow: var(--app-shadow);
  z-index: 1300;
  margin-top: 4px;
}
.ts-dropdown .option { color: var(--app-text); }
.ts-dropdown .option.active, .ts-dropdown .option:hover { background: var(--pulse-accent-soft); color: var(--app-text); }
.ts-dropdown .no-results, .ts-dropdown .optgroup-header { color: var(--app-muted); }
.ts-dropdown-content { max-height: 320px; }
.ts-wrapper.form-select-sm .ts-control { min-height: 31px; padding-top: 2px; padding-bottom: 2px; font-size: .875rem; }

.badge.text-bg-accent { background: var(--pulse-accent); color: #0a120c; }

/* ============================================================
   Layout
   ============================================================ */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-wrap { width: 100%; max-width: 1480px; margin: 0 auto; padding: 1rem 1.25rem 0; flex: 1 0 auto; }

/* ---- Horní navbar (bílá karta) ---- */
.app-navbar {
  display: flex; align-items: center; gap: 1rem;
  background: var(--app-surface);
  border-radius: 18px;
  padding: .7rem 1.1rem;
  box-shadow: var(--app-shadow);
  margin-bottom: 1rem;
}
.brand { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand-autoneum {
  font-weight: 800; font-size: 1.7rem; letter-spacing: -.02em;
  color: var(--autoneum); line-height: 1;
}
.brand-autoneum .dot { color: var(--autoneum); }

.app-search { flex: 1 1 auto; max-width: 640px; margin: 0 auto; position: relative; }
.app-search .bi { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--app-muted); font-size: 1.05rem; }
.app-search input {
  width: 100%; border: none; outline: none;
  background: var(--app-search-bg);
  border-radius: 50rem; padding: .7rem 1.1rem .7rem 2.7rem;
  color: var(--app-text); font-size: .95rem;
}
.app-search input::placeholder { color: var(--app-muted); }

/* Našeptávač */
.search-suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--app-surface); border: 1px solid var(--app-border);
  border-radius: 14px; box-shadow: var(--app-shadow); padding: .35rem;
  max-height: 72vh; overflow-y: auto; z-index: 1200;
}
.search-suggest[hidden] { display: none; }
.ss-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--app-muted); padding: .5rem .7rem .2rem; font-weight: 700; }
.ss-item { display: flex; align-items: center; gap: .55rem; padding: .5rem .7rem; border-radius: 9px; color: var(--app-text); text-decoration: none; }
.ss-item:hover { background: var(--app-surface-2); }
.ss-ico { color: var(--app-muted); font-size: 1rem; width: 16px; text-align: center; flex-shrink: 0; }
.ss-label { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.ss-meta { color: var(--app-muted); font-size: .78rem; white-space: nowrap; flex-shrink: 0; }
.ss-empty { padding: .9rem .8rem; color: var(--app-muted); font-size: .9rem; text-align: center; }
.ss-all { display: flex; align-items: center; gap: .5rem; justify-content: center; padding: .6rem; margin-top: .25rem; border-top: 1px solid var(--app-border); color: var(--pulse-accent); text-decoration: none; font-size: .88rem; font-weight: 600; }
.ss-all:hover { background: var(--pulse-accent-soft); }

.app-actions { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--app-text); font-size: 1.2rem;
  position: relative; cursor: pointer; transition: background .15s;
}
.icon-btn:hover { background: var(--app-surface-2); }
.icon-btn .notif-badge {
  position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px;
  background: #ff3b54; color: #fff; border-radius: 50rem; font-size: .68rem;
  display: flex; align-items: center; justify-content: center; font-weight: 700; padding: 0 4px;
}
.avatar-btn { background: var(--pulse-dark); color: #fff; }
[data-bs-theme="dark"] .avatar-btn { background: #000; }

/* Theme switch (pill) */
.theme-switch {
  width: 58px; height: 30px; border-radius: 50rem; border: none;
  background: var(--pulse-dark); position: relative; cursor: pointer; padding: 0; flex-shrink: 0;
  transition: background .2s;
}
.theme-switch .knob {
  position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; transition: left .2s; display: flex; align-items: center; justify-content: center;
  color: var(--pulse-dark); font-size: .8rem;
}
[data-bs-theme="dark"] .theme-switch { background: var(--pulse-accent); }
[data-bs-theme="dark"] .theme-switch .knob { left: 31px; color: #0a120c; }

/* ---- Sekční navigace (pills) ---- */
.section-nav {
  display: flex; gap: .35rem; flex-wrap: wrap; align-items: center;
  background: var(--app-surface);
  border-radius: 16px; padding: .45rem .55rem; box-shadow: var(--app-shadow); margin-bottom: 1.1rem;
}
.section-nav .nav-link {
  color: var(--app-muted); border-radius: 50rem; padding: .5rem .95rem; font-size: .92rem; font-weight: 500;
  display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; transition: all .15s;
}
.section-nav .nav-link:hover { background: var(--app-surface-2); color: var(--app-text); }
.section-nav .nav-link.active { background: var(--pulse-accent); color: #0a120c; font-weight: 600; }
.section-nav .nav-spacer { flex: 1 1 auto; }
.role-chip { font-size: .78rem; color: var(--app-muted); padding-right: .5rem; }

.page-title { font-weight: 700; font-size: 1.5rem; margin: .25rem 0 1rem; letter-spacing: -.01em; }
.page-title:empty { display: none; }

.content { padding-bottom: 1.5rem; }

/* ============================================================
   Karty / komponenty
   ============================================================ */
.card {
  border: 1px solid var(--app-border);
  border-radius: var(--bs-border-radius-lg);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}
[data-bs-theme="dark"] .card { box-shadow: none; }

.kpi-card { padding: 1.15rem 1.3rem; height: 100%; }
.kpi-label { font-size: .76rem; color: var(--app-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; margin-top: .2rem; letter-spacing: -.01em; }
.kpi-sub { font-size: .82rem; color: var(--app-muted); }
.kpi-icon { font-size: 1.4rem; color: var(--pulse-accent); opacity: .9; }
.delta-up { color: #ff3b54; font-weight: 600; }
.delta-down { color: var(--pulse-accent-600); font-weight: 600; }
.delta-flat { color: var(--app-muted); }
[data-bs-theme="light"] .delta-down { color: #07b36a; }

.chart-card { padding: 1.1rem 1.2rem; }
.chart-card h6 { font-weight: 700; margin-bottom: .25rem; }
.chart-card .chart-wrap { position: relative; }

.filter-bar { background: var(--app-surface); border: 1px solid var(--app-border); border-radius: 16px; padding: .9rem 1.1rem; box-shadow: var(--app-shadow); }

.table { --bs-table-bg: transparent; color: var(--app-text); }
.table thead th { font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; color: var(--app-muted); font-weight: 600; }
.cat-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.cat-row:hover { background: var(--pulse-accent-soft) !important; }
.sum-pill { font-variant-numeric: tabular-nums; }
.sum-ok { color: var(--pulse-accent-600); } [data-bs-theme="light"] .sum-ok { color: #07b36a; }
.sum-warn { color: #ff3b54; }

.heatmap-table td, .heatmap-table th { border: 1px solid var(--app-border); font-size: .82rem; }
.heat-cell { font-variant-numeric: tabular-nums; }
#downtime-rows .dt-row { border-bottom: 1px solid var(--app-border); }

/* ============================================================
   Loga (PULSE / autoneum text approximace)
   ============================================================ */
.pulse-logo { font-weight: 600; letter-spacing: .04em; color: var(--pulse-accent); line-height: .9; display: inline-block; }
.pulse-logo .tm { font-size: .35em; vertical-align: top; }
.pulse-logo .sub { display: block; font-size: .26em; letter-spacing: .18em; color: #cfd3d1; font-weight: 400; margin-top: .15em; }
.pulse-logo .sub b { font-weight: 800; color: #fff; }

/* Oficiální SVG loga */
.brand-img { height: 26px; width: auto; display: block; }
.footer-tep { width: clamp(190px, 22vw, 270px); height: auto; display: block; margin-bottom: 1.2rem; }
.footer-pulse { width: 210px; max-width: 100%; height: auto; display: block; }
.login-pulse { width: 210px; max-width: 78%; height: auto; }

/* ============================================================
   Patička (přesně dle zadání) – vždy tmavá
   ============================================================ */
.app-footer {
  margin-top: 1.5rem;
  background:
    radial-gradient(90% 130% at 0% 0%, rgba(0, 255, 145, .16) 0%, rgba(0, 255, 145, 0) 42%),
    linear-gradient(180deg, #0c150f 0%, #0a0f0c 100%);
  color: #c9cfcb;
  flex-shrink: 0;
}
.app-footer .footer-inner { max-width: 1480px; margin: 0 auto; padding: 3.2rem 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr; gap: 0; }
.footer-col { padding: 0 2.2rem; position: relative; }
.footer-col:not(:first-child)::before {
  content: ""; position: absolute; left: 0; top: .2rem; bottom: .2rem; width: 1px;
  background: rgba(255, 255, 255, .12);
}
.footer-col:first-child { padding-left: 0; }
.footer-col:last-child { padding-right: 0; }

.footer-headline { color: var(--pulse-accent); font-weight: 400; font-size: 2.6rem; line-height: 1.02; letter-spacing: -.01em; text-transform: uppercase; margin-bottom: 1.1rem; }
.footer-lede { color: #9aa39d; font-size: .95rem; max-width: 320px; line-height: 1.5; }

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 1.05rem; }
.footer-links a { display: inline-flex; align-items: center; gap: .7rem; color: #e7eae8; text-decoration: none; font-size: 1.02rem; transition: color .15s; }
.footer-links a:hover { color: var(--pulse-accent); }
.footer-arrow { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .35); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; flex-shrink: 0; }
.footer-links a:hover .footer-arrow { border-color: var(--pulse-accent); color: var(--pulse-accent); }

.footer-contact { margin-bottom: 1.6rem; }
.footer-contact .lbl { display: flex; align-items: center; gap: .55rem; color: #9aa39d; font-size: .9rem; margin-bottom: .15rem; }
.footer-contact .val { font-size: 1.18rem; font-weight: 700; color: #fff; }
.footer-contact a.val { text-decoration: none; }
.footer-guide { display: inline-flex; align-items: center; gap: .6rem; color: #fff; font-weight: 600; font-size: 1.05rem; text-decoration: none; }

.footer-legal { color: #7e867f; font-size: .82rem; line-height: 1.55; margin-top: 1.4rem; }
.footer-legal .strong { color: #9aa39d; }
.footer-legal a, .auth-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer-legal a:hover, .auth-legal a:hover { color: var(--pulse-accent); }

/* ============================================================
   Login (split panel) + reset hesla
   ============================================================ */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.2rem; padding: 2.5rem 1rem;
  background: radial-gradient(70% 80% at 12% 8%, rgba(0, 255, 145, .10) 0%, rgba(0, 255, 145, 0) 45%), #07100b;
}
.auth-legal { text-align: center; max-width: 780px; padding: 0 1rem; }
.auth-legal-lead { color: #cfd3d1; font-size: 1.02rem; margin: 0 0 .65rem; }
.auth-legal-fine { color: #7e867f; font-size: .8rem; line-height: 1.65; margin: 0; }
.auth-card {
  display: flex; width: 100%; max-width: 1000px; min-height: 600px;
  border-radius: 28px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .55);
}
.auth-brand {
  flex: 1 1 50%; display: flex; flex-direction: column; padding: 3.4rem 3rem;
  background:
    radial-gradient(95% 75% at 12% 8%, rgba(0, 255, 145, .22) 0%, rgba(0, 255, 145, 0) 50%),
    linear-gradient(155deg, #0f2718 0%, #0a140e 60%, #060d09 100%);
}
.auth-brand-headline { width: min(80%, 330px); height: auto; margin-bottom: 2.2rem; }
.auth-brand-lede { color: #aeb6b0; font-size: 1.05rem; line-height: 1.55; max-width: 340px; }
.auth-brand-logo { width: 150px; height: auto; margin-top: auto; }

.auth-form { flex: 1 1 50%; background: #fff; display: flex; align-items: center; justify-content: center; padding: 2.5rem; }
.auth-form-inner { width: 100%; max-width: 380px; }
.auth-title { color: #1a1a1a; text-align: center; font-weight: 600; margin-bottom: 2rem; }

.auth-field { position: relative; margin-bottom: 1.1rem; }
.auth-field i { position: absolute; left: 1.3rem; top: 50%; transform: translateY(-50%); color: #6b7280; font-size: 1.1rem; }
.auth-field input {
  width: 100%; height: 56px; border: none; border-radius: 50rem; background: #ececec;
  padding: 0 1.25rem 0 3.1rem; font-size: 1rem; color: #1a1a1a; outline: none;
}
.auth-field input::placeholder { color: #9aa0a6; }
.auth-field input:focus { background: #e6e7e9; box-shadow: 0 0 0 .2rem rgba(0, 255, 145, .25); }

.auth-row { display: flex; align-items: center; justify-content: space-between; margin: .3rem .25rem 0; }
.auth-forgot { color: #6b7280; font-size: .9rem; text-decoration: none; }
.auth-forgot:hover { color: #1a1a1a; }
.auth-toggle { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .9rem; color: #4b5563; user-select: none; }
.auth-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.auth-toggle-track { width: 40px; height: 22px; border-radius: 50rem; background: #1a1a1a; position: relative; transition: background .2s; flex-shrink: 0; }
.auth-toggle-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.auth-toggle input:checked + .auth-toggle-track { background: var(--pulse-accent); }
.auth-toggle input:checked + .auth-toggle-track .auth-toggle-knob { left: 21px; }

.auth-submit { min-width: 150px; padding: .7rem 2rem; font-size: 1rem; }
.auth-demo { text-align: center; color: #9aa0a6; font-size: .78rem; margin-top: 1.6rem; }

.auth-single { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem;
  background: radial-gradient(70% 80% at 12% 8%, rgba(0, 255, 145, .10) 0%, rgba(0, 255, 145, 0) 45%), #07100b; }
.auth-single-card { width: 100%; max-width: 440px; background: #fff; border-radius: 22px; padding: 2.5rem; }
.auth-single-card h2 { color: #1a1a1a; font-weight: 600; }
.auth-single-card .form-control { background: #ececec; border: none; border-radius: 50rem; height: 52px; padding: 0 1.3rem; color: #1a1a1a; }
.auth-single-card .form-label { color: #4b5563; }
.auth-single-card .text-muted, .auth-single-card p { color: #4b5563 !important; }

@media (max-width: 767.98px) {
  .auth-card { flex-direction: column; max-width: 440px; min-height: 0; }
  .auth-brand { padding: 2.4rem; }
  .auth-brand-logo { margin-top: 1.6rem; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991.98px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem 0; }
  .footer-col { padding: 0 1.4rem; }
  .footer-col:nth-child(odd) { padding-left: 0; }
  .footer-col:nth-child(odd)::before { display: none; }
  .footer-headline { font-size: 2rem; }
}
@media (max-width: 767.98px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-col { padding: 0; }
  .footer-col::before { display: none; }
  .app-search { order: 3; flex-basis: 100%; max-width: none; }
  .app-navbar { flex-wrap: wrap; }
}

@media print {
  .app-navbar, .section-nav, .app-footer, .no-print { display: none !important; }
  .app-wrap { max-width: none; padding: 0; }
  body { background: #fff; }
}
