

/* =========================================================
   APP.CSS – štýly pre WEB APP (login, dashboard, screens)
   ========================================================= */



/* Rounded outer edges (same feel as Timesheet detail) */
.card.card-flat {
  border-radius: var(--radius-xl) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  overflow: hidden;
}

/* Same for APP cards (contracts/orders/timesheets form container) */
.app-card.app-card-flat {
  border-radius: var(--radius-xl) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  overflow: hidden;
}
/* ---------- APP SHELL ---------- */
.app-shell {

  display: flex;
  align-items: center;
}


/* ===== Invoice totals: FORCE sizing by IDs (fallback) ===== */
/* Ak HTML nepoužíva .totals-value/.totals-label ale ID sumBase/sumVat/sumTotal */
.totals #sumBase,
.totals #sumVat,
.totals #sumTotal,
#invoiceTotals #sumBase,
#invoiceTotals #sumVat,
#invoiceTotals #sumTotal {
  font-size: 20px !important;   /* nastav tu čísla */
  font-weight: 900 !important;
  line-height: 1.2;
}

/* mena hneď vedľa čísla */
.totals #sumBase .currency-suffix,
.totals #sumVat .currency-suffix,
.totals #sumTotal .currency-suffix,
#invoiceTotals #sumBase .currency-suffix,
#invoiceTotals #sumVat .currency-suffix,
#invoiceTotals #sumTotal .currency-suffix {
  font-size: 20px !important;
  font-weight: 900 !important;
  opacity: 1 !important;
}

/* labely (Základ DPH/DPH/Celkom) – ak sú v .totals-label, nechaj ich rovnaké */
.totals .totals-label,
#invoiceTotals .totals-label {
  font-size: 20px !important;
  font-weight: 900 !important;
}
/* ---------- AUTH LAYOUT ---------- */
.app-auth {
  display: grid;
  gap: var(--space-7);
}

@media (min-width: 900px) {
  .app-auth {
    grid-template-columns: 1fr 0.9fr;
    align-items: stretch;
  }
}

/* ---------- AUTH CARD ---------- */
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
  box-shadow: var(--shadow-soft);
}

.auth-card .section-head {
  margin-bottom: var(--space-6);
}

/* ---------- FORM ---------- */
.form {
  display: grid;
  gap: var(--space-5);
}

.form-error {
  min-height: 1.2em;
  color: #ff6b6b;
  font-size: 0.9rem;
}

/* ---------- ROLE SWITCH ---------- */
.role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: var(--space-5);
}

.role-btn {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--bg-main);
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
}

.role-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text-main);
}

/* ---------- AUTH LINKS ---------- */
.auth-links {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

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

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

/* ---------- SIDE PANEL ---------- */
.auth-side {
  background: linear-gradient(180deg, var(--bg-alt), var(--bg-main));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: var(--space-7);
}

.auth-side h3 {
  margin-bottom: var(--space-4);
}

.auth-side ul {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

/* ---------- CHECKLIST ---------- */
.checklist li {
  position: relative;
  padding-left: 22px;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 899px) {
  .auth-side {
    display: none;
  }
}


/* =========================================================
   DASHBOARD + APP LAYOUT
   ========================================================= */

/* TOPBAR */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(11, 15, 20, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.app-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
}

/* MAIN LAYOUT */
.app-layout {
  display: grid;
  grid-template-columns: 260px 1fr;

}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
}

/* SIDEBAR */
.app-sidebar {
  background: rgba(11, 15, 20, 0.86);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-soft);
  padding: var(--space-6);
  position: sticky;
  top: 64px; /* height of topbar */
  height: calc(100vh - 64px);
  overflow: auto;
}

.app-nav {
  display: grid;
  gap: 8px;
}

.app-nav-link {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
}

.app-nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-main);
  border: 1px solid rgba(255,255,255,0.10);
}

