:root {
  color-scheme: light;
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-soft: #faf9f6;
  --surface-strong: #efeee9;
  --ink: #252823;
  --ink-soft: #464a43;
  --muted: #797d75;
  --muted-2: #9a9e96;
  --line: #e5e4de;
  --line-strong: #d8d7d0;
  --accent: #334c40;
  --accent-hover: #293f35;
  --accent-soft: #e9efeb;
  --danger: #a35750;
  --danger-soft: #f6ebe9;
  --warning: #9a7742;
  --warning-soft: #f6f0e4;
  --shadow-sm: 0 1px 2px rgba(37, 40, 35, 0.04), 0 4px 16px rgba(37, 40, 35, 0.03);
  --shadow-md: 0 18px 50px rgba(37, 40, 35, 0.12);
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 20px;
  --sidebar-width: 242px;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(51, 76, 64, 0.2);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

/* Authentication and setup */
.app-loading-screen,
.setup-screen,
.auth-screen {
  min-height: 100vh;
}

.app-loading-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
  background: var(--bg);
  font-size: 11px;
}

.auth-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px 13px 13px 4px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(51, 76, 64, 0.16);
}

.auth-brand-mark svg {
  width: 21px;
  height: 21px;
}

.auth-loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: auth-pulse 900ms ease-in-out infinite alternate;
}

.setup-screen {
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 15% 10%, #e9efeb 0, transparent 32%), var(--bg);
}

.setup-card {
  width: min(100%, 520px);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.setup-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 15px;
  color: var(--accent);
  background: var(--accent-soft);
}

.setup-icon svg {
  width: 23px;
  height: 23px;
}

