
:root {
  --light-hue-shift: 0;
  --dark-hue-shift: 0;
  --bg: hsl(calc(200 + var(--light-hue-shift)) 29% 94%);
  --bg-strong: hsl(calc(202 + var(--light-hue-shift)) 29% 90%);
  --panel: hsla(calc(0 + var(--light-hue-shift)) 0% 100% / 0.86);
  --panel-solid: hsl(calc(0 + var(--light-hue-shift)) 0% 100%);
  --panel-alt: hsl(calc(196 + var(--light-hue-shift)) 38% 97%);
  --surface-soft: hsla(calc(0 + var(--light-hue-shift)) 0% 100% / 0.74);
  --surface-muted: hsla(calc(196 + var(--light-hue-shift)) 38% 97% / 0.9);
  --surface-accent: hsla(calc(172 + var(--light-hue-shift)) 77% 26% / 0.03);
  --field-bg: hsla(calc(198 + var(--light-hue-shift)) 41% 98% / 0.95);
  --field-bg-focus: hsl(calc(0 + var(--light-hue-shift)) 0% 100%);
  --field-text: hsl(calc(202 + var(--light-hue-shift)) 48% 18%);
  --button-secondary-bg: hsla(calc(0 + var(--light-hue-shift)) 0% 100% / 0.82);
  --sidebar: hsl(calc(196 + var(--light-hue-shift)) 38% 97%);
  --sidebar-2: hsl(calc(201 + var(--light-hue-shift)) 30% 91%);
  --sidebar-text: hsl(calc(202 + var(--light-hue-shift)) 48% 18%);
  --sidebar-text-muted: hsl(calc(204 + var(--light-hue-shift)) 18% 45%);
  --sidebar-overlay: rgba(20, 39, 56, 0.06);
  --sidebar-overlay-strong: rgba(20, 39, 56, 0.12);
  --sidebar-active-bg: linear-gradient(135deg, rgba(23, 110, 99, 0.12), rgba(111, 196, 185, 0.22));
  --sidebar-active-border: rgba(23, 131, 116, 0.32);
  --line: hsl(calc(202 + var(--light-hue-shift)) 24% 88%);
  --line-strong: hsl(calc(204 + var(--light-hue-shift)) 27% 78%);
  --text: hsl(calc(202 + var(--light-hue-shift)) 48% 18%);
  --muted: hsl(calc(204 + var(--light-hue-shift)) 18% 45%);
  --accent: hsl(calc(172 + var(--light-hue-shift)) 77% 26%);
  --accent-strong: hsl(calc(172 + var(--light-hue-shift)) 78% 20%);
  --accent-soft: hsla(calc(172 + var(--light-hue-shift)) 77% 26% / 0.11);
  --danger: #b33b46;
  --warn: #a05f10;
  --shadow: 0 24px 80px rgba(20, 39, 56, 0.12);
  --shadow-soft: 0 12px 36px rgba(20, 39, 56, 0.08);
  --card-outline: var(--line);
}

