/* ── RESET ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  /* Light theme */
  --bg:       #F4F6F9;
  --surface:  #FFFFFF;
  --surface2: #F8FAFC;
  --border:   #E2E8F0;
  --border2:  #CBD5E1;

  /* Text */
  --text:     #0F172A;
  --text2:    #475569;
  --text3:    #94A3B8;

  /* Brand */
  --primary:      #2563EB;
  --primary-lt:   #EFF6FF;
  --primary-mid:  #BFDBFE;

  /* Status colours */
  --s-pending:    #9CA3AF;  /* GREY */
  --s-assigned:   #EAB308;  /* YELLOW */
  --s-inprogress: #3B82F6;  /* BLUE */
  --s-complete:   #16A34A;  /* DARK GREEN */
  --s-qa-pending: #EF4444;  /* RED */
  --s-qa-done:    #F97316;  /* ORANGE */

  --s-pending-lt:    #F3F4F6;
  --s-assigned-lt:   #FEFCE8;
  --s-inprogress-lt: #EFF6FF;
  --s-complete-lt:   #F0FDF4;
  --s-qa-pending-lt: #FEF2F2;
  --s-qa-done-lt:    #FFF7ED;

  /* Other */
  --danger:   #DC2626;
  --success:  #16A34A;
  --warning:  #D97706;

  --sidebar-w:  240px;
  --topbar-h:   60px;
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 4px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.12);

  --mono: 'DM Mono', 'Fira Mono', monospace;
  --sans: 'Inter', system-ui, sans-serif;
}

html, body { height: 100%; font-family: var(--sans); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
#app { height: 100vh; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--sans); }
input, select, textarea { font-family: var(--sans); }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 10px; }

