/* ------------------------------------------------------------------
   BharatOPD Doctor Portal — shared styles.
   Mobile-first; sidebar collapses below 900px.
   AI-feeling visual language: deep gradients, glass surfaces, subtle
   glow accents, kicker eyebrows, animated hero blob.
   Class names match the originals so existing markup keeps working.
   ------------------------------------------------------------------ */
:root {
    --brand:        #0b1e36;
    --brand-soft:   #16314f;
    --brand-deep:   #07172a;
    --brand-accent: #4f7cff;
    --brand-accent-2: #7c3aed;
    --amber:        #f59e0b;
    --green:        #10b981;
    --red:          #ef4444;
    --ink:          #0f172a;
    --ink-soft:     #1e293b;
    --muted:        #64748b;
    --line:         #e6ecf3;
    --line-soft:    #eef2f7;
    --bg:           #f4f6fb;
    --bg-2:         #eef1f8;
    --card:         #ffffff;
    --shadow-sm:    0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15, 23, 42, .03);
    --shadow-md:    0 8px 28px rgba(15, 23, 42, .07), 0 2px 6px rgba(15, 23, 42, .04);
    --shadow-lg:    0 20px 50px rgba(15, 23, 42, .14);
    --r-sm:         10px;
    --r-md:         14px;
    --r-lg:         20px;
    --r-xl:         28px;
    --gradient-brand: linear-gradient(135deg, #4f7cff 0%, #7c3aed 100%);
    --gradient-ink:   linear-gradient(135deg, #0b1e36 0%, #1f3b5c 60%, #2557b8 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.portal-body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background:
        radial-gradient(1200px 600px at 100% -200px, rgba(124, 58, 237, .07), transparent 60%),
        radial-gradient(900px 500px at -200px 100%, rgba(79, 124, 255, .06), transparent 55%),
        var(--bg);
    color: var(--ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--brand-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Skip link (a11y) ---------- */
.skip-link {
    position: absolute;
    left: -9999px;
}
.skip-link:focus {
    left: 12px;
    top: 12px;
    z-index: 1000;
    background: var(--brand);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
}

/* ---------- Top bar ---------- */
.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .75);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line);
}
.portal-menu-btn {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 7px 11px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}
.portal-menu-btn:hover { background: var(--bg-2); }
.portal-topbar-title {
    font-weight: 700;
    font-size: 15.5px;
    color: var(--ink);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -.01em;
}
.portal-who {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--bg-2);
    border: 1px solid var(--line);
    padding: 5px 10px;
    border-radius: 999px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.portal-who::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    margin-right: 6px;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, .15);
    vertical-align: 1px;
}

/* ---------- Sidebar ---------- */
.portal-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: 244px;
    background:
        radial-gradient(420px 180px at 0% 0%, rgba(79, 124, 255, .22), transparent 60%),
        radial-gradient(380px 220px at 100% 100%, rgba(124, 58, 237, .18), transparent 55%),
        linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
    color: #fff;
    padding: 22px 16px 20px;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 60;
    border-right: 1px solid rgba(255, 255, 255, .04);
}
.portal-side.is-open { transform: translateX(0); }
.portal-brand {
    margin-bottom: 22px;
}
.portal-brand img {
    height: 40px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}
.portal-brand-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255, 255, 255, .55);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
}
.portal-brand-mini::before {
    content: "✦";
    color: #c7b6ff;
    font-size: 14px;
}
.portal-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border-radius: 10px;
    color: rgba(255, 255, 255, .72);
    font-weight: 500;
    font-size: 14.5px;
    transition: background .15s ease, color .15s ease, transform .12s ease;
    position: relative;
}
.portal-nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
    text-decoration: none;
}
.portal-nav-link.is-active {
    background: linear-gradient(135deg, rgba(79, 124, 255, .35) 0%, rgba(124, 58, 237, .28) 100%);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.portal-nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    border-radius: 2px;
    background: linear-gradient(180deg, #4f7cff, #7c3aed);
    box-shadow: 0 0 12px rgba(124, 58, 237, .55);
}
.portal-side-foot {
    margin-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding-top: 14px;
}
.portal-logout {
    width: 100%;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .14);
    color: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.portal-logout:hover {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .25);
}

/* ---------- Main content ---------- */
.portal-main {
    padding: 22px 16px 100px;
    max-width: 1180px;
    margin: 0 auto;
}