html[data-theme="dark"] {
  --bg: hsl(calc(203 + var(--dark-hue-shift)) 24% 8%);
  --bg-strong: hsl(calc(208 + var(--dark-hue-shift)) 33% 10%);
  --panel: hsla(calc(208 + var(--dark-hue-shift)) 28% 10% / 0.96);
  --panel-solid: hsl(calc(208 + var(--dark-hue-shift)) 28% 10%);
  --panel-alt: hsl(calc(209 + var(--dark-hue-shift)) 27% 13%);
  --surface-soft: hsla(calc(207 + var(--dark-hue-shift)) 30% 9% / 0.98);
  --surface-muted: hsla(calc(207 + var(--dark-hue-shift)) 24% 11% / 0.98);
  --surface-accent: hsla(calc(174 + var(--dark-hue-shift)) 47% 54% / 0.08);
  --field-bg: hsl(calc(207 + var(--dark-hue-shift)) 31% 13%);
  --field-bg-focus: hsl(calc(207 + var(--dark-hue-shift)) 30% 17%);
  --field-text: hsl(calc(198 + var(--dark-hue-shift)) 100% 98%);
  --button-secondary-bg: hsla(calc(207 + var(--dark-hue-shift)) 31% 10% / 0.98);
  --sidebar: hsl(calc(203 + var(--dark-hue-shift)) 37% 6%);
  --sidebar-2: hsl(calc(208 + var(--dark-hue-shift)) 37% 10%);
  --sidebar-text: #eef7fb;
  --sidebar-text-muted: rgba(232, 247, 252, 0.76);
  --sidebar-overlay: rgba(255, 255, 255, 0.08);
  --sidebar-overlay-strong: rgba(255, 255, 255, 0.12);
  --sidebar-active-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(111, 196, 185, 0.18));
  --sidebar-active-border: rgba(169, 229, 220, 0.38);
  --line: hsl(calc(206 + var(--dark-hue-shift)) 25% 21%);
  --line-strong: hsl(calc(206 + var(--dark-hue-shift)) 22% 31%);
  --text: hsl(calc(198 + var(--dark-hue-shift)) 100% 98%);
  --muted: hsl(calc(202 + var(--dark-hue-shift)) 26% 79%);
  --accent: hsl(calc(174 + var(--dark-hue-shift)) 47% 54%);
  --accent-strong: hsl(calc(174 + var(--dark-hue-shift)) 61% 69%);
  --accent-soft: hsla(calc(174 + var(--dark-hue-shift)) 47% 54% / 0.16);
  --danger: #ff8e9a;
  --warn: #ffcb7a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 16px 34px rgba(0, 0, 0, 0.34);
  --card-outline: hsl(calc(206 + var(--dark-hue-shift)) 22% 33%);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: hsl(calc(203 + var(--dark-hue-shift)) 24% 8%);
    --bg-strong: hsl(calc(208 + var(--dark-hue-shift)) 33% 10%);
    --panel: hsla(calc(208 + var(--dark-hue-shift)) 28% 10% / 0.96);
    --panel-solid: hsl(calc(208 + var(--dark-hue-shift)) 28% 10%);
    --panel-alt: hsl(calc(209 + var(--dark-hue-shift)) 27% 13%);
    --surface-soft: hsla(calc(207 + var(--dark-hue-shift)) 30% 9% / 0.98);
    --surface-muted: hsla(calc(207 + var(--dark-hue-shift)) 24% 11% / 0.98);
    --surface-accent: hsla(calc(174 + var(--dark-hue-shift)) 47% 54% / 0.08);
    --field-bg: hsl(calc(207 + var(--dark-hue-shift)) 31% 13%);
    --field-bg-focus: hsl(calc(207 + var(--dark-hue-shift)) 30% 17%);
    --field-text: hsl(calc(198 + var(--dark-hue-shift)) 100% 98%);
    --button-secondary-bg: hsla(calc(207 + var(--dark-hue-shift)) 31% 10% / 0.98);
    --sidebar: hsl(calc(203 + var(--dark-hue-shift)) 37% 6%);
    --sidebar-2: hsl(calc(208 + var(--dark-hue-shift)) 37% 10%);
    --sidebar-text: #eef7fb;
    --sidebar-text-muted: rgba(232, 247, 252, 0.76);
    --sidebar-overlay: rgba(255, 255, 255, 0.08);
    --sidebar-overlay-strong: rgba(255, 255, 255, 0.12);
    --sidebar-active-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(111, 196, 185, 0.18));
    --sidebar-active-border: rgba(169, 229, 220, 0.38);
    --line: hsl(calc(206 + var(--dark-hue-shift)) 25% 21%);
    --line-strong: hsl(calc(206 + var(--dark-hue-shift)) 22% 31%);
    --text: hsl(calc(198 + var(--dark-hue-shift)) 100% 98%);
    --muted: hsl(calc(202 + var(--dark-hue-shift)) 26% 79%);
    --accent: hsl(calc(174 + var(--dark-hue-shift)) 47% 54%);
    --accent-strong: hsl(calc(174 + var(--dark-hue-shift)) 61% 69%);
    --accent-soft: hsla(calc(174 + var(--dark-hue-shift)) 47% 54% / 0.16);
    --danger: #ff8e9a;
    --warn: #ffcb7a;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
    --shadow-soft: 0 16px 34px rgba(0, 0, 0, 0.34);
    --card-outline: hsl(calc(206 + var(--dark-hue-shift)) 22% 33%);
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 14%, transparent), transparent 22%),
    radial-gradient(circle at bottom right, color-mix(in srgb, var(--sidebar) 12%, transparent), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-strong) 100%);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--line-strong);
  border-radius: 8px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
}

