* {
  box-sizing: border-box;
}

:root {
  --ink: #0a0a0a;
  --ink-soft: #c8c2ba;
  --mist: #2a2622;
  --mist-deep: #3d3732;
  --page-top: #1a1410;
  --page-bot: #0a0a0a;
  --surface: #161412;
  --surface-muted: #1e1b18;
  --text: #f2efe9;
  --text-muted: #9a9288;
  --border: #33302c;
  --amber: #e85d04;
  --amber-hover: #ff6d14;
  --amber-soft: #2a180e;
  --steel: #b8aea4;
  --steel-soft: #252220;
  --success: #3ecfad;
  --success-soft: #122e28;
  --danger: #f07171;
  --danger-soft: #3a1515;
  --sky: #5eb3e0;
  --sky-soft: #142832;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --radius-sm: 11px;
  --font-ui: 'Outfit', system-ui, sans-serif;
  color-scheme: dark;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  margin: 0;
  padding:
    max(1.25rem, env(safe-area-inset-top))
    max(1.25rem, env(safe-area-inset-right))
    max(2rem, env(safe-area-inset-bottom))
    max(1.25rem, env(safe-area-inset-left));
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  line-height: 1.55;
  background:
    radial-gradient(ellipse 70% 45% at 85% 0%, rgba(232, 93, 4, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 100%, rgba(232, 93, 4, 0.1), transparent 50%),
    linear-gradient(160deg, #1f1612 0%, #0d0d0d 45%, #080808 100%);
  background-attachment: fixed;
}

.container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(232, 93, 4, 0.14),
    var(--shadow);
  /* visible so sticky tabs work; radius still applied on shell */
  overflow: visible;
  color: var(--text);
}

/* Nav — dark bar, soft on eyes, orange active */
.tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  padding: 0.55rem 0.6rem;
  background: linear-gradient(180deg, #1a1a1a 0%, #111 100%);
  border-bottom: 1px solid #2a2a2a;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 40;
  border-radius: var(--radius) var(--radius) 0 0;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  flex: 1 1 0;
  min-width: 4.2rem;
  padding: 0.68rem 0.4rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.48);
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  overflow: visible;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
}

.tab.active {
  background: var(--amber);
  color: #fff;
  box-shadow: 0 2px 12px rgba(232, 93, 4, 0.35);
  font-weight: 600;
}

.tab.active:hover {
  background: var(--amber-hover);
  color: #fff;
}

.panel {
  display: none;
  padding: 1.35rem 1.35rem 1.6rem;
}

.panel.active {
  display: block;
  animation: fadeIn 0.28s ease-out;
}

.form-section {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.form-section-title {
  margin: 0 0 1rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
}

.form-section-desc {
  margin: 0 0 1rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-islaidos-blokas {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 1.15rem;
}

.form-islaidos-subtitle {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* Form */
.forma .form-group {
  margin-bottom: 1.1rem;
  min-width: 0;
  max-width: 100%;
}

.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.pvm-preview {
  margin-top: 0.55rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--amber-soft);
  border: 1px solid rgba(232, 93, 4, 0.35);
  border-radius: var(--radius-sm);
}

.pvm-preview strong {
  font-weight: 650;
  color: #ff9a4a;
}

.forma label,
.label-like {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 550;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.forma input[type="text"],
.forma input[type="number"],
.forma input[type="date"],
.forma textarea,
.backup-section select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem; /* ≥16px — no iOS zoom on focus */
  font-family: inherit;
  background: var(--surface-muted);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 2.75rem;
  box-sizing: border-box;
}

/* iOS Safari date fields have huge intrinsic width — force fit */
.forma input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  line-height: 1.25;
}

.forma input:hover,
.forma textarea:hover,
.backup-section select:hover {
  border-color: var(--mist-deep);
}

.forma input:focus,
.forma textarea:focus,
.backup-section select:focus,
.filtrai input:focus,
.filtrai select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.18);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 561px) {
  .form-row-uzrasai {
    grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  }
}

[hidden],
.form-row[hidden],
.billing-fields-hidden {
  display: none !important;
}

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

