/* ============================================================
   CMC PROPERTIES — Luxury Design System
   Palette : Warm ivory · Rich gold · Dark walnut
   Inspired by the CMC Properties monogram brand identity
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Brand Gold */
  --gold:          #C9A84C;
  --gold-light:    #E2C97E;
  --gold-dark:     #8B6726;
  --gold-pale:     #F5EDD6;
  --gold-muted:    #D4C09A;

  /* Ivory & Cream */
  --cream:         #F0EBE1;
  --cream-dark:    #E6DFD3;
  --cream-card:    #FFFDF8;

  /* Walnut (sidebar) */
  --walnut:        #1C1208;
  --walnut-hover:  #2E1E0F;
  --walnut-active: rgba(201,168,76,0.15);

  /* Sidebar aliases */
  --sidebar-bg:          var(--walnut);
  --sidebar-hover:       var(--walnut-hover);
  --sidebar-active:      var(--walnut-active);
  --sidebar-text:        #B8A882;
  --sidebar-text-active: #E2C97E;
  --sidebar-width:       268px;
  --sidebar-collapsed:   0px;

  /* Semantic */
  --primary:      var(--gold);
  --primary-dark: var(--gold-dark);
  --success:      #22c55e;
  --danger:       #ef4444;
  --warning:      #f59e0b;

  /* Surfaces */
  --bg:       var(--cream);
  --card-bg:  var(--cream-card);
  --text:     #2C1810;
  --text-muted: #8B7355;
  --border:   #DDD0B8;

  /* Shadows — warm tinted */
  --shadow:    0 1px 4px rgba(44,24,16,0.08), 0 1px 2px rgba(44,24,16,0.05);
  --shadow-md: 0 4px 12px rgba(44,24,16,0.10), 0 2px 4px rgba(44,24,16,0.06);
  --shadow-lg: 0 12px 32px rgba(44,24,16,0.14), 0 4px 8px rgba(44,24,16,0.06);

  --radius:    12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, .card-title, .modal-title, .page-title, .stat-value {
  font-family: 'Cormorant Garamond', Georgia, serif;
}

/* ============================================================
   AUTH / LOGIN SCREEN
   ============================================================ */
#auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--cream);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(201,168,76,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(201,168,76,0.08) 0%, transparent 60%);
  padding: 20px;
}

.auth-card {
  background: var(--cream-card);
  border-radius: 20px;
  padding: 52px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.2);
}

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

/* CMC monogram circle — matches logo aesthetic */
.auth-logo .logo-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--gold-pale), var(--cream-card));
  box-shadow: 0 0 0 6px rgba(201,168,76,0.08);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-dark);
  letter-spacing: 1px;
}

.auth-logo h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1.2;
}

.auth-logo .tagline {
  font-size: 11px;
  color: var(--gold-dark);
  margin-top: 8px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-logo .tagline::before,
.auth-logo .tagline::after {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--gold-muted);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s;
  background: var(--cream-card);
  color: var(--text);
  outline: none;
}

.form-control:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238B7355' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger);     margin-top: 4px; }

.time-shift-btn {
  display: inline-block;
  background: var(--gold-pale);
  color: var(--gold-dark);
  border: 1px solid var(--gold-muted, #d4b962);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 4px;
  transition: opacity 0.15s;
}
.time-shift-btn:hover { opacity: 0.8; }

.input-group {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.2s;
}

.input-group:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}

.input-addon {
  padding: 11px 14px;
  background: var(--gold-pale);
  color: var(--gold-dark);
  font-size: 14px;
  font-weight: 700;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.input-group .form-control {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0;
  flex: 1;
}

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

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

/* Gold primary — matches the brand */
.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--walnut);
  box-shadow: 0 4px 14px rgba(201,168,76,0.35);
  border: 1px solid rgba(201,168,76,0.4);
}
.btn-primary:hover  { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(201,168,76,0.45); }
.btn-primary:active { transform: translateY(0); }