.setup-card h1 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.setup-description {
  margin: 10px 0 23px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.setup-steps {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.setup-steps > div {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.setup-steps > div > span {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 9px;
  font-weight: 700;
}

.setup-steps p {
  margin: 1px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.setup-steps a,
.setup-steps code {
  color: var(--accent);
  font-weight: 600;
}

.setup-steps code {
  font-size: 9px;
}

.auth-screen {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(430px, 1.15fr);
  background: var(--surface);
}

.auth-side-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px clamp(28px, 5vw, 72px);
  overflow: hidden;
  color: #f4f5f0;
  background: var(--accent);
}

.auth-side-panel::before,
.auth-side-panel::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  content: "";
}

.auth-side-panel::before {
  top: 20%;
  right: -120px;
  width: 390px;
  height: 390px;
}

.auth-side-panel::after {
  bottom: -150px;
  left: -100px;
  width: 330px;
  height: 330px;
}

.auth-side-brand,
.auth-mobile-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-side-brand strong,
.auth-mobile-brand strong {
  font-family: "Newsreader", Georgia, serif;
  font-size: 27px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.auth-side-brand .auth-brand-mark {
  color: var(--accent);
  background: #f2f4ee;
  box-shadow: none;
}

.auth-side-copy {
  position: relative;
  z-index: 1;
  max-width: 390px;
  margin: auto 0;
}

.auth-side-copy > p {
  margin: 0 0 13px;
  color: #b9c9c0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-side-copy h1 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(36px, 4vw, 55px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.auth-side-points {
  display: grid;
  gap: 10px;
  margin-top: 30px;
  color: #d7e1da;
  font-size: 10px;
}

.auth-side-points span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-side-points svg {
  width: 15px;
  height: 15px;
  color: #a9c3b3;
}

.auth-side-foot {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #a6bdb0;
  font-size: 9px;
}

.auth-form-panel {
  display: grid;
  place-items: center;
  padding: 36px;
  background: var(--surface);
}

.auth-form-wrap {
  width: min(100%, 390px);
}

.auth-mobile-brand {
  display: none;
  margin-bottom: 38px;
  color: var(--ink);
}

.auth-mobile-brand .auth-brand-mark {
  color: #fff;
  background: var(--accent);
}

.auth-form-heading {
  margin-bottom: 25px;
}

.auth-form-heading .page-kicker {
  margin-bottom: 9px;
}

.auth-form-heading h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 31px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.auth-form-heading > p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

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

.auth-form .button {
  min-height: 44px;
  margin-top: 3px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 21px 0 14px;
  color: var(--muted-2);
  font-size: 9px;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.auth-switch,
.auth-forgot,
.auth-legal {
  text-align: center;
}

.auth-switch {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.auth-switch button,
.auth-forgot {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-size: inherit;
  font-weight: 600;
}

.auth-switch button:hover,
.auth-forgot:hover {
  text-decoration: underline;
}

.auth-forgot {
  display: block;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.auth-legal {
  margin: 28px 0 0;
  color: var(--muted-2);
  font-size: 8.5px;
  line-height: 1.5;
}

.auth-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -8px 0 15px;
  padding: 10px 11px;
  border: 1px solid #d6e5da;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
}

.auth-message.error {
  border-color: #ead3cf;
  color: var(--danger);
  background: var(--danger-soft);
}

.auth-message svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

/* Sidebar */
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #f9f8f5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 84px;
  padding: 0 24px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px 10px 10px 3px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 5px 14px rgba(51, 76, 64, 0.16);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-name {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-caption {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 16px 14px;
}

.nav-label {
  margin: 20px 11px 8px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 500;
  text-align: left;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav-item:hover {
  color: var(--ink);
  background: var(--surface-strong);
}

.nav-item:active {
  transform: translateY(1px);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.nav-icon {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
}

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

.nav-count {
  min-width: 22px;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.nav-item.active .nav-count {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.7);
}

.sidebar-note {
  margin: 8px 4px 18px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.sidebar-note-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.sidebar-note-head svg {
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.sidebar-note p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 13px 10px;
  border-top: 1px solid var(--line);
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #858b82;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.user-copy {
  min-width: 0;
  flex: 1;
}

.user-name {
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.mobile-backdrop {
  display: none;
}

/* Workspace and topbar */
.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 76px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 3vw, 42px);
  border-bottom: 1px solid rgba(229, 228, 222, 0.9);
  background: rgba(245, 244, 240, 0.88);
  backdrop-filter: blur(16px);
}

.topbar-title-wrap {
  min-width: 0;
}

.topbar-eyebrow {
  margin: 0 0 1px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.topbar-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

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

.icon-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.icon-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.icon-button.subtle {
  border-color: transparent;
  background: transparent;
}

.icon-button.subtle:hover {
  background: var(--surface-strong);
}

.notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--danger);
}

.notification-wrap {
  position: relative;
}

.notification-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  right: 0;
  width: 350px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: pop-in 140ms ease-out;
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
}

.notification-head h3 {
  margin: 0;
  font-size: 14px;
}

.notification-head span {
  color: var(--muted);
  font-size: 11px;
}

.notification-list {
  display: grid;
  max-height: 370px;
  overflow: auto;
}

.notification-item {
  display: flex;
  width: 100%;
  gap: 11px;
  padding: 13px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.notification-item:hover {
  background: var(--surface-soft);
}

.notification-symbol {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--warning);
  background: var(--warning-soft);
}

.notification-symbol.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.notification-symbol svg {
  width: 15px;
  height: 15px;
}

.notification-copy {
  min-width: 0;
  flex: 1;
}

.notification-copy strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 600;
}

.notification-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.notification-empty {
  padding: 30px 18px 34px;
  color: var(--muted);
  text-align: center;
}

.notification-empty svg {
  width: 25px;
  height: 25px;
  margin: 0 auto 8px;
  color: var(--accent);
}

/* Buttons */
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.button:active {
  transform: translateY(1px);
}

.button svg {
  width: 16px;
  height: 16px;
}

.button-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 5px 12px rgba(51, 76, 64, 0.12);
}

.button-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 7px 16px rgba(51, 76, 64, 0.18);
}

.button-secondary {
  color: var(--ink-soft);
  border-color: var(--line);
  background: var(--surface);
}

.button-secondary:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.button-ghost {
  color: var(--muted);
  background: transparent;
}

.button-ghost:hover {
  color: var(--ink);
  background: var(--surface-strong);
}

.button-danger {
  color: var(--danger);
  border-color: #ead3cf;
  background: var(--danger-soft);
}

.button-danger:hover {
  color: #8c433d;
  border-color: #e2bfba;
}

.topbar-expense-button {
  color: var(--accent);
  border-color: #cbdad1;
  background: var(--accent-soft);
}

.topbar-expense-button:hover {
  color: var(--accent-hover);
  border-color: #aec5b8;
  background: #dfeae3;
}

.button-small {
  min-height: 33px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 11px;
}

.button-block {
  width: 100%;
}

.mobile-menu-button {
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

/* Main content */
.main-content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 30px clamp(22px, 3vw, 42px) 48px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-heading-copy {
  min-width: 0;
}

.page-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.page-kicker::before {
  width: 16px;
  height: 1px;
  background: currentColor;
  content: "";
}

.page-title {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(30px, 3vw, 39px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.page-description {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.heading-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  display: flex;
  min-height: 106px;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.stat-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-soft);
}

.stat-icon.warm {
  color: var(--warning);
  background: var(--warning-soft);
}

.stat-icon.rose {
  color: var(--danger);
  background: var(--danger-soft);
}

.stat-copy {
  min-width: 0;
}

.stat-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.stat-value {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.stat-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 10px;
}

.stat-meta.positive {
  color: var(--accent);
}

.stat-meta svg {
  width: 12px;
  height: 12px;
}

/* Finance */
.finance-toolbar {
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 9px 12px;
}

.finance-month-label {
  min-width: 170px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-align: center;
}

.finance-collection-card {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(210px, 0.8fr) minmax(360px, 1.35fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
  padding: 22px;
}

.finance-collection-copy {
  display: flex;
  align-items: center;
  gap: 14px;
}

.finance-card-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: var(--accent);
  background: var(--accent-soft);
}

.finance-card-label {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.finance-collection-copy h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.finance-collection-copy p:last-child {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.finance-progress-labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
}

.finance-progress-labels strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.finance-progress-track {
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.finance-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.finance-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.finance-breakdown > div {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.finance-breakdown > div:last-child {
  border-right: 0;
}

.finance-breakdown span,
.finance-breakdown strong {
  display: block;
}

.finance-breakdown span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8.5px;
}

.finance-breakdown strong {
  font-size: 13px;
  font-weight: 600;
}

.positive {
  color: var(--accent) !important;
}

.finance-rail {
  margin-top: 0;
  margin-bottom: 18px;
}

.finance-table-section {
  min-width: 0;
}

.section-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
  margin: 24px 2px 11px;
}

.section-heading-row h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.section-heading-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 9.5px;
}

.section-heading-row > span {
  color: var(--muted);
  font-size: 9.5px;
}

.finance-table-card {
  overflow: hidden;
}

.finance-table-head,
.finance-table-row {
  display: grid;
  grid-template-columns: minmax(175px, 1.25fr) minmax(145px, 0.95fr) minmax(125px, 0.85fr) 90px 90px 90px 88px;
  gap: 14px;
  align-items: center;
}

.finance-table-head {
  min-height: 43px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  background: var(--surface-soft);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.finance-table-row {
  min-height: 68px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: background 120ms ease;
}

.finance-table-row:last-child {
  border-bottom: 0;
}

.finance-table-row:hover {
  background: var(--surface-soft);
}

.finance-money-cell strong {
  font-size: 11px;
  font-weight: 600;
}

.finance-empty-state {
  min-height: 260px;
}

/* Expenses */
.expense-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(220px, 1.15fr);
  gap: 10px;
  margin: 0 0 18px;
}

.expense-summary-card,
.expense-category-summary {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.expense-summary-card span,
.expense-summary-card small,
.expense-category-summary-head span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.expense-summary-card strong {
  display: block;
  margin: 7px 0 2px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.expense-summary-card strong.negative {
  color: var(--danger) !important;
}

.expense-category-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.expense-category-summary-head strong {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.expense-category-line {
  display: grid;
  grid-template-columns: minmax(75px, 0.8fr) minmax(40px, 1fr) auto;
  gap: 7px;
  align-items: center;
  min-height: 22px;
  color: var(--muted);
  font-size: 8.5px;
}

.expense-category-line > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-category-line > div {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.expense-category-line i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.expense-category-line strong {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.expense-empty-hint {
  margin: 3px 0;
  color: var(--muted-2);
  font-size: 9px;
}

.finance-expenses-section {
  min-width: 0;
  margin-top: 24px;
}

.expense-shortcut-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #dbe5de;
  border-radius: 12px;
  background: var(--accent-soft);
}

.expense-shortcut-icon {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.7);
}

.expense-shortcut-icon svg {
  width: 14px;
  height: 14px;
}

.expense-shortcut-tip > div {
  min-width: 0;
  flex: 1;
}

.expense-shortcut-tip strong,
.expense-shortcut-tip span {
  display: block;
}

.expense-shortcut-tip strong {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.expense-shortcut-tip > div span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.expense-shortcut-tip .button {
  flex: 0 0 auto;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.64);
}

.expense-property-summary {
  margin: 0 0 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.expense-property-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.expense-property-summary-head small {
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 500;
}

.expense-property-total-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 14px;
}

.expense-property-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 8.5px;
}

.expense-property-total span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-property-total strong {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.expense-list {
  display: grid;
  gap: 7px;
}

.expense-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 11px;
  align-items: center;
  min-height: 70px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.expense-row-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-soft);
}

.expense-row-icon svg {
  width: 15px;
  height: 15px;
}

.expense-row-main {
  min-width: 0;
}

.expense-row-main strong,
.expense-row-main span,
.expense-row-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-row-main strong {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.expense-row-main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.expense-row-main small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8.5px;
}

.expense-row-amount {
  min-width: 92px;
  text-align: right;
}

.expense-row-amount strong,
.expense-row-amount span {
  display: block;
}

.expense-row-amount strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.expense-row-amount span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.expense-row-actions {
  display: flex;
  align-items: center;
  gap: 1px;
}

.expense-row-actions .icon-button {
  width: 29px;
  height: 29px;
  border-radius: 8px;
}

.expense-row-actions .icon-button svg {
  width: 14px;
  height: 14px;
}

.danger-icon:hover {
  color: var(--danger) !important;
  background: var(--danger-soft) !important;
}

.expense-empty-state {
  min-height: 190px;
}

.expense-modal-panel {
  width: min(100%, 610px);
}

.expense-file-input {
  height: auto;
  min-height: 41px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 10px;
}

.expense-file-input::file-selector-button {
  margin-right: 8px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
}

.mobile-expense-fab {
  display: none;
}

/* Calendar */
.calendar-layout {
  display: block;
}

.calendar-card {
  min-width: 0;
  overflow: hidden;
}

.calendar-toolbar {
  display: flex;
  min-height: 66px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.month-navigation {
  display: flex;
  align-items: center;
  gap: 6px;
}

.month-picker-wrap {
  position: relative;
  margin: 0 8px 0 4px;
}

.month-label-button {
  display: flex;
  min-width: 185px;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  transition: border-color 120ms ease, background 120ms ease;
}

.month-label-button:hover,
.month-label-button[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface-soft);
}

.month-label-button svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.month-picker-popover {
  position: absolute;
  z-index: 45;
  top: calc(100% + 8px);
  left: 0;
  width: 310px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: pop-in 140ms ease-out;
}

.month-picker-selects {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 9px;
  margin-bottom: 9px;
}

.month-picker-selects label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.month-picker-selects .select-control {
  width: 100%;
  min-width: 0;
  height: 38px;
  background-color: var(--surface-soft);
}

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.segment-button {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.segment-button:hover {
  color: var(--ink);
}

.segment-button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(37, 40, 35, 0.08);
}

.calendar-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #fdfcf9;
}

.filter-summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.filter-summary strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.filter-spacer {
  flex: 1;
}

.select-control {
  min-width: 150px;
  height: 34px;
  padding: 0 31px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-soft);
  background-color: var(--surface);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.weekday {
  padding: 9px 10px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: minmax(108px, 1fr);
}

.calendar-day {
  position: relative;
  min-width: 0;
  padding: 7px 7px 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: background 120ms ease;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.calendar-day:hover {
  background: #fcfcfa;
}

.calendar-day.outside {
  background: #fbfaf8;
}

.calendar-day.outside .day-number,
.calendar-day.weekend .day-number {
  color: var(--muted-2);
}

.calendar-day.weekend {
  background: #fdfcf9;
}

.calendar-day.outside.weekend {
  background: #f9f8f5;
}

.day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.day-number {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.calendar-day.today .day-number {
  color: #fff;
  background: var(--accent);
}

.day-add {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  color: var(--muted-2);
  background: transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, color 120ms ease, background 120ms ease;
}

.day-add svg {
  width: 13px;
  height: 13px;
}

.calendar-day:hover .day-add,
.day-add:focus-visible {
  opacity: 1;
}

.day-add:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.calendar-events {
  display: grid;
  gap: 3px;
}

.calendar-event {
  display: flex;
  width: 100%;
  min-width: 0;
  height: 23px;
  align-items: center;
  gap: 5px;
  padding: 0 6px;
  overflow: hidden;
  border: 0;
  border-left: 2px solid var(--event-color);
  border-radius: 5px;
  color: var(--event-text);
  background: var(--event-bg);
  cursor: pointer;
  font-size: 9.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  transition: filter 120ms ease, transform 120ms ease;
}

.calendar-event:hover {
  filter: saturate(1.08) brightness(0.98);
  transform: translateY(-1px);
}

.event-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.event-guest {
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-property {
  margin-left: auto;
  overflow: hidden;
  opacity: 0.68;
  font-size: 8px;
  text-overflow: ellipsis;
}

.more-events {
  padding: 2px 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

/* Property timeline */
.timeline-filters {
  min-height: 48px;
}

.timeline-instruction {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.timeline-instruction svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--accent);
}

.timeline-instruction strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.timeline-instruction.active {
  color: var(--accent);
}

.timeline-booking-count {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.timeline-booking-count strong {
  color: var(--ink-soft);
  font-weight: 600;
}

.resource-calendar {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: var(--surface);
  scrollbar-color: #c7c8c1 transparent;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.resource-calendar::-webkit-scrollbar {
  height: 9px;
}

.resource-calendar::-webkit-scrollbar-track {
  background: var(--surface-soft);
}

.resource-calendar::-webkit-scrollbar-thumb {
  border: 2px solid var(--surface-soft);
  border-radius: 999px;
  background: #c7c8c1;
}

.resource-grid-header,
.resource-row {
  display: grid;
  grid-template-columns: var(--property-column, 182px) repeat(var(--day-count), minmax(32px, 1fr));
  min-width: var(--timeline-width);
}

.resource-grid-header {
  position: relative;
  z-index: 7;
  min-height: 53px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.resource-header-title,
.resource-day-header {
  display: flex;
  grid-row: 1;
  align-items: center;
  justify-content: center;
}

.resource-header-title {
  position: sticky;
  z-index: 9;
  left: 0;
  justify-content: flex-start;
  padding: 0 16px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  box-shadow: 5px 0 10px rgba(37, 40, 35, 0.025);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.resource-day-header {
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
  text-transform: capitalize;
}

.resource-day-header.weekend {
  background: #f8f7f3;
}

.resource-day-header strong {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.resource-day-header.today strong {
  color: #fff;
  background: var(--accent);
}

.resource-row {
  position: relative;
  height: 67px;
  min-height: 67px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

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

.resource-property {
  position: sticky;
  z-index: 6;
  left: 0;
  display: flex;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 0 13px 0 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 5px 0 10px rgba(37, 40, 35, 0.025);
}

.resource-property::before {
  width: 4px;
  height: 31px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--property-color);
  content: "";
}

.resource-property-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}

.resource-property-copy strong,
.resource-property-copy span {
  display: block;
}

.resource-property-name {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  overflow-wrap: normal;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.05;
}

.resource-property-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-property-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8.5px;
}

.resource-property-occupancy {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 600;
}

.resource-day {
  position: relative;
  display: grid;
  grid-row: 1;
  min-width: 0;
  place-items: center;
  border-right: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: background 100ms ease, box-shadow 100ms ease;
}

.resource-day.weekend {
  background: #fdfcf9;
}

.resource-day:hover {
  z-index: 2;
  background: var(--accent-soft);
}

.resource-day:hover::after {
  position: absolute;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 6px;
  color: var(--accent);
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(37, 40, 35, 0.09);
  content: "+";
  font-size: 12px;
  font-weight: 600;
}

.resource-day.today {
  box-shadow: inset 1px 0 0 rgba(51, 76, 64, 0.22), inset -1px 0 0 rgba(51, 76, 64, 0.22);
}

.resource-day.selected-range {
  background: #edf3ef;
}

.resource-day.selected-start,
.resource-day.selected-end {
  z-index: 3;
  background: #dce9e1;
  box-shadow: inset 0 0 0 1px rgba(51, 76, 64, 0.26);
}

.resource-day.selected-start:hover,
.resource-day.selected-end:hover {
  background: #dce9e1;
}

.selection-marker {
  position: relative;
  z-index: 5;
  display: flex;
  height: 19px;
  align-items: center;
  padding: 0 5px;
  border-radius: 5px;
  color: #fff;
  background: var(--accent);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.resource-pill {
  position: relative;
  z-index: 4;
  display: flex;
  grid-row: 1;
  min-width: 0;
  height: 31px;
  align-self: center;
  flex-direction: column;
  justify-content: center;
  margin: 0 4px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--pill-color) 25%, white);
  border-left: 3px solid var(--pill-color);
  border-radius: 8px;
  color: var(--pill-text);
  background: var(--pill-bg);
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: filter 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.resource-pill:hover {
  z-index: 5;
  filter: saturate(1.08) brightness(0.985);
  box-shadow: 0 4px 10px rgba(37, 40, 35, 0.1);
  transform: translateY(-1px);
}

.resource-pill.pending {
  border-style: dashed;
}

.resource-pill-name,
.resource-pill-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-pill-name {
  font-size: 9.5px;
  font-weight: 700;
}

.resource-pill-meta {
  margin-top: 1px;
  opacity: 0.7;
  font-size: 7.5px;
  font-weight: 500;
}

.resource-pill.narrow {
  padding: 0 5px;
}

.resource-pill.narrow .resource-pill-name {
  font-size: 8.5px;
}

.resource-pill.compact {
  justify-content: center;
  padding: 0;
  border-radius: 50%;
}

.resource-pill.compact .resource-pill-name {
  width: 5px;
  height: 5px;
  color: var(--pill-color);
  font-size: 0;
  border-radius: 50%;
  background: currentColor;
}

.resource-empty-state {
  min-height: 240px;
}

.timeline-footer {
  justify-content: space-between;
  background: var(--surface-soft);
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-item.ending::after {
  width: 12px;
  height: 1px;
  margin-left: -3px;
  background: currentColor;
  content: "";
}

.legend-spacer {
  flex: 1;
}

.legend-hint {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-hint svg {
  width: 12px;
  height: 12px;
}

/* Activity rail */
.insights-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.rail-card {
  overflow: hidden;
}

.rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px 11px;
}

.rail-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}

.rail-link {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
}

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

.arrival-list,
.attention-list,
.property-progress-list {
  display: grid;
  margin: 0;
  padding: 0 16px 14px;
  list-style: none;
}

.arrival-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.arrival-date {
  display: grid;
  width: 34px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  line-height: 1;
}

.arrival-date strong {
  align-self: end;
  font-size: 14px;
  font-weight: 600;
}

.arrival-date span {
  align-self: start;
  margin-top: 3px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.arrival-copy {
  min-width: 0;
  flex: 1;
}

.arrival-copy strong,
.attention-copy strong,
.property-progress-item strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arrival-copy span,
.attention-copy span,
.property-progress-item span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arrival-status {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--property-color);
}

.attention-item {
  display: flex;
  gap: 9px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.attention-icon {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--warning);
  background: var(--warning-soft);
}

.attention-icon.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.attention-icon svg {
  width: 13px;
  height: 13px;
}

.attention-copy {
  min-width: 0;
  flex: 1;
}

.attention-copy strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.3;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.property-progress-item {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.property-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.property-progress-head strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-progress-head span {
  color: var(--muted);
  font-size: 9px;
}

.progress-track {
  height: 4px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress-value {
  height: 100%;
  border-radius: inherit;
  background: var(--progress-color);
}

.rail-empty {
  padding: 4px 16px 20px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.rail-empty svg {
  width: 22px;
  height: 22px;
  margin: 0 auto 7px;
  color: var(--muted-2);
}

/* Agenda */
.agenda-list {
  overflow: hidden;
}

.agenda-row {
  display: grid;
  grid-template-columns: 74px minmax(150px, 1.2fr) minmax(160px, 1fr) 110px 95px 36px;
  gap: 16px;
  align-items: center;
  min-height: 78px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: background 120ms ease;
}

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

.agenda-row:hover {
  background: var(--surface-soft);
}

.agenda-date {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda-date-block {
  display: grid;
  width: 41px;
  height: 45px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  line-height: 1;
}

.agenda-date-block strong {
  align-self: end;
  font-size: 16px;
  font-weight: 600;
}

.agenda-date-block span {
  align-self: start;
  margin-top: 4px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.agenda-date small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.agenda-guest {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.guest-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--avatar-color, #747a72);
  background: color-mix(in srgb, var(--avatar-color, #747a72) 14%, white);
  font-size: 10px;
  font-weight: 700;
}

.agenda-copy,
.property-copy,
.dates-copy,
.amount-copy {
  min-width: 0;
}

.agenda-copy strong,
.property-copy strong,
.dates-copy strong,
.amount-copy strong {
  display: block;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agenda-copy span,
.property-copy span,
.dates-copy span,
.amount-copy span {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.property-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.property-swatch {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: var(--property-color);
}

.amount-copy strong {
  font-size: 12px;
}

.row-menu {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.row-menu:hover {
  color: var(--ink);
  background: var(--surface-strong);
}

/* Statuses */
.status-pill,
.payment-pill,
.confirmation-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill::before,
.confirmation-pill::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-confirmed {
  color: #537061;
  background: #edf3ef;
}

.status-pending {
  color: #97733d;
  background: #f7f0e4;
}

.status-canceled {
  color: #8c716d;
  background: #f3edeb;
}

.payment-paid {
  color: #537061;
  background: #edf3ef;
}

.payment-partial {
  color: #8c7549;
  background: #f6f0e5;
}

.payment-pending {
  color: #8c716d;
  background: #f3edeb;
}

.confirmation-sent {
  color: #537061;
  background: #edf3ef;
}

.confirmation-prepared {
  color: #8c7549;
  background: #f6f0e5;
}

.confirmation-pending {
  color: #8c716d;
  background: #f3edeb;
}

/* Filters and table */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  padding: 12px;
}

.search-wrap {
  position: relative;
  min-width: 220px;
  max-width: 340px;
  flex: 1;
}

.search-wrap svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--muted-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 11px;
}

.search-input::placeholder {
  color: var(--muted-2);
}

.filter-bar .select-control {
  min-width: 135px;
  background-color: var(--surface-soft);
}

.filter-spacer-small {
  flex: 1;
}

.result-count {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.reservations-table-card {
  overflow: hidden;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) minmax(150px, 1fr) minmax(165px, 1.1fr) 90px 100px 36px;
  gap: 16px;
  align-items: center;
}

.table-head {
  min-height: 43px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  background: var(--surface-soft);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.table-row {
  min-height: 70px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: background 120ms ease;
}

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

.table-row:hover {
  background: var(--surface-soft);
}

.table-property {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.table-dates strong {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.table-dates span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9.5px;
}

.table-payment strong,
.table-payment span {
  display: block;
}

.table-payment strong {
  font-size: 11px;
  font-weight: 600;
}

.table-payment span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

/* Properties */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.property-card {
  position: relative;
  overflow: hidden;
}

.property-visual {
  position: relative;
  display: flex;
  height: 126px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px;
  overflow: hidden;
  color: var(--property-text, #fff);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--property-color) 78%, white), var(--property-color));
}

.property-visual::before,
.property-visual::after {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  content: "";
}

.property-visual::before {
  top: -45px;
  right: -25px;
  width: 145px;
  height: 145px;
}

.property-visual::after {
  right: 29px;
  bottom: -63px;
  width: 100px;
  height: 100px;
}

.property-visual-lines {
  position: absolute;
  inset: 0;
  opacity: 0.23;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(90deg, transparent, #000);
}

.property-type,
.property-color-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(25, 28, 25, 0.13);
  font-size: 9px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.property-color-label {
  align-self: flex-end;
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.property-card-menu {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9px;
  color: #fff;
  background: rgba(31, 34, 31, 0.18);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.property-card-menu:hover {
  background: rgba(31, 34, 31, 0.3);
}

.property-body {
  padding: 17px;
}

.property-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.property-title-row h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.property-location {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.property-location svg {
  width: 12px;
  height: 12px;
}

.property-facts {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 14px 0;
  color: var(--muted);
  font-size: 10px;
}

.property-fact {
  display: flex;
  align-items: center;
  gap: 5px;
}

.property-fact svg {
  width: 14px;
  height: 14px;
}

.property-stay-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.stay-stat strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stay-stat span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.add-property-card {
  display: grid;
  min-height: 293px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.add-property-card:hover {
  color: var(--accent);
  border-color: #b8c5bd;
  background: rgba(255, 255, 255, 0.65);
}

.add-property-inner {
  padding: 30px;
  text-align: center;
}

.add-property-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--accent);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.add-property-icon svg {
  width: 21px;
  height: 21px;
}

.add-property-inner strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.add-property-inner span {
  display: block;
  max-width: 190px;
  font-size: 10px;
}

.properties-callout {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 17px;
  padding: 15px 18px;
}

.properties-callout-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: var(--accent);
  background: var(--accent-soft);
}

.properties-callout strong {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
}

.properties-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

/* Empty states */
.empty-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  padding: 40px;
  text-align: center;
}

.empty-state-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 16px;
  color: var(--accent);
  background: var(--accent-soft);
}

.empty-state-icon svg {
  width: 23px;
  height: 23px;
}

.empty-state h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.empty-state p {
  max-width: 340px;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 11px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  z-index: 150;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(31, 34, 30, 0.43);
  backdrop-filter: blur(3px);
  animation: fade-in 140ms ease-out;
}

.modal-panel {
  width: min(100%, 650px);
  max-height: min(90vh, 820px);
  overflow: hidden auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(30, 34, 29, 0.24);
  animation: modal-in 170ms ease-out;
}

.modal-panel.small {
  width: min(100%, 470px);
}

.modal-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.modal-header h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.modal-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--ink);
  background: var(--surface-strong);
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-form {
  margin: 0;
}

.form-section {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.form-section:last-of-type {
  border-bottom: 0;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 13px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.form-section-title svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

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

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

.form-field {
  min-width: 0;
}

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

.form-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.form-label small {
  margin-left: auto;
  color: var(--muted-2);
  font-size: 8.5px;
  font-weight: 500;
}

.form-label .required {
  margin-left: 2px;
  color: var(--danger);
}

.form-control {
  width: 100%;
  height: 41px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 11px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.form-control:hover {
  border-color: var(--line-strong);
}

.form-control:focus {
  border-color: #9aaea2;
  outline: 0;
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(51, 76, 64, 0.09);
}

.form-control::placeholder {
  color: var(--muted-2);
}

textarea.form-control {
  min-height: 78px;
  padding-top: 10px;
  resize: vertical;
}

input[type="date"].form-control {
  min-width: 0;
  color-scheme: light;
}

.input-with-prefix {
  position: relative;
}

.input-with-prefix span {
  position: absolute;
  top: 50%;
  left: 11px;
  color: var(--muted);
  font-size: 11px;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-with-prefix .form-control {
  padding-left: 24px;
}

.form-hint {
  margin: 5px 0 0;
  color: var(--muted-2);
  font-size: 8.5px;
}

.balance-preview {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9.5px;
}

.balance-preview strong {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.balance-preview strong.invalid {
  color: var(--danger);
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
}

.form-check input {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.form-check-copy strong {
  display: block;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.form-check-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.form-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin: 0 22px 18px;
  padding: 10px 11px;
  border: 1px solid #e9cfcb;
  border-radius: 9px;
  color: #8c4842;
  background: var(--danger-soft);
  font-size: 10px;
}

.form-error.visible {
  display: flex;
}

.form-error svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.modal-footer {
  position: sticky;
  z-index: 3;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(10px);
}

.modal-footer .footer-note {
  margin-right: auto;
  color: var(--muted);
  font-size: 9px;
}

/* Email template composer */
.email-composer-panel {
  width: min(100%, 920px);
}

.email-composer-layout {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  min-height: 480px;
}

.email-template-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.email-template-sidebar-head {
  display: flex;
  min-height: 53px;
  align-items: center;
  justify-content: space-between;
  padding: 0 13px 0 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.email-template-sidebar-head .icon-button {
  width: 28px;
  height: 28px;
  border-color: var(--line);
  background: var(--surface);
}

.email-template-list {
  display: grid;
  gap: 4px;
  padding: 10px 8px;
}

.email-template-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.email-template-item:hover {
  color: var(--ink);
  background: var(--surface);
}

.email-template-item.active {
  color: var(--accent);
  border-color: #d6e2da;
  background: var(--accent-soft);
}

.email-template-icon {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: var(--surface);
}

.email-template-icon svg {
  width: 13px;
  height: 13px;
}

.email-template-item > span:last-child {
  min-width: 0;
}

.email-template-item strong,
.email-template-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-template-item strong {
  font-size: 9.5px;
  font-weight: 600;
}

.email-template-item small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
}

.email-template-delete {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: auto 12px 13px;
  padding: 8px 5px;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 8.5px;
  text-align: left;
}

.email-template-delete:hover {
  color: var(--danger);
}

.email-template-delete svg {
  width: 12px;
  height: 12px;
}

.email-editor {
  min-width: 0;
  padding: 18px 21px;
}

.email-recipient-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.email-recipient-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
}

.email-recipient-icon svg {
  width: 14px;
  height: 14px;
}

.email-recipient-bar > div {
  min-width: 0;
  flex: 1;
}

.email-recipient-bar > div span,
.email-recipient-bar > div strong {
  display: block;
}

.email-recipient-bar > div span {
  color: var(--muted);
  font-size: 8px;
}

.email-recipient-bar > div strong {
  margin-top: 1px;
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-recipient-property {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--property-color);
  background: color-mix(in srgb, var(--property-color) 12%, white);
  font-size: 8px;
  font-weight: 600;
}

.email-editor-fields {
  display: grid;
  gap: 14px;
}

.email-body-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.email-body-label-row .form-label {
  margin-bottom: 6px;
}

.email-body-label-row > span {
  color: var(--muted-2);
  font-size: 8px;
}

.email-message-textarea {
  min-height: 245px;
  line-height: 1.55;
}

.email-variable-block {
  display: grid;
  gap: 6px;
}

.email-variable-block > span {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
}

.email-variable-block > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.email-variable-block button {
  min-height: 24px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent);
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 8px;
}

.email-variable-block button:hover {
  border-color: #b9cabe;
  background: var(--accent-soft);
}

.email-preview {
  min-height: 390px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.email-preview-toolbar {
  display: flex;
  min-height: 54px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
}

.email-preview-toolbar span,
.email-preview-meta {
  color: var(--muted);
  font-size: 8.5px;
}

.email-preview-toolbar strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--line);
}

.email-preview pre {
  margin: 0;
  padding: 17px;
  overflow: auto;
  color: var(--ink-soft);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 10px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.email-composer-footer {
  flex-wrap: wrap;
}

.email-composer-footer .footer-note {
  flex: 1 0 100%;
  margin: 0 0 3px;
}

.color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.color-option {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: var(--color);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.color-option::after {
  position: absolute;
  inset: -4px;
  border: 1.5px solid transparent;
  border-radius: 13px;
  content: "";
}

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

.color-option:has(input:checked)::after {
  border-color: var(--color);
}

.color-option:has(input:focus-visible)::after {
  outline: 3px solid rgba(51, 76, 64, 0.2);
  outline-offset: 2px;
}

.delete-property {
  margin: 0 22px 18px;
  padding: 11px 12px;
  border: 1px solid #ead3cf;
  border-radius: 10px;
  color: var(--danger);
  background: var(--danger-soft);
}

/* Drawer */
.drawer-overlay {
  position: fixed;
  z-index: 110;
  inset: 0;
  background: rgba(31, 34, 30, 0.32);
  backdrop-filter: blur(2px);
  animation: fade-in 140ms ease-out;
}

.drawer {
  position: fixed;
  z-index: 111;
  inset: 0 0 0 auto;
  width: min(100%, 430px);
  overflow: hidden auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: -20px 0 60px rgba(31, 34, 30, 0.16);
  animation: drawer-in 200ms ease-out;
}

.drawer-header {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.drawer-header-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.drawer-header-title h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}

.drawer-body {
  padding: 20px;
}

.reservation-hero {
  padding: 0 0 19px;
  border-bottom: 1px solid var(--line);
}

.reservation-guest {
  display: flex;
  align-items: center;
  gap: 13px;
}

.reservation-guest .guest-avatar {
  width: 45px;
  height: 45px;
  font-size: 12px;
}

.reservation-guest h3 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.reservation-guest p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.hero-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.drawer-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.drawer-section:last-child {
  border-bottom: 0;
}

.drawer-section-title {
  margin: 0 0 11px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.detail-item {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.detail-item.wide {
  grid-column: 1 / -1;
}

.detail-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 8.5px;
}

.detail-value {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.contact-link {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 9.5px;
  text-decoration: none;
}

.contact-link:hover {
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.contact-link svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--accent);
}

.contact-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-note {
  margin: 0;
  padding: 11px 12px;
  border-left: 2px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 10px;
  font-style: normal;
  line-height: 1.6;
  white-space: pre-wrap;
}

.confirmation-box {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.confirmation-symbol {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--warning);
  background: var(--warning-soft);
}

.confirmation-symbol.sent {
  color: var(--accent);
  background: var(--accent-soft);
}

.confirmation-symbol svg {
  width: 15px;
  height: 15px;
}

.confirmation-copy {
  min-width: 0;
  flex: 1;
}

.confirmation-copy strong {
  display: block;
  font-size: 10px;
  font-weight: 600;
}

.confirmation-copy span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8px;
  margin-top: 20px;
}

.drawer-danger-action {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 9.5px;
  font-weight: 600;
}

.drawer-danger-action:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* Roles, equipo y modo de solo lectura */
.read-only-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.read-only-badge svg {
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.resource-day.read-only {
  cursor: default;
}

.resource-day.read-only:hover {
  z-index: auto;
  background: inherit;
  box-shadow: none;
}

.resource-day.read-only:hover::after {
  display: none;
}

.agenda-row.read-only-agenda {
  grid-template-columns: 74px minmax(150px, 1.2fr) minmax(160px, 1fr) 110px 36px;
}

.drawer-read-only-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9.5px;
  line-height: 1.4;
}

.drawer-read-only-note svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--accent);
}

.team-intro-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.team-intro-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
}

.team-intro-icon svg {
  width: 20px;
  height: 20px;
}

.team-intro-card > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.team-intro-card strong {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.team-intro-card p {
  max-width: 720px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.team-list-card {
  margin-top: 14px;
  overflow: hidden;
}

.team-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 13px;
  border-bottom: 1px solid var(--line);
}

.team-list-head h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.team-list-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.team-member-list {
  display: grid;
}

.team-member-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 112px 90px auto;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
}

.team-member-row:last-child {
  border-bottom: 0;
}

.team-member-row.is-inactive {
  background: var(--surface-soft);
}

.team-member-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.team-member-identity:hover .team-member-copy strong {
  color: var(--accent);
}

.team-member-identity:focus-visible {
  border-radius: 9px;
  outline-offset: 4px;
}

.team-member-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.team-avatar {
  width: 34px;
  height: 34px;
  background: var(--accent);
}

.team-member-copy {
  min-width: 0;
}

.team-member-copy strong,
.team-member-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-copy strong {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.team-member-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
}

.role-pill,
.team-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 600;
  white-space: nowrap;
}

.role-admin {
  color: var(--accent);
  background: var(--accent-soft);
}

.role-employee {
  color: var(--ink-soft);
  background: var(--surface-strong);
}

.role-editor {
  color: #7c6134;
  background: #f5eddf;
}

.team-status.active {
  color: #537061;
  background: #edf3ef;
}

.team-status.inactive {
  color: var(--muted);
  background: var(--surface-strong);
}

.team-current-label {
  color: var(--muted-2);
  font-size: 9px;
  white-space: nowrap;
}

.team-empty {
  min-height: 220px;
}

.team-permissions-guide {
  margin-top: 14px;
  padding: 18px 20px;
}

.team-permissions-guide-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.team-permissions-guide-head h2 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.team-permissions-guide-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9.5px;
}

.team-permissions-guide-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 8.5px;
  font-weight: 600;
  white-space: nowrap;
}

.team-permissions-guide-badge svg {
  width: 13px;
  height: 13px;
}

.team-role-guide-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 15px;
}

.team-role-guide {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.team-role-guide.role-guide-admin {
  border-color: #d5e3dc;
  background: var(--accent-soft);
}

.team-role-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.team-role-guide-head strong {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.team-role-guide-head span {
  color: var(--muted-2);
  font-size: 8px;
}

.team-role-guide-permissions {
  display: grid;
  gap: 5px;
}

.team-role-guide-permissions span {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.25;
}

.team-role-guide-permissions svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: var(--accent);
}

.team-member-modal {
  width: min(100%, 640px);
}

.team-member-profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.team-avatar-large {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  font-size: 13px;
}

.team-member-profile-summary > div {
  min-width: 0;
  flex: 1;
}

.team-member-profile-summary strong,
.team-member-profile-summary span,
.team-member-profile-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-profile-summary strong {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.team-member-profile-summary div span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.team-member-profile-summary small {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8px;
}

.team-member-form-grid {
  margin-bottom: 2px;
}

.team-access-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  cursor: pointer;
}

.team-access-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.team-access-toggle-control {
  position: relative;
  width: 36px;
  height: 21px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 150ms ease;
}

.team-access-toggle-control::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(37, 40, 35, 0.18);
  content: "";
  transition: transform 150ms ease;
}

.team-access-toggle input:checked + .team-access-toggle-control {
  background: var(--accent);
}

.team-access-toggle input:checked + .team-access-toggle-control::after {
  transform: translateX(15px);
}

.team-access-toggle input:disabled + .team-access-toggle-control {
  cursor: not-allowed;
  opacity: 0.55;
}

.team-access-toggle:focus-within {
  border-color: #9aaea2;
  box-shadow: 0 0 0 3px rgba(51, 76, 64, 0.09);
}

.team-access-toggle-copy {
  min-width: 0;
}

.team-access-toggle-copy strong,
.team-access-toggle-copy small {
  display: block;
}

.team-access-toggle-copy strong {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}

.team-access-toggle-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8.5px;
}

.team-permission-panel {
  margin: 0 22px 18px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.team-permission-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.team-permission-panel-head h3 {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.team-permission-panel-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 8.5px;
}

.team-permission-row {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

.team-permission-state {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-strong);
}

.team-permission-row.allowed .team-permission-state {
  color: var(--accent);
  background: var(--accent-soft);
}

.team-permission-state svg {
  width: 13px;
  height: 13px;
}

.team-permission-copy {
  min-width: 0;
}

.team-permission-copy strong,
.team-permission-copy small {
  display: block;
}

.team-permission-copy strong {
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
}

.team-permission-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.team-permission-label {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.team-permission-row.allowed .team-permission-label {
  color: var(--accent);
}

/* Toast */
.toast-root {
  position: fixed;
  z-index: 200;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(360px, calc(100vw - 40px));
  gap: 9px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-md);
  font-size: 10.5px;
  pointer-events: auto;
  animation: toast-in 200ms ease-out;
  backdrop-filter: blur(10px);
}

.toast.removing {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast-icon {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
}

.toast.error .toast-icon {
  color: var(--danger);
  background: var(--danger-soft);
}

.toast-icon svg {
  width: 13px;
  height: 13px;
}

.toast-copy {
  flex: 1;
  padding-top: 1px;
}

.toast-copy strong {
  display: block;
  margin-bottom: 1px;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 600;
}

.toast-copy span {
  display: block;
  color: var(--muted);
  line-height: 1.4;
}

.toast-close {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--muted-2);
  background: transparent;
  cursor: pointer;
}

.toast-close:hover {
  color: var(--ink);
  background: var(--surface-strong);
}

.toast-close svg {
  width: 12px;
  height: 12px;
}

/* Responsive */
@media (max-width: 1180px) {
  .finance-collection-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-breakdown {
    grid-column: 1 / -1;
  }

  .finance-table-card {
    overflow-x: auto;
  }

  .finance-table-head,
  .finance-table-row {
    min-width: 1000px;
  }

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

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

  .table-head,
  .table-row {
    grid-template-columns: minmax(170px, 1.2fr) minmax(135px, 0.9fr) minmax(150px, 1fr) 80px 95px 32px;
    gap: 10px;
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 218px;
  }

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

  .rail-card {
    min-width: 0;
  }

  .agenda-row {
    grid-template-columns: 64px minmax(140px, 1fr) minmax(140px, 1fr) 85px 34px;
  }

  .agenda-row .amount-cell,
  .agenda-row .payment-cell {
    display: none;
  }

  .table-head,
  .table-row {
    grid-template-columns: minmax(170px, 1.2fr) minmax(130px, 0.9fr) minmax(150px, 1fr) 90px 32px;
  }

  .table-head .payment-head,
  .table-row .payment-cell {
    display: none;
  }
}

@media (max-width: 760px) {
  /* Netlify inyecta este iframe fuera de la aplicación. En móvil ocupa la
     esquina inferior y se superpone a la barra de Nido, así que lo ocultamos
     solo en pantallas pequeñas; en escritorio se conserva. */
  #nl-badge-frame,
  #nl-hud-frame {
    display: none !important;
  }

  .auth-screen {
    display: block;
    min-height: 100vh;
  }

  .auth-side-panel {
    display: none;
  }

  .auth-form-panel {
    min-height: 100vh;
    align-items: start;
    padding: 28px 20px 40px;
  }

  .auth-mobile-brand {
    display: flex;
  }

  .auth-form-wrap {
    padding-top: 8px;
  }

  .setup-screen {
    align-items: start;
    padding: 16px;
  }

  .setup-card {
    padding: 26px 20px;
  }

  .setup-card h1 {
    font-size: 30px;
  }

  .sidebar {
    width: min(286px, 85vw);
    transform: translateX(-102%);
    transition: transform 200ms ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 20px 0 60px rgba(31, 34, 30, 0.18);
  }

  .mobile-backdrop {
    position: fixed;
    z-index: 29;
    inset: 0;
    display: block;
    background: rgba(31, 34, 30, 0.34);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  .mobile-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    margin-left: 0;
  }

  .topbar {
    height: 66px;
    padding: 0 16px;
  }

  .mobile-menu-button {
    display: grid;
    margin-right: 3px;
  }

  .topbar-eyebrow {
    display: none;
  }

  .topbar-title {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar .button-primary span {
    display: none;
  }

  .topbar .button-primary {
    width: 40px;
    padding: 0;
  }

  .topbar-expense-button {
    width: 40px;
    padding: 0;
  }

  .topbar-expense-button span {
    display: none;
  }

  .main-content {
    padding: 22px 14px 92px;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 25;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 66px;
    padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 -8px 24px rgba(37, 40, 35, 0.06);
    backdrop-filter: blur(16px);
  }

  .mobile-bottom-item {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 3px;
    border: 0;
    border-radius: 10px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 8px;
    font-weight: 600;
  }

  .mobile-bottom-item svg {
    width: 17px;
    height: 17px;
  }

  .mobile-bottom-item.active {
    color: var(--accent);
    background: var(--accent-soft);
  }

  .mobile-bottom-item span {
    overflow: hidden;
    max-width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-heading {
    align-items: flex-start;
    margin-bottom: 19px;
  }

  .page-title {
    font-size: 30px;
  }

  .page-description {
    font-size: 11px;
  }

  .heading-actions .button-secondary {
    display: none;
  }

  .stats-grid {
    gap: 9px;
  }

  .stat-card {
    min-height: 90px;
    gap: 10px;
    padding: 13px;
  }

  .stat-icon {
    width: 32px;
    height: 32px;
  }

  .stat-value {
    font-size: 18px;
  }

  .calendar-toolbar {
    flex-wrap: wrap;
    padding: 12px;
  }

  .month-navigation {
    width: 100%;
  }

  .month-picker-wrap {
    min-width: 0;
    flex: 1;
    margin-right: 2px;
  }

  .month-label-button {
    width: 100%;
    min-width: 0;
  }

  .month-picker-popover {
    width: min(310px, calc(100vw - 42px));
  }

  .calendar-toolbar > .segmented {
    width: 100%;
  }

  .calendar-toolbar > .segment-button {
    flex: 1;
  }

  .calendar-filters {
    padding: 9px 12px;
  }

  .filter-summary {
    display: none;
  }

  .calendar-filters .filter-spacer {
    display: none;
  }

  .calendar-filters .select-control {
    width: 100%;
  }

  .timeline-filters {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .timeline-instruction {
    flex: 1 0 100%;
  }

  .timeline-booking-count {
    display: none;
  }

  .resource-grid-header,
  .resource-row {
    --property-column: 150px;
  }

  .resource-property {
    padding-right: 9px;
    padding-left: 12px;
  }

  .resource-property-occupancy,
  .resource-pill-meta {
    display: none;
  }

  .resource-row {
    height: 62px;
    min-height: 62px;
  }

  .resource-property-name {
    font-size: 9px;
  }

  .timeline-footer {
    display: flex;
    min-height: 34px;
    padding: 6px 12px;
  }

  .timeline-footer .legend-hint {
    display: inline-flex;
    font-size: 8.5px;
  }

  .timeline-footer .legend-hint:last-child {
    display: none;
  }

  .weekday {
    padding: 8px 5px;
    font-size: 8px;
    text-align: center;
  }

  .calendar-grid {
    grid-auto-rows: minmax(87px, 1fr);
  }

  .calendar-day {
    padding: 5px 3px;
  }

  .day-top {
    margin-bottom: 3px;
  }

  .day-number {
    width: 21px;
    height: 21px;
    font-size: 9px;
  }

  .day-add {
    display: none;
  }

  .calendar-event {
    height: 20px;
    gap: 3px;
    padding: 0 3px;
    border-left-width: 2px;
    border-radius: 3px;
    font-size: 0;
  }

  .event-dot {
    width: 5px;
    height: 5px;
  }

  .event-property {
    display: none;
  }

  .more-events {
    padding: 0 2px;
    font-size: 8px;
  }

  .calendar-legend {
    overflow-x: auto;
  }

  .legend-hint {
    display: none;
  }

  .insights-rail {
    grid-template-columns: 1fr;
  }

  .properties-grid {
    grid-template-columns: 1fr;
  }

  .finance-toolbar {
    flex-wrap: wrap;
  }

  .finance-toolbar .month-navigation {
    width: 100%;
  }

  .finance-toolbar > .select-control {
    width: 100%;
  }

  .finance-collection-card {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px;
  }

  .finance-breakdown {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .finance-breakdown > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .finance-breakdown > div:last-child {
    border-bottom: 0;
  }

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

  .expense-category-summary {
    grid-column: 1 / -1;
  }

  .expense-shortcut-tip {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .expense-shortcut-tip > div {
    flex-basis: calc(100% - 43px);
  }

  .expense-shortcut-tip > .button {
    margin-left: 39px;
  }

  .finance-expenses-section .heading-actions .button-secondary {
    display: inline-flex;
  }

  .expense-property-total-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .expense-row {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: start;
  }

  .expense-row-amount {
    grid-column: 2;
    min-width: 0;
    margin-top: -2px;
    text-align: left;
  }

  .expense-row-actions {
    grid-column: 3;
    grid-row: 1 / span 2;
    flex-direction: column;
  }

  .mobile-expense-fab {
    position: fixed;
    z-index: 26;
    right: 16px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    display: inline-flex;
    min-width: 66px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1px;
    padding: 5px 10px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 8px 20px rgba(37, 40, 35, 0.2);
    cursor: pointer;
    font-size: 9px;
    font-weight: 600;
  }

  .mobile-expense-fab svg {
    width: 17px;
    height: 17px;
  }

  .filter-bar {
    flex-wrap: wrap;
  }

  .search-wrap {
    width: 100%;
    max-width: none;
    flex-basis: 100%;
  }

  .filter-bar .select-control {
    flex: 1;
  }

  .filter-spacer-small,
  .result-count {
    display: none;
  }

  .table-head {
    display: none;
  }

  .table-row {
    grid-template-columns: minmax(0, 1fr) 94px 30px;
    gap: 10px;
    min-height: 76px;
  }

  .table-row .property-cell,
  .table-row .dates-cell,
  .table-row .payment-cell,
  .table-head .property-head,
  .table-head .dates-head,
  .table-head .payment-head {
    display: none;
  }

  .agenda-row {
    grid-template-columns: 56px minmax(0, 1fr) 30px;
    gap: 10px;
    min-height: 74px;
  }

  .agenda-row .property-cell,
  .agenda-row .dates-cell,
  .agenda-row .amount-cell,
  .agenda-row .payment-cell {
    display: none;
  }

  .agenda-row.read-only-agenda {
    grid-template-columns: 56px minmax(0, 1fr) 85px 30px;
  }

  .mobile-bottom-nav.read-only-mobile-nav {
    grid-template-columns: 1fr;
  }

  .team-intro-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .team-intro-card > div:nth-child(2) {
    flex-basis: calc(100% - 58px);
  }

  .team-intro-card > .button {
    width: 100%;
    margin-left: 56px;
  }

  .team-member-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 12px 14px;
  }

  .team-member-identity {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .team-member-row .role-pill {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .team-member-row .team-status {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  .team-member-actions {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: flex-end;
  }

  .team-role-guide-list {
    grid-template-columns: 1fr;
  }

  .team-member-profile-summary {
    align-items: flex-start;
  }

  .team-member-profile-summary > .role-pill {
    display: none;
  }

  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .form-field.full {
    grid-column: auto;
  }

  .modal-overlay {
    align-items: end;
    padding: 0;
  }

  .modal-panel,
  .modal-panel.small {
    width: 100%;
    max-height: 94vh;
    border-radius: 20px 20px 0 0;
    border-bottom: 0;
    animation-name: sheet-in;
  }

  .email-composer-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .email-template-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .email-template-list {
    display: flex;
    overflow-x: auto;
    padding: 8px 10px;
  }

  .email-template-item {
    min-width: 145px;
  }

  .email-template-delete {
    display: none;
  }

  .email-editor {
    padding: 15px;
  }

  .email-message-textarea {
    min-height: 210px;
  }

  .email-composer-footer .button {
    flex: 1;
  }

  .drawer {
    width: 100%;
  }

  .modal-footer .footer-note {
    display: none;
  }

  .properties-callout {
    align-items: flex-start;
  }
}

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

  .stat-card {
    display: block;
  }

  .stat-icon {
    margin-bottom: 8px;
  }

  .page-heading {
    display: block;
  }

  .heading-actions {
    margin-top: 13px;
  }

  .heading-actions .button-primary {
    width: 100%;
  }

  .finance-expenses-section .section-heading-row {
    display: block;
  }

  .finance-expenses-section .heading-actions {
    width: 100%;
    margin-top: 12px;
  }

  .finance-expenses-section .heading-actions .button-secondary {
    display: inline-flex;
    flex: 1;
  }

  .finance-expenses-section .heading-actions .button-primary {
    flex: 1;
  }

  .expense-summary-card {
    padding: 12px;
  }

  .expense-summary-card strong {
    font-size: 15px;
  }

  .expense-shortcut-tip > .button {
    width: calc(100% - 39px);
    margin-left: 39px;
  }

  .team-permissions-guide {
    padding: 14px;
  }

  .team-permissions-guide-head {
    display: block;
  }

  .team-permissions-guide-badge {
    display: inline-flex;
    margin-top: 10px;
  }

  .team-member-actions {
    flex-wrap: wrap;
  }

  .team-permission-panel {
    margin-right: 14px;
    margin-left: 14px;
  }

  .calendar-toolbar .segmented {
    width: 100%;
  }

  .calendar-toolbar .segment-button {
    flex: 1;
  }

  .month-navigation {
    width: 100%;
  }

  .calendar-grid {
    grid-auto-rows: minmax(79px, 1fr);
  }

  .detail-contact {
    grid-template-columns: 1fr;
  }

  .drawer-actions {
    grid-template-columns: 1fr;
  }
}

@keyframes auth-pulse {
  from { opacity: 0.35; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Nido visual system: lavender / sky / slate palette.
   This layer changes presentation only; application behavior remains in app.js. */
:root {
  --sky: #a0d2e8;
  --lavender: #d0bdf4;
  --purple: #8458b3;
  --slate: #494d5f;
  --bg: #e5eaf5;
  --surface: #ffffff;
  --surface-soft: #f5f6fc;
  --surface-strong: #e1e5f2;
  --ink: #343746;
  --ink-soft: #4b4f61;
  --muted: #626879;
  --muted-2: #858aa0;
  --line: rgba(73, 77, 95, 0.14);
  --line-strong: rgba(73, 77, 95, 0.24);
  --accent: #8458b3;
  --accent-hover: #6e429a;
  --accent-soft: #e9dff8;
  --coral-soft: #e2f1fa;
  --danger: #b04f68;
  --danger-soft: #f9e2ea;
  --warning: #9b7135;
  --warning-soft: #fff0d7;
  --success: #4b8b6e;
  --success-soft: #e0f0e7;
  --shadow-sm: 0 2px 5px rgba(73, 77, 95, 0.05), 0 10px 24px rgba(73, 77, 95, 0.05);
  --shadow-md: 0 20px 48px rgba(73, 77, 95, 0.14);
  --sidebar-width: 224px;
}

html {
  color-scheme: light;
  background: var(--bg);
}

body {
  background: linear-gradient(135deg, #a0d2e8 0%, #e5eaf5 48%, #d0bdf4 100%);
  color: var(--ink);
  font-family: "DM Sans", "Segoe UI", sans-serif;
}

body:has(#theme-toggle:checked) {
  --bg: #343846;
  --surface: #414659;
  --surface-soft: #383d4e;
  --surface-strong: #4b5064;
  --ink: #f2f3fa;
  --ink-soft: #d9dcec;
  --muted: #b8bdd1;
  --muted-2: #969db6;
  --line: rgba(229, 234, 245, 0.16);
  --line-strong: rgba(229, 234, 245, 0.27);
  --accent: #d0bdf4;
  --accent-hover: #b9a0e6;
  --accent-soft: #49415e;
  --coral-soft: #354a5b;
  --danger: #f09aaa;
  --danger-soft: #4a303b;
  --warning: #f1c27d;
  --warning-soft: #4a3c2b;
  --success: #a8d0bf;
  --success-soft: #344a45;
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.18), 0 10px 24px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 22px 54px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
  background: linear-gradient(145deg, #363a4b 0%, #494d5f 52%, #303444 100%);
}

.theme-toggle-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.skip-link {
  background: var(--purple);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline-color: color-mix(in srgb, var(--purple) 35%, transparent);
}

.app-shell {
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  border-right-color: rgba(229, 234, 245, 0.1);
  color: #e5eaf5;
  background: var(--slate);
  box-shadow: 12px 0 32px rgba(73, 77, 95, 0.08);
}

.brand {
  height: 84px;
  padding: 0 24px;
}

.brand-mark {
  color: var(--slate);
  background: var(--sky);
  box-shadow: 0 8px 18px rgba(73, 77, 95, 0.2);
}

.brand-name {
  color: #ffffff;
  font-size: 28px;
}

.brand-caption {
  color: #c8cee0;
  font-size: 10px;
}

.sidebar-nav {
  padding: 16px 14px;
}

.nav-label {
  color: #b7bdd1;
}

.nav-item {
  position: relative;
  color: #e5eaf5;
  font-size: 12px;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(229, 234, 245, 0.09);
}

.nav-item.active {
  color: #ffffff;
  background: rgba(229, 234, 245, 0.13);
}

.nav-item.active::before {
  position: absolute;
  top: 11px;
  bottom: 11px;
  left: 0;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--lavender);
  content: "";
}

.nav-item.active .nav-count {
  color: var(--slate);
  background: var(--sky);
}

.nav-count {
  color: #e5eaf5;
  background: rgba(229, 234, 245, 0.12);
}

.sidebar-note {
  border-color: rgba(229, 234, 245, 0.15);
  color: #c8cee0;
  background: rgba(229, 234, 245, 0.07);
}

.sidebar-note-head {
  color: #ffffff;
}

.sidebar-note-head svg {
  color: var(--sky);
}

.sidebar-note p {
  color: #c8cee0;
  font-size: 11px;
}

.sidebar-user {
  border-top-color: rgba(229, 234, 245, 0.15);
}

.avatar {
  color: var(--slate);
  background: var(--sky);
}

.user-name {
  color: #ffffff;
  font-size: 12px;
}

.user-role,
.sidebar-user .icon-button {
  color: #c8cee0;
}

.mobile-backdrop {
  background: rgba(36, 39, 52, 0.46);
}

/* Workspace and topbar */
.workspace {
  margin-left: var(--sidebar-width);
  background: transparent;
}

.topbar {
  border-bottom-color: var(--line);
  background: rgba(229, 234, 245, 0.78);
  box-shadow: 0 4px 20px rgba(73, 77, 95, 0.04);
  backdrop-filter: blur(16px);
}

body:has(#theme-toggle:checked) .topbar {
  background: rgba(52, 56, 70, 0.82);
}

.topbar-eyebrow {
  color: var(--muted);
  font-size: 11px;
}

.topbar-title {
  color: var(--ink);
  font-size: 17px;
}

.topbar-actions {
  gap: 10px;
}

.theme-toggle-control {
  display: inline-flex;
  height: 34px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  user-select: none;
}

.theme-icon {
  width: 13px;
  height: 13px;
}

.theme-toggle-track {
  position: relative;
  width: 29px;
  height: 17px;
  border-radius: 999px;
  background: var(--surface-strong);
  transition: background 150ms ease;
}

.theme-toggle-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 1px 3px rgba(73, 77, 95, 0.2);
  transition: transform 150ms ease, background 150ms ease;
}

#theme-toggle:checked ~ #app .theme-toggle-track {
  background: var(--purple);
}

#theme-toggle:checked ~ #app .theme-toggle-track span {
  background: #ffffff;
  transform: translateX(12px);
}

.icon-button {
  border-color: var(--line);
  color: var(--muted);
  background: var(--surface);
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface-soft);
}

.notification-panel,
.month-picker-popover {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.notification-item:hover {
  background: var(--surface-soft);
}

/* Main content and shared surfaces */
.main-content {
  max-width: 1500px;
  padding: 31px 36px 48px;
}

.page-heading {
  margin-bottom: 24px;
}

.page-kicker {
  color: var(--purple);
  font-size: 10.5px;
}

.page-title {
  color: var(--ink);
  font-size: clamp(32px, 3vw, 40px);
  font-weight: 600;
}

.page-description {
  color: var(--muted);
  font-size: 13px;
}

.card,
.calendar-card,
.finance-collection-card,
.expense-summary-card,
.expense-category-summary,
.expense-row,
.filter-bar,
.team-permissions-guide,
.team-member-modal,
.team-member-profile-summary {
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.card,
.calendar-card {
  border-radius: 20px;
}

/* Buttons and controls */
.button {
  border-radius: 11px;
  font-size: 12px;
}

.button-primary {
  color: #ffffff;
  background: var(--purple);
  box-shadow: 0 7px 16px rgba(132, 88, 179, 0.2);
}

.button-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 9px 20px rgba(132, 88, 179, 0.26);
}

body:has(#theme-toggle:checked) .button-primary {
  color: #343746;
  background: var(--lavender);
}

body:has(#theme-toggle:checked) .button-primary:hover {
  background: #ddcff8;
}

.button-secondary,
.topbar-expense-button {
  color: var(--purple);
  border-color: color-mix(in srgb, var(--purple) 22%, var(--line));
  background: var(--accent-soft);
}

.button-secondary:hover,
.topbar-expense-button:hover {
  color: var(--accent-hover);
  border-color: color-mix(in srgb, var(--purple) 34%, var(--line));
  background: color-mix(in srgb, var(--purple) 15%, var(--surface));
}

.topbar-expense-button {
  color: #67418f;
  border-color: #b7cce0;
  background: #e2f1fa;
}

body:has(#theme-toggle:checked) .topbar-expense-button {
  color: var(--sky);
  border-color: #536d7c;
  background: var(--coral-soft);
}

.button-ghost:hover {
  background: var(--surface-strong);
}

.select-control,
.search-input,
.form-control {
  border-color: var(--line);
  color: var(--ink-soft);
  background: var(--surface-soft);
}

.select-control:hover,
.search-input:hover,
.form-control:hover {
  border-color: var(--line-strong);
}

.form-control:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 14%, transparent);
}

.form-hint,
.form-label small {
  color: var(--muted-2);
}

/* Calendar */
.calendar-card {
  overflow: hidden;
}

.calendar-toolbar {
  min-height: 76px;
  padding: 13px 19px;
  border-bottom-color: var(--line);
  background: var(--surface);
}

.month-label-button {
  min-width: 185px;
  min-height: 38px;
  font-size: 15px;
}

.month-label-button:hover,
.month-label-button[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface-soft);
}

.segmented {
  border-color: var(--line);
  background: var(--surface-muted);
}

.segment-button {
  color: var(--muted);
  font-size: 11px;
}

.segment-button.active {
  color: var(--purple);
  background: var(--surface);
}

.calendar-filters {
  min-height: 57px;
  padding: 10px 19px;
  border-bottom-color: var(--line);
  background: var(--surface-soft);
}

.timeline-instruction,
.timeline-booking-count {
  font-size: 10.5px;
}

.timeline-instruction svg {
  color: var(--purple);
}

.calendar-filters .select-control {
  background: var(--surface);
}

.resource-calendar {
  background: var(--surface);
  scrollbar-color: color-mix(in srgb, var(--purple) 28%, var(--surface)) transparent;
}

.resource-calendar::-webkit-scrollbar-track {
  background: var(--surface-soft);
}

.resource-calendar::-webkit-scrollbar-thumb {
  border-color: var(--surface-soft);
  background: color-mix(in srgb, var(--purple) 28%, var(--surface));
}

.resource-grid-header,
.resource-row {
  --property-column: 126px;
  grid-template-columns: var(--property-column) repeat(var(--day-count), minmax(32px, 1fr));
}

.resource-grid-header {
  min-height: 48px;
  border-bottom-color: var(--line);
  background: var(--surface-soft);
}

.resource-header-title {
  padding: 0 12px;
  border-right-color: var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  box-shadow: 5px 0 10px rgba(73, 77, 95, 0.03);
  font-size: 8.5px;
}

.resource-day-header {
  border-right-color: var(--line);
  color: var(--muted-2);
  font-size: 8.5px;
}

.resource-day-header.weekend {
  background: color-mix(in srgb, var(--lavender) 14%, var(--surface-soft));
}

.resource-day-header.today {
  background: color-mix(in srgb, var(--sky) 18%, var(--surface));
}

.resource-day-header strong {
  color: var(--ink-soft);
  font-size: 10.5px;
}

.resource-day-header.today strong {
  color: var(--slate);
  background: var(--sky);
}

body:has(#theme-toggle:checked) .resource-day-header.today strong {
  color: #343746;
  background: var(--sky);
}

.resource-row {
  height: 64px;
  min-height: 64px;
  border-bottom-color: var(--line);
  background: var(--surface);
}

.resource-property {
  gap: 8px;
  padding: 0 10px;
  border-right-color: var(--line);
  background: var(--surface-soft);
  box-shadow: 5px 0 10px rgba(73, 77, 95, 0.03);
}

.resource-property::before {
  width: 5px;
  height: 27px;
}

.resource-property-name {
  font-size: 9.5px;
}

.resource-property-copy span {
  color: var(--muted);
  font-size: 8px;
}

.resource-property-occupancy {
  color: var(--muted-2);
  font-size: 8px;
}

.resource-day {
  border-right-color: var(--line);
  background: var(--surface);
}

.resource-day.weekend {
  background: color-mix(in srgb, var(--lavender) 8%, var(--surface));
}

.resource-day:hover {
  background: var(--accent-soft);
}

.resource-day.today {
  box-shadow: inset 1px 0 0 color-mix(in srgb, var(--purple) 32%, transparent), inset -1px 0 0 color-mix(in srgb, var(--purple) 32%, transparent);
}

.resource-day.selected-range {
  background: color-mix(in srgb, var(--lavender) 24%, var(--surface));
}

.resource-day.selected-start,
.resource-day.selected-end {
  background: color-mix(in srgb, var(--lavender) 42%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--purple) 38%, transparent);
}

.selection-marker {
  color: #ffffff;
  background: var(--purple);
}

body:has(#theme-toggle:checked) .selection-marker {
  color: #343746;
  background: var(--lavender);
}

.resource-pill {
  height: 31px;
  margin: 0 4px;
  border: 1px solid color-mix(in srgb, var(--pill-color) 34%, var(--line)) !important;
  border-left: 3px solid var(--pill-color) !important;
  border-radius: 8px;
  color: var(--ink-soft) !important;
  background: color-mix(in srgb, var(--pill-color) 17%, var(--surface)) !important;
  box-shadow: 0 3px 8px rgba(73, 77, 95, 0.08);
}

.resource-pill:hover {
  box-shadow: 0 6px 14px rgba(73, 77, 95, 0.16);
}

body:has(#theme-toggle:checked) .resource-pill {
  border-color: color-mix(in srgb, var(--pill-color) 58%, var(--line)) !important;
  color: #f2f3fa !important;
  background: color-mix(in srgb, var(--pill-color) 31%, #202832) !important;
  box-shadow: 0 0 0 1px rgba(229, 234, 245, 0.06), 0 5px 12px rgba(0, 0, 0, 0.24);
}

.resource-pill-name {
  font-size: 9.5px;
}

.resource-pill-meta {
  color: var(--muted);
  font-size: 7.5px;
}

body:has(#theme-toggle:checked) .resource-pill-meta {
  color: #d9dcec;
}

.timeline-footer,
.calendar-legend {
  border-top-color: var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 9.5px;
}

/* Cards, status and supporting views */
.stat-icon,
.finance-card-icon,
.expense-row-icon,
.properties-callout-icon,
.team-intro-icon,
.empty-state-icon,
.add-property-icon,
.email-recipient-icon,
.toast-icon,
.contact-link svg,
.drawer-read-only-note svg {
  color: var(--purple);
  background: var(--accent-soft);
}

.stat-label,
.finance-card-label,
.expense-summary-card span,
.expense-summary-card small,
.section-heading-row p,
.property-location,
.property-facts,
.empty-state p,
.rail-empty {
  color: var(--muted);
}

.status-confirmed,
.payment-paid,
.confirmation-sent,
.team-status.active {
  color: var(--success);
  background: var(--success-soft);
}

.status-pending,
.payment-partial,
.confirmation-prepared {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-canceled,
.payment-pending,
.confirmation-pending {
  color: var(--danger);
  background: var(--danger-soft);
}

.role-admin,
.team-permissions-guide-badge {
  color: var(--purple);
  background: var(--accent-soft);
}

.team-role-guide.role-guide-admin {
  border-color: color-mix(in srgb, var(--purple) 24%, var(--line));
  background: var(--accent-soft);
}

.team-avatar {
  color: var(--slate);
  background: var(--sky);
}

.add-property-card {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 42%, transparent);
}

.add-property-card:hover {
  color: var(--purple);
  border-color: color-mix(in srgb, var(--purple) 30%, var(--line));
  background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.auth-side-panel {
  color: #f2f3fa;
  background: var(--slate);
}

.auth-side-brand .auth-brand-mark,
.auth-mobile-brand .auth-brand-mark {
  color: var(--slate);
  background: var(--sky);
}

.auth-side-copy > p,
.auth-side-foot {
  color: #c8cee0;
}

.auth-side-copy h1 {
  color: #ffffff;
}

.auth-side-points {
  color: #e5eaf5;
}

.auth-side-points svg {
  color: var(--sky);
}

.auth-form-panel,
.auth-mobile-brand {
  color: var(--ink);
  background: var(--surface);
}

.auth-message {
  border-color: color-mix(in srgb, var(--purple) 24%, var(--line));
  color: var(--purple);
  background: var(--accent-soft);
}

.modal-header,
.modal-footer,
.drawer-header {
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
}

.modal-panel,
.drawer {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.form-section,
.drawer-section,
.detail-item,
.contact-link,
.balance-preview,
.email-preview,
.email-template-sidebar,
.email-recipient-bar,
.team-member-profile-summary,
.team-permission-panel {
  border-color: var(--line);
  background: var(--surface-soft);
}

body:has(#theme-toggle:checked) .modal-header,
body:has(#theme-toggle:checked) .modal-footer,
body:has(#theme-toggle:checked) .drawer-header {
  background: rgba(65, 70, 89, 0.94);
}

body:has(#theme-toggle:checked) .modal-overlay,
body:has(#theme-toggle:checked) .drawer-overlay {
  background: rgba(26, 29, 39, 0.62);
}

body:has(#theme-toggle:checked) .toast {
  background: rgba(65, 70, 89, 0.97);
}

body:has(#theme-toggle:checked) .mobile-bottom-nav {
  background: rgba(52, 56, 70, 0.94);
}

body:has(#theme-toggle:checked) .topbar,
body:has(#theme-toggle:checked) .main-content {
  color: var(--ink);
}

/* Mobile keeps the same palette and the new visual control. */
@media (max-width: 760px) {
  :root {
    --sidebar-width: 0px;
  }

  .theme-toggle-control {
    width: 34px;
    justify-content: center;
    padding: 0;
  }

  .theme-icon {
    display: none;
  }

  .sidebar {
    background: var(--slate);
  }

  .topbar {
    background: rgba(229, 234, 245, 0.86);
  }

  body:has(#theme-toggle:checked) .topbar {
    background: rgba(52, 56, 70, 0.9);
  }

  .resource-grid-header,
  .resource-row {
    --property-column: 126px;
  }

  .resource-row {
    height: 62px;
    min-height: 62px;
  }

  .resource-property {
    padding-right: 8px;
    padding-left: 10px;
  }

  .resource-property-name {
    font-size: 9px;
  }

  .resource-pill-meta {
    display: none;
  }
}

/* Final mobile guard: keep the navigation off-canvas until explicitly opened. */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    width: 100%;
  }

  .sidebar {
    z-index: 40;
    width: min(286px, 85vw) !important;
    max-width: 86vw;
    visibility: hidden;
    transform: translateX(-102%) !important;
    transition: transform 200ms ease, visibility 200ms ease;
  }

  .sidebar.mobile-open {
    visibility: visible;
    transform: translateX(0) !important;
  }

  .mobile-backdrop {
    z-index: 35;
    display: block;
  }

  .workspace {
    width: 100%;
    margin-left: 0 !important;
  }

  .topbar {
    width: 100%;
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
    overflow: hidden;
  }

  .topbar-title-wrap {
    min-width: 0;
    flex: 1 1 auto;
    gap: 6px;
    overflow: hidden;
  }

  .topbar-title {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-actions {
    flex: 0 0 auto;
    gap: 4px;
  }

  .topbar-actions > .notification-wrap,
  .topbar-actions > .icon-button,
  .topbar-actions > .button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    flex: 0 0 36px;
  }

  .topbar-actions > .button {
    padding: 0;
  }

  .theme-toggle-control {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
  }

  .topbar .button-primary span,
  .topbar-expense-button span {
    display: none;
  }

  .main-content {
    width: 100%;
    max-width: 100%;
  }

  .main-content .card,
  .filter-bar,
  .filter-bar .select-control {
    min-width: 0;
  }
}

/* Compact timeline on phones: preserve horizontal scrolling while showing more days. */
@media (max-width: 760px) {
  .calendar-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 52px;
    gap: 6px;
    padding: 8px 10px;
  }

  .month-navigation {
    width: 100%;
    min-width: 0;
    gap: 2px;
  }

  .month-picker-wrap {
    min-width: 0;
    flex: 1 1 auto;
    margin: 0 2px;
  }

  .month-label-button {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    padding: 0 5px;
    font-size: 12px;
    white-space: nowrap;
  }

  .month-label-button svg {
    display: none;
  }

  .calendar-toolbar > .segmented {
    width: 100%;
    flex: 0 0 auto;
  }

  .calendar-toolbar .segment-button {
    min-height: 28px;
    flex: 1 1 0;
    padding: 0 8px;
    font-size: 9px;
  }

  .timeline-filters {
    gap: 6px;
    padding: 6px 8px;
  }

  .timeline-instruction {
    font-size: 9px;
    line-height: 1.25;
  }

  .timeline-instruction svg {
    width: 13px;
    height: 13px;
  }

  .timeline-filters .select-control {
    width: 100%;
    min-width: 0;
    height: 32px;
    font-size: 10px;
  }

  .resource-grid-header,
  .resource-row {
    --property-column: 112px;
    grid-template-columns: 112px repeat(var(--day-count), minmax(25px, 1fr));
    min-width: calc(112px + var(--day-count) * 25px) !important;
  }

  .resource-grid-header {
    min-height: 40px;
  }

  .resource-header-title {
    padding: 0 7px;
    font-size: 7px;
    letter-spacing: 0.06em;
  }

  .resource-day-header {
    font-size: 7px;
  }

  .resource-day-header strong {
    width: 20px;
    height: 20px;
    font-size: 9px;
  }

  .resource-property {
    gap: 5px;
    padding-right: 6px;
    padding-left: 6px;
  }

  .resource-property::before {
    width: 3px;
    height: 20px;
  }

  .resource-property-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 8px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .resource-property-copy span,
  .resource-property-occupancy {
    display: none;
  }

  .resource-row {
    height: 58px;
    min-height: 58px;
  }

  .resource-pill {
    height: 27px;
    margin-right: 2px;
    margin-left: 2px;
    padding-right: 5px;
    padding-left: 5px;
  }

  .resource-pill-name {
    font-size: 8px;
  }
}