/* ── LOGIN ───────────────────────────────────────────────────────────────── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  height: 100vh;
  background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 50%, #F0FDF4 100%);
}
.login-wrap { display: flex; gap: 64px; align-items: center; max-width: 860px; width: 100%; padding: 40px; }
.login-brand { flex: 1; }
.login-logo { width: 52px; height: 52px; background: var(--primary); border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; font-size: 26px; color: white; margin-bottom: 20px; box-shadow: var(--shadow); }
.login-brand h1 { font-size: 32px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.login-brand p { color: var(--text2); margin-top: 8px; font-size: 15px; }
.login-tagline { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
.login-feat { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text2); }
.login-feat-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.login-card { flex: 1; background: var(--surface); border-radius: var(--radius-xl); padding: 40px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.login-card h2 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.login-card p { color: var(--text2); font-size: 13px; margin-bottom: 28px; }

/* ── LAYOUT ──────────────────────────────────────────────────────────────── */
#main-layout { display: flex; height: 100vh; overflow: hidden; }
#sidebar { width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; transition: width .2s ease; }
#sidebar.collapsed { width: 60px; }
#content-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar-brand { padding: 18px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.brand-logo { width: 32px; height: 32px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: white; font-size: 15px; flex-shrink: 0; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; white-space: nowrap; color: var(--text); }
.brand-version { font-size: 10px; color: var(--text3); background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; margin-left: auto; flex-shrink: 0; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-section { font-size: 10px; font-weight: 600; letter-spacing: .8px; color: var(--text3); padding: 14px 10px 4px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); color: var(--text2); font-size: 13.5px; font-weight: 450; transition: all .12s; white-space: nowrap; margin-bottom: 1px; position: relative; }
.nav-item .ni { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-lt); color: var(--primary); font-weight: 500; }
.nav-item.active .ni { color: var(--primary); }
.nav-badge { margin-left: auto; background: var(--primary); color: white; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 20px; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.user-chip { display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-ava { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.user-meta > div:first-child { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.user-role { font-size: 11px; color: var(--text3); }
#logout-btn { background: transparent; border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; color: var(--text3); font-size: 12px; }
#logout-btn:hover { color: var(--danger); border-color: var(--danger); }

/* ── TOPBAR ──────────────────────────────────────────────────────────────── */
#topbar { height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 24px; flex-shrink: 0; }
.page-title-wrap h2 { font-size: 17px; font-weight: 600; color: var(--text); }
.page-title-wrap p { font-size: 12px; color: var(--text3); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-box { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 12px; max-width: 340px; flex: 1; position: relative; }
.search-box input { background: transparent; border: none; outline: none; color: var(--text); flex: 1; padding: 9px 0; font-size: 13px; }
.search-icon { color: var(--text3); font-size: 14px; }
#search-drop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); z-index: 300; box-shadow: var(--shadow-lg); max-height: 320px; overflow-y: auto; }
.search-item { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .1s; }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--bg); }
.si-label { font-size: 13px; font-weight: 500; }
.si-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }
.si-type { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; margin-right: 5px; text-transform: uppercase; }
.sit-property { background: var(--primary-lt); color: var(--primary); }
.sit-work_order { background: #F0FDF4; color: #16A34A; }
.sit-contractor { background: #FFF7ED; color: #F97316; }

#sidebar-toggle { background: transparent; border: none; color: var(--text3); font-size: 18px; padding: 4px; }

/* ── PAGE CONTENT ────────────────────────────────────────────────────────── */
#page-content { flex: 1; overflow-y: auto; padding: 24px 28px; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius); padding: 8px 16px; font-size: 13.5px; font-weight: 500; border: none; transition: all .15s; cursor: pointer; font-family: var(--sans); white-space: nowrap; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1D4ED8; box-shadow: 0 2px 8px rgba(37,99,235,.3); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border2); background: var(--bg); }
.btn-danger { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }
.btn-danger:hover { background: #FEE2E2; }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-xs { padding: 3px 8px; font-size: 11.5px; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; color: var(--text2); }
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }

/* ── FORM FIELDS ─────────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 12px; color: var(--text);
  font-size: 13.5px; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.field input[readonly], .field input.auto-filled {
  background: var(--primary-lt); border-color: var(--primary-mid); color: var(--primary);
  font-weight: 500;
}
.field-hint { font-size: 11px; color: var(--text3); margin-top: 4px; }
.field-row { display: grid; gap: 14px; }
.field-row.cols-2 { grid-template-columns: 1fr 1fr; }
.field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.field-row.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ── STAT CARDS ──────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; transition: box-shadow .15s; }
.stat-card:hover { box-shadow: var(--shadow); }
.stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 17px; margin-bottom: 12px; }
.stat-label { font-size: 12px; color: var(--text3); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; color: var(--text); }
.stat-sub { font-size: 11.5px; color: var(--text3); margin-top: 4px; }
.trend-up { color: #16A34A; font-weight: 600; }
.trend-down { color: #DC2626; font-weight: 600; }
.dash-alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.dash-alert { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500; }
.dash-alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.dash-alert-info { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.si-blue { background: var(--primary-lt); color: var(--primary); }
.si-green { background: #F0FDF4; color: #16A34A; }
.si-amber { background: #FFFBEB; color: #D97706; }
.si-red { background: #FEF2F2; color: #DC2626; }
.si-purple { background: #F5F3FF; color: #7C3AED; }
.si-teal { background: #F0FDFA; color: #0D9488; }

/* ── TABLE CARD ──────────────────────────────────────────────────────────── */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-toolbar h3 { font-size: 14px; font-weight: 600; }
.tb-search { display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 10px; }
.tb-search input { background: transparent; border: none; outline: none; color: var(--text); padding: 7px 0; font-size: 13px; width: 200px; }
.tb-search input::placeholder { color: var(--text3); }
.filter-select { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 10px; color: var(--text); font-size: 12.5px; }
.filter-select:focus { outline: none; border-color: var(--primary); }
.toolbar-spacer { flex: 1; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); border-bottom: 1px solid var(--border); background: var(--surface2); white-space: nowrap; }
.data-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; transition: background .1s; }
.data-table tbody tr:hover td { background: var(--bg); }
.table-empty { text-align: center; padding: 48px 20px; color: var(--text3); }
.table-loading { display: flex; justify-content: center; padding: 48px; color: var(--text3); gap: 8px; align-items: center; }

/* ── STATUS BADGES ───────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.b-pending    { background: #F3F4F6; color: #4B5563; }
.b-pending::before { background: var(--s-pending); }
.b-assigned   { background: #FEFCE8; color: #A16207; }
.b-assigned::before { background: var(--s-assigned); }
.b-inprogress { background: #EFF6FF; color: #1D4ED8; }
.b-inprogress::before { background: var(--s-inprogress); }
.b-complete   { background: #F0FDF4; color: #15803D; }
.b-complete::before { background: var(--s-complete); }
.b-waiting-review { background: #F5F3FF; color: #6D28D9; }
.b-waiting-review::before { background: #7C3AED; }
.b-qa-pending { background: #FEF2F2; color: #B91C1C; }
.b-qa-pending::before { background: var(--s-qa-pending); }
.b-qa-done    { background: #FFF7ED; color: #C2410C; }
.b-qa-done::before { background: var(--s-qa-done); }
.b-cancelled  { background: #FEF2F2; color: #991B1B; }
.b-cancelled::before { background: #DC2626; }
.cp-cancelled { background: #FEE2E2; color: #991B1B; }
.b-grey   { background: #F3F4F6; color: #4B5563; }
.b-blue   { background: #EFF6FF; color: #1D4ED8; }
.b-green  { background: #F0FDF4; color: #15803D; }
.b-amber  { background: #FFFBEB; color: #B45309; }
.b-red    { background: #FEF2F2; color: #B91C1C; }

/* ── PAGINATION ──────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 6px; padding: 12px 18px; border-top: 1px solid var(--border); }
.pg-info { font-size: 12.5px; color: var(--text3); margin-right: auto; }
.pg-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; color: var(--text2); font-size: 12.5px; min-width: 32px; }
.pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }
.pg-btn.active { background: var(--primary); border-color: var(--primary); color: white; }

/* ── MODAL ───────────────────────────────────────────────────────────────── */
#modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 1000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
#modal-box { background: var(--surface); border-radius: var(--radius-xl); width: 680px; max-width: 95vw; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }
.modal-hdr { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-hdr h3 { font-size: 16px; font-weight: 600; }
.modal-close-btn { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; color: var(--text3); font-size: 13px; }
.modal-close-btn:hover { color: var(--danger); border-color: var(--danger); }
#modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding-top: 18px; border-top: 1px solid var(--border); margin-top: 18px; }

/* ── CALENDAR ────────────────────────────────────────────────────────────── */
.cal-container { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); overflow: hidden; }
.cal-topbar { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cal-nav-btns { display: flex; align-items: center; gap: 6px; }
.cal-nav-btn { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 12px; color: var(--text); font-size: 13px; }
.cal-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.cal-nav-btn.today { background: var(--primary); color: white; border-color: var(--primary); }
.cal-heading { font-size: 17px; font-weight: 600; min-width: 200px; }
.cal-view-tabs { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 2px; margin-left: auto; }
.cal-view-tab { padding: 5px 14px; font-size: 12.5px; font-weight: 500; border-radius: 5px; color: var(--text2); border: none; background: transparent; }
.cal-view-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.cal-legend-item { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text2); font-weight: 500; }
.cal-legend-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* Month grid */
.cal-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { text-align: center; padding: 10px 6px; font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.cal-cell { min-height: 120px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 8px; vertical-align: top; position: relative; transition: background .1s; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.other-month { background: var(--surface2); }
.cal-cell.today { background: var(--primary-lt); }
.cal-cell.today .cal-day-num { color: var(--primary); font-weight: 700; }
.cal-cell.holiday { background: #FFFBEB; }
.cal-day-num { font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.cal-holiday-label { font-size: 9.5px; color: #D97706; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }

.cal-status-pills { display: flex; flex-direction: column; gap: 2px; }
.cal-pill { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: 600; cursor: pointer; transition: filter .1s; }
.cal-pill:hover { filter: brightness(.93); }
.cal-pill-label { text-transform: uppercase; font-size: 9.5px; letter-spacing: .3px; }
.cal-pill-count { font-size: 12px; font-weight: 700; }
.cp-pending    { background: #F3F4F6; color: #374151; }
.cp-assigned   { background: #FEFCE8; color: #A16207; border: 1px solid #FEF08A; }
.cp-inprogress { background: #DBEAFE; color: #1D4ED8; }
.cp-complete   { background: #DCFCE7; color: #15803D; }
.cp-waiting-review { background: #EDE9FE; color: #6D28D9; border: 1px solid #DDD6FE; }
.cp-qa-pending { background: #FEE2E2; color: #B91C1C; }
.cp-qa-done    { background: #FFEDD5; color: #C2410C; border: 1px solid #FED7AA; }

.cal-more-pill { font-size: 10px; color: var(--text3); text-align: center; cursor: pointer; padding: 1px; }
.cal-more-pill:hover { color: var(--primary); }

/* Week / Day views */
.cal-week-grid { display: grid; grid-template-columns: 60px repeat(7, 1fr); border-top: 1px solid var(--border); }
.cal-week-col-hdr { padding: 10px 6px; text-align: center; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cal-week-col-hdr .dow { font-size: 10px; color: var(--text3); text-transform: uppercase; font-weight: 600; }
.cal-week-col-hdr .date-num { font-size: 20px; font-weight: 700; color: var(--text); }
.cal-week-col-hdr.today .date-num { color: var(--primary); }
.cal-time-col { font-size: 10px; color: var(--text3); text-align: right; padding-right: 8px; }
.cal-time-slot { height: 50px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); display: flex; align-items: flex-start; padding-top: 2px; }
.cal-day-events { height: 50px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 1px 2px; position: relative; }
.cal-we { font-size: 10px; padding: 1px 4px; border-radius: 3px; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }

/* Year view */
.cal-year-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); }
.cal-year-month { background: var(--surface); padding: 14px; }
.cal-year-month-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.cal-year-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.cal-year-dow { font-size: 8px; color: var(--text3); text-align: center; padding: 2px 0; font-weight: 600; }
.cal-year-day { font-size: 9px; text-align: center; padding: 2px; border-radius: 3px; cursor: pointer; transition: background .1s; }
.cal-year-day:hover { background: var(--primary-lt); }
.cal-year-day.today { background: var(--primary); color: white; border-radius: 50%; }
.cal-year-day.has-events { font-weight: 700; color: var(--primary); }
.cal-year-day.holiday { color: #D97706; }
.cal-year-day.other-month { color: var(--text3); }

/* Day view */
.cal-day-view { display: grid; grid-template-columns: 60px 1fr; }
.cal-day-hdr { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.cal-day-hdr-date { font-size: 28px; font-weight: 700; color: var(--primary); font-family: var(--mono); }
.cal-day-hdr-info { font-size: 13px; color: var(--text2); }
.cal-day-all-day { border-bottom: 1px solid var(--border); padding: 8px 12px; min-height: 40px; }
.cal-day-all-day-label { font-size: 10px; color: var(--text3); text-transform: uppercase; font-weight: 600; margin-bottom: 4px; }
.cal-day-status-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-day-stat-pill { padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; }

/* ── CHARTS ROW ──────────────────────────────────────────────────────────── */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.chart-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 16px; }
.chart-wrap { position: relative; height: 190px; }

/* ── DETAIL ──────────────────────────────────────────────────────────────── */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.detail-title { font-size: 20px; font-weight: 700; margin-bottom: 3px; }
.detail-sub { color: var(--text2); font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 20px; }
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.detail-card h4 { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.info-row { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.ir-label { color: var(--text2); font-size: 12.5px; }
.ir-value { font-weight: 500; text-align: right; max-width: 60%; word-break: break-word; }
.ir-value.highlight { color: var(--primary); font-weight: 600; }
.ir-value.money { color: var(--success); font-weight: 600; font-family: var(--mono); }

/* ── LINEN PACKS GRID ────────────────────────────────────────────────────── */
.packs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.pack-tile { text-align: center; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 6px; }
.pack-num { font-size: 22px; font-weight: 700; color: var(--primary); font-family: var(--mono); }
.pack-label { font-size: 10px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; margin-top: 3px; }

/* ── AUTOFILL SECTION ────────────────────────────────────────────────────── */
.autofill-banner { background: var(--primary-lt); border: 1px solid var(--primary-mid); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--primary); font-weight: 500; }

/* ── PRICE PREVIEW ───────────────────────────────────────────────────────── */
.price-preview { background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: var(--radius-lg); padding: 16px; margin-top: 4px; }
.price-preview h4 { font-size: 12px; font-weight: 600; color: var(--success); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.price-row { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px solid #BBF7D0; }
.price-row:last-child { border-bottom: none; font-weight: 700; font-size: 14px; }
.price-total { color: var(--success); }

/* ── PROPERTY SEARCH DROPDOWN ────────────────────────────────────────────── */
.prop-search-wrap { position: relative; }
.prop-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); z-index: 400; box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; margin-top: 4px; }
.prop-option { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.prop-option:hover { background: var(--bg); }
.prop-option:last-child { border-bottom: none; }
.po-name { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.po-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
.prop-id-tag { background: var(--primary-lt); color: var(--primary); font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.linen-toggle { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.linen-btn { padding: 4px 16px; font-size: 13px; font-weight: 700; border: none; background: var(--surface); color: var(--text3); cursor: pointer; transition: all .15s; }
.linen-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.linen-btn.active.linen-no  { background: #F1F5F9; color: #64748B; }
.linen-btn.active.linen-yes { background: #DCFCE7; color: #16A34A; }

/* ── TOAST ───────────────────────────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--surface); border-radius: var(--radius-lg); padding: 12px 18px; z-index: 3000; font-size: 13.5px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; min-width: 240px; animation: toastIn .2s ease; }
.toast.success { border-color: #BBF7D0; background: #F0FDF4; color: var(--success); }
.toast.error { border-color: #FECACA; background: #FEF2F2; color: var(--danger); }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── MISC ────────────────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-head h2 { font-size: 18px; font-weight: 700; }
.page-head-sub { font-size: 13px; color: var(--text3); margin-top: 2px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.tag { display: inline-block; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 7px; font-size: 11.5px; color: var(--text2); font-weight: 500; }
.mono { font-family: var(--mono); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text3); }
.text-warning { color: var(--warning); }
.fw-600 { font-weight: 600; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 28px; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }

@media (max-width: 900px) {
  :root { --sidebar-w: 200px; }
  .charts-row { grid-template-columns: 1fr; }
  .report-summary { grid-template-columns: 1fr 1fr; }
  .field-row.cols-3, .field-row.cols-4 { grid-template-columns: 1fr 1fr; }
  .cal-year-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  #page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .field-row.cols-2 { grid-template-columns: 1fr; }
  .cal-year-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── DASHBOARD v2 ────────────────────────────────────────────────────────── */
.dash-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.period-tabs { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 3px; flex-shrink: 0; }
.period-tab { background: none; border: none; padding: 6px 13px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text2); cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.period-tab:hover { background: var(--bg); color: var(--text); }
.period-tab.active { background: var(--primary); color: #fff; }
.custom-range { display: flex; align-items: center; gap: 6px; }
.custom-range input[type=date] { border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 9px; font-size: 13px; background: var(--surface); }

/* Zone multi-select dropdown */
.zone-filter-wrap { position: relative; margin-left: auto; }
.zone-filter-btn { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 13px; font-size: 13px; cursor: pointer; color: var(--text2); white-space: nowrap; transition: border-color .15s, color .15s; }
.zone-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.zone-drop { position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); width: 230px; z-index: 100; }
.zone-drop-actions { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.zone-drop-actions button { font-size: 12px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); cursor: pointer; color: var(--text2); }
.zone-drop-actions button:hover { border-color: var(--primary); color: var(--primary); }
.zone-drop-list { max-height: 270px; overflow-y: auto; padding: 4px 0; }
.zone-drop-item { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.zone-drop-item:hover { background: var(--bg); }

/* Alert strip */
.dash-alert-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.dash-ap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; align-items: center; gap: 12px; transition: box-shadow .15s; }
.dash-ap.active:hover { box-shadow: var(--shadow); }
.ap-num { font-size: 26px; font-weight: 700; font-family: var(--mono); line-height: 1; }
.ap-txt { font-size: 12px; color: var(--text3); font-weight: 500; line-height: 1.4; }
.dash-ap.ap-red .ap-num    { color: #DC2626; }
.dash-ap.ap-red.active     { border-color: #FCA5A5; background: #FEF2F2; }
.dash-ap.ap-amber .ap-num  { color: #D97706; }
.dash-ap.ap-amber.active   { border-color: #FCD34D; background: #FFFBEB; }
.dash-ap.ap-purple .ap-num { color: #7C3AED; }
.dash-ap.ap-purple.active  { border-color: #C4B5FD; background: #F5F3FF; }
.dash-ap.ap-blue .ap-num   { color: #2563EB; }
.dash-ap.ap-blue.active    { border-color: #93C5FD; background: #EFF6FF; }

/* Financial strip */
.fin-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.fin-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 20px; }
.fin-card-warn { border-color: #FCA5A5; background: #FEF2F2; }
.fin-card-muted { background: var(--surface2); }
.fin-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); margin-bottom: 6px; }
.fin-value { font-size: 22px; font-weight: 700; font-family: var(--mono); color: var(--text); margin-bottom: 4px; }
.fin-trend { font-size: 12px; color: var(--text3); margin-bottom: 4px; min-height: 17px; }
.fin-sub { font-size: 12px; color: var(--text3); }

/* Zone grid */
.section-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-hdr h3 { font-size: 15px; font-weight: 600; }
.zone-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 20px; }
.zone-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 15px; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.zone-card:hover { box-shadow: var(--shadow); border-color: var(--primary-mid); }
.zc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.zc-name { font-size: 13px; font-weight: 700; color: var(--text); flex: 1; padding-right: 8px; line-height: 1.3; }
.zc-donut { flex-shrink: 0; }
.zc-total { font-size: 11px; color: var(--text3); margin-bottom: 6px; }
.zc-statuses { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 10px; min-height: 22px; }
.zc-revenue { font-size: 16px; font-weight: 700; font-family: var(--mono); color: #16A34A; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.zc-sub { font-size: 11px; color: var(--text3); margin-bottom: 8px; }
.zc-linen { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 8px; border-top: 1px solid var(--border); }
.linen-pill { font-size: 11px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; color: var(--text2); }
.linen-pill strong { color: var(--text); }

/* Bottom row */
.dash-bottom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

@media (max-width: 1100px) {
  .fin-strip { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .dash-alert-strip { grid-template-columns: repeat(2, 1fr); }
  .fin-strip { grid-template-columns: 1fr 1fr; }
  .dash-bottom-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dash-alert-strip { grid-template-columns: 1fr 1fr; }
  .zone-grid { grid-template-columns: 1fr; }
  .zone-filter-wrap { margin-left: 0; width: 100%; }
  .zone-filter-btn { width: 100%; }
}
