* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f7fb;
    color: #1e293b;
}


/* TOPBAR */

.topbar {
    height: 70px;
    background: white;
    border-bottom: 1px solid #e5e7eb;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 25px;

    position: sticky;
    top: 0;
    z-index: 10;
}


.brand {
    font-weight: bold;
    font-size: 19px;
}


.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


.top-actions form {
    margin: 0;
}


/* BUTTON */

.btn {
    display: inline-block;

    border: 0;

    background: #2196f3;
    color: white;

    text-decoration: none;

    padding: 11px 16px;

    border-radius: 9px;

    cursor: pointer;
}


.btn.light {
    background: #f1f5f9;
    color: #334155;
}


/* LAYOUT */

.layout {
    display: grid;

    grid-template-columns: 230px 1fr;

    min-height:
        calc(100vh - 70px);
}


.sidebar {
    background: white;

    border-right:
        1px solid #e5e7eb;

    padding: 20px;
}


.menu {
    display: flex;

    justify-content: space-between;

    text-decoration: none;

    color: #475569;

    padding: 13px;

    border-radius: 10px;

    margin-bottom: 6px;
}


.menu:hover,
.menu.active {
    background: #eaf6ff;

    color: #1683d8;
}


/* MAIN */

.main {
    padding: 25px;

    min-width: 0;
}


/* STATS */

.stats {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 15px;

    margin-bottom: 18px;
}


.stat {
    background: white;

    border-radius: 15px;

    padding: 20px;

    box-shadow:
        0 4px 18px
        rgba(0,0,0,.05);
}


.stat span {
    color: #64748b;

    font-size: 13px;
}


.stat strong {
    display: block;

    font-size: 28px;

    margin-top: 6px;
}


/* SEARCH */

.search {
    background: white;

    padding: 15px;

    border-radius: 15px;

    margin-bottom: 15px;
}


.search form {
    display: flex;

    gap: 10px;
}


.search input {
    flex: 1;
}


/* MAIL */

.mail-list {
    display: flex;

    flex-direction: column;

    gap: 8px;
}


.mail {
    background: white;

    border-radius: 12px;

    padding: 16px;

    display: grid;

    grid-template-columns:
        45px 1fr auto;

    gap: 14px;

    align-items: center;
}


.mail.unread {
    background: #f7fcff;

    border-left:
        3px solid #2196f3;
}


.avatar {
    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: #e5f4ff;

    display: flex;

    align-items: center;
    justify-content: center;
}


.subject {
    display: block;

    color: #1e293b;

    text-decoration: none;

    font-weight: bold;

    margin-bottom: 5px;
}


.sender,
.date {
    font-size: 13px;

    color: #64748b;
}


.mail-actions {
    display: flex;

    gap: 6px;

    margin-top: 9px;
}


.small {
    border: 0;

    background: #f1f5f9;

    padding: 6px 9px;

    border-radius: 7px;

    cursor: pointer;
}


.danger:hover {
    background: #fee2e2;

    color: #dc2626;
}


/* PAGINATION */

.pagination {
    display: flex;

    gap: 7px;

    justify-content: center;

    margin-top: 20px;
}


.pagination a {
    padding: 9px 13px;

    background: white;

    text-decoration: none;

    color: #334155;

    border-radius: 8px;
}


.pagination a.active {
    background: #2196f3;

    color: white;
}


/* EMPTY */

.empty {
    text-align: center;

    padding: 60px;

    background: white;

    border-radius: 15px;

    color: #64748b;
}


/* CARD */

.card {
    background: white;

    border-radius: 15px;

    padding: 25px;

    box-shadow:
        0 4px 18px
        rgba(0,0,0,.05);
}


/* READER */

.reader {
    max-width: 1000px;

    margin: 25px auto;

    padding: 0 15px;
}


.reader h1 {
    margin-top: 0;
}


.meta {
    display: flex;

    gap: 15px;

    color: #64748b;

    padding-bottom: 15px;

    border-bottom:
        1px solid #eee;
}


.reader-actions {
    display: flex;

    gap: 8px;

    margin: 18px 0;
}


.email-body {
    line-height: 1.7;

    overflow-x: auto;
}


.email-body img {
    max-width: 100%;
}


/* COMPOSE */

.compose {
    max-width: 1000px;

    margin: 25px auto;

    padding: 0 15px;
}


.compose .card {
    display: flex;

    flex-direction: column;

    gap: 8px;
}


.compose label {
    font-weight: 600;

    margin-top: 7px;
}


.compose input,
.compose textarea,
.search input {
    width: 100%;

    padding: 13px;

    border:
        1px solid #d9e1e8;

    border-radius: 9px;

    font: inherit;
}


.compose textarea {
    resize: vertical;
}


.send {
    width: max-content;

    margin-top: 10px;
}


/* LOGIN */

.login-page {
    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    background: #eef6ff;
}


.login-card {
    width: 95%;

    max-width: 420px;

    background: white;

    padding: 35px;

    border-radius: 20px;

    box-shadow:
        0 15px 50px
        rgba(0,0,0,.12);

    text-align: center;
}


.login-logo {
    font-size: 40px;
}


.login-card input {
    width: 100%;

    padding: 14px;

    margin: 15px 0;

    border:
        1px solid #d8dee6;

    border-radius: 10px;
}


.login-card button {
    width: 100%;

    padding: 14px;

    border: 0;

    border-radius: 10px;

    background: #2196f3;

    color: white;

    cursor: pointer;
}


.error {
    margin-top: 15px;

    padding: 12px;

    background: #fee2e2;

    color: #991b1b;

    border-radius: 8px;
}


/* MOBILE */

@media (max-width: 800px) {

    .layout {
        grid-template-columns: 1fr;
    }


    .sidebar {
        display: none;
    }


    .stats {
        grid-template-columns: 1fr;
    }


    .main {
        padding: 12px;
    }


    .mail {
        grid-template-columns:
            42px 1fr;
    }


    .mail > div:last-child {
        display: none;
    }


    .topbar {
        padding: 0 12px;
    }


    .reader,
    .compose {
        margin: 12px auto;
    }


    .search form {
        flex-direction: column;
    }

}