.sidebar-shell {
  position: sticky;
  top: 0;
  min-height: 100vh;
  padding: 28px 22px;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 22%, transparent), transparent 24%),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color: var(--sidebar-text);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  border-right: 1px solid var(--sidebar-overlay);
}

.brand-block,
.sidebar-note {
  padding: 18px;
  border-radius: 24px;
  background: var(--sidebar-overlay);
  border: 1px solid var(--sidebar-overlay);
  backdrop-filter: blur(14px);
}

.brand-kicker,
.topbar-kicker,
.sidebar-note-label,
.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
}

.brand-kicker,
.sidebar-note-label {
  color: var(--sidebar-text-muted);
}

.brand-block h1,
.topbar-title,
.hero-content h1,
.toolbar-card h1,
.panel h2,
.warning-card h2,
.home-section-head h2,
.launch-card h3,
.owner-card h3,
.mini-stat-value {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  letter-spacing: -0.03em;
}

.brand-block h1 {
  font-size: 1.9rem;
  margin-bottom: 10px;
}

.sidebar-logo {
  display: block;
  max-width: 96px;
  max-height: 96px;
  margin: 10px 0 14px;
  object-fit: contain;
}

.brand-copy,
.sidebar-note p,
.lead,
.form-hint,
.muted,
.quick-list li,
.launch-card p,
.hero-content p,
.section-caption,
.mini-stat p {
  color: var(--muted);
}

.brand-copy,
.sidebar-note p {
  margin: 0;
  color: var(--sidebar-text-muted);
  line-height: 1.55;
}

.sidebar-note p {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  align-content: start;
}

.sidebar-link {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 20px;
  text-decoration: none;
  color: var(--sidebar-text);
  background: transparent;
  border: 1px solid transparent;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.sidebar-link:hover {
  transform: translateX(3px);
  background: var(--sidebar-overlay-strong);
  border-color: var(--sidebar-overlay-strong);
}

.sidebar-link.active {
  background: var(--sidebar-active-bg);
  border-color: var(--sidebar-active-border);
  box-shadow: inset 0 1px 0 var(--sidebar-overlay-strong);
}

.sidebar-link-heading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sidebar-link-icon {
  display: inline-flex;
  width: 1.25rem;
  justify-content: center;
}

.sidebar-link-title {
  font-weight: 700;
  font-size: 0.98rem;
}

.sidebar-link-meta {
  font-size: 0.83rem;
  color: var(--sidebar-text-muted);
}

.content-shell {
  min-width: 0;
  padding: 28px;
}

.topbar-shell {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  padding: 22px 24px;
  border-radius: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  animation: fade-up 260ms ease;
  position: sticky;
  top: 16px;
  z-index: 30;
}

.topbar-kicker,
.eyebrow {
  color: var(--accent);
}

.topbar-title {
  font-size: 2rem;
}

.notice-flag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--danger) 45%, transparent);
  animation: noticeBlink 1s ease-in-out infinite;
}

