:root{
    --cream:#FBF7F2;
    --ink:#24162F;
    --ink-2:#2C1B3A;
    --muted:#6B5F75;
    --plum:#5B2A86;
    --gold:#D9A441;
    --line:#E9E1F2;
    --green:#1F9D6A;
    --blue:#2563EB;
    --red:#9A4B45;
}

*{
    box-sizing:border-box;
}

html{
    color-scheme:light;
}

body{
    margin:0;
    color:var(--ink);
    font-family:"Segoe UI",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;
    background-color:#FCF7F1;
    background-image:
        radial-gradient(1200px 620px at 10% 8%, rgba(91,42,134,.14), rgba(91,42,134,0) 58%),
        radial-gradient(980px 520px at 88% 10%, rgba(217,164,65,.18), rgba(217,164,65,0) 54%),
        linear-gradient(180deg, #FFFDFB 0%, #FCF7F1 42%, #F2E8DC 100%);
    background-repeat:no-repeat;
    background-attachment:fixed;
}

a{
    color:inherit;
}

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

.shell{
    max-width:1260px;
    margin:0 auto;
    padding:28px 24px 48px;
}

.shell--centered{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:32px 24px;
}

.auth-stage{
    display:inline-block;
    width:min(100%, 560px);
}

.brand-shell{
    display:flex;
    justify-content:center;
    margin-bottom:22px;
}

.brand-shell img{
    height:56px;
}

.panel,
.card{
    background:rgba(255,255,255,.82);
    backdrop-filter:blur(14px);
    -webkit-backdrop-filter:blur(14px);
    border:1px solid rgba(233,225,242,.9);
    border-radius:24px;
    padding:22px;
    box-shadow:0 18px 55px rgba(44,27,58,.10), inset 0 1px 0 rgba(255,255,255,.60);
}

.auth-panel{
    padding:28px 30px;
}

.tone-panel{
    margin-bottom:16px;
    padding:16px;
}

.tone-info{
    background:rgba(37,99,235,.06);
    border-color:rgba(37,99,235,.14);
}

.tone-info .tone-text,
.tone-info strong{
    color:#3056b3;
}

.tone-negative{
    background:rgba(180,35,24,.045);
    border-color:rgba(180,35,24,.14);
}

.tone-negative .tone-text,
.tone-negative strong{
    color:var(--red);
}

.tone-positive{
    background:rgba(31,157,106,.07);
    border-color:rgba(31,157,106,.18);
}

.tone-positive .tone-text,
.tone-positive strong{
    color:#137a52;
}

.eyebrow{
    font-size:12px;
    letter-spacing:.08em;
    text-transform:uppercase;
    font-weight:800;
    color:var(--plum);
}

.page-title{
    margin:0;
    font-size:30px;
    line-height:1.1;
    font-weight:800;
    color:var(--ink);
}

.muted{
    color:var(--muted);
}

.auth-copy{
    max-width:34ch;
    line-height:1.6;
    margin:12px 0 24px;
}

.auth-form{
    display:grid;
    gap:18px;
}

.auth-field{
    display:grid;
    gap:8px;
    justify-items:start;
}

.auth-field input[type="number"],
.auth-field input[type="password"],
.auth-field input[type="text"]{
    width:380px;
    max-width:100%;
    padding:16px 18px;
    font-size:18px;
    border-radius:18px;
    border:1px solid rgba(120,92,66,.18);
    background:#fffaf5;
    box-shadow:0 16px 32px rgba(44,27,58,.08), inset 0 1px 0 rgba(255,255,255,.90);
}

.auth-checkbox{
    display:flex;
    align-items:center;
    gap:12px;
    margin-top:2px;
}

.auth-checkbox input{
    width:18px;
    height:18px;
    accent-color:var(--plum);
}

.auth-action{
    margin-top:4px;
}

.chip-link{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:10px 14px;
    border-radius:999px;
    border:1px solid rgba(233,225,242,1);
    background:rgba(255,255,255,.72);
    color:var(--ink);
    box-shadow:0 10px 24px rgba(44,27,58,.06), inset 0 1px 0 rgba(255,255,255,.80);
    font-weight:650;
    cursor:pointer;
    text-decoration:none;
}

.chip-link:hover{
    background:rgba(255,255,255,.88);
}

.status-pill{
    display:inline-flex;
    align-items:center;
    gap:8px;
    font-weight:700;
}

.status-dot{
    width:10px;
    height:10px;
    border-radius:999px;
    display:inline-block;
    flex:0 0 auto;
}

.status-online{
    color:var(--green);
}

.status-online .status-dot{
    background:var(--green);
    box-shadow:0 0 0 3px rgba(31,157,106,.14);
}

.status-offline{
    color:var(--blue);
}

.status-offline .status-dot{
    background:var(--blue);
    box-shadow:0 0 0 3px rgba(37,99,235,.14);
}

.status-inactive{
    color:#111827;
}

.status-inactive .status-dot{
    background:#111827;
    box-shadow:0 0 0 3px rgba(17,24,39,.10);
}

.otp-group{
    display:flex;
    gap:12px;
    flex-wrap:nowrap;
}

.otp-input{
    width:56px !important;
    height:64px;
    text-align:center;
    padding:0 !important;
    font-size:28px !important;
    font-weight:800;
    border-radius:18px !important;
}

.otp-hidden{
    position:absolute;
    left:-9999px;
    opacity:0;
    pointer-events:none;
}

.dashboard-topbar{
    display:grid;
    grid-template-columns:auto 1fr auto;
    align-items:center;
    gap:24px;
}

.dashboard-topbar__brand{
    display:flex;
    align-items:center;
}

.dashboard-topbar__brand img{
    height:44px;
}

.dashboard-topbar__nav{
    display:flex;
    justify-content:center;
}

.dashboard-topbar__meta{
    display:grid;
    justify-items:end;
    gap:6px;
    text-align:right;
}

.dashboard-topbar__name{
    font-size:26px;
    line-height:1.1;
    font-weight:800;
    color:var(--ink);
}

.dashboard-topbar__actions{
    display:grid;
    justify-items:end;
    gap:10px;
    margin-top:4px;
}

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

.dashboard-nav__link{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:10px 16px;
    border-radius:999px;
    text-decoration:none;
    border:1px solid rgba(233,225,242,1);
    background:rgba(255,255,255,.72);
    color:var(--ink);
    font-weight:700;
    box-shadow:0 10px 24px rgba(44,27,58,.06), inset 0 1px 0 rgba(255,255,255,.80);
}

.dashboard-nav__link.is-active{
    background:linear-gradient(135deg, rgba(91,42,134,.14), rgba(217,164,65,.18));
    border-color:rgba(91,42,134,.24);
}

.dashboard-nav__badge{
    min-width:22px;
    height:22px;
    padding:0 6px;
    border-radius:999px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:var(--plum);
    color:#fff;
    font-size:12px;
    font-weight:800;
}

.dashboard-filterbar{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    align-items:center;
    justify-content:space-between;
}

.dashboard-filterbar__group{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:center;
}

.dashboard-pill{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:10px 14px;
    border-radius:999px;
    text-decoration:none;
    border:1px solid rgba(233,225,242,1);
    background:rgba(255,255,255,.72);
    color:var(--ink);
    font-weight:650;
}

.dashboard-pill.is-active{
    background:linear-gradient(135deg, rgba(91,42,134,.14), rgba(217,164,65,.18));
    border-color:rgba(91,42,134,.24);
}

.dashboard-inline-form{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:center;
}

.dashboard-date-input{
    min-width:220px;
    padding:10px 14px;
    border-radius:14px;
    border:1px solid rgba(233,225,242,1);
    background:rgba(255,255,255,.88);
    color:var(--ink);
}

.dashboard-status-card{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:16px;
    align-items:center;
}

.dashboard-switch{
    display:inline-flex;
    align-items:center;
    gap:12px;
    padding:12px 16px;
    border-radius:999px;
    background:#fffaf5;
    border:1px solid rgba(233,225,242,1);
    box-shadow:0 10px 24px rgba(44,27,58,.06), inset 0 1px 0 rgba(255,255,255,.85);
    cursor:pointer;
    text-align:left;
    color:var(--ink);
}

button.dashboard-switch{
    appearance:none;
}

.dashboard-switch.is-pending{
    opacity:.75;
    pointer-events:none;
}

.dashboard-switch__track{
    width:56px;
    height:32px;
    border-radius:999px;
    background:#d6d3d1;
    position:relative;
    display:inline-block;
}

.dashboard-switch__track::after{
    content:"";
    position:absolute;
    top:4px;
    left:4px;
    width:24px;
    height:24px;
    border-radius:999px;
    background:#fff;
    box-shadow:0 2px 8px rgba(17,24,39,.16);
}

.dashboard-switch__track.is-on{
    background:rgba(31,157,106,.35);
}

.dashboard-switch__track.is-on::after{
    left:28px;
}

.dashboard-switch__track.is-inactive{
    background:rgba(17,24,39,.24);
}

.dashboard-status-feedback{
    padding:12px 14px;
    border-radius:14px;
    font-weight:700;
    border:1px solid rgba(233,225,242,1);
    background:rgba(255,255,255,.72);
    color:var(--ink);
}

.dashboard-status-feedback.is-pending{
    background:rgba(37,99,235,.06);
    border-color:rgba(37,99,235,.14);
    color:#3056b3;
}

.dashboard-status-feedback.is-error{
    background:rgba(180,35,24,.045);
    border-color:rgba(180,35,24,.14);
    color:var(--red);
}

.dashboard-status-feedback.is-success{
    background:rgba(31,157,106,.07);
    border-color:rgba(31,157,106,.18);
    color:#137a52;
}

.dashboard-section-grid{
    display:grid;
    grid-template-columns:1.65fr 1fr;
    gap:16px;
}

.dashboard-empty{
    padding:22px;
    border-radius:18px;
    background:rgba(255,255,255,.5);
    border:1px dashed rgba(107,95,117,.26);
    color:var(--muted);
}

.dashboard-field-label{
    display:block;
    margin-bottom:8px;
    font-size:12px;
    letter-spacing:.04em;
    text-transform:uppercase;
    color:var(--muted);
    font-weight:800;
}

.dashboard-text-input,
.dashboard-message-textarea{
    width:100%;
    padding:14px 16px;
    border-radius:16px;
    border:1px solid rgba(233,225,242,.95);
    background:rgba(255,255,255,.82);
    color:var(--ink);
}

.dashboard-message-textarea{
    min-height:120px;
    resize:vertical;
}

.dashboard-text-input:focus,
.dashboard-message-textarea:focus,
.dashboard-date-input:focus{
    outline:none;
    border-color:rgba(91,42,134,.36);
    box-shadow:0 0 0 4px rgba(91,42,134,.08);
}

.dashboard-meta-list{
    display:grid;
    gap:12px;
}

.dashboard-meta-list dt{
    font-size:12px;
    letter-spacing:.04em;
    text-transform:uppercase;
    color:var(--muted);
    font-weight:800;
}

.dashboard-meta-list dd{
    margin:4px 0 0;
}

.dashboard-stats-block{
    display:grid;
    gap:18px;
}

.dashboard-stats-main{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:18px;
}

.dashboard-stat{
    display:grid;
    gap:8px;
}

.dashboard-stat__label{
    font-size:12px;
    letter-spacing:.04em;
    text-transform:uppercase;
    color:var(--muted);
    font-weight:800;
}

.dashboard-stat__value{
    font-size:30px;
    line-height:1.1;
    font-weight:800;
    color:var(--ink);
}

.dashboard-stats-divider{
    height:1px;
    background:rgba(233,225,242,.9);
}

.dashboard-stats-detail{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px 24px;
}

.dashboard-detail-row{
    display:flex;
    justify-content:space-between;
    gap:16px;
    padding:10px 0;
    border-bottom:1px solid rgba(233,225,242,.72);
}

.dashboard-detail-row span{
    color:var(--muted);
}

.dashboard-detail-row strong{
    font-weight:800;
    color:var(--ink);
}

.dashboard-combined-grid{
    display:grid;
    grid-template-columns:minmax(0,1.35fr) minmax(320px,1fr);
    gap:24px;
}

.dashboard-combined-side{
    display:grid;
    gap:20px;
}

.dashboard-earnings-summary{
    display:grid;
    gap:12px;
}

.dashboard-earnings-total{
    display:flex;
    position:relative;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    padding:18px 20px;
    border-radius:20px;
    background:linear-gradient(135deg, rgba(91,42,134,.12), rgba(217,164,65,.18));
    border:1px solid rgba(91,42,134,.14);
}

.dashboard-earnings-total__copy{
    display:grid;
    gap:8px;
}

.dashboard-earnings-total .label,
.dashboard-earnings-card .label,
.dashboard-message-sidecard .label{
    display:block;
    font-size:12px;
    letter-spacing:.04em;
    text-transform:uppercase;
    color:var(--muted);
    font-weight:800;
}

.dashboard-earnings-total .value{
    display:block;
    font-size:36px;
    line-height:1;
    font-weight:800;
    color:var(--ink);
}

.dashboard-special-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:34px;
    padding:8px 14px;
    border-radius:999px;
    position:absolute;
    top:0;
    right:30px;
    float:right;
    margin-top:65px;
    transform:rotate(-15deg);
    z-index:2;
    background:
        linear-gradient(135deg, rgba(255,247,214,.98), rgba(227,184,71,.95));
    border:1px solid rgba(171,123,24,.58);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.75),
        0 10px 24px rgba(181,132,32,.22);
    color:#704b07;
    font-size:12px;
    font-weight:900;
    letter-spacing:.08em;
    text-transform:uppercase;
    white-space:nowrap;
}