.form-row-4 {
  grid-template-columns: repeat(4, 1fr);
}

.form-row-6 {
  grid-template-columns: repeat(6, 1fr);
}

.saskaitos-sarasas {
  margin-bottom: 0.5rem;
  min-height: 0.5rem;
}

.saskaitos-sarasas .saskaita-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.9rem;
}

.saskaitos-sarasas .saskaita-item .suma {
  font-weight: 600;
  color: var(--text);
}

.saskaitos-sarasas .saskaita-item button {
  margin-left: auto;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  border: none;
  background: var(--mist);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.saskaitos-sarasas .saskaita-item button:hover {
  background: var(--amber-soft);
  color: #ff9a4a;
}

.saskaita-eilute {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.saskaita-eilute input.saskaita-sum {
  width: 95px;
}

.saskaita-eilute input.saskaita-apr {
  flex: 1;
  min-width: 120px;
}

/* Buttons */
.btn {
  padding: 0.7rem 1.15rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover {
    transform: translateY(-1px);
  }
}

.btn:active {
  transform: translateY(0) scale(0.985);
}

.btn-primary {
  background: var(--amber);
  color: #fff;
  width: 100%;
  margin-top: 0.5rem;
  box-shadow: 0 4px 18px rgba(232, 93, 4, 0.35);
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: var(--amber-hover);
  box-shadow: 0 6px 22px rgba(232, 93, 4, 0.42);
}

.btn-small {
  padding: 0.42rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 500;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn-small:hover {
  background: var(--amber);
  color: #fff;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--ink);
  color: #fff;
  width: 100%;
  margin-top: 0.5rem;
}

.btn-secondary:hover {
  background: #2a2a2a;
  color: #fff;
}

/* Atsarginė */
.backup-section .backup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.backup-section .backup-actions .btn-small {
  width: 100%;
  margin-top: 0.35rem;
  text-align: center;
}

.backup-reminder {
  background: var(--amber-soft);
  border: 1px solid rgba(232, 93, 4, 0.35);
  color: #ffb07a;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.backup-month-stats {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0.75rem;
  min-height: 1.25rem;
}

.backup-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Filters / toolbars */
.filtrai,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
  padding: 0.65rem;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.filtrai label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.filtrai input[type="date"],
.filtrai input[type="search"],
.filtrai select {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem; /* no iOS zoom */
  background: var(--surface-muted);
  max-width: 100%;
  color: var(--text);
  min-height: 2.75rem;
}

.filtrai input[type="search"] {
  min-width: 7.5rem;
  flex: 1 1 8rem;
}

.filtrai select {
  min-width: 6.5rem;
}

.filtrai .btn-small {
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
}

.filtras-datos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  flex: 1 1 100%;
}

.filtras-datos-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1 1 10rem;
  min-width: 0;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filtras-datos-field input[type="date"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.dashboard-filtrai {
  margin-bottom: 1rem;
}

/* History */
.istorijos-sarasas {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.istorijos-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem 0.95rem;
  background: linear-gradient(165deg, #1c1916 0%, var(--surface-muted) 100%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .istorijos-item:hover {
    border-color: rgba(232, 93, 4, 0.4);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.32);
    transform: translateY(-1px);
  }
}

.item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.35rem;
}

.item-date {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.item-head-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}

.item-type {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.item-type-expense {
  background: var(--steel-soft);
  color: var(--steel);
}

.item-client {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 0.15rem 0 0.45rem;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
}

.item-body {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.istorijos-item .data-line {
  font-weight: 650;
  margin-bottom: 0.45rem;
  color: var(--text);
  font-size: 0.98rem;
}

.istorijos-item .detail {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr);
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  font-size: 0.95rem;
  line-height: 1.4;
  margin: 0;
  color: var(--text);
  padding: 0.18rem 0;
}

.detail-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-value {
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}

.detail-muted .detail-value {
  color: var(--ink-soft);
  font-weight: 500;
}

.item-amounts {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.item-amounts-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1;
}

.item-amounts-left .detail {
  padding: 0.08rem 0;
}

.item-amounts-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  flex-shrink: 0;
  text-align: right;
}

.item-amounts-right .detail-label {
  color: #ffb07a;
}

.item-amounts-only {
  justify-content: flex-end;
  border-top: none;
  padding-top: 0.15rem;
  margin-top: 0.15rem;
}

.detail-total {
  margin-top: 0.2rem;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.detail-total .detail-label {
  color: #ffb07a;
}

.money {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.money-total {
  font-size: 1.12rem;
  color: #ffb07a;
}

.istorijos-item .pastabos {
  margin-top: 0.55rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  border-left: 2px solid rgba(232, 93, 4, 0.35);
}

.istorijos-item .veiksmai {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* History action buttons */
.btn-hist {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.48rem 0.85rem;
  min-height: 2.35rem;
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.btn-hist:active {
  transform: scale(0.97);
}

.btn-hist-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(62, 207, 173, 0.35);
}

@media (hover: hover) and (pointer: fine) {
  .btn-hist-success:hover {
    background: rgba(62, 207, 173, 0.28);
    color: #6aefd0;
  }
}

.btn-hist-muted {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

@media (hover: hover) and (pointer: fine) {
  .btn-hist-muted:hover {
    color: var(--text);
    border-color: var(--mist-deep);
    background: rgba(255, 255, 255, 0.04);
  }
}

.btn-hist-sky {
  background: var(--sky-soft);
  color: var(--sky);
  border-color: rgba(94, 179, 224, 0.35);
}

@media (hover: hover) and (pointer: fine) {
  .btn-hist-sky:hover {
    background: rgba(94, 179, 224, 0.22);
  }
}

.btn-hist-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink-soft);
  border-color: var(--border);
  min-height: 2rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 550;
  vertical-align: middle;
  margin-left: 0.25rem;
}

@media (hover: hover) and (pointer: fine) {
  .btn-hist-ghost:hover {
    color: #ffb07a;
    border-color: rgba(232, 93, 4, 0.4);
    background: var(--amber-soft);
  }
}

.btn-hist-danger {
  background: transparent;
  color: #d4a0a0;
  border-color: rgba(240, 113, 113, 0.28);
}

@media (hover: hover) and (pointer: fine) {
  .btn-hist-danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: rgba(240, 113, 113, 0.5);
  }
}

.istorijos-item .veiksmai button.trynti {
  padding: 0.48rem 0.85rem;
  font-size: 0.86rem;
  margin-right: 0;
  min-height: 2.35rem;
  border: 1px solid rgba(240, 113, 113, 0.28);
  background: transparent;
  color: #d4a0a0;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.istorijos-item .veiksmai button.trynti:hover {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(240, 113, 113, 0.5);
}

.status-badge {
  display: inline-block;
  padding: 0.28rem 0.6rem;
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-left: 0;
}

.status-paid {
  background: var(--success-soft);
  color: var(--success);
  box-shadow: inset 0 0 0 1px rgba(62, 207, 173, 0.25);
}

.status-unpaid {
  background: var(--amber-soft);
  color: #ff9a4a;
  box-shadow: inset 0 0 0 1px rgba(232, 93, 4, 0.3);
}

.status-saskaita {
  background: var(--steel-soft);
  color: var(--steel);
  box-shadow: inset 0 0 0 1px rgba(184, 174, 164, 0.2);
}

.status-grynekas {
  background: var(--sky-soft);
  color: var(--sky);
  box-shadow: inset 0 0 0 1px rgba(94, 179, 224, 0.25);
}

.btn-mark-paid {
  margin-left: 0;
}

@media (max-width: 560px) {
  .istorijos-item .detail {
    grid-template-columns: 5.6rem minmax(0, 1fr);
    gap: 0.2rem 0.55rem;
    font-size: 0.92rem;
  }

  .item-client {
    font-size: 1.05rem;
  }

  .detail-label {
    font-size: 0.72rem;
  }

  .money-total {
    font-size: 1.05rem;
  }

  .item-head-badges {
    width: 100%;
    justify-content: flex-start;
  }

  .btn-hist-ghost {
    display: inline-flex;
    margin: 0.15rem 0 0;
  }

  .item-amounts {
    flex-wrap: nowrap;
    align-items: flex-end;
  }

  .item-amounts-left .detail {
    grid-template-columns: 4.8rem minmax(0, 1fr);
  }
}

.pay-kind-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.billing-options .pay-kind-option {
  min-width: 6rem;
  padding: 0.55rem 0.75rem;
}

.pay-kind-option {
  flex: 1;
  min-width: 7rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 500;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.pay-kind-option:has(input:checked) {
  border-color: var(--amber);
  background: var(--amber-soft);
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.2);
  color: #ff9a4a;
  font-weight: 600;
}

.pay-kind-option:has(#pay-grynekas:checked) {
  border-color: var(--sky);
  background: var(--sky-soft);
  box-shadow: 0 0 0 3px rgba(94, 179, 224, 0.18);
  color: var(--sky);
  font-weight: 600;
}

.pay-kind-hint {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.pay-kind-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pay-kind-visual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pay-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -0.2em;
}

.pay-kind-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.6rem;
}

.pay-kind-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.pay-kind-toggle {
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pay-kind-toggle .pay-icon {
  width: 1rem;
  height: 1rem;
}

.tuscia {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
  font-size: 0.95rem;
}

/* Užrašai badge — ant tab kampo, neįlenda į gretimą */
.tab-badge {
  position: absolute;
  top: 0.18rem;
  right: 0.18rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.28rem;
  margin: 0;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  background: var(--amber);
  color: #fff;
  box-shadow: 0 0 0 2px #111;
  pointer-events: none;
}

.tab:has(.tab-badge:not([hidden])) {
  padding-right: 1.15rem;
}

.tab:not(.active) .tab-badge {
  background: rgba(232, 93, 4, 0.92);
}

.tab.active .tab-badge {
  background: #fff;
  color: var(--amber);
  box-shadow: 0 0 0 2px var(--amber);
}

.uzrasai-sarasas {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.uzrasas-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.05rem;
  background: linear-gradient(165deg, #1c1916 0%, var(--surface-muted) 100%);
}

.uzrasas-item.uzrasas-today {
  border-color: rgba(232, 93, 4, 0.45);
  background: linear-gradient(165deg, #241810 0%, var(--surface-muted) 100%);
}

.uzrasas-item.uzrasas-overdue {
  border-color: rgba(240, 113, 113, 0.4);
}

.uzrasas-item.uzrasas-done {
  opacity: 0.58;
}

.uzrasas-item.uzrasas-done .uzrasas-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.uzrasas-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
  margin-bottom: 0.35rem;
}

.uzrasas-date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.uzrasas-day-badge {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--amber-soft);
  color: #ff9a4a;
}

.uzrasas-overdue .uzrasas-day-badge {
  background: var(--danger-soft);
  color: var(--danger);
}

.uzrasas-client {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: -0.015em;
}

.uzrasas-text {
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.uzrasas-item .veiksmai {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* PVM skaičiuoklė */
.pvm-calc-hint {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.pvm-calc-hint strong {
  color: #ffb07a;
  font-weight: 600;
}

.pvm-calc-load {
  margin-bottom: 1.25rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pvm-calc-period {
  grid-template-columns: 1fr 1fr;
}

.pvm-calc-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.1rem;
  margin: 0.15rem 0 0.85rem;
}

.pvm-calc-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  margin: 0;
  font-weight: 500;
}

.pvm-calc-check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--amber);
}

.pvm-calc-load .btn-primary {
  margin-top: 0;
}

.pvm-calc-load-status {
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: var(--success);
  line-height: 1.4;
}

.pvm-calc-load-status.is-error {
  color: #ff9a4a;
}

.pvm-calc-line-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: -0.15rem 0 0.4rem;
  line-height: 1.35;
  word-break: break-word;
}

.pvm-calc-lines {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.pvm-calc-line-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pvm-calc-line-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
}

.pvm-calc-amount {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface-muted);
  color: var(--text);
  min-height: 2.75rem;
  box-sizing: border-box;
}

