/* ============================================================
   SoloCare — design tokens
   Soft & friendly health-app style: pastel mint/green, rounded
   corners everywhere, warm rounded type.
   Display: Baloo 2 (rounded, friendly — headings)
   Body/UI: Nunito (rounded, warm — everything else)
   Utility/data: IBM Plex Mono (device tokens, timestamps)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700&family=Nunito:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    --ink:        #2B3A34;   /* warm charcoal-green, not pure black */
    --muted:      #6E7F77;

    --bg:         #F6FAF7;   /* soft mint-white page background */
    --paper-alt:  #FFFFFF;
    --mint:       #E4F5EC;   /* pastel mint tint, sidebar / soft panels */
    --mint-deep:  #CFEEDF;

    --brand:      #3FAE82;   /* friendly mid green */
    --brand-dark: #2C8A66;
    --brand-soft: #D9F0E5;

    --line:       rgba(43,58,52,0.10);
    --line-soft:  rgba(43,58,52,0.08);

    --green:  #4CAF8A;
    --yellow: #EFAF3E;
    --red:    #E3766B;

    --green-soft:  #DFF3E9;
    --yellow-soft: #FBF0DA;
    --red-soft:    #FBE4E1;

    --green-text:  #1E7A54;
    --yellow-text: #966A0F;
    --red-text:    #B24A40;
    --pending:     #A9B7B0;
    --pending-soft: #EEF1EF;

    --radius: 22px;
    --radius-sm: 14px;
    --font-display: 'Baloo 2', 'Nunito', sans-serif;
    --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-dark); }
img { max-width: 100%; }
code { font-family: var(--font-mono); background: rgba(43,58,52,0.06); padding: 3px 7px; border-radius: 6px; font-size: 0.88em; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------- Status orb — the signature element ---------------- */
.orb {
    display: inline-block;
    width: 18px; height: 18px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}
.orb::after {
    content: '';
    position: absolute; inset: -7px;
    border-radius: 50%;
    opacity: 0.30;
    filter: blur(7px);
    background: inherit;
}
.orb--green  { background: var(--green); }
.orb--yellow { background: var(--yellow); }
.orb--red    { background: var(--red); }
.orb--big { width: 120px; height: 120px; }
.orb--pulse { animation: orb-pulse 2.6s ease-in-out infinite; }
@keyframes orb-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}
.orb--breathe-cycle { animation: orb-cycle 9s ease-in-out infinite; }
@keyframes orb-cycle {
    0%, 28%   { background: var(--green); }
    38%, 62%  { background: var(--yellow); }
    72%, 100% { background: var(--red); }
}

/* ---------------- Marketing / landing page ---------------- */
.site-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 6vw;
}
.brand-mark {
    font-family: var(--font-display);
    font-size: 1.35rem; font-weight: 700;
    display: flex; align-items: center; gap: 10px;
    color: var(--ink);
}
.nav-links a { color: var(--muted); text-decoration: none; margin-left: 26px; font-size: 0.95rem; font-weight: 600; }
.nav-links a:hover { color: var(--brand-dark); }
.btn {
    display: inline-block;
    font-family: var(--font-body); font-weight: 700; font-size: 0.95rem;
    padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
    text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(63,174,130,0.28); }
