/* ================================================================
   BIMO AI — PROFILE PAGE
   Clean, modern redesign with indigo accent system
   ================================================================ */

/* ── Design tokens ───────────────────────────────────────────── */
:root {
    /* Accent — Indigo */
    --p-accent:         #5E6AD2;
    --p-accent-hover:   #4b57bf;
    --p-accent-soft:    rgba(94, 106, 210, 0.08);
    --p-accent-border:  rgba(94, 106, 210, 0.20);
    --p-accent-text:    #3d4db5;

    /* Surfaces */
    --p-bg:             #eef0f6;
    --p-surface:        #ffffff;
    --p-surface-alt:    #f6f7fb;

    /* Borders */
    --p-border:         rgba(0, 0, 0, 0.07);
    --p-border-strong:  rgba(0, 0, 0, 0.12);

    /* Text */
    --p-text:           #0f1117;
    --p-text-soft:      #4a5166;
    --p-text-muted:     #6c7290;
    --p-text-faint:     #9ba3be;

    /* Status — Danger */
    --p-danger:         #b83232;
    --p-danger-soft:    rgba(184, 50, 50, 0.08);
    --p-danger-border:  rgba(184, 50, 50, 0.16);

    /* Status — Gold */
    --p-gold:           #8c6c00;
    --p-gold-soft:      rgba(140, 108, 0, 0.08);
    --p-gold-border:    rgba(140, 108, 0, 0.18);

    /* Status — Success */
    --p-success:        #186b38;
    --p-success-soft:   rgba(24, 107, 56, 0.08);
    --p-success-border: rgba(24, 107, 56, 0.18);

    /* Elevation */
    --p-shadow:         0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
    --p-shadow-md:      0 4px 18px rgba(0, 0, 0, 0.07);

    /* Shape */
    --p-r-xs:  5px;
    --p-r-sm:  8px;
    --p-r:     12px;
    --p-r-lg:  16px;
    --p-r-pill: 9999px;

    /* Layout */
    --p-width: 1160px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    min-width: 0;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
    font: inherit;
}

button:disabled { cursor: not-allowed; }

a {
    color: inherit;
    text-decoration: none;
}

input, select, textarea { font: inherit; }
textarea { resize: vertical; }

/* ── Base ────────────────────────────────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--p-text);
    background: var(--p-bg);
    -webkit-font-smoothing: antialiased;
}

/* ── Page shell ──────────────────────────────────────────────── */
.profile-page {
    min-height: 100vh;
    padding: 20px;
}

.profile-shell {
    width: min(100%, var(--p-width));
    margin: 0 auto;
    display: grid;
    gap: 14px;
}

.profile-content {
    display: grid;
    gap: 14px;
}

/* ── Topbar ──────────────────────────────────────────────────── */
.profile-topbar {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r);
    box-shadow: var(--p-shadow);
    overflow: hidden;
}

.topbar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 24px;
    border-bottom: 1px solid var(--p-border);
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.brand-lockup__logo {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    border: 1px solid var(--p-border);
    background: var(--p-surface-alt);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.brand-lockup__logo img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.brand-lockup__name {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--p-text);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-link {
    height: 34px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-sm);
    background: var(--p-surface);
    color: var(--p-text-soft);
    font-size: 0.845rem;
    font-weight: 500;
    box-shadow: var(--p-shadow);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.topbar-link:hover {
    background: var(--p-surface-alt);
    color: var(--p-text);
    border-color: var(--p-border-strong);
}

.topbar-link--danger {
    color: var(--p-danger);
    background: var(--p-danger-soft);
    border-color: var(--p-danger-border);
}

.topbar-link--danger:hover {
    opacity: 0.85;
}

/* ── Profile hero ────────────────────────────────────────────── */
.profile-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 28px 22px;
    flex-wrap: wrap;
}

.profile-hero__eyebrow {
    margin: 0 0 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--p-accent);
}

.profile-hero h1 {
    margin: 0 0 6px;
    font-size: clamp(1.45rem, 2.5vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.18;
}

.profile-hero__text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--p-text-muted);
    line-height: 1.6;
    max-width: 560px;
}

