/* ============================================================
   LAVIKA CHANNEL MANAGER — app.css v2
   Design System: "Lavika Elegance" (Stitch #18307242591209021768)
   Typography: Noto Serif (display) + Manrope (UI)
   Palette: Material You M3, seed #A28A67, LIGHT mode
   Filosofia: "No-Line", Tonal Layering, Ghost Border, Ivory Editorial
   ============================================================ */

/* ── CSS CUSTOM PROPERTIES ──────────────────────────────────── */
:root {
  /* Primary — golden brown */
  --primary:            #6D5939;
  --primary-container:  #877150;
  --primary-fixed:      #FBDEB6;
  --primary-fixed-dim:  #DEC29C;
  --on-primary:         #FFFFFF;
  --on-primary-fixed:   #2A1800;

  /* Secondary */
  --secondary:               #5F5E5E;
  --secondary-container:     #E4E2E1;
  --on-secondary:            #FFFFFF;
  --on-secondary-container:  #656464;

  /* Tertiary — sage green (confirmed / booked) */
  --tertiary:            #506147;
  --tertiary-container:  #687A5F;
  --tertiary-fixed:      #D5E8C8;
  --on-tertiary:         #FFFFFF;
  --on-tertiary-fixed:   #F8FFEF;

  /* Error */
  --error:            #BA1A1A;
  --error-container:  #FFDAD6;
  --on-error:         #FFFFFF;

  /* Surfaces — 6-level tonal hierarchy (never hard black borders) */
  --surface-lowest:    #FFFFFF;      /* card interactive white */
  --surface:           #FBF9F4;      /* global background — ivory */
  --surface-low:       #F5F3EE;      /* large section backgrounds */
  --surface-container: #F0EEE9;      /* secondary sectioning */
  --surface-high:      #EAE8E3;      /* input field backgrounds */
  --surface-highest:   #E4E2DD;      /* available calendar cells, chips */
  --surface-dim:       #DBDAD5;

  /* Text */
  --on-surface:          #1B1C19;    /* primary text — never pure #000 */
  --on-surface-variant:  #4D453C;    /* secondary text, table headers */
  --text-muted:          #7F766B;    /* helper text, timestamps */

  /* Borders — "Ghost Border" rule */
  --outline:       #7F766B;
  --ghost-border:  rgba(208, 197, 184, 0.45);
  --ghost-focus:   rgba(109,  89,  57, 0.22);

  /* Inverse surfaces */
  --inverse-surface:    #30312E;
  --inverse-on-surface: #F2F1EC;

  /* Channel brand colors */
  --ch-airbnb:   #FF5A5F;
  --ch-booking:  #003580;
  --ch-vrbo:     #1C5CCA;
  --ch-direct:   #506147;
  --ch-blocked:  #7F766B;

  /* Layout */
  --sidebar-w:    240px;
  --topbar-h:     64px;
  --bottomnav-h:  64px;

  /* Radius — "ROUND_FOUR" = xl = 12px; pill = full */
  --radius-xs:   6px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   20px;
  --radius-pill: 999px;

  /* Shadows — warm tonal, not cold black */
  --shadow-sm:    0 2px 8px  rgba(27,28,25,.05);
  --shadow-card:  0 10px 40px rgba(27,28,25,.06);
  --shadow-lg:    0 20px 60px rgba(27,28,25,.10);
  --shadow-float: 0 4px 20px rgba(109,89,57,.22);

  /* Typography */
  --font-display: 'Noto Serif', Georgia, serif;
  --font-ui:      'Manrope', 'Inter', system-ui, sans-serif;

  /* Transitions */
  --transition: 0.25s ease;

  /* ── Legacy aliases — keep inline styles in template working ── */
  --lava-amber:     var(--primary);
  --lava-gold:      var(--primary-container);
  --lava-cream:     var(--surface);
  --lava-black:     var(--inverse-surface);
  --lava-dark:      var(--inverse-surface);
  --text-primary:   var(--on-surface);
  --text-secondary: var(--on-surface-variant);
  --bg-page:        var(--surface);
  --bg-card:        var(--surface-lowest);
  --border-color:   var(--ghost-border);
}

