/* =========================================================
   COMPONENTS.CSS – UI komponenty
   Buttons, header, nav, forms, pricing, footer, FAQ
   ŽIADNE animácie, len čistý SaaS look
   ========================================================= */

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #071016;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 26px rgba(0,0,0,0.35);
}

.btn:hover {
  filter: brightness(0.96);
}

/* Small/compact button helpers */
.btn-sm {
  padding: 9px 14px;
  font-size: 0.92rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

.btn-ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-main);
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
}

/* ---------- HEADER CTA ---------- */
.header-cta {
  display: none;
  gap: var(--space-3);
}

@media (min-width: 900px) {
  .header-cta {
    display: flex;
  }
}

/* ---------- MOBILE NAV TOGGLE ---------- */
.nav-toggle {
  background: none;
  border: 0;
  display: inline-flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text-main);
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }
}

/* ---------- HERO ACTIONS ---------- */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

/* ---------- PRICING ---------- */
.price-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.price {
  font-size: 2rem;
  font-weight: 700;
}

.price .small {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.price-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

/* ---------- CTA SECTION ---------- */
.cta {
  background: linear-gradient(180deg, var(--bg-alt), var(--bg-main));
  border-top: 1px solid var(--border-soft);
}

.cta-inner {
  display: grid;
  gap: var(--space-7);
}

@media (min-width: 900px) {
  .cta-inner {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
  }
}

.cta-form {
  display: grid;
  gap: var(--space-4);
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.field input,
.field select {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.03);
  color: var(--text-main);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ---------- FAQ ---------- */
.faq {
  display: grid;
  gap: var(--space-4);
}

.faq details {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--bg-card);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq p {
  margin-top: var(--space-3);
  color: var(--text-muted);
}

/* ---------- FOOTER ---------- */
.footer-grid {
  display: grid;
  gap: var(--space-6);
  padding-block: var(--space-7);
}

.footer-links {
  display: grid;
  gap: var(--space-3);
}

.footer-links a {
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--text-main);
}

@media (min-width: 900px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    align-items: start;
  }
}

/* =========================================================
   MOBILE NAV – OPEN STATE
   ========================================================= */

.header-inner {
  position: relative;
}

.site-nav.open {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: absolute;
  top: 72px;
  right: 0;
  min-width: 220px;
  padding: var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  z-index: 200;
}

.site-nav.open a {
  padding: 8px 6px;
  color: var(--text-main);
}

.site-nav.open a:hover {
  color: var(--accent);
}

/* =========================================================
   CONTRACTS / ORDERS – TYPE PILLS
   ========================================================= */

.type-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}

/* Objednávka – bledomodrá */
.type-pill.type-order {
  background: rgba(56, 139, 253, 0.15);
  border-color: rgba(56, 139, 253, 0.35);
  color: #9ec5ff;
}

/* Zmluva – bledofialová */
.type-pill.type-contract {
  background: rgba(167, 139, 250, 0.15);
  border-color: rgba(167, 139, 250, 0.35);
  color: #d6c6ff;
}

/* Jemné zarovnanie v tabuľke */
.table .type-pill {
  margin-top: 2px;
}

/* =========================================================
   DOCUMENTS TABLE – FIX ROW BACKGROUND TO END
   ========================================================= */

.documents-table tbody tr {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
}

.documents-table tbody tr:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
}

/* všetky bunky nech sú transparentné – pozadie rieši TR */
.documents-table td {
  background: transparent !important;
}

/* zaoblenie riadku ako „bublina“ */
.documents-table tbody tr td:first-child {
  border-top-left-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
}

.documents-table tbody tr td:last-child {
  border-top-right-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.table-head #invoicesTotalInfo.invoice-total {
  font-size: 16px !important;
  font-weight: 500;
  color: var(--text-muted);
}

.table-head #invoicesTotalInfo.invoice-total strong {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}