.profile-hero__side {
    flex-shrink: 0;
}

/* ── Status badges ───────────────────────────────────────────── */
.profile-status,
.form-status {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: var(--p-r-pill);
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid var(--p-accent-border);
    background: var(--p-accent-soft);
    color: var(--p-accent-text);
    white-space: nowrap;
}

[data-tone="success"] {
    border-color: var(--p-success-border);
    background: var(--p-success-soft);
    color: var(--p-success);
}

[data-tone="warning"] {
    border-color: var(--p-gold-border);
    background: var(--p-gold-soft);
    color: var(--p-gold);
}

[data-tone="danger"] {
    border-color: var(--p-danger-border);
    background: var(--p-danger-soft);
    color: var(--p-danger);
}

/* ── Cards ───────────────────────────────────────────────────── */
.profile-card {
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r);
    box-shadow: var(--p-shadow);
    padding: 24px 26px 28px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.card-header__title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--p-text-faint);
}

.card-header h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--p-text);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-secondary {
    height: 34px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--p-border-strong);
    border-radius: var(--p-r-sm);
    background: var(--p-surface);
    color: var(--p-text-soft);
    font-size: 0.845rem;
    font-weight: 500;
    box-shadow: var(--p-shadow);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.btn-secondary:hover {
    background: var(--p-surface-alt);
    color: var(--p-text);
}

.btn-primary {
    height: 40px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--p-accent);
    border-radius: var(--p-r-sm);
    background: var(--p-accent);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 1px 5px rgba(94, 106, 210, 0.28);
    flex-shrink: 0;
    transition: background 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
    background: var(--p-accent-hover);
    border-color: var(--p-accent-hover);
    box-shadow: 0 2px 10px rgba(94, 106, 210, 0.34);
}

.btn-primary:disabled { opacity: 0.58; }

.btn-gold {
    height: 34px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--p-gold-border);
    border-radius: var(--p-r-sm);
    background: var(--p-gold-soft);
    color: var(--p-gold);
    font-size: 0.845rem;
    font-weight: 600;
    box-shadow: var(--p-shadow);
    flex-shrink: 0;
    transition: opacity 0.15s;
}

.btn-gold:hover { opacity: 0.82; }

.icon-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-sm);
    background: var(--p-surface);
    color: var(--p-text-muted);
    box-shadow: var(--p-shadow);
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.icon-btn:hover {
    background: var(--p-surface-alt);
    color: var(--p-text);
}

.text-link {
    display: inline;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--p-accent-text);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s;
}

.text-link:hover { color: var(--p-accent); }

/* ── Focus rings ─────────────────────────────────────────────── */
.topbar-link:focus-visible,
.btn-secondary:focus-visible,
.btn-primary:focus-visible,
.btn-gold:focus-visible,
.icon-btn:focus-visible,
.avatar-edit-btn:focus-visible,
.brand-lockup:focus-visible,
.text-link:focus-visible,
.input-action-btn:focus-visible {
    outline: 2px solid var(--p-accent);
    outline-offset: 2px;
}

/* ── Identity section ────────────────────────────────────────── */
.identity-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
    gap: 20px;
    align-items: start;
}

.identity-main {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* Avatar */
.avatar-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.avatar-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 14px;
    overflow: hidden;
    border: 1.5px solid var(--p-border);
    background: var(--p-surface-alt);
    box-shadow: var(--p-shadow-md);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--p-accent);
    background: var(--p-accent-soft);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--p-border);
    background: rgba(255, 255, 255, 0.92);
    color: var(--p-text-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--p-shadow);
    transition: background 0.15s, color 0.15s;
}

.avatar-edit-btn:hover {
    background: #fff;
    color: var(--p-accent);
}

.avatar-hint {
    margin: 0;
    font-size: 0.71rem;
    color: var(--p-text-faint);
    text-align: center;
    line-height: 1.45;
    max-width: 100px;
}

/* Identity info */
.identity-info {
    display: flex;
    flex-direction: column;
    gap: 11px;
    min-width: 0;
    flex: 1;
}