.btn-success {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: #052e16;
  box-shadow: 0 4px 12px rgba(34,197,94,0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, #ef4444);
  color: white;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}

.btn-warning {
  background: linear-gradient(135deg, #fcd34d, #f59e0b);
  color: #451a03;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--cream-dark); border-color: var(--gold-muted); }

.btn-sm  { padding: 7px 14px; font-size: 13px; border-radius: 7px; }
.btn-lg  { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
#app-screen { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--walnut);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(201,168,76,0.12);
}

.sidebar.collapsed { transform: translateX(-100%); }

.sidebar-header {
  padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(201,168,76,0.12);
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(201,168,76,0.06) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lock-btn {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 8px;
  color: var(--gold-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 6px 9px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.lock-btn:hover {
  background: rgba(201,168,76,0.18);
  color: var(--gold-light);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

/* Sidebar monogram icon — gold circle */
.sidebar-logo .icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--gold-light);
  flex-shrink: 0;
  background: rgba(201,168,76,0.08);
  letter-spacing: 0.5px;
}

.sidebar-logo .name {
  color: var(--gold-light);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  line-height: 1.2;
}

.sidebar-logo .sub {
  color: var(--sidebar-text);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(184,168,130,0.5);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--sidebar-text);
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--walnut-hover);
  color: var(--gold-light);
}

.nav-item.active {
  background: rgba(201,168,76,0.14);
  color: var(--gold-light);
  border-left: 2px solid var(--gold);
  padding-left: 10px;
}

.nav-item .icon { font-size: 17px; width: 22px; text-align: center; flex-shrink: 0; }
.nav-item .badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--walnut);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 14px 10px 18px;
  border-top: 1px solid rgba(201,168,76,0.12);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(201,168,76,0.06);
  border: 1px solid rgba(201,168,76,0.1);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--walnut);
  flex-shrink: 0;
}

.user-name { color: var(--gold-light); font-size: 13px; font-weight: 600; }
.user-role { color: var(--sidebar-text); font-size: 11px; letter-spacing: 0.5px; }

/* OVERLAY */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(28,18,8,0.6);
  z-index: 999;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* MAIN */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s;
}

/* TOP BAR */
.topbar {
  background: var(--cream-card);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(44,24,16,0.06);
}

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

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
}

.page-title    { font-size: 20px; font-weight: 600; color: var(--text); letter-spacing: 0.5px; }
.page-subtitle { font-size: 12px; color: var(--text-muted); }

.notif-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
  transition: all 0.2s;
}
.notif-btn:hover { background: var(--cream-dark); border-color: var(--gold-muted); }
.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  border: 2px solid var(--cream-card);
}

/* PAGE CONTENT */
.page-content { flex: 1; padding: 28px; display: none; }
.page-content.active { display: block; }

/* ============================================================
   CARDS & STATS
   ============================================================ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: linear-gradient(180deg, rgba(201,168,76,0.03) 0%, transparent 100%);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.card-body { padding: 20px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, var(--gold));
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--stat-bg, rgba(201,168,76,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 5px; font-weight: 500; letter-spacing: 0.3px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

thead tr { background: var(--gold-pale); }

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gold-dark);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(221,208,184,0.5);
  color: var(--text);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(201,168,76,0.04); }

.td-name  { font-weight: 600; }
.td-muted { color: var(--text-muted); font-size: 13px; }

/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green  { background: #dcfce7; color: #166534; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-blue   { background: var(--gold-pale); color: var(--gold-dark); }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-gray   { background: var(--cream-dark); color: var(--text-muted); }
.badge-orange { background: #ffedd5; color: #9a3412; }

/* ============================================================
   TIMELINE / CALENDAR DASHBOARD
   ============================================================ */
.timeline-container {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--cream-card);
}

.timeline-grid { min-width: 900px; display: grid; }

.timeline-header-row {
  display: flex;
  background: var(--gold-pale);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.timeline-prop-col {
  width: 180px;
  min-width: 180px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gold-dark);
  border-right: 1px solid var(--border);
}

.timeline-day-cell {
  flex: 1;
  min-width: 36px;
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 1px solid rgba(221,208,184,0.4);
}

.timeline-day-cell.today { color: var(--gold-dark); background: rgba(201,168,76,0.08); }

.timeline-row {
  display: flex;
  border-bottom: 1px solid rgba(221,208,184,0.5);
  min-height: 52px;
}
.timeline-row:last-child { border-bottom: none; }

