/* =========================================================
   SOCIAL SAAS - AUTHENTICATION UI
   ========================================================= */

* {
    box-sizing: border-box;
}

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

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: #f5f7fb;
    color: #172033;
}

/* =========================================================
   AUTH PAGE
   ========================================================= */

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 15% 15%,
            rgba(124, 92, 255, 0.08),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            #f8f9fd 0%,
            #f1f3f9 100%
        );
}

.auth-shell {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px 20px;
}

/* =========================================================
   AUTH CARD
   ========================================================= */

.auth-card {
    width: 100%;
    max-width: 520px;

    background: #ffffff;

    border: 1px solid #e5e8f0;

    border-radius: 24px;

    padding: 42px 48px 40px;

    box-shadow:
        0 30px 70px rgba(24, 32, 56, 0.10),
        0 8px 25px rgba(24, 32, 56, 0.05);
}

/* =========================================================
   BRAND
   ========================================================= */

.auth-brand {
    display: flex;
    align-items: center;

    gap: 13px;

    margin-bottom: 38px;
}

.brand-icon {
    width: 46px;
    height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    border-radius: 13px;

    background: linear-gradient(
        135deg,
        #6d4aff,
        #9257ff
    );

    color: #ffffff;

    font-size: 21px;
    font-weight: 800;

    box-shadow:
        0 10px 25px rgba(111, 74, 255, 0.28);
}

.brand-content {
    display: flex;
    flex-direction: column;

    gap: 3px;
}

.brand-name {
    font-size: 19px;
    font-weight: 800;

    line-height: 1.2;

    color: #172033;
}

.brand-tagline {
    font-size: 13px;

    line-height: 1.3;

    color: #8991a5;
}

/* =========================================================
   LOGIN CONTENT
   ========================================================= */

.login-content {
    width: 100%;
}

.eyebrow {
    margin-bottom: 10px;

    color: #7557ff;

    font-size: 13px;
    font-weight: 700;

    letter-spacing: 0.03em;
}

.login-content h1 {
    margin: 0;

    font-size: 40px;
    line-height: 1.15;

    font-weight: 800;

    color: #111827;
}

.login-description {
    margin: 12px 0 30px;

    font-size: 15px;
    line-height: 1.6;

    color: #7d879c;
}

/* =========================================================
   FORM
   ========================================================= */

.login-form {
    display: flex;
    flex-direction: column;

    gap: 21px;
}

.form-group {
    display: flex;
    flex-direction: column;

    gap: 9px;
}

.form-group label {
    font-size: 14px;
    font-weight: 700;

    color: #172033;
}

