:root {
  --navy: #0F1E2E;
  --gold: #D9BE85;
  --gold-dark: #8A6A2E;
  --ivory: #F7F4EE;
  --bg: #F4F1EA;
  --line: #E6E0D4;
  --line-strong: #D8D2C5;
  --muted: #5A6472;
  --ink2: #3B4552;
  --red: #B3261E;
  --green: #1E6B3A;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--navy); font-family: Cairo, "Segoe UI", Tahoma, sans-serif; font-size: 15px; }
a { color: var(--navy); }
a:hover { color: var(--gold-dark); }
.layout { display: flex; flex-wrap: wrap; min-height: 100vh; }
.sidebar { flex: 0 0 240px; background: var(--navy); color: var(--ivory); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; text-decoration: none; color: var(--ivory); }
.brand { white-space: nowrap; }
[dir=ltr] { unicode-bidi: isolate; }
.brand .word { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 700; font-size: 20px; letter-spacing: 2px; line-height: 1; }
.brand .tag { font-size: 9px; letter-spacing: 3px; color: var(--gold); }
.sidebar a.nav { padding: 11px 14px; border-radius: 10px; color: #C9D1DB; text-decoration: none; display: flex; justify-content: space-between; }
.sidebar a.nav.active { background: rgba(217,190,133,0.16); color: var(--ivory); font-weight: 600; }
.sidebar a.nav:hover { color: var(--ivory); }
.sidebar .soon { font-size: 11px; color: var(--gold); }
.sidebar .section { margin-top: 14px; padding: 0 14px 4px; font-size: 12px; color: var(--gold); }
.sidebar .me { margin-top: auto; padding: 14px; border-top: 1px solid rgba(247,244,238,.15); font-size: 14px; }
.sidebar .me small { display: block; color: var(--gold); }
.sidebar .me button { margin-top: 8px; background: none; border: 1px solid rgba(247,244,238,.3); color: var(--ivory); border-radius: 8px; padding: 6px 12px; font-family: inherit; cursor: pointer; }
.content { flex: 999 1 560px; min-width: 0; padding: 22px 28px 48px; display: flex; flex-direction: column; gap: 18px; }
.topbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.topbar form.search { flex: 1 1 280px; display: flex; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--navy); border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; padding: 0 12px; min-height: 44px; width: 100%; }
textarea { padding: 10px 12px; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; color: var(--navy); font-family: inherit; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn.primary { background: var(--navy); color: var(--ivory); border-color: var(--navy); font-weight: 600; }
.btn.outline { border-color: var(--navy); font-weight: 600; }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn.danger { color: #7A1A13; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.bell { position: relative; width: 44px; padding: 0; }
.bell .count { position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
h1 { margin: 0; font-size: 26px; }
h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card.dark { background: var(--navy); color: var(--ivory); border-color: var(--navy); }
.card.dark .muted { color: #C9D1DB; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi .num { font-size: 32px; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.split { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.split > .main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.split > .side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--ivory); text-align: right; color: var(--ink2); font-size: 14px; padding: 12px 14px; white-space: nowrap; }
td { padding: 12px 14px; border-top: 1px solid #EEE9DE; vertical-align: top; }
tr.warn td { background: #FFF8F0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.available { background: #E3F1E6; color: #1E5530; }
.pill.reserved { background: #FFF3D6; color: #6B4E12; }
.pill.sold, .pill.rented { background: #E8ECF2; color: var(--navy); }
.pill.archived { background: #F4C7C3; color: #7A1A13; }
.pill.orange { background: #FFE2C2; color: #7A3E00; }
.pill.gold { background: #FFF3D6; color: #6B4E12; }
.pill.plain { background: #E8ECF2; color: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; color: var(--navy); text-decoration: none; display: inline-flex; align-items: center; font-size: 14px; }
.chip.on { background: var(--navy); color: var(--ivory); border-color: var(--navy); font-weight: 600; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.specs .k { font-size: 13px; color: var(--muted); }
.specs .v { font-weight: 600; word-break: break-word; }
.flash { background: #E3F1E6; color: #1E5530; padding: 12px 16px; border-radius: 10px; }
.errors { background: #FBEAEA; color: #7A1A13; padding: 12px 16px; border-radius: 10px; }
.errors ul { margin: 0; padding-right: 18px; }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photos figure { margin: 0; position: relative; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.photos form { position: absolute; top: 4px; left: 4px; }
.photos form button { background: rgba(15,30,46,.75); color: #fff; border: none; border-radius: 6px; padding: 2px 8px; cursor: pointer; font-family: inherit; }
.history .item { border-right: 2px solid var(--line); padding: 2px 10px 2px 0; }
.history .item.change { border-right-color: var(--gold); }
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: right; font-weight: 600; }
.notes .note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--ivory); text-decoration: none; }
.notes .note.unread { background: #FFF3D6; }
.pager { display: flex; gap: 8px; align-items: center; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); padding: 20px; }
.login-card { background: #fff; border-radius: 16px; padding: 32px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: center; min-height: 44px; color: inherit !important; font-size: 15px !important; cursor: pointer; }
.check input { width: 20px; min-height: 20px; }
.req { color: var(--red); }
.star { font-size: 16px; }
.addr-edit { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 10px 14px; }
.addr-edit summary { cursor: pointer; font-weight: 600; }
.addr-edit[open] { display: flex; flex-direction: column; gap: 10px; }
.purpose-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.purpose-cards a { text-decoration: none; }
.purpose-cards .num { font-size: 30px; font-weight: 700; }
.matrix td.total, .matrix th.total { background: var(--ivory); font-weight: 700; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: right; }
.sound-toggle { width: 44px; padding: 0; }
.bell .count[hidden] { display: none; }
.calc .calc-v { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 10px; background: var(--ivory); font-weight: 700; direction: ltr; justify-content: flex-end; }
@media (max-width: 760px) {
  .sidebar { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; padding: 10px; }
  .sidebar .brand { padding: 0 8px; flex-basis: 100%; }
  .sidebar .section, .sidebar .me small { display: none; }
  .sidebar .me { margin: 0; border: 0; padding: 4px; }
  .content { padding: 16px; }
}