.timeline-prop-label {
  width: 180px;
  min-width: 180px;
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.timeline-prop-label .prop-type { font-size: 11px; color: var(--text-muted); }
.timeline-days-area { flex: 1; position: relative; overflow: hidden; }

.timeline-cell {
  position: absolute;
  top: 6px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: opacity 0.2s;
}

.timeline-cell:hover   { opacity: 0.85; }
.timeline-cell.booked  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.timeline-cell.cleaning { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.timeline-cell.longterm { background: var(--gold-pale); color: var(--gold-dark); border: 1px solid var(--gold-muted); }

.legend { display: flex; gap: 20px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.legend-dot  { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(28,18,8,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--cream-card);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.15);
  animation: modalIn 0.22s ease;
}

.modal-lg { max-width: 800px; }
.modal-sm { max-width: 440px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--cream-card);
  z-index: 1;
  background: linear-gradient(180deg, var(--gold-pale) 0%, var(--cream-card) 100%);
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--cream);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-muted);
  transition: all 0.2s;
}
.modal-close:hover { background: #fee2e2; color: var(--danger); border-color: #fecaca; }

.modal-body   { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(201,168,76,0.03);
}

/* ============================================================
   ALERTS & NOTICES
   ============================================================ */
.alert {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fff1f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #854d0e; border: 1px solid #fde68a; }
.alert-info    { background: var(--gold-pale); color: var(--gold-dark); border: 1px solid var(--gold-muted); }
.alert-icon    { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--cream-card);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  pointer-events: all;
  border-left: 4px solid var(--gold);
  animation: toastIn 0.3s ease;
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

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

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg  { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.4; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.6; }
.empty-state h3 { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; max-width: 320px; margin: 0 auto 20px; }

/* ============================================================
   CALENDAR
   ============================================================ */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.cal-day-header {
  background: var(--walnut);
  padding: 10px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold-muted);
}

.cal-cell {
  background: var(--cream-card);
  min-height: 88px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.15s;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.cal-cell:nth-child(7n) { border-right: none; }

.cal-cell:hover { background: var(--gold-pale); }
.cal-cell.other-month { background: var(--cream); opacity: 0.6; }
.cal-cell.other-month .cal-date { color: var(--text-muted); }
.cal-cell.today { background: #fffbf0; }
.cal-cell.today .cal-date {
  background: var(--gold);
  color: var(--walnut);
  font-weight: 800;
}

.cal-date {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--text);
}

.cal-event {
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid transparent;
}

.cal-event.booked   { background: #fef2f2; color: #b91c1c; border-left-color: #ef4444; }
.cal-event.cleaning { background: #fffbeb; color: #92400e; border-left-color: #f59e0b; }
.cal-event.longterm { background: var(--gold-pale); color: var(--gold-dark); border-left-color: var(--gold); }

/* ============================================================
   PHOTO UPLOAD
   ============================================================ */
.photo-upload-zone {
  border: 2px dashed var(--gold-muted);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--cream);
}

.photo-upload-zone:hover, .photo-upload-zone.dragover {
  border-color: var(--gold);
  background: var(--gold-pale);
}

.photo-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.photo-thumb  {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--border);
}

/* ============================================================
   FINANCIAL CHARTS
   ============================================================ */
.chart-container { position: relative; height: 280px; }

/* ============================================================
   CONFLICT WARNING
   ============================================================ */
.conflict-box {
  background: #fff1f2;
  border: 2px solid #ef4444;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.conflict-box .icon { font-size: 22px; flex-shrink: 0; }
.conflict-box h4 { font-size: 14px; font-weight: 700; color: #991b1b; margin-bottom: 4px; }
.conflict-box p  { font-size: 13px; color: #b91c1c; }

/* ============================================================
   AMENITIES CHECKBOX GRID
   ============================================================ */
.amenities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  padding: 4px 0;
}

.amenity-checkbox {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--cream);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.amenity-checkbox:hover {
  border-color: var(--gold);
  background: var(--gold-pale);
}

.amenity-checkbox input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--gold-dark);
  cursor: pointer;
  flex-shrink: 0;
}

.amenity-checkbox:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--gold-dark);
  font-weight: 600;
}

/* Flatpickr booked-date highlight */
.flatpickr-day.booked-day {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border-color: #fca5a5 !important;
  text-decoration: line-through;
}

.flatpickr-day.flatpickr-disabled.booked-day {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  opacity: 1;
}

/* Override Flatpickr selected day with gold */
.flatpickr-day.selected, .flatpickr-day.selected:hover {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: var(--walnut) !important;
}

.flatpickr-day:hover {
  background: var(--gold-pale) !important;
  border-color: var(--gold-muted) !important;
}

.flatpickr-months .flatpickr-month,
.flatpickr-weekdays,
span.flatpickr-weekday {
  background: var(--gold-pale) !important;
  color: var(--gold-dark) !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0 !important; }
  .menu-toggle { display: flex; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .auth-card { padding: 36px 24px; }
  .modal { max-height: 100vh; border-radius: 16px 16px 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  table { font-size: 13px; }
  th, td { padding: 10px 12px; }
  .stat-value { font-size: 22px; }
}

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

/* ============================================================
   UTILITY
   ============================================================ */
.d-flex        { display: flex; }
.flex-wrap     { flex-wrap: wrap; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 12px; }
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 12px; }
.mt-4  { margin-top: 16px; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 12px; }
.font-bold   { font-weight: 700; }
.text-green  { color: #16a34a; }
.text-red    { color: #dc2626; }
.text-blue   { color: var(--gold-dark); }
.text-right  { text-align: right; }
.hidden      { display: none !important; }
.fw          { width: 100%; }
.separator   { height: 1px; background: var(--border); margin: 20px 0; }

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(201,168,76,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

.page-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  font-size: 14px;
  gap: 10px;
}

/* Scrollbar */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gold-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* Print */
@media print {
  .sidebar, .topbar, .btn, .modal-overlay { display: none !important; }
  .main-content { margin-left: 0; }
  .page-content { display: block !important; }
}
