:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-2: #f2f5f8;
  --text: #06172e;
  --muted: #536780;
  --line: #d5dee8;
  --brand: #f59e0b;
  --brand-2: #d97706;
  --accent: #1e40af;
  --danger: #dc2626;
  --warning: #b7791f;
  --ok: #15803d;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .12);
  --sidebar: #0f172a;
  --sidebar-muted: #9aa6ba;
  --sidebar-active: #1b2638;
}

[data-theme="dark"] {
  --bg: #101418;
  --panel: #171d22;
  --panel-2: #20272e;
  --text: #eef4f7;
  --muted: #9aa8b4;
  --line: #2d3842;
  --brand: #2dd4bf;
  --brand-2: #14b8a6;
  --accent: #60a5fa;
  --shadow: 0 12px 30px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { font-family: Inter; color: var(--text); background: var(--bg); }
body { margin: 0; min-height: 100vh; font-size: 16px; line-height: 1.45; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; line-height: 1.4; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 176px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 10px 8px; background: var(--sidebar); border-right: 0; color: #fff; display: flex; flex-direction: column; }
.brand { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 6px; padding: 6px 2px 10px; margin-bottom: 3px; }
.sidebar .brand { grid-template-columns: 1fr; padding: 4px 0 14px; margin-bottom: 4px; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--brand); color: #111827; font-weight: 600; }
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand strong { color: #fff; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small { color: var(--sidebar-muted); font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.capeway-logo { min-height: 74px; display: grid; place-items: center; align-content: center; gap: 3px; border-radius: 8px; background: #f8f7f3; border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .04); color: #1f2a44; text-align: center; padding: 9px 8px; }
.capeway-logo strong { color: #1f2a44; font-size: 14px; font-weight: 500; letter-spacing: 0; line-height: 1.2; }
.capeway-logo small { color: #6b7280; font-size: 12px; font-weight: 500; letter-spacing: 0; }
.capeway-wave { position: relative; width: 58px; height: 15px; display: block; margin-bottom: 1px; }
.capeway-wave::before, .capeway-wave::after { content: ""; position: absolute; left: 4px; right: 4px; height: 8px; border-top: 3px solid #b08a39; border-radius: 50%; transform: skewX(-18deg); }
.capeway-wave::before { top: 1px; }
.capeway-wave::after { top: 6px; left: 13px; right: 0; border-color: #6b7280; }
.collapse-mark { display: none; }
.side-nav { display: grid; gap: 4px; }
.side-nav a, .sidebar-settings, .sidebar-logout { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 9px; border-radius: 6px; color: #e5edf8; font-size: 14px; font-weight: 600; }
.side-nav a:hover, .side-nav a.active, .sidebar-settings:hover, .sidebar-settings.active, .sidebar-logout:hover { background: var(--sidebar-active); color: #fff; }
.side-nav a.active, .sidebar-settings.active { box-shadow: none; }
.side-nav a.active .nav-icon, .sidebar-settings.active .nav-icon { color: var(--brand); }
.sidebar-settings { margin-top: auto; margin-bottom: 2px; }
.sidebar-logout-form { margin: 0; }
.sidebar-logout { width: 100%; border: 0; background: transparent; cursor: pointer; font-family: inherit; text-align: left; }
.sidebar-logout .nav-icon { color: #ffb4a8; }
.nav-icon { width: 18px; height: 18px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 0 5px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }
.reservation-badge { background: var(--brand); color: #111827; }
.nav-badge.pulse { animation: badgePulse .7s ease-out; }
@keyframes badgePulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, .55); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.main-shell { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 5; height: 64px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 20px; background: color-mix(in srgb, var(--panel) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.search { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); }
.property-select, input, select, textarea { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); min-height: 40px; padding: 8px 10px; }
.icon-button { position: relative; width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
.action-buttons { display: flex; gap: 4px; align-items: center; }
.action-buttons form { margin: 0; }
.billing-actions { min-width: 520px; flex-wrap: wrap; }
.billing-actions form { display: inline-flex; align-items: center; gap: 4px; }
.inline-amount-input { width: 94px; min-height: 34px; padding: 6px 8px; }
.danger-action { color: var(--danger); }
.danger-action:hover { border-color: var(--danger); background: rgba(220, 38, 38, .08); }
.success-action { color: var(--ok); }
.success-action:hover { border-color: var(--ok); background: rgba(21, 128, 61, .08); }
.warning-action { color: var(--warning); }
.warning-action:hover { border-color: var(--warning); background: rgba(183, 121, 31, .1); }
.dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 99px; background: var(--danger); }
.user-menu { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: var(--accent); color: #fff; overflow: hidden; }
.property-identity { max-width: 320px; min-width: 160px; }
.property-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.property-identity-copy { min-width: 0; display: grid; gap: 2px; line-height: 1.3; }
.property-identity-copy strong, .property-identity-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.property-identity-copy small { color: var(--muted); font-size: 12px; font-weight: 500; }
.settings-account-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.settings-actions { display: flex; align-items: center; gap: 8px; }
.settings-property-preview { min-width: min(320px, 100%); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.settings-property-preview .avatar { flex: 0 0 auto; }
.content { padding: 25px 25px 36px; display: grid; gap: 21px; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.page-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
h1, h2, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.3; font-weight: 500; letter-spacing: 0; }
h2 { font-size: 18px; line-height: 1.35; font-weight: 500; }
.page-title p, .muted { color: var(--muted); font-size: 13px; line-height: 1.45; }

.primary-button, .ghost-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; padding: 8px 12px; font-weight: 600; border: 1px solid transparent; }
.primary-button { background: var(--brand); color: #fff; }
.primary-button:hover { background: var(--brand-2); }
.ghost-button { background: var(--panel); border-color: var(--line); color: var(--text); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)); gap: 10px; }
.detail-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--bg); display: grid; gap: 4px; }
.detail-grid span { color: var(--muted); font-size: 13px; font-weight: 500; }
.checkbox-row { min-height: 40px; display: flex; align-items: center; gap: 8px; }
.checkbox-row input { min-height: auto; width: 16px; height: 16px; padding: 0; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 12px; }
.metric-grid article, .panel, .module-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-grid article { padding: 16px; display: grid; gap: 5px; }
.metric-grid span, .metric-grid small, .module-card p { color: var(--muted); }
.metric-grid strong { font-size: 25px; }
.split-grid { display: grid; grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr); gap: 18px; align-items: start; }
.panel { padding: 16px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.s { width: 9px; height: 9px; border-radius: 99px; display: inline-block; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.room-tile { min-height: 92px; text-align: left; display: grid; gap: 4px; border-radius: 8px; border: 1px solid var(--line); padding: 10px; background: var(--panel-2); color: var(--text); }
.room-tile strong { font-size: 20px; }
.room-tile span, .room-tile small { overflow-wrap: anywhere; }
.vacant, .clean, .inspected { --state: #16a34a; }
.occupied { --state: #2563eb; }
.dirty { --state: #d97706; }
.maintenance, .out-of-order { --state: #dc2626; }
.room-tile { border-left: 5px solid var(--state, var(--muted)); }
.room-tile.selected { outline: 3px solid rgba(15, 23, 42, .22); outline-offset: 2px; }
.legend .vacant { background: #16a34a; } .legend .occupied { background: #2563eb; } .legend .dirty { background: #d97706; } .legend .maintenance { background: #dc2626; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 840px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 14px; line-height: 1.45; }
.data-table th { position: sticky; top: 0; background: var(--panel-2); font-size: 14px; font-weight: 600; text-transform: uppercase; color: var(--muted); cursor: pointer; }
.data-table td small { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; margin-top: 2px; }
.reservations-table { min-width: 1420px; table-layout: fixed; }
.reservations-table th,
.reservations-table td { padding: 11px 12px; white-space: nowrap; }
.reservations-table th { padding: 11px 12px; white-space: nowrap; }
.reservations-table th:nth-child(1), .reservations-table td:nth-child(1) { width: 180px; }
.reservations-table th:nth-child(2), .reservations-table td:nth-child(2),
.reservations-table th:nth-child(3), .reservations-table td:nth-child(3) { width: 110px; }
.reservations-table th:nth-child(4), .reservations-table td:nth-child(4),
.reservations-table th:nth-child(5), .reservations-table td:nth-child(5) { width: 104px; }
.reservations-table th:nth-child(6), .reservations-table td:nth-child(6),
.reservations-table th:nth-child(9), .reservations-table td:nth-child(9) { width: 68px; }
.reservations-table th:nth-child(7), .reservations-table td:nth-child(7) { width: 138px; }
.reservations-table th:nth-child(8), .reservations-table td:nth-child(8),
.reservations-table th:nth-child(10), .reservations-table td:nth-child(10) { width: 92px; }
.reservations-table th:nth-child(11), .reservations-table td:nth-child(11) { width: 112px; }
.reservations-table th:nth-child(12), .reservations-table td:nth-child(12) {
  width: 210px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.reservations-table th:nth-child(13), .reservations-table td:nth-child(13) { width: 104px; }
.reservations-table th:nth-child(14), .reservations-table td:nth-child(14) { width: 180px; }
.reservations-table .action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  white-space: normal;
}
.reservations-table .action-buttons .ghost-button,
.reservations-table .action-buttons .icon-button { flex: 0 0 auto; }
.checkout-action { white-space: nowrap; }
.special-request-cell { max-width: 360px; line-height: 1.45; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--panel-2); text-transform: capitalize; }
.status.confirmed, .status.checked-in, .status.approved, .status.completed, .status.closed { color: var(--ok); }
.status.pending, .status.assigned, .status.in-progress { color: var(--warning); }
.status.cancelled, .status.canceled, .status.no-show, .status.declined { color: var(--danger); }
.table-tools, .pagination, .toolbar, .row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-search { width: 190px; }
.pagination { justify-content: flex-end; margin-top: 12px; color: var(--muted); }
.toolbar { padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }

.calendar-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.month-expanded .calendar-strip { grid-template-columns: repeat(7, minmax(90px, 1fr)); }
.calendar-strip div, .kanban div { border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); padding: 12px; display: grid; gap: 5px; }
.calendar-strip span { font-size: 24px; font-weight: 800; }
.calendar-strip small, .kanban p { color: var(--muted); }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 12px; }
.module-card { padding: 16px; display: grid; gap: 12px; align-content: start; }
.generated-ui-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.generated-form { display: grid; gap: 10px; }
.generated-form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.generated-metric { font-size: 28px; }
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.data-form { display: grid; gap: 12px; }
.two-col { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
.data-form label, .form-stack label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.data-form input, .data-form select, .data-form textarea, .form-stack input { width: 100%; }
.full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.alert { border-radius: 8px; padding: 10px 12px; background: var(--panel-2); }
.alert.danger { color: #991b1b; background: #fee2e2; }
.alert.success { color: #166534; background: #dcfce7; }

.dashboard-kpis { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 18px; }
.dash-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.kpi-card { position: relative; min-height: 121px; padding: 21px 24px; display: grid; gap: 5px; align-content: start; }
.kpi-label { color: #3f5a7b; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.kpi-card strong { color: #031b3f; font-size: 27px; line-height: 1.08; }
.kpi-card small { color: #536780; font-size: 13px; line-height: 1.4; }
.kpi-icon { position: absolute; top: 20px; right: 20px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: #f1f5f9; font-weight: 600; font-size: 18px; }
.kpi-icon.blue { color: #2563eb; } .kpi-icon.green { color: #059669; } .kpi-icon.orange { color: #f97316; }
.kpi-icon.purple { color: #9333ea; } .kpi-icon.teal { color: #0f9f86; } .kpi-icon.red { color: #ff4d2f; }
.kpi-icon.cyan { color: #00a7d8; } .kpi-icon.pink { color: #e11d72; }

.dashboard-main-grid { display: grid; grid-template-columns: minmax(520px, 1.8fr) minmax(300px, .9fr); gap: 24px; }
.trend-card, .room-status-card, .list-card { padding: 28px 28px 24px; }
.trend-card h2, .room-status-card h2, .list-card h2 { color: #06172e; font-size: 18px; font-weight: 500; line-height: 1.35; margin-bottom: 18px; }
.chart-frame { height: 285px; overflow: hidden; }
.chart-frame svg { width: 100%; height: 100%; }
.grid-lines path { stroke: #d8e1eb; stroke-width: 1; stroke-dasharray: 3 4; fill: none; }
.line { fill: none; stroke-width: 2.2; }
.occupancy-line { stroke: #64748b; }
.revenue-line { stroke: #f59e0b; }
.axis-labels text { fill: #60738c; font-size: 12px; }
.trend-card .grid-lines, .trend-card .axis-labels { animation: chartFadeIn .55s ease-out both; }
.trend-card .chart-fill { opacity: 0; transform-origin: 40px 200px; animation: chartFillRise .9s ease-out .45s both; }
.trend-card .revenue-fill { animation-delay: .68s; }
.trend-card .line { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: chartLineDraw 1.35s cubic-bezier(.42, 0, .18, 1) .18s both; }
.trend-card .revenue-line { animation-delay: .38s; }
@keyframes chartLineDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes chartFillRise {
  from { opacity: 0; transform: scaleY(.72); }
  to { opacity: 1; transform: scaleY(1); }
}
@keyframes chartFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.room-status-card { display: grid; align-content: start; }
.donut-wrap { display: grid; place-items: center; height: 150px; }
.donut-chart {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(#6b7280 0 24%, #1f3d63 24% 64%, #f97316 64% 70%, #3b82f6 70% 76%, #111827 76% 82%, #9ca3af 82% 100%);
  position: relative;
}
.donut-chart::after { content: ""; position: absolute; inset: 30px; border-radius: 50%; background: #fff; }
.status-list { display: grid; gap: 7px; list-style: none; padding: 0; margin: 10px 0 0; }
.status-list li { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 7px; color: #314763; font-size: 13px; line-height: 1.4; }
.status-list strong { color: #06172e; }
.dot-status { width: 9px; height: 9px; border-radius: 50%; }
.dot-status.slate { background: #6b7280; } .dot-status.gray { background: #9ca3af; } .dot-status.navy { background: #1f3d63; }
.dot-status.dark { background: #111827; } .dot-status.amber { background: #f97316; } .dot-status.sky { background: #3b82f6; }

.dashboard-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.list-card h2 { display: flex; align-items: center; gap: 8px; }
.section-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; font-size: 16px; }
.section-icon.teal { color: #0f9f86; } .section-icon.pink { color: #e11d72; }
.compact-list { display: grid; }
.compact-row { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #dce4ed; }
.compact-row:last-child { border-bottom: 0; }
.rotating-message { animation: messageSlideIn .32s ease-out; }
@keyframes messageSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.compact-row strong { display: block; color: #06172e; font-size: 14px; margin-bottom: 3px; }
.compact-row small { display: block; color: #536780; font-size: 13px; line-height: 1.4; }
.compact-row em { padding: 4px 8px; border-radius: 6px; background: #f3f6fa; color: #031b3f; font-size: 12px; font-style: normal; font-weight: 600; text-transform: capitalize; }
.empty-row { min-height: 60px; }

.dark-add-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
}
.dark-add-button span { font-size: 17px; line-height: 1; }
.room-status-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.room-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; border-radius: 7px; padding: 5px 12px; font-size: 13px; border: 1px solid; }
.room-pill strong { font-weight: 600; }
.room-pill.vacant-clean { background: #dcfce7; border-color: #86efac; color: #15803d; }
.room-pill.vacant-dirty { background: #fef9c3; border-color: #fde047; color: #a16207; }
.room-pill.occupied { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }
.room-pill.out-of-order { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.room-pill.maintenance { background: #ffedd5; border-color: #fdba74; color: #c2410c; }
.room-pill.inspected { background: #f3e8ff; border-color: #d8b4fe; color: #7e22ce; }
.rooms-toolbar {
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.rooms-toolbar select { width: 140px; min-height: 38px; font-size: 14px; }
.view-toggle { display: flex; gap: 6px; }
.view-toggle button {
  width: 32px;
  height: 32px;
  border: 1px solid #cfd9e5;
  border-radius: 6px;
  background: #fff;
  color: #34445d;
  font-weight: 600;
}
.view-toggle button.active { background: #0f172a; color: #fff; border-color: #0f172a; }
.rooms-map { display: grid; gap: 24px; }
.floor-section { display: grid; gap: 13px; }
.floor-section h2 { display: flex; align-items: center; gap: 9px; color: #213a59; font-size: 18px; font-weight: 500; line-height: 1.35; }
.floor-section h2 span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.floor-room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.rooms-map.list-view .floor-room-grid { grid-template-columns: 1fr; }
.rooms-map.list-view .room-card { min-height: 74px; grid-template-columns: 120px 1fr 120px 120px auto; align-items: center; }
.room-card {
  min-height: 121px;
  display: grid;
  align-content: start;
  gap: 6px;
  border: 1px solid;
  border-radius: 9px;
  padding: 15px 16px;
}
.room-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.room-card strong { font-size: 20px; line-height: 1; color: #0b53d0; }
.room-card em { color: #0b53d0; font-size: 13px; font-style: normal; }
.room-card span { color: #0b315f; font-size: 14px; font-weight: 600; }
.room-card small { color: #274f7c; font-size: 13px; line-height: 1.4; }
.room-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.room-card-actions form { margin: 0; }
.room-card-actions .icon-button { width: 34px; height: 34px; background: rgba(255,255,255,.72); }
.rooms-map.list-view .room-card-actions { margin-top: 0; }
.room-card.vacant-clean { background: #d8fbe3; border-color: #88efad; }
.room-card.vacant-dirty { background: #fff8bd; border-color: #f7dc3e; }
.room-card.occupied { background: #d7e9ff; border-color: #9bc7ff; }
.room-card.out-of-order { background: #ffe0e0; border-color: #f6a7a7; }
.room-card.maintenance { background: #ffebcf; border-color: #f7bf76; }
.room-card.inspected { background: #efe0ff; border-color: #dab7ff; }
.room-card.vacant-clean strong, .room-card.vacant-clean em { color: #00883c; }
.room-card.vacant-dirty strong, .room-card.vacant-dirty em { color: #b96b00; }
.room-card.maintenance strong, .room-card.maintenance em { color: #d64b00; }
.room-card.out-of-order strong, .room-card.out-of-order em { color: #c51616; }
.room-card.inspected strong, .room-card.inspected em { color: #7f22ce; }
.empty-rooms-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}
.empty-rooms-state p { color: var(--muted); }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 28%, rgba(245, 158, 11, .14), transparent 30%), rgba(15, 23, 42, .74);
  padding: 20px;
  perspective: 1200px;
  backdrop-filter: blur(3px);
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  width: min(540px, 100%);
  background:
    linear-gradient(145deg, rgba(255,255,255,.99), rgba(242,245,248,.98)),
    var(--panel);
  border-radius: 10px;
  border: 1px solid rgba(213, 222, 232, .95);
  box-shadow:
    0 28px 76px rgba(15, 23, 42, .38),
    0 12px 0 rgba(15, 23, 42, .08),
    inset 0 1px 0 rgba(255,255,255,.92);
  padding: 24px;
  transform: rotateX(3deg) translateY(0);
  transform-origin: center top;
  animation: modalPop3d .2s ease-out both;
}
.modal-card::before {
  content: "";
  display: block;
  height: 4px;
  margin: -24px -24px 18px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(90deg, var(--brand), #0e7490, var(--accent));
}
.confirm-backdrop { background: rgba(15, 23, 42, .64); }
.confirm-card {
  width: min(460px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(245, 158, 11, .45);
  transform: rotateX(4deg) translateY(0);
}
.confirm-card::before { grid-column: 1 / -1; margin: -22px -22px 14px; }
.confirm-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--brand), #fbbf24);
  color: #111827;
  font-size: 24px;
  font-weight: 600;
  box-shadow: 0 10px 18px rgba(245, 158, 11, .32);
}
.confirm-copy { display: grid; gap: 7px; }
.confirm-copy h2 { color: var(--text); font-size: 18px; font-weight: 500; line-height: 1.35; }
.confirm-copy p { color: var(--muted); line-height: 1.45; }
.confirm-actions { grid-column: 1 / -1; padding-top: 4px; }
.confirm-ok {
  background: linear-gradient(180deg, #0f766e, #0e7490);
  box-shadow: 0 4px 0 #155e75, 0 12px 22px rgba(14, 116, 144, .22);
}
.confirm-ok:not(:disabled):hover { background: linear-gradient(180deg, #115e59, #155e75); }
.confirm-cancel { background: #fff; }
@keyframes modalPop3d {
  from { opacity: 0; transform: rotateX(12deg) translateY(18px) scale(.96); }
  to { opacity: 1; transform: rotateX(3deg) translateY(0) scale(1); }
}
.wide-modal { width: min(760px, 100%); }
.global-search-card { width: min(840px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.modal-head h2 { font-size: 18px; font-weight: 500; line-height: 1.35; color: #06172e; }
.modal-close { width: 32px; height: 32px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #64748b; font-size: 20px; }
.modal-close:hover { border-color: var(--line); background: var(--panel-2); color: var(--text); }
.room-modal-form { display: grid; gap: 16px; }
.room-modal-form label { display: grid; gap: 7px; color: #06172e; font-size: 13px; font-weight: 500; }
.room-modal-form input, .room-modal-form select, .room-modal-form textarea { width: 100%; min-height: 38px; background: #fff; border-color: #cfd9e5; color: #06172e; -webkit-text-fill-color: #06172e; opacity: 1; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04), 0 1px 0 rgba(255,255,255,.86); }
.room-modal-form input::placeholder, .room-modal-form textarea::placeholder { color: #64748b; opacity: 1; -webkit-text-fill-color: #64748b; }
.room-modal-form select option { color: #06172e; background: #fff; }
.room-modal-form input:disabled, .room-modal-form select:disabled, .room-modal-form textarea:disabled { color: #334155; -webkit-text-fill-color: #334155; opacity: .85; background: #f8fafc; }
.two-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.global-search-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 14px; }
.search-field { min-height: 42px; display: flex; align-items: center; gap: 8px; border: 1px solid #cfd9e5; border-radius: 8px; background: #fff; padding: 0 12px; color: #06172e; }
.search-field input { flex: 1; min-height: 38px; border: 0; outline: 0; padding: 0; background: transparent; color: #06172e; -webkit-text-fill-color: #06172e; }
.global-search-results { max-height: min(56vh, 520px); overflow: auto; display: grid; gap: 8px; padding-right: 2px; }
.global-search-empty { min-height: 72px; display: grid; place-items: center; border: 1px dashed #cfd9e5; border-radius: 8px; color: #536780; font-size: 14px; text-align: center; padding: 18px; }
.global-search-row { display: grid; grid-template-columns: 108px 1fr auto; align-items: center; gap: 12px; border: 1px solid #d5dee8; border-radius: 8px; background: #fff; padding: 12px; color: #06172e; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
.global-search-row strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; color: #06172e; overflow-wrap: anywhere; }
.global-search-row small { display: block; margin-top: 3px; color: #536780; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.global-search-type { justify-self: start; border-radius: 999px; padding: 5px 8px; background: #f3f6fa; color: #314763; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.global-search-loading { border-style: solid; }
.compose-backdrop {
  place-items: end;
  align-items: end;
  justify-items: end;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
  padding: 18px 22px;
}
.compose-card {
  width: min(560px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  background: #fff;
  border: 1px solid #263445;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .38), 0 2px 8px rgba(15, 23, 42, .2);
  transform: none;
  pointer-events: auto;
  animation: composeSlideUp .18s ease-out both;
}
.compose-card::before { display: none; }
.compose-head {
  min-height: 44px;
  margin: 0;
  padding: 10px 12px 10px 16px;
  background: #111820;
  color: #fff;
}
.compose-head h2 { color: #fff; font-size: 14px; font-weight: 600; }
.compose-head .modal-close { width: 28px; height: 28px; color: #cbd5e1; font-size: 18px; border-radius: 6px; }
.compose-head .modal-close:hover { background: rgba(255,255,255,.12); color: #fff; border-color: transparent; }
.compose-form { gap: 0; min-height: 0; background: #fff; }
.compose-warning {
  margin: 10px 14px 0;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fee2e2;
  color: #991b1b;
  padding: 9px 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.compose-field-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid #e5ebf2;
  color: #64748b;
  font-size: 14px;
}
.compose-field-row input,
.compose-subject-row input,
.compose-body {
  min-height: 40px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 8px 0;
  background: #fff;
  color: #06172e;
  -webkit-text-fill-color: #06172e;
  outline: 0;
}
.compose-subject-row { padding: 0 14px; border-bottom: 1px solid #e5ebf2; }
.compose-subject-row input { width: 100%; font-weight: 500; }
.compose-body {
  width: 100%;
  min-height: 220px;
  max-height: 330px;
  resize: vertical;
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.compose-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid #e5ebf2;
  background: #f8fafc;
}
.compose-options label,
.compose-form [data-reply-field] {
  display: grid;
  gap: 6px;
  color: #536780;
  font-size: 13px;
  font-weight: 500;
}
.compose-options select { min-height: 36px; background: #fff; color: #06172e; }
.compose-form [data-reply-field] { padding: 10px 14px; border-top: 1px solid #e5ebf2; }
.compose-form [data-reply-field] textarea { min-height: 110px; background: #fff; color: #06172e; -webkit-text-fill-color: #06172e; }
.compose-actions {
  justify-content: flex-start;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid #e5ebf2;
  background: #fff;
}
.compose-actions .modal-primary {
  min-width: 94px;
  border-radius: 999px;
  background: #0b57d0;
}
.compose-actions .modal-primary:hover { background: #0842a0; }
.compose-detail-mode .compose-body { background: #f8fafc; }
#reservationForm input[type="date"] { cursor: pointer; }
@keyframes composeSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.billing-print-area { display: grid; gap: 16px; color: #06172e; }
.billing-print-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border: 1px solid #d5dee8; border-radius: 8px; background: #f8fafc; padding: 14px; }
.billing-print-head strong { display: block; font-size: 18px; font-weight: 600; }
.billing-print-head small { display: block; margin-top: 4px; color: #536780; font-size: 13px; }
.billing-itemized-list { display: grid; border: 1px solid #d5dee8; border-radius: 8px; overflow: hidden; }
.billing-itemized-list div { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid #d5dee8; background: #fff; }
.billing-itemized-list div:last-child { border-bottom: 0; }
.billing-itemized-list span { color: #536780; font-weight: 600; }
.billing-itemized-list strong { color: #06172e; font-weight: 700; }
.billing-total-row { background: #f3f6fa !important; }
.modal-primary {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, #0f766e, #0e7490);
  color: #fff;
  padding: 8px 16px;
  font-weight: 600;
  box-shadow: 0 4px 0 #155e75, 0 12px 22px rgba(14, 116, 144, .18);
}
.modal-primary:not(:disabled):hover { background: linear-gradient(180deg, #115e59, #155e75); }
.approve-action {
  background: linear-gradient(180deg, #16a34a, #15803d);
  box-shadow: 0 4px 0 #166534, 0 12px 22px rgba(21, 128, 61, .2);
}
.approve-action:not(:disabled):hover { background: linear-gradient(180deg, #15803d, #166534); }
.decline-action {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}
.decline-action:hover {
  border-color: #dc2626;
  background: #fecaca;
  color: #7f1d1d;
}
.focus-panel { outline: 3px solid rgba(245, 158, 11, .35); outline-offset: 3px; }
.module-action-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.webhook-endpoint {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.webhook-endpoint span { color: var(--muted); font-size: 13px; font-weight: 500; }
.webhook-endpoint code { overflow-wrap: anywhere; color: var(--text); }
.webhook-endpoint.success { border-color: #86efac; background: #dcfce7; }
.api-example { display: grid; gap: 8px; margin: 12px 0; }
.api-example pre { margin: 0; max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); padding: 12px; }
.api-example code { white-space: pre; color: var(--text); }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 18%, rgba(45, 212, 191, .18), transparent 28%), linear-gradient(135deg, #eef6f5, #f8fafc 54%, #e7eef8); color: #06172e; }
.auth-panel { width: min(440px, 100%); display: grid; gap: 18px; background: #fff; border: 1px solid #d5dee8; border-radius: 10px; padding: 28px; box-shadow: 0 24px 54px rgba(15, 23, 42, .18); }
.auth-brand { grid-template-columns: 34px 1fr; align-items: center; gap: 10px; margin: 0; padding: 0 0 4px; }
.auth-brand .brand-mark { width: 34px; height: 34px; border-radius: 9px; background: #2dd4bf; color: #06172e; font-size: 14px; }
.auth-brand strong { color: #06172e; font-size: 16px; font-weight: 600; }
.auth-brand small { color: #536780; font-size: 13px; }
.auth-panel h1 { color: #06172e; font-size: 24px; font-weight: 500; line-height: 1.3; }
.auth-panel > p { color: #536780; font-size: 16px; line-height: 1.45; max-width: 340px; }
.form-stack { display: grid; gap: 14px; }
.form-stack label { display: grid; gap: 7px; color: #314763; font-size: 14px; font-weight: 600; }
.form-stack input { width: 100%; min-height: 44px; border: 1px solid #c9d5e2; border-radius: 8px; background: #fff; color: #06172e; -webkit-text-fill-color: #06172e; padding: 10px 12px; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04); opacity: 1; }
.form-stack input:focus { border-color: #2dd4bf; outline: 3px solid rgba(45, 212, 191, .22); }
.auth-panel .primary-button { min-height: 44px; background: #2dd4bf; color: #06172e; border: 0; font-size: 14px; font-weight: 700; }
.auth-panel .primary-button:hover { background: #14b8a6; }
.auth-link { justify-self: center; color: #2563eb; font-weight: 700; }
.auth-link:hover { text-decoration: underline; }
.mobile-only { display: none; }

@media print {
  body * { visibility: hidden !important; }
  #billingPrintArea, #billingPrintArea * { visibility: visible !important; }
  #billingPrintArea { position: absolute; left: 0; top: 0; width: 100%; padding: 24px; background: #fff; }
  .modal-backdrop { position: static; background: #fff; padding: 0; }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; z-index: 20; transition: left .2s ease; }
  .sidebar.open { left: 0; }
  .mobile-only { display: inline-grid; }
  .topbar .mobile-only { margin-right: auto; }
  .metric-grid, .module-grid, .split-grid, .kanban, .dashboard-kpis, .dashboard-main-grid, .dashboard-bottom-grid { grid-template-columns: 1fr 1fr; }
  .user-menu span:last-child { display: none; }
  .property-identity { min-width: auto; }
}

@media (max-width: 640px) {
  .topbar { padding: 10px; gap: 8px; }
  .search { min-width: 0; }
  .content { padding: 12px; }
  .page-title { align-items: stretch; flex-direction: column; }
  .metric-grid, .module-grid, .split-grid, .kanban, .calendar-strip, .two-col, .dashboard-kpis, .dashboard-main-grid, .dashboard-bottom-grid { grid-template-columns: 1fr; }
  .global-search-form, .global-search-row { grid-template-columns: 1fr; }
  .global-search-row .ghost-button { justify-self: stretch; }
  h1 { font-size: 24px; }
}