.dashboard-special-note{
    display:grid;
    gap:4px;
    padding:12px 14px;
    border-radius:16px;
    background:linear-gradient(180deg, rgba(255,250,231,.92), rgba(250,238,198,.86));
    border:1px solid rgba(214,183,94,.48);
    color:#5c4314;
}

.dashboard-special-note strong{
    font-size:14px;
    line-height:1.3;
}

.dashboard-special-note span{
    font-size:13px;
    line-height:1.45;
    color:rgba(92,67,20,.82);
}

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

.dashboard-earnings-card,
.dashboard-message-sidecard{
    padding:14px 16px;
    border-radius:16px;
    background:rgba(255,255,255,.62);
    border:1px solid rgba(233,225,242,.9);
}

.dashboard-earnings-card .value,
.dashboard-message-sidecard .value{
    display:block;
    margin-top:6px;
    font-size:20px;
    font-weight:800;
    color:var(--ink);
}

.dashboard-tier-table{
    width:100%;
    border-collapse:collapse;
}

.dashboard-tier-table td:last-child,
.dashboard-tier-table th:last-child{
    text-align:right;
}

.dashboard-tier-status{
    font-weight:700;
    color:var(--muted);
}

.dashboard-tier-status.is-active{
    color:var(--plum);
}

.dashboard-message-grid{
    display:grid;
    grid-template-columns:360px minmax(0,1fr);
    gap:20px;
}

