/* ============================================================
   klachtenportal.nl - Stylesheet
   LeefEnergieBewust Thema
   ============================================================ */

:root {
    --primary-color: #4a7c59;
    --secondary-color: #2d5a3d;
    --accent-color: #6b9b7a;
    --danger: #e74c3c;
    --warning: #f39c12;
    --success: #27ae60;
    --info: #3498db;
    --text-dark: #1a1a2e;
    --text-medium: #4a4a6a;
    --text-light: #7a7a9a;
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
    font-family: var(--font-main);
    background: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 16px;
}

.login-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 4px;
}

.logo-circle {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(74, 124, 89, 0.3);
}

.logo-circle.large {
    width: 80px;
    height: 80px;
}

.logo-text {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 6px;
}

.input-with-icon {
    position: relative;
    width: 100%;
}

.input-with-icon svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    z-index: 5;
    width: 18px;
    height: 18px;
}

.input-with-icon input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: var(--font-main);
    position: relative;
    z-index: 1;
    background: white;
}

.input-with-icon input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 0.8rem;
    color: var(--text-light);
}

.powered-by {
    margin-top: 8px;
    font-weight: 500;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 500;
    line-height: 1.2;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-medium);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    background: rgba(74, 124, 89, 0.08);
    color: var(--primary-color);
}

.nav-link svg {
    flex-shrink: 0;
}

.nav-badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.2;
}

.user-role {
    font-size: 0.7rem;
    color: var(--text-light);
    line-height: 1.2;
}

.nav-logout {
    color: var(--danger) !important;
}

.nav-logout:hover {
    background: rgba(231, 76, 60, 0.08) !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-spacer {
    height: 64px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    min-height: calc(100vh - 64px - 60px);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

.page-header p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.page-header-actions {
    display: flex;
    gap: 8px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-body);
    color: var(--text-medium);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-light);
    border: 1px solid transparent;
}

.btn-ghost:hover {
    background: var(--bg-body);
    color: var(--text-medium);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* ============================================================
   CARDS
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    stroke-width: 2.5;
}

.stat-total .stat-icon { background: rgba(74, 124, 89, 0.1); color: var(--primary-color); }
.stat-nieuw .stat-icon { background: rgba(231, 76, 60, 0.1); color: var(--danger); }
.stat-behandeling .stat-icon { background: rgba(243, 156, 18, 0.1); color: var(--warning); }
.stat-opgelost .stat-icon { background: rgba(39, 174, 96, 0.1); color: var(--success); }
.stat-kritisch .stat-icon { background: rgba(231, 76, 60, 0.15); color: var(--danger); }

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-card, .detail-card, .table-card, .form-card, .settings-card, .admin-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h2 svg {
    color: var(--primary-color);
}

.card-body {
    padding: 20px 24px;
}