/* ---------- Section eyebrow ---------- */
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
    color: var(--brand-accent);
    background: rgba(79, 124, 255, .08);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.kicker.is-ai {
    background: linear-gradient(135deg, rgba(79, 124, 255, .12), rgba(124, 58, 237, .12));
    color: #6d4ce6;
}
.kicker.is-ai::before { content: "✦"; color: #7c3aed; }

/* ---------- Cards ---------- */
.p-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.p-card:hover {
    box-shadow: var(--shadow-md);
}
.p-card + .p-card { margin-top: 14px; }
.p-card h2, .p-card h3 {
    margin: 0 0 6px;
    letter-spacing: -.01em;
    color: var(--ink);
}
.p-card h3 { font-size: 16.5px; }
.p-card .muted { color: var(--muted); font-size: 13.5px; }

.p-grid { display: grid; gap: 16px; }
.p-grid.cols-2 { grid-template-columns: 1fr; }
.p-grid.cols-3 { grid-template-columns: 1fr; }
.p-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }

/* ---------- KPI ---------- */
.kpi {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, 1) 100%),
        var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 16px 16px 14px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.kpi::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--gradient-brand);
    opacity: 0;
    transition: opacity .2s ease;
}
.kpi:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #d6deea;
}
.kpi:hover::before { opacity: 1; }
.kpi .label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 700;
}
.kpi .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--ink);
    margin-top: 6px;
    line-height: 1.05;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #0b1e36, #2557b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.kpi .delta {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
    font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--gradient-brand);
    color: #fff;
    font-weight: 700;
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14.5px;
    letter-spacing: -.005em;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .12),
        0 6px 18px rgba(79, 124, 255, .28);
    transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover {
    text-decoration: none;
    filter: brightness(1.05);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, .12),
        0 10px 24px rgba(79, 124, 255, .35);
}
.btn:active { transform: scale(.98); }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 124, 255, .35), 0 6px 18px rgba(79, 124, 255, .28);
}
.btn.btn-ghost {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.btn.btn-ghost:hover {
    background: #fff;
    border-color: #c8d1de;
    box-shadow: var(--shadow-md);
    filter: none;
}
.btn.btn-danger {
    background: linear-gradient(135deg, #ef4444, #c2185b);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 6px 18px rgba(239, 68, 68, .28);
}
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }

.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #eef2ff;
    color: var(--brand);
    letter-spacing: .01em;
}
.badge.is-trial   { background: #fff7ed; color: #c2410c; }
.badge.is-paid    { background: #ecfdf5; color: #047857; }
.badge.is-expired { background: #fef2f2; color: #b91c1c; }
.badge.is-new     { background: #eff6ff; color: #1d4ed8; }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea, select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    font-family: inherit;
    transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 4px rgba(79, 124, 255, .15);
}
label.field {
    display: block;
    margin-bottom: 14px;
}
label.field > span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    align-items: center;
}

/* ---------- Tables ---------- */
.list-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.list-table th, .list-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 14px;
    text-align: left;
}
.list-table th {
    background: var(--bg-2);
    color: var(--muted);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.list-table tr:last-child td { border-bottom: 0; }
.list-table tr:hover td { background: rgba(79, 124, 255, .03); }

/* ---------- Alerts ---------- */
.alert {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.alert.alert-info  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert.alert-warn  { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.alert.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert.alert-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 20px);
    background: var(--brand-deep);
    color: #fff;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 1000;
    box-shadow: 0 12px 30px rgba(11, 30, 54, .45);
}
.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

/* ---------- Login screen ---------- */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background:
        radial-gradient(700px 380px at 80% 0%, rgba(124, 58, 237, .18), transparent 60%),
        radial-gradient(800px 460px at 0% 100%, rgba(79, 124, 255, .18), transparent 55%),
        linear-gradient(160deg, #f6f8fb 0%, #eaf0ff 100%);
}
.login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-radius: 24px;
    padding: 32px 26px 28px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, .18);
    border: 1px solid rgba(255, 255, 255, .55);
}
.login-card .logo {
    display: block;
    margin: 0 auto 14px;
    height: 44px;
}
.login-card h1 {
    text-align: center;
    margin: 0 0 6px;
    font-size: 22px;
    letter-spacing: -.015em;
}
.login-card .lede {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 20px;
}
.login-card .field { margin-bottom: 14px; }
.login-card .otp-input { letter-spacing: .4em; text-align: center; font-size: 22px; font-weight: 700; }
.login-card .helper {
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 16px;
}
.login-card .helper a { color: var(--brand-accent); }

