/* Main Styles for Training Management Application */

/* === Color Palette (unified) === */
:root {
    /* Primary */
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-primary-bg: #eff6ff;

    /* Success / Green */
    --color-success: #16a34a;
    --color-success-light: #dcfce7;
    --color-success-text: #166534;

    /* Warning / Orange */
    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;
    --color-warning-text: #b45309;

    /* Danger / Red */
    --color-danger: #dc2626;
    --color-danger-light: #fee2e2;
    --color-danger-text: #991b1b;

    /* Info / Cyan */
    --color-info: #0891b2;
    --color-info-light: #ecfeff;
    --color-info-text: #155e75;

    /* Purple */
    --color-purple: #7c3aed;
    --color-purple-light: #f5f3ff;

    /* Neutral */
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-bg: #f4f7fb;
    --color-bg-card: #ffffff;
    --color-bg-subtle: #f8fafc;

    /* Sidebar */
    --sidebar-bg-start: #1e2547;
    --sidebar-bg-end: #1e2547;
    --sidebar-active: #2f6fed;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
}

/* General Styles */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg);
}

.footer {
    margin-top: auto;
}

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

.app-sidebar {
    width: 260px;
    min-width: 260px;
    background: linear-gradient(180deg, var(--sidebar-bg-start) 0%, var(--sidebar-bg-end) 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease, transform 0.25s ease;
    box-shadow: 0 0 30px rgba(15, 23, 42, 0.2);
}

.app-main {
    flex: 1;
    margin-left: 260px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.app-content {
    flex: 1;
    padding: 1.75rem 2rem;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.brand-link:hover {
    color: #fff;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    transition: all 0.2s ease;
}

.app-sidebar .sidebar-toggle {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-toggle:hover {
    transform: translateY(-1px);
    background: rgba(37, 99, 235, 0.16);
}

.sidebar-nav {
    padding: 1rem 0.75rem 1.5rem;
    flex: 1;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-section-title {
    padding: 1rem 0.75rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin: 0.25rem 0;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.sidebar-link.active {
    color: #fff;
    background: var(--sidebar-active);
    box-shadow: 0 4px 12px rgba(47, 111, 237, 0.4);
}

.sidebar-link-icon {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link-text {
    flex: 1;
    min-width: 0;
}

.sidebar-link-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: #f59e0b;
    color: #111827;
    font-size: 0.72rem;
    font-weight: 700;
}

.sidebar-link-badge.danger {
    background: #ef4444;
    color: #fff;
}

/* Sidebar sub-navigation */
.sidebar-subnav {
    margin-left: 2.5rem;
    margin-bottom: 0.25rem;
    padding-left: 0.5rem;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.sidebar-sublink:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-sublink.active {
    color: #fff;
    background: rgba(37, 99, 235, 0.2);
    font-weight: 600;
}

.sidebar-sublink-text {
    flex: 1;
}

.sidebar-sublink-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.68rem;
    font-weight: 700;
}

.sidebar-sublink.active .sidebar-sublink-badge {
    background: rgba(96, 165, 250, 0.35);
    color: #fff;
}

body.sidebar-collapsed .sidebar-subnav {
    display: none;
}

/* Filters inline bar */
.filters-bar {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* On mobile, filters collapse; on desktop always visible */
@media (min-width: 768px) {
    .filters-bar.collapse:not(.show) {
        display: flex !important;
    }
}

.filters-bar .filter-group {
    flex: 1;
    min-width: 150px;
}

.filters-bar .filter-group-grow {
    flex: 2;
    min-width: 200px;
}

.filters-bar .filter-group-btn {
    flex: none;
    align-self: flex-end;
}

.filters-bar .filter-group label,
.filters-bar .filter-group-grow label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.25rem;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Tab pills style */
.nav-pills-custom .nav-link {
    border-radius: 20px;
    padding: 0.4rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: #475569;
    background: #e2e8f0;
    border: none;
    margin-right: 0.5rem;
    transition: all 0.2s ease;
}

.nav-pills-custom .nav-link.active {
    background: #2563eb;
    color: #fff;
}

.nav-pills-custom .nav-link:hover:not(.active) {
    background: #cbd5e1;
}

/* Lightweight table card */
.table-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 10px 30px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.table-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.1rem;
    background: #fff;
    border-bottom: 1px solid #eef1f6;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
}

.table-card-header > i,
.table-card-header > div > i:first-child {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #eef3ff;
    color: #3b82f6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Compact table */
.table-compact {
    width: 100%;
    border-collapse: collapse;
}

.table-compact th {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    text-transform: none;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    background: transparent;
    white-space: nowrap;
}

.table-compact td {
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
    color: #334155;
}

.table-compact tbody tr {
    border-bottom: 1px solid #f1f5f9;
}

.table-compact tbody tr:hover {
    background: #f8fafc;
}

/* Document action icons */
.doc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    text-decoration: none;
}

.doc-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.doc-icon-pdf {
    color: #dc2626;
    background: #fef2f2;
}

.doc-icon-pdf:hover {
    color: #dc2626;
    background: #fee2e2;
}

.doc-icon-file {
    color: #2563eb;
    background: #eff6ff;
}

.doc-icon-file:hover {
    color: #2563eb;
    background: #dbeafe;
}

/* Action icon buttons */
.action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 0.82rem;
    transition: all 0.15s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

.action-icon:hover {
    transform: translateY(-1px);
}

.action-icon-view {
    color: #0891b2;
    background: #ecfeff;
}

.action-icon-view:hover {
    color: #0891b2;
    background: #cffafe;
}

.action-icon-edit {
    color: #2563eb;
    background: #eff6ff;
}

.action-icon-edit:hover {
    color: #2563eb;
    background: #dbeafe;
}

.action-icon-docs {
    color: #7c3aed;
    background: #f5f3ff;
}

.action-icon-docs:hover {
    color: #7c3aed;
    background: #ede9fe;
}

.action-icon-delete {
    color: #dc2626;
    background: #fef2f2;
}

.action-icon-delete:hover {
    color: #dc2626;
    background: #fee2e2;
}

/* Pagination styling */
.pagination-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.pagination-custom .page-link {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    background: transparent;
    border: none;
    transition: all 0.15s ease;
}

.pagination-custom .page-link:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.pagination-custom .page-item.active .page-link {
    background: #2563eb;
    color: #fff;
    font-weight: 700;
}

.pagination-custom .page-item.disabled .page-link {
    color: #cbd5e1;
}

/* Status badges refined */
.badge-status {
    display: inline-block;
    padding: 0.3em 0.7em;
    font-size: 0.78em;
    font-weight: 600;
    border-radius: 6px;
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
    line-height: 1.3;
}

.badge-status-scheduled {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-status-in_progress {
    background: #fef3c7;
    color: #b45309;
}

.badge-status-completed {
    background: #dcfce7;
    color: #166534;
}

.badge-status-abandoned {
    background: #fee2e2;
    color: #991b1b;
}

.badge-status-postponed {
    background: #f1f5f9;
    color: #475569;
}

.badge-status-archived {
    background: #f1f5f9;
    color: #64748b;
}

/* Contact status badges */
.badge-status-to_process {
    background: #fef3c7;
    color: #92400e;
}

.badge-status-processed {
    background: #dbeafe;
    color: #1e40af;
}

.badge-status-awaiting_funding {
    background: #f3e8ff;
    color: #6b21a8;
}

.badge-status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.badge-status-validated {
    background: #dcfce7;
    color: #166534;
}

.badge-status-success {
    background: #dcfce7;
    color: #166534;
}

.badge-status-secondary {
    background: #f1f5f9;
    color: #475569;
}

.badge-status-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-status-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-status-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-status-active {
    background: #dcfce7;
    color: #166534;
}

.badge-status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* Document progress bar in table */
.doc-progress {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.doc-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.doc-progress-text {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    margin-top: 2px;
    font-weight: 500;
}

/* Table footer */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.85rem;
    color: #64748b;
}

.header-user-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #f1f5fb;
    border: 1px solid #e6eaf3;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    margin-left: 0.75rem;
    min-width: 240px;
    max-width: 420px;
    flex: 1;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.header-search i {
    color: #94a3b8;
    font-size: 0.85rem;
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.88rem;
    color: #1e293b;
}

.header-search input::placeholder {
    color: #94a3b8;
}

.header-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e6eaf3;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
}

.header-icon-btn:hover {
    color: #2563eb;
    border-color: #c7d7f5;
    background: #f6f9ff;
}

.header-icon-dot {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.85rem 0.4rem 0.45rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    font: inherit;
    cursor: pointer;
}

button.user-chip::after {
    color: #94a3b8;
}

.user-name-block {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}

.user-role {
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
}

.user-name {
    font-weight: 600;
    color: #0f172a;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 1035;
}

body.sidebar-collapsed .app-sidebar {
    width: 72px;
    min-width: 72px;
}

body.sidebar-collapsed .app-main {
    margin-left: 72px;
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .sidebar-link-text,
body.sidebar-collapsed .sidebar-section-title,
body.sidebar-collapsed .sidebar-link-badge,
body.sidebar-collapsed .user-name {
    display: none;
}

body.sidebar-collapsed .brand-link {
    gap: 0;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

body.sidebar-collapsed .app-sidebar-brand {
    justify-content: center;
    gap: 0.5rem;
}

.improvement-status-card {
    border-left: 4px solid transparent;
}

.improvement-status-badge.status-pending,
.improvement-status-card.status-pending {
    border-color: #f59e0b;
}

.improvement-status-badge.status-pending {
    background: #fff3cd;
    color: #8a5a00;
}

.improvement-status-badge.status-validated,
.improvement-status-card.status-validated {
    border-color: #22c55e;
}

.improvement-status-badge.status-validated {
    background: #dcfce7;
    color: #166534;
}

.improvement-status-badge.status-rejected,
.improvement-status-card.status-rejected {
    border-color: #ef4444;
}

.improvement-status-badge.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.improvement-status-badge.status-adapted,
.improvement-status-card.status-adapted {
    border-color: #3b82f6;
}

.improvement-status-badge.status-adapted {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Dashboard Cards */
.dashboard-card {
    transition: transform 0.3s;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.dashboard-card .card-header {
    border-radius: 10px 10px 0 0;
}

.dashboard-card .card-icon {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    color: #fff;
}

.badge-to-process {
    background-color: #ff9800; /* Orange plus vif */
    color: #000; /* Texte noir pour meilleur contraste */
}

.badge-processed {
    background-color: #00bcd4; /* Bleu clair plus vif */
    color: #000; /* Texte noir pour meilleur contraste */
}

.badge-awaiting-funding {
    background-color: #9c27b0; /* Violet */
    color: #fff; /* Texte blanc */
}

.badge-rejected {
    background-color: #f44336; /* Rouge plus vif */
    color: #fff; /* Texte blanc */
}

.badge-validated {
    background-color: #4caf50; /* Vert plus vif */
    color: #000; /* Texte noir pour meilleur contraste */
}

.badge-in-progress {
    background-color: #2196f3; /* Bleu plus vif */
    color: #fff; /* Texte blanc */
}

.badge-completed {
    background-color: #4caf50; /* Vert plus vif */
    color: #000; /* Texte noir pour meilleur contraste */
}

.badge-abandoned {
    background-color: #f44336; /* Rouge plus vif */
    color: #fff; /* Texte blanc */
}

.badge-postponed {
    background-color: #9e9e9e; /* Gris plus clair */
    color: #000; /* Texte noir pour meilleur contraste */
}

/* Document Cards */
.document-card {
    transition: all 0.3s;
    border-left: 5px solid #dee2e6;
}

.document-card.present {
    border-left-color: #28a745;
}

.document-card.missing {
    border-left-color: #dc3545;
}

.document-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Dashboard stat tiles — pastel cards with icon left */
.stat-tile {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 0.95rem;
    padding: 1.05rem 1.15rem;
    border-radius: 14px;
    text-align: left;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: var(--color-text);
    min-height: 82px;
}

.stat-tile::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    color: #b6c2d6;
    grid-column: 3;
    grid-row: 1 / 3;
}

.stat-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.stat-tile-icon {
    grid-row: 1 / 3;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
    flex-shrink: 0;
}

.stat-tile-value {
    grid-column: 2;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.15;
    color: #0f172a;
}

.stat-tile-label {
    grid-column: 2;
    font-size: 0.74rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 0.1rem;
}

.stat-tile-primary   { background: #eef3ff; } .stat-tile-primary   .stat-tile-icon { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-tile-success   { background: #eaf8f0; } .stat-tile-success   .stat-tile-icon { background: linear-gradient(135deg, #22c55e, #16a34a); }
.stat-tile-warning   { background: #fff6e6; } .stat-tile-warning   .stat-tile-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-tile-danger    { background: #fdeeee; } .stat-tile-danger    .stat-tile-icon { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-tile-info      { background: #e8f8fc; } .stat-tile-info      .stat-tile-icon { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.stat-tile-secondary { background: #f1f4f9; } .stat-tile-secondary .stat-tile-icon { background: linear-gradient(135deg, #64748b, #475569); }
.stat-tile-dark      { background: #eceef5; } .stat-tile-dark      .stat-tile-icon { background: linear-gradient(135deg, #334155, #0f172a); }

/* Satisfaction rating badges */
.sat-badge {
    display: inline-block;
    padding: 0.25em 0.6em;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.sat-very_satisfied { background: #dcfce7; color: #166534; }
.sat-satisfied      { background: #ecfdf5; color: #047857; }
.sat-disappointed   { background: #fef3c7; color: #b45309; }
.sat-unsatisfied    { background: #fee2e2; color: #991b1b; }
.sat-not_applicable { background: #f1f5f9; color: #64748b; }

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.required-field label:after {
    content: " *";
    color: red;
}

/* Tables */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Pagination */
.page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

/* =============================================
   RESPONSIVE 
   ============================================= */

/* Mobile small (< 576px) */
@media (max-width: 576px) {
    .page-header,
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem;
    }

    .page-header h1,
    h1.h3 {
        font-size: 1.25rem;
    }

    .page-header-actions {
        display: flex;
        width: 100%;
        gap: 0.5rem;
    }

    .page-header-actions .btn {
        flex: 1;
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    /* Filters: stack and make compact */
    .filters-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filters-bar .filter-group,
    .filters-bar .filter-group-grow,
    .filters-bar .filter-group-btn {
        min-width: 100%;
        flex: none;
    }

    .filters-bar .filter-group-btn .btn {
        width: 100%;
    }

    .filters-bar .filter-group label,
    .filters-bar .filter-group-grow label {
        font-size: 0.72rem;
    }

    .form-select, .form-control {
        font-size: 0.85rem;
        padding: 0.35rem 0.6rem;
    }

    /* Table card */
    .table-card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
        font-size: 0.82rem;
    }

    .table-footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0.6rem;
    }

    /* Table content */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-compact th {
        font-size: 0.7rem;
        padding: 0.4rem 0.5rem;
        white-space: nowrap;
    }

    .table-compact td {
        font-size: 0.78rem;
        padding: 0.4rem 0.5rem;
    }

    /* Action icons smaller on mobile */
    .action-icon {
        width: 26px;
        height: 26px;
        font-size: 0.72rem;
    }

    .action-buttons {
        display: flex;
        gap: 2px;
    }

    /* Tabs */
    .nav-pills-custom .nav-link {
        padding: 0.3rem 0.7rem;
        font-size: 0.78rem;
    }

    /* Stat tiles */
    .stat-tile {
        min-height: 64px;
        padding: 0.65rem 0.7rem;
        column-gap: 0.6rem;
    }

    .stat-tile-value {
        font-size: 1.15rem;
    }

    .stat-tile-icon {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    .stat-tile::after {
        display: none;
    }

    .stat-tile-label {
        font-size: 0.65rem;
    }
}

/* Tablet (< 768px) */
@media (max-width: 768px) {
    .app-header {
        padding: 0.6rem 0.75rem;
    }

    .app-content {
        padding: 0.75rem;
    }

    .user-name-block {
        display: none;
    }

    .user-chip {
        padding: 0.3rem 0.45rem;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }

    .header-icon-btn {
        width: 34px;
        height: 34px;
    }

    /* Horizontal scroll indicator for tables */
    .table-responsive {
        position: relative;
    }

    .table-responsive::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 20px;
        background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
        pointer-events: none;
    }

    /* Hide less important columns on tablet */
    .table-compact .hide-tablet {
        display: none;
    }
}

/* Desktop sidebar collapse (< 992px) */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-main {
        margin-left: 0;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }
}

/* Progress bars */
.progress {
    height: 10px;
    border-radius: 5px;
}

/* Notifications */
.notification-item {
    border-left: 4px solid #dee2e6;
    transition: background-color 0.2s;
}

.notification-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.notification-item.unread {
    border-left-color: #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}

.notification-item.read {
    opacity: 0.7;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* =============================================
   GLOBAL COMPONENT REFRESH (all pages)
   ============================================= */

/* Bootstrap cards → same look as .table-card */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 10px 30px rgba(15, 23, 42, 0.05);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #eef1f6;
    font-weight: 700;
    color: #1e293b;
    padding: 0.85rem 1.1rem;
}

.card-header:first-child {
    border-radius: 16px 16px 0 0;
}

.card-footer {
    background: #f8fafc;
    border-top: 1px solid #eef1f6;
}

/* Buttons */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.btn-primary {
    background-color: var(--sidebar-active);
    border-color: var(--sidebar-active);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #2563eb;
    border-color: #2563eb;
}

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

.btn-warning {
    background-color: #f59e0b;
    border-color: #f59e0b;
    color: #1f2937;
}

/* Forms */
.form-control,
.form-select,
.input-group-text {
    border-radius: 10px;
    border-color: #dfe5f0;
    color: #1e293b;
}

.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group > .input-group-text:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    background: #f8fafc;
    color: #64748b;
}

.input-group > .btn {
    border-radius: 0 10px 10px 0;
}

.form-control:focus,
.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
}

/* Generic tables get the compact modern look */
.table {
    color: #334155;
}

.table thead th,
.table > :not(caption) > * > th {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    background: transparent;
    white-space: nowrap;
}

.table td {
    font-size: 0.87rem;
    vertical-align: middle;
}

.table > :not(caption) > * > * {
    border-bottom-color: #f1f5f9;
}

/* List groups inside cards */
.list-group-item {
    border-color: #f1f5f9;
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
}

/* Dropdowns */
.dropdown-menu {
    border-radius: 12px;
    border: 1px solid #eef1f6;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
    padding: 0.4rem;
}

.dropdown-item {
    border-radius: 8px;
    font-size: 0.88rem;
    padding: 0.5rem 0.75rem;
}

/* Modals */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.modal-header {
    border-bottom-color: #eef1f6;
}

.modal-footer {
    border-top-color: #eef1f6;
}

/* Pagination */
.page-link {
    border-radius: 8px;
    color: #475569;
}

.page-item.active .page-link {
    background-color: var(--sidebar-active);
    border-color: var(--sidebar-active);
}

/* Badges */
.badge {
    border-radius: 6px;
    font-weight: 600;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.85rem;
}

/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(160deg, #1e2547 0%, #2f3a6e 55%, #2f6fed 130%);
}

.auth-page-inner {
    width: 100%;
    max-width: 480px;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(10, 15, 40, 0.4);
    padding: 2.5rem 2.25rem;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    text-align: center;
}

.auth-brand .brand-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 1.5rem;
}

.auth-brand-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
}

.auth-brand-subtitle {
    font-size: 0.85rem;
    color: #64748b;
}
