/* KostPintar theme — tokens derived from the reference landing page */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f8fa;
  --bg-tertiary: #f2f4f7;
  --text-primary: #101828;
  --text-body: #46453f;
  --text-muted: #76756e;
  --navy: #185fa5;
  --navy-dark: #124b85;
  --navy-soft: #e6f1fb;
  --navy-tint: #f1f6fc;
  --amber: #d99a1c;
  --amber-soft: #fdf3e0;
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, .10);
  --wa: #25d366;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --border: rgba(20, 42, 66, .10);
  --border-strong: rgba(20, 42, 66, .18);
  --shadow: 0 18px 50px -20px rgba(12, 68, 124, .35);
  --shadow-sm: 0 8px 28px -12px rgba(12, 68, 124, .2);
  --radius: 12px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg-primary: #162131; --bg-secondary: #1b283b; --bg-tertiary: #0e1724;
  --text-primary: #e4ecf7; --text-body: #c3cedd; --text-muted: #8a99ad;
  --navy: #4f8fe8; --navy-dark: #3a78d0; --navy-soft: rgba(79,143,232,.16); --navy-tint: #1b283b;
  --amber-soft: rgba(217,154,28,.15); --danger: #ee6b62; --danger-soft: rgba(238,107,98,.14);
  --border: rgba(228,236,247,.09); --border-strong: rgba(228,236,247,.18);
  --shadow: 0 18px 50px -20px rgba(0,0,0,.6); --shadow-sm: 0 8px 28px -12px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-dark); }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; color: var(--text-primary); }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
img { max-width: 100%; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--amber); text-transform: uppercase; letter-spacing: .08em; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #0f172a26; border-radius: 8px; }

/* ------------------------------------------------------------------ layout */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--bg-primary); border-right: 0.5px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font-weight: 800; font-size: 17px; color: var(--text-primary); letter-spacing: -0.02em; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 18px; }
.prop-switch { margin: 0 12px 10px; position: relative; }
.prop-switch select { width: 100%; padding: 9px 30px 9px 12px; font-weight: 600; background: var(--navy-tint); }
.nav { padding: 4px 10px 16px; display: flex; flex-direction: column; gap: 1px; }
.nav-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--text-body); font-weight: 500; font-size: 13.5px;
}
.nav a i { font-size: 18px; color: var(--text-muted); }
.nav a:hover { background: var(--bg-secondary); color: var(--text-primary); }
.nav a.active { background: var(--navy-soft); color: var(--navy); font-weight: 600; }
.nav a.active i { color: var(--navy); }
.nav .count { margin-left: auto; background: var(--navy); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.nav .count.warn { background: var(--amber); }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 0.5px solid var(--border); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--bg-primary);
  border-bottom: 0.5px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.topbar .spacer { flex: 1; }
.content { padding: 24px 28px 48px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--text-muted); margin-top: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.menu-toggle { display: none; }

/* ------------------------------------------------------------------ cards & grids */
.card { background: var(--bg-primary); border: 0.5px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 18px 0; }
.hover-lift { transition: box-shadow .15s, transform .15s; }
.hover-lift:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.grid { display: grid; gap: 16px; }
.grid > *, .stack > * { min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }

