:root {
  --background: hsl(210 40% 98%);
  --foreground: hsl(222 47% 11%);
  --primary: hsl(346 87% 43%);
  --primary-foreground: hsl(0 0% 100%);
  --secondary: hsl(217 33% 17%);
  --secondary-foreground: hsl(210 40% 98%);
  --muted: hsl(210 40% 92%);
  --muted-foreground: hsl(215 16% 47%);
  --accent: hsl(214 32% 91%);
  --accent-foreground: hsl(222 47% 11%);
  --destructive: hsl(0 84% 60%);
  --card: hsl(0 0% 100%);
  --border: hsl(214 32% 86%);
  --input: hsl(214 32% 86%);
  --ring: hsl(346 87% 43%);
  --radius: 0.75rem;
  --warning: hsl(38 92% 50%);
  --status-active: hsl(142 71% 45%);
  --status-error: hsl(0 84% 60%);
  --sidebar: hsl(222 47% 7%);
  --sidebar-hover: hsl(217 33% 17%);
  --font: "Outfit", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  min-height: 100%;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
}

p { margin: 0 0 1rem; color: var(--muted-foreground); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 0.5rem;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 0.85rem 0 0.35rem;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--input);
  border-radius: 0.6rem;
  padding: 0.7rem 0.85rem;
  font: inherit;
  background: #fff;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 0.6rem;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: var(--primary-foreground);
}

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

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.btn-outline {
  background: #fff;
  color: var(--foreground);
  border: 1px solid var(--border);
}

.alert {
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-ok {
  background: #ecfdf3;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.stack { display: grid; gap: 0.35rem; }
.actions { margin-top: 1.25rem; display: flex; gap: 0.6rem; }
.muted { color: var(--muted-foreground); font-size: 0.9rem; }
code { background: var(--accent); padding: 0.1rem 0.35rem; border-radius: 0.3rem; }

.btn-block { width: 100%; margin-top: 0.5rem; }
.btn-icon {
  border: 0;
  background: transparent;
  border-radius: 0.6rem;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.btn-icon:hover { background: var(--accent); }

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.login-hero {
  display: none;
  position: relative;
  overflow: hidden;
}
.login-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.login-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, hsl(346 87% 43% / 0.92), hsl(346 87% 43%));
  mix-blend-mode: multiply;
}
.login-hero-content {
  position: relative;
  z-index: 1;
  color: #fff;
  padding: 3rem;
  max-width: 32rem;
}
.login-hero-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  font-size: 1.75rem;
  font-weight: 700;
}
.login-hero-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  background: #fff;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.login-hero-content h1 {
  font-size: 2.25rem;
  color: #fff;
  margin-bottom: 1rem;
}
.login-hero-content p {
  color: rgba(255,255,255,0.92);
  font-size: 1.1rem;
  line-height: 1.6;
}
.login-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: hsl(210 40% 96% / 0.5);
}
.login-panel-inner { width: 100%; max-width: 28rem; }
.login-mobile-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  font-weight: 700;
}
.login-card h2 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.login-card .muted { margin-bottom: 1rem; }
.remember-row {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  margin: 0.85rem 0 0.25rem !important;
  font-weight: 500;
  cursor: pointer;
  color: var(--foreground);
}
.remember-row input {
  width: auto;
  margin: 0;
  accent-color: var(--primary);
}
.btn-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.6rem;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--secondary);
  color: var(--secondary-foreground);
}
.login-footer { text-align: center; margin-top: 1.5rem; }

@media (min-width: 1024px) {
  .login-page { flex-direction: row; }
  .login-hero {
    display: flex;
    align-items: center;
    width: 50%;
  }
  .login-panel { width: 50%; }
  .login-mobile-brand { display: none; }
}

/* App shell */
.app-body { background: hsl(210 40% 96% / 0.35); }
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 16rem;
  background: hsl(222 47% 7%);
  color: #f8fafc;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}
