/* Falouj Podium — owner dashboard (professional) */
:root { --side: 248px; }
* { box-sizing: border-box; }
body.admin-body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
.layout { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.side {
  background: #0f1f22; color: #cfe0e2; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.side .brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.side .brand img { width: 40px; height: 40px; background:#fff; border-radius:11px; padding:5px; }
.side .brand b { font-size: 15px; color: #fff; }
.side .brand span { font-size: 11px; color: #7d9499; display: block; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px;
  font-size: 14px; font-weight: 600; color: #9fb4b7; cursor: pointer; margin-bottom: 3px; transition: .12s;
}
.nav-item .ic { width: 20px; text-align: center; font-size: 16px; }
.nav-item:hover { background: #16292c; color: #fff; }
.nav-item.active { background: linear-gradient(135deg, var(--green), var(--green-deep)); color: #fff; }
.side .spacer { flex: 1; }
.side .side-foot { border-top: 1px solid #1d3236; padding-top: 12px; font-size: 12px; color: #7d9499; }
.side .side-foot a { color: var(--green); cursor: pointer; }

/* ---------- Main ---------- */
.main { padding: 0 26px 50px; overflow-x: hidden; }
.topbar {
  position: sticky; top: 0; z-index: 10; background: linear-gradient(180deg,var(--bg) 75%, transparent);
  display: flex; align-items: center; justify-content: space-between; padding: 20px 0 16px;
}
.topbar h1 { font-size: 21px; margin: 0; }
.topbar .crumb { font-size: 12px; color: var(--muted); }
.topbar .tb-right { display: flex; align-items: center; gap: 10px; }
.search { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 9px 14px; font-size: 13px; width: 220px; }
.pill-btn { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 9px 14px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text); }
.pill-btn.primary { background: linear-gradient(135deg,var(--green),var(--green-deep)); color: #fff; border: none; }
.avatar-sm { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg,#74D2C9,#2E9BBE); color:#fff; display: grid; place-items: center; font-weight: 800; }

.section { display: none; animation: fade .2s; }
.section.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none; } }

/* ---------- KPI ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi .lab { font-size: 12px; color: var(--muted); font-weight: 600; display:flex; align-items:center; gap:6px; }
.kpi .val { font-size: 27px; font-weight: 800; margin: 8px 0 4px; }
.kpi .delta { font-size: 12px; font-weight: 700; }
.kpi .delta.up { color: var(--green); } .kpi .delta.down { color: var(--red); }
.kpi .spark { margin-top: 8px; }

/* ---------- Cards / grids ---------- */
.grid-2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; justify-content: space-between; }
.card .sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.card h3 .more { font-size: 12px; color: var(--green); cursor: pointer; font-weight: 700; }

/* ---------- Calendar ---------- */
.cal { display: grid; grid-template-columns: 60px 1fr 1fr; gap: 7px; }
.cal .head { font-size: 12px; color: var(--muted); font-weight: 700; text-align: center; padding-bottom: 4px; }
.cal .time { font-size: 12px; color: var(--muted-2); display: flex; align-items: center; }
.cell { min-height: 54px; border-radius: 10px; border: 1px solid var(--line); padding: 8px 10px; font-size: 12px; cursor: pointer; transition: .1s; }
.cell:hover { filter: brightness(.97); }
.cell.free { background: var(--bg-2); color: var(--muted-2); }
.cell.filling { background: rgba(231,146,15,.12); border-color: rgba(231,146,15,.4); }
.cell.full { background: rgba(31,176,166,.12); border-color: rgba(31,176,166,.5); }
.cell.blocked { background: rgba(239,77,82,.1); border-color: rgba(239,77,82,.4); color: var(--red); }
.cell b { display: block; font-weight: 700; }
.cell small { color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 14px; flex-wrap: wrap; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-inline-end: 5px; }

/* ---------- Tables ---------- */
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px; font-size: 13px; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--card-2); }
.uavatar { width: 30px; height: 30px; border-radius: 8px; background: var(--card-2); border:1px solid var(--line); display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; margin-inline-end: 8px; vertical-align: middle; }
.st { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; display: inline-block; }
.st.full { background: rgba(31,176,166,.14); color: var(--green-deep); }
.st.fill { background: rgba(231,146,15,.14); color: var(--amber); }
.st.cancel { background: rgba(239,77,82,.14); color: var(--red); }
.st.paid { background: rgba(31,176,166,.14); color: var(--green-deep); }
.st.pending { background: rgba(231,146,15,.14); color: var(--amber); }
.st.cash { background: rgba(47,147,216,.14); color: var(--blue); }
.row-act { color: var(--muted); cursor: pointer; font-weight: 700; font-size: 12px; padding: 5px 10px; border-radius: 8px; border:1px solid var(--line); background:var(--card); }
.row-act:hover { border-color: var(--green); color: var(--green-deep); }
.pay-pill { display:inline-flex; align-items:center; gap:6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display:inline-block; }

/* ---------- misc ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.bar { flex: 1; background: linear-gradient(180deg, var(--green), var(--green-deep)); border-radius: 6px 6px 0 0; position: relative; min-height: 4px; transition: .2s; }
.bar:hover { filter: brightness(1.08); }
.bar span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--muted); }
.legend-row { display:flex; justify-content:space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.rev-bar { height: 9px; background: var(--card-2); border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.rev-bar i { display: block; height: 100%; border-radius: 6px; }
.donut-wrap { display:flex; align-items:center; gap: 18px; }
.donut-legend { font-size: 13px; }
.donut-legend div { display:flex; align-items:center; gap:8px; margin-bottom: 8px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fld { margin-bottom: 14px; }
.fld label { font-size: 12px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 6px; }
.fld input, .fld select { width: 100%; height: 44px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; font-size: 14px; background: var(--card); color: var(--text); }
.toast-wrap { position: fixed; top: 16px; right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; animation: fade .25s; }
.toast b { font-size: 13px; display: block; } .toast span { font-size: 12px; color: var(--muted); }

/* ---------- Booking detail modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 120; background: rgba(15,42,47,.45); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.modal { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: 0 24px 60px rgba(16,42,47,.25); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; }
.modal-x { border: none; background: var(--card-2); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--muted); }
.modal-rows { margin: 18px 0 6px; border-top: 1px solid var(--line); }
.mrow { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mrow span { color: var(--muted); flex: none; }
.mrow b { text-align: end; font-weight: 700; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.wa-btn { flex: 1; display: flex; align-items: center; justify-content: center; height: 46px; background: #25d366; color: #fff; font-weight: 800; font-size: 14px; border-radius: 12px; text-decoration: none; }
.wa-btn:hover { filter: brightness(1.05); }
.cell.full, .cell.filling { cursor: pointer; }
.cell.full:hover, .cell.filling:hover { filter: brightness(.96); box-shadow: var(--shadow-sm); }

/* ---------- Login gate ---------- */
.admin-login { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(900px 500px at 50% -10%, rgba(31,176,166,.16), transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 32px 28px; box-shadow: 0 24px 60px rgba(16,42,47,.14); text-align: center; }
.login-logo { width: 56px; height: 56px; margin-bottom: 14px; }
.login-card h2 { margin: 0 0 6px; font-size: 21px; }
.login-card p { margin: 0 0 22px; font-size: 13px; color: var(--muted); }
.login-field { text-align: start; margin-bottom: 14px; }
.login-field label { font-size: 12px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 6px; }
.login-field input { width: 100%; height: 48px; border: 1px solid var(--line-2); border-radius: 11px; padding: 0 14px; font-size: 15px; background: var(--card); color: var(--text); outline: none; }
.login-field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.login-err { color: var(--red); font-size: 13px; min-height: 18px; margin-bottom: 8px; text-align: start; }
.login-btn { width: 100%; height: 50px; border: none; border-radius: 12px; background: linear-gradient(135deg,var(--green),var(--green-deep)); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: 0 8px 22px var(--green-glow); }
.login-back { display: inline-block; margin-top: 16px; font-size: 13px; color: var(--muted); cursor: pointer; }
.side-foot a { color: var(--green); cursor: pointer; }

.mobile-only { display: none; }
@media (max-width: 1040px) { .kpi-row { grid-template-columns: repeat(2,1fr);} .grid-2,.grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: -260px; z-index: 50; transition: .25s; width: 248px; }
  .side.open { left: 0; }
  .mobile-only { display: inline-grid; }
  .search { display: none; }
}