.form-group input {
    width: 100%;

    height: 54px;

    padding: 0 16px;

    border: 1px solid #dfe3ec;

    border-radius: 12px;

    background: #ffffff;

    color: #172033;

    font-size: 15px;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.form-group input::placeholder {
    color: #a6adbc;
}

.form-group input:focus {
    border-color: #7757ff;

    box-shadow:
        0 0 0 4px rgba(119, 87, 255, 0.10);

    background: #ffffff;
}

/* =========================================================
   BUTTON
   ========================================================= */

.login-button {
    width: 100%;

    height: 54px;

    margin-top: 3px;

    border: 0;

    border-radius: 12px;

    background: linear-gradient(
        135deg,
        #7050ff,
        #8b55f6
    );

    color: #ffffff;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 12px 24px rgba(111, 80, 255, 0.25);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.login-button:hover {
    transform: translateY(-1px);

    box-shadow:
        0 15px 28px rgba(111, 80, 255, 0.32);
}

.login-button:active {
    transform: translateY(0);
}

/* =========================================================
   LINKS
   ========================================================= */

.auth-links {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 25px;
}

.auth-links a {
    color: #6850ee;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    padding: 12px 14px;

    margin-bottom: 20px;

    border-radius: 10px;

    font-size: 14px;
}

.alert-error {
    color: #a61b2b;

    background: #fff1f2;

    border: 1px solid #fecdd3;
}

.alert-success {
    color: #166534;

    background: #f0fdf4;

    border: 1px solid #bbf7d0;
}

/* =========================================================
   VALIDATION
   ========================================================= */

.errors {
    margin-bottom: 20px;

    padding: 12px 15px;

    border-radius: 10px;

    background: #fff1f2;

    color: #a61b2b;

    font-size: 14px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .auth-shell {
        padding: 20px 14px;
    }

    .auth-card {
        padding: 30px 24px;

        border-radius: 20px;
    }

    .auth-brand {
        margin-bottom: 30px;
    }

    .login-content h1 {
        font-size: 34px;
    }

    .auth-links {
        gap: 15px;
    }
}

/* =========================================================
   SOCIALFLOW APPLICATION UI
   ========================================================= */

:root {
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-soft: #fafbff;
    --text: #172033;
    --muted: #7d879c;
    --line: #e7e9f1;
    --primary: #6d4aff;
    --primary-dark: #5a38e8;
    --purple-soft: #f0ecff;
    --green: #18a66a;
    --orange: #ed8a2f;
    --blue: #367cf5;
    --danger: #dc3545;
    --shadow: 0 16px 40px rgba(27, 36, 65, .07);
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

/* APP SHELL */

.shell {
    min-height: 100vh;
    display: flex;
    background: var(--bg);
}

.sidebar {
    width: 260px;
    flex: 0 0 260px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
    background: #fff;
    border-right: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 10px 25px;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    color: #fff;
    font-weight: 800;
    font-size: 19px;
    background: linear-gradient(135deg, #6545f5, #9156ff);
    box-shadow: 0 10px 24px rgba(109, 74, 255, .25);
}

.brand > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand b {
    font-size: 17px;
    line-height: 1.2;
}

.brand small,
.top small,
.top-user small {
    color: var(--muted);
    font-size: 12px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 12px;
    border-radius: 10px;
    color: #5f687d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: .18s ease;
}

.nav span:first-child {
    width: 19px;
    text-align: center;
    font-size: 16px;
}

.nav:hover,
.nav.active {
    color: var(--primary);
    background: var(--purple-soft);
}

.nav-label {
    margin: 22px 12px 6px;
    color: #a1a8b7;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
}

.trial {
    margin-top: auto;
    padding: 15px;
    border-radius: 14px;
    background: linear-gradient(145deg, #f5f1ff, #fbfaff);
    border: 1px solid #e7defe;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trial b {
    font-size: 13px;
}

.trial small {
    color: var(--muted);
    font-size: 11px;
}

.trial a {
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.main {
    min-width: 0;
    flex: 1;
}

.top {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 0 34px;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
}

.top > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.top > div:first-child b {
    font-size: 15px;
}

.top-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-user > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.top-user > a {
    margin-left: 12px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #6d4aff, #8f5bff);
    font-weight: 800;
}

.page {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 34px;
}

/* PAGE HERO */

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.hero h1 {
    margin: 5px 0 8px;
    color: #111827;
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.12;
    letter-spacing: -.025em;
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.eyebrow {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
}

/* BUTTONS */

.btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 17px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #4f586b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(31, 39, 63, .08);
}

.btn.primary {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #6d4aff, #8654ff);
    box-shadow: 0 10px 22px rgba(109, 74, 255, .20);
}

.btn.primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), #7945ed);
}

.btn.wide {
    width: 100%;
}

/* CARDS */

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat {
    position: relative;
    min-height: 155px;
    padding: 21px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.cards .stat {
    display: flex;
    flex-direction: column;
}

.stat .icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 11px;
    font-weight: 800;
}

.icon.purple {
    color: #6845ed;
    background: #f0ebff;
}

.icon.orange {
    color: #d9781d;
    background: #fff1e5;
}

.icon.green {
    color: #15905c;
    background: #e7f8f0;
}

.icon.blue {
    color: #2d6bd7;
    background: #eaf2ff;
}

.stat small {
    color: var(--muted);
    font-size: 12px;
}

.stat strong {
    margin: 4px 0 2px;
    color: #121a2a;
    font-size: 29px;
    line-height: 1;
}

.stat em {
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
}

/* PANELS */

.grid2 {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
    gap: 18px;
}

.grid2 > div {
    min-width: 0;
}

.panel {
    margin-bottom: 18px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-head h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.panel-head small {
    color: var(--muted);
    font-size: 12px;
}

.badge {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f0ebff;
    color: #6544df;
    font-size: 11px;
    font-weight: 800;
}

/* DETAILS */

.health,
.details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--line);
}

.health > div,
.details > div {
    min-height: 78px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding: 14px;
    background: #fff;
}

.health span,
.details span {
    color: var(--muted);
    font-size: 11px;
}

.health b,
.details b {
    color: #182135;
    font-size: 15px;
}

/* PLAN / QUICK ACTION CARDS */

.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.plan-card {
    display: block;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition: .18s ease;
}

.plan-card:hover {
    border-color: #d8cdfd;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(28, 35, 58, .07);
}

.plan-card h3 {
    margin: 8px 0 7px;
    font-size: 15px;
}

.plan-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.plan-price {
    margin: 12px 0;
    font-size: 27px;
    font-weight: 800;
}

.plan-price small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

/* TABLE */

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

th {
    color: #8a93a5;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

td b,
td small {
    display: block;
}

td small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.status {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 999px;
    background: #f0f2f7;
    color: #667085;
    font-size: 11px;
    font-weight: 800;
}

.status.published,
.status.active,
.status.approved {
    background: #e9f8f1;
    color: #16865a;
}

.status.scheduled,
.status.pending,
.status.trialing {
    background: #fff4e8;
    color: #bf6b1c;
}

.status.draft {
    background: #eef2ff;
    color: #5369b8;
}

.status.failed,
.status.cancelled {
    background: #fff0f1;
    color: #bd2d3d;
}

/* EMPTY STATE */

.empty {
    padding: 42px 20px;
    text-align: center;
    color: var(--muted);
}

.empty-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    border-radius: 14px;
    background: #f1efff;
    color: var(--primary);
    font-size: 20px;
}

.empty b,
.empty small {
    display: block;
}

.empty b {
    margin-bottom: 5px;
    color: #293248;
}

.empty small {
    font-size: 12px;
}

/* FORMS */

.form-panel {
    max-width: 100%;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

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

label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    color: #30394d;
    font-size: 13px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #dfe3ec;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: #172033;
    font-size: 14px;
    transition: .18s ease;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #9c87f7;
    box-shadow: 0 0 0 3px rgba(109, 74, 255, .10);
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.check input {
    width: auto;
    min-height: auto;
}

.flash {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
}

.flash.success {
    color: #166534;
    background: #effbf4;
    border: 1px solid #b9ebcd;
}

.flash.error {
    color: #a61b2b;
    background: #fff1f2;
    border: 1px solid #fecdd3;
}

.errors {
    margin-bottom: 18px;
    padding: 12px 15px;
    border-radius: 10px;
    background: #fff1f2;
    color: #a61b2b;
    font-size: 13px;
}

.errors ul,
.alert ul {
    margin: 0;
    padding-left: 18px;
}

/* TIMELINE */

.timeline {
    display: flex;
    flex-direction: column;
}

.timeline-item {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.timeline-item:last-child {
    border-bottom: 0;
}

.timeline-item time {
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.timeline-item b,
.timeline-item span {
    display: block;
}

.timeline-item span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

/* RESPONSIVE */

@media (max-width: 1100px) {
    .sidebar {
        width: 220px;
        flex-basis: 220px;
    }

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

    .grid2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .shell {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .sidebar nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-label {
        grid-column: 1 / -1;
        margin-top: 12px;
    }

    .trial {
        margin-top: 18px;
    }

    .top {
        height: auto;
        min-height: 70px;
        padding: 15px 18px;
    }

    .top-user > span:nth-child(2) {
        display: none;
    }

    .page {
        padding: 22px 16px;
    }

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

    .cards,
    .plan-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

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

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

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 7px;
    }
}

/* =========================================================
   ACCESSIBILITY / POLISH
   ========================================================= */

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

::selection {
    background: var(--purple-soft);
    color: var(--primary-dark);
}

* {
    scrollbar-color: #cfd3e6 transparent;
}

.btn[disabled] {
    cursor: not-allowed;
    opacity: .55;
}

.btn[disabled]:hover {
    transform: none;
    box-shadow: none;
}

.btn.sm {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

code {
    padding: 2px 6px;
    border-radius: 6px;
    background: #f1f2f8;
    color: #4c3fb0;
    font-size: 11px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* =========================================================
   BADGES (variants)
   ========================================================= */

.badge.sm {
    padding: 4px 8px;
    font-size: 10px;
}

.badge.lg {
    padding: 9px 14px;
    font-size: 13px;
}

.badge.success {
    background: #e6f8ef;
    color: #158c56;
}

.badge.warn {
    background: #fff2e0;
    color: #b4680f;
}

.badge.info {
    background: #eaf2ff;
    color: #2d6bd7;
}

/* =========================================================
   METERS / USAGE
   ========================================================= */

.usage-panel .panel-head {
    margin-bottom: 12px;
}

.meter {
    height: 10px;
    margin: 10px 0 8px;
    border-radius: 999px;
    overflow: hidden;
    background: #eef0f7;
}

.meter.sm {
    height: 7px;
    margin: 6px 0 0;
}

.meter-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), #8f5bff);
    transition: width .3s ease;
}

.meter-fill.full {
    background: linear-gradient(90deg, #ed8a2f, #dc3545);
}

.meter-note {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.meter-note a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.meter-note.error {
    color: #a61b2b;
}

.usage-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 6px;
}

.usage-item {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.usage-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.usage-item-head b {
    color: #182135;
    font-size: 13px;
}

.feature-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.feature-pill.on {
    background: #e6f8ef;
    color: #158c56;
}

.feature-pill.off {
    background: #f4f5f9;
    color: #9aa1b3;
}

/* =========================================================
   PROVIDER / CONNECT CARDS
   ========================================================= */

.provider-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.provider-card {
    display: flex;
    flex-direction: column;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    transition: .18s ease;
}

.provider-card:not(.is-disabled):hover {
    border-color: #d8cdfd;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(28, 35, 58, .07);
}

.provider-card.is-disabled {
    background: var(--surface-soft);
}

.provider-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.provider-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--purple-soft);
    color: var(--primary);
    font-weight: 800;
}

.provider-card h3 {
    margin: 2px 0 4px;
    font-size: 15px;
}

.provider-card p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    flex: 1;
}

.provider-hint {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
    text-align: center;
}

/* =========================================================
   PLAN CARD BADGE (billing)
   ========================================================= */

.plan-card {
    position: relative;
}

.plan-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    padding: 5px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6d4aff, #8654ff);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .05em;
    box-shadow: 0 8px 18px rgba(109, 74, 255, .25);
}

.plan-card.selected {
    border-color: #c8b8ff;
    box-shadow: 0 0 0 3px rgba(109, 74, 255, .12);
}

.current-plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 24px 26px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(145deg, #faf8ff, #ffffff);
    box-shadow: var(--shadow);
}

.current-plan h2 {
    margin: 4px 0 6px;
    font-size: 24px;
}

.current-plan p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.current-plan .price {
    font-size: 30px;
    font-weight: 800;
    color: #182135;
    text-align: right;
}

.current-plan .price small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

/* =========================================================
   CONNECTED ACCOUNT LIST (dashboard)
   ========================================================= */

.account-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 8px;
    border-radius: 10px;
    transition: background .15s ease;
}

.account-row:hover {
    background: var(--surface-soft);
}

.account-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--purple-soft);
    color: var(--primary);
    font-weight: 800;
    font-size: 13px;
}