.identity-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.identity-greeting {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--p-accent-text);
}

.identity-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    height: 24px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--p-r-pill);
    font-size: 0.72rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge--verified {
    background: var(--p-success-soft);
    border-color: var(--p-success-border);
    color: var(--p-success);
}

.badge--provider {
    background: var(--p-accent-soft);
    border-color: var(--p-accent-border);
    color: var(--p-accent-text);
}

.identity-name-block {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.identity-name-block h3 {
    margin: 0;
    font-size: clamp(1.18rem, 2vw, 1.4rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.identity-email {
    font-size: 0.875rem;
    color: var(--p-text-muted);
    transition: color 0.15s;
}

.identity-email:hover { color: var(--p-accent); }
.identity-email.is-unavailable { pointer-events: none; }

.identity-bio {
    margin: 0;
    font-size: 0.875rem;
    color: var(--p-text-muted);
    line-height: 1.6;
}

.identity-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.meta-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 7px 11px;
    background: var(--p-surface-alt);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-sm);
    box-shadow: var(--p-shadow);
}

.meta-chip__label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--p-text-faint);
}

.meta-chip strong {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--p-text);
}

/* Identity aside panel */
.identity-aside {
    display: flex;
    flex-direction: column;
    padding: 18px 20px;
    background: var(--p-surface-alt);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r);
}

.aside-block {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 14px 0;
    border-bottom: 1px solid var(--p-border);
}

.aside-block:first-child { padding-top: 0; }
.aside-block:last-child  { border-bottom: none; padding-bottom: 0; }

.aside-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--p-text-faint);
}

.member-id-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.member-id-value {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--p-text);
}

.copy-feedback {
    font-size: 0.78rem;
    color: var(--p-text-faint);
}

/* Select */
.select-wrap {
    position: relative;
}

.select-wrap select {
    width: 100%;
    height: 38px;
    padding: 0 34px 0 11px;
    font-size: 0.875rem;
    border: 1px solid var(--p-border-strong);
    border-radius: var(--p-r-sm);
    background: var(--p-surface);
    color: var(--p-text);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%239ba3be' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.select-wrap select:focus {
    border-color: var(--p-accent-border);
    box-shadow: 0 0 0 3px var(--p-accent-soft);
}

.aside-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Analytics section ───────────────────────────────────────── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.metric-card {
    padding: 16px 18px;
    background: var(--p-surface-alt);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-sm);
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: var(--p-shadow);
}

.metric-card--primary {
    background: var(--p-accent-soft);
    border-color: var(--p-accent-border);
}

.metric-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--p-text-faint);
}

.metric-card--primary .metric-label { color: var(--p-accent-text); }

.metric-value {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.1;
    color: var(--p-text);
}

.metric-card--primary .metric-value { color: var(--p-accent); }

.metric-note {
    font-size: 0.78rem;
    color: var(--p-text-faint);
    line-height: 1.4;
}

/* Analytics body: chart + time */
.analytics-body {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.chart-panel {
    flex: 1 1 0;
    min-width: 0;
    background: var(--p-surface-alt);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-sm);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--p-shadow);
}

.chart-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.chart-panel-eyebrow {
    display: block;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--p-text-faint);
    margin-bottom: 3px;
}

.chart-panel-head strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--p-text);
}

.chart-badge {
    height: 24px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--p-r-pill);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--p-gold-soft);
    border: 1px solid var(--p-gold-border);
    color: var(--p-gold);
    flex-shrink: 0;
}

.chart-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.credit-chart {
    width: 100%;
    height: auto;
    display: block;
}

.chart-grid line {
    stroke: var(--p-border);
    stroke-width: 1;
}

