* {
    box-sizing: border-box;
}


html,
body {
    min-height: 100%;
}


body {
    margin: 0;

    background: #07101e;

    color: #e7edf7;

    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;
}


.app {
    min-height: 100vh;

    display: flex;
}


/* =========================
   SIDEBAR
========================= */

aside {
    width: 245px;

    min-height: 100vh;

    padding: 22px;

    background: #08101f;

    border-right: 1px solid #1c2a45;

    position: fixed;

    left: 0;
    top: 0;
    bottom: 0;
}


.brand {
    display: flex;

    align-items: center;

    gap: 12px;

    padding: 10px 6px 28px;

    border-bottom: 1px solid #1a2942;

    margin-bottom: 16px;
}


.logo {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #3156df,
            #7b3ce7
        );

    font-size: 21px;

    color: #ffffff;
}


.brand strong {
    display: block;

    font-size: 21px;

    color: #eef3fb;
}


.brand small {
    display: block;

    margin-top: 5px;

    color: #8fa0ba;

    font-size: 12px;
}


.nav {
    padding: 14px;

    margin: 8px 0;

    border-radius: 10px;

    color: #aebbd0;

    font-size: 14px;
}


.nav.active {
    color: #ffffff;

    background:
        linear-gradient(
            90deg,
            #2651c9,
            #58349d
        );
}


.status {
    position: absolute;

    left: 22px;
    right: 22px;
    bottom: 30px;

    padding: 14px;

    border: 1px solid #1c2d48;

    border-radius: 10px;

    color: #c7d4e8;

    background: #0a1423;
}


.status b {
    display: block;

    font-size: 13px;
}


.status small {
    display: block;

    margin-top: 6px;

    color: #64d994;

    font-size: 12px;
}


/* =========================
   MAIN
========================= */

main {
    flex: 1;

    margin-left: 245px;

    padding: 20px 34px;

    max-width: 1900px;
}


header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 22px;
}


header b {
    display: block;

    color: #edf3fc;

    font-size: 15px;
}


header small {
    display: block;

    margin-top: 5px;

    color: #8fa0ba;

    font-size: 12px;
}


.mode {
    border: 1px solid #2a3a58;

    background: #101b30;

    color: #d9e4f4;

    border-radius: 10px;

    padding: 12px 18px;

    font-size: 13px;
}


/* =========================
   CARD
========================= */

.card {
    background:
        linear-gradient(
            145deg,
            #0d192b,
            #0a1423
        );

    border: 1px solid #1c2d4a;

    border-radius: 15px;

    box-shadow:
        0 12px 35px
        rgba(0, 0, 0, 0.2);
}


.form-card {
    padding: 22px;
}


/* =========================
   FORM HEADER
========================= */

.head {
    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 14px;
}


.head h2 {
    margin: 0;

    font-size: 19px;

    color: #eaf0fa;
}


.head p {
    margin: 8px 0 16px;

    color: #9baac0;

    font-size: 13px;
}


.head code {
    color: #8aaaff;
}


.clear {
    border: 1px solid #2a3a58;

    background: #101b30;

    color: #d9e4f4;

    border-radius: 10px;

    padding: 10px 17px;

    cursor: pointer;
}


.clear:hover {
    background: #17243b;
}


/* =========================
   TEXTAREA
========================= */

textarea {
    width: 100%;

    min-height: 120px;

    padding: 15px;

    background: #071321;

    color: #dce8f8;

    border: 1px solid #2a405f;

    border-radius: 11px;

    font-family:
        ui-monospace,
        Consolas,
        monospace;

    font-size: 13px;

    line-height: 1.55;

    outline: none;

    resize: vertical;
}


textarea:focus {
    border-color: #526bd7;

    box-shadow:
        0 0 0 3px
        rgba(82, 107, 215, 0.12);
}


/* =========================
   CONTROLS
========================= */

.controls {
    display: flex;

    align-items: center;

    gap: 12px;

    margin-top: 18px;
}


.tabs {
    display: flex;

    overflow: hidden;

    border-radius: 9px;

    background: #101b30;
}


.tabs span {
    padding: 14px 28px;

    color: #a9b8cc;

    font-size: 14px;
}


.tabs .selected {
    color: #ffffff;

    background:
        linear-gradient(
            135deg,
            #3150d8,
            #713ce0
        );
}


select {
    margin-left: auto;

    min-width: 140px;

    padding: 13px 16px;

    background: #101b30;

    color: #e3ebf7;

    border: 1px solid #2a3a58;

    border-radius: 9px;

    outline: none;

    cursor: pointer;
}


