html {
  font-family: Arial, Helvetica, sans-serif;
  height: 100%;
}

body {
  margin: 0;
  background: #f7f7f7;
  color: #1f2937;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ── Top header (logo + auth only) ───────────────────── */

.app-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: #1f2937;
  color: #fff;
  flex-shrink: 0;
}

.app-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  text-decoration: none;
}

.app-logo:hover {
  color: #e5e7eb;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
}

.language-switcher-separator {
  color: #6b7280;
}

.language-switcher-link {
  color: #9ca3af;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.language-switcher-link:hover {
  color: #e5e7eb;
}

.language-switcher-link--active {
  color: #fff;
}

.header-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid #4b5563;
  border-radius: 0.25rem;
  background: #374151;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.header-btn:hover {
  background: #4b5563;
}

.header-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.header-btn-signout {
  border-color: #b91c1c;
  background: #991b1b;
}

.header-btn-signout:hover {
  background: #b91c1c;
}

.header-btn-signin {
  border-color: #2563eb;
  background: #1d4ed8;
}

.header-btn-signin:hover {
  background: #2563eb;
}

.header-user {
  font-size: 0.85rem;
  color: #d1d5db;
  text-decoration: none;
}

.header-user:hover {
  color: #fff;
  text-decoration: underline;
}

/* ── Body: anonymous = workspace only; auth = 3 columns ─ */

.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.app-body--anonymous .workspace {
  flex: 1;
  max-width: 100%;
}

.app-body--anonymous .workspace:has(.account-auth-panel) {
  align-items: center;
  justify-content: center;
}

.account-auth-panel {
  width: 100%;
  max-width: 28rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.account-auth-panel .stack-form {
  max-width: 100%;
}

.app-body--authenticated .workspace {
  flex: 1;
  min-width: 0;
}

/* ── Sidebar (authenticated only) ───────────────────── */

.sidebar {
  width: 180px;
  flex-shrink: 0;
  background: #111827;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.sidebar-link {
  display: block;
  padding: 0.65rem 1rem;
  color: #d1d5db;
  text-decoration: none;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  background: #1f2937;
  color: #fff;
}

.sidebar-link.active {
  background: #1f2937;
  color: #fff;
  border-left-color: #3b82f6;
  font-weight: 600;
}

/* ── Workspace + scenario toolbar (second header) ───── */

.workspace {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.workspace-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.35rem;
  flex-shrink: 0;
}

.toolbar-location {
  padding: 0.3rem 0.5rem;
  border-radius: 0.25rem;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #1f2937;
  min-width: 10rem;
}

.toolbar-btn {
  padding: 0.35rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  background: #f3f4f6;
  color: #1f2937;
  cursor: pointer;
  font-size: 0.85rem;
}

.toolbar-btn:hover:not(:disabled) {
  background: #e5e7eb;
}

.toolbar-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.toolbar-btn--panel {
  flex: 1;
  min-width: 0;
}

/* ── Right panel (authenticated only) ──────────────── */

.right-panel {
  width: 280px;
  flex-shrink: 0;
  background: #ffffff;
  border-left: 1px solid #d1d5db;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  color: #6b7280;
  font-size: 0.9rem;
}

.right-panel:has(.planner-draft-workspace) {
  width: 420px;
  display: none;
}

.right-panel:has(.planner-draft-workspace).is-draft-active {
  display: flex;
}

.right-panel-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.right-panel-body {
  padding: 1rem;
  flex: 1;
}

.planner-draft-workspace {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.planner-draft-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.planner-draft-field label {
  font-size: 0.85rem;
  color: #4b5563;
}

.planner-draft-field input,
.planner-draft-field select {
  width: 100%;
  box-sizing: border-box;
}

.planner-draft-guest-picker {
  gap: 0.5rem;
}

.planner-selected-guest-summary {
  margin: 0;
  font-size: 0.85rem;
  color: #374151;
}

.planner-guest-search-status {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.planner-guest-search-status[hidden] {
  display: none;
}

.planner-draft-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.planner-draft-panel-error {
  color: #b91c1c;
  margin: 0;
}

.planner-draft-panel-success {
  color: #047857;
  margin: 0;
}

.planner-draft-preview-status {
  color: #4b5563;
  font-size: 0.85rem;
  margin: 0;
}

.planner-draft-preview-status.is-error {
  color: #b91c1c;
}

.planner-draft-pricing-status {
  color: #4b5563;
  font-size: 0.85rem;
  margin: 0;
}

.reservation-error-details {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #4b5563;
}

.planner-draft-idle-hint {
  color: #6b7280;
  margin: 0;
}

.planner-draft-mode-label {
  margin: 0;
  font-size: 1rem;
}

.planner-draft-toolbar {
  flex-direction: row;
  align-items: center;
}

.planner-draft-status-badge {
  margin-left: auto;
  border-radius: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.2rem 0.45rem;
}

.planner-draft-close {
  align-self: flex-start;
}

/* ── Guests list filter ─────────────────────────────── */

.guests-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: 1rem;
  row-gap: 0.75rem;
}

.guests-filter-field {
  box-sizing: border-box;
  width: 11rem;
  max-width: 100%;
  flex: 0 0 auto;
}

.guests-filter-field--email {
  width: 12rem;
}

.guests-filter-field label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
}

.guests-filter-field input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #f9fafb;
  font-size: 0.875rem;
  color: #111827;
}