.app-nav-link.is-active {
  background: linear-gradient(
    135deg,
    rgba(79, 209, 197, 0.36),
    rgba(56, 178, 172, 0.22)
  );
  color: #ffffff;
  border: 1px solid rgba(79, 209, 197, 0.62);
  box-shadow:
    inset 0 0 0 1px rgba(79, 209, 197, 0.45),
    0 0 0 4px rgba(79, 209, 197, 0.18),
    0 10px 26px rgba(0,0,0,0.22);
}

/* CONTENT */
.app-content {
  padding: var(--space-7);
}

/* Make app pages wider on desktop (like Výkazy) */
.app-content .container,
.app-content .container-wide,
.app-content .container.container-wide {
  width: 100% !important;
  max-width: 1520px !important;
  margin-left: auto;
  margin-right: auto;
}

/* Slightly tighter side padding on very wide screens */
@media (min-width: 1400px) {
  .app-content {
    padding-left: calc(var(--space-7) + 10px);
    padding-right: calc(var(--space-7) + 10px);
  }
}

.app-content-head {
  margin-bottom: var(--space-6);
}

/* CARDS */
.app-grid {
  display: grid;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.app-grid.stats {
  grid-template-columns: repeat(3, 1fr);
}

.app-grid.modules {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .app-grid.stats,
  .app-grid.modules {
    grid-template-columns: 1fr;
  }
}

.app-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-6);
  box-shadow: 0 14px 46px rgba(0,0,0,0.46);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
}

.link-card {
  text-decoration: none;
  color: inherit;
}

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

.stat-big {
  font-size: 2.2rem;
  font-weight: 800;
  margin: 6px 0;
}

/* FOOT NOTE */
.app-note {
  background: linear-gradient(180deg, var(--bg-alt), var(--bg-main));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

/* =========================================================
   JOBS SCREEN
   ========================================================= */

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  appearance: none;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
}

.tab:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
  background: var(--bg-card);
}

.tab.is-active {
  background: rgba(61, 220, 151, 0.14);
  border-color: rgba(61, 220, 151, 0.55);
  color: var(--text-main);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.10);
}

/* Filters grid */
.filters {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: var(--space-4);
}

@media (max-width: 1100px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .filters {
    grid-template-columns: 1fr;
  }
}

/* Field blocks inside filters */
.field {
  display: grid;
  gap: 8px;
}

.field > span {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  outline: none;
}

.field textarea {
  height: auto;
  min-height: 110px;
  resize: vertical;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.15);
}

/* =========================================================
   FORM FALLBACKS (for screens that don't wrap inputs in .field)
   - ensures Timesheets/Contracts forms match Invoice form styling
   ========================================================= */
.app-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.app-card select,
.app-card textarea {
  width: 100%;
  height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  outline: none;
}

.app-card textarea {
  height: auto;
  min-height: 110px;
  resize: vertical;
}

.app-card input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.app-card input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
.app-card select:focus,
.app-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.15);
}

/* labels inside app cards */
.app-card label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* nicer select arrow (keeps native) */
.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.55) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.55) 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.filter-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-5);
  align-items: center;
}

.filter-actions .btn {
  height: 44px;
  padding-inline: 16px;
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.9rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.pill:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.18);
}

.pill-soft {
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

/* Job cards */
.job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.job-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.job-actions {
  margin-top: 0;               /* price-tag controls bottom alignment */
  padding-top: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  align-items: stretch;
}

.job-actions .btn {
  width: 100%;
}

/* Make module grid a bit wider on large screens for job cards */
@media (min-width: 1100px) {
  .app-grid.modules {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


/* Price tag (job €/h) */
.price-tag {
  margin-top: auto;            /* THIS pushes price + buttons to bottom */
  margin-bottom: var(--space-3); /* tight spacing above buttons */
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.95rem;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text-main);
  width: fit-content;
}

/* =========================================================
   JOB DETAIL
   ========================================================= */

.job-detail-grid {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: start;
}

@media (max-width: 980px) {
  .job-detail-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   PROFILE PAGE
   ========================================================= */

/* Avatar */
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  color: var(--text-main);
  font-weight: 900;
  display: grid;
  place-items: center;
  letter-spacing: 0.02em;
}

/* Availability */
.availability {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.avail-btn {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-muted);
  font-weight: 800;
  cursor: pointer;
}

.avail-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text-main);
}