/* =========================================================
   LAYOUT – WIDE CONTAINER (timesheets, forms)
   ========================================================= */

.container-wide {
  max-width: 1200px;
}

@media (min-width: 1400px) {
  .container-wide {
    max-width: 1400px;
  }
}

/* =========================================================
   RESPONSIVE – COMPONENTS (MOBILE + TABLET)
   Only layout, spacing and touch usability
   ========================================================= */

/* ---------- TABLET (<= 1024px) ---------- */
@media (max-width: 1024px) {
  .btn {
    padding: 11px 16px;
  }

  .hero-actions {
    gap: var(--space-3);
  }

  .price {
    font-size: 1.8rem;
  }
}

/* ---------- MOBILE / TABLET BREAK (<= 900px) ---------- */
@media (max-width: 900px) {
  /* Header CTA stays hidden, nav toggle already active */

  /* Mobile nav dropdown should span full width */
  .site-nav.open {
    left: 0;
    right: 0;
    min-width: unset;
    width: calc(100% - 24px);
  }
}

/* ---------- MOBILE (<= 768px) ---------- */
@media (max-width: 768px) {
  /* Buttons: full width for primary actions */
  .btn,
  .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  /* Pricing cards spacing */
  .price-card {
    gap: var(--space-3);
  }

  .price {
    font-size: 1.6rem;
  }

  /* Forms: better touch targets */
  .field input,
  .field select {
    height: 46px;
    font-size: 1rem;
  }

  /* FAQ readability */
  .faq details {
    padding: var(--space-3);
  }
}

/* ---------- SMALL MOBILE (<= 480px) ---------- */
@media (max-width: 480px) {
  .btn {
    font-size: 0.95rem;
    padding: 10px 14px;
  }

  .price {
    font-size: 1.4rem;
  }

  .type-pill {
    font-size: 0.7rem;
    padding: 5px 10px;
  }
}

/* INVOICES TAB */
/* Mobile vs desktop layout helpers */
.mobile-only { display: none; }
.desktop-only { display: block; }

@media (max-width: 920px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
}

/* KROS-style invoice cards (mobile) */
.invoice-cards {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.invoice-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: 0 14px 46px rgba(0,0,0,0.46);
  backdrop-filter: blur(14px);
}

.invoice-card:hover {
  border-color: rgba(255,255,255,0.16);
  box-shadow: 0 18px 58px rgba(0,0,0,0.52);
}

.invoice-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.invoice-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.invoice-card-no {
  font-weight: 700;
  color: var(--text-main);
}