.notice-flag[hidden] {
  display: none;
}

.notice-flag:hover,
.notice-flag:focus {
  filter: brightness(1.08);
}

.notice-flag-mark {
  font-size: 1.1em;
  line-height: 1;
}

.notice-flag-db-hint {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  margin-left: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

@keyframes noticeBlink {
  50% {
    opacity: 0.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice-flag {
    animation: none;
  }
}

.topbar-actions,
.toolbar-actions,
.hero-actions,
.inline-form,
.form-actions,
.card-actions,
.status-stack {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.topbar-chip,
.primary-button,
.secondary-button,
.danger-button,
button,
input,
select,
textarea {
  font: inherit;
}

.topbar-chip,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.topbar-chip {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 22%, transparent);
}

.secondary-button {
  background: var(--button-secondary-bg);
  border-color: var(--line);
  color: var(--text);
}

.theme-select {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--button-secondary-bg);
  color: var(--text);
  cursor: pointer;
}

.inline-button {
  width: fit-content;
}

.field-with-action {
  display: flex;
  gap: 8px;
  align-items: center;
}

.field-with-action input {
  flex: 1 1 auto;
  min-width: 0;
}

.field-with-action .inline-button {
  flex: 0 0 auto;
}

input[readonly],
textarea[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}

.danger-button {
  background: rgba(179, 59, 70, 0.08);
  border-color: rgba(179, 59, 70, 0.16);
  color: var(--danger);
}

.topbar-chip:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: var(--muted);
  box-shadow: none;
}

.primary-button:disabled:hover,
.secondary-button:disabled:hover,
.danger-button:disabled:hover {
  transform: none;
}

.page-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding-bottom: 24px;
}

.hero-card,
.toolbar-card,
.panel,
.warning-card,
.owner-card,
.history-item,
.transfer-panel,
.mini-stat {
  background: var(--panel);
  border: 1px solid var(--card-outline);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.settings-group {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-alt);
}

.toolbar-card,
.panel,
.warning-card,
.owner-card,
.history-item,
.transfer-panel,
.mini-stat {
  animation: fade-up 260ms ease;
}

.hero-card {
  padding: 34px;
}

.home-stack,
.section-stack,
.owners-layout {
  display: grid;
  gap: 24px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 24px;
}

.page-intro-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.hero-card.dashboard-hero {
  overflow: hidden;
  position: relative;
  min-height: 360px;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.18), transparent 22%),
    linear-gradient(180deg, var(--panel-solid) 0%, var(--panel-alt) 100%);
}