.btn--primary:hover { background: var(--brand-dark); }
.btn--ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn--dark { background: var(--ink); color: #fff; }

.hero {
    background: radial-gradient(120% 140% at 15% -10%, var(--mint) 0%, var(--bg) 60%);
    color: var(--ink);
    padding: 64px 6vw 90px;
    display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.3rem, 4.6vw, 3.3rem);
    line-height: 1.15; font-weight: 700;
    margin: 16px 0 20px;
}
.hero .eyebrow { font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase; font-size: .76rem; color: var(--brand-dark); }
.hero p.lede { font-size: 1.12rem; color: var(--muted); max-width: 46ch; }
.hero-cta { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-orb-stage {
    display: flex; flex-direction: column; align-items: center; gap: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 44px;
    box-shadow: 0 10px 34px rgba(43,58,52,0.06);
}
.hero-orb-stage .orb-caption { font-family: var(--font-mono); font-size: 0.82rem; color: var(--muted); text-align: center; }

.section { padding: 84px 6vw; }
.section--alt { background: var(--paper-alt); }
.section h2 {
    font-family: var(--font-display); font-weight: 700;
    font-size: clamp(1.7rem, 3vw, 2.2rem); margin-bottom: 10px;
}
.section .lede { color: var(--muted); max-width: 62ch; margin-bottom: 44px; font-size: 1.04rem; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.feature-card {
    background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px; box-shadow: 0 2px 10px rgba(43,58,52,0.03);
}
.feature-card .icon {
    font-size: 1.5rem; display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 16px; background: var(--mint);
}
.feature-card h3 { font-family: var(--font-body); font-weight: 800; font-size: 1.05rem; margin: 16px 0 8px; }
.feature-card p { color: var(--muted); font-size: 0.95rem; margin: 0; }

.steps { counter-reset: step; display: grid; gap: 26px; max-width: 700px; }
.step { display: grid; grid-template-columns: 54px 1fr; gap: 18px; }
.step-num {
    counter-increment: step; font-family: var(--font-display); font-weight: 700;
    width: 54px; height: 54px; border-radius: 50%;
    border: none; display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem; color: var(--brand-dark); background: var(--mint);
}
.step h4 { margin: 4px 0 6px; font-weight: 800; }
.step p { margin: 0; color: var(--muted); }

.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 18px; }
.tier-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; background: var(--paper-alt); }
.tier-card h3 { margin: 0 0 10px; font-size: 1.08rem; font-weight: 800; color: var(--brand-dark); }
.tier-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.92rem; }
.tier-card li { margin-bottom: 7px; }

.site-footer {
    background: var(--mint); color: var(--muted); padding: 40px 6vw; font-size: 0.9rem;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}