.read {
    border: 0;

    border-radius: 9px;

    padding: 14px 32px;

    color: #ffffff;

    font-size: 14px;

    font-weight: 700;

    background:
        linear-gradient(
            90deg,
            #2460d9,
            #9b3ce4
        );

    cursor: pointer;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}


.read:hover {
    transform: translateY(-1px);

    opacity: 0.95;
}


/* =========================
   STATS
========================= */

.stats {
    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 12px;

    margin: 18px 0;
}


.stats > div {
    padding: 17px;

    background: #0b1728;

    border: 1px solid #1d2f4b;

    border-radius: 12px;
}


.stats small {
    display: block;

    color: #8d9bb2;

    font-size: 12px;
}


.stats b {
    display: block;

    margin-top: 7px;

    color: #edf3fc;

    font-size: 24px;
}


/* =========================
   RESULTS
========================= */

.results {
    padding: 17px;
}


.result-head {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    margin-bottom: 15px;
}


.result-head h2 {
    margin: 0;

    font-size: 18px;

    color: #e8eef8;
}


.result-head span {
    padding: 7px 11px;

    border-radius: 7px;

    background: #123826;

    color: #7be5a6;

    font-size: 12px;
}


/* =========================
   ACCOUNT
========================= */

.account {
    margin-top: 14px;

    border: 1px solid #1c2e4b;

    border-radius: 12px;

    overflow: hidden;

    background: #091524;
}


.account-title {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 14px;

    padding: 13px 15px;

    background: #0b1728;

    border-bottom: 1px solid #172944;
}


.account-title b {
    color: #dce6f5;

    font-size: 14px;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}


.account-title em {
    flex-shrink: 0;

    font-style: normal;

    font-size: 11px;

    padding: 6px 10px;

    border-radius: 6px;
}


.ok {
    background: #123826;

    color: #7ce5a6;
}


.bad {
    background: #3a1820;

    color: #ffabb7;
}


.error {
    padding: 15px;

    background: #3a1820;

    color: #ffc0c9;

    font-size: 13px;
}


/* =========================
   EMAIL LIST
========================= */

.mail-list {
    display: flex;

    flex-direction: column;

    gap: 9px;

    padding: 10px;
}


/* =========================
   EMAIL CARD
========================= */

.mail-item {
    background: #0a1628;

    border: 1px solid #1d304d;

    border-radius: 12px;

    overflow: hidden;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}


.mail-item:hover {
    border-color: #3e5c92;

    background: #0c192c;
}


.mail-item[open] {
    border-color: #596de0;

    box-shadow:
        0 0 0 1px
        rgba(91, 105, 224, 0.15);
}


.mail-item summary {
    list-style: none;

    cursor: pointer;

    padding: 15px 16px;

    display: flex;

    align-items: center;

    gap: 14px;
}


.mail-item summary::-webkit-details-marker {
    display: none;
}


/* =========================
   AVATAR
========================= */

.mail-avatar {
    width: 44px;
    height: 44px;

    min-width: 44px;

    border-radius: 50%;

    display: flex;

    align-items: center;

    justify-content: center;

    background:
        linear-gradient(
            135deg,
            #3157d8,
            #843de4
        );

    color: #ffffff;

    font-size: 17px;

    font-weight: 700;
}


/* =========================
   EMAIL MAIN
========================= */

.mail-main {
    flex: 1;

    min-width: 0;
}


.mail-top {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;
}


