:root {
  --blue: #16324A;
  --teal: #167D78;
  --amber: #E9A23B;
  --bg: #F5F7F9;
  --white: #FFFFFF;
  --text: #202B33;
  --muted: #66737D;
  --success: #2E7D5B;
  --warning: #D9822B;
  --danger: #C94C4C;
  --line: #DDE5EA;
  --soft: #EAF1F4;
  --shadow: 0 12px 30px rgba(22, 50, 74, .08);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
}

button, .button, .icon-button {
  border: 0;
  cursor: pointer;
}

.auth-shell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(18px, 2.8vw, 34px);
  background: #F4F7F8;
  isolation: isolate;
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(12,31,48,.99) 0%, rgba(22,50,74,.97) 48%, rgba(22,125,120,.94) 70%, rgba(244,247,248,.98) 70%, rgba(255,255,255,.98) 100%);
}

.auth-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .24;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,.10) 1px, transparent 1px);
  background-size: 88px 88px;
}

.auth-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  align-items: center;
  gap: clamp(32px, 5vw, 68px);
  width: min(1120px, 100%);
  min-height: min(660px, calc(100svh - 56px));
}

.login-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  min-width: 0;
  color: var(--white);
}

.login-hero-brand {
  display: grid;
  place-items: center;
  width: 118px;
  height: 86px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 42px rgba(0,0,0,.2);
}

.login-intro-logo {
  display: block;
  width: 132px;
  max-width: none;
  height: 104px;
  object-fit: cover;
  object-position: center;
}

.login-slider {
  display: grid;
  width: 100%;
  max-width: 650px;
  min-height: 318px;
}

.login-slide {
  grid-area: 1 / 1;
  display: none;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  pointer-events: none;
}

.login-slide.active {
  display: flex;
  pointer-events: auto;
}

.login-slide h1,
.login-slide h2 {
  max-width: 650px;
  margin: 8px 0 0;
  color: var(--white);
  font-weight: 800;
  line-height: 1.04;
}

.login-slide h1 {
  font-size: 64px;
}

.login-slide h2 {
  font-size: 42px;
}

.login-slide p:not(.eyebrow) {
  max-width: 610px;
  margin: 16px 0 0;
  color: rgba(255,255,255,.86);
  font-size: 17px;
  line-height: 1.55;
}

.login-intro .eyebrow {
  color: rgba(255,255,255,.68);
}

.login-feature-grid,
.login-finance-preview {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
  max-width: 640px;
}

.login-feature-grid div,
.login-finance-preview div,
.login-timeline div {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(8px);
}

.login-feature-grid div {
  min-height: 122px;
  padding: 14px;
}

.login-feature-grid svg {
  width: 22px;
  height: 22px;
  color: var(--amber);
}

.login-feature-grid strong,
.login-feature-grid span,
.login-finance-preview span,
.login-finance-preview strong {
  display: block;
}

.login-feature-grid strong {
  margin-top: 16px;
  color: var(--white);
  font-size: 15px;
}

.login-feature-grid span {
  margin-top: 6px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1.35;
}

.login-timeline {
  display: grid;
  width: 100%;
  gap: 10px;
  margin-top: 24px;
  max-width: 540px;
}

.login-timeline div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
  color: rgba(255,255,255,.9);
  font-weight: 700;
}

.login-timeline svg {
  width: 20px;
  height: 20px;
  color: var(--amber);
}

.login-finance-preview div {
  min-height: 96px;
  padding: 14px;
}

.login-finance-preview span {
  color: rgba(255,255,255,.7);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-finance-preview strong {
  margin-top: 14px;
  color: var(--white);
  font-size: 24px;
  line-height: 1;
}

.landing-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 650px;
}

.landing-summary button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
  font-weight: 700;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.landing-summary button:hover,
.landing-summary button.active {
  border-color: rgba(233,162,59,.75);
  background: rgba(255,255,255,.16);
  color: var(--white);
}

.landing-summary svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--amber);
}

.login-panel {
  justify-self: end;
  width: min(400px, 100%);
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(221,229,234,.88);
  border-radius: 8px;
  padding: clamp(24px, 3vw, 34px);
  box-shadow: 0 28px 72px rgba(12,31,48,.26);
  backdrop-filter: blur(14px);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.login-logo {
  display: block;
  width: min(260px, 100%);
  height: 96px;
  object-fit: cover;
  object-position: center;
}

.login-panel-heading {
  margin-bottom: 22px;
}

.login-panel-heading h2 {
  margin: 0;
  color: var(--blue);
  font-size: 24px;
  line-height: 1.15;
}

.login-panel-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-field + .login-field {
  margin-top: 14px;
}

.login-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 20px;
  box-shadow: 0 12px 24px rgba(22,125,120,.22);
}

.login-help {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--teal);
  color: var(--white);
  font-weight: 800;
}

.login-brand strong,
.brand strong {
  display: block;
  font-size: 24px;
  color: var(--blue);
}

.login-brand small,
.brand small {
  color: var(--muted);
  font-size: 12px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: var(--blue);
  color: var(--white);
  padding: 18px 14px;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 4px 0 14px;
  border-bottom: 1px solid rgba(255,255,255,.14);
  margin-bottom: 14px;
}

.brand-logo {
  display: block;
  width: 232px;
  max-width: 100%;
  height: 88px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  background: var(--white);
  padding: 0;
}

.brand strong { color: var(--white); }
.brand small { color: rgba(255,255,255,.72); }

.nav {
  display: grid;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.82);
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255,255,255,.11);
  color: var(--white);
}

