:root {
    --primary: #2b6777;
    --secondary: #c8d8e4;
    --light: #f2f2f2;
    --dark: #1b2430;
    --danger: #d9534f;
    --success: #4caf50;
    --warning: #f0ad4e;
    --info: #5bc0de;
    font-family: 'Segoe UI', sans-serif;
}

body {
    margin: 0;
    background: var(--light);
    color: var(--dark);
}

.top-bar {
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.top-bar__title h1 {
    margin: 0;
    font-size: 1.5rem;
}

.top-bar__subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
}

.top-bar__user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-form button {
    background: var(--secondary);
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
}

.page-wrapper {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 130px);
}

.sidebar {
    background: #fff;
    border-right: 1px solid #e1e1e1;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    border-bottom: 1px solid #eee;
}

.sidebar a {
    display: block;
    padding: 0.85rem 1.2rem;
    color: var(--dark);
    text-decoration: none;
}

.sidebar li.active a,
.sidebar a:hover {
    background: var(--secondary);
    color: var(--primary);
    font-weight: 600;
}

.content {
    padding: 2rem;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.card h2 {
    margin-top: 0;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

th {
    background: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.8rem;
}

tr:nth-child(even) {
    background: #f9f9f9;
}

form {
    display: grid;
    gap: 1rem;
}

label {
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="datetime-local"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

textarea {
    min-height: 100px;
}

button,
.button {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.button.secondary {
    background: var(--secondary);
    color: var(--dark);
}

.button.danger {
    background: var(--danger);
}

.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success { background: rgba(76, 175, 80, 0.1); color: var(--success); }
.alert-danger { background: rgba(217, 83, 79, 0.1); color: var(--danger); }
.alert-info { background: rgba(91, 192, 222, 0.1); color: var(--info); }

.footer {
    padding: 1rem 2rem;
    background: #fff;
    border-top: 1px solid #e1e1e1;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    background: var(--secondary);
}

.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--light);
}

.error-card {
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

.error-card h1 {
    font-size: 6rem;
    margin: 0;
    color: var(--primary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #fff;
}

.badge.success { background: var(--success); }
.badge.warning { background: var(--warning); }
.badge.danger { background: var(--danger); }
.badge.info { background: var(--info); }

.table-actions {
    display: flex;
    gap: 0.4rem;
}

@media (max-width: 960px) {
    .page-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .content {
        padding: 1.5rem;
    }
}
