* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

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

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

.sidebar {
    width: 270px;
    background: #111827;
    color: white;
    padding: 18px 14px;
    position: fixed;
    top: 0;
    bottom: 0;
    overflow-y: auto;
}

.brand {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 18px;
}

.menu-title {
    color: #9ca3af;
    font-size: 12px;
    text-transform: uppercase;
    margin: 18px 8px 8px;
}

.sidebar a {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 14px;
}

.sidebar a:hover,
.sidebar a.active {
    background: #374151;
}

.content {
    margin-left: 270px;
    flex: 1;
    padding: 20px;
}

.topbar {
    background: white;
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 18px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.topbar h2 {
    margin: 0;
}

.card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
    margin-bottom: 18px;
}

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

.stat {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}

.stat .num {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 6px;
}

.stat .label {
    color: #6b7280;
    font-size: 13px;
}

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

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

th, td {
    padding: 10px 9px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

th {
    background: #f9fafb;
    font-weight: bold;
}

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

label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 14px;
}

input, select, textarea {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    font-size: 14px;
    background: white;
}

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

.btn {
    display: inline-block;
    padding: 9px 13px;
    border-radius: 9px;
    border: 0;
    cursor: pointer;
    font-size: 14px;
    margin: 2px;
}

.btn.primary {
    background: #2563eb;
    color: white;
}

.btn.success {
    background: #16a34a;
    color: white;
}

.btn.warning {
    background: #d97706;
    color: white;
}

.btn.danger {
    background: #dc2626;
    color: white;
}

.btn.light {
    background: #e5e7eb;
    color: #111827;
}

.btn.full {
    width: 100%;
    margin-top: 12px;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #e5e7eb;
}

.badge.green {
    background: #dcfce7;
    color: #166534;
}

.badge.red {
    background: #fee2e2;
    color: #991b1b;
}

.badge.blue {
    background: #dbeafe;
    color: #1e40af;
}

.alert {
    padding: 11px 13px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.danger {
    background: #fee2e2;
    color: #991b1b;
}

.muted {
    color: #6b7280;
}

.small {
    font-size: 12px;
}

.actions {
    margin-bottom: 14px;
}

.filter-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    background: linear-gradient(135deg, #111827, #2563eb);
}

.login-card {
    width: min(430px, 92vw);
    background: white;
    padding: 28px;
    border-radius: 18px;
    box-shadow: 0 20px 45px rgba(0,0,0,.22);
}

.login-card h1 {
    margin: 0 0 8px;
}

.print-header {
    display: none;
}

.row-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 46px;
    gap: 10px;
    margin-bottom: 10px;
}

hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 16px 0;
}

@media (max-width: 900px) {
    .sidebar {
        position: relative;
        width: 100%;
    }

    .layout {
        display: block;
    }

    .content {
        margin-left: 0;
    }

    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid,
    .row-item {
        grid-template-columns: 1fr;
    }
}

@media print {
    body {
        background: white;
    }

    .sidebar,
    .topbar,
    .no-print,
    .actions,
    .btn {
        display: none !important;
    }

    .content {
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 0;
        padding: 0;
    }

    .print-header {
        display: block;
        text-align: center;
        margin-bottom: 18px;
    }

    table, th, td {
        border: 1px solid #111;
    }

    th {
        background: #eee !important;
    }
}