.nav-link svg,
.icon-button svg,
.button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.main {
  min-height: 100vh;
  margin-left: 260px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 16px 28px;
  background: rgba(245,247,249,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 26px;
  line-height: 1.15;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding: 24px 28px 40px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.panel,
.stat,
.table-wrap,
.form-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel,
.form-panel {
  padding: 18px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2,
.section-title h3 {
  margin: 0;
  font-size: 18px;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stat {
  padding: 16px;
  min-height: 112px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
  line-height: 1.15;
}

.stat small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.dashboard-top-cards {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-top-cards .stat {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: auto;
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 10px;
  overflow: hidden;
  background: var(--white);
  border-color: var(--line);
  border-left: 5px solid var(--blue);
  box-shadow: 0 6px 14px rgba(22, 50, 74, .05);
}

.dashboard-top-cards .stat span {
  font-size: 11px;
  font-size: clamp(10px, 8cqw, 13px);
  font-weight: 800;
  line-height: 1.12;
  text-transform: uppercase;
}

.dashboard-top-cards .stat strong {
  margin-top: 0;
  font-size: 20px;
  font-size: clamp(16px, 16cqw, 28px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.dashboard-top-cards .stat small {
  margin-top: 0;
  font-size: 10px;
  font-size: clamp(9px, 7cqw, 12px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.dashboard-top-cards .stat:nth-child(1) {
  border-left-color: var(--blue);
}

.dashboard-top-cards .stat:nth-child(2) {
  border-left-color: var(--teal);
}

.dashboard-top-cards .stat:nth-child(3) {
  border-left-color: var(--amber);
}

.dashboard-top-cards .stat:nth-child(4) {
  border-left-color: var(--danger);
}

.dashboard-top-cards .stat:nth-child(5) {
  border-left-color: var(--success);
}

.dashboard-top-cards .stat:nth-child(6) {
  border-left-color: #8A6BBE;
}

.dashboard-top-cards .stat:nth-child(7) {
  border-left-color: var(--teal);
}

.seal-stat-grid .stat {
  border-left: 4px solid var(--blue);
}

.seal-stat-grid .stat:nth-child(2),
.seal-stat-stock {
  border-left-color: var(--success);
  background: linear-gradient(145deg, rgba(46, 125, 91, .10), var(--white));
}

.seal-stat-grid .stat:nth-child(4),
.seal-stat-use {
  border-left-color: var(--danger);
  background: linear-gradient(145deg, rgba(201, 76, 76, .10), var(--white));
}

.seal-edit-panel {
  border-color: rgba(22, 125, 120, .28);
  background: linear-gradient(145deg, rgba(22, 125, 120, .07), var(--white) 48%);
}

.selo-flow-grid {
  align-items: start;
}

.selo-flow-panel {
  min-width: 0;
  overflow: hidden;
}

.selo-flow-panel .section-title {
  margin: -18px -18px 14px;
  padding: 14px 18px;
}

.selo-flow-buy {
  border-color: rgba(46, 125, 91, .28);
}

.selo-flow-buy .section-title {
  background: linear-gradient(135deg, rgba(46, 125, 91, .14), rgba(255, 255, 255, .86));
  border-bottom: 1px solid rgba(46, 125, 91, .18);
}

.selo-flow-buy h2 {
  color: #1F6B4B;
}

.selo-flow-use {
  border-color: rgba(201, 76, 76, .26);
}

.selo-flow-use .section-title {
  background: linear-gradient(135deg, rgba(201, 76, 76, .13), rgba(255, 255, 255, .88));
  border-bottom: 1px solid rgba(201, 76, 76, .18);
}

.selo-flow-use h2 {
  color: #9C3535;
}

.selo-flow-buy .table-wrap {
  border-color: rgba(46, 125, 91, .22);
}

.selo-flow-use .table-wrap {
  border-color: rgba(201, 76, 76, .22);
}

.selo-flow-buy thead th {
  background: rgba(46, 125, 91, .075);
}

.selo-flow-use thead th {
  background: rgba(201, 76, 76, .075);
}

.seal-history-filter {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.seal-history-filter label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.seal-history-filter input[type="date"] {
  width: 100%;
  min-width: 0;
}

.seal-history-filter .button {
  justify-content: center;
}

.seal-filter-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.seal-filter-summary > div {
  display: grid;
  align-content: space-between;
  min-width: 0;
  min-height: 82px;
  padding: 9px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--blue);
  border-radius: 6px;
  background: rgba(22, 50, 74, .035);
}

.seal-filter-summary span,
.seal-filter-summary small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.seal-filter-summary strong {
  margin: 4px 0;
  color: var(--blue);
  font-size: 16px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.seal-filter-summary-buy > div {
  border-top-color: var(--success);
}

.seal-filter-summary-use > div {
  border-top-color: var(--danger);
}

.seal-filter-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 9px;
  border-radius: 5px;
  background: rgba(22, 50, 74, .055);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.seal-filter-note svg {
  width: 14px;
  min-width: 14px;
  height: 14px;
  margin-top: 1px;
}

.seal-history-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.seal-history-table table {
  min-width: 1120px;
}

.seal-pagination {
  align-items: flex-start;
  flex-direction: column;
}

.seal-pagination .pagination-pages {
  max-width: 100%;
}

.attention-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.attention-card {
  display: grid;
  gap: 12px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  background: var(--white);
}

.attention-card:nth-child(2) { border-left-color: var(--danger); }
.attention-card:nth-child(3) { border-left-color: var(--teal); }
.attention-card:nth-child(4) { border-left-color: var(--blue); }
.attention-card:nth-child(5) { border-left-color: var(--success); }
.attention-card:nth-child(6) { border-left-color: #8A6BBE; }

.attention-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.attention-card strong {
  font-size: 26px;
  line-height: 1;
}

.attention-card small {
  color: var(--muted);
  line-height: 1.35;
}

.attention-card[href] {
  color: var(--text);
  text-decoration: none;
}

.attention-card[href]:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.seal-alert-danger {
  border-left-color: var(--danger) !important;
  background: rgba(201, 76, 76, .065);
}

.seal-alert-warning {
  border-left-color: var(--warning) !important;
  background: rgba(217, 130, 43, .075);
}

.badge,
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.is-active {
  background: rgba(46, 125, 91, 0.12);
  color: #1F6B4B;
}

.badge.is-inactive {
  background: rgba(176, 64, 64, 0.12);
  color: var(--danger);
}

.badge.is-open {
  background: rgba(217, 130, 43, .16);
  color: #A45A12;
}

.account-type-badge.is-recurring {
  background: rgba(22, 125, 120, .13);
  color: #106B67;
}

.account-type-badge.is-one-off {
  background: rgba(233, 162, 59, .16);
  color: #9A6411;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--teal);
  color: var(--white);
  font-weight: 700;
  line-height: 1;
}

.button.secondary {
  background: var(--blue);
}

.button.light {
  background: var(--soft);
  color: var(--text);
}

.button.fill {
  width: 100%;
}

.button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.button.warning {
  background: var(--warning);
}

.button.danger,
.icon-button.danger {
  background: var(--danger);
  color: var(--white);
}

.button.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--blue);
}

.icon-button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

form {
  margin: 0;
}

label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--white);
  color: var(--text);
}

textarea {
  min-height: 102px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(22, 125, 120, .18);
  border-color: var(--teal);
}

.password-field {
  position: relative;
}

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

.password-toggle {
  position: absolute;
  right: 5px;
  top: 50%;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--blue);
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.inline-section {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.field-2 { grid-column: span 2; }
.field-1 { grid-column: span 1; }
.field-3 { grid-column: span 3; }
.field-4 { grid-column: span 4; }
.field-5 { grid-column: span 5; }
.field-6 { grid-column: span 6; }
.field-7 { grid-column: span 7; }
.field-8 { grid-column: span 8; }
.field-12 { grid-column: span 12; }

.process-service-list {
  display: grid;
  gap: 10px;
}

.process-service-row {
  display: grid;
  grid-template-columns: 42px minmax(220px, 1fr) minmax(150px, 220px) 42px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.process-service-row .icon-button {
  align-self: end;
}

.process-service-actions {
  margin-top: 10px;
}

.process-service-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(22, 50, 74, .09);
  color: var(--blue);
  font-weight: 900;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 180px 160px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.process-list-filters {
  grid-template-columns: minmax(220px, 1fr) 180px 150px 120px auto;
}

.table-wrap {
  overflow-x: auto;
}

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

th, td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

tr:last-child td { border-bottom: 0; }

.payable-row td {
  transition: background-color .16s ease;
}

.payable-row.is-recurring td {
  background: rgba(22, 125, 120, .055);
}

.payable-row.is-one-off td {
  background: rgba(233, 162, 59, .065);
}

.payable-row.is-recurring:hover td {
  background: rgba(22, 125, 120, .095);
}

.payable-row.is-one-off:hover td {
  background: rgba(233, 162, 59, .11);
}

.payable-row.is-recurring td:first-child {
  box-shadow: inset 3px 0 0 rgba(22, 125, 120, .55);
}

.payable-row.is-one-off td:first-child {
  box-shadow: inset 3px 0 0 rgba(233, 162, 59, .65);
}

.table-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.inline-choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
}

.inline-choice input {
  width: auto;
  min-height: auto;
}

.company-link-list,
.permission-group {
  display: grid;
  gap: 10px;
}

.company-link-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, 260px) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.company-default-choice {
  white-space: nowrap;
}

.permission-group {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.permission-group h3 {
  margin: 0;
  font-size: 15px;
  color: var(--blue);
}

.permission-group-featured {
  padding: 14px;
  border: 1px solid rgba(22, 50, 74, .14);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: rgba(22, 50, 74, .035);
}

.advanced-access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.advanced-access-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.advanced-access-card > div:first-child {
  display: grid;
  gap: 4px;
}

.advanced-access-card small {
  color: var(--muted);
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.permission-grid-compact {
  grid-template-columns: 1fr;
}

.permission-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
}

.permission-check input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.permission-check span {
  display: grid;
  gap: 4px;
}

.permission-check small {
  color: var(--muted);
}

.danger-zone {
  border-color: rgba(201, 76, 76, .35);
  border-left: 4px solid var(--danger);
}

.muted { color: var(--muted); }
.success { color: var(--success); }
.warning-text { color: var(--warning); }
.danger-text { color: var(--danger); }
.right { text-align: right; }

.alert {
  margin: 16px 28px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--white);
}

.alert.success { border-left-color: var(--success); }
.alert.warning { border-left-color: var(--warning); }
.alert.danger { border-left-color: var(--danger); }
.floating-alert { position: fixed; top: 18px; right: 18px; z-index: 30; margin: 0; }

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  padding: 14px;
  background: var(--soft);
  border-radius: 8px;
}

.summary-band span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-band strong {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

.summary-band.compact-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 10px 0 12px;
  padding: 10px;
}

.process-values-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) repeat(4, minmax(140px, 1fr));
  gap: 8px;
  align-items: stretch;
  margin: 14px 0 18px;
}

.process-value-card {
  min-width: 0;
  min-height: 96px;
  padding: 12px;
  border: 1px solid rgba(22, 50, 74, .1);
  border-left: 5px solid var(--value-color, var(--teal));
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
}

.process-value-card span,
.process-value-card strong,
.process-value-card small {
  display: block;
}

.process-value-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.process-value-card strong {
  margin-top: 7px;
  color: var(--value-color, var(--blue));
  font-size: 21px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.process-value-card small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.process-value-total {
  --value-color: var(--blue);
  background: rgba(22, 50, 74, .075);
}

.process-value-total strong {
  font-size: 25px;
}

.process-value-fees {
  --value-color: var(--success);
  background: rgba(46, 125, 91, .075);
}

.process-value-taxes {
  --value-color: var(--amber);
  background: rgba(233, 162, 59, .1);
}

.process-value-paid {
  --value-color: var(--teal);
  background: rgba(22, 125, 120, .07);
}

.process-value-balance {
  --value-color: var(--danger);
  background: rgba(201, 76, 76, .07);
}

.chart-panel {
  min-height: 320px;
}

.chart-panel canvas {
  width: 100% !important;
  height: 240px !important;
  max-height: 240px;
}

.step-options {
  align-items: stretch;
}

.step-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.step-label span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  font-weight: 800;
  font-size: 13px;
}

.stack-form {
  display: grid;
  gap: 10px;
}

.selected-client {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(22, 125, 120, .24);
  border-radius: 8px;
  background: rgba(22, 125, 120, .08);
}

.selected-client[hidden] {
  display: none;
}

.selected-client + .button {
  margin-top: 8px;
}

.selected-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.selected-actions .button {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 13px;
}

.selected-client small,
.lookup-result small {
  color: var(--muted);
}

.selected-vehicle {
  border-color: rgba(22, 50, 74, .24);
  background: rgba(22, 50, 74, .06);
}

.lookup-result {
  display: grid;
  gap: 8px;
  min-height: 20px;
}

.lookup-item {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.lookup-button {
  width: 100%;
  text-align: left;
  color: var(--text);
}

.lookup-item:hover,
.active-filter {
  outline: 2px solid rgba(22, 125, 120, .18);
  border-color: var(--teal);
}

.live-search-count {
  display: block;
  margin-top: 6px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.disabled-link {
  pointer-events: none;
  opacity: .45;
}

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

.cashier-period-filter {
  grid-template-columns: repeat(4, minmax(145px, 175px)) auto auto auto;
  justify-content: start;
  align-items: end;
}

.cashier-period-filter input[type="date"] {
  width: 160px;
}

.cashier-category-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.cashier-category-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--teal);
  border-radius: 8px;
  background: var(--white);
}

.cashier-category-panel.is-outgoing {
  border-top-color: #D97A7A;
}

.cashier-category-title,
.cashier-category-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
}

.cashier-category-title {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.cashier-category-title h3 {
  margin: 0;
  color: var(--blue);
  font-size: 16px;
}

.cashier-category-title strong {
  color: var(--blue);
  font-size: 20px;
}

.cashier-category-row {
  min-height: 32px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(170, 183, 192, .45);
}

.cashier-category-row:last-child {
  border-bottom: 0;
}

.cashier-category-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.cashier-category-row strong {
  color: var(--blue);
  white-space: nowrap;
}

.cash-flow-dropdown {
  overflow: hidden;
  border: 1px solid rgba(22, 50, 74, .18);
  border-top: 5px solid var(--success);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 8px 22px rgba(22, 50, 74, .08);
}

.cash-flow-dropdown.is-outgoing {
  border-top-color: var(--danger);
}

.cash-flow-dropdown summary {
  list-style: none;
}

.cash-flow-dropdown summary::-webkit-details-marker {
  display: none;
}

.cash-flow-dropdown-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 14px 16px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(46, 125, 91, .12), rgba(46, 125, 91, .035));
  user-select: none;
}

.cash-flow-dropdown.is-outgoing .cash-flow-dropdown-summary {
  background: linear-gradient(135deg, rgba(201, 76, 76, .12), rgba(201, 76, 76, .035));
}

.cash-flow-dropdown-title,
.cash-flow-dropdown-total,
.cash-flow-group summary,
.cash-flow-subgroup summary {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cash-flow-dropdown-title {
  color: var(--blue);
  font-size: 17px;
  font-weight: 900;
}

.cash-flow-dropdown-title svg {
  width: 21px;
  height: 21px;
  color: var(--success);
}

.cash-flow-dropdown.is-outgoing .cash-flow-dropdown-title svg {
  color: var(--danger);
}

.cash-flow-dropdown-total {
  flex: 0 0 auto;
}

.cash-flow-dropdown-total strong {
  color: var(--blue);
  font-size: 20px;
}

.cash-flow-dropdown-total svg,
.cash-flow-group summary svg,
.cash-flow-subgroup summary svg {
  width: 18px;
  height: 18px;
  color: var(--teal);
  transition: transform .2s ease;
}

.cash-flow-dropdown[open] > .cash-flow-dropdown-summary .cash-flow-dropdown-total svg,
.cash-flow-group[open] > summary > span:last-child svg,
.cash-flow-subgroup[open] > summary > span:last-child svg {
  transform: rotate(180deg);
}

.cash-flow-groups {
  display: none;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid rgba(170, 183, 192, .4);
  background: rgba(246, 249, 250, .86);
}

.cash-flow-dropdown[open] > .cash-flow-groups {
  display: grid;
}

.cash-flow-group,
.cash-flow-subgroup {
  overflow: hidden;
  border: 1px solid rgba(170, 183, 192, .55);
  border-radius: 9px;
  background: var(--white);
}

.cash-flow-group > summary,
.cash-flow-subgroup > summary {
  justify-content: space-between;
  gap: 14px;
  min-height: 42px;
  padding: 9px 11px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  user-select: none;
}

.cash-flow-group > summary:hover,
.cash-flow-subgroup > summary:hover {
  background: rgba(22, 125, 120, .06);
}

.cash-flow-group > summary > span:last-child,
.cash-flow-subgroup > summary > span:last-child {
  flex: 0 0 auto;
}

.cash-flow-group > summary strong,
.cash-flow-subgroup > summary strong {
  color: var(--blue);
  white-space: nowrap;
}

.cash-flow-subgroups {
  display: grid;
  gap: 8px;
  padding: 0 10px 10px 24px;
  border-top: 1px solid rgba(170, 183, 192, .35);
  background: rgba(22, 50, 74, .025);
}

.cash-flow-subgroup {
  margin-top: 9px;
  border-left: 4px solid var(--teal);
}

.cash-flow-subgroup.cash-flow-depth-1 {
  border-left-color: var(--success);
  background: rgba(46, 125, 91, .025);
}

.cash-flow-subgroup.cash-flow-depth-2 {
  border-left-color: var(--amber);
  background: rgba(233, 162, 59, .035);
}

.cash-flow-depth-2 > summary > span:first-child {
  font-size: 12px;
  text-transform: uppercase;
}

.cash-flow-items {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(170, 183, 192, .38);
  background: rgba(246, 249, 250, .75);
}

.cash-flow-item {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 8px 11px;
  border-bottom: 1px dashed rgba(170, 183, 192, .55);
}

.cash-flow-item:last-child {
  border-bottom: 0;
}

.cash-flow-item-date {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.cash-flow-item-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.cash-flow-item-copy b {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
}

.cash-flow-item-copy small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.cash-flow-item > strong {
  color: var(--blue);
  font-size: 13px;
  white-space: nowrap;
}

.cash-flow-empty {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

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

.cashier-payment-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.cashier-final-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 14px;
}

.cashier-summary > div {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: var(--white);
}

.cashier-summary span,
.cashier-summary strong {
  display: block;
}

.cashier-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.cashier-summary strong {
  color: var(--blue);
  font-size: 23px;
  line-height: 1.15;
}

.cashier-summary .cashier-received {
  border-left-color: var(--success);
  background: rgba(46, 125, 91, .08);
}

.cashier-summary .cashier-spent {
  border-left-color: var(--danger);
  background: rgba(201, 76, 76, .08);
}

.cashier-summary .cashier-reserve {
  border-left-color: #D97A7A;
  background: rgba(217, 122, 122, .1);
}

.cashier-summary .cashier-balance {
  border-left-color: var(--blue);
  background: rgba(22, 50, 74, .06);
}

.cashier-final-summary .cashier-highlight {
  grid-column: span 2;
  min-height: 132px;
  border-width: 2px;
  box-shadow: 0 12px 28px rgba(22, 50, 74, .12);
}

.cashier-summary .cashier-highlight span {
  color: var(--blue);
  font-size: 13px;
}

.cashier-summary .cashier-highlight strong {
  font-size: 31px;
}

.cashier-summary .cashier-profit {
  border-left-color: var(--success);
  background: rgba(46, 125, 91, .1);
}

.cashier-summary .cashier-profit strong {
  color: var(--success);
}

.cashier-summary .cashier-balance.is-negative {
  border-left-color: var(--danger);
  background: rgba(201, 76, 76, .08);
}

.cashier-summary .cashier-profit.is-negative {
  border-left-color: var(--danger);
  background: rgba(201, 76, 76, .08);
}

.cashier-summary .cashier-balance.is-negative strong,
.cashier-summary .cashier-profit.is-negative strong,
.money-negative {
  color: var(--danger) !important;
}

.cashier-summary .cashier-start {
  border-left-color: #8A6BBE;
  background: rgba(138, 107, 190, .08);
}

.cashier-summary .cashier-method-pix {
  border-left-color: var(--success);
  background: rgba(46, 125, 91, .08);
}

.cashier-summary .cashier-method-especie {
  border-left-color: var(--amber);
  background: rgba(233, 162, 59, .11);
}

.cashier-summary .cashier-method-cartao_debito {
  border-left-color: var(--teal);
  background: rgba(22, 125, 120, .08);
}

.cashier-summary .cashier-method-cartao_credito {
  border-left-color: #8A6BBE;
  background: rgba(138, 107, 190, .08);
}

.cashier-summary .cashier-method-outro {
  border-left-color: var(--muted);
  background: rgba(91, 105, 116, .08);
}

.cashier-summary .cashier-total {
  border-left-color: var(--blue);
  background: rgba(22, 50, 74, .08);
}

.cashier-summary .cashier-total strong {
  font-size: 28px;
}

.migration-inline-form {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) auto minmax(180px, 1fr);
  gap: 10px;
  align-items: end;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 50, 74, .035);
}

.migration-inline-form small {
  align-self: center;
}

.finance-home-grid {
  align-items: stretch;
}

.finance-cost-payment-panel {
  margin-top: 16px;
}

.cost-payment-tree {
  width: min(100%, 760px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(22, 50, 74, .2);
  border-left: 5px solid var(--teal);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 8px 22px rgba(22, 50, 74, .08);
}

.cost-payment-tree > summary {
  list-style: none;
}

.cost-payment-tree > summary::-webkit-details-marker {
  display: none;
}

.cost-payment-tree-node {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(170, 183, 192, .55);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}

.cost-payment-tree-node span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.cost-payment-tree-node .cost-payment-tree-copy {
  min-width: 0;
  gap: 10px;
}

.cost-payment-tree-copy > span {
  display: grid;
  min-width: 0;
  gap: 3px;
  text-transform: none;
}

.cost-payment-tree-copy b {
  color: var(--blue);
  font-size: 15px;
  line-height: 1.25;
}

.cost-payment-tree-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.cost-payment-tree-node span svg {
  width: 17px;
  height: 17px;
  color: var(--teal);
}

.cost-payment-tree-node strong {
  color: var(--blue);
  white-space: nowrap;
}

.cost-payment-tree-node.is-root {
  min-height: 50px;
  padding: 13px 15px;
  cursor: pointer;
  border: 0;
  border-radius: 0;
  background: linear-gradient(135deg, rgba(22, 125, 120, .1), rgba(22, 50, 74, .045));
  user-select: none;
  transition: background-color .18s ease;
}

.cost-payment-tree-node.is-root:hover {
  background: linear-gradient(135deg, rgba(22, 125, 120, .16), rgba(22, 50, 74, .07));
}

.cost-payment-tree-node.is-root strong {
  font-size: 18px;
}

.cost-payment-tree-total {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.cost-payment-tree-chevron {
  width: 20px;
  height: 20px;
  color: var(--teal);
  transition: transform .2s ease;
}

.cost-payment-tree[open] .cost-payment-tree-chevron {
  transform: rotate(180deg);
}

.cost-payment-tree-node.is-branch {
  border-left: 4px solid var(--success);
}

.cost-payment-tree-node.is-pending {
  border-left: 4px solid var(--warning);
}

.cost-payment-tree-children {
  position: relative;
  display: grid;
  gap: 8px;
  margin: 8px 0 0 20px;
  padding-left: 22px;
  border-left: 2px solid rgba(22, 125, 120, .26);
}

.cost-payment-tree > .cost-payment-tree-children {
  display: none;
  margin: 0;
  padding: 12px 16px 14px 42px;
  border-top: 1px solid rgba(170, 183, 192, .45);
  border-left: 0;
  background: rgba(246, 249, 250, .84);
}

.cost-payment-tree[open] > .cost-payment-tree-children {
  display: grid;
}

.cost-payment-tree-node.is-leaf::before,
.cost-payment-tree-node.is-pending::before,
.cost-payment-tree-node.is-branch::before {
  content: "";
  position: absolute;
  top: 21px;
  left: -23px;
  width: 21px;
  border-top: 2px solid rgba(22, 125, 120, .26);
}

.cost-payment-tree-children.is-nested {
  margin-top: 0;
  margin-left: 18px;
  border-left-color: rgba(46, 125, 91, .24);
}

.cost-payment-tree-node.is-leaf {
  min-height: 38px;
  padding-top: 7px;
  padding-bottom: 7px;
  border-style: dashed;
}

.cashier-cost-payment-tree,
.cashier-print-cost-tree {
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}

.cashier-cost-payment-tree .cost-payment-tree,
.cashier-print-cost-tree .cost-payment-tree {
  width: 100%;
}

.finance-card {
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 6px solid var(--teal);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.finance-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(22, 50, 74, .12);
}

.finance-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.15;
}

.finance-card small {
  color: var(--muted);
}

.finance-card-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.finance-card-breakdown > div {
  min-width: 0;
  padding: 8px 9px;
  border-radius: 7px;
  background: rgba(22, 50, 74, .04);
}

.finance-card-breakdown small {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-card-breakdown strong {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.finance-card-breakdown .is-pending {
  color: #A45A12;
}

.finance-card-breakdown .is-paid {
  color: var(--success);
}

.finance-card-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.finance-card-total span {
  font-size: 11px;
}

.finance-card-total b {
  color: var(--text);
  font-size: 16px;
}

.finance-card-pay { border-left-color: #E58A8A; }
.finance-card-reserve { border-left-color: #D97A7A; }
.finance-card-overdue { border-left-color: var(--danger); }
.finance-card-receive { border-left-color: var(--success); }
.finance-card-cash { border-left-color: var(--blue); }
.finance-card-cash.is-negative {
  border-left-color: var(--danger);
}
.finance-card-cash.is-negative strong {
  color: var(--danger);
}
.finance-card-profit { border-left-color: var(--blue); }
.finance-card-profit.is-negative {
  border-left-color: var(--danger);
}
.finance-card-profit.is-negative strong {
  color: var(--danger);
}
.finance-card-profit.is-positive {
  border-left-color: var(--success);
}
.finance-card-profit.is-positive strong {
  color: var(--success);
}

.quick-form-head {
  border-top: 5px solid var(--teal);
}

.quick-value-sticky {
  position: sticky;
  top: 79px;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 12px 28px rgba(22, 50, 74, .1);
  backdrop-filter: blur(8px);
}

.quick-value-sticky div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(22, 50, 74, .045);
}

.quick-value-sticky div:nth-child(2) { background: rgba(233, 162, 59, .13); }
.quick-value-sticky div:nth-child(3) { background: rgba(46, 125, 91, .1); }
.quick-value-sticky div:nth-child(4) { background: rgba(22, 125, 120, .09); }
.quick-value-sticky div:nth-child(5) { background: rgba(201, 76, 76, .09); }

.quick-value-sticky span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-value-sticky strong {
  display: block;
  margin-top: 4px;
  color: var(--blue);
  font-size: 18px;
  line-height: 1.15;
}

.quick-card-slider {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(620px, 82%);
  gap: 14px;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 2px 2px 14px;
  scrollbar-width: thin;
}

.quick-card {
  scroll-snap-align: start;
  align-self: start;
  min-height: 280px;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.quick-card:focus-within,
.quick-relation-row:focus-within,
.quick-lookup-field:focus-within {
  z-index: 50;
}

.quick-card-wide {
  min-height: 520px;
  margin-top: 2px;
}

.quick-area-client { border-top: 5px solid var(--teal); background: rgba(22, 125, 120, .045); }
.quick-area-service { border-top: 5px solid var(--amber); background: rgba(233, 162, 59, .07); }
.quick-area-vehicle { border-top: 5px solid #8A6BBE; background: rgba(138, 107, 190, .06); }
.quick-area-values { border-top: 5px solid var(--blue); background: rgba(22, 50, 74, .035); }
.quick-area-status { border-top: 5px solid var(--success); background: rgba(46, 125, 91, .055); }
.quick-area-seals { border-top: 5px solid var(--warning); background: rgba(233, 162, 59, .07); }

.quick-seal-process-grid {
  align-items: end;
}

.quick-seal-cost-preview {
  max-width: 360px;
}

.quick-seal-cost-preview input {
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.quick-seal-cost-preview.is-muted label {
  color: var(--muted);
}

.quick-seal-cost-preview.is-muted input {
  background: #EEF2F4;
  border-color: #CFD9DF;
  color: var(--muted);
  box-shadow: none;
}

.quick-seal-cost-preview.is-billable input {
  background: var(--white);
  border-color: rgba(22, 125, 120, .46);
  color: var(--text);
}

.quick-values-layout {
  display: grid;
  grid-template-columns: minmax(360px, .8fr) minmax(560px, 1.35fr);
  gap: 14px;
  align-items: start;
}

.quick-values-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.quick-values-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(170, 183, 192, .75);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}

.quick-values-process {
  background: rgba(22, 50, 74, .045);
}

.quick-values-costs {
  background: rgba(233, 162, 59, .055);
}

.quick-values-payments {
  background: rgba(22, 125, 120, .05);
}

.quick-values-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.quick-values-heading h4 {
  margin: 0;
  color: var(--blue);
  font-size: 15px;
}

.quick-values-heading span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.quick-payment-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 125, 120, .18);
  border-radius: 8px;
  background: rgba(255,255,255,.76);
}

.quick-payment-summary-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-payment-summary-line strong {
  color: var(--blue);
  font-size: 18px;
}

.quick-process-values-grid {
  gap: 12px;
}

.quick-relation-list {
  display: grid;
  gap: 10px;
}

.quick-relation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 50, 74, .025);
}

.quick-payment-entry {
  grid-template-columns: minmax(130px, .9fr) minmax(160px, 1fr) minmax(130px, .9fr) 42px;
}

.quick-payment-entry label {
  margin-bottom: 5px;
}

.quick-lookup-field {
  position: relative;
  z-index: 2;
}

.quick-lookup-result {
  position: absolute;
  z-index: 999;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.quick-lookup-result:empty {
  display: none;
}

.quick-phone-action {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid rgba(233, 162, 59, .4);
  border-radius: 8px;
  background: rgba(233, 162, 59, .1);
}

.quick-phone-action[hidden] {
  display: none;
}

.quick-cost-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 3px;
}

.quick-card-wide .quick-cost-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.quick-cost-item {
  display: grid;
  grid-template-columns: minmax(112px, 1fr) minmax(88px, 116px);
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.76);
}

.quick-cost-item > label {
  margin: 0;
  color: var(--text);
  font-size: 12px;
}

.quick-cost-item input[type="number"] {
  min-height: 34px;
  padding: 6px 8px;
}

.quick-cost-payer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.quick-cost-payer label {
  margin: 0;
}

.quick-cost-payer input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.quick-cost-payer span {
  display: grid;
  place-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quick-cost-payer input:checked + span {
  border-color: var(--teal);
  background: rgba(22, 125, 120, .12);
  color: var(--blue);
}

.quick-cost-paid-choice {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.quick-cost-paid-choice input[type="checkbox"] {
  width: auto;
  min-height: auto;
  accent-color: var(--teal);
}

.quick-cost-date {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.quick-cost-date label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-cost-date input[type="date"] {
  min-height: 34px;
  padding: 6px 8px;
}

.quick-cost-payment-method {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.quick-cost-payment-method label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-cost-payment-method select {
  min-height: 34px;
  padding: 6px 8px;
}

.quick-pay-field label {
  margin-bottom: 7px;
}

[data-autosave-mode="pending"] { color: var(--warning); }
[data-autosave-mode="saving"] { color: var(--teal); }
[data-autosave-mode="saved"] { color: var(--success); }
[data-autosave-mode="error"] { color: var(--danger); }

.quick-total-grid .stat {
  min-height: 92px;
}

.quick-total-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.quick-card-wide .quick-total-grid {
  margin-top: 14px;
}

.quick-card-wide + .quick-area-status {
  margin-top: 14px;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 9;
  padding: 12px 0;
  background: linear-gradient(to top, var(--bg) 72%, rgba(245,247,249,0));
}

.document-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.document-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 32px;
  padding: 3px 5px 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}

.document-chip-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.document-chip-link svg {
  flex: 0 0 auto;
}

.document-chip-delete {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(201, 76, 76, .12);
  color: var(--danger);
  cursor: pointer;
}

.document-chip-delete svg {
  width: 14px;
  height: 14px;
}

.document-chip-delete:hover {
  background: rgba(201, 76, 76, .2);
}

.quick-permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.company-access-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.company-access-card {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-weight: 800;
  color: var(--text);
}

.company-access-card input {
  width: auto;
  min-height: auto;
}

.permission-card {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(22, 50, 74, .025);
}

.quick-print-page h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--blue);
}

.quick-print-seal-highlight {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 3px solid var(--blue);
  border-radius: 8px;
  background: rgba(22, 50, 74, .06);
  break-inside: avoid;
  page-break-inside: avoid;
}

.quick-print-seal-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.quick-print-seal-heading span {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.quick-print-seal-heading small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.quick-print-seal-table-wrap {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(22, 50, 74, .28);
  border-radius: 5px;
  background: #fff;
}

.quick-print-seal-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.quick-print-seal-table th,
.quick-print-seal-table td {
  padding: 5px 6px;
  border-right: 1px solid rgba(22, 50, 74, .16);
  border-bottom: 1px solid rgba(22, 50, 74, .16);
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
}

.quick-print-seal-table th {
  background: rgba(22, 50, 74, .08);
  color: var(--blue);
  font-size: 7.5px;
  font-weight: 900;
}

.quick-print-seal-table th:first-child,
.quick-print-seal-table td:first-child {
  text-align: left;
}

.quick-print-seal-table th:last-child,
.quick-print-seal-table td:last-child {
  border-right: 0;
}

.quick-print-seal-table tbody tr:last-child td {
  border-bottom: 0;
}

.quick-print-seal-table td strong {
  color: var(--blue);
  font-size: 13px;
}

.quick-doc-print {
  margin-top: 16px;
  break-before: page;
}

.quick-doc-box {
  margin-top: 10px;
}

.quick-doc-box img,
.quick-doc-box object {
  display: block;
  width: 100%;
  max-height: 920px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.quick-doc-box object {
  min-height: 760px;
}
.finance-card-paid { border-left-color: var(--teal); }
.finance-card-spent { border-left-color: var(--warning); }
.finance-card-organized { border-left-color: #2E7D5B; }
.finance-card-refund { border-left-color: #8A6BBE; }

.finance-side-panel {
  align-self: start;
}

.finance-mini-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pay-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pay-inline-form select {
  width: auto;
  min-width: 120px;
  min-height: 36px;
}

.pay-inline-form input[type="date"] {
  width: auto;
  min-width: 142px;
  min-height: 36px;
}

.process-card {
  border-left: 5px solid var(--teal);
}

.process-card-client { background: rgba(22, 125, 120, .06); border-left-color: var(--teal); }
.process-card-vehicle { background: rgba(138, 107, 190, .08); border-left-color: #8A6BBE; }
.process-card-service { background: rgba(233, 162, 59, .08); border-left-color: var(--amber); }
.process-card-check { background: rgba(22, 50, 74, .06); border-left-color: var(--blue); }
.process-card-costs { background: rgba(201, 76, 76, .06); border-left-color: var(--danger); }
.process-card-payment { background: rgba(46, 125, 91, .07); border-left-color: var(--success); }
.process-card-status { background: rgba(82, 109, 130, .08); border-left-color: #526D82; }
.process-card-seals { background: rgba(217, 130, 43, .08); border-left-color: var(--warning); }
.process-card-documents { background: rgba(22, 125, 120, .045); border-left-color: var(--teal); }
.process-card-notes { background: rgba(255, 255, 255, .8); border-left-color: var(--line); }
.process-card-action { background: rgba(138, 107, 190, .06); border-left-color: #8A6BBE; }

.process-detail-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
  margin-top: 18px;
}

.process-detail-layout > .grid {
  display: contents;
}

.process-detail-layout .process-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 152px;
  margin-top: 0 !important;
  transition: box-shadow .2s ease, transform .2s ease, background-color .2s ease;
}

.process-detail-layout .process-card:not(.is-open) {
  min-height: 152px;
}

.process-detail-layout .process-card.is-collapsible {
  cursor: pointer;
}

.process-detail-layout .process-card.is-collapsible:not(.is-open) {
  height: 152px;
  overflow: hidden;
}

.process-detail-layout .process-card.is-open {
  grid-column: span 2;
  height: auto;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.process-detail-layout .process-card-costs.is-open,
.process-detail-layout .process-card-payment.is-open,
.process-detail-layout .process-card-status.is-open,
.process-detail-layout .process-card-seals.is-open,
.process-detail-layout .process-card-documents.is-open {
  grid-column: span 2;
}

.process-detail-layout .section-title {
  align-items: flex-start;
  margin-bottom: 10px;
}

.process-detail-layout .process-card.is-collapsible > .section-title {
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.process-detail-layout .process-card.is-collapsible > .section-title h3 {
  line-height: 1.25;
}

.process-card-preview {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.process-detail-layout .process-card.is-open .process-card-preview {
  -webkit-line-clamp: 2;
}

.process-card-chevron {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin-left: auto;
  border: 1px solid rgba(22, 50, 74, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  color: var(--blue);
  transition: transform .22s ease, background-color .2s ease;
}

.process-card-chevron svg {
  width: 17px;
  height: 17px;
}

.process-detail-layout .process-card.is-open .process-card-chevron {
  transform: rotate(180deg);
  background: var(--white);
}

.process-card-body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height .28s ease, opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.process-detail-layout .process-card.is-open .process-card-body {
  margin-top: 10px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.process-detail-layout .summary-band.compact-summary {
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  margin: 8px 0 0;
  padding: 9px;
  border: 1px solid rgba(22, 50, 74, .08);
  background: rgba(255, 255, 255, .68);
}

.process-detail-layout .summary-band.compact-summary strong {
  font-size: 15px;
}

.payment-balance-summary {
  gap: 8px;
}

.payment-balance-summary small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.process-detail-layout .process-card.is-collapsible:not(.is-open) .payment-balance-summary small {
  display: none;
}

.seal-use-form {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 120px minmax(180px, 220px) auto;
  gap: 10px;
  align-items: end;
}

.seal-use-type,
.seal-use-quantity,
.seal-use-owner {
  min-width: 0;
}

.seal-use-form .button {
  white-space: nowrap;
}

.required-seal-picker table {
  min-width: 720px;
}

.required-seal-picker td:nth-child(2) {
  width: 120px;
}

.required-seal-picker td:nth-child(3) {
  min-width: 260px;
}

.payment-help {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(22, 50, 74, .08);
  border-radius: 8px;
  background: rgba(22, 50, 74, .045);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.process-detail-layout .compact-scroll {
  max-height: 260px;
}

.process-card-service {
  align-self: start;
  min-height: auto;
}

.compact-scroll {
  max-height: 154px;
  overflow: auto;
}

.compact-scroll table {
  min-width: 0;
}

.service-config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.service-config-card {
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-height: 184px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
}

.service-config-status {
  background: rgba(22, 125, 120, .06);
  border-left-color: var(--teal);
}

.service-config-taxes {
  background: rgba(233, 162, 59, .09);
  border-left-color: var(--amber);
}

.service-config-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.service-config-card strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.15;
}

.service-config-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.service-config-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.service-config-metrics div {
  padding: 10px;
  border: 1px solid rgba(22, 50, 74, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}

.service-config-metrics strong {
  font-size: 15px;
}

.service-config-dialog {
  width: min(1120px, calc(100vw - 32px));
}

.service-config-dialog .section-title {
  align-items: flex-start;
}

.service-config-table {
  max-height: 58vh;
  overflow: auto;
  margin-top: 14px;
}

.service-config-status-dialog .service-config-table {
  background: rgba(22, 125, 120, .04);
}

.service-config-taxes-dialog .service-config-table {
  background: rgba(233, 162, 59, .055);
}

.service-config-table table {
  min-width: 820px;
}

.service-config-table th,
.service-config-table td {
  padding: 9px 10px;
}

.mini-input {
  max-width: 86px;
  min-height: 36px;
  padding: 7px 8px;
}

.status-admin-panel,
.status-form-panel {
  border-left: 5px solid #8A6BBE;
  background: rgba(138, 107, 190, .045);
}

.status-admin-table {
  max-height: 62vh;
  overflow: auto;
  margin-top: 14px;
}

.color-chip {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border: 1px solid rgba(22, 50, 74, .22);
  border-radius: 50%;
  background: var(--chip-color);
  vertical-align: -2px;
}

.file-input-wide input[type="file"] {
  min-width: 100%;
  min-height: 46px;
}

.logo-preview-box {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.logo-preview-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.logo-preview {
  display: block;
  width: min(360px, 100%);
  height: 150px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
}

.setup-wizard {
  margin-top: 16px;
}

.setup-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.setup-steps span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 36px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.setup-steps span.active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
}

.setup-steps span.done {
  border-color: rgba(46, 125, 91, .28);
  background: rgba(46, 125, 91, .08);
  color: var(--success);
}

.setup-panel[hidden] {
  display: none;
}

.quick-dialog {
  width: min(760px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 24px 80px rgba(22, 50, 74, .25);
}

.quick-dialog::backdrop {
  background: rgba(22, 50, 74, .36);
}

.confirm-dialog {
  width: min(520px, calc(100vw - 32px));
}

.confirm-layout {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: rgba(201, 76, 76, .1);
  color: var(--danger);
}

.confirm-dialog .section-title {
  margin: 0;
}

.confirm-dialog .section-title h3 {
  margin: 0;
}

.confirm-dialog .section-title p {
  max-width: 390px;
}

.relation-delete-dialog {
  width: min(680px, calc(100vw - 32px));
}

.relation-delete-options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.relation-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: flex-start;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
}

.relation-option input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.relation-option span,
.relation-option small {
  display: block;
}

.relation-option small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.backup-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  border-left: 5px solid var(--accent);
}

.backup-panel-download {
  border-left-color: #1e7f6f;
}

.backup-panel-restore {
  border-left-color: #a56a19;
}

.backup-panel-reset {
  border-left-color: #b73f55;
}

.reset-options {
  display: grid;
  gap: 10px;
  max-height: 360px;
  padding-right: 4px;
  margin-top: 12px;
  overflow: auto;
}

.picker-dialog {
  width: min(980px, calc(100vw - 32px));
}

.picker-table {
  max-height: 54vh;
  overflow: auto;
}

.picker-pagination {
  justify-content: flex-end;
}

.validation-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding-left: 18px;
  color: var(--danger);
}

.report-filters {
  grid-template-columns: minmax(220px, 1.4fr) 150px 150px auto auto auto;
  align-items: end;
}

.report-filters .field-date input {
  width: 150px;
}

.report-field-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 8px;
}

.report-field-picker label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.report-field-picker input {
  width: auto;
  min-height: auto;
}

.report-page {
  position: relative;
  overflow: visible;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-top: 16px;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.report-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.report-filters {
  grid-template-columns: minmax(140px, 170px) minmax(140px, 170px) auto auto auto;
  justify-content: start;
}

.report-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.report-brand-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.report-system-logo {
  width: 178px;
  height: 68px;
  object-fit: contain;
  flex: 0 0 auto;
}

.report-brand-left h2 {
  margin: 2px 0 4px;
}

.report-company-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 160px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
}

.report-company-logo {
  width: 168px;
  height: 72px;
  object-fit: contain;
  flex: 0 0 auto;
}

.report-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92%, 1040px);
  transform: translate(-50%, -50%);
  opacity: .12;
  pointer-events: none;
  z-index: 0;
}

.report-summary,
.report-section,
.report-section-title {
  position: relative;
  z-index: 1;
}

.report-page .stat,
.report-page .report-table {
  background: rgba(255, 255, 255, .78);
}

.report-summary .stat.is-negative {
  border-left-color: var(--danger);
}

.report-summary .stat.is-highlight {
  grid-column: span 2;
  min-height: 132px;
  border-width: 2px;
  box-shadow: 0 12px 28px rgba(22, 50, 74, .12);
}

.report-summary .stat.is-highlight span {
  color: var(--blue);
  font-weight: 800;
  text-transform: uppercase;
}

.report-summary .stat.is-highlight strong {
  font-size: 31px;
}

.report-summary .stat.is-cash {
  border-left-color: var(--blue);
  background: rgba(22, 50, 74, .08);
}

.report-summary .stat.is-profit {
  border-left-color: var(--success);
  background: rgba(46, 125, 91, .1);
}

.report-summary .stat.is-profit strong {
  color: var(--success);
}

.report-summary .stat.is-highlight.is-negative {
  border-left-color: var(--danger);
  background: rgba(201, 76, 76, .08);
}

.report-summary .stat.is-negative strong {
  color: var(--danger);
}

.report-section {
  margin-top: 16px;
}

.report-table {
  position: relative;
  z-index: 1;
  overflow: visible;
  background: transparent;
}

.report-table table {
  min-width: 0;
  table-layout: fixed;
}

.report-table th,
.report-table td {
  padding: 8px 9px;
  overflow-wrap: anywhere;
  word-break: normal;
  font-size: 12px;
  line-height: 1.32;
}

.report-table th {
  font-size: 10.5px;
}

.report-table table,
.report-table thead,
.report-table tbody,
.report-table tr,
.report-table th,
.report-table td {
  background: transparent;
}

.print-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
  background: var(--white);
}

.print-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid var(--blue);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.print-logo {
  display: block;
  width: 260px;
  max-width: 100%;
  height: auto;
}

.print-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.print-box {
  border: 1px solid #AAB7C0;
  border-radius: 6px;
  padding: 8px;
  break-inside: avoid;
  page-break-inside: avoid;
}

.print-box h3 {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--blue);
}

.print-box p,
.print-box table {
  font-size: 12px;
}

@media (max-width: 1040px) {
  .dashboard-top-cards { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cashier-final-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .filters { grid-template-columns: 1fr 1fr; }
  .process-values-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .process-value-total {
    grid-column: span 2;
  }
  .process-detail-layout .process-card.is-open {
    grid-column: 1 / -1;
  }
  .quick-values-layout {
    grid-template-columns: 1fr;
  }
  .quick-card-wide .quick-cost-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .auth-shell::before {
    background: linear-gradient(145deg, rgba(12,31,48,.99) 0%, rgba(22,50,74,.97) 48%, rgba(22,125,120,.94) 100%);
  }
  .auth-layout {
    grid-template-columns: 1fr;
    width: min(680px, 100%);
    min-height: auto;
    gap: 26px;
  }
  .login-intro {
    align-items: center;
    text-align: center;
  }
  .login-slider {
    min-height: 340px;
  }
  .login-feature-grid,
  .login-finance-preview,
  .login-timeline {
    margin-right: auto;
    margin-left: auto;
  }
  .landing-summary {
    justify-content: center;
  }
  .login-panel {
    order: -1;
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .auth-shell {
    align-items: flex-start;
    padding: 16px;
  }
  .auth-layout {
    gap: 20px;
    justify-items: stretch;
    max-width: calc(100vw - 32px);
  }
  .login-intro {
    gap: 16px;
    max-width: 100%;
    min-width: 0;
  }
  .login-hero-brand {
    width: 96px;
    height: 72px;
  }
  .login-intro-logo {
    width: 112px;
    height: 90px;
  }
  .login-slider {
    min-height: 390px;
  }
  .login-slide h1 {
    font-size: 42px;
  }
  .login-slide h2 {
    font-size: 29px;
  }
  .login-slide p:not(.eyebrow) {
    font-size: 15px;
  }
  .login-feature-grid,
  .login-finance-preview {
    grid-template-columns: 1fr;
  }
  .login-feature-grid div,
  .login-finance-preview div {
    min-height: auto;
  }
  .landing-summary {
    gap: 8px;
  }
  .landing-summary button {
    flex: 1 1 120px;
    justify-content: center;
  }
  .login-panel {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    padding: 22px;
  }
  .login-logo {
    height: 86px;
  }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
  }
  .main { margin-left: 0; }
  .topbar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }
  .topbar-actions { justify-content: space-between; }
  .content { padding: 16px; }
  .dashboard-top-cards {
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  }
  .grid-2, .grid-3, .grid-4, .summary-band, .service-config-grid, .process-detail-layout, .process-values-row {
    grid-template-columns: 1fr;
  }
  .cashier-final-summary .cashier-highlight,
  .report-summary .stat.is-highlight {
    grid-column: auto;
  }
  .quick-value-sticky {
    top: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-card-slider {
    grid-auto-columns: minmax(calc(100vw - 36px), 100%);
  }
  .quick-cost-grid {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .quick-card-wide .quick-cost-grid,
  .quick-values-layout {
    grid-template-columns: 1fr;
  }
  .quick-values-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .quick-values-heading span {
    text-align: left;
  }
  .process-value-total {
    grid-column: auto;
  }
  .process-detail-layout .process-card.is-open {
    grid-column: auto;
  }
  .seal-use-form {
    grid-template-columns: 1fr;
  }
  .form-grid { grid-template-columns: 1fr; }
  .field-1, .field-2, .field-3, .field-4, .field-5, .field-6, .field-7, .field-8, .field-12 {
    grid-column: span 1;
  }
  .process-service-row {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
  }
  .process-service-row > div:nth-of-type(3) {
    grid-column: 2;
  }
  .process-service-row [data-remove-process-service] {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }
  .filters { grid-template-columns: 1fr; }
  .cashier-period-filter,
  .cashier-payment-summary,
  .cashier-category-columns,
  .cashier-final-summary {
    grid-template-columns: 1fr;
  }
  .cashier-period-filter input[type="date"] {
    width: 100%;
  }
  .cost-payment-tree-node.is-root {
    align-items: flex-start;
  }
  .cost-payment-tree-total {
    padding-top: 1px;
  }
  .cost-payment-tree-copy small {
    font-size: 11px;
  }
  .cash-flow-dropdown-summary {
    align-items: flex-start;
  }
  .cash-flow-dropdown-total strong {
    font-size: 17px;
  }
  .cash-flow-item {
    grid-template-columns: 70px minmax(0, 1fr);
  }
  .cash-flow-item > strong {
    grid-column: 2;
  }
  .cash-flow-subgroups {
    padding-left: 14px;
  }
  .migration-inline-form { grid-template-columns: 1fr; }
  .attention-cards {
    grid-template-columns: 1fr;
  }
  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }
  .pagination-pages {
    justify-content: flex-start;
  }
  .advanced-access-grid,
  .company-link-row,
  .company-access-grid,
  .permission-grid,
  .quick-permission-grid {
    grid-template-columns: 1fr;
  }
  .setup-steps {
    grid-template-columns: 1fr 1fr;
  }
  .print-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .login-slider {
    min-height: 430px;
  }
  .login-panel-heading h2 {
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-slide,
  .landing-summary button,
  .process-detail-layout .process-card,
  .process-card-chevron,
  .process-card-body {
    transition: none;
  }
}

@media print {
  @page {
    margin: 10mm;
  }
  body {
    background: #fff;
  }
  .sidebar,
  .topbar,
  .alert,
  .no-print {
    display: none !important;
  }
  .main {
    margin: 0;
  }
  .content {
    padding: 0;
  }
  .print-page,
  .report-page {
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    margin: 0;
    overflow: visible;
  }
  .quick-print-page {
    max-width: 980px;
    padding: 20px;
    margin: 0 auto;
  }
  .quick-print-page .print-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px;
  }
  .quick-print-page .print-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
  }
  .quick-print-page .print-box {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .quick-print-seal-highlight {
    background: #f1f4f7 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .report-watermark {
    position: fixed;
    width: 88vw;
    max-width: 1080px;
    opacity: .14;
  }
  .report-table {
    overflow: visible;
  }
  .report-table table {
    min-width: 0;
    table-layout: fixed;
  }
  .cost-payment-tree {
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cost-payment-tree > .cost-payment-tree-children {
    display: grid !important;
  }
  .cost-payment-tree-chevron {
    display: none;
  }
  .cash-flow-dropdown,
  .cash-flow-group,
  .cash-flow-subgroup,
  .cash-flow-item {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .cash-flow-dropdown > .cash-flow-groups {
    display: grid !important;
  }
  .cash-flow-dropdown-summary svg:last-child,
  .cash-flow-group summary svg,
  .cash-flow-subgroup summary svg {
    display: none;
  }
  .report-header,
  .print-header {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .process-detail-layout {
    display: block;
  }
  .process-detail-layout > .grid {
    display: grid;
  }
  .process-detail-layout .process-card {
    margin-top: 10px !important;
  }
  .process-card-chevron {
    display: none;
  }
  .process-card-body {
    max-height: none !important;
    overflow: visible;
    opacity: 1;
    transform: none;
  }
  table {
    min-width: 0;
    page-break-inside: auto;
  }
  tr {
    page-break-inside: avoid;
  }
}