/* Key–value rows */
.kv {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.kv-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  align-items: center;
}

.kv-key {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
}

.kv-val {
  font-weight: 600;
}

/* Lists (certificates etc.) */
.list {
  display: grid;
  gap: 12px;
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-soft);
}

/* Chips (skills) */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Profile grid responsive */
@media (max-width: 900px) {
  .app-grid[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}


/* =========================================================
   SETTINGS PAGE
   ========================================================= */

/* Settings forms spacing */
.settings-card .form {
  margin-top: var(--space-4);
}

/* Settings helper text */
.settings-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Language select full width */
.settings-lang select {
  width: 100%;
}

/* Password section separation */
.settings-section + .settings-section {
  margin-top: var(--space-6);
}

/* Save feedback */
.settings-saved {
  font-size: 0.85rem;
  margin-top: 10px;
  color: var(--accent);
}

/* Make settings grid responsive (2 → 1 column) */
@media (max-width: 900px) {
  .settings-grid {
    grid-template-columns: 1fr !important;
  }
}


/* =========================================================
   FORMS PAGE
   ========================================================= */

/* Forms grid cards – make them feel actionable */
.forms-grid .app-card {
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.forms-grid .app-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

/* Icon placeholder (future-proof if we add icons later) */
.form-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  display: grid;
  place-items: center;
  font-weight: 900;
  margin-bottom: var(--space-3);
}

/* Forms card description spacing */
.forms-grid .app-card p {
  line-height: 1.5;
}

/* Actions always at bottom */
.forms-grid .app-card {
  display: flex;
  flex-direction: column;
}

.forms-grid .job-actions {
  margin-top: auto;
}

/* Mobile polish */
@media (max-width: 600px) {
  .forms-grid {
    gap: var(--space-4);
  }
}


/* =========================================================
   INVOICES PAGE
   ========================================================= */

.invoices-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.invoices-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Range inputs (date from/to)
   Fix overflow on mobile/tablet inside the filter bubble */
.range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

/* Critical: allow grid children to shrink (prevents spilling outside bubble) */
.range > * {
  min-width: 0;
}

/* Inputs should never exceed the bubble width */
.range input,
.range select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  /* On tablet/mobile stack date inputs under each other */
  .range {
    grid-template-columns: 1fr !important;
  }
}

/* Table */
.table-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: var(--space-4);
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.02);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px; /* horizontal scroll on small screens */
}

.table th,
.table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: middle;
}

.table thead th {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 800;
  background: rgba(255,255,255,0.03);
}

.table tbody tr:hover {
  background: rgba(255,255,255,0.04);
}

.ta-right {
  text-align: right !important;
}

/* Small buttons */
.btn-sm {
  padding: 8px 10px;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
}

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.04);
  font-weight: 800;
  font-size: 0.8rem;
  white-space: nowrap;
}

.status-paid {
  border-color: rgba(0, 200, 150, 0.35);
}

.status-sent {
  border-color: rgba(80, 160, 255, 0.35);
}

.status-draft {
  border-color: rgba(255, 255, 255, 0.18);
}


.status-overdue {
  border-color: rgba(255, 120, 120, 0.4);
}

/* Head responsive */
@media (max-width: 720px) {
  .invoices-head {
    flex-direction: column;
  }
}

/* =========================================================
   CONTRACTS / ORDERS HEAD (desktop alignment)
   - on desktop: title left, "+ Nový dokument" button right
   ========================================================= */

