:root {
    --navy: #0F2E3D;
    --green: #3FA84D;
    --green-soft: #E6F4E8;
    --lime: #B3DA3F;
    --bg: #F5F7F9;
    --card: #FFFFFF;
    --line: #DCE4EA;
    --grey: #4F6170;
    --muted: #8497A4;
    --warn: #A15C00;
    --warn-soft: #FFF4E0;
    --error: #8A1C1C;
    --error-soft: #FDECEC;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--navy); font-size: 15px; line-height: 1.5; }
a { color: var(--green); }
h1 { font-size: 26px; margin: 0 0 20px; }
h2 { font-size: 18px; margin: 0 0 14px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.content { padding-top: 28px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); font-weight: 600; }
.brand img { height: 32px; }
.topbar nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.topbar nav a { color: var(--grey); text-decoration: none; font-weight: 500; }
.topbar nav a.active { color: var(--navy); border-bottom: 2px solid var(--green); }
.topbar .who { color: var(--muted); font-size: 13px; }
button.link { background: none; border: 0; color: var(--grey); font: inherit; cursor: pointer; padding: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.tile-label { color: var(--muted); font-size: 13px; }
.tile-value { font-size: 22px; font-weight: 700; }
.tile-note { color: var(--muted); font-size: 12px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; white-space: nowrap; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--green-soft); color: #22662D; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--green-soft); color: #22662D; }

.alert { border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
.alert-ok { background: var(--green-soft); color: #22662D; }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-error { background: var(--error-soft); color: var(--error); }

.form { display: flex; flex-direction: column; gap: 14px; max-width: 420px; }
.form-inline { flex-direction: row; align-items: center; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; font-size: 14px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
input[type=text], input[type=email], input[type=password] { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); }
input:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
.btn { font: inherit; font-weight: 600; background: var(--green); color: #fff; border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; }
.btn:hover { filter: brightness(.95); }
.btn-secondary { background: var(--card); color: var(--navy); border: 1px solid var(--line); }
.btn-danger { background: var(--error); }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.qr { background: #fff; display: inline-block; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.codes { columns: 2; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--navy); }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }

body.guest { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.guest-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 32px; width: 100%; max-width: 420px; }
.guest-logo { height: 40px; margin-bottom: 20px; }
.guest-card h1 { font-size: 22px; }
.guest-card .form { max-width: none; }
details summary { cursor: pointer; color: var(--grey); margin: 16px 0 10px; }
.small-value { font-size: 15px; font-weight: 600; }
tfoot th { color: var(--navy); font-size: 14px; text-transform: none; letter-spacing: 0; border-bottom: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1, .page-head h2 { margin: 0; }
a.btn { text-decoration: none; display: inline-block; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; max-width: 860px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
select, textarea, input[type=number], input[type=date] { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); }
textarea { resize: vertical; }
.form-inline { margin-top: 14px; flex-wrap: wrap; max-width: none; }
.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.badge-muted { background: var(--bg); color: var(--muted); }
tr.inactive td { color: var(--muted); }
button.link.danger, .danger { color: var(--error); }
.danger-zone { margin: -8px 0 20px; }
nav[role=navigation] { margin-top: 14px; }
nav[role=navigation] ul { display: flex; gap: 12px; list-style: none; padding: 0; }
h3 { font-size: 15px; margin: 18px 0 8px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 8px 14px; color: var(--grey); text-decoration: none; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--green); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters input[type=search] { min-width: 220px; }
.filters select, .filters input { max-width: 240px; }
input[type=search], input[type=month] { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy); }
.inline-label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
table.dense th, table.dense td { padding: 6px 8px; font-size: 14px; }
table.nested { margin: 8px 0 4px; background: var(--bg); border-radius: 8px; }
td.neg { color: var(--error); }
.bar-cell { min-width: 140px; white-space: nowrap; }
.bar { display: inline-block; height: 10px; background: var(--green); border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; }
.month-bar { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--grey); text-decoration: none; }
.month-bar .bars { display: flex; gap: 2px; align-items: flex-end; height: 120px; width: 100%; justify-content: center; }
.month-bar .b { width: 40%; min-height: 1px; border-radius: 3px 3px 0 0; }
.b.rev, .key.rev { background: var(--green); }
.b.cost, .key.cost { background: var(--muted); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
details summary { list-style-position: inside; }
@media (max-width: 640px) { .months { gap: 2px; } .month-bar .small { font-size: 10px; } }