/* ── RESET & BASE ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--on-surface);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app { height: 100%; }

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-ui); }
input, select, textarea { font-family: var(--font-ui); }
ul { list-style: none; }
img { display: block; max-width: 100%; }

/* ── SCROLLBAR ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline); }

/* ================================================================
   LOGIN PAGE — ivory premium
   ================================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  background-image:
    radial-gradient(ellipse at 15% 55%, rgba(109,89,57,.08) 0%, transparent 60%),
    radial-gradient(ellipse at 88% 20%, rgba(80,97,71,.06) 0%, transparent 55%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-lowest);
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--on-primary);
  letter-spacing: -.5px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-float);
}

.login-logo-img {
  width: auto;
  height: 56px;
  max-width: 180px;
  object-fit: contain;
  display: block;
  margin: 0 auto 14px;
  background: none;
}

.sidebar-logo-img {
  width: 36px;
  height: 36px;
  min-width: 36px;
  object-fit: contain;
  background: none;
}

.login-title {
  font-size: 22px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--on-surface);
  letter-spacing: -.4px;
  line-height: 1.2;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
  font-style: italic;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-high);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--on-surface);
  font-size: 14px;
  font-family: var(--font-ui);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  background: var(--surface-lowest);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ghost-focus);
}

.form-input::placeholder { color: var(--text-muted); }

/* Password show/hide toggle */
.input-password-wrap {
  position: relative;
  width: 100%;
  display: block;
}
.input-password-wrap .form-input,
.input-password-wrap .form-input-light {
  width: 100%;
  padding-right: 42px !important;
  box-sizing: border-box;
}
.btn-show-password {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 40px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: .6;
  transition: opacity .15s;
}
.btn-show-password:hover { opacity: 1; }
.btn-show-password svg { display: block; flex-shrink: 0; }

/* Login form inputs reuse base .form-input */
.login-form .form-input { background: var(--surface-high); }
.login-form .form-input:focus { background: var(--surface-lowest); border-color: var(--primary); }

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-ui);
  border-radius: var(--radius-pill);
  border: none;
  margin-top: 8px;
  letter-spacing: .2px;
  transition: opacity var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-float);
}

.btn-login:hover         { opacity: .88; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(109,89,57,.35); }
.btn-login:active        { transform: translateY(0); }
.btn-login:disabled      { opacity: .5; cursor: not-allowed; transform: none; }

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: var(--error-container);
  border: 1px solid rgba(186,26,26,.2);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 13px;
}

/* ================================================================
   APP LAYOUT
   ================================================================ */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--surface);
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface-lowest);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--ghost-border);
  z-index: 100;
  flex-shrink: 0;
  box-shadow: 2px 0 16px rgba(27,28,25,.04);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--ghost-border);
}

.sidebar-monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--on-primary);
  letter-spacing: -.3px;
  box-shadow: 0 2px 10px rgba(109,89,57,.25);
}

.sidebar-brand-text { overflow: hidden; }

.sidebar-brand-name {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.1px;
  line-height: 1.3;
}

.sidebar-brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  font-style: italic;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--on-surface-variant);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  user-select: none;
  letter-spacing: .1px;
}

.nav-item:hover {
  background: var(--surface-high);
  color: var(--on-surface);
}

.nav-item.active {
  background: var(--primary-fixed);
  color: var(--primary);
  font-weight: 700;
}

.nav-item.active .nav-icon { opacity: 1; }

.nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  opacity: .7;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--ghost-border);
}

.nav-item.logout { color: var(--text-muted); }
.nav-item.logout:hover { background: var(--error-container); color: var(--error); }

