:root {
  --bg: #eef0f4;
  --surface: #ffffff;
  --sidebar: #1a2332;
  --sidebar-border: #2a3544;
  --sidebar-text: #9aa5b4;
  --sidebar-active-bg: rgba(201, 0, 43, 0.22);
  --sidebar-active-text: #ff7089;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --text: #1a2332;
  --text-muted: #6b7280;
  --border: #e2e6ec;
  --primary: #c9002b;
  --primary-hover: #a80024;
  --primary-soft: #fdeaee;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #059669;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(26, 35, 50, 0.06);
  --font: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}

.hidden { display: none !important; }

/* —— Brand wordmark —— */
.brand-wordmark {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.brand-wordmark.sm { font-size: 1.25rem; }

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.brand-mark.sm { width: 8px; height: 8px; }

.brand-text strong {
  display: block;
  color: #fff;
  font-size: 0.85rem;
  line-height: 1.2;
}

/* Masked like a password field, but not one a password manager offers to keep. */
.secret-input {
  -webkit-text-security: disc;
}

/* —— Login (weekly Cyprus full-bleed backdrop + centered card) —— */
.login-screen {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3.5rem;
  overflow: hidden;
  background: #1a2332;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.login-backdrop-image {
  position: absolute;
  inset: -3%;
  background-color: #1a2332;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 0.9s ease;
  animation: login-kenburns 28s ease-in-out infinite alternate;
}

.login-backdrop-image.is-ready {
  opacity: 1;
  filter: brightness(1.18) saturate(1.08);
}

.login-backdrop-image.is-fallback {
  background-image: none !important;
  background: linear-gradient(145deg, #0f766e 0%, #1a2332 48%, #0c4a6e 100%);
  animation: none;
  transform: none;
  filter: none;
}

.login-backdrop-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(15, 23, 32, 0.1) 0%, rgba(15, 23, 32, 0.18) 42%, rgba(15, 23, 32, 0.36) 100%),
    radial-gradient(ellipse 75% 60% at 50% 40%, rgba(15, 23, 32, 0.02), rgba(15, 23, 32, 0.22));
}

.login-center {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  animation: login-card-in 0.65s ease both;
}

.login-card {
  position: relative;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 14px;
  padding: 2rem 2.25rem;
  box-shadow: 0 18px 50px rgba(10, 18, 28, 0.32);
  backdrop-filter: blur(24px) saturate(1.1);
  -webkit-backdrop-filter: blur(24px) saturate(1.1);
}

/* Without the blur behind it, a translucent card leaves the text on bare photo. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .login-card {
    background: rgba(255, 255, 255, 0.93);
  }
}

.login-backdrop-caption {
  position: absolute;
  z-index: 1;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1rem;
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  animation: login-caption-in 1s ease 0.25s both;
  pointer-events: none;
}

@keyframes login-kenburns {
  from { transform: scale(1.06); }
  to { transform: scale(1.12); }
}

@keyframes login-card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes login-caption-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .login-backdrop-image,
  .login-center,
  .login-backdrop-caption {
    animation: none;
    transition: opacity 0.3s ease;
  }
  .login-backdrop-image {
    transform: none;
  }
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

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

.login-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.login-lead {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.login-server-hint {
  color: var(--warning);
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius);
  background: #fffbeb;
  border: 1px solid #fde68a;
  line-height: 1.45;
}

.login-server-hint code {
  font-size: 0.8rem;
}

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin: 0;
}

.login-cmc-step {
  margin-top: 0.5rem;
}

.login-cmc-title {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.cmc-code-input {
  font-size: 1.35rem;
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cmc-demo-hint {
  margin: 0.75rem 0;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(201, 0, 43, 0.08);
  border: 1px solid rgba(201, 0, 43, 0.18);
  color: var(--text);
  font-size: 0.875rem;
}

.cmc-demo-hint strong {
  font-size: 1.05rem;
  letter-spacing: 0.12em;
}

.cmc-confirm-body .cmc-code-input {
  width: 100%;
}

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

.demo-users p { margin: 0 0 0.75rem; font-size: 0.75rem; color: var(--text-muted); }

.demo-user-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.demo-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.demo-user-chip:hover { border-color: var(--primary); background: var(--primary-soft); }

.btn-block { width: 100%; justify-content: center; }

/* —— App shell —— */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0.75rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 0.5rem;
}

.brand-sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--sidebar-text);
  margin-top: 0.1rem;
}

.nav { flex: 1; }

.nav-section { margin-bottom: 1rem; }

.nav-section-label {
  display: block;
  padding: 0.5rem 0.85rem 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7a8c;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  text-align: left;
  border-left: 3px solid transparent;
}

.nav-btn:hover:not(:disabled) { background: var(--sidebar-hover); color: #e8edf3; }
.nav-btn.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left-color: var(--primary);
  font-weight: 600;
}
.nav-btn.disabled, .nav-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-svg { width: 18px; height: 18px; }

.nav-btn-footer {
  color: var(--sidebar-text) !important;
  font-size: 0.75rem !important;
}
.nav-btn-footer:hover { color: #fff !important; }

.sidebar-footer {
  padding: 0.5rem;
  border-top: 1px solid var(--sidebar-border);
  margin-top: 0.5rem;
}

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 52px;
}

.topbar-left { min-width: 140px; }
.topbar-center { flex: 1; max-width: 420px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
}
.crumb-muted { color: var(--text-muted); }
.crumb-sep { color: #cbd5e1; }
.crumb-current { font-weight: 600; color: var(--text); }

.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
}
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.page-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-toolbar-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.toolbar-spacer { flex: 1; }