.guests-filter-field input:focus {
  border-color: #3b82f6;
  outline: 2px solid #3b82f6;
  outline-offset: 0;
}

.guests-filter-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  column-gap: 0.75rem;
}

/* ── Reusable page-level styles ─────────────────────── */

.page-shell {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

h1 {
  margin-top: 0;
}

.muted {
  color: #6b7280;
  font-size: 0.9rem;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 22rem;
}

.stack-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stack-form input[type="text"],
.stack-form input[type="password"] {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 0.35rem;
  box-sizing: border-box;
}

.stack-form button {
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.35rem;
  border: 1px solid #1f2937;
  background: #1f2937;
  color: #fff;
  cursor: pointer;
}

.inline-form {
  display: inline;
}

.field-validation-error {
  color: #b91c1c;
  font-size: 0.95rem;
}

.tariff-version-fields {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
}

.tariff-version-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-sizing: border-box;
}

.tariff-version-field + .tariff-version-field {
  margin-left: 0.75rem;
}

.tariff-version-field--date {
  flex: 0 0 9rem;
  width: 9rem;
}

.tariff-version-field--number {
  flex: 0 0 4.75rem;
  width: 4.75rem;
}

.tariff-version-caption {
  display: block;
  margin-bottom: 0.25rem;
  color: #6b7280;
  font-size: 0.58rem;
  font-weight: 500;
  line-height: 1;
}

.tariff-version-field input {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tariff-version-action-button {
  display: inline-flex;
  width: 7rem;
  height: 2.125rem;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

.tariff-version-action-button--primary {
  border: 1px solid #1a56db;
  background: #1c64f2;
  color: #ffffff;
}

.tariff-version-action-button--primary:hover {
  background: #3f83f8;
}

.tariff-version-action-button--secondary {
  border: 1px solid #374151;
  background: #1f2937;
  color: #e5e7eb;
}

.tariff-version-action-button--secondary:hover {
  background: #374151;
}

.tariff-version-action-button--danger {
  border: 1px solid #c81e1e;
  background: #450a0a;
  color: #ffffff;
}

.tariff-version-action-button--danger:hover {
  background: #7f1d1d;
}

.login-hint {
  color: #4b5563;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.reservation-guest-search-dialog[hidden] {
  display: none;
}

.reservation-guest-search-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(17, 24, 39, 0.42);
}

.reservation-guest-search-dialog-panel {
  width: min(620px, 100%);
  max-height: min(720px, 90vh);
  overflow: auto;
  box-sizing: border-box;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  box-shadow: 0 20px 45px rgba(17, 24, 39, 0.18);
}

.reservation-guest-search-dialog-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.reservation-guest-search-dialog-panel input[type="search"] {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
}

.reservation-guest-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0;
  margin: 0.75rem 0;
  list-style: none;
}

.reservation-guest-search-result {
  width: 100%;
  text-align: left;
}

