/* Fem Physio admin — mobile first */
body.admin { background: var(--blush); min-height: 100vh; }
body.admin h1 { font-size: 1.7rem; margin: 0; }
body.admin h2 { font-size: 1.1rem; margin: 0 0 14px; }
.small { font-size: .85rem; }
.center { text-align: center; }
.hint { font-size: .82rem; color: var(--muted); margin: 0; }

/* Login */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); padding: 32px 22px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login-card .field { text-align: left; }
.login-logo { height: 72px; width: auto; margin: 0 auto; mix-blend-mode: multiply; }
.login-card h1 { font-size: 1.8rem; }
.login-card p { margin: 0; }
.login-card .btn { width: 100%; margin-top: 4px; }
.login-card .back { margin-top: 6px; }
.alert { background: #fde8ea; color: #9b2a33; padding: 10px 12px; border-radius: 10px; font-size: .9rem; margin: 0 0 12px; }

/* Install popup */
.install-pop { position: fixed; inset: 0; z-index: 100; background: rgba(46, 26, 40, .45); display: flex; align-items: flex-end; justify-content: center; padding: 12px; animation: fade .2s ease; }
.install-pop[hidden] { display: none; }
.install-card { position: relative; width: min(420px, 100%); background: #fff; border-radius: 24px; padding: 28px 22px 18px; text-align: center; box-shadow: 0 -10px 40px rgba(0,0,0,.2); animation: up .25s ease; margin-bottom: env(safe-area-inset-bottom); }
.install-card img { margin: 0 auto 10px; border-radius: 16px; box-shadow: var(--shadow); }
.install-card h2 { font-size: 1.25rem; }
.install-card .btn { width: 100%; margin: 6px 0; }
.install-x { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; background: var(--blush); border-radius: 50%; font-size: 1.4rem; line-height: 1; color: var(--plum); cursor: pointer; }
.install-steps { text-align: left; margin: 10px 0 12px; padding-left: 22px; display: grid; gap: 8px; }
.install-steps svg { width: 18px; height: 18px; vertical-align: -3px; color: #0a84ff; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

/* Shell: top brand bar + bottom tab bar on phones */
.admin-top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top); }
.admin-top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; }
.admin-top .brand img { height: 38px; }
.admin-top .brand b { font-size: 1.15rem; }
.admin-top .brand small { font-style: normal; color: var(--muted); display: block; }
.admin-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 20px -12px rgba(91, 26, 69, .3); }
.admin-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 2px 8px; font-size: .72rem; font-weight: 500; color: var(--muted); text-decoration: none; min-height: 56px; }
.admin-nav a svg { width: 22px; height: 22px; }
.admin-nav a.on { color: var(--plum); font-weight: 700; }
.admin-nav a.on svg { stroke-width: 2.1; }
.badge { position: absolute; top: 5px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--magenta); color: #fff; font: 700 .68rem/18px var(--sans); font-style: normal; text-align: center; }
.admin-main { padding: 18px 0 calc(96px + env(safe-area-inset-bottom)); }
.narrow-main { max-width: 640px; }
.flash { background: var(--mint); color: #24694a; padding: 10px 14px; border-radius: 12px; font-weight: 500; margin: 0 0 14px; }

/* Push banner */
.push-banner { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; margin-bottom: 16px; box-shadow: none; border-color: #ead0de; background: linear-gradient(135deg, #fff, var(--rose)); }
.push-banner[hidden] { display: none; }
.push-banner p { margin: 2px 0 0; font-size: .88rem; }
.push-banner-actions { display: flex; gap: 8px; }

/* Appointments: day tabs */
.day-tabs { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 5px; }
.day-tabs > a, .date-pick { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .92rem; position: relative; }
.day-tabs > a em { font-style: normal; font-size: .75rem; background: var(--rose); color: var(--plum); border-radius: 999px; padding: 1px 7px; }
.day-tabs > a.on, .date-pick.on { background: var(--plum); color: #fff; }
.day-tabs > a.on em { background: rgba(255,255,255,.25); color: #fff; }
.date-pick { padding: 0 8px; border: 1.5px dashed var(--line); }
.date-pick.on { border-color: var(--plum); }
.date-pick svg { width: 18px; height: 18px; flex: none; }
.date-pick input { border: 0; background: transparent; padding: 0; width: 100%; min-width: 0; font: 700 .85rem var(--sans); color: inherit; cursor: pointer; }
.date-pick input::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
.date-pick.on input::-webkit-calendar-picker-indicator { filter: invert(1); }
.day-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 10px; text-align: center; }
.day-head-row p { margin: 0; }
.day-nav { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--line); font-size: 1.6rem; line-height: 1; color: var(--plum); text-decoration: none; }
.mini-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
.mini-stats b { color: var(--ink); }
.s-pending b { color: #a35d0c; } .s-confirmed b { color: #24694a; } .s-completed b { color: #5a3d86; }

.appt-list .card, .fb-list .card { box-shadow: none; }
.appt { display: grid; gap: 10px; padding: 14px 16px; margin-bottom: 10px; border-left: 5px solid var(--line); }
.appt.status-pending { border-left-color: #eeb46b; }
.appt.status-confirmed { border-left-color: #7cc3a1; }
.appt.status-completed { border-left-color: #a98bd0; }
.appt.status-cancelled { opacity: .55; }
.appt-time { display: flex; align-items: center; gap: 10px; }
.appt-time b { font: 600 1.15rem var(--serif); color: var(--plum); }
.pill { display: inline-block; font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; vertical-align: middle; }
.pill.pending { background: var(--peach); color: #8a5310; }
.pill.confirmed { background: var(--mint); color: #24694a; }
.pill.completed { background: var(--lilac); color: #5a3d86; }
.pill.cancelled { background: #eee; color: #666; }
.pill.new { background: var(--magenta); color: #fff; }
.appt h3 { margin: 0; font-size: 1.1rem; overflow-wrap: anywhere; }
.appt h3 small { font: 400 .85rem var(--sans); color: var(--muted); }
.appt .meta { margin: 2px 0 8px; font-size: .9rem; }
.appt .notes { background: var(--cream); border-radius: 10px; padding: 8px 12px; font-size: .9rem; color: var(--muted); margin: 0 0 8px; overflow-wrap: anywhere; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 12px; border-radius: 999px; background: var(--blush); border: 1px solid var(--line); color: var(--plum); font-size: .88rem; font-weight: 500; text-decoration: none; }
.chip svg { width: 16px; height: 16px; }
.chip.wa { background: #e7f8ee; border-color: #c9eed8; color: #17803d; }
.appt-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.appt-actions .btn { flex: 1 1 auto; min-height: 42px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); box-shadow: none; }
.empty svg { width: 40px; height: 40px; color: var(--pink); margin-bottom: 6px; }
.empty p { margin: 0; }

/* Shared segmented tabs */
.dash-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.dash-head p { margin: 2px 0 0; }
.seg-tabs { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.seg-tabs a { flex: 1; text-align: center; padding: 9px 8px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: .88rem; font-weight: 500; white-space: nowrap; }
.seg-tabs a.on { background: var(--plum); color: #fff; font-weight: 700; }
.seg-tabs em { font-style: normal; font-size: .75rem; opacity: .8; }
.range-form { display: flex; flex-direction: column; gap: 8px; }
.custom-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; }
.custom-range .btn { grid-column: 1 / -1; }
.custom-range input { padding: 8px 10px; font-size: .88rem; background: #fff; }
.custom-range.on input { border-color: var(--plum); }

/* Dashboard */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; min-width: 0; }
.kpi span { color: var(--muted); font-size: .8rem; }
.kpi b { font: 600 1.9rem/1.2 var(--serif); color: var(--plum); }
.kpi b i { font-style: normal; font-size: 1.2rem; color: #d99a2b; margin-left: 2px; }
.kpi small { color: var(--muted); font-size: .76rem; }
.kpi-link { text-decoration: none; grid-column: 1 / -1; background: linear-gradient(135deg, #fff, var(--rose)); }
.chart-card { padding: 16px; margin-bottom: 14px; box-shadow: none; min-width: 0; }
.chart-head h2 { margin-bottom: 2px; }
.chart-head p { margin: 0 0 14px; font-size: .82rem; }
.cols { position: relative; padding-left: 26px; }
.cols-grid { position: absolute; left: 26px; right: 0; top: 0; height: 160px; }
.cols-grid span { position: absolute; left: -26px; right: 0; transform: translateY(50%); font-size: .7rem; color: var(--muted); border-bottom: 1px solid var(--line); line-height: 0; height: 0; }
.cols-grid span::before { content: ''; }
.cols-plot { position: relative; height: 160px; display: flex; align-items: flex-end; gap: 2px; }
.col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; outline: none; }
.col span { display: block; width: 100%; max-width: 24px; background: var(--magenta); border-radius: 4px 4px 0 0; min-height: 0; transition: opacity .15s; }
.col:hover span, .col:focus span { opacity: .75; }
.cols-x { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 6px; }
.dash-grid { display: grid; gap: 0; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 7.5em) minmax(0, 1fr) 2.2em; align-items: center; gap: 10px; font-size: .86rem; outline: none; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { height: 12px; }
.hb-bar { display: block; height: 100%; background: var(--magenta); border-radius: 0 4px 4px 0; }
.hb-val { text-align: right; font-weight: 700; color: var(--ink); }
.status-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.status-list li { display: grid; grid-template-columns: 12px 1fr auto 3em; align-items: center; gap: 10px; font-size: .9rem; }
.status-list .dot { width: 10px; height: 10px; border-radius: 50%; margin: 0; }
.status-list b { color: var(--ink); }
.status-list small { color: var(--muted); text-align: right; }
.s-completed .dot { background: #8a6bc0; } .s-confirmed .dot { background: #3f9d6f; } .s-pending .dot { background: #e19a3c; } .s-cancelled .dot { background: #b9aab3; }
.export-row { text-align: center; margin: 4px 0 0; }
.tip { position: fixed; z-index: 50; background: var(--ink); color: #fff; font-size: .8rem; padding: 6px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }
.tip[hidden] { display: none; }

/* Feedback */
.fb { padding: 16px; margin-bottom: 10px; }
.fb.is-featured { border-color: var(--pink); background: linear-gradient(180deg, #fff, #fff8fb); }
.fb header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.fb h3 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.fb header p { margin: 2px 0 0; }
.stars { color: #e0a32e; letter-spacing: 1px; white-space: nowrap; font-size: 1.05rem; }
.stars i { font-style: normal; color: #e7dbe1; }
.fb-msg { margin: 10px 0 12px; overflow-wrap: anywhere; }
.fb footer form { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; border: 0; background: none; padding: 0; font: 500 .9rem var(--sans); color: var(--ink); cursor: pointer; }
.toggle span { width: 44px; height: 26px; border-radius: 13px; background: #dccfd6; position: relative; transition: background .2s; flex: none; }
.toggle span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on span { background: var(--magenta); }
.toggle.on span::after { transform: translateX(18px); }
.toggle:disabled { opacity: .45; cursor: not-allowed; }
.link-btn { border: 0; background: none; font: 500 .88rem var(--sans); color: var(--muted); cursor: pointer; padding: 8px 4px; }
.link-btn.danger, .danger { color: #b3313b; }

/* Settings */
.narrow-main h1 { margin-bottom: 14px; }
.set-card { padding: 18px; margin-bottom: 14px; box-shadow: none; }
.set-card > p { margin: 0 0 10px; }
.set-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.set-actions form { margin: 0; }
.stack { display: grid; gap: 10px; }
.stack .btn { justify-self: start; }
.push-status { font-weight: 500; }
.devices { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.devices li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 10px 12px; background: var(--cream); border-radius: 12px; }
.devices li .small { flex-basis: 100%; }

/* Larger screens: nav moves to the top bar */
@media (min-width: 760px) {
  .admin-top-in { height: 66px; }
  .admin-nav { position: static; display: flex; gap: 4px; border: 0; box-shadow: none; padding: 0; background: none; }
  .admin-nav a { flex-direction: row; gap: 8px; min-height: 0; padding: 9px 14px; border-radius: 999px; font-size: .92rem; }
  .admin-nav a svg { width: 18px; height: 18px; }
  .admin-nav a.on { background: var(--blush); }
  .badge { position: static; margin: 0; }
  .admin-main { padding: 26px 0 50px; }
  .push-banner { flex-direction: row; align-items: center; justify-content: space-between; }
  .day-tabs { max-width: 560px; }
  .appt { grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 18px; }
  .appt-time { flex-direction: column; align-items: flex-start; gap: 4px; }
  .appt-actions { justify-content: flex-end; }
  .appt-actions .btn { flex: 0 0 auto; }
  .dash-head { flex-direction: row; justify-content: space-between; align-items: flex-start; }
  .range-form { align-items: flex-end; }
  .custom-range { grid-template-columns: auto auto auto auto; }
  .custom-range .btn { grid-column: auto; }
  .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kpi-link { grid-column: auto; }
  .cols-plot, .cols-grid { height: 200px; }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
  .hbars li { grid-template-columns: minmax(0, 11em) minmax(0, 1fr) 2.5em; }
}

body.admin { --bar-h: 0px; }
