* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: #f4f7fb;
    color: #183247;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #173d5c 0%, #205e73 100%);
    color: #ffffff;
    padding: 24px 18px;
}

.brand h1,
.brand p {
    margin: 0;
}

.brand h1 {
    font-size: 24px;
    margin-bottom: 6px;
}

.brand p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.menu {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.menu a {
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.88);
}

.menu a.active,
.menu a:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.content {
    flex: 1;
    padding: 28px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar h2 {
    margin: 0;
    font-size: 30px;
}

.topbar p {
    margin: 6px 0 0;
    color: #5f7384;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #d9e3ec;
}

.logout-link {
    color: #b03d30;
    font-weight: 600;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.card {
    background: #ffffff;
    border: 1px solid #d9e3ec;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 28px rgba(24, 50, 71, 0.06);
}

.stat-label {
    font-size: 14px;
    color: #687b8a;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
}

.section-title {
    margin: 0 0 16px;
    font-size: 20px;
}

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

.toolbar form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

input,
select,
button,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #cfd9e3;
    background: #ffffff;
}

textarea {
    min-height: 90px;
    resize: vertical;
}

button,
.button {
    border: none;
    background: #1a5a80;
    color: #ffffff;
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 600;
}

.button.secondary,
button.secondary {
    background: #dbe8f2;
    color: #183247;
}

.button.danger,
button.danger {
    background: #b03d30;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

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

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

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid #e4ebf1;
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #688091;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: #daf3dd;
    color: #247533;
}

.badge-warning {
    background: #fff2d1;
    color: #996200;
}

.badge-danger {
    background: #fbe0db;
    color: #a43b2f;
}

.badge-neutral {
    background: #e7edf3;
    color: #506677;
}

.flash-message {
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    background: #e2f0fb;
    color: #1b4f72;
}

.empty-state {
    padding: 28px;
    text-align: center;
    color: #687b8a;
}

.activity-list {
    margin: 0;
    padding-left: 18px;
}

.activity-list li {
    margin-bottom: 12px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #eef4f9 0%, #dfeaf3 100%);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #d9e3ec;
    box-shadow: 0 14px 32px rgba(24, 50, 71, 0.08);
    padding: 28px;
}

.login-card h1 {
    margin-top: 0;
}

.login-note {
    margin-top: 18px;
    padding: 12px;
    border-radius: 12px;
    background: #f4f8fc;
    color: #526575;
    font-size: 14px;
}

.error-box {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fbe0db;
    color: #a43b2f;
}

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .content {
        padding: 20px;
    }

    .topbar {
        flex-direction: column;
    }
}

