/* Gelatoville Manager & Staff — shared styles. Brand: charcoal, mint, blush pink, lavender. */
:root {
  --ink: #393536;
  --ink-2: #6b6466;
  --muted: #8a8385;
  --bg: #f7f5f4;
  --card: #ffffff;
  --line: #e6e1df;
  --mint: #9fc2af;
  --mint-50: #eef5f1;
  --mint-700: #3f7a62;
  --mint-800: #2f5f4c;
  --pink: #f1dded;
  --pink-700: #9a4d86;
  --lav: #cacbdd;
  --lav-50: #f1f1f7;
  --red: #b42318;
  --red-50: #fdecea;
  --amber: #93590b;
  --amber-50: #fdf3e2;
  --green: #2f6f4f;
  --green-50: #e7f4ec;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(57, 53, 54, .06), 0 4px 16px rgba(57, 53, 54, .05);
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.45; color: var(--ink); background: var(--bg); }
a { color: var(--mint-700); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; }
code { background: var(--lav-50); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .6rem 1rem;
  border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.btn:hover { background: #faf8f7; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--mint-700); border-color: var(--mint-700); color: #fff; }
.btn.primary:hover { background: var(--mint-800); }
.btn.danger { color: var(--red); border-color: #f0c8c4; }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 36px; padding: .35rem .7rem; font-size: .9rem; }
.btn.block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.form { display: grid; gap: .9rem; }
label { display: grid; gap: .3rem; font-weight: 600; font-size: .93rem; }
label.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; }
input, select, textarea { font: inherit; font-size: 16px; color: var(--ink); width: 100%; min-height: 44px; padding: .55rem .7rem;
  border: 1px solid #d8d2d0; border-radius: 10px; background: #fff; }
textarea { min-height: 88px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--mint-700); }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 3px solid rgba(63, 122, 98, .3); outline-offset: 1px; border-color: var(--mint-700); }
.hint { font-size: .85rem; color: var(--ink-2); font-weight: 400; margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 520px) { .row2, .row3 { grid-template-columns: 1fr; } }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 4.2rem; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font: inherit; font-size: .85rem;
  font-weight: 600; color: var(--mint-700); padding: .4rem; cursor: pointer; }