.chart-area { fill: url(#creditAreaGradient); }

.chart-line {
    fill: none;
    stroke: var(--p-accent);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-x-labels {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    font-size: 0.7rem;
    color: var(--p-text-faint);
    text-align: center;
}

.chart-note {
    margin: 0;
    font-size: 0.79rem;
    color: var(--p-text-faint);
    line-height: 1.5;
}

/* Time metrics panel */
.time-metrics {
    width: 230px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-metric {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 13px 15px;
    background: var(--p-surface-alt);
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-sm);
    box-shadow: var(--p-shadow);
}

.time-metric--highlight {
    background: var(--p-gold-soft);
    border-color: var(--p-gold-border);
}

.time-metric-label {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--p-text-faint);
}

.time-metric--highlight .time-metric-label {
    color: var(--p-gold);
    opacity: 0.8;
}

.time-metric strong {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--p-text);
    line-height: 1.2;
}

.time-metric--highlight strong { color: var(--p-gold); }

.time-metric small {
    font-size: 0.75rem;
    color: var(--p-text-faint);
    line-height: 1.4;
}

/* ── Details form section ────────────────────────────────────── */
.details-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field--full { grid-column: 1 / -1; }

.form-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.835rem;
    font-weight: 600;
    color: var(--p-text-soft);
}

.form-label svg {
    color: var(--p-text-faint);
    flex-shrink: 0;
}

/* Input base */
input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    height: 42px;
    padding: 0 40px 0 13px;
    border: 1px solid var(--p-border-strong);
    border-radius: var(--p-r-sm);
    background: var(--p-surface);
    color: var(--p-text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    width: 100%;
    min-height: 108px;
    padding: 11px 40px 11px 13px;
    border: 1px solid var(--p-border-strong);
    border-radius: var(--p-r-sm);
    background: var(--p-surface);
    color: var(--p-text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus {
    border-color: var(--p-accent-border);
    box-shadow: 0 0 0 3px var(--p-accent-soft);
}

.input-wrap { position: relative; }

.input-wrap--locked input {
    padding-right: 72px;
    background: var(--p-surface-alt);
    color: var(--p-text-muted);
}

.locked-badge {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    height: 20px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--p-r-pill);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: var(--p-surface);
    border: 1px solid var(--p-border);
    color: var(--p-text-faint);
}

.input-action-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--p-border);
    border-radius: var(--p-r-xs);
    background: var(--p-surface);
    color: var(--p-text-faint);
    box-shadow: var(--p-shadow);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.input-action-btn:hover {
    background: var(--p-accent-soft);
    color: var(--p-accent);
    border-color: var(--p-accent-border);
}

.textarea-action-btn {
    top: 9px;
    transform: none;
}

.form-footer {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid var(--p-border);
    margin-top: 2px;
}

.form-status {
    min-height: 34px;
    padding: 6px 13px;
    border-radius: var(--p-r-pill);
    font-size: 0.8rem;
    white-space: normal;
}

/* ── Loading skeletons ───────────────────────────────────────── */
.profile-page--loading [data-loading-block] {
    color: transparent !important;
    border-radius: var(--p-r-xs);
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.05) 0%,
        rgba(0, 0, 0, 0.02) 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: profileShimmer 1.3s linear infinite;
}

.profile-page--loading .badge--provider[data-loading-block],
.profile-page--loading .meta-chip[data-loading-block] {
    border-color: transparent !important;
    background: rgba(0, 0, 0, 0.04) !important;
}

@keyframes profileShimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1060px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .identity-layout {
        grid-template-columns: 1fr;
    }

    .identity-aside {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0;
    }

    .aside-block {
        flex: 1 1 200px;
        border-bottom: none;
        border-right: 1px solid var(--p-border);
        padding: 0 20px;
    }

    .aside-block:first-child { padding-left: 0; }
    .aside-block:last-child  { border-right: none; }

    .analytics-body {
        flex-direction: column;
    }

    .time-metrics {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .time-metric {
        flex: 1 1 calc(50% - 6px);
    }
}

@media (max-width: 760px) {
    .profile-page { padding: 14px; }
    .profile-shell { gap: 12px; }
    .profile-content { gap: 12px; }
    .topbar-nav { padding: 11px 18px; }
    .profile-hero { padding: 20px 20px 18px; }
    .profile-card { padding: 18px 18px 22px; }

    .identity-main {
        flex-direction: column;
    }

    .avatar-block {
        flex-direction: row;
        align-items: center;
    }

    .avatar-hint { max-width: none; text-align: left; }

    .identity-aside {
        flex-direction: column;
        gap: 0;
    }

    .aside-block {
        border-right: none;
        border-bottom: 1px solid var(--p-border);
        padding: 14px 0;
    }

    .aside-block:first-child { padding-top: 0; }
    .aside-block:last-child  { border-bottom: none; padding-bottom: 0; }
}