.stat { background: var(--navy-tint); border: 0.5px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.stat .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--navy-soft); color: var(--navy); display: grid; place-items: center; font-size: 18px; margin-bottom: 10px; }
.stat .val { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.stat .lbl { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat.white { background: var(--bg-primary); }

.progress { height: 8px; border-radius: 4px; background: var(--navy-soft); overflow: hidden; }
.progress > div { height: 100%; background: var(--navy); border-radius: 4px; }

.note { display: flex; align-items: center; gap: 8px; border-radius: 8px; padding: 9px 12px; font-size: 12.5px; }
.note i { font-size: 16px; }
.note.blue { background: var(--navy-soft); color: var(--navy); }
.note.green { background: var(--green-soft); color: var(--green); }
.note.amber { background: var(--amber-soft); color: #9a6a0b; }
.note.red { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge.available, .badge.paid, .badge.confirmed, .badge.resolved, .badge.sent, .badge.verified, .badge.signed { background: var(--green-soft); color: var(--green); }
.badge.occupied, .badge.active, .badge.in_progress, .badge.blue { background: var(--navy-soft); color: var(--navy); }
.badge.booked, .badge.pending, .badge.queued, .badge.unpaid, .badge.open { background: var(--amber-soft); color: #9a6a0b; }
.badge.maintenance, .badge.moved_out, .badge.cancelled, .badge.gray { background: var(--bg-tertiary); color: var(--text-muted); }
.badge.overdue, .badge.rejected { background: var(--danger-soft); color: var(--danger); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 8px;
  border: 0.5px solid var(--border-strong); background: var(--bg-primary); color: var(--text-body);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2;
}
.btn i { font-size: 16px; }
.btn:hover { background: var(--bg-secondary); color: var(--text-primary); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.btn-soft { background: var(--navy-soft); border-color: transparent; color: var(--navy); }
.btn-soft:hover { background: var(--navy-soft); color: var(--navy-dark); filter: brightness(.97); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: #1fb457; color: #fff; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn { width: 34px; height: 34px; padding: 0; }
form.inline { display: inline; }

/* ------------------------------------------------------------------ forms */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-body); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 0.5px solid var(--border-strong);
  background: var(--bg-primary); color: var(--text-primary); font: inherit; font-size: 13.5px;
}
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--navy); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); }
textarea { min-height: 90px; resize: vertical; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 0.5px solid var(--border); border-radius: 8px; margin-bottom: 8px; font-weight: 500; cursor: pointer; }
.check input { margin-top: 3px; }
.check small { display: block; color: var(--text-muted); font-weight: 400; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters select, .filters input { width: auto; min-width: 150px; }
.tabs { display: flex; gap: 4px; border-bottom: 0.5px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 12px; color: var(--text-muted); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--navy); border-color: var(--navy); }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 0.5px solid var(--border); background: var(--bg-secondary); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 0.5px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bg-secondary); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-title { font-weight: 600; color: var(--text-primary); }
.empty { text-align: center; padding: 36px 16px; color: var(--text-muted); }
.empty i { font-size: 34px; display: block; margin-bottom: 8px; color: var(--navy); opacity: .5; }

/* ------------------------------------------------------------------ rooms */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.room-card { background: var(--bg-primary); border: 0.5px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.room-photo { height: 170px; flex-shrink: 0; width: 100%; overflow: hidden; background: linear-gradient(135deg, #e6f1fb 0%, #d9ebfa 100%); display: grid; place-items: center; color: var(--navy); font-size: 34px; position: relative; }
/* Any photo shape fills the box (cropped to centre) and never pushes over the text below. */
.room-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.room-photo .badge { position: absolute; top: 10px; left: 10px; z-index: 1; }
.room-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.price { font-weight: 700; color: var(--navy); }
.price small { color: var(--text-muted); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--bg-tertiary); color: var(--text-body); }
.room-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.room-mini a { border-radius: 8px; padding: 9px 8px; text-align: center; font-weight: 700; font-size: 13px; border: 0.5px solid var(--border); }
.room-mini a small { display: block; font-weight: 500; font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-mini .available { background: var(--green-soft); color: var(--green); }
.room-mini .occupied { background: var(--navy); color: #fff; }
.room-mini .booked { background: var(--amber-soft); color: #9a6a0b; }
.room-mini .maintenance { background: var(--bg-tertiary); color: var(--text-muted); }
.photo-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-strip .ph { position: relative; width: 120px; height: 84px; border-radius: 8px; overflow: hidden; border: 0.5px solid var(--border); }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; }
.photo-strip form { position: absolute; top: 4px; right: 4px; }
.photo-strip button { background: rgba(0,0,0,.55); color: #fff; border: 0; border-radius: 6px; width: 24px; height: 24px; cursor: pointer; }

/* ------------------------------------------------------------------ charts (pure CSS) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bars .bar { width: 42%; max-width: 22px; border-radius: 4px 4px 0 0; background: var(--navy); min-height: 2px; }
.bars .bar.exp { background: var(--amber); }
.bars .lbl { font-size: 11px; color: var(--text-muted); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--navy); }
.legend span.exp::before { background: var(--amber); }
.hbar { display: grid; grid-template-columns: 100px 1fr 64px; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 12.5px; }
.hbar .mono { text-align: right; }
.hbar .track { height: 8px; background: var(--navy-soft); border-radius: 4px; overflow: hidden; }
.hbar .track div { height: 100%; background: var(--amber); }

/* ------------------------------------------------------------------ calendar */
.cal { border-collapse: separate; border-spacing: 0; font-size: 11.5px; }
.cal th, .cal td { padding: 0; border-bottom: 0.5px solid var(--border); text-align: center; }
.cal th { padding: 8px 0; min-width: 30px; text-transform: none; letter-spacing: 0; }
.cal th.today { color: var(--navy); background: var(--navy-soft); }
.cal th.wk { color: var(--danger); }
.cal td.room { position: sticky; left: 0; background: var(--bg-primary); text-align: left; padding: 8px 14px; font-weight: 700; white-space: nowrap; z-index: 1; border-right: 0.5px solid var(--border); }
.cal th.room { position: sticky; left: 0; z-index: 2; text-align: left; padding-left: 14px; }
.cal td.slot { height: 38px; padding: 4px 1px; }
.cal .seg { display: block; height: 28px; line-height: 28px; border-radius: 6px; padding: 0 8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.cal .occ { background: var(--navy); color: #fff; }
.cal .book { background: var(--amber-soft); color: #9a6a0b; border: 1px dashed var(--amber); }
.cal .maint { background: var(--bg-tertiary); color: var(--text-muted); }
.cal tbody tr:hover td { background: transparent; }

/* ------------------------------------------------------------------ flash */
.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; font-size: 13px; font-weight: 500; border: 0.5px solid var(--border); }
.flash.success { background: var(--green-soft); color: var(--green); }
.flash.danger { background: var(--danger-soft); color: var(--danger); }
.flash.info { background: var(--navy-soft); color: var(--navy); }

/* ------------------------------------------------------------------ public pages */
.pub-nav { background: var(--bg-primary); border-bottom: 0.5px solid var(--border); position: sticky; top: 0; z-index: 10; }
.pub-nav .inner { max-width: 1080px; margin: 0 auto; padding: 0 22px; height: 60px; display: flex; align-items: center; gap: 22px; }
.pub-nav .links { display: flex; gap: 22px; margin-left: 12px; }
.pub-nav .links a { color: var(--text-body); font-weight: 500; font-size: 13.5px; }
.pub-nav .links a:hover { color: var(--navy); }
.container { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.section { padding: 56px 0; }
.hero { background: linear-gradient(180deg, var(--bg-primary) 0%, var(--navy-tint) 100%); border-bottom: 0.5px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 44px; align-items: center; padding: 64px 0; }
.hero h1 { font-size: 42px; line-height: 1.12; font-weight: 800; letter-spacing: -0.03em; }
.hero h1 em { font-style: normal; color: var(--navy); }
.hero p.lead { font-size: 16px; color: var(--text-body); margin: 18px 0 26px; max-width: 32em; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: var(--navy-soft); color: var(--navy); font-size: 12px; font-weight: 600; margin-bottom: 16px; }
.mock { background: var(--bg-primary); border: 0.5px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.mock-bar { background: var(--navy); padding: 10px 14px; display: flex; align-items: center; gap: 7px; }
.mock-bar span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.5); }
.mock-bar b { color: #fff; font-size: 11px; font-weight: 500; margin-left: 6px; opacity: .85; }
.feature { padding: 22px; }
.feature .ico { width: 42px; height: 42px; border-radius: 10px; background: var(--navy-soft); color: var(--navy); display: grid; place-items: center; font-size: 21px; margin-bottom: 14px; }
.feature h3 { font-size: 15px; margin-bottom: 6px; }
.feature p { color: var(--text-body); font-size: 13px; line-height: 1.65; }
.center-head { text-align: center; max-width: 36em; margin: 0 auto 36px; }
.center-head h2 { font-size: 28px; margin: 8px 0 10px; }
.center-head p { color: var(--text-body); }
.auth-wrap { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 32px 16px; background: linear-gradient(180deg, var(--bg-primary), var(--navy-tint)); }
.auth-card { width: 100%; max-width: 420px; padding: 30px; box-shadow: var(--shadow); }
.footer { border-top: 0.5px solid var(--border); padding: 28px 0; color: var(--text-muted); font-size: 12.5px; background: var(--bg-primary); }
.qr { background: #fff; padding: 10px; border-radius: 10px; display: inline-block; border: 0.5px solid var(--border); }

/* contract document */
.doc { background: #fff; color: #1a1a18; max-width: 800px; margin: 0 auto; padding: 48px 56px; border-radius: 12px; border: 0.5px solid var(--border); line-height: 1.75; font-size: 13.5px; }
.doc h1 { color: #101828; text-align: center; font-size: 20px; margin-bottom: 4px; }
.doc table td { border: 0; padding: 3px 0; vertical-align: top; }
.doc table td:first-child { width: 180px; color: #46453f; }
.doc tbody tr:hover td { background: transparent; }
.doc pre { white-space: pre-wrap; font-family: inherit; margin: 0; }
.sig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; text-align: center; }
.sig-box { height: 110px; display: grid; place-items: center; border-bottom: 1px solid #1a1a18; margin-bottom: 6px; }
.sig-box img { max-height: 100px; }
#sigpad { width: 100%; height: 180px; border: 1.5px dashed var(--border-strong); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g3 { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; padding: 40px 0; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow); }
  body.nav-open .backdrop { display: block; }
  .backdrop { display: none; position: fixed; inset: 0; background: rgba(10,20,35,.35); z-index: 20; }
  .btn.menu-toggle { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .g2, .form-grid { grid-template-columns: 1fr; }
  .pub-nav .links { display: none; }
  .hero h1 { font-size: 30px; }
  .doc { padding: 28px 20px; }
  .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .val { font-size: 18px; }
  .filters select, .filters input { min-width: 0; flex: 1; }
}
@media print {
  .sidebar, .topbar, .no-print, .flashes, .pub-nav { display: none !important; }
  body, .content { background: #fff; padding: 0; }
  .doc { border: 0; padding: 0; }
}