.account-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.account-meta b {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-meta small {
    color: var(--muted);
    font-size: 11px;
}

.member-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 8px;
    border-radius: 10px;
    transition: background .15s ease;
}

.member-row:hover {
    background: var(--surface-soft);
}

/* =========================================================
   MEDIA LIBRARY
   ========================================================= */

.dropzone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    margin-bottom: 16px;
    padding: 20px;
    border: 2px dashed #d7dbe8;
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: .18s ease;
}

.dropzone:hover {
    border-color: #b8a6ff;
    color: var(--primary);
    background: var(--purple-soft);
}

.dropzone input {
    display: none;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.media-tile {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.media-tile img {
    display: block;
    width: 100%;
    height: 110px;
    object-fit: cover;
    background: var(--surface-soft);
}

.media-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 110px;
    background: var(--purple-soft);
    color: var(--primary);
    font-size: 22px;
}

.media-tile-meta {
    padding: 9px 10px;
}

.media-tile-meta b {
    display: block;
    overflow: hidden;
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.media-tile-meta small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

/* =========================================================
   LIVE INDICATOR
   ========================================================= */

.hero-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 rgba(24, 166, 106, .5);
    animation: live-pulse 2s infinite;
}

.live-indicator.is-stale .live-dot {
    background: #cbd0dd;
    animation: none;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(24, 166, 106, .45);
    }

    70% {
        box-shadow: 0 0 0 7px rgba(24, 166, 106, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(24, 166, 106, 0);
    }
}

/* =========================================================
   MOBILE SIDEBAR TOGGLE
   ========================================================= */

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 20;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow);
    font-size: 17px;
}

@media (max-width: 760px) {
    .sidebar-toggle {
        display: flex;
    }

    .sidebar nav {
        display: none;
    }

    .shell.sidebar-open .sidebar nav {
        display: grid;
    }

    .trial {
        display: none;
    }

    .shell.sidebar-open .trial {
        display: flex;
    }

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

    .current-plan {
        flex-direction: column;
        align-items: flex-start;
    }

    .current-plan .price {
        text-align: left;
    }

    .provider-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .usage-grid,
    .provider-grid {
        grid-template-columns: 1fr;
    }
}