.compact-tabs .view-tab {
  border-radius: 4px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8125rem;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.toolbar-search {
  max-width: 220px;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
  font-size: 0.8125rem;
}

.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th-sortable:hover { color: var(--accent); }
.th-sortable.sorted { color: var(--accent); font-weight: 600; }
.sort-indicator { font-size: 0.75em; opacity: 0.85; }

.ranking-sort-card {
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ranking-sort-card:hover {
  border-color: var(--accent);
}
.ranking-sort-card.is-sorted {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.ranking-sort-card.is-sorted .label {
  color: var(--accent);
  font-weight: 600;
}
.reservation-list-toolbar-compact .toolbar-search { max-width: 180px; }
.reservation-list-toolbar .toolbar-select { min-width: 9rem; }

.toolbar-select {
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font: inherit;
  font-size: 0.8125rem;
  background: white;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-wrap input {
  width: 100%;
  padding: 0.5rem 0.85rem 0.5rem 2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  background: var(--bg);
}

.search-wrap input:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.service-line-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--surface-muted, #f8fafc);
}

.service-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.subnav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.subnav-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.view-tabs { display: flex; gap: 0.25rem; }

.view-tab {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
}

.view-tab.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.view-tab:disabled { opacity: 0.45; cursor: not-allowed; }

.users-view-tabs { margin: 0 0 1rem; }

.balances-view-tabs { margin: 0 0 1rem; }

.credentials-table .cred-password-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.credentials-table .cred-password-input {
  min-width: 10rem;
  max-width: 16rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
}

.credentials-table .cred-login {
  font-size: 0.85rem;
  margin-right: 0.35rem;
}

.login-lock-alert {
  border-color: color-mix(in srgb, var(--danger, #c0392b) 35%, var(--border));
  background: color-mix(in srgb, var(--danger, #c0392b) 8%, var(--surface));
}

.login-lock-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.login-lock-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.login-lock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.row-login-locked {
  background: color-mix(in srgb, var(--danger, #c0392b) 6%, transparent);
}

.content { padding: 1.25rem; flex: 1; }

/* —— User menu —— */
.user-menu { position: relative; }

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  z-index: 50;
}

.user-dropdown-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.user-dropdown-head span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 0.65rem 1rem;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dropdown-item:hover { background: var(--bg); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 0.75rem; }
.avatar.xs { width: 22px; height: 22px; font-size: 0.65rem; }

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* —— Dashboard —— */
.dash-header { margin-bottom: 1.25rem; }
.dash-header h1 { margin: 0; font-size: 1.35rem; }
.dash-header p { margin: 0.35rem 0 0; color: var(--text-muted); }

.dash-stat-shell {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.dash-stat-folders {
  position: sticky;
  top: 0.75rem;
  overflow: hidden;
}

.dash-stat-folder-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-stat-folder-icon {
  display: inline-flex;
  color: var(--primary);
}

.dash-stat-folder-icon .nav-svg {
  width: 1rem;
  height: 1rem;
}

.dash-stat-folder-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.5rem;
}

.dash-folder-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.dash-folder-btn:hover {
  background: var(--bg);
}

.dash-folder-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.dash-folder-item-icon {
  display: inline-flex;
  flex-shrink: 0;
  opacity: 0.85;
}

.dash-folder-item-icon .nav-svg {
  width: 1rem;
  height: 1rem;
}

.dash-folder-label {
  line-height: 1.25;
}

.dash-stat-main {
  min-width: 0;
}

@media (max-width: 900px) {
  .dash-stat-shell {
    grid-template-columns: 1fr;
  }

  .dash-stat-folders {
    position: static;
  }

  .dash-stat-folder-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .dash-folder-btn {
    width: auto;
    flex: 1 1 auto;
  }
}

.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.task-item:last-child { border-bottom: none; }

.task-check { color: var(--text-muted); }

.task-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.task-item.priority-high .badge { background: #fee2e2; color: var(--danger); }

/* —— Typography & layout —— */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-header h1 { margin: 0; font-size: 1.35rem; }
.page-header p { margin: 0.35rem 0 0; color: var(--text-muted); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--bg); }

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

.sidebar .btn-ghost {
  color: var(--sidebar-text);
  border-color: var(--sidebar-border);
}
.sidebar .btn-ghost:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.btn-danger {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}

.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.stat-card.accent { border-color: #fecaca; background: var(--primary-soft); }

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

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.sales-dashboard { margin-bottom: 1.25rem; }

.sales-kpi { margin-bottom: 0; }

.sales-charts {
  margin-top: 1.5rem;
  gap: 1.5rem;
}

.chart-title {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bar-chart-days {
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 2rem 1fr 4.5rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.bar-row.is-today .bar-label { color: var(--primary); font-weight: 700; }
.bar-row.is-today .bar-fill { background: var(--primary); }

.bar-label {
  color: var(--text-muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.3s ease;
}

.bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-size: 0.72rem;
}

.pl-chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.pl-chart-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.pl-chart-block {
  min-width: 0;
}

.pl-chart-block .chart-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.pl-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pl-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pl-chart-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.pl-chart-swatch-line {
  width: 14px;
  height: 3px;
  border-radius: 2px;
}

.pl-chart-swatch-dashed {
  background: transparent !important;
  border-top: 2px dashed;
  height: 0;
  width: 14px;
  margin-top: 2px;
}

.pl-chart-wrap {
  width: 100%;
}

.pl-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.pl-chart-grid {
  stroke: var(--border);
  stroke-width: 1;
}

.pl-chart-zero {
  stroke: var(--text-muted);
  stroke-width: 1.5;
  opacity: 0.7;
}

.pl-chart-y-label,
.pl-chart-x-label {
  fill: var(--text-muted);
  font-size: 10px;
}

.pl-chart-x-label.is-current {
  fill: var(--text);
  font-weight: 700;
}

.pl-chart-point-label {
  fill: var(--text);
  font-size: 10px;
  font-weight: 600;
  /* Halo so a value stays readable where it crosses a column. */
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.pl-chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.pl-chart-line-margin {
  stroke: #2a78d6;
}

.pl-chart-line-expense {
  stroke: #eb6834;
  stroke-dasharray: 6 4;
}

.pl-chart-line-profit {
  stroke: #008300;
  stroke-width: 2.5;
}

.pl-chart-band {
  stroke: none;
}

.pl-chart-connector {
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.6;
}

.pl-chart-hit {
  fill: transparent;
}

.pl-chart-hit:hover {
  fill: var(--text);
  fill-opacity: 0.04;
}

.pl-chart-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0.5rem 0 0;
}

.pl-monthly-chart {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.pl-monthly-chart .chart-title {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.pl-monthly-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pl-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.pl-legend-profit .pl-legend-swatch {
  background: #16a34a;
}

.pl-legend-expense .pl-legend-swatch {
  background: #dc2626;
}

.pl-monthly-columns-wrap {
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.pl-monthly-columns {
  display: grid;
  grid-template-columns: repeat(12, minmax(3.75rem, 1fr));
  gap: 0.65rem;
  align-items: stretch;
  height: 280px;
  min-width: 54rem;
  padding-top: 0.5rem;
}

.pl-month-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 0;
}

.pl-month-col.is-future .pl-month-label {
  opacity: 0.45;
}

.pl-month-chart {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.pl-month-zone-up {
  flex: var(--pl-up-flex, 1) 1 0;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.pl-month-zone-down {
  flex: var(--pl-down-flex, 0) 1 0;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.pl-month-axis {
  flex-shrink: 0;
  height: 2px;
  background: var(--text-muted);
  opacity: 0.45;
  width: 100%;
}

.pl-month-axis-bottom {
  margin-top: auto;
}

.pl-month-bar-group {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 100%;
  width: 100%;
}

.pl-month-zone-down .pl-month-bar-group {
  align-items: flex-start;
}

.pl-bar {
  width: 46%;
  max-width: 26px;
  min-height: 2px;
  transition: height 0.3s ease;
}

.pl-bar-profit {
  background: #16a34a;
  border-radius: 4px 4px 0 0;
}

.pl-bar-profit.is-below {
  border-radius: 0 0 4px 4px;
}

.pl-bar-expense {
  background: #dc2626;
  border-radius: 4px 4px 0 0;
}

.pl-month-col.is-current .pl-month-label {
  color: var(--primary);
  font-weight: 700;
}

.pl-month-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  text-align: center;
  line-height: 1.1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-header {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.9rem;
}

.card-body { padding: 1.15rem; }

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

.data-table, table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th, table th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.data-table td, table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td, table tr:hover td { background: #fafbfc; }
.data-table .num-col,
.data-table .num-cell {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.row-self td { background: var(--primary-soft); }

.data-table tr.row-inactive td { opacity: 0.55; }

.data-table tr.row-duplicate-reservation td {
  background: #dbeafe;
}

.data-table tr.row-duplicate-reservation:hover td {
  background: #bfdbfe;
}

/* Status colors — all reservation lists, all roles */
.data-table tr.row-status-new td {
  background: #ffffff;
}

.data-table tr.row-status-new:hover td {
  background: #f8fafc;
}

.data-table tr.row-status-received td {
  background: #fef3c7;
}

.data-table tr.row-status-received:hover td {
  background: #fde68a;
}

.data-table tr.row-status-sent td {
  background: #bae6fd;
}

.data-table tr.row-status-sent:hover td {
  background: #7dd3fc;
}

.data-table tr.row-status-confirmed td {
  background: #dcfce7;
}

.data-table tr.row-status-confirmed:hover td {
  background: #bbf7d0;
}

.data-table tr.row-status-fully-paid td {
  background: #22c55e;
  color: #052e16;
}

.data-table tr.row-status-fully-paid:hover td {
  background: #16a34a;
  color: #052e16;
}

.data-table tr.row-status-cancelled td,
.data-table tr.row-cancelled-reservation td {
  background: #fee2e2;
  color: #991b1b;
}

.data-table tr.row-status-cancelled:hover td,
.data-table tr.row-cancelled-reservation:hover td {
  background: #fecaca;
}

.data-table tr.row-status-cancelled.row-duplicate-reservation td,
.data-table tr.row-cancelled-reservation.row-duplicate-reservation td {
  background: #fecaca;
}

.data-table tr.row-status-fully-paid.row-duplicate-reservation td {
  background: #16a34a;
}

.data-table tr.row-status-confirmed.row-duplicate-reservation td {
  background: #bbf7d0;
}

.data-table tr.row-status-sent.row-duplicate-reservation td {
  background: #7dd3fc;
}

.data-table tr.row-status-received.row-duplicate-reservation td {
  background: #fde68a;
}

/* Legacy accountant review tints — kept as subtle markers on top of status */
.data-table tr.row-new-reservation td {
  background: #e0f2fe;
}

.data-table tr.row-new-reservation:hover td {
  background: #bae6fd;
}

.data-table tr.row-viewed-reservation td {
  background: #dcfce7;
}

.data-table tr.row-viewed-reservation:hover td {
  background: #bbf7d0;
}

.data-table tr.row-new-reservation.row-duplicate-reservation td {
  background: #dbeafe;
}

.data-table tr.row-viewed-reservation.row-duplicate-reservation td {
  background: #d9f99d;
}

.data-table tr.row-accountant-viewed td {
  box-shadow: inset 3px 0 0 #047857;
}

/* Accountant invoices — unviewed = blue, opened = soft green */
.data-table tr.row-invoice-unviewed td,
.accountant-invoices-table tr.row-invoice-unviewed td {
  background: #e0f2fe;
}

.data-table tr.row-invoice-unviewed:hover td,
.accountant-invoices-table tr.row-invoice-unviewed:hover td {
  background: #bae6fd;
}

.data-table tr.row-invoice-viewed td,
.accountant-invoices-table tr.row-invoice-viewed td {
  background: #f0fdf4;
}

.data-table tr.row-invoice-viewed:hover td,
.accountant-invoices-table tr.row-invoice-viewed:hover td {
  background: #dcfce7;
}

.accountant-reservation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.accountant-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.accountant-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.accountant-legend-swatch-new,
.accountant-legend-swatch-status-sent {
  background: #bae6fd;
}

.accountant-legend-swatch-viewed,
.accountant-legend-swatch-status-confirmed {
  background: #dcfce7;
}

.accountant-legend-swatch-status-new {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.2);
}

.accountant-legend-swatch-status-received {
  background: #fef3c7;
}

.accountant-legend-swatch-status-fully-paid {
  background: #22c55e;
}

.accountant-legend-swatch-status-cancelled {
  background: #fee2e2;
}

.pipeline-card.pipeline-card-cancelled,
.pipeline-card.row-status-cancelled {
  border-color: #f87171;
  background: #fef2f2;
}

.pipeline-card.row-status-new {
  background: #ffffff;
  border-color: #e2e8f0;
}

.pipeline-card.row-status-received {
  background: #fef3c7;
  border-color: #fcd34d;
}

.pipeline-card.row-status-sent {
  background: #bae6fd;
  border-color: #38bdf8;
}

.pipeline-card.row-status-confirmed {
  background: #dcfce7;
  border-color: #86efac;
}

.pipeline-card.row-status-fully-paid {
  background: #22c55e;
  border-color: #16a34a;
  color: #052e16;
}

.pipeline-card.row-status-fully-paid .pipeline-card-meta {
  color: #14532d;
}

.pipeline-card.pipeline-card-duplicate {
  border-color: #60a5fa;
  background: #eff6ff;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-draft { background: #f3f4f6; color: #4b5563; }
.badge-sent { background: #dbeafe; color: #1d4ed8; }
.badge-accepted { background: var(--primary-soft); color: var(--primary); }
.badge-paid { background: #d1fae5; color: var(--success); }
.badge-overdue { background: #fee2e2; color: var(--danger); }
.badge-planning { background: #fef3c7; color: #b45309; }
.badge-new { background: #fce7f3; color: #be185d; }
.badge-received { background: #e0e7ff; color: #4338ca; }
/* A cost that came back: neither paid nor owed, just undone. */
.badge-neutral { background: #e5e7eb; color: #374151; }
.badge-confirmed { background: #d1fae5; color: var(--success); }
.badge-fully_paid { background: #bbf7d0; color: #047857; font-weight: 600; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }

.trip-status-select {
  min-width: 7.5rem;
  max-width: 100%;
  font-size: 0.8125rem;
  padding: 0.2rem 0.35rem;
}

.data-table td .trip-status-select {
  width: 100%;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.split {
  display: grid;
  /* minmax(0, …) and min-width let a wide table shrink inside its own half.
     With plain 1fr the column grows to the table's natural width, and the two
     cards spill past the page instead of the table wrapping or scrolling. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}
.split > * { min-width: 0; }

.form { display: flex; flex-direction: column; gap: 0.85rem; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* `display: grid` outranks the hidden attribute, which would otherwise show. */
.form-row[hidden] {
  display: none;
}

.form label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
}

/* A tickbox belongs beside the words it answers: the block label above would
   stretch it across the row and leave the text on its own. */
.form label.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form label.checkbox-label input[type="checkbox"] {
  width: auto;
  flex: none;
  margin: 0;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.timeline li:last-child { border-bottom: none; }
.timeline time {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Permissions page */
.role-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border: 1px solid;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.demo-pw {
  font-size: 0.8rem;
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.access-tags { font-size: 0.8rem; color: var(--text-muted); }

.perm-card .card-body { padding: 0.85rem; }
.perm-grid { display: flex; flex-direction: column; gap: 0.65rem; }
.perm-group strong {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.perm-chip {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  margin: 0.1rem;
}
.perm-chip.yes { background: #d1fae5; color: var(--success); }
.perm-chip.no { background: #f3f4f6; color: #9ca3af; }

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

/* Itinerary */
.itinerary-days { display: flex; flex-direction: column; gap: 0.85rem; }
.day-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafbfc;
}
.day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.activity-list { padding: 0.5rem; }
.activity-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.45rem;
}
.activity-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
}
.activity-title { font-weight: 600; font-size: 0.875rem; }
.activity-meta { font-size: 0.78rem; color: var(--text-muted); }

.line-items { margin-top: 0.85rem; }
.line-item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.totals {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  max-width: 280px;
  margin-left: auto;
}
.totals .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}
.totals .grand {
  font-weight: 700;
  font-size: 1.05rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.invoice-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.invoice-export-note {
  margin: -0.5rem 0 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.invoice-terms,
.invoice-notes {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.invoice-meta {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Instalments of the booking payment plan — invoice form preview and detail. */
.invoice-plan-preview {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
}

.invoice-plan-preview li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: baseline;
  padding-bottom: 0.15rem;
  border-bottom: 1px dotted var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.invoice-plan-preview strong {
  color: var(--text);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 43, 60, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: var(--surface);
  border-radius: 10px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: auto;
}

.modal-wide { max-width: 720px; }
.modal-voucher {
  max-width: min(1120px, calc(100vw - 2rem));
  width: 100%;
}
.voucher-editor {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.15fr);
  gap: 1rem;
  align-items: start;
  max-height: min(78vh, 820px);
}
.voucher-editor-form {
  overflow: auto;
  max-height: min(78vh, 820px);
  padding-right: 0.35rem;
}
.voucher-editor-form .input-readonly,
.voucher-editor-form input[readonly],
.voucher-editor-form textarea[readonly] {
  background: #f1f5f9;
  color: #334155;
  cursor: default;
}
.voucher-stay-fields {
  border: 0;
  padding: 0;
  margin: 0;
}
.voucher-stay-fields > legend {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #475569;
  padding: 0.6rem 0 0.15rem;
}
.voucher-stay-fields + .voucher-stay-fields > legend {
  border-top: 1px solid #e2e8f0;
  width: 100%;
  margin-top: 0.35rem;
}
.voucher-editor-preview {
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  overflow: hidden;
  max-height: min(78vh, 820px);
  min-height: 420px;
  padding: 0;
}
.voucher-preview-scroll {
  height: 100%;
  min-height: 420px;
}
.voucher-preview-frame {
  width: 100%;
  height: min(78vh, 820px);
  min-height: 420px;
  border: 0;
  background: #fff;
}
@media (max-width: 900px) {
  .voucher-editor {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .voucher-editor-form,
  .voucher-editor-preview {
    max-height: 50vh;
  }
  .voucher-preview-frame {
    height: 50vh;
    min-height: 280px;
  }
}

.modal-header {
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.modal-body { padding: 1.35rem; }
.modal-footer {
  padding: 0.85rem 1.35rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 4px;
  max-height: 300px;
  overflow: auto;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.search-result-item {
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.search-result-item:hover { background: var(--bg); }
.search-result-item small {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 0.75rem;
  align-items: start;
}

.pipeline-col {
  background: #eef0f4;
  border-radius: var(--radius);
  min-height: 320px;
}

.pipeline-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.pipeline-count {
  background: var(--surface);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
}

.pipeline-cards {
  padding: 0 0.5rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pipeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.pipeline-card:hover { border-color: var(--primary); }
.pipeline-card strong { display: block; font-size: 0.875rem; margin-bottom: 0.35rem; }
.pipeline-card-meta { display: block; font-size: 0.75rem; color: var(--text-muted); }

.pipeline-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
  margin: 0;
}

@media (max-width: 900px) {
  .pipeline-board { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .split { grid-template-columns: 1fr; }
  .topbar-center { display: none; }
  .pipeline-board { grid-template-columns: 1fr; }
}

/* Department nav */
.nav-section-label.dept-production { color: #e8956f; }
.nav-section-label.dept-sales { color: #7eb8da; }
.nav-section-label.dept-operations { color: #8bc9a0; }
.nav-section-label.dept-finance { color: #c9b87a; }
.nav-section-label.dept-admin { color: #9aa8b8; }
.nav-section-label.dept-default { color: var(--text-muted); }

.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.dept-card .card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dept-card .nav-section-label {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}

.dept-period-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.dept-period-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.5rem 0.75rem;
}

.dept-period-custom.hidden {
  display: none;
}

.dept-period-date {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dept-period-date input[type="date"] {
  min-width: 9.5rem;
}

.dept-period-label {
  margin-left: auto;
}

.ranking-panels .ranking-table td small.text-muted {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
}

.ranking-table tbody tr:first-child .rank-badge {
  background: rgba(201, 0, 43, 0.16);
  color: var(--primary);
}

.hotel-stats-table tfoot td {
  border-top: 2px solid var(--border);
  background: var(--bg);
}

.hotel-stats-total-row td {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

/* A brand heading over the hotels it belongs to. */
.hotel-stats-network-row td {
  background: var(--surface-muted, rgba(148, 163, 184, 0.12));
}

.hotel-stats-network-indent {
  display: inline-block;
  width: 1.1rem;
}

.hotel-stat-totals {
  margin-bottom: 0;
}

.top-ranking-period {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.top-ranking-period-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.top-ranking-period-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}

.top-ranking-period-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.top-ranking-period-field .toolbar-select,
.top-ranking-period-field input[type="date"] {
  min-width: 8.5rem;
  font-weight: 500;
  color: var(--text);
}

.top-ranking-period-hint {
  margin: 0;
}

.stats-zero-row td {
  color: var(--text-muted);
}

.stats-zero-row .rank-badge {
  opacity: 0.55;
}

.nav-btn {
  justify-content: flex-start;
}

.nav-label { flex: 1; min-width: 0; }

.nav-badge {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.35rem;
  border-radius: 3px;
  background: rgba(201, 0, 43, 0.3);
  color: #ff8098;
  flex-shrink: 0;
}

/* Module shells */
.module-intro h2 {
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
}

.module-intro p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}

.module-placeholder .card-body { padding: 1.25rem 1.5rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.feature-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.feature-tile strong { font-size: 0.8125rem; }
.feature-tile span { font-size: 0.75rem; color: var(--text-muted); }

.list-card .list-toolbar { border-bottom: 1px solid var(--border); }

.timeline-full li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.activity-type { font-size: 0.65rem; text-transform: uppercase; }

.task-toggle {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  color: var(--primary);
  padding: 0;
  width: 1.5rem;
}

.task-toggle:disabled { opacity: 0.4; cursor: default; }

.row-muted { opacity: 0.55; }

.text-success { color: #059669; font-weight: 600; }
.text-danger { color: #dc2626; font-weight: 600; }

.card-header .link-btn {
  float: right;
  font-size: 0.75rem;
  font-weight: 500;
}

.readonly-form input:disabled {
  background: var(--bg);
  color: var(--text-muted);
}

.contact-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.8125rem;
}

.contact-link:hover { text-decoration: underline; }

.row-actions {
  white-space: nowrap;
  text-align: right;
}

.row-actions .link-btn + .link-btn { margin-left: 0.5rem; }

/* Partner cabinet */
.partner-body { background: #1a2332; min-height: 100vh; }

.partner-app { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

.partner-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.partner-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.partner-topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.partner-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.partner-user {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.partner-main {
  flex: 1;
  padding: 1.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Partner search: form and offers on the left, the client shortlist on the right. */
.partner-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1rem;
  align-items: start;
}

.partner-search-main { display: grid; gap: 1rem; min-width: 0; }

.partner-search-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.partner-search-check {
  grid-column: 1 / span 3;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.partner-search-check input { width: auto; }
.partner-search-submit { display: flex; justify-content: flex-end; }

.partner-offers { display: grid; gap: 0.6rem; }

.partner-offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 10px);
}

.partner-offer.added { border-color: var(--primary, #2563eb); }
.partner-offer-main { display: grid; gap: 0.25rem; min-width: 0; }
.partner-offer-stars { color: #d97706; letter-spacing: 1px; }
.partner-offer-room { font-size: 0.875rem; }
.partner-offer-meta { font-size: 0.8rem; color: var(--text-muted); }
.partner-offer-price { display: grid; text-align: right; gap: 0.1rem; }
.partner-offer-price strong { font-size: 1.1rem; }
.partner-offer-price small { font-size: 0.78rem; color: var(--text-muted); }
.partner-offer-price .partner-offer-gain { color: #15803d; }
.partner-offer-actions { display: grid; gap: 0.4rem; }

.partner-avail {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #e0f2fe;
  color: #0369a1;
}

.partner-avail-stop { background: #fef3c7; color: #b45309; }
.partner-avail-closed { background: #fee2e2; color: #b91c1c; }

.partner-shortlist { position: sticky; top: 1rem; }
.partner-shortlist-list { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.5rem; }

.partner-shortlist-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.partner-shortlist-list small { display: block; color: var(--text-muted); }

.partner-shortlist-sum {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.partner-shortlist-text {
  width: 100%;
  min-height: 160px;
  margin-bottom: 0.5rem;
  font: inherit;
  font-size: 0.8rem;
  box-sizing: border-box;
}

.partner-guest-row { display: grid; grid-template-columns: 2fr 1fr; gap: 0.75rem; }
.partner-pay-option { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
.partner-pay-option input { width: auto; }

@media (max-width: 900px) {
  .partner-search { grid-template-columns: 1fr; }
  .partner-search-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .partner-search-check { grid-column: 1 / -1; }
  .partner-offer { grid-template-columns: 1fr; }
  .partner-offer-price { text-align: left; }
  .partner-shortlist { position: static; }
  .partner-topbar { flex-wrap: wrap; gap: 0.75rem; }
  .partner-topbar-actions { flex-wrap: wrap; }
}

/* Account statement: the figure the agency looks for first sits top right. */
.partner-balance-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.partner-balance-total {
  text-align: right;
}

.partner-balance-total .label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.partner-balance-amount {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.statement-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

/* Payments read lighter than the bookings they settle. */
.partner-statement tr.statement-payment td {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.partner-statement tr.statement-payment td:nth-child(2) {
  padding-left: 1.75rem;
}

.partner-statement .statement-title {
  color: var(--text-muted);
  margin-left: 0.4rem;
}

.partner-statement .statement-stay {
  white-space: nowrap;
}

.login-footer-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
}

.login-footer-link a {
  color: var(--primary);
  text-decoration: none;
}

.login-footer-link a:hover { text-decoration: underline; }

.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

.form-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Reservation form — destination & hotel picker */
.res-location-section,
.res-room-section {
  background: linear-gradient(165deg, #fafbfc 0%, #f4f6f9 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.1rem 1.15rem;
  margin-bottom: 0.25rem;
}

.res-room-section {
  background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.res-location-title {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.res-location-flow {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.res-location-flow::before {
  content: "";
  position: absolute;
  left: 0.95rem;
  top: 1.75rem;
  bottom: 1.75rem;
  width: 2px;
  background: linear-gradient(180deg, var(--primary-soft) 0%, var(--border) 50%, var(--border) 100%);
  border-radius: 1px;
  pointer-events: none;
}

.res-stay-stops {
  position: relative;
}

.res-stay-stops-lead {
  margin: 0 0 0.75rem 2.5rem;
  font-size: 0.8125rem;
}

.stay-stop-main-card,
.stay-stop-card,
.stay-transfer-card {
  margin-left: 2.5rem;
}

.stay-stop-segment {
  margin-left: 0;
}

.stay-stop-card {
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.stay-stop-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.stay-stop-card-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
}

.stay-stop-dates-inline {
  margin-top: 0.35rem;
  padding-left: 0;
}

.stay-stop-dates-inline .form-section-title {
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

.res-guests-confirm-hint {
  margin: 0 0 0.65rem;
}

.res-guests-section.is-confirm-guests {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.stay-stop-main-card {
  margin-bottom: 0.75rem;
}

.stay-stop-main-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}

#stay-stops-extras {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 0.65rem;
}

.stay-transfer-card {
  padding: 0.75rem;
  margin: 0 0 0.45rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
}

.stay-transfer-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.stay-transfer-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 0.5rem;
}

#add-stay-stop-btn {
  margin-left: 2.5rem;
}

.res-loc-field {
  position: relative;
  padding: 0.65rem 0 0.85rem 2.5rem;
}

.res-loc-field:last-child {
  padding-bottom: 0.35rem;
}

.res-loc-field.is-disabled {
  opacity: 0.55;
}

.res-loc-field-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.res-loc-field-head label {
  margin-bottom: 0 !important;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.res-loc-step {
  position: absolute;
  left: 0;
  top: 0.72rem;
  width: 1.9rem;
  height: 1.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  z-index: 1;
}

.res-loc-badge {
  margin-left: auto;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.res-input-wrap,
.res-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.res-field-hint {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.res-field-hint:empty {
  display: none;
}

/* "Did you mean Russian Express?" under the agency field. */
.agency-name-hint {
  display: inline-block;
  margin-top: 0.25rem;
}

/* The same question under a stay's hotel field. */
.hotel-name-hint {
  display: inline-block;
  margin-top: 0.25rem;
}

/* A rule between one group of look-alike agencies and the next. */
.agency-dup-group > td {
  border-top: 2px solid var(--border);
}

.agency-dup-note {
  margin: 0 1rem 0.75rem;
  font-size: 0.8rem;
}

/* Picking the cards to fold into one. */
.agency-merge-list {
  max-height: 16rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 0.4rem;
}

/* A row of the list is a label, so it has to outrank the form label style. */
.form .agency-merge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
}

.form .agency-merge-row input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex: none;
}

.form .agency-merge-row:last-child {
  border-bottom: none;
}

.form .agency-merge-row:hover {
  background: var(--surface-hover, rgba(127, 127, 127, 0.08));
}

.agency-merge-name {
  flex: 1;
  font-weight: 500;
}

.agency-merge-preview {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}

.agency-merge-preview ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

.agency-exchange-preview {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}

.agency-exchange-preview p {
  margin: 0;
}

.agency-exchange-preview p + p {
  margin-top: 0.35rem;
}

.res-field-icon {
  position: absolute;
  left: 0.75rem;
  font-size: 1rem;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
  opacity: 0.85;
}

.res-input-wrap .res-input,
.res-select-wrap .res-select {
  width: 100%;
  padding: 0.62rem 0.85rem 0.62rem 2.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.res-select-wrap .res-select {
  padding-left: 0.85rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.res-select-wrap:has(.res-field-icon) .res-select {
  padding-left: 2.35rem;
}

.res-select-country {
  font-size: 0.9375rem;
  font-weight: 500;
}

.res-input-wrap .res-input:focus,
.res-select-wrap .res-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.res-input-wrap .res-input:disabled {
  background: #f1f5f9;
  cursor: not-allowed;
}

.res-loc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

/* Suggestions we draw ourselves. Part of the page rather than a floating popup,
   so Safari's autofill window cannot sit on top of it. */
.suggest-list {
  display: none;
  margin-top: 0.4rem;
  max-height: 15rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}

.suggest-list.is-open {
  display: block;
}

.suggest-option {
  display: block;
  width: 100%;
  padding: 0.4rem 0.65rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border-soft, #f0f0f0);
  cursor: pointer;
}

.suggest-option:last-of-type {
  border-bottom: 0;
}

.suggest-option:hover,
.suggest-option.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

.suggest-empty,
.suggest-more {
  display: block;
  padding: 0.4rem 0.65rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.res-loc-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.res-loc-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.res-loc-chip.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.res-loc-chip-hotel {
  max-width: 14rem;
}

.res-loc-hint {
  margin-top: 0.4rem !important;
  font-size: 0.6875rem;
}

.res-loc-room {
  padding-left: 2.5rem;
}

.res-loc-room .res-loc-step {
  top: 0.15rem;
}

.res-loc-room .res-loc-field-head {
  margin-bottom: 0.45rem;
}

.room-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.55rem;
  margin-top: 0.15rem;
}

.room-type-card {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.12s;
  position: relative;
}

.room-type-card:hover {
  border-color: var(--primary-muted, #93c5fd);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.room-type-card.is-active {
  border-color: var(--primary, #2563eb);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, rgba(37, 99, 235, 0.02) 100%);
  box-shadow: 0 0 0 1px var(--primary, #2563eb), 0 4px 12px rgba(37, 99, 235, 0.12);
}

.room-type-card-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--surface-muted, #f1f5f9);
}

.room-tier-deluxe .room-type-card-icon {
  background: rgba(124, 58, 237, 0.1);
}

.room-tier-superior .room-type-card-icon {
  background: rgba(14, 165, 233, 0.12);
}

.room-tier-suite .room-type-card-icon {
  background: rgba(217, 119, 6, 0.12);
}

.room-type-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.room-type-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.room-type-card-rate {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.room-type-card.is-active .room-type-card-rate {
  color: var(--primary, #2563eb);
}

.room-type-card-check {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  border: 1.5px solid var(--border, #cbd5e1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  color: transparent;
  margin-top: 0.1rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.room-type-card.is-active .room-type-card-check {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
}

.room-type-card-other .room-type-card-icon {
  background: rgba(100, 116, 139, 0.12);
}

.room-type-card-other.is-active {
  border-color: var(--text-muted, #64748b);
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.08) 0%, rgba(100, 116, 139, 0.02) 100%);
  box-shadow: 0 0 0 1px var(--text-muted, #64748b);
}

.room-type-card-other.is-active .room-type-card-check {
  background: var(--text-muted, #64748b);
  border-color: var(--text-muted, #64748b);
}

.res-loc-room-pending .room-type-pending-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  margin-top: 0.15rem;
  border: 1.5px dashed var(--border, #cbd5e1);
  border-radius: 12px;
  background: var(--surface-muted, #f8fafc);
}

.room-type-pending-icon {
  font-size: 1.25rem;
  line-height: 1;
}

#room-type-other-wrap {
  margin-top: 0.5rem;
  padding-left: 2.5rem;
}

#room-type-other-wrap .res-input,
#room-type-other-wrap input {
  border-radius: 10px;
}

.reservation-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1rem 1.5rem;
}

.reservation-details-grid .detail-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.reservation-details-grid .reservation-names {
  grid-column: 1 / -1;
}

.stay-detail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stay-detail-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.stay-detail-card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.stay-detail-card-actions .stay-delete-btn {
  font-size: 0.8125rem;
}

.stay-room-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.stay-room-line {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2, #f8fafc);
}

.stay-room-line-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.stay-room-line-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.stay-room-primary-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.35rem;
}

.stay-finance-room-lines {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.stay-finance-room-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.75rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: var(--surface-2, #f8fafc);
  font-size: 0.875rem;
}

.stay-finance-room-row strong {
  font-weight: 600;
}

.stay-detail-region-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
}

.stay-detail-transfer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border);
  background: #fff7ed;
}

.stay-supplier-finance {
  margin-top: 1rem;
  padding-top: 0.25rem;
}

.stay-supplier-finance-divider {
  border-top: 1px solid var(--border);
  margin: 0 0 0.75rem;
}

.stay-supplier-finance-title {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.stay-finance-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stay-finance-card {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.stay-finance-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.financial-combined-summary {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--primary-soft, #f0f7ff);
}

.financial-combined-summary .financial-section-title {
  margin-top: 0;
}

.extra-services-card {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.extra-services-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.extra-services-card .card-body {
  min-width: 0;
  max-width: 100%;
}

.extra-services-card .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
}

.extra-services-total {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.extra-services-table {
  width: max-content;
  min-width: 100%;
  max-width: none;
  table-layout: auto;
  font-size: 0.8125rem;
  margin: 0;
}

.extra-services-table th,
.extra-services-table td {
  padding: 0.45rem 0.55rem;
  vertical-align: top;
}

.extra-services-table .extra-service-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: normal;
  max-width: 7.5rem;
}

.extra-services-table .extra-service-stay {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: normal;
  max-width: 8.5rem;
  line-height: 1.25;
}

.extra-services-table .extra-service-name {
  max-width: 12rem;
  word-break: break-word;
}

.extra-services-table .extra-service-supplier {
  max-width: 9rem;
  word-break: break-word;
}

.extra-services-table .extra-service-notes {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.extra-services-table .extra-service-actions {
  white-space: nowrap;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.extra-services-table tr.is-editing-service {
  background: #fff7ed;
}

.extra-services-add-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #e2e8f0);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 100%;
  min-width: 0;
}

.extra-services-add-form.is-editing {
  border-top-color: #fdba74;
  background: #fffaf5;
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-bottom: 0.75rem;
  border-radius: 8px;
}

.extra-services-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.extra-services-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10.5rem), 1fr));
  gap: 0.75rem 0.85rem;
  max-width: 100%;
  min-width: 0;
}

.extra-services-add-grid > * {
  min-width: 0;
}

.extra-services-add-form input,
.extra-services-add-form select,
.extra-services-add-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.extra-services-name-field {
  grid-column: 1 / -1;
}

.extra-services-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.extra-services-pricing-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface-muted, #f8fafc);
  border-radius: 8px;
  max-width: 100%;
}

.extra-services-pricing-preview .detail-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.extra-services-add-form label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

@media (max-width: 720px) {
  .extra-services-table {
    font-size: 0.75rem;
  }

  .extra-services-table th,
  .extra-services-table td {
    padding: 0.4rem 0.45rem;
  }

  .extra-services-table .extra-service-name,
  .extra-services-table .extra-service-supplier,
  .extra-services-table .extra-service-stay,
  .extra-services-table .extra-service-cat {
    max-width: 7rem;
  }
}

.settings-add-user-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.settings-fx-actions {
  display: flex;
  align-items: flex-end;
}

.settings-add-user-status.field-hint-success,
.settings-fx-status.field-hint-success {
  color: var(--success, #059669);
}

.settings-fx-status.field-hint-error {
  color: var(--danger, #b91c1c);
}

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

.field-hint-success {
  color: var(--success, #059669);
}

.field-hint-warning {
  color: var(--warning, #b45309);
}

.field-action-btn {
  margin-top: 0.5rem;
}

#room-type-other-wrap.hidden {
  display: none;
}

.input-readonly {
  background: var(--surface-muted, #f1f5f9);
  color: var(--text);
  cursor: default;
}

#website-rates-selected-wrap.hidden,
#website-price-wrap.hidden {
  display: none;
}

.website-rates-table-wrap {
  margin-top: 0.75rem;
}

.website-rates-table {
  font-size: 0.8125rem;
}

.website-rates-table th,
.website-rates-table td {
  padding: 0.4rem 0.6rem;
}

.website-rates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.rate-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface-muted, #f8fafc);
}

.rate-option:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, white);
}

.rate-option input {
  margin-top: 0.2rem;
}

.rate-option-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rate-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rate-value {
  font-size: 1rem;
}

#website-rates-wrap {
  margin-top: 0.75rem;
}

.official-site-panel {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  background: var(--surface-muted, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.official-site-btn {
  display: inline-flex;
  margin-top: 0.35rem;
  text-decoration: none;
}

.field-hint-warn {
  color: #b45309;
}

.sub-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

#manual-rates-selected-wrap.hidden {
  display: none;
}

.rate-display-card {
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted, #f8fafc);
}

.rate-display-card .rate-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.website-rates-display {
  margin-top: 0.35rem;
}

#room-price-panels-container.hidden {
  display: none;
}

.room-price-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.price-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted, #f8fafc);
  overflow: hidden;
}

.price-panel-internet {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.price-panel-official {
  border-color: #fde68a;
  background: #fffbeb;
}

.price-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  background: color-mix(in srgb, white 55%, transparent);
}

.price-panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.price-panel-tag-breakfast {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  text-transform: none;
  font-weight: 600;
  letter-spacing: 0;
}

.price-panel-title {
  font-size: 0.8125rem;
  font-weight: 600;
}

.price-panel-tag {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.price-panel-body {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.price-panel-main {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.price-panel-value {
  font-size: 1.35rem;
  line-height: 1.2;
}

.price-panel-unit {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.price-panel-rate {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.price-panel-rate .rate-label {
  min-width: 5.5rem;
}

.official-rate-fields {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.official-rate-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.official-rate-fields-readonly .official-rate-field {
  gap: 0.25rem;
}

.official-rate-fields-readonly .price-panel-main {
  margin: 0;
}

.price-comparison-dates {
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.breakfast-toggle {
  display: inline-flex;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 35%, transparent);
}

.breakfast-toggle-option {
  display: inline-flex;
  align-items: center;
  margin: 0;
  cursor: pointer;
}

.breakfast-toggle-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.breakfast-toggle-option span {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  transition: background 0.15s ease, color 0.15s ease;
}

.breakfast-toggle-option.is-active span {
  background: white;
  color: var(--text, #0f172a);
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.08);
}

.price-comparison-dates strong {
  color: var(--text, #0f172a);
}

.reservation-rates-stay-note {
  grid-column: 1 / -1;
  padding-bottom: 0.25rem;
  border-bottom: 1px dashed color-mix(in srgb, var(--border) 60%, transparent);
  margin-bottom: 0.25rem;
}

.official-rate-field .rate-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.official-rate-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.official-rate-input {
  width: 6.5rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.875rem;
}

.price-panel-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  align-self: flex-start;
}

@media (max-width: 640px) {
  .room-price-panels {
    grid-template-columns: 1fr;
  }
}

#official-rates-ref-container.hidden {
  display: none;
}

.stay-dates-section {
  margin: 0.25rem 0 0.5rem;
}

.stay-dates-section .form-section-title {
  margin-bottom: 0.5rem;
}

.stay-range-summary {
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  background: var(--surface-muted, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.stay-range-summary strong {
  color: var(--text);
}

.stay-range-picker {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.75rem;
}

.stay-range-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.stay-range-months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stay-range-months.stay-range-single {
  grid-template-columns: 1fr;
  max-width: 17.6rem;
  margin: 0 auto;
}

.stay-range-month-label {
  text-align: center;
  font-size: 0.79rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.stay-range-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.stay-range-head {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.18rem 0;
}

.stay-day {
  aspect-ratio: 1;
  min-height: 1.43rem;
  border: none;
  border-radius: 5px;
  background: transparent;
  font: inherit;
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.stay-day:hover:not(.stay-day-empty) {
  background: var(--primary-soft);
}

.stay-day.is-today {
  box-shadow: inset 0 0 0 1px var(--primary);
}

.stay-day.in-range {
  background: var(--primary-soft);
  border-radius: 0;
}

.stay-day.range-start {
  background: var(--primary);
  color: #fff;
  border-radius: 6px 0 0 6px;
}

.stay-day.range-end {
  background: var(--primary);
  color: #fff;
  border-radius: 0 6px 6px 0;
}

.stay-day.range-start.range-end {
  border-radius: 6px;
}

.stay-day-empty {
  pointer-events: none;
}

@media (max-width: 640px) {
  .stay-range-months {
    grid-template-columns: 1fr;
  }
}

.official-rates-ref-wrap {
  margin-top: 0.75rem;
}

.field-hint-error {
  color: #b91c1c;
}

.pricing-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface-muted, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.pricing-summary-item strong {
  display: block;
  font-size: 1.05rem;
  margin-top: 0.15rem;
}

/* Room plus services — the figure the agency is invoiced. */
.pricing-summary-booking {
  margin-top: 0.5rem;
  grid-template-columns: repeat(3, 1fr);
  border-color: var(--accent, #2563eb);
}

.login-remember {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.875rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.detail-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.stat-value-sm { font-size: 1.15rem !important; }

.currency-stat-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.currency-stat-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.35;
}

.currency-stat-code {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  min-width: 2rem;
}

.currency-stat-value {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.currency-stat-empty {
  color: var(--text-muted);
}

.stat-card .currency-stat-stack .currency-stat-line {
  font-size: 0.8125rem;
}

.currency-summary-block {
  margin-bottom: 0.25rem;
}

.chart-hint {
  margin: -0.25rem 0 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.currency-stats-table .currency-col {
  white-space: nowrap;
  min-width: 5.5rem;
}

.currency-stats-table th.currency-col {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

.quote-ref { margin: 0 0 0.5rem; font-size: 0.875rem; }

.text-muted { color: var(--text-muted); font-size: 0.75rem; }

code {
  font-size: 0.75rem;
  background: var(--bg);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

@media (max-width: 700px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* Reservation calendar */
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cal-month-label { flex: 1; text-align: center; font-size: 1rem; }

.cal-legend {
  display: flex;
  gap: 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.cal-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.cal-dot.arrival { background: #059669; }
.cal-dot.departure { background: #d97706; }
.cal-dot.client-payment { background: #2563eb; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cal-head {
  background: var(--bg);
  padding: 0.5rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.cal-cell {
  background: var(--surface);
  min-height: 88px;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cal-cell.cal-empty { background: #f8f9fb; }
.cal-cell.cal-today { background: var(--primary-soft); }

.cal-day-num {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.cal-today .cal-day-num { color: var(--primary); }

.cal-events { display: flex; flex-direction: column; gap: 0.2rem; }

.cal-event {
  border: none;
  border-radius: 4px;
  padding: 0.2rem 0.35rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.62rem;
  line-height: 1.25;
}

.cal-event.cal-arrival { background: #d1fae5; color: #065f46; }
.cal-event.cal-departure { background: #fef3c7; color: #92400e; }
.cal-event.cal-client_payment { background: #dbeafe; color: #1e40af; }

.client-payment-schedule-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #e2e8f0);
}

.client-payment-schedule-row:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.client-payment-schedule-remove {
  display: flex;
  align-items: flex-end;
  padding-bottom: 0.15rem;
}

.cal-event-type { display: block; font-weight: 700; font-size: 0.58rem; }
.cal-event-title { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 800px) {
  .cal-cell { min-height: 64px; }
  .cal-event-title { display: none; }
}

.status-flow-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.status-update-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0;
  border-top: 1px solid var(--border);
  margin-top: -0.25rem;
}

.status-update-row label {
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0;
}

.status-update-row select {
  min-width: 10rem;
}

.status-step {
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--bg);
}

.status-step.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.team-workload {
  list-style: none;
  margin: 0;
  padding: 0;
}

.team-workload li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.team-workload li:last-child { border-bottom: none; }

.team-presence-grid {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(20rem, 1.4fr);
  gap: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 960px) {
  .team-presence-grid {
    grid-template-columns: 1fr;
  }
}

.team-online-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.team-online-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.team-online-item:last-child { border-bottom: none; }

.team-online-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.team-online-avatar-muted { opacity: 0.65; }

.team-online-meta {
  flex: 1;
  min-width: 0;
}

.team-online-meta strong {
  display: block;
  font-size: 0.9rem;
}

.team-online-meta span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.presence-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.presence-dot-online {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.presence-dot-offline {
  background: var(--text-muted, #94a3b8);
}

.team-presence-subtitle {
  margin: 1rem 0 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.team-online-list-compact .team-online-item {
  padding: 0.4rem 0;
}

.team-usage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.usage-period-tabs {
  display: flex;
  gap: 0.35rem;
}

.usage-period-btn {
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #fff);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.usage-period-btn.active {
  background: var(--accent, #E9472E);
  border-color: var(--accent, #E9472E);
  color: #fff;
}

.usage-bar-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-content: flex-end;
}

.usage-bar-track {
  width: 5rem;
  height: 0.35rem;
  background: var(--surface-muted, #f1f5f9);
  border-radius: 999px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  background: var(--accent, #E9472E);
  border-radius: 999px;
}

.team-usage-table tfoot td {
  border-top: 2px solid var(--border, #e2e8f0);
  padding-top: 0.65rem;
}

.card-header-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.company-overview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.company-overview-kpis {
  margin-bottom: 1.25rem;
}

.company-overview-split {
  gap: 1.25rem;
}

.company-overview-split .chart-title {
  margin: 0 0 0.65rem;
}

.company-overview-table .num {
  text-align: right;
}

/* Both rankings fit their half of the page, so neither needs a scrollbar: the
   columns are sized here instead of being left to the widest figure, which is
   what pushed the rank and the name out of sight. */
.company-overview-split .table-wrap {
  overflow-x: visible;
}

.company-overview-table {
  table-layout: fixed;
}

.company-overview-table th,
.company-overview-table td {
  padding: 0.55rem 0.4rem;
}

/* Column headings are single words here: let them stand, and spend the saved
   letter-spacing on the figures instead. */
.company-overview-table th {
  font-size: 0.64rem;
  letter-spacing: 0;
  white-space: nowrap;
}

.company-overview-table th:first-child,
.company-overview-table td:first-child {
  width: 2.1rem;
  padding-right: 0;
}

/* Only the name may break: it is the one column that can take two lines. */
.company-overview-table td:nth-child(2) {
  overflow-wrap: anywhere;
}

.company-overview-table th:nth-child(3),
.company-overview-table td:nth-child(3),
.company-overview-table th:nth-child(5),
.company-overview-table td:nth-child(5) {
  width: 4.9rem;
  text-align: right;
}

.company-overview-table th:nth-child(4),
.company-overview-table td:nth-child(4),
.company-overview-table th:nth-child(6),
.company-overview-table td:nth-child(6) {
  width: 6rem;
  text-align: right;
}

.company-overview-table .dual-money-cell {
  white-space: normal;
  vertical-align: top;
}

/* The currency code and the figure share a narrow cell, so the gap between them
   gives way first — neither of the two may be broken across lines. */
.company-overview-table .currency-stat-line {
  gap: 0.3rem;
  font-size: 0.78rem;
}

/* Each figure already carries its currency, so the code beside it is a second
   label for the same thing — and the width it takes is what pushed the ranking
   off the page. */
.company-overview-table .currency-stat-code {
  display: none;
}

.company-overview-table .currency-stat-line {
  justify-content: flex-end;
}

.company-overview-table .currency-stat-value {
  white-space: nowrap;
}

/* On a phone the two rankings stack and the fixed columns no longer fit, so the
   scrollbar comes back where it is the lesser evil. */
@media (max-width: 700px) {
  .company-overview-split .table-wrap {
    overflow-x: auto;
  }

  .company-overview-table {
    table-layout: auto;
  }

  /* Scrolling sideways is one thing; a name broken mid-word is another. */
  .company-overview-table td:nth-child(2) {
    overflow-wrap: normal;
    white-space: nowrap;
  }

  .company-overview-table th:first-child,
  .company-overview-table td:first-child,
  .company-overview-table th:nth-child(3),
  .company-overview-table td:nth-child(3),
  .company-overview-table th:nth-child(4),
  .company-overview-table td:nth-child(4),
  .company-overview-table th:nth-child(5),
  .company-overview-table td:nth-child(5),
  .company-overview-table th:nth-child(6),
  .company-overview-table td:nth-child(6) {
    width: auto;
  }
}

.company-overview-table .dual-money-cell .currency-stat-stack {
  align-items: flex-end;
  width: 100%;
}

.company-overview-kpis .value-dual {
  font-size: 1rem !important;
  font-weight: 700;
  margin-top: 0.35rem;
}

.company-overview-kpis .value-dual .currency-stat-stack {
  gap: 0.35rem;
}

.company-overview-kpis .value-dual .currency-stat-line {
  font-size: 1rem;
  font-weight: 700;
  color: inherit;
}

.company-overview-kpis .value-dual .currency-stat-code {
  font-size: 0.75rem;
  font-weight: 700;
}

.company-overview-kpis .value-dual .currency-stat-value {
  font-size: 1rem;
  font-weight: 700;
}

.company-overview-kpis .dual-money-kpi {
  margin-top: 0.55rem;
  margin-bottom: 0;
}

.profit-positive { color: #059669; }
.profit-negative { color: #dc2626; }

.invoice-cap-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}
.invoice-cap-list li { margin: 0.25rem 0; }

.financial-block .financial-kpis {
  margin-bottom: 0;
}

.accounting-identity-check {
  margin: 0.85rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.accounting-identity-check.is-balanced {
  background: #ecfdf5;
  color: #047857;
}

.accounting-identity-check.is-unbalanced {
  background: #fef2f2;
  color: #b91c1c;
}

.financial-kpis .stat-card.is-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.financial-kpis .stat-card.is-clickable:hover,
.financial-kpis .stat-card.is-clickable:focus {
  outline: none;
  border-color: var(--accent, #0f766e);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #0f766e) 25%, transparent);
}

.stat-link-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: lowercase;
}

.financial-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.financial-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stats-year-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stats-year-toolbar label {
  font-weight: 600;
  font-size: 0.875rem;
}

.stats-year-toolbar select {
  min-width: 6rem;
}

.stats-year-toolbar .field-hint {
  margin: 0;
  flex: 1 1 12rem;
}

.col-hidden {
  display: none !important;
}

.column-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.column-picker-item {
  padding: 0.35rem 0;
}

.column-add-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.column-add-btn {
  text-align: left;
}

/* Columns size to their content instead of being pinned to 1280px. The fixed
   width forced a sideways scroll even on the seven-column agency list, which
   needs barely half of it; the wrap below still scrolls when a table genuinely
   does not fit. */
.agency-balance-table { font-size: 0.8125rem; min-width: 0; width: 100%; }
.agency-balance-table th { white-space: nowrap; }
.agency-balance-table .num-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.agency-balance-table .balance-due { color: #dc2626; font-weight: 600; }
.agency-balance-table .balance-partial { color: #b45309; font-weight: 600; }
.agency-balance-table .balance-paid { color: #059669; font-weight: 600; }
.agency-balance-table tr.agency-balance-paid { background: #ecfdf5; }
.agency-balance-table tr.agency-balance-paid:hover { background: #d1fae5; }
.agency-balance-table tr.agency-balance-partial { background: #fefce8; }
.agency-balance-table tr.agency-balance-partial:hover { background: #fef9c3; }
.agency-balance-table tr.agency-balance-unpaid { background: #fef2f2; }
.agency-balance-table tr.agency-balance-unpaid:hover { background: #fee2e2; }
.agency-balance-table tr.agency-balance-cancel-debt { outline: 1px solid #fca5a5; }
.agency-balance-totals td { border-top: 2px solid var(--border); background: var(--surface-muted, #f8fafc); font-weight: 600; }
.agency-balance-table tr.hotel-balance-empty { color: var(--text-muted, #64748b); }
.agency-balance-table tr.hotel-balance-empty .link-btn { color: inherit; }
/*
 * The commission column has to earn its place without pushing the table into a
 * sideways scroll: a balance read half at a time is what sends people back to
 * their own spreadsheets. The default 1rem of side padding costs more width across
 * a dozen columns than any of the figures do, and a supplier name is the one cell
 * that can be cut short without losing a number or a badge.
 */
.agency-balance-table th, .agency-balance-table td { padding: 0.45rem 0.5rem; }
/*
 * Headings wrap here, unlike everywhere else: "Остаток комиссии" over one line is
 * wider than any sum it heads, so the narrow money columns were being sized by
 * their own titles.
 */
.agency-balance-table th { white-space: normal; }
.agency-balance-table th.money-col { text-wrap: balance; }
.agency-balance-table td[data-col="supplier"] {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The one-click offer to turn an agency's overpay into its commission. */
.agency-commission-offer {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #fde68a;
  border-radius: 0.5rem;
  background: #fffbeb;
}
.agency-commission-offer .field-hint { margin: 0 0 0.6rem; }
.agency-commission-offer .btn + .field-hint { margin: 0.6rem 0 0; }

/* Commission we owe the agency but have not paid out — pending, not profit and not debt. */
.agency-balance-table .commission-left { color: #b45309; font-weight: 600; }
/*
 * The paid column spells out each receipt underneath the sum. Money cells never
 * wrap, which is right for the sums but let a line of prose set the width of the
 * widest column in the table; the note may wrap, the figures above it may not.
 */
.agency-balance-table .agency-paid-note {
  font-size: 0.8em;
  line-height: 1.35;
  margin-bottom: 0.2rem;
  white-space: normal;
}
.agency-balance-toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; align-items: center; }

/* Hotel / Supplier balance: full page width, no forced 1280px table stretch */
.party-balance-page {
  max-width: none;
  width: 100%;
}
.party-balance-page .grid-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  max-width: 48rem;
}

/* Booking total, Paid, Balance and the two halves of that balance. */
.party-balance-page .grid-stats.grid-stats--balance-horizon {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0.35rem;
  max-width: 78rem;
}

@media (max-width: 1200px) {
  .party-balance-page .grid-stats.grid-stats--balance-horizon {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 48rem;
  }
}

.balance-horizon-hint {
  margin: 0 0 1rem;
}

.balance-credit-warning {
  margin: 0 0 0.5rem;
  color: var(--danger);
  font-weight: 600;
}

/* Sale, paid, credit, balance, the two halves of that balance, and profit. Seven
   cards do not fit the default 160px minimum, and auto-fit dropped the last one
   onto a row of its own. */
.grid-stats.grid-stats--agency-balance {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.grid-stats.grid-stats--agency-balance .stat-card {
  padding: 0.75rem 0.85rem;
}

@media (max-width: 1200px) {
  .grid-stats.grid-stats--agency-balance {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.party-balance-page .stat-card {
  padding: 0.75rem 1rem;
}
.party-balance-page .agency-balance-toolbar {
  margin-bottom: 0.75rem;
}
.party-balance-page .party-balance-note {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted, #64748b);
}
.party-balance-table.agency-balance-table th.num-cell,
.party-balance-table.agency-balance-table td.num-cell {
  width: 1%;
  white-space: nowrap;
  padding-left: 1rem;
}

/* One money column per metric. Digits line up on the right, each sum keeps its
   own currency, and the rare cell holding both stacks them on two lines.
   The header needs the table in the selector, otherwise the left-aligned
   `.data-table th` rule wins on specificity and the label drifts away from its
   figures. */
.money-col,
.data-table th.money-col,
.data-table td.money-col,
table th.money-col,
table td.money-col {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.money-line {
  display: block;
}
.money-line + .money-line {
  margin-top: 0.15rem;
}

.agency-payment-dues { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.agency-payment-due-row { align-items: flex-start; }
.agency-payment-selected-sum { margin: 0.25rem 0 0; }
.agency-cancel-penalty-fieldset { border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem 1rem; margin: 0.75rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.agency-cancel-penalty-fieldset legend { padding: 0 0.35rem; font-weight: 600; }

.accountant-reservations-table { font-size: 0.8125rem; min-width: 1200px; }
.accountant-reservations-table th { white-space: nowrap; }
.accountant-reservations-table .guest-names-cell {
  max-width: 10rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reservation-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text, #1e293b);
}

.booking-type-col {
  text-align: center;
  width: 2.75rem;
  white-space: nowrap;
}

.booking-type-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.booking-type-s { color: #0f766e; }
.booking-type-h { color: #1d4ed8; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  background: var(--surface-muted, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px;
  padding: 2px;
}

.lang-switch button {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-muted, #64748b);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.lang-switch button:hover {
  color: var(--text, #1e293b);
}

.lang-switch button.active {
  background: var(--primary, #2563eb);
  color: #fff;
}

.lang-switch-login {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.bank-cashback-quick-entry .bank-cashback-inline-form .form-row {
  align-items: flex-end;
}

.bank-cashback-quick-entry .field-hint {
  margin-bottom: 0.75rem;
}


.bonus-rules-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.bonus-rules-list li {
  margin-bottom: 0.35rem;
}

.bonus-example {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
}

.bonus-card-hint {
  margin: 0 1rem 0.75rem;
}

.bonus-period-field {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.bonus-program-table .num-col,
.bonus-program-table .num-cell {
  text-align: right;
  white-space: nowrap;
}

.bonus-program-table tr.bonus-positive td:last-child {
  color: var(--success, #059669);
}

.bonus-program-table tr.bonus-below-min td:first-of-type {
  color: var(--text-muted, #64748b);
}

.badge-role {
  background: var(--surface-2, #f1f5f9);
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.salary-rules-list {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.salary-rules-list li {
  margin-bottom: 0.35rem;
}

.approvals-stale-note {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border-left: 3px solid #d97706;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.875rem;
}

.salary-window-notice {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.9rem;
}

.salary-window-closed {
  background: #f8fafc;
  color: #64748b;
}

.salary-table .salary-amount-input {
  width: 7rem;
  text-align: right;
}

.salary-table tr.salary-adjusted td {
  background: #fffbeb;
}

.bank-source-line {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
}

.bank-source-line .btn {
  margin-left: 0.5rem;
}

.bank-renew-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: #7c2d12;
  background: #ffedd5;
  border: 1px solid #fdba74;
  border-radius: 8px;
}

.crm-mode-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  padding: 0.45rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #7c2d12;
  background: #ffedd5;
  border-bottom: 1px solid #fdba74;
  pointer-events: none;
}

body.crm-mode-test #app,
body.crm-mode-test .login-screen {
  padding-top: 2rem;
}

.sales-yoy-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.5rem;
}

.sales-yoy-year-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.sales-yoy-margin-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.yoy-baseline-margin-input {
  width: 5.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border, #cfd8dc);
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

.yoy-baseline-year-select {
  min-width: 5.5rem;
}

.sales-yoy-vs {
  font-size: 0.875rem;
}

.sales-yoy-table .yoy-baseline-input {
  width: 100%;
  min-width: 6.5rem;
  max-width: 9rem;
  text-align: right;
  padding: 0.35rem 0.5rem;
}

.sales-yoy-total-row td {
  border-top: 2px solid var(--border, #e2e8f0);
  background: var(--surface-muted, #f8fafc);
}

.sales-yoy-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.sales-yoy-save-status.field-hint {
  margin: 0;
  color: #059669;
}

.payment-flags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-top: 0.5rem;
}

.payment-flag-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}

.payment-flag-label input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent, #2563eb);
}

.future-payments-toolbar-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.future-payments-period-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.future-payments-period-label {
  min-width: 10rem;
  text-align: center;
}

.future-payments-date-input {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.375rem;
}

.payment-planning-cal .cal-has-payment {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.cal-payment-total {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #047857;
  margin-top: 0.25rem;
}

.future-payments-total-row td {
  border-top: 2px solid var(--border, #e2e8f0);
  background: var(--surface-muted, #f8fafc);
}

.sales-yoy-summary-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sales-yoy-metric {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.65rem;
  background: var(--surface-muted, #f8fafc);
}

.sales-yoy-metric-label {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 0.65rem;
}

.sales-yoy-metric-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.sales-yoy-metric-caption {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.2rem;
}

.sales-yoy-metric-current {
  font-size: 1.05rem;
}

.sales-yoy-summary-footer {
  margin-top: 0.25rem;
}

@media (max-width: 720px) {
  .sales-yoy-metric-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Ivan — sales analytics chart (combo bar + line) */
.sales-analytics-card {
  margin-bottom: 1.25rem;
}

.sales-3y-chart-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.sales-3y-chart-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sales-3y-period-tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.sales-3y-period-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}

.sales-3y-period-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

.sales-3y-period-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

@media (max-width: 720px) {
  .sales-3y-chart-header {
    flex-direction: column;
    align-items: stretch;
  }

  .sales-3y-period-tabs {
    align-self: flex-start;
  }
}

.sales-analytics-subtitle {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.sales-analytics-chart-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 0.25rem;
  padding-left: 0.15rem;
}

.sales-analytics-svg {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
  overflow: visible;
}

.sales-analytics-grid {
  stroke: #e8ecef;
  stroke-width: 1;
}

.sales-analytics-axis {
  stroke: #cfd8dc;
  stroke-width: 1.25;
}

.sales-analytics-y-label {
  font-size: 11px;
  fill: #607d8b;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.sales-analytics-x-label {
  font-size: 11px;
  fill: #607d8b;
}

.sales-analytics-bar {
  opacity: 0.92;
}

.sales-analytics-line {
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sales-analytics-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 1.75rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
}

.sales-analytics-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #546e7a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sales-analytics-swatch {
  width: 1.35rem;
  height: 0.65rem;
  border-radius: 2px;
  background: var(--swatch-color, #2563EB);
}

.sales-analytics-swatch-bar {
  background: #16A34A;
}

.sales-analytics-swatch-line {
  width: 1.5rem;
  height: 0;
  border-top: 2.5px dashed var(--swatch-color, #2563EB);
  border-radius: 0;
  background: transparent;
}

.sales-analytics-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.1rem;
}

.sales-analytics-kpi {
  background: #f3f5f6;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  text-align: center;
}

.sales-analytics-kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #78909c;
  margin-bottom: 0.35rem;
}

.sales-analytics-kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
}

.sales-analytics-kpi-margin {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #546e7a;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .sales-analytics-kpis {
    grid-template-columns: 1fr;
  }
}

/* Hotel database */
.hotel-db-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 1rem 0.75rem;
}

.hotel-country-stats {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface-muted, #f8fafc);
}
.hotel-country-stats-summary {
  font-size: 0.92rem;
  margin-bottom: 0.65rem;
  color: var(--text-muted, #64748b);
}
.hotel-country-stats-summary strong {
  color: var(--text, #0f172a);
}
.hotel-country-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.hotel-country-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 7.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
}
.hotel-country-stat-name {
  font-size: 0.8rem;
  font-weight: 600;
}
.hotel-country-stat-nums {
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}
.hotel-country-stat-active {
  color: var(--text-muted, #64748b);
  font-size: 0.78rem;
}

.hotel-database-table .hotel-address-cell {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hotel-database-table,
.agency-database-table {
  min-width: 1100px;
}

body.crm-db-export-locked .crm-db-protect {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.hotel-database-table .crm-db-phone-cell,
.agency-database-table .crm-db-phone-cell {
  min-width: 11.5rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hotel-stars-num {
  color: var(--text-muted, #64748b);
  font-size: 0.75rem;
  margin-left: 0.15rem;
}

.hotel-stars-palace {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #92400e;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: 0.25rem;
  padding: 0.1rem 0.45rem;
}

.hotel-source-badge {
  white-space: nowrap;
}

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

.hotel-detail-wide {
  grid-column: 1 / -1;
}

.hotel-detail-body {
  display: grid;
  gap: 0.65rem;
}

.hotel-detail-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.75rem;
  align-items: start;
}

.hotel-detail-label {
  font-size: 0.8125rem;
  color: var(--text-muted, #64748b);
}

.hotel-detail-value {
  font-size: 0.875rem;
  word-break: break-word;
}

.hotel-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hotel-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-muted, #f1f5f9);
  font-size: 0.75rem;
}

.hotel-notes {
  white-space: pre-wrap;
  margin: 0;
}

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

@media (max-width: 900px) {
  .hotel-detail-grid {
    grid-template-columns: 1fr;
  }

  .hotel-detail-row {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .profit-share-layout {
    flex-direction: column;
    align-items: center;
  }

  .profit-share-legend {
    width: 100%;
  }
}

/* Financial management — profit share donut */
.profit-share-card {
  margin-bottom: 1.25rem;
}

.profit-share-card .chart-hint {
  margin: 0 0 1rem;
}

.profit-share-layout {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.profit-share-chart-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  flex-shrink: 0;
}

.profit-share-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.profit-share-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  padding: 0 1.5rem;
}

.profit-share-center-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profit-share-center-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.profit-share-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
  min-width: 240px;
}

.profit-share-legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  gap: 0.65rem 0.75rem;
  align-items: center;
  font-size: 0.875rem;
}

.profit-share-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--swatch-color, #2563eb);
}

.profit-share-legend-label {
  font-weight: 600;
  color: var(--text);
}

.profit-share-legend-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.profit-share-legend-amount {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.profit-share-empty {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 1rem 0;
}

/* Reporting module */
.reporting-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.reporting-catalog-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: calc(100vh - 220px);
  overflow: auto;
}
.reporting-catalog-heading {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.reporting-catalog-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 0.55rem 0.65rem;
  cursor: pointer;
}
.reporting-catalog-item:hover { border-color: var(--accent); }
.reporting-catalog-item.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.reporting-catalog-label { font-weight: 600; font-size: 0.8125rem; }
.reporting-catalog-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.35; }
.reporting-main { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.reporting-controls-body { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; }
.reporting-period-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.reporting-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8125rem; }
.reporting-field select { min-width: 140px; }
.reporting-export-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.reporting-preview-table { max-height: 480px; overflow: auto; }
.reporting-preview-note { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--text-muted); }
.invoice-action-cells { white-space: nowrap; }
.invoice-action-cells .link-btn + .link-btn { margin-left: 0.5rem; }
@media (max-width: 960px) {
  .reporting-layout { grid-template-columns: 1fr; }
  .reporting-catalog-body { max-height: none; }
}

/* Hotel contracts */
.hotel-contracts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.contract-list { display: flex; flex-direction: column; gap: 0.75rem; }
.contract-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.contract-list-main { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.contract-list-dates { font-size: 0.8125rem; color: var(--text-muted); }
.contract-list-summary { font-size: 0.8125rem; color: var(--text-muted); margin: 0; }
.contract-list-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.contract-list-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.contract-status-select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  border: 1px solid transparent;
  cursor: pointer;
  padding-right: 1.35rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 0.6rem) 55%, calc(100% - 0.35rem) 55%;
  background-size: 0.25rem 0.25rem;
  background-repeat: no-repeat;
}
.contract-status-select:hover,
.contract-status-select:focus-visible { border-color: currentColor; outline: none; }
.contract-form .form-section-title { margin-top: 1rem; margin-bottom: 0.5rem; }
.contract-vat-basis {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.contract-vat-basis legend { font-size: 0.8125rem; font-weight: 600; padding: 0 0.25rem; }
.contract-row-actions { display: flex; align-items: flex-end; padding-bottom: 0.25rem; }
.contract-checkbox-field { display: flex; align-items: center; gap: 0.35rem; font-size: 0.875rem; }
.contract-pricing-panel {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
.contract-pricing-panel.hidden { display: none; }
.contract-terms-summary { font-size: 0.875rem; margin-bottom: 0.5rem; }
.contract-terms-line { display: block; color: var(--text-muted); font-size: 0.8125rem; margin-top: 0.2rem; }
.contract-alert-warning {
  border-left: 3px solid #d97706;
  background: #fffbeb;
  padding: 0.5rem 0.65rem;
  margin: 0.5rem 0;
  font-size: 0.8125rem;
}
.contract-alert-info {
  border-left: 3px solid var(--primary);
  background: var(--primary-soft);
  padding: 0.5rem 0.65rem;
  margin: 0.5rem 0;
  font-size: 0.8125rem;
}
.contract-blackout-line { margin: 0.15rem 0; }
.contract-pricing-options { margin-top: 0.5rem; gap: 1rem; }
.hotel-contracts-header-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.contract-ai-match-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.contract-ai-match-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
}
.contract-ai-match-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 260px;
  max-width: 320px;
}
.contract-ai-match-actions select[data-target-hotel] {
  width: 100%;
  min-height: 10rem;
}
.contract-ai-match-actions [data-hotel-filter] {
  width: 100%;
  margin-bottom: 0.25rem;
}
.contract-ai-hotel-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  max-width: 320px;
}
.contract-ai-hotel-picks .btn small {
  opacity: 0.75;
  font-weight: 400;
}
.contract-ai-type-label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.85rem;
}
.contract-ai-match-row.contract-ai-type-uncertain {
  border-color: #d97706;
  background: #fffbeb;
}
select.contract-type-needs-confirm {
  border-color: #d97706;
  box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.25);
}
.contract-ai-type-banner,
.contract-ai-type-hint {
  color: #92400e;
}
.contract-ai-missing-blackouts {
  color: #b45309;
  font-weight: 500;
}
.contract-ai-match-row.contract-ai-create-new {
  border-color: #2563eb;
  background: #eff6ff;
}
.contract-ai-create-hotel {
  width: 100%;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border, #cbd5e1);
}
.contract-ai-create-hotel .form-row {
  margin-bottom: 0.35rem;
}
.contract-ai-create-hotel input,
.contract-ai-create-hotel select {
  width: 100%;
}
.contract-dup-banner {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  border-radius: 8px;
  color: #92400e;
}
.contract-dup-banner p {
  margin: 0.25rem 0 0;
}
.contract-dup-banner-sm {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
.contract-fit-period-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.5rem; align-items: end; margin-bottom: 0.5rem; }
.contract-fit-rates-summary { font-size: 0.875rem; margin: 0.5rem 0; }
.contract-fit-room-table, .contract-fit-legacy { border: 0; padding: 0; margin: 0; min-width: 0; }
.contract-fit-table-wrap { overflow-x: auto; margin: 0.5rem 0; }
.contract-fit-table { border-collapse: collapse; font-size: 0.8125rem; }
.contract-fit-table th { text-align: left; font-weight: 600; padding: 0.25rem; white-space: normal; max-width: 7rem; vertical-align: bottom; }
.contract-fit-table td { padding: 0.125rem 0.25rem; }
.contract-fit-table input[type="date"] { width: 9.5rem; }
.contract-fit-table input[type="number"] { width: 5rem; }
.contract-meal-plan-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.5rem; align-items: end; margin-bottom: 0.5rem; }
.contract-quote-panel { margin: 0.5rem 0; }
.contract-quote-summary { font-size: 0.875rem; margin: 0.5rem 0; }
.contract-quote-rooms { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.5rem 0; }
.contract-supplement-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.5rem; align-items: end; margin-bottom: 0.5rem; }
.contract-supplements-summary { font-size: 0.875rem; margin: 0.5rem 0; }

/* Read-only contract conditions inside the reservation card */
.contract-read {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  margin: 0.5rem 0;
  font-size: 0.8125rem;
}
.contract-read > summary {
  cursor: pointer;
  font-weight: 600;
}
.contract-read-block { margin-top: 0.5rem; }
.contract-read-block h4 {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.contract-read-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.15rem 0;
}
.contract-read-label { min-width: 11rem; color: var(--text-muted); }
.contract-read-value { flex: 1; }
.contract-read-list { margin: 0; padding-left: 1.1rem; }
.contract-read-list li { margin: 0.2rem 0; }
.contract-read-hit { color: #b45309; }
.service-catalog-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.agency-markup-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.5rem; align-items: end; margin-bottom: 0.5rem; }
.service-vehicle-rate-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.5rem; align-items: end; margin-bottom: 0.5rem; }
.res-guests-section { margin: 0.75rem 0; }
.guest-child-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.guest-child-row label { min-width: 5rem; }
.guest-child-row input { max-width: 6rem; }

/* AI Manager / AI Inbox */
.ai-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1rem;
}
.ai-manager-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.ai-manager-mailbox { margin: 0 0 0.75rem; font-size: 0.875rem; }
.ai-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
}
.ai-kpi {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  border-radius: 0.5rem;
  padding: 0.5rem 0.4rem;
  text-align: center;
}
.ai-kpi-value { display: block; font-size: 1.25rem; font-weight: 650; line-height: 1.2; }
.ai-kpi-label { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }
.ai-manager-error { color: #b91c1c; font-size: 0.8125rem; margin: 0.5rem 0 0; }
.ai-demo-hint { margin: 0 0 0.75rem; }
.ai-inbox-list { display: flex; flex-direction: column; gap: 1rem; }
.ai-inbox-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.ai-inbox-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 800px) {
  .ai-inbox-cols { grid-template-columns: 1fr; }
}
.ai-extract-list, .ai-offers-list { margin: 0; padding-left: 1.1rem; font-size: 0.875rem; }
.ai-draft-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.5rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}
.ai-price-card {
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}
.ai-price-card:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.ai-price-table { width: 100%; margin: 0.5rem 0 0; font-size: 0.8125rem; }
.ai-verify-sites {
  margin: 0.75rem 0;
  padding: 0.65rem 0.75rem;
  background: #f8fafc;
  border-radius: 0.4rem;
  border: 1px dashed var(--border, #e5e7eb);
}
.ai-verify-sites a { font-weight: 600; }
.ai-draft-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.ai-draft-body {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.8125rem;
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  padding: 0.65rem;
  border-radius: 0.35rem;
  margin: 0.5rem 0;
  max-height: 14rem;
  overflow: auto;
}
.ai-offer-edit-row {
  display: grid;
  grid-template-columns: 2fr 1fr 5rem auto;
  gap: 0.5rem;
  align-items: end;
  margin-bottom: 0.5rem;
}
@media (max-width: 700px) {
  .ai-offer-edit-row { grid-template-columns: 1fr; }
}

/* My Mail (personal Gmail — Ivan) */
.my-mail-toolbar { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.my-mail-layout {
  display: grid;
  grid-template-columns: 11rem minmax(14rem, 1fr) minmax(18rem, 1.4fr);
  gap: 0.75rem;
  min-height: 70vh;
  align-items: stretch;
}
.my-mail-labels, .my-mail-list, .my-mail-thread {
  overflow: auto;
  max-height: 75vh;
  padding: 0.5rem;
}
.my-mail-label, .my-mail-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.5rem;
  border-radius: 0.35rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.my-mail-label:hover, .my-mail-row:hover,
.my-mail-label.active, .my-mail-row.active {
  background: color-mix(in srgb, var(--accent, #2563eb) 10%, transparent);
}
.my-mail-row { border-bottom: 1px solid var(--border, #e5e7eb); border-radius: 0; }
.my-mail-row-from { font-weight: 600; font-size: 0.85rem; }
.my-mail-row-subject { font-size: 0.85rem; }
.my-mail-row-meta { font-size: 0.7rem; color: var(--muted, #64748b); }
.my-mail-row-snippet {
  font-size: 0.75rem;
  color: var(--muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.my-mail-msg { margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border, #e5e7eb); }
.my-mail-body {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.875rem;
  margin: 0.5rem 0 0;
}
.my-mail-html {
  display: block;
  width: 100%;
  min-height: 160px;
  height: 320px;
  margin-top: 0.5rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0.35rem;
  background: #fff;
}
.my-mail-compose { margin-top: 1rem; display: grid; gap: 0.5rem; }
.my-mail-compose-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.revolut-tabs { margin: 0.75rem 0; }
.revolut-layout {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(20rem, 1.3fr);
  gap: 0.75rem;
  align-items: start;
}
.revolut-pane { padding: 0.75rem; min-height: 12rem; }
.revolut-list { display: flex; flex-direction: column; gap: 0.35rem; }
.revolut-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  border-radius: 0.4rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}
.revolut-row.active { border-color: var(--accent, #2563eb); box-shadow: 0 0 0 1px var(--accent, #2563eb); }
.revolut-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.revolut-row-main strong { font-size: 0.875rem; }
.revolut-amt { font-weight: 600; white-space: nowrap; }
.revolut-dir {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.35rem;
  border-radius: 0.25rem;
  background: #e2e8f0;
}
.revolut-dir.in { background: #dcfce7; color: #166534; }
.revolut-dir.out { background: #fee2e2; color: #991b1b; }
.revolut-detail-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.revolut-doubt {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 0.4rem;
  padding: 0.65rem 0.75rem;
  margin: 0.75rem 0;
}
.revolut-doubt ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.revolut-suggest { color: #166534; }
.revolut-booking {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  margin: 0.5rem 0;
}
.revolut-salary-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
}
.revolut-booking strong { display: block; margin-bottom: 0.2rem; }
.revolut-booking p { margin: 0.15rem 0; }
.revolut-booking ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.revolut-excess {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  margin: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.revolut-excess.hidden { display: none; }
.revolut-excess p { margin: 0; }
.revolut-posted { color: #166534; font-weight: 600; }
.revolut-history { display: flex; flex-direction: column; gap: 1rem; max-height: 70vh; overflow: auto; }
.revolut-hist-month h3 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  text-transform: capitalize;
}
.revolut-hist-day { margin: 0 0 0.75rem; }
.revolut-hist-day h4 {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  color: var(--muted, #64748b);
  font-weight: 600;
}
.revolut-dues { display: flex; flex-direction: column; gap: 0.35rem; max-height: 16rem; overflow: auto; }
.revolut-dues .revolut-due { display: flex; gap: 0.45rem; align-items: center; font-size: 0.8125rem; }
.revolut-dues .revolut-due input[type="checkbox"] { flex: none; width: auto; margin: 0; }
.revolut-due-text { flex: 1; min-width: 0; }
.revolut-dues .revolut-due-amount { width: 6.5rem; flex: none; padding: 0.15rem 0.35rem; font-size: 0.8125rem; text-align: right; }
.revolut-due-amount:disabled { background: #f1f5f9; color: #94a3b8; }
.revolut-due-search { display: flex; gap: 0.4rem; margin: 0.35rem 0 0.5rem; }
.revolut-due-search input { flex: 1; min-width: 0; }
.revolut-alloc-summary { margin: 0.4rem 0 0; font-size: 0.8125rem; color: #475569; }
.revolut-alloc-summary:empty { display: none; }
.revolut-auto { display: flex; gap: 0.35rem; align-items: center; }
@media (max-width: 900px) {
  .revolut-layout { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .my-mail-layout { grid-template-columns: 1fr; }
  .my-mail-labels, .my-mail-list, .my-mail-thread { max-height: none; }
}

/* Diary (My tasks) — month calendar beside the agenda of the selected day. */
.diary-layout {
  display: grid;
  grid-template-columns: minmax(20rem, 26rem) 1fr;
  gap: 1rem;
  align-items: start;
}

.diary-toolbar .card-body { padding: 0.75rem 1rem; }

.diary-filter { display: flex; flex-direction: column; gap: 0.25rem; max-width: 16rem; }

.diary-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.diary-cal-grid .cal-cell {
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font: inherit;
}

.diary-cal-grid .cal-has-payment { background: #fffbeb; }
.diary-cal-grid .diary-cal-selected { outline: 2px solid var(--primary); outline-offset: -2px; }

.diary-cal-count {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
}

.diary-agenda { display: flex; flex-direction: column; gap: 1rem; }

.diary-overdue-card .card-header { color: var(--danger); }

.diary-table td { vertical-align: top; }
.diary-sub { font-size: 0.72rem; color: var(--text-muted); }
.diary-done-by { display: block; font-size: 0.68rem; color: var(--text-muted); }
.diary-actions { white-space: nowrap; }
.diary-actions .link-btn + .link-btn { margin-left: 0.4rem; }

.diary-remind-choices { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.diary-remind-choice { display: flex; align-items: center; gap: 0.3rem; font-size: 0.82rem; }

@media (max-width: 1100px) {
  .diary-layout { grid-template-columns: 1fr; }
}

/* Payment planning: both sides of the budget in one screen. */
.future-payments-summary-body {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.future-payments-summary-body > div { display: flex; flex-direction: column; gap: 0.2rem; }
.future-payments-summary-body strong { font-size: 1.05rem; }

.fp-in { color: #047857; }
.fp-out { color: #b45309; }

.cal-payment-out {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #b45309;
}

/* A month's worth of expenses, with the month and its total above them.
   Reads as a divider rather than a row: no hover, and the figures sit under
   the columns they belong to so the eye can follow them down. */
.data-table tr.table-group-row th {
  background: var(--surface-muted, #f4f6f8);
  border-top: 2px solid var(--border, #e3e8ee);
  color: var(--text, #1f2933);
  font-size: 0.82rem;
  text-transform: none;
  letter-spacing: 0;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.data-table tr.table-group-row:hover th { background: var(--surface-muted, #f4f6f8); }
.data-table tr.table-group-row th:first-child { text-transform: capitalize; }

.stop-sale-rooms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.stop-sale-review {
  border-top: 1px solid var(--border, #e5e7eb);
  padding: 14px 0;
}

.stop-sale-review:first-child {
  border-top: none;
}

.stop-sale-line {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
}

.stop-sale-mail-body {
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
  font-size: 12px;
}

.bank-badge {
  display: inline-block;
  min-width: 2.6em;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  vertical-align: middle;
  color: #fff;
}
.bank-badge-boc { background: #0b5f8a; }
.bank-badge-rev { background: #1f1f1f; }
