:root {
  --bg: #f5f7f6;
  --card: #ffffff;
  --text: #142019;
  --muted: #66736b;
  --line: #e3e9e5;
  --primary: #126b4f;
  --primary-dark: #0b523c;
  --soft: #e8f3ee;
  --danger: #a52a2a;
  --danger-soft: #fff0f0;
  --warning: #fff7df;
  --shadow: 0 12px 36px rgba(21, 50, 38, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(760px, 100%); min-height: 100vh; margin: 0 auto; padding: 22px 18px 38px; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin: 4px 0 20px; }
.topbar.compact { min-height: 46px; margin-bottom: 16px; }
.topbar h1, .topbar h2 { margin: 0; }
h1 { font-size: clamp(28px, 7vw, 42px); line-height: 1.05; margin: 0 0 8px; }
h2 { font-size: 20px; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--primary); margin-bottom: 4px; }
.muted { color: var(--muted); line-height: 1.55; }
.center { text-align:center; }
.top-actions { display:flex; gap:8px; }
.icon-button, .back { min-height: 40px; display:inline-flex; align-items:center; justify-content:center; padding:0 13px; border:1px solid var(--line); border-radius:12px; background:var(--card); font-weight:700; font-size:14px; }
.login-card, .form-card, .detail-card { background:var(--card); border:1px solid var(--line); border-radius:24px; box-shadow:var(--shadow); padding:26px; }
.login-card { max-width:430px; margin: 10vh auto 0; text-align:center; }
.login-card .stack { text-align:left; margin-top:26px; }
.brand-mark { width:58px; height:58px; margin:0 auto 18px; display:grid; place-items:center; border-radius:18px; background:var(--primary); color:#fff; font-size:26px; font-weight:900; }
.brand-mark.admin { background:#26352e; }
.stack { display:flex; flex-direction:column; gap:12px; }
label, .label-row label { font-size:13px; font-weight:800; color:#39463f; }
input, textarea { width:100%; border:1px solid #ced8d1; border-radius:13px; background:#fff; color:var(--text); padding:13px 14px; outline:none; transition:.15s border-color,.15s box-shadow; }
input:focus, textarea:focus { border-color:var(--primary); box-shadow:0 0 0 3px rgba(18,107,79,.1); }
textarea { resize:vertical; }
.button { min-height:44px; border:1px solid var(--line); border-radius:13px; background:#fff; color:var(--text); padding:10px 15px; display:inline-flex; align-items:center; justify-content:center; font-weight:800; }
.button.primary { background:var(--primary); color:#fff; border-color:var(--primary); }
.button.primary:hover { background:var(--primary-dark); }
.button.danger { color:var(--danger); background:var(--danger-soft); border-color:#f0cccc; }
.button.small { min-height:36px; padding:7px 12px; font-size:13px; }
.quiet-link { display:inline-block; margin-top:22px; color:var(--muted); font-weight:700; font-size:14px; }
.search { position:relative; margin-bottom:10px; }
.search input { padding:15px 70px 15px 16px; border-radius:16px; box-shadow:0 4px 16px rgba(28,54,43,.04); }
.clear-search { position:absolute; right:12px; top:50%; transform:translateY(-50%); color:var(--primary); font-size:13px; font-weight:800; }
.result-meta { color:var(--muted); font-size:12px; font-weight:700; margin:10px 3px 8px; }
.contact-list, .admin-list { background:var(--card); border:1px solid var(--line); border-radius:20px; overflow:hidden; }
.contact-row, .admin-row { min-height:76px; display:flex; align-items:center; border-bottom:1px solid var(--line); }
.contact-row:last-child, .admin-row:last-child { border-bottom:0; }
.contact-main { min-width:0; flex:1; display:flex; align-items:center; gap:13px; padding:12px 8px 12px 14px; }
.avatar { flex:0 0 auto; width:44px; height:44px; border-radius:50%; display:grid; place-items:center; background:var(--soft); color:var(--primary); font-weight:900; }
.avatar.large { width:76px; height:76px; margin:4px auto 17px; font-size:28px; }
.contact-copy { min-width:0; display:flex; flex-direction:column; gap:3px; }
.contact-copy strong, .admin-row strong { font-size:16px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.contact-copy span, .admin-row span { color:var(--muted); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.phone-preview { color:#405047 !important; }
.call-button { flex:0 0 auto; margin-right:12px; min-width:58px; padding:10px 12px; border-radius:12px; color:var(--primary); background:var(--soft); text-align:center; font-weight:900; font-size:13px; }
.empty { padding:52px 22px; text-align:center; color:var(--muted); }
.empty h2 { color:var(--text); margin:8px 0; }
.empty-icon { font-size:36px; }
.detail-card { text-align:center; }
.detail-card h1 { font-size:30px; }
.detail-section { margin-top:24px; border-top:1px solid var(--line); }
.detail-line { text-align:left; display:flex; justify-content:space-between; align-items:center; gap:12px; padding:15px 2px; border-bottom:1px solid var(--line); }
.detail-line div { min-width:0; display:flex; flex-direction:column; gap:3px; }
.detail-line small, .notes small { color:var(--muted); font-weight:800; text-transform:uppercase; letter-spacing:.05em; font-size:10px; }
.detail-line strong { word-break:break-word; }
.tappable:hover { background:#fafcfb; }
.pill { padding:8px 12px; border-radius:999px; background:var(--soft); color:var(--primary); font-size:12px; font-weight:900; }
.notes { margin-top:22px; text-align:left; background:#f8faf9; padding:14px; border-radius:14px; }
.notes p { margin:7px 0 0; line-height:1.5; }
.admin-nav { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:14px; }
.warning, .info-box { border-radius:14px; padding:13px 14px; margin:0 0 14px; line-height:1.45; }
.warning { background:var(--warning); border:1px solid #eedda8; }
.info-box { margin-top:16px; background:#eef5f1; border:1px solid #d9e6df; color:#405047; }
.admin-row { justify-content:space-between; gap:12px; padding:12px 14px; }
.admin-row > div { min-width:0; display:flex; flex-direction:column; gap:4px; }
.form-card h1 { font-size:28px; }
.label-row { display:flex; justify-content:space-between; align-items:center; }
.text-button { border:0; background:transparent; color:var(--primary); font-weight:900; padding:4px; }
.phone-editor { display:flex; flex-direction:column; gap:8px; }
.phone-input-row { display:grid; grid-template-columns:120px 1fr 42px; gap:8px; }
.remove-phone { border:1px solid var(--line); border-radius:12px; background:#fff; color:var(--danger); font-size:22px; }
.divider { height:1px; background:var(--line); margin:5px 0; }
.flash { padding:12px 14px; border-radius:14px; margin-bottom:14px; font-weight:700; font-size:14px; }
.flash.success { background:#e8f6ef; color:#176242; }
.flash.error { background:#fff0f0; color:#972828; }
.flash.info { background:#edf3f8; color:#3a586f; }
.footer { text-align:center; color:#8a958e; font-size:11px; margin-top:24px; }
@media (max-width: 580px) {
  .shell { padding:14px 12px 28px; }
  .login-card, .form-card, .detail-card { padding:20px; border-radius:20px; }
  .login-card { margin-top:8vh; }
  .admin-nav { grid-template-columns:1fr 1fr; }
  .phone-input-row { grid-template-columns:88px 1fr 40px; }
  .contact-main { padding-left:10px; gap:10px; }
  .avatar { width:40px; height:40px; }
  .call-button { min-width:52px; margin-right:8px; }
}