.contracts-head,
.orders-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.contracts-head-actions,
.orders-head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* If the button is the only thing in actions, keep it pinned to the right */
.contracts-head-actions .btn,
.contracts-head-actions .filters-bubble,
.orders-head-actions .btn,
.orders-head-actions .filters-bubble {
  margin-left: auto;
}

/* ===== Inline picker (clients/items) – same look as odberateľ picker ===== */
.itemPickerPanel,
.clientPicker {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 500;

  background: linear-gradient(180deg, var(--bg-alt), var(--bg-main));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 10px;
}

.itemPickerList,
#clientPickerList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.itemPickerList > li,
#clientPickerList > li {
  margin: 0;
  padding: 0;
}

.itemPickerList button,
#clientPickerList button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  cursor: pointer;
  font-weight: 700;
}

.itemPickerList button:hover,
#clientPickerList button:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.itemPickerList button:focus,
#clientPickerList button:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.15);
}

/* Empty state text inside picker */
.itemPickerEmpty,
#clientPickerEmpty,
.micro.muted {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 2px 2px;
}


/* =========================================================
   TIMESHEETS PAGE
   ========================================================= */

.timesheets-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.timesheets-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Status variants for timesheets */
.status-submitted {
  border-color: rgba(80, 160, 255, 0.35);
}

.status-approved {
  border-color: rgba(0, 200, 150, 0.35);
}

/* Head responsive */
@media (max-width: 720px) {
  .timesheets-head {
    flex-direction: column;
  }
}

/* ===== Modal (generic) ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: rgba(18, 24, 34, 0.96);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-body {
  padding: 16px 18px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.icon-btn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: inherit;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.10);
}

.totals-value{
  display:flex;
  align-items:baseline;
  justify-content:flex-end;
  gap:8px;
}

.currency-suffix{
  font-size: 12px;
  opacity: .75;
  min-width: 34px;  /* nech to neskáče pri EUR/CZK */
  text-align: left;
}


/* ===== Signature / stamp block (invoice) – force left alignment ===== */
#signatureSection,
#signatureWrap,
#signatureBlock,
.signature-section,
.signature-wrap,
.signature-block {
  text-align: left !important;
  margin-left: 0 !important;
  margin-right: auto !important;
}

#signatureSection *,
#signatureWrap *,
#signatureBlock *,
.signature-section *,
.signature-wrap *,
.signature-block * {
  text-align: left !important;
}

/* If the signature area is laid out with flex/grid, keep it anchored to the left */
#signatureSection,
#signatureWrap,
#signatureBlock,
.signature-section,
.signature-wrap,
.signature-block {
  justify-content: flex-start !important;
  align-items: flex-start !important;
}

/* Preview image: keep left and prevent centering */
#signaturePreview,
.signature-preview {
  display: block;
  text-align: left !important;
}

#signaturePreview img,
.signature-preview img {
  display: block;
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* File input row (label + input) */

#signatureSection .field,
#signatureWrap .field,
.signature-section .field,
.signature-wrap .field {
  justify-items: start;
}


/* ===== Invoice totals: MEGA (labels + sums) ===== */
.totals,
.invoice-totals,
#invoiceTotals {
  font-size: 22px; /* celkový základ pre tento blok */
  line-height: 1.25;
}

.totals .totals-row,
.invoice-totals .totals-row,
#invoiceTotals .totals-row {
  padding: 12px 0;
}

.totals .totals-label,
.invoice-totals .totals-label,
#invoiceTotals .totals-label {
  font-size: 20px;
  font-weight: 900;
  opacity: 1;
}

/* čísla + mena vpravo */
.totals-value{
  font-size: 20px;      /* rovnaká veľkosť ako labely */
  font-weight: 900;
  letter-spacing: .2px;
}

.currency-suffix{
  font-size: 22px;      /* € / CZK */
  font-weight: 900;
  opacity: 1;
  min-width: 46px;
}

