:root {
    --sidebar: #111827;
    --sidebar-soft: #1f2937;
    --accent: #2563eb;
    --page: #f3f6fb;
    --line: #d8dee9;
    --text: #111827;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: var(--page);
    color: var(--text);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(440px, 100%);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(17, 24, 39, 0.14);
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
}

.admin-sidebar {
    width: 248px;
    flex: 0 0 248px;
    background: var(--sidebar);
    color: #fff;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    margin-bottom: 22px;
    padding: 0 8px;
}

.admin-sidebar .nav-link {
    color: #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 4px;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background: var(--sidebar-soft);
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.09);
    margin: 12px 0;
}

.main-content {
    flex: 1;
    padding: 28px;
    min-width: 0;
}

.content-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(17, 24, 39, 0.05);
}

.stat-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    min-height: 118px;
}

.stat-label {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    margin-top: 8px;
}

.quick-action {
    display: block;
    height: 100%;
    text-decoration: none;
    color: inherit;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.quick-action:hover {
    border-color: var(--accent);
    color: inherit;
}

.table td,
.table th {
    vertical-align: middle;
}

.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1080;
}

.empty-state {
    padding: 36px 16px;
    color: #6b7280;
    text-align: center;
}

.empty-state i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
}

.result-table-scroll {
    max-height: 360px;
    overflow: auto;
}

.mail-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px;
}

.mail-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.message-row {
    cursor: pointer;
}

.message-row.unseen td {
    font-weight: 700;
}

@media (max-width: 860px) {
    .page-wrapper {
        display: block;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        display: block;
    }

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

    .main-content {
        padding: 18px;
    }
}
