* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: #f6f8fb;
    background: #080b10;
}

a {
    color: inherit;
}

.login-page,
.app-shell {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 10%, rgba(0, 207, 255, .18), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(255, 202, 40, .16), transparent 24%),
        linear-gradient(135deg, #07090e 0%, #101923 52%, #0b0f16 100%);
}

.login-card {
    width: min(420px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 28px;
    position: relative;
    top: 50vh;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background: rgba(9, 13, 20, .84);
    box-shadow: 0 20px 70px rgba(0, 0, 0, .45);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #00cffc, #ffd24a);
    color: #071018;
    font-weight: 800;
}

h1,
h2,
h3 {
    margin: 0;
}

.muted {
    color: #aab5c3;
}

label {
    display: block;
    margin: 14px 0 7px;
    color: #dbe5ef;
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    padding: 12px 13px;
    font: inherit;
    outline: none;
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 86px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 6px;
    min-height: 34px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    padding: 0 12px;
    font-size: 13px;
}

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

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 12px;
    background: #00cffc;
    color: #061018;
    padding: 0 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.btn-secondary {
    background: rgba(255, 255, 255, .1);
    color: #f7fbff;
}

.btn-danger {
    background: #ff4d67;
    color: #fff;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    background: rgba(6, 9, 14, .88);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    backdrop-filter: blur(12px);
}

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

.account-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(0, 207, 252, .16);
    color: #dff8ff;
    font-size: 12px;
    font-weight: 800;
}

.account-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-switcher label {
    margin: 0;
    color: #aab5c3;
}

.account-switcher select {
    min-width: 245px;
    padding: 10px 12px;
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - 75px);
}

.sidebar {
    padding: 18px;
    border-right: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .04);
}

.nav-link {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 12px 13px;
    border-radius: 12px;
    color: #dce8f5;
    text-decoration: none;
}

.nav-link.active,
.nav-link:hover {
    background: rgba(0, 207, 252, .16);
    color: #fff;
}

.main {
    padding: 22px;
}

.panel {
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 18px;
    background: rgba(9, 13, 20, .76);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
    overflow: hidden;
}

.panel-head,
.panel-body {
    padding: 18px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.mail-list {
    display: grid;
}

.mail-row {
    display: grid;
    grid-template-columns: 82px 1fr 104px;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    text-decoration: none;
}

.mail-row:hover {
    background: rgba(255, 255, 255, .05);
}

.mail-row.unread {
    background: rgba(0, 207, 252, .1);
    font-weight: 700;
}

.mail-open {
    display: grid;
    grid-template-columns: minmax(160px, 250px) 1fr 150px;
    gap: 14px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.mail-open strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    min-height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .1);
    color: #c9d4df;
    font-size: 12px;
    font-weight: 800;
}

.mail-status.new {
    background: #ffd24a;
    color: #101010;
}

.mail-status.seen {
    background: rgba(255, 255, 255, .1);
}

.mail-forward {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ffd24a;
    color: #101010;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 800;
}

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

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

.flash {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 207, 252, .16);
}

.flash.error {
    background: rgba(255, 77, 103, .16);
}

.message-body {
    white-space: pre-wrap;
    line-height: 1.55;
    color: #edf4fb;
}

.message-html {
    width: 100%;
    min-height: 620px;
    border: 0;
    border-radius: 14px;
    background: #fff;
}

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

    .sidebar {
        display: flex;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .1);
    }

    .nav-link {
        min-width: max-content;
    }

    .mail-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .mail-open {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .mail-forward {
        width: 100%;
    }

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

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

    .topbar-actions,
    .account-switcher,
    .account-switcher select {
        width: 100%;
    }
}