/* Celkom ešte väčšie (ak má riadok triedu totals-total) */
.totals .totals-total .totals-value,
.invoice-totals .totals-total .totals-value,
#invoiceTotals .totals-total .totals-value {
  font-size: 20px;   /* rovnaké ako ostatné sumy */
  font-weight: 900;
}





/* =========================================================
   RESPONSIVE POLISH (TABLET + MOBILE)
   - keep HTML/JS unchanged
   - stack layouts, tighten paddings, improve touch targets
   ========================================================= */

/* ---------- TABLET (<= 1024px) ---------- */
@media (max-width: 1024px) {
  .app-content {
    padding: var(--space-6);
  }

  .app-grid.stats,
  .app-grid.modules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .job-actions {
    grid-template-columns: 1fr; /* buttons under each other */
  }

  .stat-big {
    font-size: 2rem;
  }

  /* Modals: a little wider on tablet but comfortable */
  .modal {
    width: min(860px, 100%);
  }
}


/* ---------- SMALL TABLET / LANDSCAPE MOBILE (<= 900px) ---------- */
@media (max-width: 900px) {
  .app-topbar-inner {
    padding: var(--space-3) 0;
    gap: 10px;
  }

  /* Sidebar becomes a top section (no JS drawer needed) */
  .app-layout {
    grid-template-columns: 1fr;
  }

  /* MOBILE SIDEBAR -> TOP NAV BAR (under header) */
  .app-sidebar {
    position: sticky;
    top: 64px;              /* height of topbar */
    left: 0;
    right: 0;

    height: auto;
    padding: 10px 12px;

    background: rgba(11, 15, 20, 0.92);
    backdrop-filter: blur(14px);

    border-right: 0;
    border-top: 0;
    border-bottom: 1px solid var(--border-soft);

    z-index: 450;
    overflow: visible;
  }

  .app-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .app-nav-link {
    flex: 1;
    text-align: center;
    padding: 10px 10px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: 0.92rem;

    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
  }

  .app-nav-link:hover {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
  }

  /* Make sure active state still pops on mobile */
  .app-nav-link.is-active {
    background: linear-gradient(
      135deg,
      rgba(79, 209, 197, 0.36),
      rgba(56, 178, 172, 0.22)
    );
    border: 1px solid rgba(79, 209, 197, 0.62);
  }

  /* Content padding: tighter on small screens */
  .app-content {
    padding: 10px;
  }

  /* On small screens: don't center containers with big side margins */
  .app-content .container,
  .app-content .container-wide,
  .app-content .container.container-wide {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Cards */
  .app-card {
    padding: var(--space-5);
  }
}


/* ---------- MOBILE (<= 768px) ---------- */
@media (max-width: 768px) {
  .app-sidebar {
    padding: 8px 10px;
  }

  .app-nav-link {
    padding: 10px 8px;
    font-size: 0.9rem;
  }

  .app-shell {
    min-height: 100vh;
    align-items: stretch;
  }

  .app-content-head {
    margin-bottom: var(--space-5);
  }

  /* Phone: even tighter page padding */
  .app-content {
    padding: 8px;
  }

  /* Containers: full width on phones */
  .app-content .container,
  .app-content .container-wide,
  .app-content .container.container-wide {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Make grids single column */
  .app-grid.stats,
  .app-grid.modules {
    grid-template-columns: 1fr;
  }

  /* Reduce heavy typography a bit */
  .stat-big {
    font-size: 1.8rem;
  }

  /* Tables: keep scroll but improve readability */
  .table th,
  .table td {
    padding: 10px 10px;
  }

  .table thead th {
    font-size: 0.8rem;
  }

  /* Invoice totals: slightly smaller on phones */
  .totals,
  .invoice-totals,
  #invoiceTotals {
    font-size: 18px;
  }

  .totals .totals-label,
  .invoice-totals .totals-label,
  #invoiceTotals .totals-label {
    font-size: 16px;
  }

  .totals-value {
    font-size: 16px;
  }

  .currency-suffix {
    font-size: 16px;
    min-width: 34px;
  }

  /* Pickers (clients/items) – prevent overflow on small screens */
  .itemPickerPanel,
  .clientPicker {
    left: 0;
    right: 0;
    max-height: 55vh;
    overflow: auto;
  }

  /* Forms: buttons full width by default in action rows */
  .filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-actions .btn {
    width: 100%;
  }

  /* Modals padding tighter */
  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 14px;
    padding-right: 14px;
  }
}