.pvm-calc-amount:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.18);
}

.pvm-calc-remove {
  flex-shrink: 0;
  width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
}

.pvm-calc-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pvm-calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.15rem;
}

.pvm-calc-actions .btn-secondary {
  width: auto;
  margin-top: 0;
  flex: 1 1 auto;
}

.pvm-calc-actions .btn-small {
  min-height: 2.75rem;
}

.pvm-calc-result {
  padding: 1rem 1.05rem;
  background: linear-gradient(165deg, #1c1916 0%, var(--surface-muted) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.pvm-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.pvm-calc-row strong {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 650;
}

.pvm-calc-total {
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  color: #ffb07a;
  font-weight: 600;
}

.pvm-calc-total strong {
  font-size: 1.2rem;
  color: #ffb07a;
}

.pvm-calc-words-block {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pvm-calc-words-label {
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.pvm-calc-words {
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.pvm-calc-words-block .btn-primary {
  margin-top: 0;
}

.pvm-calc-pdf-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pvm-calc-pdf-actions .btn-secondary {
  width: 100%;
  margin-top: 0;
}

.invoice-rekvizitai {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  padding: 0.35rem 0.85rem 0.85rem;
}

.invoice-rekvizitai > summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.95rem;
  color: var(--text);
  padding: 0.65rem 0.15rem;
  list-style: none;
}

.invoice-rekvizitai > summary::-webkit-details-marker {
  display: none;
}

.invoice-rekvizitai > summary::before {
  content: '▸ ';
  color: #ffb07a;
}

.invoice-rekvizitai[open] > summary::before {
  content: '▾ ';
}

.invoice-rekv-title {
  margin: 1rem 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffb07a;
  letter-spacing: 0.02em;
}

.invoice-rekv-grid .btn-secondary {
  width: 100%;
  margin-top: 0.25rem;
  margin-bottom: 0.35rem;
}

/* PDF sąskaitos išvaizda (balta, kaip Excel) */
.inv-sheet {
  width: 190mm;
  max-width: 190mm;
  padding: 8mm 6mm;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  line-height: 1.35;
  box-sizing: border-box;
}

.inv-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.inv-logo {
  width: 42mm;
  height: auto;
  object-fit: contain;
  background: #000;
  padding: 4px 8px;
}

.inv-title-block {
  text-align: right;
  flex: 1;
}

.inv-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.inv-nr {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.inv-date span {
  color: #555;
  margin-right: 6px;
}

.inv-parties {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}

.inv-party {
  flex: 1;
  border: 1px solid #ccc;
  padding: 8px 10px;
  min-height: 28mm;
}

.inv-party-h {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #555;
  margin-bottom: 4px;
}

.inv-party-name {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 2px;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
}

.inv-table th,
.inv-table td {
  border: 1px solid #bbb;
  padding: 4px 5px;
  vertical-align: top;
}

.inv-table th {
  background: #f2f2f2;
  font-size: 10px;
  font-weight: 700;
}

.inv-table .c { text-align: center; }
.inv-table .r { text-align: right; white-space: nowrap; }

.inv-totals {
  margin: 8px 0 10px;
  text-align: right;
}

.inv-totals > div {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  padding: 2px 0;
}

.inv-moketi {
  font-size: 13px;
  font-weight: 700;
}

.inv-net-note {
  color: #666;
  font-size: 10px;
  justify-content: flex-end !important;
}

.inv-words {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid #ccc;
}

.inv-words span {
  display: block;
  font-size: 10px;
  color: #555;
  margin-bottom: 3px;
  font-weight: 700;
}

.inv-bank {
  margin: 10px 0;
}

.inv-bank span {
  color: #555;
  margin-right: 6px;
  font-weight: 700;
}

.inv-signs {
  display: flex;
  gap: 20px;
  margin-top: 18px;
}

.inv-signs > div {
  flex: 1;
}

.inv-sign-h {
  font-size: 10px;
  font-weight: 700;
  color: #555;
  margin-bottom: 8px;
}

.inv-sign-line {
  margin-top: 28px;
  border-bottom: 1px solid #999;
}

/* Dashboard */
.dashboard-period-label {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: #ffb07a;
  padding: 0.45rem 0.65rem;
  background: var(--amber-soft);
  border: 1px solid rgba(232, 93, 4, 0.3);
  border-radius: 8px;
  display: inline-block;
}

.dashboard-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2.5rem 1rem;
  font-size: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.35rem;
}

.stat-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: left;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  animation: fadeInUp 0.35s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.04s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.16s; }
.stat-card:nth-child(5) { animation-delay: 0.2s; }
.stat-card:nth-child(6) { animation-delay: 0.24s; }
.stat-card:nth-child(7) { animation-delay: 0.28s; }
.stat-card:nth-child(8) { animation-delay: 0.32s; }
.stat-card:nth-child(9) { animation-delay: 0.36s; }

.stat-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.stat-card .stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.45rem;
}

.stat-card .stat-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
}

