* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f5f5;
}

.layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: #1a2332;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
}

.sidebar-header {
    padding: 20px 16px;
    font-size: 18px;
    border-bottom: 1px solid #2a3a4a;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
}

.nav-item {
    display: block;
    padding: 10px 16px;
    color: #ccc;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #2a3a4a;
    color: #fff;
}

.nav-item.active {
    background: #2a3a4a;
    color: #fff;
    border-left-color: #4a9eff;
}

.nav-logout {
    margin-top: auto;
    border-top: 1px solid #2a3a4a;
}

.sidebar-user {
    padding: 12px 16px;
    font-size: 12px;
    color: #888;
    border-top: 1px solid #2a3a4a;
}

/* Content */
.content {
    margin-left: 220px;
    flex: 1;
    padding: 24px 32px;
}

.content h1 {
    margin-bottom: 24px;
    font-size: 22px;
    font-weight: 600;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 4px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.card h3 {
    margin-bottom: 12px;
    font-size: 15px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

table th, table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

table th {
    background: #f8f9fa;
    font-weight: 600;
}

table tr:hover {
    background: #f8f9fa;
}

/* Forms */
label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 13px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    margin-bottom: 12px;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}

.form-row > div {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    background: #4a9eff;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: #357abd;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: 3px;
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
}

/* Status indicators */
.status-ok {
    color: #28a745;
    font-weight: 600;
}

.status-warn {
    color: #ffc107;
    font-weight: 600;
}

.status-error {
    color: #dc3545;
    font-weight: 600;
}

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 4px;
    margin-top: 16px;
}

.pagination a, .pagination span {
    padding: 6px 10px;
    border: 1px solid #ddd;
    text-decoration: none;
    font-size: 12px;
    color: #333;
}

.pagination .current {
    background: #4a9eff;
    color: #fff;
    border-color: #4a9eff;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 16px;
}

.tab {
    padding: 8px 16px;
    text-decoration: none;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab.active {
    color: #4a9eff;
    border-bottom-color: #4a9eff;
}

/* Checkbox grid */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 6px;
}

.checkbox-grid label {
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 6px;
}