.badge-count {
    background: var(--bg-body);
    color: var(--text-light);
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-nieuw { background: rgba(231, 76, 60, 0.1); color: #c0392b; }
.badge-behandeling { background: rgba(243, 156, 18, 0.1); color: #d68910; }
.badge-opgelost { background: rgba(39, 174, 96, 0.1); color: #1e8449; }
.badge-gesloten { background: rgba(149, 165, 166, 0.1); color: #7f8c8d; }
.badge-gearchiveerd { background: rgba(127, 140, 141, 0.1); color: #616a6b; }

.badge-laag { background: rgba(52, 152, 219, 0.1); color: #2980b9; }
.badge-normaal { background: rgba(149, 165, 166, 0.1); color: #7f8c8d; }
.badge-hoog { background: rgba(243, 156, 18, 0.1); color: #d68910; }
.badge-kritisch { background: rgba(231, 76, 60, 0.15); color: #c0392b; }

.badge-role-admin { background: rgba(231, 76, 60, 0.1); color: #c0392b; }
.badge-role-manager { background: rgba(243, 156, 18, 0.1); color: #d68910; }
.badge-role-employee { background: rgba(52, 152, 219, 0.1); color: #2980b9; }
.badge-inactive { background: rgba(149, 165, 166, 0.15); color: #7f8c8d; }

/* ============================================================
   COMPLAINT LIST
   ============================================================ */
.complaint-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.complaint-item {
    display: block;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.complaint-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.complaint-kritisch {
    border-left: 4px solid var(--danger);
}

.complaint-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.complaint-number {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary-color);
}

.complaint-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.complaint-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.complaint-customer {
    font-size: 0.8rem;
    color: var(--text-medium);
}

.complaint-assigned {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ============================================================
   TABLE
   ============================================================ */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(74, 124, 89, 0.02);
}

.data-table tr.priority-kritisch td {
    background: rgba(231, 76, 60, 0.03);
}

.data-table tr.priority-hoog td {
    background: rgba(243, 156, 18, 0.03);
}

.empty-table {
    text-align: center;
    padding: 48px 24px !important;
    color: var(--text-light);
}

.empty-table svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ============================================================
   FILTERS
   ============================================================ */
.filter-bar {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-search {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    min-width: 260px;
    font-family: var(--font-main);
}

.filter-search:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: white;
    font-family: var(--font-main);
    cursor: pointer;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.page-link {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-medium);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--bg-body);
    color: var(--primary-color);
}

.page-link.active {
    background: var(--primary-color);
    color: white;
}

.page-info {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-left: 12px;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-card {
    max-width: 800px;
}

.form-section {
    margin-bottom: 32px;
}

.form-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-main);
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.form-group small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row .form-col-2 {
    grid-column: 1 / -1;
}

.form-row-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-medium);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.detail-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.detail-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 16px;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.detail-description {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.detail-description h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 8px;
}

.detail-description p {
    font-size: 0.9rem;
    color: var(--text-medium);
    line-height: 1.7;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-dot {
    position: absolute;
    left: -22px;
    top: 4px;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--border-color);
}

.timeline-content {
    background: var(--bg-body);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.timeline-note {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin: 6px 0;
    font-style: italic;
}

.timeline-by {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Notes */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.note-item {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.note-internal {
    background: rgba(74, 124, 89, 0.03);
    border-left: 3px solid var(--primary-color);
}

.note-external {
    background: rgba(52, 152, 219, 0.03);
    border-left: 3px solid var(--info);
}

.note-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.note-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.note-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.note-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--primary-color);
    color: white;
    text-transform: uppercase;
}

.note-text {
    font-size: 0.85rem;
    color: var(--text-medium);
    line-height: 1.6;
}

.note-form {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* Customer card */
.customer-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.customer-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.customer-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.customer-info p {
    font-size: 0.85rem;
    color: var(--text-medium);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.customer-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.customer-info a:hover {
    text-decoration: underline;
}

/* Action forms */
.action-form {
    margin-bottom: 16px;
}

.action-form:last-child {
    margin-bottom: 0;
}

.action-select {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font-main);
    background: white;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

/* Attachments */
.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-body);
}

.attachment-item svg {
    color: var(--primary-color);
    flex-shrink: 0;
}

.attachment-info {
    display: flex;
    flex-direction: column;
}

.attachment-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
}

.attachment-meta {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-error {
    background: rgba(231, 76, 60, 0.08);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.alert-success {
    background: rgba(39, 174, 96, 0.08);
    color: #1e8449;
    border: 1px solid rgba(39, 174, 96, 0.2);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-light);
}

.empty-state svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state.small {
    padding: 24px;
}

/* ============================================================
   CHART
   ============================================================ */
.chart-container {
    padding: 10px 0;
}

.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-bar-item {
    display: grid;
    grid-template-columns: 140px 1fr 100px;
    align-items: center;
    gap: 12px;
}

.chart-bar-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
}

.chart-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-bar-track {
    height: 24px;
    background: var(--bg-body);
    border-radius: 12px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.5s ease;
}

.chart-bar-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-medium);
    text-align: right;
}

/* ============================================================
   ADMIN - USERS
   ============================================================ */
.admin-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.user-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.user-inactive {
    opacity: 0.6;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.user-details p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.user-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.user-form .form-group {
    margin-bottom: 14px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.2s ease;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

.modal-content form {
    padding: 20px 24px;
}

.modal-text {
    margin-bottom: 16px;
    color: var(--text-medium);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
}

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.info-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.settings-form .form-group {
    margin-bottom: 20px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.portal-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 20px 24px;
    text-align: center;
}

.footer-content p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.footer-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

.sep {
    margin: 0 8px;
    color: var(--border-color);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.text-sm { font-size: 0.8rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .dashboard-grid,
    .detail-grid,
    .admin-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .chart-bar-item {
        grid-template-columns: 120px 1fr 80px;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
        gap: 4px;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        padding: 12px 16px;
        width: 100%;
    }

    .nav-divider {
        width: 100%;
        height: 1px;
        margin: 8px 0;
    }

    .nav-user {
        padding: 12px 16px;
    }

    .main-content {
        padding: 16px;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-left {
        flex-direction: column;
        gap: 8px;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-search {
        min-width: unset;
    }

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

    .chart-bar-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .chart-bar-value {
        text-align: left;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .login-card {
        padding: 24px;
    }

    .user-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 14px;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }
}


/* ============================================================
   SUPERADMIN STYLES
   ============================================================ */

.superadmin-notice {
    text-align: center;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(74, 124, 89, 0.08);
    border-radius: var(--radius-md);
    border: 1px solid rgba(74, 124, 89, 0.2);
}

.superadmin-notice svg {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.superadmin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-color) !important;
    font-weight: 600;
}

.company-selector {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.company-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.company-option {
    cursor: pointer;
    display: block;
}

.company-option input[type="radio"] {
    display: none;
}

.company-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    background: white;
}

.company-option input[type="radio"]:checked + .company-card {
    border-color: var(--primary-color);
    background: rgba(74, 124, 89, 0.04);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.company-card:hover {
    border-color: var(--primary-color);
}

.company-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
}

.company-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.company-info strong {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.company-info span {
    font-size: 0.8rem;
}

.nav-company-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
}

.switcher-label {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
}

.switcher-form {
    flex: 1;
}

.switcher-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: var(--font-main);
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.switcher-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

@media (max-width: 768px) {
    .nav-company-switcher {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .switcher-label {
        margin-bottom: 4px;
    }
}