body.admin { background: #f5f1ec; font-size: 14px; }
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #1d0a0e; color: #e8dcd4; padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar .brand { color: #fff; margin: 0 8px 26px; }
.sidebar .brand-name small { color: #b9a9a0; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; color: #e8dcd4; text-decoration: none; font-weight: 500; margin-bottom: 4px; }
.side-link:hover { background: rgba(255,255,255,.07); }
.side-link.active { background: var(--maroon); color: #fff; }
.side-bottom { margin-top: auto; font-size: 12.5px; color: #a8968c; padding: 0 8px; word-break: break-all; }
.side-bottom button { margin-top: 8px; }
.main { padding: 26px 30px 60px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.topbar h1 { font-size: 28px; margin: 0; color: var(--maroon); }
.mobile-top { display: none; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-xs { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-danger { background: #fde8e7; color: var(--bad); }
.btn-danger:hover { background: #f9d3d0; }
.btn-light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-light:hover { background: var(--cream); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: #fff; border-radius: 12px; padding: 16px 18px; border: 1px solid var(--line); }
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font: 700 24px 'Poppins'; color: var(--ink); margin-top: 2px; }
.stat.accent { background: var(--maroon); color: #fff; border-color: var(--maroon); }
.stat.accent .k { color: #f1d9dd; } .stat.accent .v { color: #fff; }

.card { background: #fff; border-radius: 14px; border: 1px solid var(--line); padding: 20px; margin-bottom: 22px; }
.card h2 { font-size: 19px; color: var(--maroon); margin-bottom: 14px; }
.card h3 { font: 600 13px 'Poppins'; text-transform: uppercase; letter-spacing: 1px; color: var(--maroon); margin: 18px 0 10px; }
.card h3:first-child { margin-top: 0; }

.filters { display: grid; grid-template-columns: 2fr repeat(5, 1fr) auto; gap: 10px; margin-bottom: 14px; align-items: end; }
.filters label { font-size: 11.5px; margin-bottom: 3px; }
.filters input, .filters select { padding: 8px 10px; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; padding: 10px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data tr:hover td { background: #fcfaf7; }
.data .r { text-align: right; }
.data small { color: var(--muted); }
.data select { padding: 5px 8px; font-size: 12.5px; width: auto; border-radius: 8px; }
.row-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.b-unpaid { background: #fde8e7; color: var(--bad); } .b-partial { background: #fdf0e1; color: var(--warn); } .b-paid { background: #e3f6ea; color: var(--ok); }
.b-online { background: #e7f1fb; color: #175cd3; } .b-offline { background: #efedff; color: #5925dc; }
.st-pending { color: var(--warn); } .st-confirmed { color: #175cd3; } .st-checked_in { color: var(--ok); } .st-checked_out { color: var(--muted); } .st-cancelled { color: var(--bad); }

.occ { border-collapse: collapse; font-size: 12px; width: 100%; }
.occ th, .occ td { padding: 6px 4px; text-align: center; border: 1px solid var(--line); white-space: nowrap; }
.occ th:first-child, .occ td:first-child { text-align: left; padding-left: 8px; font-weight: 600; }
.occ .o0 { background: #e3f6ea; } .occ .o1 { background: #fdf0e1; } .occ .o2 { background: #fbd5d1; }

/* editor */
.editor-layout { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(380px, 1fr); gap: 22px; align-items: start; }
.preview-col { position: sticky; top: 16px; }
.preview-box { background: #e9e2da; border-radius: 14px; padding: 14px; overflow: hidden; }
.inv-scale { transform-origin: top left; width: 210mm; }
.inv-scale .inv { margin: 0; }
.items-table { width: 100%; border-collapse: collapse; }
.items-table th { font-size: 11px; color: var(--muted); text-align: left; padding: 4px; font-weight: 600; }
.items-table td { padding: 4px; vertical-align: top; }
.items-table input { padding: 8px; font-size: 13px; }
.items-table .amt { text-align: right; font-weight: 600; padding-top: 12px; white-space: nowrap; }
.totals-box { background: var(--cream); border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.totals-box .sum-row { font-size: 13.5px; }
.inline { display: flex; gap: 10px; align-items: center; }
.inline input[type=checkbox] { width: auto; }
.warn-box { background: #fdf0e1; color: var(--warn); padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px; }
.sticky-actions { position: sticky; bottom: 0; background: #f5f1ec; padding: 12px 0; display: flex; gap: 8px; flex-wrap: wrap; z-index: 5; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(20,10,10,.55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 30px 12px; }
.modal-inner { background: #f5f1ec; border-radius: 14px; padding: 16px; max-width: 860px; width: 100%; }
.modal-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-bottom: 10px; }

/* login */
.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(120deg, #3a0c14, var(--maroon)); padding: 16px; }
.login-card { background: #fff; border-radius: 18px; padding: 34px 30px; width: min(400px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.25); }

.room-edit { display: grid; grid-template-columns: 160px 1fr; gap: 18px; }
.room-edit img { width: 160px; height: 120px; object-fit: cover; border-radius: 10px; background: var(--maroon-l); }

@media (max-width: 1100px) {
  .editor-layout { grid-template-columns: 1fr; }
  .preview-col { position: static; }
  .filters { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 800px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -260px; width: 240px; z-index: 60; transition: left .25s; }
  .sidebar.open { left: 0; }
  .mobile-top { display: flex; align-items: center; justify-content: space-between; background: #1d0a0e; color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 55; }
  .mobile-top button { background: none; border: 0; color: #fff; font-size: 24px; }
  .main { padding: 18px 16px 50px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .room-edit { grid-template-columns: 1fr; }
  .editor-layout { grid-template-columns: minmax(0, 1fr); }
}