/* ── MAIN AREA ──────────────────────────────────────────── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

/* ── TOP BAR ────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface-lowest);
  border-bottom: 1px solid var(--ghost-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 50;
}

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

.topbar-property-icon { font-size: 18px; }

/* Logo mobile nel topbar (nascosto su desktop) */
.topbar-logo-mobile {
  display: none;
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.topbar-property-name {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--on-surface);
  letter-spacing: -.1px;
}

.topbar-property-addr {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-info {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tertiary);
  flex-shrink: 0;
}

.sync-dot.error   { background: var(--error); }
.sync-dot.loading { background: var(--primary); animation: pulse-dot 1.2s ease-in-out infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* ── PAGE CONTENT ───────────────────────────────────────── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  background: var(--surface);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 26px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--on-surface);
  letter-spacing: -.6px;
  line-height: 1.2;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
  font-style: italic;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-ui);
  letter-spacing: .1px;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-container) 100%);
  color: var(--on-primary);
  box-shadow: 0 2px 10px rgba(109,89,57,.22);
}

.btn-primary:hover:not(:disabled) {
  opacity: .88;
  box-shadow: var(--shadow-float);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-lowest);
  color: var(--primary);
  border: 1.5px solid var(--ghost-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--primary-fixed);
  border-color: var(--primary-fixed-dim);
}

.btn-danger {
  background: var(--error-container);
  color: var(--error);
  border: 1px solid rgba(186,26,26,.15);
}

.btn-danger:hover:not(:disabled) { background: rgba(186,26,26,.15); }

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--on-surface-variant);
  background: transparent;
  border: 1.5px solid transparent;
  transition: all var(--transition);
}

.btn-icon:hover { background: var(--surface-low); border-color: var(--ghost-border); }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--surface-lowest);
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--ghost-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-low);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.card-body { padding: 22px; }

/* ── STAT CARDS ─────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--surface-lowest);
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--on-surface);
  line-height: 1.1;
  letter-spacing: -1.5px;
}

.stat-value.amber { color: var(--primary); }
.stat-value.green { color: var(--tertiary); }

.stat-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ================================================================
   CALENDAR PAGE
   ================================================================ */
.calendar-wrapper {
  background: var(--surface-lowest);
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* FullCalendar overrides */
.fc {
  height: 100%;
  font-family: var(--font-ui);
  font-size: 13px;
}

.fc .fc-toolbar {
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.fc .fc-toolbar-title {
  font-size: 18px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--on-surface);
  text-transform: capitalize;
  letter-spacing: -.3px;
}

.fc .fc-button {
  background: var(--surface-low) !important;
  border: 1.5px solid var(--ghost-border) !important;
  color: var(--on-surface-variant) !important;
  border-radius: var(--radius-pill) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  font-family: var(--font-ui) !important;
  padding: 6px 14px !important;
  box-shadow: none !important;
  transition: all var(--transition) !important;
  text-transform: capitalize !important;
}

.fc .fc-button:hover {
  background: var(--primary-fixed) !important;
  border-color: var(--primary-fixed-dim) !important;
  color: var(--primary) !important;
}

.fc .fc-button-active,
.fc .fc-button-primary:not(:disabled).fc-button-active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--on-primary) !important;
  box-shadow: 0 2px 8px rgba(109,89,57,.3) !important;
}

.fc .fc-daygrid-day             { background: var(--surface-lowest); }
.fc .fc-daygrid-day:hover       { background: var(--surface-low); }

.fc .fc-col-header-cell {
  background: var(--surface-low);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}

