:root {
    --bg: #07070a;
    --panel: rgba(20, 20, 27, .72);
    --panel-strong: rgba(27, 27, 36, .88);
    --border: rgba(255, 255, 255, .09);
    --text: #f7f7fa;
    --muted: #9999a8;
    --muted-2: #686875;
    --orange: #ff7a18;
    --pink: #ff3d9a;
    --purple: #8b5cf6;
    --green: #35d49a;
    --danger: #ff5470;
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 85% 10%, rgba(139, 92, 246, .13), transparent 30%),
        radial-gradient(circle at 20% 80%, rgba(255, 61, 154, .08), transparent 30%),
        var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    min-height: 100vh;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 245px;
    min-height: 100vh;
    padding: 28px 18px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    border-right: 1px solid var(--border);
    background: rgba(8, 8, 11, .78);
    backdrop-filter: blur(25px);
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 30px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 20px;
    background: linear-gradient(135deg, var(--orange), var(--pink), var(--purple));
    box-shadow: 0 10px 35px rgba(255, 61, 154, .22);
}

.brand strong,
.brand span {
    display: block;
}

.brand strong {
    font-size: 16px;
}

.brand span {
    color: var(--muted);
    font-size: 11px;
    margin-top: 3px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 13px;
    padding: 12px 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: .2s ease;
}

.nav-item:hover,
.nav-item.active {
    color: white;
    background: rgba(255, 255, 255, .07);
}

.nav-item.active {
    box-shadow: inset 2px 0 0 var(--pink);
}

.sidebar-bottom {
    margin-top: auto;
    padding: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .035);
    border-radius: 16px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.sidebar-bottom small,
.sidebar-bottom strong {
    display: block;
}

.sidebar-bottom small {
    color: var(--muted-2);
    font-size: 10px;
}

.sidebar-bottom strong {
    font-size: 12px;
    margin-top: 3px;
}

.status-dot {
    width: 9px;
    height: 9px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(53, 212, 154, .7);
}

.main {
    width: calc(100% - 245px);
    margin-left: 245px;
    padding: 35px;
    max-width: 1600px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
}

.eyebrow {
    color: var(--pink);
    font-size: 10px;
    letter-spacing: .2em;
    font-weight: 700;
    margin: 0 0 8px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(25px, 3vw, 34px);
    letter-spacing: -.04em;
}

h2 {
    font-size: 23px;
    letter-spacing: -.025em;
    margin-bottom: 8px;
}

h3 {
    margin-bottom: 7px;
}

p {
    color: var(--muted);
    line-height: 1.6;
}

.top-actions {
    display: flex;
    gap: 10px;
}

.button {
    border: 1px solid var(--border);
    color: white;
    border-radius: 13px;
    padding: 11px 17px;
    font-weight: 600;
    transition: .2s ease;
    background: rgba(255, 255, 255, .05);
}

.button:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, .18);
}

.button.primary {
    border: 0;
    background: linear-gradient(100deg, var(--orange), var(--pink));
    box-shadow: 0 10px 30px rgba(255, 61, 154, .17);
}

.button.secondary {
    background: rgba(255, 255, 255, .055);
}

.button.full {
    width: 100%;
    margin-top: 10px;
}

.glass {
    border: 1px solid var(--border);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, .065),
        rgba(255, 255, 255, .025)
    );
    box-shadow:
        0 25px 80px rgba(0, 0, 0, .22),
        inset 0 1px 0 rgba(255, 255, 255, .025);
    backdrop-filter: blur(24px);
}

.mailbox-hero {
    padding: 30px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.mailbox-hero::after {
    content: "";
    width: 300px;
    height: 300px;
    position: absolute;
    right: -130px;
    top: -150px;
    border-radius: 50%;
    background: rgba(139, 92, 246, .13);
    filter: blur(30px);
    pointer-events: none;
}

.hero-copy {
    max-width: 650px;
}

.hero-copy p {
    max-width: 620px;
    margin-bottom: 24px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #ff9bc9;
    font-size: 10px;
    letter-spacing: .15em;
    font-weight: 800;
    margin-bottom: 12px;
}

.email-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(0, 0, 0, .25);
    max-width: 760px;
}

.email-value {
    flex: 1;
    min-width: 0;
    padding: 10px 13px;
    overflow: hidden;
}

.email-value span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 15px;
}

.copy-button {
    border: 0;
    border-radius: 11px;
    background: white;
    color: #101014;
    font-weight: 700;
    padding: 10px 17px;
}

.copy-button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.mailbox-meta {
    display: flex;
    gap: 10px;
    margin-top: 17px;
    flex-wrap: wrap;
}

.mailbox-meta > div {
    min-width: 145px;
    padding: 12px 14px;
    border-radius: 13px;
    background: rgba(0, 0, 0, .18);
    border: 1px solid rgba(255, 255, 255, .06);
}