.seg { display: inline-flex; border: 1px solid #d8d2d0; border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: #fff; font: inherit; font-size: .92rem; font-weight: 600; padding: .5rem .85rem; min-height: 40px; cursor: pointer; color: var(--ink-2); }
.seg button + button { border-left: 1px solid #d8d2d0; }
.seg button.on { background: var(--mint-700); color: #fff; }
.seg button.on.bad { background: var(--red); }
.seg button.on.warn { background: var(--amber); }
.locs { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }

/* ---------- notices, chips ---------- */
.notice { padding: .7rem .9rem; border-radius: 10px; background: var(--lav-50); margin: 0 0 1rem; font-size: .95rem; }
.notice.ok { background: var(--green-50); color: var(--green); }
.notice.err { background: var(--red-50); color: var(--red); }
.notice.warn { background: var(--amber-50); color: var(--amber); }
.chip { display: inline-block; font-size: .78rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; background: var(--lav-50); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--green-50); color: var(--green); }
.chip.bad { background: var(--red-50); color: var(--red); }
.chip.warn { background: var(--amber-50); color: var(--amber); }
.chip.info { background: var(--mint-50); color: var(--mint-800); }
.chip.pink { background: var(--pink); color: var(--pink-700); }
.badge { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff;
  font-size: .72rem; font-weight: 700; align-items: center; justify-content: center; }

/* ---------- cards & lists ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.card + .card { margin-top: .75rem; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.card h3 { margin: 0; }
.grid { display: grid; gap: .75rem; }
.grid.tiles { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .grid.tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem; box-shadow: var(--shadow); min-height: 108px; position: relative; }
.tile .t-label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.tile .t-val { font-size: 1.05rem; font-weight: 700; }
.tile .t-sub { font-size: .85rem; color: var(--ink-2); }
.tile.alert { border-color: #f0c8c4; background: #fffafa; }
.tile.done { border-color: #cfe3d7; background: #fbfdfc; }
.list { display: grid; gap: .6rem; }
.meta { font-size: .85rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.empty { text-align: center; color: var(--ink-2); padding: 2rem 1rem; }
.thumbs { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; background: var(--lav-50); }
.section-title { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.35rem; margin: 1.25rem 0 .6rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--ink-2); padding: .6rem .8rem; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; min-height: 44px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--mint-700); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); background: #faf8f7; position: sticky; top: 0; }
.tbl-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.check-item { padding: .75rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .5rem; }
.check-item:last-child { border-bottom: 0; }
.check-item .ci-label { font-weight: 600; }
.flagged { color: var(--red); font-weight: 700; font-size: .85rem; }

/* ---------- auth screens ---------- */
.auth-body { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(180deg, var(--mint-50), var(--bg) 40%, #fbf6fa); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1.75rem 1.4rem; box-shadow: var(--shadow); }
.auth-logo { display: block; width: 210px; margin: .25rem auto 1rem; }
.auth-title { text-align: center; font-size: .9rem; letter-spacing: .18em; font-weight: 700; color: var(--ink-2); margin-bottom: 1.4rem; }
.auth-links { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.auth-foot { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 1.25rem; }

/* ---------- staff app shell ---------- */
.app-top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  padding: calc(.5rem + var(--safe-t)) 16px .5rem; display: flex; align-items: center; gap: .6rem; }
.app-top .logo { height: 26px; }
.app-top .spacer { flex: 1; }
.loc-select { width: auto; min-height: 38px; padding: .3rem 1.8rem .3rem .6rem; font-size: .9rem; font-weight: 600; border-radius: 999px; background-color: var(--mint-50); border-color: #cfe3d7; }
.loc-pill { font-size: .85rem; font-weight: 700; background: var(--mint-50); color: var(--mint-800); padding: .3rem .7rem; border-radius: 999px; }
.icon-btn { position: relative; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 0; background: none; cursor: pointer; color: var(--ink); text-decoration: none; }
.icon-btn .badge { position: absolute; top: 4px; right: 2px; }
.app-main { max-width: 760px; margin: 0 auto; padding: 1rem 16px calc(88px + var(--safe-b)); }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: var(--safe-b); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem 0 .5rem; font-size: .72rem; font-weight: 600;
  color: var(--ink-2); text-decoration: none; position: relative; min-height: 56px; }
.bottom-nav a.on { color: var(--mint-700); }
.bottom-nav svg { width: 24px; height: 24px; }
.bottom-nav .badge { position: absolute; top: 4px; left: calc(50% + 6px); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .9rem; }
.page-head h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 1.65rem; }
.back { text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: .25rem; margin-bottom: .5rem; min-height: 36px; }
.hello { margin-bottom: 1rem; }
.hello h1 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: 1.75rem; margin: 0; }

/* ---------- modal, toast, lightbox ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(40, 36, 37, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .modal-bg { align-items: center; } }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 1.25rem 16px calc(1.25rem + var(--safe-b)); }
@media (min-width: 640px) { .modal { border-radius: 18px; padding: 1.4rem; } }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .9rem; }
.modal-head h2 { margin: 0; }
.toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: .7rem 1rem;
  border-radius: 10px; z-index: 60; font-size: .95rem; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0, 0, 0, .2); }
.toast.err { background: var(--red); }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-height: 92vh; border-radius: 8px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--mint-700); border-radius: 50%; animation: spin .8s linear infinite; margin: 2rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- admin shell ---------- */
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: #fff; border-right: 1px solid var(--line); padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { width: 150px; display: block; margin: .25rem .5rem .25rem; }
.side .tag { font-size: .7rem; letter-spacing: .16em; font-weight: 700; color: var(--ink-2); margin: 0 .5rem 1rem; }
.side nav a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem .7rem; border-radius: 9px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; }
.side nav a:hover { background: var(--bg); }
.side nav a.on { background: var(--mint-50); color: var(--mint-800); }
.side .who { border-top: 1px solid var(--line); margin-top: 1rem; padding: .9rem .5rem 0; font-size: .88rem; }
.admin-main { padding: 1.5rem 1.75rem 3rem; max-width: 1180px; width: 100%; }
.admin-top { display: none; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .side.open { transform: none; }
  .admin-top { display: flex; align-items: center; gap: .5rem; position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); padding: calc(.4rem + var(--safe-t)) 16px .4rem; }
  .admin-top img { height: 24px; }
  .admin-main { padding: 1rem 16px 3rem; }
}
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.toolbar label { font-size: .8rem; }
.toolbar input, .toolbar select { min-height: 40px; width: auto; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; }
.kpi .k-label { font-size: .78rem; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.kpi .k-val { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.loc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .9rem; }
.stat-line { display: flex; justify-content: space-between; padding: .35rem 0; border-bottom: 1px dashed var(--line); font-size: .93rem; }
.stat-line:last-child { border-bottom: 0; }
.copybox { display: flex; gap: .5rem; }
.copybox input { font-size: .85rem; }
.stars { color: #b7791f; letter-spacing: 1px; white-space: nowrap; }
.rank { font-family: var(--serif); font-style: italic; font-size: 1.3rem; }