.hero-card.dashboard-hero::after {
  content: "";
  position: absolute;
  inset: auto -90px -90px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(17, 36, 51, 0.12), transparent 68%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-content h1 {
  font-size: clamp(2.5rem, 4vw, 4.1rem);
  margin-bottom: 16px;
}

.hero-content p {
  max-width: 60ch;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.metric-grid,
.launchpad-grid,
.insight-grid {
  display: grid;
  gap: 18px;
}

.metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card,
.launch-card,
.insight-card,
.mini-stat {
  padding: 22px;
  border-radius: 24px;
  background: var(--surface-soft);
  border: 1px solid var(--card-outline);
  box-shadow: var(--shadow-soft);
}

.metric-card .eyebrow,
.mini-stat .eyebrow {
  margin-bottom: 12px;
}

.metric-value,
.mini-stat-value {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 10px;
}

.metric-copy,
.section-caption,
.lead {
  margin: 0;
  color: var(--muted);
}

.lead {
  margin-top: 10px;
  max-width: 62ch;
  line-height: 1.65;
}

.metric-breakdown {
  list-style: none;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--card-outline);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-breakdown li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.metric-breakdown strong {
  color: var(--text);
}

.metric-number-block {
  margin-top: 12px;
}

.metric-number-label {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.metric-number-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
  color: var(--text);
  max-height: 220px;
  overflow-y: auto;
}

.metric-toggle {
  margin-top: 16px;
}

.metric-toggle-summary {
  list-style: none;
  cursor: pointer;
}

.metric-toggle-summary::-webkit-details-marker {
  display: none;
}

.metric-toggle[open] .metric-toggle-summary {
  margin-bottom: 12px;
}

.metric-toggle-label::after {
  content: "Rodyti savininkų korteles";
}

.metric-toggle[open] .metric-toggle-label::after {
  content: "Slėpti savininkų korteles";
}

.metric-toggle-label-debtors::after {
  content: "Rodyti skolininkų korteles";
}

.metric-toggle[open] .metric-toggle-label-debtors::after {
  content: "Slėpti skolininkų korteles";
}

.metric-toggle-inline {
  margin-top: 0;
}

.metric-toggle-inline[open] {
  flex-basis: 100%;
}

.metric-toggle-owners {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.divider-line {
  width: 100%;
  border: none;
  border-top: 1px solid var(--card-outline);
  margin: 4px 0;
}

.section-caption {
  margin-bottom: 18px;
  max-width: 72ch;
  line-height: 1.6;
}

.home-section-head-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.home-section-head-top-row .eyebrow {
  margin-bottom: 0;
}

.db-name-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.badge-db-name {
  background: rgba(96, 119, 137, 0.14);
  color: var(--muted);
  font-family: "IBM Plex Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-weight: 500;
  font-size: 0.76rem;
  min-height: 26px;
}

.home-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.home-section-head p,
.launch-card p,
.insight-card p,
.panel > p,
.toolbar-card p,
.mini-stat p {
  margin-bottom: 0;
}

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

.launch-card {
  display: grid;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.launch-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 118, 110, 0.24);
  box-shadow: 0 18px 40px rgba(17, 36, 51, 0.1);
}

.launch-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.launch-card h3 {
  font-size: 1.35rem;
}

.launch-card-meta {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.quick-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  gap: 24px;
  align-items: start;
}

.content-grid.single-column {
  grid-template-columns: 1fr;
}

.toolbar-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  padding: 28px 30px;
}

.toolbar-card h1 {
  font-size: 2.2rem;
  margin-top: 4px;
}

.toolbar-actions-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.owner-garages-note {
  margin: 0;
  color: var(--muted);
}

.owner-garages-note-value {
  margin: 0;
  font-family: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 2.2rem;
  letter-spacing: -0.03em;
  text-align: right;
}

.panel,
.warning-card {
  padding: 28px;
}

.warning-card {
  border-color: rgba(160, 95, 16, 0.2);
  background: linear-gradient(180deg, var(--surface-muted), var(--panel-alt));
}

.filter-form,
.owner-form {
  display: grid;
  gap: 14px;
}

.filter-form {
  grid-template-columns: minmax(0, 2.2fr) repeat(2, minmax(0, 1fr)) auto;
  margin-bottom: 24px;
}

.filter-form.payments-filter-form {
  grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(0, 1fr)) auto;
}

.filter-form.filter-form-simple {
  grid-template-columns: minmax(0, 1fr) auto;
}

.filter-form input,
.filter-form select,
.owner-form input,
.owner-form textarea,
.owner-form select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--field-text);
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
  color-scheme: light dark;
}

.filter-form input:focus,
.filter-form select:focus,
.owner-form input:focus,
.owner-form textarea:focus,
.owner-form select:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.34);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
  background: var(--field-bg-focus);
}

.filter-form input::placeholder,
.owner-form input::placeholder,
.owner-form textarea::placeholder {
  color: var(--muted);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1em;
  line-height: 1;
  padding: 6px;
  border-radius: 8px;
}

.password-toggle:hover {
  color: var(--field-text);
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.34);
  outline-offset: 2px;
}