/* ---------------- Auth pages ---------------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--mint); }
.auth-card {
    background: #fff; border-radius: 28px; padding: 42px;
    width: 380px; box-shadow: 0 20px 50px rgba(43,58,52,0.12);
}
.auth-card h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.55rem; margin: 18px 0 6px; }
.auth-card label { display: block; font-size: 0.85rem; font-weight: 700; margin: 16px 0 6px; }
.auth-card input, .field input, .field select, .field textarea {
    width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); font-family: var(--font-body); font-size: 0.95rem;
    background: #fff;
}
.auth-card input:focus, .field input:focus, .field select:focus { border-color: var(--brand); }
.auth-card button { margin-top: 22px; width: 100%; }
.muted { color: var(--muted); font-size: 0.9rem; }
.install-list { font-family: var(--font-mono); font-size: 0.85rem; background: var(--mint); padding: 16px 20px; border-radius: var(--radius-sm); }
.flash-error { background: var(--red-soft); color: var(--red-text); padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 10px; }
.flash-success { background: var(--green-soft); color: var(--green-text); }
.flash-warn { background: var(--yellow-soft); color: var(--yellow-text); }
.demo-hint { font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); margin-top: 22px; line-height: 1.6; }

/* ---------------- App shell ---------------- */
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.app-sidebar {
    background: var(--mint); color: var(--ink); padding: 26px 18px; display: flex; flex-direction: column;
    border-right: 1px solid var(--line);
}
.app-sidebar .brand-mark { color: var(--ink); margin-bottom: 28px; padding: 0 8px; }
.nav-group { margin-bottom: 22px; }
.nav-group-label {
    font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); padding: 0 12px; margin-bottom: 8px;
}
.app-nav a {
    display: flex; align-items: center; gap: 10px;
    color: var(--muted); text-decoration: none; padding: 10px 12px; border-radius: var(--radius-sm);
    font-size: 0.93rem; font-weight: 700; margin-bottom: 3px;
}
.app-nav a:hover { background: #fff; color: var(--ink); }
.app-nav a.active { background: var(--brand); color: #fff; }
.app-nav a .nav-icon { font-size: 1.05rem; width: 20px; text-align: center; }
.app-sidebar .who { margin-top: auto; font-size: 0.8rem; color: var(--muted); padding-top: 18px; border-top: 1px solid var(--line); }
.app-sidebar .who a { color: var(--brand-dark); font-weight: 700; }

.app-main { padding: 34px 44px; max-width: 1180px; }
.app-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 10px; }
.app-header h1 { font-family: var(--font-display); font-weight: 700; margin: 0; font-size: 1.8rem; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { color: var(--brand-dark); }

/* ---------------- Avatars & people cards ---------------- */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; font-weight: 800; font-size: 0.9rem; flex-shrink: 0;
}
.avatar--sm { width: 30px; height: 30px; font-size: 0.75rem; }
.avatar--lg { width: 64px; height: 64px; font-size: 1.3rem; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 16px; }
.person-card {
    background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px; text-decoration: none; color: var(--ink); display: flex; gap: 14px; align-items: flex-start;
    box-shadow: 0 2px 10px rgba(43,58,52,0.03);
    transition: box-shadow .15s ease, transform .15s ease;
}
.person-card:hover { box-shadow: 0 10px 26px rgba(43,58,52,0.10); transform: translateY(-2px); }
.person-card .pc-name { font-weight: 800; font-size: 1.02rem; }
.person-card .pc-meta { color: var(--muted); font-size: 0.83rem; margin-top: 3px; }
.person-card .pc-badges { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- Profile header + sub-nav (device/patient page) ---------------- */
.profile-header {
    display: flex; align-items: center; gap: 18px; padding: 24px; border-radius: var(--radius);
    background: var(--paper-alt); border: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap;
    box-shadow: 0 2px 10px rgba(43,58,52,0.03);
}
.profile-header .ph-name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.profile-header .ph-meta { color: var(--muted); font-size: 0.88rem; margin-top: 3px; }
.profile-header .ph-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.profile-subnav { display: flex; gap: 4px; margin-bottom: 22px; border-bottom: 2px solid var(--line); overflow-x: auto; }
.profile-subnav a {
    padding: 10px 18px; font-weight: 800; font-size: 0.9rem; color: var(--muted); text-decoration: none;
    border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.profile-subnav a:hover { color: var(--ink); }
.profile-subnav a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.profile-subnav a .badge { background: var(--red-soft); color: var(--red-text); font-size: 0.68rem; font-family: var(--font-mono); padding: 1px 7px; border-radius: 999px; }

/* ---------------- Add-device wizard ---------------- */
.wizard-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 30px; }
.wizard-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; font-size: 0.88rem; }
.wizard-step .ws-num {
    width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color: var(--muted);
    display: flex; align-items: center; justify-content: center; font-size: 0.82rem; font-family: var(--font-mono);
}
.wizard-step.done .ws-num { background: var(--brand); color: #fff; }
.wizard-step.current .ws-num { background: var(--ink); color: #fff; }
.wizard-step.current { color: var(--ink); }
.wizard-connector { flex: 1; height: 2px; background: var(--line); min-width: 20px; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; margin: 18px 0 26px; }
.plan-option { position: relative; }
.plan-option input { position: absolute; opacity: 0; }
.plan-option label {
    display: block; border: 2px solid var(--line); border-radius: var(--radius); padding: 20px;
    cursor: pointer; background: var(--paper-alt); transition: border-color .15s ease;
}
.plan-option input:checked + label { border-color: var(--brand); background: var(--green-soft); }
.plan-option .po-name { font-weight: 800; margin-bottom: 6px; }
.plan-option ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.85rem; }
.plan-option li { margin-bottom: 4px; }

/* ---------------- Alert timeline ---------------- */
.alert-timeline { display: flex; flex-direction: column; gap: 2px; }
.alert-item { display: flex; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line-soft); }
.alert-item:last-child { border-bottom: none; }
.alert-item .ai-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.alert-item .ai-body { flex: 1; }
.alert-item .ai-title { font-weight: 700; font-size: 0.95rem; }
.alert-item .ai-meta { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.card {
    background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 26px; margin-bottom: 22px; box-shadow: 0 2px 10px rgba(43,58,52,0.03);
}
.card h2, .card h3 { margin-top: 0; font-family: var(--font-display); font-weight: 700; }
.card h2 { font-size: 1.2rem; } .card h3 { font-size: 1.02rem; }

.patient-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 18px; }
.patient-card {
    background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px; text-decoration: none; color: var(--ink); display: block;
    border-top: 5px solid var(--status-color, #C7CFCA);
    box-shadow: 0 2px 10px rgba(43,58,52,0.03);
    transition: box-shadow .15s ease, transform .15s ease;
}
.patient-card:hover { box-shadow: 0 10px 26px rgba(43,58,52,0.10); transform: translateY(-2px); }
.patient-card .top-row { display: flex; align-items: center; justify-content: space-between; }
.patient-card .name { font-weight: 800; font-size: 1.08rem; }
.patient-card .meta { color: var(--muted); font-size: 0.85rem; margin-top: 8px; }
.patient-card .tag {
    font-family: var(--font-mono); font-size: 0.72rem; padding: 4px 11px; border-radius: 999px;
    background: var(--brand-soft); color: var(--brand-dark); display: inline-block; margin-top: 12px; font-weight: 600;
}

.status-banner {
    display: flex; align-items: center; gap: 18px; padding: 22px 26px; border-radius: var(--radius);
    border: 1px solid var(--line); margin-bottom: 22px; background: var(--paper-alt);
}
.status-banner .label { font-weight: 800; font-size: 1.15rem; font-family: var(--font-display); }
.status-banner .sub { color: var(--muted); font-size: 0.9rem; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data-table th { text-align: left; color: var(--muted); font-weight: 800; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 2px solid var(--line); }
table.data-table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--bg); }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.pill--green  { background: var(--green-soft);  color: var(--green-text); }
.pill--yellow { background: var(--yellow-soft); color: var(--yellow-text); }
.pill--red    { background: var(--red-soft);    color: var(--red-text); }
.pill--muted  { background: var(--mint); color: var(--muted); }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 14px; }
.field label { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 6px; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; font-family: var(--font-body); }
.btn-sm:hover { background: var(--mint); }
.btn-danger { color: #B24A40; border-color: rgba(227,118,107,.35); }
.empty-state { text-align: center; padding: 54px 20px; color: var(--muted); }

.device-simulator { display: flex; gap: 12px; flex-wrap: wrap; }
.simulator-log {
    font-family: var(--font-mono); font-size: 0.82rem; background: var(--ink); color: var(--green-soft);
    padding: 16px; border-radius: var(--radius-sm); max-height: 240px; overflow-y: auto;
}

/* ---------------- Admin panel ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card {
    background: var(--paper-alt); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 20px 22px; box-shadow: 0 2px 10px rgba(43,58,52,0.03);
}
.stat-card .num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1.1; color: var(--brand-dark); }
.stat-card .num.stat--warn { color: var(--yellow-text); }
.stat-card.stat--warn { background: var(--yellow-soft); }
.stat-card.stat--danger { background: var(--red-soft); }
.stat-card.stat--danger .num { color: var(--red-text); }
.stat-card .lbl { color: var(--muted); font-size: 0.82rem; margin-top: 4px; font-weight: 600; }

.admin-tabs {
    display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 2px solid var(--line);
    overflow-x: auto;
}
.admin-tabs a {
    background: none; border: none; padding: 11px 20px; font-family: var(--font-body); font-size: 0.92rem; font-weight: 800;
    color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; margin-bottom: -2px;
    text-decoration: none; display: inline-block;
}
.admin-tabs a:hover { color: var(--ink); }
.admin-tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.admin-tab-btn {
    background: none; border: none; padding: 11px 20px; font-family: var(--font-body); font-size: 0.92rem; font-weight: 800;
    color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; margin-bottom: -2px;
}
.admin-tab-btn:hover { color: var(--ink); }
.admin-tab-btn.active { color: var(--brand-dark); border-bottom-color: var(--brand); }
.admin-tab-btn .count { background: var(--red-soft); color: var(--red-text); font-size: 0.72rem; font-family: var(--font-mono); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }

.admin-section { display: none; }
.admin-section.active { display: block; }

.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-input {
    padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);
    font-family: var(--font-body); font-size: 0.9rem; background: var(--bg); min-width: 220px;
}
.table-search { margin-bottom: 16px; max-width: 320px; }
.table-search input { width: 100%; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); font-family: var(--font-body); font-size: 0.9rem; background: var(--bg); }

.receipt-thumb {
    width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex-shrink: 0;
    border: 1px solid var(--line); background: var(--mint);
}
.receipt-thumb--none {
    display: flex; align-items: center; justify-content: center; text-align: center;
    font-size: 0.65rem; color: var(--muted); padding: 4px;
}

/* ---------------- Top bar + profile menu ---------------- */
.topbar {
    display: flex; align-items: center; justify-content: flex-end;
    padding: 16px 32px; border-bottom: 1px solid var(--line); background: var(--paper-alt);
}
.user-menu { position: relative; }
.user-menu summary {
    display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
    padding: 6px 14px 6px 6px; border-radius: 999px;
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { background: var(--mint); }
.user-menu .name { font-weight: 700; font-size: 0.9rem; }
.user-menu .chev { color: var(--muted); font-size: 0.7rem; }
.avatar {
    width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
    font-family: var(--font-display); flex-shrink: 0;
}
.user-menu .dropdown {
    position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line);
    border-radius: 16px; box-shadow: 0 14px 34px rgba(43,58,52,0.14); min-width: 210px; padding: 8px; z-index: 30;
}
.user-menu .dropdown .role-badge { font-size: 0.72rem; color: var(--muted); font-weight: 700; padding: 8px 14px 4px; text-transform: uppercase; letter-spacing: .04em; }
.user-menu .dropdown a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.9rem; }
.user-menu .dropdown a:hover { background: var(--mint); }
.user-menu .dropdown hr { border: none; border-top: 1px solid var(--line); margin: 6px 4px; }

