* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --border: #d9dfeb;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    --radius: 14px;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

.muted {
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.btn:hover {
    border-color: #b8c2d9;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Home */

.home-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.home-card {
    width: min(560px, 100%);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
    text-align: center;
}

.home-title {
    margin: 0 0 8px;
    font-size: 32px;
    line-height: 1.15;
}

.home-subtitle {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 15px;
}

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

.home-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.home-actions .btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.home-actions-single {
    display: flex;
    margin-top: 24px;
}

.home-actions-single .btn {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
    font-weight: 600;
}

.home-footer {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.home-footer .btn {
    min-width: 180px;
}

/* Shared admin shell — baseline like old Statistics */

.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-content {
    flex: 1 1 auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 28px 40px 22px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.topbar-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.topbar h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--text);
}

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

.topbar .btn {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 14px;
}

.menu-dropdown {
    position: relative;
}

.menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
    z-index: 100;
}

.menu-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.menu-item:hover {
    background: #f8fafc;
}

.menu-item-active {
    background: #eff6ff;
    color: var(--primary);
}

.menu-item-button {
    appearance: none;
}

.menu-divider {
    height: 1px;
    margin: 6px 0;
    background: var(--border);
}

@media (max-width: 640px) {
    .menu-panel {
        left: 0 !important;
        right: auto !important;
        transform: none !important;
        min-width: min(260px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
    }

    .home-card {
        padding: 24px;
    }

    .home-title {
        font-size: 28px;
    }

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

    .home-footer {
        justify-content: stretch;
    }

    .home-footer .btn {
        width: 100%;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 20px 18px;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}