.sidebar.is-open { transform: translateX(0); }
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0,0,0,0.5);
}
.sidebar-brand {
  height: 4rem;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  background: hsl(217 33% 12%);
  border-bottom: 1px solid hsl(217 33% 17%);
}
.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
}
.sidebar-logo {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  background: #fff;
  border-radius: 0.375rem;
  padding: 0.125rem;
}
.sidebar-nav { padding: 1rem 0.75rem 2rem; }
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.25rem;
  border-radius: 0.6rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover {
  background: hsl(217 33% 17% / 0.55);
  color: #fff;
  text-decoration: none;
}
.sidebar-link.is-active {
  background: hsl(217 33% 17%);
  color: #fff;
}
.badge-soon {
  margin-left: auto;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: hsl(217 33% 20%);
  color: #cbd5e1;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
}
.nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 1;
}
.nav-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.page-header .muted { margin: 0; }
.page-header .btn { flex-shrink: 0; align-self: center; }
.sidebar-link .nav-icon {
  color: inherit;
  opacity: 0.9;
}
.sidebar-link.is-active .nav-icon {
  opacity: 1;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  background: hsl(210 40% 98% / 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--foreground);
  text-decoration: none;
}
.header-brand:hover { text-decoration: none; }
.header-logo {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}
.header-title {
  font-weight: 600;
  font-size: 1rem;
  display: none;
}
.header-actions { margin-left: auto; }
.user-menu { position: relative; }
.user-menu summary {
  list-style: none;
  cursor: pointer;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-trigger { display: inline-flex; }
.user-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: hsl(346 87% 43% / 0.12);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 14rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(15,23,42,0.12);
  padding: 0.35rem;
}
.user-dropdown-head {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}
.user-dropdown-head strong {
  display: block;
  font-size: 0.9rem;
}
.user-dropdown-head span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
}
.user-dropdown-item {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.9rem;
}
.user-dropdown-item:hover { background: var(--accent); text-decoration: none; }
.user-dropdown-item.danger { color: hsl(0 84% 45%); }

.app-main {
  flex: 1;
  padding: 1rem;
  max-width: 80rem;
  width: 100%;
  margin: 0 auto;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.page-header h1 { font-size: 1.875rem; }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: 0 4px 16px rgba(15,23,42,0.04);
}
.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-bottom: 0.35rem;
}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--foreground);
}
.stat-warning { color: hsl(38 92% 40%); }
.stat-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.2rem;
}
.stat-grid-compact {
  grid-template-columns: 1fr;
}
.stat-card-compact {
  padding: 0.85rem 1rem;
}
.stat-value-sm {
  font-size: 1.15rem;
}
.dashboard-banner {
  font-size: 0.95rem;
}
.text-danger { color: hsl(0 84% 45%); }

.alert-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
.alert-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: #fff;
}
.alert-card-urgent {
  border-color: hsl(0 84% 60%);
  background: hsl(0 84% 60% / 0.06);
  box-shadow: inset 0 0 0 1px hsl(0 84% 60% / 0.15);
}
.alert-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.alert-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: hsl(0 84% 60%);
  color: #fff;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}
.alert-card-tour {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--foreground);
}
.alert-card-phone {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}
.alert-card-phone a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.alert-card-amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
.alert-card-meta {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
}
.alert-card-action { margin-top: 0.25rem; }
.alert-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.toolbar-presets {
  margin-bottom: 0.5rem;
}
.btn-sm.is-active,
.btn-outline.is-active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

@media (min-width: 640px) {
  .stat-grid-compact { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
  .alert-card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1100px) {
  .alert-card-grid { grid-template-columns: repeat(3, 1fr); }
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(15,23,42,0.04);
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.panel-head h2 { font-size: 1.1rem; margin: 0; }
.panel-empty { margin: 0; padding: 1rem 0; }

.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th,
.data-table td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.data-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-foreground);
}

.icon-menu {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}
.md-hidden { display: inline-grid; }

@media (min-width: 640px) {
  .header-title { display: inline; }
}

@media (min-width: 768px) {
  .app-shell { margin-left: 16rem; }
  .sidebar { transform: translateX(0); }
  .sidebar-backdrop { display: none !important; }
  .md-hidden { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .app-main { padding: 1.5rem 2rem; }
}

@media (min-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Forms & tables */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
  align-items: center;
}
.toolbar-filters select {
  width: auto;
  min-width: 10rem;
}
.search-input {
  flex: 1;
  min-width: 12rem;
}
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}
.btn-danger {
  background: hsl(0 84% 45%);
  color: #fff;
}
.btn-danger:hover { filter: brightness(1.05); }
.btn-danger-text {
  color: hsl(0 84% 45%);
}

.code-block {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.85rem 1rem;
  border-radius: 0.6rem;
  overflow-x: auto;
  font-size: 0.82rem;
  margin: 0.5rem 0 1rem;
}
.detail-list-compact { margin-bottom: 1rem; }