/* ---------------- Grouped sidebar nav ---------------- */
.nav-group { margin-bottom: 22px; }
.nav-group-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; padding: 0 14px; margin-bottom: 8px; }

/* ---------------- Device detail tab strip ---------------- */
.device-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 26px; overflow-x: auto; }
.device-tabs a {
    padding: 10px 20px; font-weight: 800; color: var(--muted); text-decoration: none;
    border-bottom: 3px solid transparent; white-space: nowrap; font-size: 0.92rem;
}
.device-tabs a:hover { color: var(--ink); }
.device-tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* ---------------- Add-device wizard ---------------- */
.wizard-steps { display: flex; gap: 10px; margin-bottom: 32px; max-width: 640px; }
.wizard-step {
    flex: 1; text-align: center; padding: 12px 8px; border-radius: 14px; background: var(--mint);
    color: var(--muted); font-weight: 800; font-size: 0.82rem;
}
.wizard-step.active { background: var(--brand); color: #fff; }
.wizard-step.done { background: var(--brand-soft); color: var(--brand-dark); }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; }
.plan-card {
    border: 2px solid var(--line); border-radius: 20px; padding: 22px; cursor: pointer;
    background: #fff; transition: border-color .15s ease, background .15s ease; display: block;
}
.plan-card:hover { border-color: var(--brand); }
.plan-card input { position: absolute; opacity: 0; pointer-events: none; }
.plan-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.plan-card h3 { margin: 0 0 10px; font-size: 1.05rem; color: var(--brand-dark); }
.plan-card ul { padding-left: 18px; color: var(--muted); font-size: 0.88rem; margin: 0; }
.plan-card li { margin-bottom: 5px; }