.stat-card .stat-value small {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.stat-card .stat-value .stat-sub {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.stat-card-profit-neg .stat-value { color: var(--danger); }

.stat-card-paid-saskaita .stat-label,
.stat-card-paid-grynekas .stat-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.stat-card-paid-saskaita .pay-icon,
.stat-card-paid-grynekas .pay-icon {
  width: 1rem;
  height: 1rem;
}

.dashboard-summary {
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.35rem;
  border: 1px solid var(--border);
  animation: fadeInUp 0.35s ease-out 0.15s backwards;
}

.dashboard-summary p {
  margin: 0.45rem 0;
  font-size: 0.94rem;
  color: var(--text);
}

.dashboard-summary p:first-child {
  margin-top: 0;
}

.dashboard-summary strong {
  color: #ffb07a;
}

.pvm-stats {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.pvm-stats-title {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.pvm-stats-note {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.pvm-stats-grid {
  margin-bottom: 1rem;
}

.stat-card .stat-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.pvm-summary {
  background: var(--amber-soft);
  border-color: rgba(232, 93, 4, 0.35);
}

/* Overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.overlay-box {
  background: var(--surface);
  padding: 1.75rem;
  border-radius: var(--radius);
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border);
  animation: fadeInUp 0.35s ease-out;
}

.overlay-box p {
  margin: 0 0 0.85rem 0;
  color: var(--text);
}

.overlay-box input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface-muted);
  color: var(--text);
}

.overlay-box input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232, 93, 4, 0.2);
}

.overlay-box .btn {
  width: 100%;
  margin-top: 0.25rem;
}

.overlay-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.85rem !important;
}

.overlay-box code {
  font-size: 0.85em;
  background: var(--mist);
  color: var(--text);
  padding: 0.15em 0.4em;
  border-radius: 6px;
}

/* Edit modal (istorija) */
.edit-overlay {
  align-items: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem;
  z-index: 110;
}

.edit-box {
  max-width: 520px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 1.25rem 1.25rem 1.35rem;
  max-height: none;
}

.edit-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.edit-box-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 650;
  color: var(--text);
}

.edit-box .forma .form-group {
  margin-bottom: 0.85rem;
}

.edit-overlay .overlay-box input,
.edit-overlay .overlay-box textarea {
  margin-bottom: 0;
  width: 100%;
}

.edit-overlay .overlay-box .btn {
  width: auto;
  margin-top: 0;
}

.edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  margin-top: 1.1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.edit-actions .btn {
  min-width: 7.5rem;
}

@media (max-width: 560px) {
  .edit-box {
    margin: 0.5rem auto 1.5rem;
    padding: 1rem;
  }

  .edit-actions {
    flex-direction: column-reverse;
  }

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

.toast {
  position: fixed;
  bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 0.75rem));
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  padding: 0.65rem 1.25rem;
  max-width: calc(100vw - 2rem);
  background: var(--ink);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 10px;
  border-left: 3px solid var(--amber);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 9999;
}

.toast.toast-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Phones incl. iPhone 15 Pro Max (~430px CSS width) */
@media (max-width: 560px) {
  body {
    padding:
      env(safe-area-inset-top, 0px)
      0
      env(safe-area-inset-bottom, 0px)
      0;
    background-attachment: scroll; /* iOS: fixed can jank */
  }

  .container {
    max-width: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .tabs {
    border-radius: 0;
    padding:
      0.5rem 0.5rem
      0.5rem;
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(0.5rem, env(safe-area-inset-right));
    gap: 0.35rem;
  }

  .tab {
    flex: 0 0 auto;
    font-size: 0.8rem;
    padding: 0.72rem 0.55rem;
    min-width: auto;
    min-height: 2.75rem;
  }

  .tab:has(.tab-badge:not([hidden])) {
    padding-right: 1.2rem;
  }

  .tab-badge {
    top: 0.22rem;
    right: 0.2rem;
    min-width: 1rem;
    height: 1rem;
    font-size: 0.6rem;
  }

  .panel {
    padding:
      1.1rem
      max(1rem, env(safe-area-inset-right))
      max(1.5rem, calc(env(safe-area-inset-bottom) + 0.75rem))
      max(1rem, env(safe-area-inset-left));
    overflow-x: clip;
    max-width: 100%;
  }

  .forma,
  .form-section {
    max-width: 100%;
    min-width: 0;
  }

  .form-row,
  .form-row-3,
  .form-row-4,
  .form-row-6,
  .form-row-uzrasai {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-row .form-group,
  .form-row-3 .form-group {
    margin-bottom: 1.1rem;
  }

  /* km + €/km / hours + €/h can stay side-by-side if space allows */
  #billing-fields-km.form-row,
  #billing-fields-hourly.form-row {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .saskaita-eilute {
    flex-direction: column;
    align-items: stretch;
  }

  .saskaita-eilute input.saskaita-sum {
    width: 100%;
  }

  .filtrai,
  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.7rem;
  }

  .filtrai input[type="search"],
  .filtrai #filtruoti,
  .filtras-datos {
    grid-column: 1 / -1;
    width: 100%;
  }

  .filtras-datos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .filtras-datos-field input[type="date"] {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
  }

  .filtrai input[type="date"],
  .filtrai select {
    width: 100%;
    min-width: 0;
  }

  .dashboard-filtrai {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .dashboard-filtrai label {
    justify-self: start;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .stat-card {
    padding: 0.85rem 0.9rem;
  }

  .pay-kind-option {
    min-width: 0;
    padding: 0.85rem 0.6rem;
    min-height: 3rem;
  }

  .btn-primary,
  .btn-secondary {
    min-height: 3rem;
    font-size: 1.02rem;
  }

  .istorijos-item {
    padding: 0.95rem 1rem;
  }

  .btn-copy-words {
    margin-left: 0;
    margin-top: 0.35rem;
    display: inline-block;
  }
}

/* Narrow phones: stack km/€ rows fully */
@media (max-width: 380px) {
  .form-row,
  .form-row-3,
  .form-row-4,
  .form-row-6 {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .tab {
    font-size: 0.72rem;
  }
}

/* Tablets / small laptops */
@media (min-width: 561px) and (max-width: 899px) {
  body {
    padding:
      max(1rem, env(safe-area-inset-top))
      max(1rem, env(safe-area-inset-right))
      max(1.5rem, env(safe-area-inset-bottom))
      max(1rem, env(safe-area-inset-left));
  }

  .container {
    max-width: 700px;
  }

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

  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* Laptops and desktops */
@media (min-width: 900px) {
  body {
    padding: 2rem 1.5rem 2.5rem;
  }

  .container {
    max-width: 820px;
  }

  .panel {
    padding: 1.5rem 1.65rem 1.85rem;
  }

  .tabs {
    padding: 0.65rem 0.75rem;
    gap: 0.4rem;
  }

  .tab {
    font-size: 0.9rem;
    padding: 0.72rem 0.55rem;
  }

  .filtrai,
  .toolbar {
    gap: 0.55rem;
    padding: 0.75rem 0.85rem;
  }

  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.85rem;
  }

  .form-islaidos-blokas {
    padding: 1.15rem 1.25rem;
  }
}

/* Very wide screens — keep content readable, not stretched */
@media (min-width: 1280px) {
  .container {
    max-width: 880px;
  }
}
