:root {
    --navy: #172847;
    --navy-2: #20375f;
    --gold: #c9a227;
    --bg: #f5f7fb;
    --text: #1c2635;
    --muted: #6f7b8f;
    --danger: #b42318;
    --success: #0b7a3b;
    --warn: #8a6500;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--navy); color: #fff; transition: width .25s ease; flex-shrink: 0; }
.sidebar.collapsed { width: 76px; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar nav { display: grid; gap: 6px; padding: 14px; }
.sidebar a { padding: 12px 14px; border-radius: 12px; color: #dfe7f4; white-space: nowrap; overflow: hidden; }
.sidebar a.active, .sidebar a:hover { background: rgba(201,162,39,.18); color: #fff; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 72px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; box-shadow: 0 8px 28px rgba(23,40,71,.08); }
.brand { display: flex; align-items: center; gap: 14px; font-weight: 700; color: var(--navy); }
.brand img { max-height: 42px; max-width: 150px; object-fit: contain; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.icon-btn, .btn, button { border: 0; border-radius: 10px; cursor: pointer; }
.icon-btn { background: #edf1f7; padding: 8px 11px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--navy); color: #fff; padding: 10px 14px; font-weight: 600; }
.btn.secondary { background: #e9edf5; color: var(--navy); }
.btn.gold { background: var(--gold); color: #141414; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.success { background: var(--success); color: #fff; }
.content { padding: 26px; flex: 1; }
.footer { background: #fff; color: var(--muted); padding: 12px 24px; border-top: 1px solid #e5eaf2; font-size: 13px; }
.card { background: #fff; border-radius: 18px; padding: 22px; box-shadow: 0 10px 35px rgba(23,40,71,.08); margin-bottom: 20px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; color: var(--navy); font-size: 28px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { position: relative; overflow: hidden; }
.kpi h3 { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.kpi .value { margin: 10px 0 4px; font-size: 28px; color: var(--navy); font-weight: 800; line-height: 1.1; }
.kpi .value.sub { font-size: 22px; margin-top: 6px; }
.kpi-follow { margin-top: 14px !important; }
.kpi small { color: var(--muted); }
.kpi.good .value { color: var(--success); }
.kpi.warn .value { color: var(--warn); }
.kpi.bad .value { color: var(--danger); }
.kpi::after { content: ""; position: absolute; right: -12px; top: -12px; width: 72px; height: 72px; border-radius: 50%; background: rgba(201,162,39,.12); }
label { display: grid; gap: 7px; color: var(--navy); font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid #d7deea; border-radius: 12px; padding: 11px 12px; font: inherit; background: #fff; }
textarea { min-height: 90px; resize: vertical; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions input[type="date"], .actions input[type="month"] { width: auto; min-width: 160px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid #edf1f7; vertical-align: top; }
th { color: var(--navy); background: #f8fafc; font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; background: #e8edf5; color: var(--navy); }
.badge.good, .badge.off { background: #dff7e9; color: var(--success); }
.badge.warn, .badge.scheduled { background: #fff4cc; color: var(--warn); }
.badge.bad, .badge.on { background: #fee4e2; color: var(--danger); }
.alert { padding: 13px 15px; border-radius: 12px; margin-bottom: 16px; }
.alert.success { background: #e8f8ef; color: var(--success); }
.alert.danger { background: #fee4e2; color: var(--danger); }
.alert.warn { background: #fff7dc; color: var(--warn); }
.user-menu { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.user-menu span { color: var(--navy); font-weight: 700; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-2)); padding: 24px; }
.login-card { width: min(440px, 100%); background: #fff; border-radius: 24px; padding: 34px; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.login-logo { display: block; max-width: 220px; max-height: 90px; margin: 0 auto 24px; object-fit: contain; }
.muted { color: var(--muted); }
.section-title { margin: 0 0 14px; color: var(--navy); font-size: 18px; }
.spark { width: 100%; height: 140px; background: #f8fafc; border-radius: 14px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 90px; gap: 10px; align-items: center; margin-bottom: 8px; }
.bar { height: 10px; background: #e8edf5; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--navy); }
.bar span.gold { background: var(--gold); }
.bar span.danger { background: var(--danger); }
.callout { padding: 14px 16px; border-radius: 14px; background: #f8fafc; border: 1px solid #e3e9f3; }
.callout strong { color: var(--navy); }
.guide-steps { margin: 0; padding-left: 20px; line-height: 1.7; }
.guide-steps li { margin-bottom: 8px; }
.guide-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.guide-head .section-title { margin: 0; }
.card ul { line-height: 1.65; padding-left: 18px; }
.card code { background: #eef2f8; padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: auto; }
@media (max-width: 1100px) {
    .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.content.chat-content { padding: 0; display: flex; flex-direction: column; min-height: calc(100vh - 72px); }
.chat-layout { display: grid; grid-template-columns: 260px 1fr; flex: 1; min-height: 0; }
.chat-list { background: #fff; border-right: 1px solid #e5eaf2; display: flex; flex-direction: column; }
.chat-list-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid #edf1f7; color: var(--navy); }
.chat-item { display: grid; gap: 4px; padding: 12px 16px; border-bottom: 1px solid #f3f6fb; }
.chat-item small { color: var(--muted); font-weight: 400; }
.chat-item.active, .chat-item:hover { background: #f6f8fd; }
.chat-main { display: flex; flex-direction: column; min-width: 0; background: #eef2f8; }
.chat-toolbar { display: flex; justify-content: space-between; gap: 12px; padding: 16px 20px; background: #fff; border-bottom: 1px solid #e5eaf2; }
.chat-toolbar p { margin: 4px 0 0; }
.chat-suggest { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px 0; }
.chat-suggest button { background: #fff; color: var(--navy); border: 1px solid #d7deea; padding: 8px 12px; font-weight: 600; }
.chat-thread { flex: 1; overflow: auto; padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.chat-bubble { max-width: 78%; padding: 12px 14px; border-radius: 16px; line-height: 1.5; box-shadow: 0 8px 20px rgba(23,40,71,.06); }
.chat-bubble.user { margin-left: auto; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble.assistant { background: #fff; color: var(--text); border-bottom-left-radius: 4px; }
.chat-bubble.pending { color: var(--muted); font-style: italic; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 14px 20px 18px; background: #fff; border-top: 1px solid #e5eaf2; }
.chat-form textarea { min-height: 52px; }
@media (max-width: 1100px) {
    .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar { position: fixed; z-index: 20; height: 100vh; transform: translateX(-110%); }
    .sidebar.open { transform: none; }
    .grid.cols-2, .grid.cols-3, .form-grid { grid-template-columns: 1fr; }
    .chat-layout { grid-template-columns: 1fr; }
    .chat-list { display: none; }
}
.hours-input { width: 72px; padding: 7px 8px; text-align: right; }
.asset-table td, .sheet td { vertical-align: middle; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 10px 14px; border-radius: 10px; background: #e9edf5; color: var(--navy); font-weight: 600; }
.tabs a.active { background: var(--navy); color: #fff; }
.sheet-wrap { overflow: auto; max-height: 70vh; border: 1px solid #e5eaf2; border-radius: 12px; }
.sheet { width: max-content; min-width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { border: 1px solid #e5eaf2; padding: 6px 8px; font-size: 13px; white-space: nowrap; }
.sheet thead th { position: sticky; top: 0; z-index: 2; background: #f3f6fb; }
.sheet .sticky { position: sticky; left: 0; z-index: 3; background: #fff; min-width: 92px; }
.sheet thead .sticky { z-index: 4; background: #eef2f8; }
.sheet input { width: 88px; padding: 6px 8px; border-radius: 8px; }
.sheet .cons { color: var(--muted); text-align: right; }
.sheet tr.today td { background: #fff8e6; }
.sheet tr.today .sticky { background: #fff8e6; }
.group-head { text-align: center; background: #eef2f8; color: var(--navy); }
.dropzone { border: 2px dashed #c9d3e3; border-radius: 16px; padding: 22px; background: #f8fafc; }
.nav-note { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.45); padding: 10px 14px 2px; }
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 40; background: rgba(23,40,71,.45); place-items: center; padding: 24px; }
.modal-overlay.open { display: grid; }
.modal-box { background: #fff; border-radius: 18px; padding: 22px; width: min(760px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px rgba(23,40,71,.25); }
.modal-box .page-head { margin-bottom: 12px; }
.modal-box .page-head .section-title { margin: 0; }
.modal-box ul { margin: 0 0 14px; padding-left: 18px; color: var(--navy); }
.sheet tr.today td, table tr.today td { background: #fff8e6; }
.summary-rev { width: 150px; text-align: right; padding: 8px 10px; }
.summary-rooms { width: 78px; text-align: right; padding: 8px 10px; }
.summary-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.summary-head .section-title { margin-bottom: 6px; }
.summary-head .muted { margin: 0; }
.month-avg { background: #f8fafc; border: 1px solid #e5eaf2; border-radius: 14px; padding: 12px 16px; min-width: min(560px, 100%); }
.month-avg h3 { margin: 0 0 10px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.month-avg-grid { display: grid; grid-template-columns: repeat(4, minmax(90px, 1fr)); gap: 10px 16px; }
.month-avg small { color: var(--muted); display: block; }
.month-avg .val { font-weight: 800; color: var(--navy); font-size: 18px; margin: 4px 0 2px; }
@media (max-width: 900px) {
    .month-avg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