.callout { background: var(--yellow-soft); color: var(--yellow-text); border-radius: 16px; padding: 16px 20px; margin-bottom: 20px; font-size: 0.92rem; }
.callout a { color: var(--yellow-text); text-decoration: underline; font-weight: 700; }
.callout--brand { background: var(--brand-soft); color: var(--brand-dark); }
.callout--brand a { color: var(--brand-dark); }

.review-list { border: 1px solid var(--line); border-radius: 16px; padding: 4px 0; margin-bottom: 20px; }
.review-list dt { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 20px 0; }
.review-list dd { margin: 2px 0 10px; padding: 0 20px; font-weight: 700; }


details.add-form { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
details.add-form > summary {
    cursor: pointer; font-weight: 800; font-size: 0.9rem; color: var(--brand-dark); list-style: none;
    display: inline-flex; align-items: center; gap: 6px;
}
details.add-form > summary::before { content: '+'; font-size: 1.2rem; line-height: 1; }
details.add-form[open] > summary::before { content: '−'; }
details.add-form > summary::-webkit-details-marker { display: none; }
details.add-form .form-row { margin-top: 18px; }

.payment-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.payment-row:last-child { border-bottom: none; }
.empty-inline { color: var(--muted); font-size: 0.9rem; padding: 10px 0; }

@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar { position: sticky; top: 0; z-index: 5; flex-direction: row; align-items: center; padding: 14px 18px; }
    .app-sidebar .who, .app-nav { display: none; }
    .hero { grid-template-columns: 1fr; }
}