.reservation-guest-search-result.is-selected {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.reservation-guest-search-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Dashboard */

.dashboard-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dashboard-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dashboard-heading h1,
.dashboard-public h1 {
  margin: 0;
  color: #111827;
  font-size: 1.65rem;
  line-height: 1.2;
}

.dashboard-eyebrow {
  margin: 0 0 0.25rem;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dashboard-plan {
  min-width: 9rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #dbe4f0;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dashboard-plan span,
.dashboard-kpi span,
.dashboard-progress-list span {
  display: block;
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 600;
}

.dashboard-plan strong {
  display: block;
  margin-top: 0.15rem;
  color: #111827;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.dashboard-kpi,
.dashboard-panel {
  border: 1px solid #dbe4f0;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.dashboard-kpi {
  min-height: 5.25rem;
  padding: 0.9rem;
  border-top: 3px solid #2563eb;
}

.dashboard-kpi--attention {
  border-top-color: #d97706;
}

.dashboard-kpi strong {
  display: block;
  margin-top: 0.25rem;
  color: #111827;
  font-size: 1.35rem;
  line-height: 1.15;
}

.dashboard-kpi small {
  display: block;
  margin-top: 0.25rem;
  color: #6b7280;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  gap: 0.9rem;
  align-items: start;
}

.dashboard-grid--setup {
  grid-template-columns: minmax(0, 1fr) 20rem;
}

.dashboard-side-stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.dashboard-panel {
  padding: 1rem;
}

.dashboard-panel--primary {
  min-height: 18rem;
}

.dashboard-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.dashboard-panel-header--compact {
  margin-bottom: 0.65rem;
}

.dashboard-panel h2,
.dashboard-panel-header h2 {
  margin: 0;
  color: #111827;
  font-size: 1rem;
  line-height: 1.25;
}

.dashboard-panel p,
.dashboard-panel-header p {
  margin: 0.25rem 0 0;
  color: #6b7280;
  font-size: 0.86rem;
}

.dashboard-panel-header a,
.dashboard-checklist a,
.dashboard-empty a {
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.dashboard-panel-header a:hover,
.dashboard-checklist a:hover,
.dashboard-empty a:hover {
  text-decoration: underline;
}

.dashboard-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dashboard-checklist li {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #f9fafb;
}

.dashboard-checklist li.is-complete {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.dashboard-checkmark {
  display: inline-flex;
  width: 1.45rem;
  height: 1.45rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #047857;
  font-size: 0.85rem;
  font-weight: 800;
}

.dashboard-checklist strong,
.dashboard-empty strong {
  color: #111827;
  font-size: 0.92rem;
}

.dashboard-checklist p {
  margin: 0.15rem 0 0;
  color: #6b7280;
  font-size: 0.82rem;
}

.dashboard-progress-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.dashboard-progress-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid #eef2f7;
}

.dashboard-progress-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.dashboard-progress-list strong {
  color: #111827;
  font-size: 0.9rem;
}

.dashboard-reservation-list,
.dashboard-attention-list,
.dashboard-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dashboard-reservation,
.dashboard-attention {
  color: inherit;
  text-decoration: none;
}

.dashboard-reservation {
  display: grid;
  grid-template-columns: 8.25rem minmax(0, 1fr) 7.5rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #ffffff;
}

.dashboard-reservation:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.dashboard-reservation-time strong,
.dashboard-reservation-main strong,
.dashboard-reservation-meta strong {
  display: block;
  color: #111827;
  font-size: 0.9rem;
}

.dashboard-reservation-time span,
.dashboard-reservation-main span {
  display: block;
  margin-top: 0.15rem;
  color: #6b7280;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-reservation-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.dashboard-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
}

.dashboard-status--tentative {
  background: #fef3c7;
  color: #92400e;
}

.dashboard-status--definite {
  background: #dcfce7;
  color: #166534;
}

.dashboard-attention {
  display: grid;
  grid-template-columns: 0.45rem minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background: #ffffff;
}

.dashboard-attention > span {
  width: 0.45rem;
  min-height: 100%;
  border-radius: 999px;
  background: #2563eb;
}

.dashboard-attention--warning > span {
  background: #d97706;
}

.dashboard-attention--critical > span {
  background: #dc2626;
}

.dashboard-attention strong {
  color: #111827;
  font-size: 0.88rem;
}

.dashboard-attention p {
  margin: 0.2rem 0 0;
  color: #6b7280;
  font-size: 0.78rem;
}

.dashboard-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.dashboard-action:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.dashboard-action--primary {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.dashboard-action--primary:hover {
  background: #1d4ed8;
  color: #ffffff;
}

.dashboard-empty {
  padding: 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 0.5rem;
  background: #f8fafc;
}

.dashboard-empty--small {
  padding: 0.85rem;
}

.dashboard-empty p {
  margin: 0.3rem 0 0.75rem;
  color: #6b7280;
  font-size: 0.86rem;
}

.dashboard-public {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 56rem;
  margin: 4rem auto 0;
  padding: 2rem;
  border: 1px solid #dbe4f0;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.dashboard-public p {
  max-width: 38rem;
  color: #4b5563;
}

.dashboard-public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

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

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

  .dashboard-reservation {
    grid-template-columns: 7rem minmax(0, 1fr);
  }

  .dashboard-reservation-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 760px) {
  .dashboard-heading,
  .dashboard-public {
    flex-direction: column;
    align-items: stretch;
  }

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

  .dashboard-checklist li,
  .dashboard-reservation {
    grid-template-columns: 1fr;
  }

  .dashboard-checkmark {
    display: none;
  }
}
