/* Chez Amr brand tokens — taken from chezamr.com (ink #0C0C0C, surface #171717, cream #FFEDC3,
   Instrument Serif headings, Inter Tight text). Shared by /admin and /owner. */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter+Tight:wght@400;500;600&display=swap');

:root {
  --ink: #0c0c0c;
  --surface: #171717;
  --surface-2: #202020;
  --line: rgba(255, 237, 195, 0.12);
  --cream: #ffedc3;
  --cream-dim: rgba(255, 237, 195, 0.62);
  --cream-faint: rgba(255, 237, 195, 0.35);
  --good: #9bd3a6;
  --warn: #f2c26b;
  --bad: #f08a7e;
  --airbnb: #f0857d;
  --booking: #7aa7f5;
  --direct: #ffedc3;
  --manual: #c8b6f2;
  --owner: #9fd4cf;
  --radius: 14px;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter Tight', Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Elements styled with display (e.g. .login { display: grid }) must still disappear when hidden. */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--ink);
  color: var(--cream);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.05; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }
a { color: inherit; }
.eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cream-dim); }
.muted { color: var(--cream-dim); }
.num { font-variant-numeric: tabular-nums; }

button, .btn {
  font: 500 14px var(--sans);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--cream);
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}
button:hover { border-color: var(--cream-faint); }
button.primary, .btn.primary { background: var(--cream); color: var(--ink); border-color: var(--cream); }
button.ghost { background: transparent; }
button.danger { color: var(--bad); }
button:disabled { opacity: 0.45; cursor: default; }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }

input, select, textarea {
  font: 15px var(--sans);
  color: var(--cream);
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  width: 100%;
  min-height: 40px;
}
textarea { min-height: 80px; resize: vertical; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--cream-dim); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.grid { display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi .value { font-family: var(--serif); font-size: 32px; line-height: 1.1; margin-top: 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 500; color: var(--cream-dim); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; background: var(--surface); }
tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--surface); }
td.amount, th.amount { text-align: end; font-variant-numeric: tabular-nums; }

.pill { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--cream-dim); }
.pill.airbnb { color: var(--airbnb); border-color: currentColor; }
.pill.booking { color: var(--booking); border-color: currentColor; }
.pill.direct { color: var(--direct); border-color: currentColor; }
.pill.manual { color: var(--manual); border-color: currentColor; }
.pill.owner { color: var(--owner); border-color: currentColor; }
.pill.good { color: var(--good); border-color: currentColor; }
.pill.warn { color: var(--warn); border-color: currentColor; }
.pill.bad { color: var(--bad); border-color: currentColor; }

dialog {
  background: var(--surface);
  color: var(--cream);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog form { padding: 22px; display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.error { color: var(--bad); font-size: 14px; min-height: 1em; }

.empty { padding: 28px; text-align: center; color: var(--cream-dim); }

/* Installed app (home screen): keep content clear of the notch and the home bar. */
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}