.dashboard-message-list,
.dashboard-message-posts,
.dashboard-message-composer,
.dashboard-message-reply,
.dashboard-message-meta{
    display:grid;
    gap:12px;
}

.dashboard-message-thread{
    display:grid;
    gap:8px;
    padding:16px 18px;
    border-radius:18px;
    text-decoration:none;
    color:var(--ink);
    background:rgba(255,255,255,.7);
    border:1px solid rgba(233,225,242,.9);
}

.dashboard-message-thread.is-active{
    background:linear-gradient(135deg, rgba(91,42,134,.10), rgba(217,164,65,.14));
    border-color:rgba(91,42,134,.2);
}

.dashboard-message-thread.is-unread{
    border-color:rgba(91,42,134,.34);
    box-shadow:0 10px 24px rgba(91,42,134,.08);
}

.dashboard-message-thread__meta,
.dashboard-message-post__meta{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    align-items:center;
    justify-content:space-between;
}

.dashboard-message-thread__title,
.dashboard-message-post__author{
    font-weight:800;
}

.dashboard-message-pill{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:6px 10px;
    border-radius:999px;
    background:rgba(91,42,134,.08);
    color:var(--plum);
    font-size:12px;
    font-weight:800;
}

.dashboard-message-unread{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:5px 9px;
    border-radius:999px;
    background:rgba(31,157,106,.12);
    color:var(--green);
    font-size:12px;
    font-weight:800;
}

