* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1b5e20;
    --primary-dark: #114316;
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #ef6c00;
    --info: #1565c0;
    --dark: #1f2937;
    --light: #f5f7fb;
    --border: #dce3ec;
    --text: #1f2937;
    --text-muted: #64748b;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text);
    background: var(--light);
    line-height: 1.5;
}

.login-page {
    background: linear-gradient(135deg, #0f766e 0%, #1b5e20 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    max-width: 1000px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.login-card,
.demo-credentials {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.login-header { text-align: center; margin-bottom: 24px; }
.login-header h1 { font-size: 42px; color: var(--primary); }
.login-header h2 { font-size: 22px; }
.login-header p { color: var(--text-muted); font-size: 14px; }

.demo-grid { display: grid; gap: 12px; }
.demo-item { background: var(--light); border-radius: 8px; padding: 12px; display: grid; gap: 4px; }
.demo-item span { font-family: Consolas, monospace; color: var(--text-muted); }

.login-footer { margin-top: 20px; text-align: center; color: var(--text-muted); }

.dashboard {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
    color: var(--primary);
    margin-bottom: 8px;
}

.user-info { font-size: 13px; color: var(--text-muted); }

.role-badge {
    display: inline-block;
    margin-top: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
}

.role-badge.manager { background: #e8f5e9; color: #1b5e20; }
.role-badge.officer { background: #e3f2fd; color: #1565c0; }
.role-badge.accountant { background: #fff8e1; color: #ef6c00; }
.role-badge.client { background: #fce4ec; color: #ad1457; }

.nav-menu {
    padding: 10px 0;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.nav-item {
    padding: 12px 20px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background: var(--light);
    border-left-color: var(--primary);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    background: #fff;
}

.main-content {
    margin-left: 280px;
    padding: 24px;
    width: calc(100% - 280px);
}

.content-header { margin-bottom: 20px; }
.content-header h2 { font-size: 28px; }
.content-header p { color: var(--text-muted); }

.card {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body { padding: 20px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
}

.stat-content h4 { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.stat-content p { font-size: 24px; font-weight: 700; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; }

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-secondary { background: #e2e8f0; color: var(--dark); }
.btn-block { width: 100%; }

.table-container { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 10px;
    text-align: left;
    font-size: 14px;
}

th {
    font-size: 12px;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.badge {
    border-radius: 999px;
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success { background: #e8f5e9; color: #1b5e20; }
.badge-warning { background: #fff3e0; color: #e65100; }
.badge-danger { background: #ffebee; color: #b71c1c; }
.badge-info { background: #e3f2fd; color: #0d47a1; }
.badge-primary { background: #e8f5e9; color: #1b5e20; }

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.alert-success { background: #e8f5e9; color: #1b5e20; }
.alert-danger { background: #ffebee; color: #b71c1c; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    align-items: center;
    justify-content: center;
    z-index: 99;
}

.modal.active { display: flex; }

.modal-content {
    width: 92%;
    max-width: 600px;
    background: #fff;
    border-radius: 12px;
}

.modal-header,
.modal-footer {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-footer {
    border-bottom: 0;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-body { padding: 20px; }
.modal-close { cursor: pointer; font-size: 28px; }

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-20 { margin-top: 20px; }

.error-message {
    background: #ffebee;
    color: #b71c1c;
    border-left: 4px solid var(--danger);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-280px);
        transition: transform 0.3s;
        z-index: 80;
    }

    .sidebar.active { transform: translateX(0); }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .login-container { grid-template-columns: 1fr; }
}