/* ---------- SMALL MOBILE (<= 480px) ---------- */
@media (max-width: 480px) {
  .app-content {
    padding: 6px;
  }

  .app-sidebar {
    padding: var(--space-3);
  }

  .app-card {
    padding: 12px;
    border-radius: var(--radius-lg);
  }

  .btn-sm {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  /* Inputs: comfortable touch */
  .field input,
  .field select,
  .field textarea {
    height: 46px;
  }

  .app-nav {
    gap: 6px;
  }

  .app-nav-link {
    font-size: 0.88rem;
    padding: 10px 6px;
  }
}


/* =========================================================
   MOBILE + TABLET UNIFICATION (clean)
   - avoids duplicates with RESPONSIVE POLISH above
   ========================================================= */

/* Stop any left-right scrolling globally */
html, body {
  overflow-x: hidden;
}

/* Ensure containers never exceed viewport width */
.app-shell,
.app-layout,
.app-content,
.app-card,
.container,
.container-wide,
.container.container-wide {
  max-width: 100%;
}

/* Make header action area a single "bubble" on mobile/tablet */
@media (max-width: 900px) {
  /* Hide big page headings above filters on mobile/tablet (Invoices/Timesheets/Contracts/Orders)
     -> on mobile we want only the bubble row (Filter + New) */
  .invoices-head h1,
  .timesheets-head h1,
  .contracts-head h1,
  .orders-head h1,
  .invoices-head .page-title,
  .timesheets-head .page-title,
  .contracts-head .page-title,
  .orders-head .page-title,
  .invoices-head p,
  .timesheets-head p,
  .contracts-head p,
  .orders-head p,
  .invoices-head .muted,
  .timesheets-head .muted,
  .contracts-head .muted,
  .orders-head .muted {
    display: none !important;
  }

  /* tighten the head container spacing so the bubble sits higher */
  .invoices-head,
  .timesheets-head,
  .contracts-head,
  .orders-head {
    margin-bottom: 0 !important;
    gap: 0 !important;
  }
  .invoices-head-actions,
  .timesheets-head-actions,
  .contracts-head-actions,
  .orders-head-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;

    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 14px 46px rgba(0,0,0,0.28);
    backdrop-filter: blur(14px);
  }

  .invoices-head-actions .btn,
  .timesheets-head-actions .btn,
  .contracts-head-actions .btn,
  .orders-head-actions .btn,
  .invoices-head-actions button,
  .timesheets-head-actions button,
  .contracts-head-actions button,
  .orders-head-actions button,
  .invoices-head-actions a.btn,
  .timesheets-head-actions a.btn,
  .contracts-head-actions a.btn,
  .orders-head-actions a.btn {
    height: 48px;
    border-radius: 999px;
    width: 100%;
  }

  /* --- MERGE "New" button bubble + Filter bubble into ONE visual block --- */
  .invoices-head-actions,
  .timesheets-head-actions,
  .contracts-head-actions,
  .orders-head-actions {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
    padding-bottom: 8px;
  }

  /* the filter container is usually the next app-card or .filters-collapsible */
  .invoices-head-actions + .filters-collapsible,
  .timesheets-head-actions + .filters-collapsible,
  .contracts-head-actions + .filters-collapsible,
  .orders-head-actions + .filters-collapsible,
  .invoices-head-actions + .app-card,
  .timesheets-head-actions + .app-card,
  .contracts-head-actions + .app-card,
  .orders-head-actions + .app-card {
    margin-top: -1px; /* visually joins borders */
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
  }

  /* if that next card has its own background/border, keep it but make it match */
  .invoices-head-actions + .filters-collapsible,
  .timesheets-head-actions + .filters-collapsible,
  .contracts-head-actions + .filters-collapsible,
  .orders-head-actions + .filters-collapsible {
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 14px 46px rgba(0,0,0,0.28);
    backdrop-filter: blur(14px);
    padding: 10px;
  }

  /* remove double padding when the filter area already contains its own app-card */
  .invoices-head-actions + .filters-collapsible .app-card,
  .timesheets-head-actions + .filters-collapsible .app-card,
  .contracts-head-actions + .filters-collapsible .app-card,
  .orders-head-actions + .filters-collapsible .app-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  /* collapse any multi-column layout helpers inside forms */
  .filters,
  .range,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* neutralize inline grid spans that cause overlaps */
  [style*="grid-column"] {
    grid-column: auto !important;
  }

  /* Prevent any filter content from overflowing the joined “bubble” container */
  .filters-collapsible,
  .filters-panel,
  .filters {
    width: 100%;
  }

  .filters-collapsible * {
    box-sizing: border-box;
  }

  /* Any inline widths inside filter markup must not push outside */
  .filters-collapsible input,
  .filters-collapsible select,
  .filters-collapsible textarea {
    max-width: 100%;
  }

  /* --- FIX iOS/Safari: date inputs overflow in filter bubble --- */
  .invoices-head-actions + .filters-collapsible,
  .timesheets-head-actions + .filters-collapsible,
  .contracts-head-actions + .filters-collapsible,
  .orders-head-actions + .filters-collapsible {
    overflow-x: hidden; /* stop tiny horizontal spill */
  }

  /* allow children to shrink (Safari sometimes ignores grid minmax without this) */
  .filters-collapsible .field,
  .filters-collapsible label.field {
    width: 100%;
    min-width: 0;
  }

  /* Force date range to be a true full-width stack on mobile/tablet */
  .filters-collapsible .range {
    width: 100%;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
  }

  .filters-collapsible .range > * {
    min-width: 0 !important;
  }

  /* iOS Safari: native date inputs have implicit min-width; neutralize it */
  .filters-collapsible input[type="date"] {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;

    appearance: none;
    -webkit-appearance: none;

    /* keep same look as other inputs */
    height: 44px;
    padding: 10px 12px;
  }
}