.fc .fc-daygrid-day.fc-day-today { background: var(--primary-fixed) !important; }

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
  background: var(--primary);
  color: var(--on-primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.fc .fc-daygrid-day-number {
  font-size: 12px;
  font-weight: 500;
  color: var(--on-surface-variant);
  padding: 5px 7px;
}

.fc .fc-event {
  border: none !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 6px !important;
  cursor: pointer !important;
  box-shadow: 0 1px 4px rgba(27,28,25,.12) !important;
  transition: opacity var(--transition) !important;
}

.fc .fc-event:hover { opacity: .82 !important; }

.fc .fc-event-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-event-airbnb  { background-color: var(--ch-airbnb)  !important; color: #fff !important; }
.fc-event-booking { background-color: var(--ch-booking) !important; color: #fff !important; }
.fc-event-vrbo    { background-color: var(--ch-vrbo)    !important; color: #fff !important; }
.fc-event-direct  { background-color: var(--ch-direct)  !important; color: #fff !important; }
.fc-event-blocked { background-color: var(--ch-blocked) !important; color: #fff !important; }

/* Barra prenotazione: border-radius azzerato — le clip-path in eventDidMount
   gestiscono l'arrotondamento visivo su check-in (80% destro) e checkout (20% sinistro) */
.fc .reservation-event { border-radius: 0 !important; }

/* Permette alla coda visiva del checkout (tail div) di estendersi nella cella adiacente
   senza essere tagliata dai contenitori FullCalendar che hanno overflow:hidden di default */
.fc .fc-daygrid-event-harness { overflow: visible !important; }
.fc .fc-daygrid-day-events    { overflow: visible !important; }


.fc .fc-scrollgrid      { border-color: var(--ghost-border) !important; }
.fc td, .fc th          { border-color: var(--ghost-border) !important; }

/* ================================================================
   RESERVATIONS PAGE
   ================================================================ */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.reservation-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.reservation-filters .form-group { flex: 1; min-width: 130px; max-width: 220px; }

.res-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.res-card {
  background: var(--surface-lowest);
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.res-card:hover {
  border-color: var(--primary-fixed-dim);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.res-card.upcoming { border-left: 3px solid var(--primary); }

.res-channel-bar {
  width: 4px;
  min-width: 4px;
  height: 44px;
  border-radius: 2px;
  flex-shrink: 0;
}

.res-main { flex: 1; min-width: 0; }

.res-guest {
  font-size: 14px;
  font-weight: 700;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.res-dates {
  font-size: 13px;
  color: var(--on-surface-variant);
  margin-top: 2px;
}

.res-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .1px;
}

.badge-airbnb  { background: rgba(255,90,95,.12);  color: var(--ch-airbnb); }
.badge-booking { background: rgba(0,53,128,.10);   color: var(--ch-booking); }
.badge-vrbo    { background: rgba(28,92,202,.10);  color: var(--ch-vrbo); }
.badge-direct  { background: var(--tertiary-fixed); color: var(--tertiary); }
.badge-blocked { background: var(--surface-high);   color: var(--text-muted); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

.status-confirmed { background: var(--tertiary-fixed);  color: var(--tertiary); }
.status-pending   { background: rgba(255,152,0,.12);     color: #C35A00; }
.status-cancelled { background: var(--error-container);  color: var(--error); }
.status-block     { background: var(--surface-high);     color: var(--text-muted); }

.nights-badge {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.page-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--on-surface-variant);
  background: var(--surface-lowest);
  border: 1.5px solid var(--ghost-border);
  cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover  { background: var(--surface-low); border-color: var(--primary-fixed-dim); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 2px 8px rgba(109,89,57,.3); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ================================================================
   CHANNELS PAGE
   ================================================================ */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.channel-card {
  background: var(--surface-lowest);
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.channel-card:hover {
  border-color: var(--primary-fixed-dim);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.channel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--ghost-border);
  background: var(--surface-low);
}

.channel-name-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.channel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.channel-display-name {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--on-surface);
}

.channel-slug {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  font-style: italic;
}

.channel-status-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.connected  { background: var(--tertiary); box-shadow: 0 0 0 2px var(--tertiary-fixed); }
.status-dot.not-config { background: var(--error);    box-shadow: 0 0 0 2px var(--error-container); }
.status-dot.syncing    { background: var(--primary);  animation: pulse-dot 1.2s infinite; }
.status-dot.inactive   { background: var(--surface-dim); }

.channel-connected  .status-text { color: var(--tertiary); }
.channel-not-config .status-text { color: var(--error); }

.channel-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.channel-ical-field { display: flex; flex-direction: column; gap: 4px; }

.channel-ical-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}

.channel-ical-url {
  font-size: 12px;
  color: var(--on-surface-variant);
  background: var(--surface-high);
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  word-break: break-all;
  font-family: 'Courier New', monospace;
  line-height: 1.4;
}

.channel-ical-url.empty {
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--font-ui);
}

.channel-sync-info { font-size: 12px; color: var(--text-muted); }

.channel-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--ghost-border);
  background: var(--surface-low);
}

/* ================================================================
   BLOCKS PAGE
   ================================================================ */
.block-form-card {
  background: var(--surface-lowest);
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.block-form-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.block-form-fields .full-width { grid-column: 1 / -1; }

.blocks-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.block-item {
  background: var(--surface-lowest);
  border: 1px solid var(--ghost-border);
  border-left: 4px solid var(--text-muted);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.block-dates {
  font-size: 14px;
  font-weight: 700;
  color: var(--on-surface);
}

.block-reason {
  font-size: 13px;
  color: var(--on-surface-variant);
  margin-top: 3px;
}

.block-nights {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.empty-state {
  text-align: center;
  padding: 52px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 14px;
  opacity: .4;
}

.empty-state-text { font-size: 14px; line-height: 1.5; }

/* ================================================================
   SYNC STATUS BAR
   ================================================================ */
.sync-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  animation: slideDown .25s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sync-bar.success { background: var(--tertiary-fixed);  color: var(--tertiary); border: 1px solid rgba(80,97,71,.2); }
.sync-bar.error   { background: var(--error-container); color: var(--error);    border: 1px solid rgba(186,26,26,.2); }
.sync-bar.loading { background: var(--primary-fixed);   color: var(--primary);  border: 1px solid rgba(109,89,57,.2); }

.sync-bar-dismiss { opacity: .6; font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0; }
.sync-bar-dismiss:hover { opacity: 1; }

/* ================================================================
   MODAL — glassmorphism + ivory
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27,28,25,.4);
  backdrop-filter: blur(10px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-card {
  background: rgba(251,249,244,.94);
  border: 1px solid var(--ghost-border);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn .2s ease;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ghost-border);
  background: var(--surface-low);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--on-surface);
  letter-spacing: -.2px;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--surface-high); color: var(--on-surface); }

.modal-body { padding: 24px; }

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--ghost-border);
  background: var(--surface-low);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── FORM ELEMENTS — light ────────────────────────────── */
.form-input-light {
  width: 100%;
  padding: 10px 13px;
  background: var(--surface-high);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--on-surface);
  font-size: 14px;
  font-family: var(--font-ui);
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input-light:focus {
  background: var(--surface-lowest);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ghost-focus);
}

.form-input-light::placeholder { color: var(--text-muted); }

select.form-input-light {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%237F766B' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-color: var(--surface-high);
  padding-right: 30px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-group-light { display: flex; flex-direction: column; gap: 5px; }

.form-label-light {
  font-size: 11px;
  font-weight: 700;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Reservation detail grid */
.res-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.res-detail-field { display: flex; flex-direction: column; gap: 3px; }
.res-detail-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}
.res-detail-value { font-size: 14px; font-weight: 500; color: var(--on-surface); }
.res-detail-value.full { grid-column: 1 / -1; }

/* ================================================================
   LOADING
   ================================================================ */
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--primary-fixed);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-lg { width: 36px; height: 36px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(251,249,244,.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: inherit;
}

.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ================================================================
   TOAST NOTIFICATIONS — light premium
   ================================================================ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 340px;
  width: calc(100vw - 40px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-lowest);
  border: 1px solid var(--ghost-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: slideInRight .25s ease;
  overflow: hidden;
  position: relative;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0);  max-height: 100px; }
  to   { opacity: 0; transform: translateX(20px); max-height: 0; padding: 0; }
}

.toast.leaving { animation: slideOutRight .25s ease forwards; }

.toast-icon  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.toast-body  { flex: 1; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--on-surface); }
.toast-msg   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.toast-close       { font-size: 16px; color: var(--text-muted); cursor: pointer; flex-shrink: 0; line-height: 1; }
.toast-close:hover { color: var(--on-surface); }

.toast.success { border-left: 3px solid var(--tertiary); }
.toast.error   { border-left: 3px solid var(--error);    }
.toast.info    { border-left: 3px solid var(--primary);  }
.toast.warning { border-left: 3px solid #E07A00;         }

.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px;
  border-radius: 0 1px 1px 0;
  animation: toastProgress 4s linear forwards;
}

.toast.success .toast-progress { background: var(--tertiary); }
.toast.error   .toast-progress { background: var(--error);    }
.toast.info    .toast-progress { background: var(--primary);  }
.toast.warning .toast-progress { background: #E07A00;         }

@keyframes toastProgress { from { width: 100%; } to { width: 0%; } }

/* ================================================================
   MOBILE BOTTOM NAV
   ================================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottomnav-h);
  background: var(--surface-lowest);
  border-top: 1px solid var(--ghost-border);
  box-shadow: 0 -4px 20px rgba(27,28,25,.06);
  z-index: 200;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}

.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item:hover  { color: var(--on-surface); }
.bottom-nav-icon        { font-size: 20px; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  .sidebar      { display: none; }
  .bottom-nav   { display: flex; }
  .main-area    { padding-bottom: var(--bottomnav-h); }
  .page-content { padding: 16px 14px; gap: 16px; }
  .topbar       { padding: 0 14px; }
  .topbar-property-addr { display: none; }
  .topbar-property-icon { display: none; }
  .topbar-logo-mobile   { display: block; }
  .stats-row    { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card    { padding: 16px 18px; }
  .stat-value   { font-size: 26px; }
  .channels-grid { grid-template-columns: 1fr; }
  .block-form-fields { grid-template-columns: 1fr; }
  .form-row     { grid-template-columns: 1fr; }
  .res-card     { padding: 12px 14px; flex-wrap: wrap; }
  .res-meta     { width: 100%; margin-top: 6px; }
  .modal-card   { max-width: 100%; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-card   { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .toast-container { top: auto; bottom: calc(var(--bottomnav-h) + 12px); right: 10px; left: 10px; }
  .res-detail-grid { grid-template-columns: 1fr; }
  .reservation-filters .form-group { min-width: 100%; max-width: 100%; }
}

@media (max-width: 480px) {
  .stats-row    { grid-template-columns: 1fr; }
  .page-header  { flex-direction: column; align-items: flex-start; }
  .calendar-wrapper { padding: 10px 8px; }
  .fc .fc-toolbar       { gap: 4px; }
  .fc .fc-toolbar-title { font-size: 15px; }
  .page-title   { font-size: 22px; }
}

/* ================================================================
   UTILITIES
   ================================================================ */
.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.fw-600       { font-weight: 600; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.mt-4         { margin-top: 4px; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mb-4         { margin-bottom: 4px; }
.mb-8         { margin-bottom: 8px; }
.mb-16        { margin-bottom: 16px; }
.w-100        { width: 100%; }
.relative     { position: relative; }
.truncate     { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Vue directives */
[v-cloak] { display: none !important; }

.fade-enter-active, .fade-leave-active { transition: opacity .2s ease; }
.fade-enter-from, .fade-leave-to       { opacity: 0; }
.slide-enter-active { animation: slideDown .2s ease; }
.slide-leave-active { animation: slideDown .2s ease reverse; }