/* ---------- Welcome / hero strip ---------- */
.welcome-strip {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(380px 220px at 100% 0%, rgba(124, 58, 237, .55), transparent 60%),
        radial-gradient(420px 260px at 0% 100%, rgba(79, 124, 255, .45), transparent 55%),
        linear-gradient(135deg, var(--brand) 0%, var(--brand-soft) 100%);
    color: #fff;
    padding: 22px 22px 24px;
    border-radius: var(--r-xl);
    margin-bottom: 18px;
    box-shadow: 0 18px 40px rgba(11, 30, 54, .22);
    border: 1px solid rgba(255, 255, 255, .06);
}
.welcome-strip::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, .12), transparent);
    pointer-events: none;
    animation: pulseBlob 6s ease-in-out infinite;
}
@keyframes pulseBlob {
    0%, 100% { transform: scale(1); opacity: .8; }
    50% { transform: scale(1.15); opacity: 1; }
}
.welcome-strip .ai-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.welcome-strip .ai-pill::before {
    content: "✦";
    color: #c7b6ff;
}
.welcome-strip h2 {
    color: #fff;
    margin: 0 0 6px;
    font-size: 22px;
    letter-spacing: -.02em;
    line-height: 1.2;
    font-weight: 800;
}
.welcome-strip p {
    margin: 0;
    color: rgba(255, 255, 255, .85);
    font-size: 14px;
    line-height: 1.5;
}
.welcome-strip .strip-clinic {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 10px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: .01em;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    max-width: 100%;
}
/* Inline clinic name shown in the H2 itself (after the doctor name)
   so the hospital identity is never visually lost. */
.welcome-strip h2 .strip-clinic-inline {
    color: rgba(255, 255, 255, .92);
    font-weight: 700;
    background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.08));
    border: 1px solid rgba(255, 255, 255, .22);
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.78em;
    letter-spacing: -.005em;
    margin-left: 4px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
}
/* Highlighted dates inside the trial-status line. */
.welcome-strip p b {
    color: #fff;
    font-weight: 700;
    background: rgba(255, 255, 255, .12);
    padding: 1px 7px;
    border-radius: 6px;
}
.welcome-strip .strip-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.welcome-strip .btn {
    background: #fff;
    color: var(--brand);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
.welcome-strip .btn:hover { filter: brightness(1.02); }
.welcome-strip .btn.btn-ghost {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .3);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: none;
}
.welcome-strip .btn.btn-ghost:hover { background: rgba(255, 255, 255, .15); }

/* ---------- Link rows (dashboard "Your links") ---------- */
.link-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--r-md, 12px);
    background:
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.link-row:hover {
    border-color: rgba(47, 111, 214, .35);
    box-shadow: 0 8px 22px rgba(20, 41, 63, .07);
    transform: translateY(-1px);
}
.link-row .link-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.link-row .link-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.link-row .link-meta { min-width: 0; }
.link-row .link-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
    line-height: 1.2;
}
.link-row .link-desc {
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--muted);
}
.link-row .link-url {
    font-size: 12.5px;
    color: var(--brand);
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-weight: 600;
}
.link-row .link-actions {
    display: flex;
    gap: 8px;
}
.link-row .link-actions .btn { flex: 1; }
.btn.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 9px;
}

/* ---------- Sparkline ---------- */
.spark {
    width: 100%;
    height: 60px;
    overflow: hidden;
    margin-top: 8px;
}

/* ---------- Section head (kicker + h3 row) ---------- */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.section-head h3 {
    margin: 0;
    font-size: 16.5px;
    letter-spacing: -.01em;
}
.section-head .lede {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

/* ---------- Segmented preset toggle ---------- */
.seg {
    display: inline-flex;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}
.seg button {
    background: transparent;
    border: 0;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
    font-family: inherit;
}
.seg button:hover { color: var(--ink); }
.seg button.is-active {
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

/* ---------- KPI with icon + delta chip ---------- */
.kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(79, 124, 255, .12), rgba(124, 58, 237, .12));
    color: var(--brand-accent);
    font-size: 14px;
    margin-right: 8px;
    vertical-align: -10px;
}
.kpi-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.kpi .delta-chip {
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--muted);
    margin-top: 6px;
    display: inline-block;
}