.dashboard-message-actions{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    align-items:center;
    justify-content:space-between;
}

.dashboard-message-post{
    padding:18px;
    border-radius:18px;
    background:rgba(255,255,255,.66);
    border:1px solid rgba(233,225,242,.9);
}

.dashboard-message-post.is-starter{
    background:linear-gradient(135deg, rgba(91,42,134,.08), rgba(217,164,65,.12));
}

.dashboard-message-post__body{
    white-space:pre-wrap;
    line-height:1.6;
}

.dashboard-message-media{
    margin-top:12px;
    border-radius:18px;
    overflow:hidden;
    border:1px solid rgba(233,225,242,.9);
    background:#fff;
}

.dashboard-message-media img,
.dashboard-message-media video{
    display:block;
    max-width:100%;
    width:100%;
    height:auto;
    background:#000;
}

.dashboard-message-empty{
    padding:26px;
    border-radius:18px;
    background:rgba(255,255,255,.58);
    border:1px dashed rgba(107,95,117,.26);
    color:var(--muted);
}

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

.media-card{
    border:1px solid rgba(233,225,242,.9);
    border-radius:20px;
    padding:16px;
    background:rgba(255,255,255,.78);
}

.media-thumb{
    width:100%;
    aspect-ratio:3/4;
    object-fit:cover;
    border-radius:16px;
    background:#efe7f6;
}