.invoice-card-menu {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.invoice-card-client {
  margin: var(--space-3) 0 0;
  font-size: 16px;
  line-height: 1.25;
}

.invoice-card-bottom {
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.invoice-card-amount {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.invoice-card-actions {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.invoices-mobile-summary {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
}

.invoices-mobile-total-label {
  font-size: 11px;
  font-weight: 700;
}

.invoices-mobile-total-value {
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
}

.invoice-card-actions {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.invoice-menu-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
[hidden] { display: none !important; }
.invoice-card-actions[hidden] { display: none !important; }

/* Sticky mobile invoice summary (KROS-style) */
@media (max-width: 920px) {
  .invoices-mobile-summary {
    position: sticky;
    bottom: 0;
    z-index: 50;

    margin-top: var(--space-4);
    padding: 8px 10px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));

    background: linear-gradient(
      180deg,
      rgba(11, 15, 20, 0.85),
      rgba(11, 15, 20, 0.95)
    );

    border-top: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(6px);

    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
  }
}

@media (max-width: 920px) {
  .invoices-mobile-summary .micro { font-size: 10px; }
}


/* =========================================================
   FILTERS – MOBILE/TABLET COLLAPSIBLE "BUBBLE" (NO JS)
   Usage in HTML (same for invoices/timesheets/contracts/jobs...):

   <div class="filters-collapsible">
     <input class="filters-toggle" type="checkbox" id="filtersToggle">
     <label class="filters-bubble" for="filtersToggle">Filtre</label>
     <div class="filters-panel">
       ... existing filters form fields ...
     </div>
   </div>

   Desktop (>= 1025px): panel always visible, bubble hidden.
   Mobile/Tablet (<= 1024px): bubble visible, panel hidden until toggled.
   ========================================================= */

.filters-collapsible {
  position: relative;
}

.filters-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filters-bubble {
  display: none; /* enabled only on mobile/tablet */
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  width: fit-content;
}

.filters-bubble::after {
  content: "▾";
  font-weight: 900;
  opacity: 0.9;
}

/* The panel is your existing filters wrapper (form / grid / etc.) */
.filters-panel {
  display: block;
}

/* Desktop: normal filters (always visible) */
@media (min-width: 1025px) {
  .filters-bubble { display: none !important; }
  .filters-panel { display: block !important; }
}

/* Mobile + Tablet: show bubble, collapse panel */
@media (max-width: 1024px) {
  .filters-bubble { display: inline-flex !important; }
  .filters-panel {
    display: none;
    margin-top: var(--space-3);
    padding: var(--space-3);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.03);
  }

  .filters-toggle:checked ~ .filters-bubble::after {
    content: "▴";
  }

  .filters-toggle:checked ~ .filters-panel {
    display: block;
  }
}


/* =========================================================
   FILTER BUBBLE NEXT TO PRIMARY ACTION (MOBILE/TABLET ONLY)
   – used on invoices (and reusable elsewhere)
   ========================================================= */

/* hidden by default (desktop) */
.filters-bubble--head {
  display: none;
}

@media (max-width: 1024px) {
  /* header actions row: filter bubble + primary button side by side */
  .invoices-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  /* show bubble in header */
  .filters-bubble--head {
    display: inline-flex !important;
  }

}



/* =========================================================
   CARD QUICK PDF ACTION (invoice cards)
   ========================================================= */
/* =========================================================
   CARD QUICK PDF ACTION (invoice cards)
   ========================================================= */

/* container for quick actions in card header (PDF + menu) */
.invoice-card-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* quick PDF bubble (same size as menu button) */
.invoice-card-quick-pdf {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.invoice-card-quick-pdf:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

.invoice-card-quick-pdf-icon {
  font-size: 16px;
  line-height: 1;
}

/* Desktop: topbar full width */
@media (min-width: 1025px) {
  .app-topbar,
  .app-header {
    width: 100%;
  }

  /* ak máš vnútorný wrapper s max-width */
  .app-topbar .container,
  .app-topbar .topbar-inner,
  .app-header .container,
  .app-header .topbar-inner {
    max-width: none !important;
    width: 100% !important;
  }

  /* aby sa logo a logout roztiahli na okraje */
  .app-topbar .topbar-inner,
  .app-header .topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}
/* =========================================================
   FORMS – DISABLE CARD HOVER COLOR SHIFT
   (Create/Edit screens: prevent blue highlight when hovering over the big form card)
   ========================================================= */
.card.app-card:hover,
.card.card-flat.app-card:hover,
.app-card:hover {
  /* lock the visual state to the normal card look */
  background: rgba(255,255,255,0.04) !important;
  border-color: rgba(255,255,255,0.10) !important;
  box-shadow: 0 14px 46px rgba(0,0,0,0.46) !important;
  transform: none !important;
  filter: none !important;
}

/* ===============================
   FORMS — REMOVE BLUE FOCUS/ACCENT
   =============================== */

/* Remove default blue outline */
input:focus,
select:focus,
textarea:focus,
.input:focus,
button:focus,
.btn:focus,
a:focus {
  outline: none;
}

/* Use consistent teal focus ring */
input:focus,
select:focus,
textarea:focus,
.input:focus {
  border-color: rgba(64, 224, 208, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(64, 224, 208, 0.18) !important;
}