:root{
  --page-bg: #e7e1d4;
  --shell: #211e17;
  --shell-soft: #2b2820;
  --card-mid: #322e26;
  --accent: #f0b10a;
  --accent-deep: #cf9407;
  --ink: #1c1b19;
  --text-dim: #8f8d8d;
  --text-dim2: #b5adad;
  --line-on-dark: rgba(255,255,255,0.10);
  --error: #e0685a;
}
*{ box-sizing:border-box; }
body{
  margin:0; min-height:100vh; background:var(--page-bg);
  font-family:'Manrope', sans-serif; color:#fff;
  display:flex; justify-content:center; padding:5vh 16px 60px;
}
.wrap{ width:100%; max-width:420px; }
.phone{
  background:var(--shell);
  border-radius:38px;
  padding:22px 20px 20px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.5);
  min-height:400px;
  position:relative;
}

/* ---- flash messages ---- */
.flash-stack{ margin-bottom:14px; display:flex; flex-direction:column; gap:8px; }
.flash{ padding:12px 14px; border-radius:14px; font-size:13px; font-weight:600; }
.flash-error{ background:rgba(224,104,90,0.15); color:#f0a89e; border:1px solid rgba(224,104,90,0.3); }
.flash-success{ background:rgba(240,177,10,0.15); color:var(--accent); border:1px solid rgba(240,177,10,0.3); }

/* ---- plain form pages (login, change-password, readings) ---- */
.page-title{ font-size:22px; font-weight:800; margin:4px 0 4px; }
.page-sub{ font-size:13px; color:var(--text-dim2); font-weight:500; margin-bottom:22px; line-height:1.5; }

.field{ margin-bottom:14px; }
.field label{ display:block; font-size:11px; font-weight:700; letter-spacing:.08em; color:var(--text-dim2); margin-bottom:8px; text-transform:uppercase; }
.field input{
  width:100%; border:none; background:var(--shell-soft); border-radius:14px;
  font-family:'Manrope', sans-serif; font-size:16px; font-weight:700;
  padding:14px 16px; color:#fff;
}
.field input:focus{ outline:2px solid var(--accent); }
.field-hint{ font-size:11.5px; color:var(--text-dim); margin-top:6px; }
.field-hint a{ color:var(--accent); font-weight:700; }

.btn{
  width:100%; border:1.5px solid transparent; border-radius:100px; background:var(--accent); color:var(--ink);
  font-family:'Manrope', sans-serif; font-weight:700; font-size:15px; padding:15px 18px;
  cursor:pointer; text-align:center; display:block; text-decoration:none; line-height:1.2;
  transition: opacity .15s ease;
}
.btn:hover{ opacity:.9; }
.btn.ghost{ background:transparent; color:#fff; border-color:var(--line-on-dark); margin-top:10px; }
.btn.small{ width:auto; padding:9px 16px; font-size:12.5px; margin-top:0; }
.btn.danger{ background:var(--error); color:#fff; }

.link-row{ text-align:center; margin-top:16px; font-size:12.5px; color:var(--text-dim2); }
.link-row a{ color:var(--accent); text-decoration:none; font-weight:700; }

/* ---- hero clock shape (dashboard) ---- */
.hero-row{
  position:relative;
  width:calc(100% + 32px);
  margin-left:-16px;
  aspect-ratio: 596 / 443;
  background-image:url('../img/clock-shape.png');
  background-size:100% 100%;
  background-repeat:no-repeat;
  margin-bottom:14px;
}
.clock-text{
  position:absolute; left:0; right:0; top:0; bottom:27%;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  color:var(--ink); text-align:center;
}
.clock-time{ font-size:46px; font-weight:800; letter-spacing:-0.02em; line-height:1; }
.clock-sub{ font-size:13px; font-weight:600; color:#3d3520; margin-top:8px; display:flex; align-items:center; justify-content:center; gap:5px; white-space:nowrap; }
.apt-chip{
  position:absolute; left:58%; top:77%; width:35%; height:16%;
  background:var(--accent); border-radius:63px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  text-align:center; padding:0 6px;
}
.apt-chip .num{ font-size:16px; font-weight:800; color:var(--ink); line-height:1; }
.apt-chip .lbl{ font-size:9px; font-weight:500; color:#474747; margin-top:2px; line-height:1.3; }

/* ---- announcement card ---- */
.announce-card{
  background:linear-gradient(180deg, rgba(240,177,10,0.20) 0%, rgba(115,115,115,0.20) 100%);
  border-radius:32px; padding:20px 20px 14px; margin-bottom:14px;
}
.announce-tag{ display:inline-block; background:var(--accent); color:var(--ink); font-size:10.5px; font-weight:700; letter-spacing:.04em; padding:5px 14px; border-radius:100px; margin-bottom:14px; }
.announce-title{ font-size:19px; font-weight:800; margin-bottom:8px; }
.announce-body{ font-size:12.5px; color:#e6e3dc; line-height:1.6; min-height:60px; }
.announce-foot{ display:flex; align-items:center; justify-content:center; gap:12px; margin-top:14px; }
.announce-label{ font-size:10px; color:var(--text-dim2); letter-spacing:.1em; }
.dots{ display:flex; gap:6px; }
.dot{ width:7px; height:7px; border-radius:50%; background:#5a564a; border:none; cursor:pointer; padding:0; transition: all .2s ease; }
.dot.active{ width:10px; height:10px; background:var(--accent); }
.announce-empty{ font-size:12.5px; color:var(--text-dim2); text-align:center; padding:10px 0; }

/* ---- status row ---- */
.status-card{ background:var(--card-mid); border-radius:32px; padding:12px; display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.status-pill{ background:rgba(255,255,255,0.14); border-radius:28px; padding:12px 16px; display:flex; align-items:center; gap:10px; flex:1; }
.status-pill .chk{ width:26px; height:26px; border-radius:50%; border:1.5px solid rgba(255,255,255,0.5); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.status-pill .chk svg{ width:13px; height:13px; }
.status-pill .txt{ font-size:11.5px; color:#e6e3dc; line-height:1.35; }
.progress-block{ display:flex; align-items:center; gap:10px; padding-right:6px; }
.progress-ring{ position:relative; width:52px; height:52px; flex-shrink:0; }
.progress-ring svg{ width:52px; height:52px; }
.progress-ring .num{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:19px; font-weight:800; color:var(--ink); }
.progress-text{ font-size:11px; color:var(--text-dim); line-height:1.5; }

/* ---- dock ---- */
.dock{ position:relative; display:flex; justify-content:space-between; align-items:center; background:var(--shell-soft); border-radius:100px; padding:10px 14px; margin-top:6px; }
.dock-btn{ width:38px; height:38px; border-radius:50%; border:none; background:transparent; display:flex; align-items:center; justify-content:center; cursor:pointer; text-decoration:none; }
.dock-btn svg{ width:17px; height:17px; }
.dock-btn.main{ width:54px; height:54px; background:var(--accent); margin-top:-22px; box-shadow: 0 8px 20px -4px rgba(240,177,10,0.6); }
.dock-btn.main svg{ width:22px; height:22px; }

/* ---- readings form ---- */
.topbar{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.topbar .eyebrow{ font-size:11px; font-weight:700; letter-spacing:.14em; color:var(--text-dim2); }
.back-btn{ width:34px;height:34px;border-radius:50%; background:var(--shell-soft); border:none; display:flex;align-items:center;justify-content:center; cursor:pointer; text-decoration:none; }
.back-btn svg{ width:15px; height:15px; }
.apt-banner{ display:flex; justify-content:space-between; align-items:center; background:var(--card-mid); border-radius:22px; padding:14px 16px; margin-bottom:16px; }
.apt-banner .big{ font-size:16px; font-weight:800; }
.apt-banner .small{ font-size:11px; color:var(--text-dim2); font-weight:500; margin-top:2px; }
.section-label{ font-size:11px; font-weight:700; letter-spacing:.1em; color:var(--text-dim2); margin:0 0 10px 2px; }

.meter-row{ display:flex; align-items:center; gap:10px; background:var(--card-mid); border-radius:20px; padding:12px 14px; margin-bottom:10px; }
.meter-icon{ width:40px; height:40px; border-radius:13px; background:var(--shell-soft); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.meter-icon svg{ width:18px; height:18px; }
.meter-mid{ flex:1; min-width:0; }
.meter-name{ font-size:12.5px; font-weight:700; color:#fff; }
.meter-prev{ font-size:10.5px; color:var(--text-dim2); font-weight:500; margin-top:1px; }
.meter-field{ display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
.meter-input-row{ display:flex; align-items:center; gap:6px; }
.meter-input{ width:88px; border:none; background:var(--shell-soft); border-radius:10px; font-family:'Manrope', sans-serif; font-size:13px; font-weight:800; text-align:right; padding:9px 8px; color:#fff; }
.meter-input:focus{ outline:2px solid var(--accent); }
.cam-btn{ width:30px; height:30px; border-radius:50%; border:none; background:var(--shell-soft); display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; }
.cam-btn svg{ width:13px; height:13px; }
.cam-btn.busy{ opacity:.5; pointer-events:none; }
.meter-unit{ font-size:9px; font-weight:600; color:var(--text-dim2); }
.meter-ocr-note{ font-size:10px; font-weight:600; margin-top:4px; display:none; padding-left:50px; color:var(--accent); }
.meter-ocr-note.show{ display:block; }

/* ---- history modal ---- */
.overlay{ position:fixed; inset:0; background:rgba(0,0,0,0.55); display:none; align-items:center; justify-content:center; padding:24px; z-index:20; }
.overlay.show{ display:flex; }
.overlay-card{ background:var(--card-mid); border-radius:24px; padding:22px; width:100%; max-width:380px; max-height:80vh; overflow-y:auto; }
.overlay-card .lbl{ font-size:11px; font-weight:700; letter-spacing:.08em; color:var(--text-dim2); margin-bottom:10px; }
.history-item{ display:flex; justify-content:space-between; align-items:center; background:var(--shell-soft); border-radius:14px; padding:11px 14px; margin-bottom:8px; }
.history-item .h-apt{ font-size:12px; font-weight:700; }
.history-item .h-date{ font-size:10.5px; color:var(--text-dim2); font-weight:500; margin-top:2px; }
.history-empty{ font-size:12.5px; color:var(--text-dim2); text-align:center; padding:16px 0; }

.toast{ position:fixed; left:50%; bottom:24px; transform:translate(-50%, 12px); background:#000; color:#fff; font-size:12px; font-weight:700; padding:10px 16px; border-radius:100px; opacity:0; pointer-events:none; transition: opacity .25s ease, transform .25s ease; white-space:nowrap; z-index:30; }
.toast.show{ opacity:1; transform:translate(-50%, 0); }

/* =========================================================================
   ADMIN PANEL — deliberately plainer/denser than the resident UI, this is
   a working tool for board members, not a polished consumer screen.
   ========================================================================= */
.admin-wrap{ max-width:1100px; margin:0 auto; padding:32px 20px 60px; }
.admin-topbar{ display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; flex-wrap:wrap; gap:12px; }
.admin-topbar h1{ font-size:20px; font-weight:800; margin:0; }
.admin-nav{ display:flex; gap:8px; }
.admin-nav a{ color:var(--text-dim2); text-decoration:none; font-size:13px; font-weight:700; padding:8px 14px; border-radius:100px; }
.admin-nav a.active{ background:var(--accent); color:var(--ink); }

.admin-stats{ display:flex; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
.stat-card{ background:var(--card-mid); border-radius:18px; padding:14px 18px; min-width:140px; }
.stat-card .num{ font-size:24px; font-weight:800; }
.stat-card .lbl{ font-size:11px; color:var(--text-dim2); font-weight:600; margin-top:2px; }

.admin-table{ width:100%; border-collapse:collapse; background:var(--card-mid); border-radius:18px; overflow:hidden; }
.admin-table th{ text-align:left; font-size:11px; letter-spacing:.06em; color:var(--text-dim2); font-weight:700; padding:12px 14px; background:var(--shell-soft); }
.admin-table td{ padding:11px 14px; font-size:13px; border-top:1px solid var(--line-on-dark); }
.badge{ display:inline-block; padding:4px 10px; border-radius:100px; font-size:11px; font-weight:700; }
.badge.yes{ background:rgba(240,177,10,0.18); color:var(--accent); }
.badge.no{ background:rgba(224,104,90,0.18); color:#f0a89e; }

.filter-row{ display:flex; gap:8px; margin-bottom:16px; flex-wrap:wrap; }
.filter-row a{ text-decoration:none; color:var(--text-dim2); background:var(--shell-soft); padding:8px 14px; border-radius:100px; font-size:12.5px; font-weight:700; }
.filter-row a.active{ background:var(--accent); color:var(--ink); }

.reveal-password{ background:rgba(240,177,10,0.15); border:1px solid rgba(240,177,10,0.3); border-radius:14px; padding:14px 16px; margin-bottom:20px; font-size:13px; }
.reveal-password b{ font-family:'Manrope', sans-serif; font-size:16px; letter-spacing:.02em; }

.ann-card{ background:var(--card-mid); border-radius:18px; padding:16px; margin-bottom:12px; }
.ann-card .ann-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; margin-bottom:8px; }
.ann-card h3{ font-size:15px; margin:6px 0 4px; }
.ann-card p{ font-size:12.5px; color:var(--text-dim2); line-height:1.5; margin:0; white-space:pre-wrap; }
.ann-actions{ display:flex; align-items:center; gap:8px; margin-top:12px; flex-wrap:wrap; }
.ann-edit textarea.admin-input{ min-height:120px; }

textarea.admin-input, input.admin-input{
  width:100%; border:none; background:var(--shell-soft); border-radius:12px;
  font-family:'Manrope', sans-serif; font-size:14px; padding:12px 14px; color:#fff; margin-bottom:10px;
}
textarea.admin-input{ min-height:90px; resize:vertical; white-space:pre-wrap; }

/* ---- dashboard toolbar / search ---- */
.toolbar-row{ margin-bottom:14px; }
.search-input{ max-width:320px; margin-bottom:0; }

.row-actions{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.reading-summary{ font-size:10.5px; color:var(--text-dim2); font-weight:500; margin-top:4px; }

.edit-row td{ padding-top:14px; padding-bottom:14px; border-top:none; background:var(--card-mid); }
.edit-reading-fields{ display:grid; grid-template-columns:repeat(auto-fit, minmax(130px, 1fr)); gap:10px; }
.field-inline{ display:flex; flex-direction:column; }
.field-inline label{ font-size:10.5px; font-weight:700; letter-spacing:.06em; color:var(--text-dim2); margin-bottom:6px; text-transform:uppercase; }
.field-inline input.admin-input{ margin-bottom:0; }

/* ---- export config page ---- */
.export-row{ display:flex; gap:14px; flex-wrap:wrap; margin-bottom:4px; }
.export-row .field-inline{ flex:1; min-width:150px; }
.apt-mode-row{ display:flex; gap:18px; flex-wrap:wrap; margin-bottom:14px; }
.apt-mode-row label{ display:flex; align-items:center; gap:6px; font-size:13px; font-weight:600; color:#fff; cursor:pointer; }

@media (max-width: 640px){
  .admin-table{ display:block; overflow-x:auto; white-space:nowrap; }
}