/* ---------- Bar rows (event breakdown) ---------- */
.bar-row { margin-bottom: 14px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    margin-bottom: 5px;
}
.bar-row-head .label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--ink-soft);
    font-weight: 500;
}
.bar-row-head .label .ico {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(79, 124, 255, .12), rgba(124, 58, 237, .12));
    color: var(--brand-accent);
    font-size: 11px;
}
.bar-row-head b { font-variant-numeric: tabular-nums; color: var(--ink); }
.bar-track {
    height: 8px;
    background: var(--bg-2);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
.bar-fill {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: 999px;
    transition: width .4s ease;
}

/* ---------- iOS-style toggle ---------- */
.toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex: 0 0 auto;
}
.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background .2s ease;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .2s ease;
}
.toggle input:checked + .toggle-slider { background: var(--gradient-brand); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle input:disabled + .toggle-slider { opacity: .5; cursor: not-allowed; }

.pref-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pref-row + .pref-row { margin-top: 10px; }
.pref-row:hover { border-color: #d6deea; box-shadow: var(--shadow-sm); }
.pref-row .pref-text { flex: 1; }
.pref-row .pref-text b {
    display: block;
    font-size: 14.5px;
    color: var(--ink);
    margin-bottom: 2px;
    font-weight: 700;
}
.pref-row .pref-text span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

/* ---------- Skeleton placeholders ---------- */
.skel {
    background: linear-gradient(90deg, var(--bg-2) 0%, #f8fafc 50%, var(--bg-2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
    border-radius: 8px;
    color: transparent;
    display: inline-block;
}
.skel-line {
    display: block;
    height: 12px;
    width: 100%;
    margin-bottom: 8px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--bg-2) 0%, #f8fafc 50%, var(--bg-2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}
.skel-block {
    height: 120px;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--bg-2) 0%, #f8fafc 50%, var(--bg-2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}

/* ---------- Date input polish ---------- */
input[type="date"] {
    font-family: inherit;
    color: var(--ink);
}
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: .6;
}
input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: 1; }

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 28px 16px;
    color: var(--muted);
}
.empty-state .icon {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
    color: var(--brand-accent);
    opacity: .55;
}

/* ---------- Empty / loading shimmer ---------- */
.muted { color: var(--muted); font-size: 13.5px; }
.shimmer {
    background: linear-gradient(90deg, var(--bg-2) 0%, #f8fafc 50%, var(--bg-2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
    border-radius: 8px;
    color: transparent;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Renew card (dashboard, shown when page is at risk) ---------- */
.renew-card {
    background: linear-gradient(180deg, #ffffff 0%, #fef9f3 100%);
    border: 1px solid #fde2c4;
    border-radius: var(--r-xl, 18px);
    padding: 18px 18px 20px;
    margin-bottom: 18px;
    box-shadow: 0 6px 20px rgba(180, 83, 9, .08);
}
.renew-card[hidden] { display: none; }
.renew-card .renew-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.renew-card .renew-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #b45309;
    background: #fef3c7;
    border: 1px solid #fde68a;
    padding: 3px 10px;
    border-radius: 999px;
}
.renew-card .renew-eyebrow::before {
    content: "⚡";
    font-size: 12px;
}
.renew-card h3 {
    margin: 8px 0 4px;
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -.01em;
}
.renew-card .renew-head .muted { font-size: 13px; }
.renew-card .renew-plans {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.renew-card .renew-plan {
    position: relative;
    display: block;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    color: var(--ink);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.renew-card .renew-plan:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -10px rgba(11, 79, 255, .25);
    border-color: rgba(11, 79, 255, .35);
}
.renew-card .renew-plan-tier {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.renew-card .renew-plan-price {
    font-size: 28px;
    font-weight: 900;
    color: var(--ink);
    margin-top: 4px;
    letter-spacing: -.02em;
    line-height: 1;
}
.renew-card .renew-plan-price span {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    margin-left: 2px;
}
.renew-card .renew-plan-meta {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 6px;
}
.renew-card .renew-plan-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-weight: 800;
    font-size: 13.5px;
    color: var(--brand-accent, #0B4FFF);
}
.renew-card .renew-plan-best {
    background: linear-gradient(160deg, #14293f 0%, #2f6fd6 60%, #7c3aed 100%);
    color: #fff;
    border: none;
    box-shadow: 0 12px 30px -10px rgba(11, 79, 255, .45);
}
.renew-card .renew-plan-best .renew-plan-tier { color: rgba(255, 255, 255, .82); }
.renew-card .renew-plan-best .renew-plan-price { color: #fff; }
.renew-card .renew-plan-best .renew-plan-price span { color: rgba(255, 255, 255, .8); }
.renew-card .renew-plan-best .renew-plan-meta { color: rgba(255, 255, 255, .85); }
.renew-card .renew-plan-best .renew-plan-cta { color: #fff; }
.renew-card .renew-best-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    background: linear-gradient(135deg, #f59e0b, #ec4899);
    color: #fff;
    font-size: 10.5px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: .04em;
    box-shadow: 0 6px 14px -4px rgba(236, 72, 153, .4);
}

/* ---------- Responsive ---------- */
@media (min-width: 700px) {
    .p-grid.cols-2 { grid-template-columns: 1fr 1fr; }
    .p-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .p-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
    .renew-card .renew-plans { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
    .portal-topbar {
        margin-left: 244px;
    }
    .portal-side {
        transform: translateX(0);
    }
    .portal-menu-btn { display: none; }
    .portal-main {
        margin-left: 244px;
        padding: 26px 32px 100px;
    }
    .welcome-strip { padding: 28px 28px 30px; }
    .welcome-strip h2 { font-size: 26px; }
}