.mail-sender {
    min-width: 0;

    color: #f0f5ff;

    font-size: 14px;

    font-weight: 700;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.mail-date {
    flex-shrink: 0;

    color: #8b9bb3;

    font-size: 12px;

    white-space: nowrap;
}


.mail-subject {
    margin-top: 5px;

    color: #dce5f4;

    font-size: 14px;

    font-weight: 600;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


.mail-preview {
    margin-top: 5px;

    color: #8191a9;

    font-size: 12px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* =========================
   CODE BADGE
========================= */

.mail-code {
    flex-shrink: 0;

    min-width: 85px;

    padding: 8px 10px;

    border-radius: 8px;

    text-align: center;

    color: #aab9ff;

    background: #101d38;

    border: 1px solid #263b69;

    font-family:
        ui-monospace,
        monospace;

    font-size: 13px;

    font-weight: 700;
}


.mail-arrow {
    flex-shrink: 0;

    color: #7d8ca5;

    font-size: 20px;

    transition: transform 0.2s ease;
}


.mail-item[open] .mail-arrow {
    transform: rotate(180deg);
}


/* =========================
   OPEN EMAIL
========================= */

.mail-full {
    padding: 18px;

    border-top: 1px solid #1d2e49;

    background: #081322;
}


.mail-info {
    display: grid;

    grid-template-columns:
        1fr 1fr;

    gap: 14px;

    margin-bottom: 16px;
}


.mail-info > div {
    padding: 12px 14px;

    border-radius: 9px;

    background: #0d192b;

    border: 1px solid #1a2a44;
}


.mail-info span {
    display: block;

    margin-bottom: 6px;

    color: #75859d;

    font-size: 10px;

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 0.5px;
}


.mail-info strong {
    display: block;

    color: #dfe8f7;

    font-size: 13px;

    word-break: break-word;
}


.mail-info small {
    display: block;

    margin-top: 5px;

    color: #8191a9;

    font-size: 12px;

    word-break: break-all;
}


/* =========================
   EMAIL CONTENT
========================= */

.mail-content {
    padding: 18px;

    background: #0b1728;

    border: 1px solid #1b2d49;

    border-radius: 10px;

    color: #c9d4e5;

    font-size: 14px;

    line-height: 1.8;

    word-break: break-word;

    white-space: normal;
}


.empty-content {
    color: #7d8ca2;
}


/* =========================
   DETECTED CODE
========================= */

.code-box {
    margin-top: 15px;

    padding: 15px;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            rgba(48, 76, 181, 0.20),
            rgba(117, 48, 194, 0.15)
        );

    border: 1px solid #344d91;
}


.code-box > span {
    display: block;

    margin-bottom: 9px;

    color: #91a4c7;

    font-size: 10px;

    font-weight: 600;

    text-transform: uppercase;

    letter-spacing: 0.6px;
}


.code-box > div {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;
}


.code-box strong {
    color: #ffffff;

    font-size: 22px;

    letter-spacing: 2px;

    font-family:
        ui-monospace,
        monospace;

    word-break: break-word;
}


.code-box button {
    flex-shrink: 0;

    border: 1px solid #5366d9;

    padding: 9px 16px;

    border-radius: 7px;

    background: #263b9c;

    color: #ffffff;

    cursor: pointer;

    transition: background 0.2s ease;
}


.code-box button:hover {
    background: #3248b9;
}


/* =========================
   NO EMAIL
========================= */

.no-mail {
    padding: 55px 20px;

    text-align: center;

    color: #8191a9;
}


.no-mail-icon {
    margin-bottom: 12px;

    color: #7188ff;

    font-size: 35px;
}


.no-mail b {
    display: block;

    margin-bottom: 6px;

    color: #dbe5f5;
}


.no-mail span {
    font-size: 13px;
}


/* =========================
   FOOTER
========================= */

footer {
    padding: 24px;

    text-align: center;

    color: #708097;

    font-size: 12px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {

    aside {
        display: none;
    }

    main {
        margin-left: 0;

        padding: 18px;
    }

    .stats {
        grid-template-columns:
            repeat(3, 1fr);
    }

}


@media (max-width: 700px) {

    main {
        padding: 14px;
    }


    header {
        align-items: flex-start;
    }


    .mode {
        padding: 9px 12px;

        font-size: 11px;
    }


    .head {
        flex-direction: column;
    }


    .clear {
        width: 100%;
    }


    .controls {
        flex-wrap: wrap;
    }


    .tabs {
        width: 100%;
    }


    .tabs span {
        flex: 1;

        padding: 12px 5px;

        text-align: center;

        font-size: 12px;
    }


    select {
        flex: 1;

        margin-left: 0;

        min-width: 0;
    }


    .read {
        flex: 1;

        padding: 13px 15px;
    }


    .stats {
        grid-template-columns:
            repeat(2, 1fr);
    }


    .mail-item summary {
        padding: 13px;

        gap: 10px;
    }


    .mail-avatar {
        width: 38px;
        height: 38px;

        min-width: 38px;
    }


    .mail-date {
        display: none;
    }


    .mail-code {
        min-width: auto;

        max-width: 80px;

        overflow: hidden;

        text-overflow: ellipsis;

        font-size: 10px;

        padding: 6px;
    }


    .mail-preview {
        max-width: 100%;
    }


    .mail-info {
        grid-template-columns: 1fr;
    }


    .code-box > div {
        flex-direction: column;

        align-items: flex-start;
    }


    .code-box button {
        width: 100%;
    }

}


@media (max-width: 400px) {

    .stats {
        grid-template-columns: 1fr;
    }


    .mail-code {
        display: none;
    }


    .mail-arrow {
        font-size: 16px;
    }

}