body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f3f4f6;
    color: #1f2937;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 320px;
    padding: 2rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.1);
}

.login-container h1 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 1rem;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}

button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background-color: #dcfce7;
    color: #065f46;
}

.layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

.sidebar {
    background-color: #111827;
    color: #ffffff;
    padding: 2rem 1rem;
}

.sidebar h2 {
    margin-top: 0;
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.sidebar nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.sidebar nav a.active,
.sidebar nav a:hover {
    background-color: #2563eb;
}

.main-content {
    padding: 2rem;
    background-color: #f9fafb;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

table thead {
    background-color: #e5e7eb;
}

table th, table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table-sort {
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.table-sort.active::after {
    content: '▾';
    font-size: 0.75rem;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.table-actions form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-actions select {
    width: auto;
    min-width: 200px;
}

.form-inline {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.muted {
    color: #6b7280;
    font-size: 0.875rem;
}

.numeric {
    text-align: right;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.checkbox input {
    width: auto;
    margin: 0;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid.two-column {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .form-grid.two-column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(17, 24, 39, 0.45);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.modal.open {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 8px;
    padding: 1.75rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-body {
    display: grid;
    gap: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.25rem;
    cursor: pointer;
}

.modal-close:hover {
    color: #111827;
}

body.modal-open {
    overflow: hidden;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    color: #1f2937;
}

.status-active {
    color: #16a34a;
}

.status-inactive {
    color: #b91c1c;
}