@media (max-width: 420px) {
  .invoices-head-actions,
  .timesheets-head-actions,
  .contracts-head-actions,
  .orders-head-actions {
    grid-template-columns: 1fr;
  }
}


/* Make tables scroll INSIDE their wrapper instead of the whole page */
.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


/* Timesheet "empty" helper text centered */
.table-wrap .micro.muted {
  display: block;
  text-align: center;
}

/* Remove caret/arrow for legacy plain bubbles (kept for other screens) */
.filters-bubble.filters-bubble--plain{
  padding-right: 16px !important; /* cancel extra space reserved for caret */
  background-image: none !important;
}

.filters-bubble.filters-bubble--plain::after{
  content: none !important;
  display: none !important;
}

/* Remove caret/arrow for action bubbles like "+ Nová faktúra" / "+ Nový dokument" */
.filters-bubble--btn{
  padding-right: 16px !important; /* cancel space reserved for caret */
}

.filters-bubble--btn::after{
  content: none !important;
  display: none !important;
}

/* Swap bubble positions: Filter on the LEFT, New on the RIGHT */
.filters-row,
.filters-bubbles-row{
  display:flex;
  align-items:center;
  gap:10px;
}

/* Keep Filter first (left) */
.filters-row > label.filters-bubble,
.filters-bubbles-row > label.filters-bubble{
  order:1;
}

