/* Rest Gym owner app — dark gold theme matching the desktop app, phone-first. */
:root {
  --bg: #0d0d0d; --panel: #161616; --card: #1e1e1e; --line: #2c2c2c;
  --text: #f2f2f2; --muted: #9a9a9a; --gold: #c59b32; --green: #48c774; --red: #dc5050; --blue: #5aa0e6;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: "Segoe UI", Tahoma, "Noto Kufi Arabic", "Noto Sans Arabic", system-ui, sans-serif; font-size: 15px; line-height: 1.5;
       padding: calc(56px + env(safe-area-inset-top)) 12px calc(76px + env(safe-area-inset-bottom)); max-width: 1100px; margin: 0 auto; }
body.bare { padding-top: 24px; padding-bottom: 24px; }
body.bare #top, body.bare #nav { display: none; }
a { color: var(--gold); text-decoration: none; }
h2 { font-size: 20px; margin: 8px 0 12px; }
h3 { font-size: 16px; margin: 0 0 10px; color: var(--gold); }
h4 { font-size: 14px; margin: 14px 0 6px; color: var(--muted); }

#top { position: fixed; top: 0; inset-inline: 0; z-index: 10; display: flex; gap: 10px; align-items: center;
       padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: rgba(13,13,13,.96); border-bottom: 1px solid var(--line); }
.brand { font-size: 28px; font-weight: 800; color: var(--gold); text-align: center; margin: 20px 0; }
.brand-s { font-weight: 800; color: var(--gold); white-space: nowrap; }
.msel { flex: 1; min-width: 0; }
#nav { position: fixed; bottom: 0; inset-inline: 0; z-index: 10; display: flex; justify-content: space-around;
       padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(16,16,16,.98); border-top: 1px solid var(--line); }
#nav a { display: flex; flex-direction: column; align-items: center; color: var(--muted); font-size: 12px; padding: 2px 8px; border-radius: 10px; }
#nav a.on { color: var(--gold); background: #231d10; }
#nav .ni { font-size: 20px; line-height: 1.2; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; overflow: hidden; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.kpi .kl { color: var(--muted); font-size: 12.5px; }
.kpi .kv { font-size: 18px; font-weight: 700; margin-top: 2px; }
.kpi.g .kv, .g { color: var(--green); } .kpi.r .kv, .r { color: var(--red); } .kpi.gold .kv, .gold-t { color: var(--gold); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 16px; }
.grid2 > div { display: flex; flex-direction: column; color: var(--muted); font-size: 13px; }
.grid2 b { color: var(--text); font-size: 15px; }

.list { display: flex; flex-direction: column; gap: 6px; }
.li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; background: #242424; border-radius: 10px; padding: 9px 11px; color: var(--text); }
.li.big { padding: 14px; font-size: 16px; }
.li.mono { font-family: Consolas, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.amt { font-weight: 700; min-width: 90px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; background: #2e2e2e; font-size: 12px; margin-inline-end: 4px; }
.pill.ok { background: #183524; color: var(--green); } .pill.bad { background: #3a1c1c; color: var(--red); }
.pill.warn-p { background: #3a2e12; color: #e6aa3c; }
.pill.ice { background: #142a44; color: #5aa0f0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.empty { color: var(--muted); padding: 10px 2px; }
.loading { text-align: center; color: var(--muted); padding: 40px; font-size: 24px; }
.banner { background: #2b2410; border: 1px solid #5c4a14; color: #e8cf86; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.warn { color: #e8cf86; }
.back { display: inline-block; margin-bottom: 8px; }

.btn { background: #2e2e2e; color: var(--text); border: 0; border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.15); } .btn:disabled { opacity: .5; }
.btn.gold { background: var(--gold); color: #000; } .btn.g { background: #1f7a45; color: #fff; }
.btn.danger { background: #8e2b2b; color: #fff; } .btn.small { padding: 5px 10px; font-size: 13px; }
.icon { background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; }
.tabs a, .tabs button { background: #222; color: var(--gold); border: 1px solid var(--gold); border-radius: 99px; padding: 6px 14px; white-space: nowrap; font: inherit; cursor: pointer; }
.tabs .on { background: var(--gold); color: #000; }
.daynav { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }

input, select { background: #262626; color: var(--text); border: 1px solid #3a3a3a; border-radius: 10px; padding: 10px 12px; font: inherit; min-width: 0; }
input:focus, select:focus { outline: 2px solid var(--gold); border-color: transparent; }
.search { width: 100%; margin-bottom: 10px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 13px; }
.secret { font-family: Consolas, monospace; font-size: 24px; letter-spacing: 2px; text-align: center; background: #111; border: 1px dashed var(--gold); border-radius: 10px; padding: 12px; margin: 10px 0; color: var(--gold); }
.fp { font-family: Consolas, monospace; color: var(--blue); }

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.tbl th { color: var(--muted); font-weight: 600; }
.chartwrap { overflow-x: auto; }
.chart { width: 100%; min-width: 320px; height: auto; display: block; }
.chart.heat { min-width: 600px; }
.chart .ax { fill: var(--muted); font-size: 10px; } .chart .axl { stroke: #444; }

.toast { position: fixed; bottom: calc(86px + env(safe-area-inset-bottom)); inset-inline: 16px; z-index: 50; background: #234a32; color: #fff; padding: 12px 14px; border-radius: 10px; text-align: center; }
.toast.bad { background: #5a2323; }
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--card); border: 1px solid #5a2323; border-radius: var(--r); padding: 18px; max-width: 480px; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.modal-box label { display: flex; flex-direction: column; gap: 4px; }

@media print {
  #top, #nav, .actions, .daynav, .tabs, .search { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .card, .kpi, .li { background: #fff; border-color: #bbb; color: #000; }
  .g, .kpi.g .kv { color: #0a0; } .r, .kpi.r .kv { color: #c00; }
}