.filter-form option,
.owner-form option {
  background: var(--field-bg-focus);
  color: var(--field-text);
}

.owner-form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

.settings-group.field-grid {
  grid-template-columns: max-content max-content minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
}

.settings-group.field-grid > label {
  display: contents;
}

.settings-group.field-grid > label > .field-label {
  grid-column: 1;
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
}

.settings-group.field-grid > label > .field-sep {
  grid-column: 2;
  color: var(--muted);
  font-weight: 400;
}

.settings-group.field-grid > label > input,
.settings-group.field-grid > label > .field-with-action {
  grid-column: 3;
  text-align: left;
}

.settings-group.field-grid > h3,
.settings-group.field-grid > p {
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .settings-group.field-grid {
    grid-template-columns: 1fr;
  }

  .settings-group.field-grid > label {
    display: grid;
    gap: 6px;
  }

  .settings-group.field-grid > label > .field-label {
    text-align: left;
  }

  .settings-group.field-grid > label > .field-sep {
    display: none;
  }
}

.field-error input,
.field-error textarea,
.field-error select {
  border-color: rgba(179, 59, 70, 0.62);
  box-shadow: 0 0 0 4px rgba(179, 59, 70, 0.1);
}

.form-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 4px;
}

.form-section-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.question-form-list {
  display: grid;
  gap: 14px;
}

.question-form-row {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.question-form-row legend {
  padding: 0 6px;
  color: var(--accent-strong);
  font-weight: 700;
}

.checkbox-field,
.checkbox-row,
.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-field input,
.checkbox-row input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-inline {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--field-text);
  font-weight: 600;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 18px;
}

.checkbox-grid .checkbox-field {
  display: flex;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--surface-muted);
}

.checkbox-grid .checkbox-field input {
  flex: none;
}

.checkbox-field-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.checkbox-field-title {
  font-weight: 600;
}

.checkbox-field-sub {
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.listing-card {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.listing-card input:disabled {
  opacity: 0.5;
}

.filter-form .full-row {
  grid-column: 1 / -1;
}

.owner-type-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--field-bg);
}

.owner-type-option {
  flex: 1;
  display: flex;
  cursor: pointer;
}

.owner-type-option input[type="radio"] {
  display: none;
}

.owner-type-option span {
  flex: 1;
  padding: 11px 16px;
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 140ms ease, color 140ms ease;
  border-radius: 15px;
}

.owner-type-option input[type="radio"]:checked + span {
  background: var(--accent);
  color: var(--panel-solid);
}

.owners-list,
.history-list {
  display: grid;
  gap: 16px;
}

.owners-list {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 4px;
}

.history-list-scroll {
  max-height: 630px;
  overflow-y: auto;
  padding-right: 4px;
}

.owner-card,
.history-item {
  padding: 18px 20px;
  background: var(--surface-soft);
}

.collapsible-card {
  padding: 0;
  overflow: hidden;
}

.collapsible-summary {
  padding: 20px;
  cursor: pointer;
  list-style: none;
}

.collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible-card[open] .collapsible-summary {
  border-bottom: 1px solid var(--line);
  background: var(--surface-accent);
}

.collapsible-body {
  padding: 0 20px 20px;
}