/* Push the primary action (New) to the right */
.filters-row > button.filters-bubble,
.filters-row > a.filters-bubble,
.filters-bubbles-row > button.filters-bubble,
.filters-bubbles-row > a.filters-bubble,
.filters-bubbles-row > #newTimesheetBtn{
  order:2;
  margin-left:auto;
}


/* Remove caret/arrow ONLY for the primary "New" bubble button */
#newTimesheetBtn{
  padding-right: 16px !important; /* cancel extra space reserved for caret */
  background-image: none !important;
}

#newTimesheetBtn::after{
  content: none !important;
  display: none !important;
}


/* =========================
   DESKTOP SAFETY (Timesheets)
   - ensure "New timesheet" button never disappears on desktop
   - keep Filter left / New right consistently
   ========================= */

/* Default (desktop + all): show head actions */
.timesheets-head-actions,
.invoices-head-actions,
.contracts-head-actions,
.orders-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Ensure bubble row uses flex and spans full width when used */
.timesheets-head-actions .filters-row,
.timesheets-head-actions .filters-bubbles-row,
.invoices-head-actions .filters-row,
.invoices-head-actions .filters-bubbles-row,
.contracts-head-actions .filters-row,
.contracts-head-actions .filters-bubbles-row,
.orders-head-actions .filters-row,
.orders-head-actions .filters-bubbles-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* Filter stays left */
.timesheets-head-actions .filters-row > label.filters-bubble,
.timesheets-head-actions .filters-bubbles-row > label.filters-bubble,
.invoices-head-actions .filters-row > label.filters-bubble,
.invoices-head-actions .filters-bubbles-row > label.filters-bubble,
.contracts-head-actions .filters-row > label.filters-bubble,
.contracts-head-actions .filters-bubbles-row > label.filters-bubble,
.orders-head-actions .filters-row > label.filters-bubble,
.orders-head-actions .filters-bubbles-row > label.filters-bubble {
  order: 1;
}

/* Primary "New" button goes right */
.timesheets-head-actions .filters-row > #newTimesheetBtn,
.timesheets-head-actions .filters-bubbles-row > #newTimesheetBtn,
.invoices-head-actions .filters-row > #newInvoiceBtn,
.invoices-head-actions .filters-bubbles-row > #newInvoiceBtn,
.contracts-head-actions .filters-row > #newContractBtn,
.contracts-head-actions .filters-bubbles-row > #newContractBtn,
.orders-head-actions .filters-row > #newOrderBtn,
.orders-head-actions .filters-bubbles-row > #newOrderBtn {
  order: 2;
  margin-left: auto;
}

/* Also catch generic "New" bubbles implemented as <button class="filters-bubble"> */
.timesheets-head-actions .filters-row > button.filters-bubble,
.timesheets-head-actions .filters-bubbles-row > button.filters-bubble,
.invoices-head-actions .filters-row > button.filters-bubble,
.invoices-head-actions .filters-bubbles-row > button.filters-bubble,
.contracts-head-actions .filters-row > button.filters-bubble,
.contracts-head-actions .filters-bubbles-row > button.filters-bubble,
.orders-head-actions .filters-row > button.filters-bubble,
.orders-head-actions .filters-bubbles-row > button.filters-bubble {
  margin-left: auto;
}

/* =========================================================
   GLOBAL HEADER GLOW (all screens)
   ========================================================= */
.app-content-head{
  position: relative;
}

.app-content-head::before{
  content:"";
  position:absolute;
  inset:-40px -40px auto -40px;
  height:240px;
  pointer-events:none;
  background: radial-gradient(
    600px 220px at 70% 30%,
    rgba(79, 209, 197, 0.22),
    rgba(0,0,0,0)
  );
  filter: blur(10px);
}