* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: #f4f6f8;
    color: #20252b;
}

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: #18232f;
    color: white;
}

.brand {
    font-size: 19px;
    font-weight: 600;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 18px;
}

.user-area form {
    margin: 0;
}

.logout-button {
    background: transparent;
    border: 0;
    color: white;
    cursor: pointer;
}

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

.sidebar {
    background: white;
    border-right: 1px solid #dce1e6;
    padding: 20px 12px;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar a {
    padding: 10px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #28323c;
}

.sidebar a:hover {
    background: #eef2f5;
}

.nav-section {
    margin-top: 18px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #7b8794;
}

.content {
    padding: 32px;
    max-width: 1500px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

h1 {
    margin-top: 0;
}

h2 {
    margin-top: 0;
    font-size: 18px;
}

.card {
    background: white;
    border: 1px solid #dfe4e8;
    border-radius: 9px;
    padding: 20px;
    margin-bottom: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.admin-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.stat-card {
    min-height: 120px;
}

.stat-title {
    color: #68737d;
}

.stat-number {
    margin-top: 12px;
    font-size: 34px;
    font-weight: 600;
}

.button {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    background: #245f91;
    color: white;
    text-decoration: none;
    cursor: pointer;
}

.button-full {
    width: 100%;
}

.muted {
    color: #737e87;
}

.anonymous-content {
    min-height: calc(100vh - 64px);
}

.login-wrapper {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 400px;
    background: white;
    border: 1px solid #dfe4e8;
    border-radius: 10px;
    padding: 32px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbc5cd;
    border-radius: 5px;
}

.alert {
    padding: 12px;
    margin-bottom: 18px;
    border-radius: 5px;
    background: #f9e3e3;
}

.login-note {
    margin-top: 20px;
    font-size: 13px;
    color: #737e87;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e3e7ea;
}

.data-table th {
    font-size: 13px;
    text-transform: uppercase;
    color: #68737d;
    background: #f7f9fa;
}

.data-table tbody tr:hover {
    background: #f8fafb;
}

.form-card {
    max-width: 1100px;
}

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

.form-grid .form-group {
    margin-bottom: 0;
}

.form-group select,
.form-group textarea,
.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbc5cd;
    border-radius: 5px;
    background: white;
}

.form-group textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}

.button-secondary {
    background: #66717b;
}

.field-help {
    margin-top: 5px;
    font-size: 12px;
    color: #6d7882;
}

.field-error {
    margin-top: 5px;
    font-size: 13px;
    color: #a32929;
}

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