.kv{
    display:grid;
    grid-template-columns:auto 1fr;
    gap:8px 12px;
}

.state-badge{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:8px 12px;
    border-radius:999px;
    font-size:13px;
    font-weight:700;
}

.state-ready{
    background:rgba(142,209,168,.18);
    color:#23543a;
}

.state-sources{
    background:rgba(112,170,214,.16);
    color:#1f4f74;
}

.state-missing{
    background:rgba(182,120,120,.12);
    color:#7a3c3c;
}

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

.table th,
.table td{
    padding:14px 12px;
    border-bottom:1px solid rgba(233,225,242,.9);
    text-align:left;
}

.table th{
    font-size:12px;
    letter-spacing:.04em;
    text-transform:uppercase;
    color:var(--muted);
    font-weight:800;
}

.table tr:last-child td{
    border-bottom:none;
}

@media (max-width: 1024px){
    .dashboard-section-grid,
    .dashboard-combined-grid,
    .dashboard-message-grid,
    .dashboard-stats-main,
    .dashboard-stats-detail,
    .dashboard-earnings-grid,
    .media-grid{
        grid-template-columns:1fr;
    }

    .dashboard-topbar{
        grid-template-columns:1fr;
        justify-items:center;
        text-align:center;
    }

    .dashboard-topbar__nav,
    .dashboard-topbar__meta{
        justify-content:center;
        justify-items:center;
        text-align:center;
    }

    .dashboard-topbar__actions{
        justify-items:center;
    }
}

@media (max-width: 640px){
    .shell{
        padding:20px 16px 32px;
    }

    .shell--centered{
        padding:24px 18px;
    }

    .auth-panel{
        padding:24px 20px;
    }

    .auth-field input[type="number"],
    .auth-field input[type="password"],
    .auth-field input[type="text"]{
        width:100%;
        font-size:17px;
    }

    .otp-group{
        gap:8px;
    }

    .otp-input{
        width:44px !important;
        height:54px;
        font-size:24px !important;
    }

    .dashboard-nav__link,
    .dashboard-pill,
    .chip-link{
        width:100%;
        justify-content:center;
    }

    .dashboard-filterbar,
    .dashboard-filterbar__group,
    .dashboard-message-actions{
        align-items:stretch;
    }

    .dashboard-date-input{
        min-width:0;
        width:100%;
    }

    .dashboard-status-card{
        grid-template-columns:1fr;
    }
}