@media (max-width: 600px) {
    .profile-page { padding: 10px; }

    .topbar-nav {
        flex-wrap: wrap;
        gap: 10px;
    }

    .topbar-actions {
        width: 100%;
    }

    .topbar-link {
        flex: 1;
        justify-content: center;
    }

    .profile-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .time-metric {
        flex: 1 1 100%;
    }

    .details-form {
        grid-template-columns: 1fr;
    }

    .form-field--full { grid-column: auto; }

    .form-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary {
        justify-content: center;
    }

    .avatar-wrap {
        width: 80px;
        height: 80px;
        border-radius: 12px;
    }
}

/* ── Dark mode ───────────────────────────────────────────────── */
[data-theme="dark"] {
    --p-bg:             #0c0e14;
    --p-surface:        #161921;
    --p-surface-alt:    #1c1f2a;
    --p-border:         rgba(255, 255, 255, 0.07);
    --p-border-strong:  rgba(255, 255, 255, 0.11);

    --p-text:           #dde0ec;
    --p-text-soft:      #8891ae;
    --p-text-muted:     #5c647e;
    --p-text-faint:     #3c4258;

    --p-accent:         #7b87e8;
    --p-accent-hover:   #6876d4;
    --p-accent-soft:    rgba(123, 135, 232, 0.10);
    --p-accent-border:  rgba(123, 135, 232, 0.22);
    --p-accent-text:    #9aa5f0;

    --p-danger:         #e06060;
    --p-danger-soft:    rgba(224, 96, 96, 0.10);
    --p-danger-border:  rgba(224, 96, 96, 0.20);

    --p-gold:           #c8a042;
    --p-gold-soft:      rgba(200, 160, 66, 0.10);
    --p-gold-border:    rgba(200, 160, 66, 0.22);

    --p-success:        #40c874;
    --p-success-soft:   rgba(64, 200, 116, 0.10);
    --p-success-border: rgba(64, 200, 116, 0.20);

    --p-shadow:         0 1px 3px rgba(0, 0, 0, 0.22);
    --p-shadow-md:      0 4px 18px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] textarea {
    background: var(--p-surface-alt);
    border-color: var(--p-border-strong);
    color: var(--p-text);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus {
    border-color: var(--p-accent-border);
    box-shadow: 0 0 0 3px var(--p-accent-soft);
}

[data-theme="dark"] .select-wrap select {
    background-color: var(--p-surface-alt);
    border-color: var(--p-border-strong);
    color: var(--p-text);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%233c4258' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

[data-theme="dark"] .avatar-fallback {
    background: rgba(123, 135, 232, 0.12);
    color: var(--p-accent);
}

[data-theme="dark"] .avatar-edit-btn {
    background: rgba(22, 25, 33, 0.92);
    border-color: var(--p-border-strong);
    color: var(--p-text-soft);
}

[data-theme="dark"] .avatar-edit-btn:hover {
    background: var(--p-surface-alt);
    color: var(--p-accent);
}

[data-theme="dark"] .input-action-btn {
    background: var(--p-surface-alt);
    border-color: var(--p-border-strong);
}

[data-theme="dark"] .locked-badge {
    background: var(--p-surface);
    border-color: var(--p-border-strong);
}

[data-theme="dark"] .profile-page--loading [data-loading-block] {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        rgba(255, 255, 255, 0.06) 100%
    );
    background-size: 200% 100%;
    animation: profileShimmer 1.3s linear infinite;
}

[data-theme="dark"] .profile-page--loading .badge--provider[data-loading-block],
[data-theme="dark"] .profile-page--loading .meta-chip[data-loading-block] {
    background: rgba(255, 255, 255, 0.04) !important;
}