.entry-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.entry-money-zone {
  flex: 0 0 240px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.entry-meta-zone {
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.entry-meta-left,
.entry-meta-right {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.entry-field {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry-payer {
  font-weight: 700;
  min-width: 0;
}

.entry-amount,
.entry-garage-number,
.entry-date {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  flex-shrink: 0;
}

.entry-rejection-note {
  max-width: 320px;
  white-space: normal;
  text-align: left;
}

.entry-divider {
  color: var(--muted);
  flex-shrink: 0;
}

.entry-duplicate-label {
  color: var(--muted);
  flex-shrink: 0;
}

.entry-toggle {
  pointer-events: none;
}

.entry-toggle::after {
  content: "Atidaryti";
}

.entry-card[open] .entry-toggle::after {
  content: "Uždaryti";
}

.owner-card-top,
.form-actions,
.card-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.summary-action-form {
  margin: 0;
}

.summary-action-button {
  min-height: 34px;
  padding: 0 12px;
}

.wrap-actions {
  flex-wrap: wrap;
  align-items: flex-start;
}

.owner-context-actions {
  margin-top: 16px;
}

.owner-card-top h3 {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.owner-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
}

.compact-filter-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.period-shortcuts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.active-filter {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.payment-group {
  display: grid;
  gap: 12px;
  padding-top: 6px;
}

.payment-group h3 {
  margin: 0;
  color: var(--accent-strong);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.11);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
}

.badge-ownership { background: rgba(160, 95, 16, 0.1); color: var(--warn); }
.badge-status-draft { background: rgba(96, 119, 137, 0.14); color: var(--muted); }
.badge-status-issued, .badge-status-demanded, .badge-status-fully_paid, .badge-status-fully_allocated, .badge-status-settled, .badge-status-overpaid, .badge-status-allocated_with_remainder { background: rgba(15, 118, 110, 0.11); color: var(--accent-strong); }
.badge-status-partially_paid, .badge-status-partially_allocated, .badge-status-awaiting_allocation, .badge-status-insufficient_for_claim, .badge-status-pending_confirmation { background: rgba(160, 95, 16, 0.1); color: var(--warn); }
.badge-status-closed_with_debt, .badge-status-unallocated, .badge-status-debtor, .badge-status-rejected { background: rgba(179, 59, 70, 0.11); color: var(--danger); }

html[data-theme="dark"] .badge-status-fully_allocated { color: var(--text); }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .badge-status-fully_allocated { color: var(--text); }
}

html[data-theme="dark"] .badge-status-fully_paid { color: #6ee7b7; }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .badge-status-fully_paid { color: #6ee7b7; }
}

.vote-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.vote-track {
  position: relative;
  flex: 0 0 auto;
  width: 28px;
  height: 12px;
}
.vote-track::before {
  content: "";
  position: absolute;
  left: 14px;
  top: -2px;
  bottom: -2px;
  width: 1.5px;
  background: var(--line-strong);
}
.vote-mark {
  position: absolute;
  top: 1px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1.5px solid var(--text);
}
.vote-mark-no { left: 0; background: var(--text); }
.vote-mark-abstain { left: 9px; background: var(--muted); border-color: var(--muted); }
.vote-mark-yes { left: 18px; background: transparent; }
.vote-label { flex: 0 0 auto; width: 4.6em; text-align: left; }

html[data-theme="dark"] .vote-mark-no { background: var(--danger); border-color: var(--danger); }
html[data-theme="dark"] .vote-mark-yes { background: #6ee7b7; border-color: #6ee7b7; }
html[data-theme="dark"] .vote-mark-abstain { background: var(--warn); border-color: var(--warn); }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .vote-mark-no { background: var(--danger); border-color: var(--danger); }
  html[data-theme="system"] .vote-mark-yes { background: #6ee7b7; border-color: #6ee7b7; }
  html[data-theme="system"] .vote-mark-abstain { background: var(--warn); border-color: var(--warn); }
}

.balance-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
}
.balance-dot-debtor   { background-color: #ff1a1a; }
.balance-dot-settled  { background-color: #00d632; }
.balance-dot-overpaid { background-color: #1a6fff; }

.owner-balance.negative {
  color: var(--danger);
}

.owner-status-split {
  display: flex;
  align-items: stretch;
  gap: 18px;
  margin-bottom: 10px;
}

.owner-status-half {
  flex: 1;
  min-width: 0;
}

.owner-status-half:first-child {
  padding-right: 18px;
  border-right: 1px solid var(--card-outline);
}

.owner-status-half .mini-stat-value {
  margin-bottom: 4px;
}

.text-output {
  width: 100%;
  min-height: 180px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--field-text);
  font-family: "IBM Plex Mono", "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre;
  overflow: auto;
  resize: vertical;
}

.responsive-table {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--accent-strong);
  font-size: 0.86rem;
}

td .muted,
td span.muted {
  display: block;
  margin-top: 4px;
}

.highlight-row {
  background: var(--accent-soft);
}

.subpanel {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.history-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.panel-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.relationship-block {
  margin: 18px 0;
}

.compact-history { gap: 10px; }
.compact-empty { padding: 18px; }
.compact-form { margin-bottom: 18px; }
.compact-warning { margin-top: 16px; }
.inline-errors { margin-top: 12px; }

.vote-row-form {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
}

.vote-row-form select {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--field-text);
}

.questions-vote-table .question-text-cell {
  width: 55%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.questions-vote-table .vote-form-cell {
  width: 240px;
  min-width: 240px;
}

.questions-vote-table .vote-confirm-cell {
  width: 110px;
  min-width: 110px;
}

.matrix-vote-counts {
  display: block;
  margin-top: 4px;
  max-width: 170px;
  white-space: normal;
  word-break: break-word;
  font-weight: 400;
}

.matrix-result {
  display: block;
  margin-top: 2px;
  max-width: 170px;
  white-space: normal;
  word-break: break-word;
  font-weight: 700;
}

html[data-theme="dark"] .matrix-result-accepted { color: #6ee7b7; }
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] .matrix-result-accepted { color: #6ee7b7; }
}

.transfer-panel {
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--surface-muted);
}

.transfer-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.transfer-panel[open] summary {
  margin-bottom: 14px;
}

.inline-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin: 6px 0;
}

.inline-divider::before,
.inline-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

dl {
  margin: 16px 0;
  display: grid;
  gap: 10px;
}

dl div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(186, 201, 213, 0.6);
}

dt {
  font-weight: 700;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-muted);
}

.form-errors {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(179, 59, 70, 0.18);
  background: rgba(179, 59, 70, 0.08);
  color: var(--danger);
}

.form-errors p:last-child,
.warning-card p:last-child,
.history-item p:last-child,
.owner-card p:last-child,
.mini-stat p:last-child {
  margin-bottom: 0;
}

.status-stack {
  justify-content: flex-end;
}

.muted {
  color: var(--muted);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .sidebar-shell {
    position: static;
    min-height: auto;
  }

  .content-shell {
    padding-top: 20px;
  }
}

@media (max-width: 980px) {
  .dashboard-grid,
  .content-grid,
  .content-grid.single-column,
  .launchpad-grid,
  .metric-grid,
  .insight-grid,
  .page-intro-grid {
    grid-template-columns: 1fr;
  }

  .filter-form,
  .filter-form.payments-filter-form,
  .filter-form.filter-form-simple {
    grid-template-columns: 1fr;
  }

  .toolbar-card,
  .owner-card-top,
  .card-actions,
  .form-actions,
  .topbar-shell,
  .home-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  dl div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .content-shell,
  .sidebar-shell {
    padding: 18px;
  }

  .page-shell {
    padding-bottom: 12px;
  }

  .hero-card,
  .panel,
  .toolbar-card,
  .warning-card,
  .mini-stat {
    padding: 22px;
  }

  .hero-content h1,
  .toolbar-card h1,
  .topbar-title {
    font-size: 1.8rem;
  }
}

@media print {
  body {
    background: white;
  }

  .sidebar-shell,
  .topbar-shell,
  .no-print {
    display: none !important;
  }

  .app-shell,
  .content-shell,
  .page-shell {
    display: block;
    padding: 0;
    margin: 0;
    width: 100%;
  }

  .panel,
  .owner-card,
  .mini-stat {
    box-shadow: none;
    border-color: #bbb;
    break-inside: avoid;
  }
}