.mailbox-meta span,
.mailbox-meta strong {
    display: block;
}

.mailbox-meta span {
    color: var(--muted-2);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.mailbox-meta strong {
    margin-top: 4px;
    font-size: 13px;
}

#countdown {
    color: #ff9b61;
}

.controls-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    margin: 20px 0 28px;
}

.select-group label,
.modal-card label,
.auth-grid label {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin: 0 0 7px;
}

select,
input {
    width: 100%;
    border: 1px solid var(--border);
    outline: none;
    color: white;
    background: rgba(255, 255, 255, .045);
    border-radius: 12px;
    padding: 12px 13px;
}

select:focus,
input:focus {
    border-color: rgba(255, 61, 154, .55);
    box-shadow: 0 0 0 3px rgba(255, 61, 154, .08);
}

select option {
    background: #18181f;
    color: white;
}

.refresh-btn {
    align-self: end;
    white-space: nowrap;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-heading h2 {
    margin-bottom: 3px;
}

.section-heading p {
    font-size: 12px;
    margin: 0;
}

.count-pill {
    min-width: 32px;
    height: 28px;
    padding: 0 9px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    color: #ff9bc9;
    background: rgba(255, 61, 154, .1);
    border: 1px solid rgba(255, 61, 154, .17);
    font-size: 12px;
    font-weight: 700;
}

.inbox {
    min-height: 300px;
    border-radius: var(--radius);
    overflow: hidden;
}

.empty-state {
    min-height: 300px;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 30px;
}

.empty-state p {
    max-width: 440px;
    font-size: 13px;
}

.empty-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, .055);
    color: #aaaab8;
    font-size: 25px;
}

.email-row {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    cursor: pointer;
    transition: background .2s ease;
}

.email-row:hover {
    background: rgba(255, 255, 255, .035);
}

.email-row:last-child {
    border-bottom: 0;
}

.email-row-top {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.email-from {
    font-weight: 650;
}

.email-time {
    color: var(--muted-2);
    font-size: 11px;
}

.email-subject {
    color: #dddde5;
    margin-top: 6px;
    font-size: 13px;
}

.email-preview {
    color: var(--muted);
    margin-top: 5px;
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.page-card {
    padding: 30px;
    border-radius: var(--radius);
    max-width: 800px;
}

.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0 20px;
}

.form-message {
    min-height: 22px;
    margin-top: 12px;
    color: #ff9bc9;
    font-size: 12px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px;
    margin-top: 25px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(255, 255, 255, .03);
}

.setting-row strong,
.setting-row span {
    display: block;
}

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

.switch input {
    display: none;
}

.switch span {
    width: 45px;
    height: 25px;
    border-radius: 20px;
    display: block;
    position: relative;
    background: #30303a;
    cursor: pointer;
}

.switch span::after {
    content: "";
    position: absolute;
    width: 19px;
    height: 19px;
    top: 3px;
    left: 3px;
    background: white;
    border-radius: 50%;
    transition: .2s;
}

.switch input:checked + span {
    background: linear-gradient(90deg, var(--orange), var(--pink));
}

.switch input:checked + span::after {
    left: 23px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal.hidden,
.hidden {
    display: none !important;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(8px);
}

.modal-card {
    width: min(430px, 100%);
    padding: 30px;
    border-radius: 22px;
    position: relative;
    z-index: 1;
}

.modal-card h2 {
    margin-bottom: 5px;
}

.modal-card label {
    margin-top: 15px;
}

.modal-close {
    position: absolute;
    right: 17px;
    top: 15px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 25px;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 200;
    background: #18181f;
    border: 1px solid var(--border);
    padding: 12px 17px;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .35);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: .25s;
    font-size: 12px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 850px) {
    .sidebar {
        width: 72px;
        padding: 20px 10px;
    }

    .brand {
        justify-content: center;
        padding: 0 0 25px;
    }

    .brand > div:last-child,
    .nav-item span:last-child,
    .sidebar-bottom > div:last-child {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 13px;
    }

    .sidebar-bottom {
        justify-content: center;
        padding: 12px 0;
    }

    .main {
        width: calc(100% - 72px);
        margin-left: 72px;
        padding: 25px 18px;
    }

    .controls-row {
        grid-template-columns: 1fr;
    }

    .refresh-btn {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .main {
        padding: 20px 13px;
    }

    .topbar {
        flex-direction: column;
    }

    .top-actions {
        width: 100%;
    }

    .top-actions .button {
        flex: 1;
    }

    .mailbox-hero,
    .page-card {
        padding: 20px;
    }

    .email-box {
        align-items: stretch;
        flex-direction: column;
    }

    .copy-button {
        width: 100%;
    }

    .mailbox-meta {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .mailbox-meta > div {
        min-width: 0;
    }

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