.form-grid { display: grid; gap: 1.25rem; }
.form-section h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}
.form-hint { margin-top: -0.35rem; margin-bottom: 0.75rem; }
.field-grid {
  display: grid;
  gap: 0.85rem;
}
.btn-whatsapp {
  background: #25D366;
  color: #fff;
}
.btn-whatsapp:hover {
  filter: brightness(1.05);
  color: #fff;
  text-decoration: none;
}
.btn-whatsapp.is-busy,
.btn-whatsapp-print.is-busy {
  opacity: 0.72;
  pointer-events: none;
}
.btn-whatsapp-reminder {
  background: #128C7E;
  color: #fff;
}
.btn-whatsapp-reminder:hover {
  filter: brightness(1.05);
  color: #fff;
  text-decoration: none;
}
.wa-receipt-frame {
  position: fixed;
  left: -220mm;
  top: 0;
  width: 210mm;
  height: 297mm;
  border: 0;
  opacity: 0.01;
  pointer-events: none;
  z-index: -1;
}
.wa-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  max-width: 22rem;
  background: #0f172a;
  color: #fff;
  padding: 0.95rem 2.2rem 0.95rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  font-size: 0.9rem;
  line-height: 1.45;
}
.wa-toast p { margin: 0; }
.wa-toast-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.7rem;
}
.wa-toast-btn {
  border: 0;
  background: #25D366;
  color: #fff;
  border-radius: 0.45rem;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.wa-toast-close {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.money-line {
  display: block;
  line-height: 1.25;
}
.stat-value .money-line + .money-line {
  font-size: 0.62em;
  font-weight: 650;
  margin-top: 0.2rem;
  opacity: 0.92;
}
.stat-value-sm .money-line + .money-line {
  font-size: 0.72em;
}

.field-grid-2,
.field-grid-4,
.field-grid-5 { grid-template-columns: 1fr; }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.panel-spaced { margin-top: 1rem; }
.cell-sub {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
}
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  white-space: nowrap;
}
.inline-form { display: inline; margin: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: hsl(142 71% 45% / 0.15); color: hsl(142 71% 30%); }
.badge-warning { background: hsl(38 92% 50% / 0.15); color: hsl(38 92% 35%); }
.badge-danger { background: hsl(0 84% 60% / 0.12); color: hsl(0 84% 40%); }
.badge-muted { background: var(--accent); color: var(--muted-foreground); }

@media (min-width: 768px) {
  .field-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .field-grid-4 { grid-template-columns: repeat(4, 1fr); }
  .field-grid-5 { grid-template-columns: repeat(5, 1fr); }
  .field-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Voucher layout */
.split-layout {
  display: grid;
  gap: 1rem;
}
@media (min-width: 1100px) {
  .split-layout {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: start;
  }
}
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.segmented label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  cursor: pointer;
}
.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0.25rem;
  background: var(--accent);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  margin-bottom: 0.85rem;
}
.segmented-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
  position: relative;
}
.segmented-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.segmented-option span {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  border-radius: 0.45rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted-foreground);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.segmented-option input:checked + span {
  background: #fff;
  color: var(--foreground);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.segmented-option input:focus-visible + span {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

.info-banner {
  background: hsl(214 32% 91% / 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
}
.info-banner p { margin: 0; color: var(--foreground); }

.field-grid label,
.field-block label,
.segmented-option {
  margin-top: 0;
}
.form-section > .field-grid:first-of-type label:first-child,
.form-section > .field-block:first-of-type label {
  margin-top: 0;
}

.table-foot {
  margin: 0.75rem 0 0;
  text-align: right;
}
.data-table-excel th,
.data-table-excel td {
  vertical-align: middle;
}
.data-table-excel td:nth-child(2),
.data-table-excel td:nth-child(4) {
  white-space: normal;
  min-width: 7rem;
}
.data-table td.table-actions,
.data-table th:last-child {
  text-align: right;
}

.toolbar input[type="date"] {
  width: auto;
  min-width: 9rem;
}
.toolbar .btn { white-space: nowrap; }

.panel-head .muted { margin: 0; }
.panel-empty { text-align: center; padding: 2rem 1rem; }

@media (max-width: 640px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .page-header .btn {
    align-self: flex-start;
    width: 100%;
  }
  .segmented-control {
    display: flex;
    width: 100%;
  }
  .segmented-option {
    flex: 1;
  }
  .segmented-option span {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 0.5rem;
    font-size: 0.85rem;
  }
}
.field-block { margin-top: 0.5rem; }
.field-grid-3 { grid-template-columns: 1fr; }

.voucher-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.voucher-preview-head h2 {
  font-size: 1.1rem;
  margin: 0;
}
.voucher-sheet {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: #fff;
}
.voucher-brand {
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 1rem;
}
.voucher-meta {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.voucher-meta div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.voucher-meta span { color: var(--muted-foreground); }
.voucher-lines {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  margin-bottom: 0.75rem;
}
.voucher-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}
.voucher-totals {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}
.voucher-totals div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.voucher-total-row {
  font-size: 1rem;
  padding-top: 0.35rem;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border);
}
.voucher-extras {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
}
.voucher-extras span {
  display: block;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}
.voucher-extras p { margin: 0; color: var(--foreground); }

.detail-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 900px) {
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
}
.detail-list {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}
.detail-list div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.75rem;
  font-size: 0.92rem;
}
.detail-list dt {
  margin: 0;
  color: var(--muted-foreground);
}
.detail-list dd { margin: 0; }
.text-warning { color: hsl(38 92% 40%); font-weight: 600; }
.text-success { color: hsl(142 71% 35%); font-weight: 600; }

.receipt-panel { max-width: 820px; }
.receipt-actions-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.receipt-split-preview {
  margin-bottom: 1rem;
}
