/* Ghara Staff web app. Colours match the iPhone app (Theme.swift). */
:root {
  --pink: #E064B4;
  --pink-dark: #C94E9C;
  --pink-soft: #FBE4F2;
  --green: #2D6152;
  --green-soft: #E3EFEA;
  --ink: #1C2B26;
  --muted: #4F5F59;
  --ground: #F4F7F5;
  --paper: #FFFFFF;
  --line: #D5E0DB;
  --red: #B3261E;
  --red-soft: #FBE3E1;
  --tab-h: 64px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green: #3D8B71;
    --green-soft: #1E3A31;
    --pink-soft: #3A2032;
    --ink: #E8EFEC;
    --muted: #9DB0A8;
    --ground: #0F1714;
    --paper: #18221E;
    --line: #2C3A35;
    --red: #F4B4AC;
    --red-soft: #3B1512;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1 { font-size: 26px; margin: 8px 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 10px; }
p { margin: 6px 0; }
a { color: var(--pink-dark); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

main.page { padding: 12px 16px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
main.center { min-height: 80vh; display: grid; place-content: center; gap: 8px; padding: 24px 16px; }
main.auth { max-width: 440px; margin: 0 auto; padding: 32px 16px 48px; display: flex; flex-direction: column; gap: 12px; }
main.auth.center { text-align: center; min-height: 80vh; justify-content: center; }
.logo { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto; display: block; }

header.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--pink); color: #fff;
}
header .brand { font-weight: 700; letter-spacing: 0.02em; }
header .who { font-size: 14px; opacity: 0.95; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-bar { background: #FFF4CC; color: #5B4500; padding: 8px 16px; font-size: 14px; text-align: center; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin: 12px 0; display: flex; flex-direction: column; gap: 8px;
}
.card.today { border-color: var(--pink); }
.card.total { flex-direction: row; justify-content: space-between; align-items: center; font-size: 17px; }
.card.clock.on { border: 2px solid var(--green); }
.big-time { font-size: 40px; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }
.note { background: var(--green-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-top: 8px; }

.row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row.mine { font-weight: 600; }
.row > span:last-child { text-align: right; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--ink); }
label.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-weight: 600; margin-bottom: 4px; }
input, select {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 48px; width: 100%;
}
input:focus, select:focus { outline: 3px solid color-mix(in srgb, var(--pink) 35%, transparent); border-color: var(--pink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

button, .button {
  font: inherit; font-weight: 600; border-radius: 12px; min-height: 48px; padding: 0 16px;
  border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; width: 100%;
}
button:disabled { opacity: 0.5; cursor: default; }
.primary { background: var(--pink); color: #fff; }
.primary:active { background: var(--pink-dark); }
.secondary { background: var(--pink-soft); color: var(--ink); }
.danger-button { background: var(--red-soft); color: var(--red); }
.big { min-height: 56px; font-size: 18px; }
button.link { background: none; color: var(--pink-dark); min-height: 40px; width: auto; padding: 0 4px; font-weight: 500; }
button.link.danger, .danger { color: var(--red); }
.links { display: flex; flex-wrap: wrap; justify-content: space-between; }
button.icon { width: 44px; min-height: 44px; padding: 0; background: var(--paper); border: 1px solid var(--line); color: var(--ink); font-size: 24px; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--line); font-size: 13px; font-weight: 600; }
.pill.pink { background: var(--pink-soft); color: var(--pink-dark); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }

.weeknav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; font-weight: 600; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; background: var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.segmented button { min-height: 38px; background: transparent; color: var(--ink); }
.segmented button.on { background: var(--paper); }

nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--paper); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex-direction: column; gap: 2px; min-height: var(--tab-h); background: none; color: var(--muted); font-size: 11px; font-weight: 500; border-radius: 0; padding: 0; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--pink-dark); }

.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / 0.4); z-index: 10; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11; max-height: 90vh; overflow: auto;
  background: var(--paper); border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin: 0 auto;
}
.sheet form { display: flex; flex-direction: column; gap: 10px; }
.sheet .close { position: absolute; top: 10px; right: 10px; border: 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photos figure { margin: 0; display: flex; flex-direction: column; align-items: center; }
.photos img, .photo-loading { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--line); display: grid; place-content: center; font-size: 12px; }
label.file { color: var(--ink); }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); z-index: 20;
  background: var(--ink); color: var(--paper); border-radius: 12px; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 608px; margin: 0 auto;
}
.toast-error { background: var(--red); color: #fff; }
@media (prefers-color-scheme: dark) { .toast-error { color: #2a0b08; } }
.toast button.link { color: inherit; text-decoration: underline; }
