@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #1a5f7a;
    --primary-dark: #134b61;
    --primary-light: #2980b9;
    --secondary-color: #159895;
    --accent-color: #57c5b6;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --sidebar-width: 280px;
    --header-height: 60px;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    margin: 0;
    padding: 0;
    background-color: var(--gray-100);
    color: var(--dark-color);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.nav-menu {
    padding: 1rem 0;
}

.nav-item {
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,0.8);
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: var(--white);
    border-left: 4px solid var(--accent-color);
}

.nav-item .icon {
    width: 20px;
    text-align: center;
}

.nav-section-title {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    font-weight: 600;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-badge {
    position: relative;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.notification-badge:hover {
    background: var(--gray-100);
}

.notification-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger-color);
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 50%;
    min-width: 18px;
    text-align: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: background 0.2s ease;
}

.user-menu:hover {
    background: var(--gray-100);
}

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

.user-info {
    text-align: left;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-600);
}

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

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: none;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background: rgba(26, 95, 122, 0.1); color: var(--primary-color); }
.stat-icon.success { background: rgba(39, 174, 96, 0.1); color: var(--success-color); }
.stat-icon.warning { background: rgba(243, 156, 18, 0.1); color: var(--warning-color); }
.stat-icon.danger { background: rgba(231, 76, 60, 0.1); color: var(--danger-color); }
.stat-icon.info { background: rgba(52, 152, 219, 0.1); color: var(--info-color); }

.stat-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.stat-content p {
    margin: 0.25rem 0 0;
    color: var(--gray-600);
    font-size: 0.85rem;
}

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

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

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

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

.btn-success:hover {
    background: #219a52;
}

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

.btn-danger:hover {
    background: #c0392b;
}

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

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

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

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

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

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--gray-100);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table tr:hover {
    background: var(--gray-100);
}

/* Status Badges */
.badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success { background: rgba(39, 174, 96, 0.15); color: var(--success-color); }
.badge-warning { background: rgba(243, 156, 18, 0.15); color: #d68910; }
.badge-danger { background: rgba(231, 76, 60, 0.15); color: var(--danger-color); }
.badge-info { background: rgba(52, 152, 219, 0.15); color: var(--info-color); }
.badge-secondary { background: var(--gray-200); color: var(--gray-700); }
.badge-primary { background: rgba(26, 95, 122, 0.15); color: var(--primary-color); }

/* Priority badges */
.priority-e { background: rgba(231, 76, 60, 0.15); color: var(--danger-color); }
.priority-m { background: rgba(243, 156, 18, 0.15); color: #d68910; }
.priority-f { background: rgba(39, 174, 96, 0.15); color: var(--success-color); }

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, var(--secondary-color) 100%);
    padding: 2rem;
}

.login-container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    background: var(--gray-100);
    padding: 2rem;
    text-align: center;
}

.login-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.login-body {
    padding: 2rem;
}

.login-footer {
    padding: 1rem 2rem;
    background: var(--gray-100);
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success { background: rgba(39, 174, 96, 0.1); border-left: 4px solid var(--success-color); color: var(--success-color); }
.alert-danger { background: rgba(231, 76, 60, 0.1); border-left: 4px solid var(--danger-color); color: var(--danger-color); }
.alert-warning { background: rgba(243, 156, 18, 0.1); border-left: 4px solid var(--warning-color); color: #d68910; }
.alert-info { background: rgba(52, 152, 219, 0.1); border-left: 4px solid var(--info-color); color: var(--info-color); }

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
}

.modal-backdrop.show {
    display: block;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2050;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    position: relative;
    width: auto;
    max-width: 600px;
    margin: 1rem;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--white);
    border-radius: var(--border-radius);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

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

.modal-close:hover {
    color: var(--dark-color);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Bootstrap-like close button */
.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.375rem;
    opacity: 0.5;
    cursor: pointer;
}

.btn-close:hover {
    opacity: 1;
}

/* Bootstrap badges */
.bg-primary { background-color: var(--primary-color) !important; color: white; }
.bg-secondary { background-color: var(--gray-600) !important; color: white; }
.bg-success { background-color: var(--success-color) !important; color: white; }
.bg-danger { background-color: var(--danger-color) !important; color: white; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-info { background-color: var(--info-color) !important; color: white; }

.text-dark { color: var(--dark-color) !important; }

/* Form switch */
.form-check-input[type="checkbox"] {
    width: 1em;
    height: 1em;
    margin-top: 0.25em;
    vertical-align: top;
    background-color: #fff;
    border: 1px solid var(--gray-400);
    border-radius: 0.25em;
    appearance: none;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.form-switch .form-check-input {
    width: 2em;
    height: 1.1em;
    background-color: var(--gray-400);
    border-radius: 2em;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
    background-position: left center;
    background-repeat: no-repeat;
    background-size: contain;
    transition: background-position 0.15s ease-in-out;
}

.form-switch .form-check-input:checked {
    background-position: right center;
    background-color: var(--primary-color);
}

.form-check-label {
    cursor: pointer;
}

/* Utility classes */
.d-flex { display: flex !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.gap-2 { gap: 0.5rem !important; }
.fw-bold { font-weight: 700 !important; }

.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border-sm {
    width: 0.75rem;
    height: 0.75rem;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Disabled buttons */
.btn:disabled, .btn.disabled {
    opacity: 0.65;
    pointer-events: none;
}

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.75rem;
}

.col {
    flex: 1;
    padding: 0.75rem;
}

.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0.75rem; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0.75rem; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0.75rem; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0.75rem; }

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

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-600);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: var(--gray-100);
}

.notification-item.unread {
    background: rgba(26, 95, 122, 0.05);
}

/* ============================================
   Hamburger button (visible mobile only)
   ============================================ */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.hamburger-btn:hover {
    border-color: var(--primary-color);
}

.hamburger-btn:hover span {
    background: var(--primary-color);
}

/* Sidebar close button (visible mobile only) */
.sidebar-close-btn {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.sidebar-close-btn:hover {
    color: var(--white);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Bootstrap-like responsive grid (col-md-*) */
.col-md-2, .col-md-3, .col-md-4 {
    padding: 0.75rem;
}

/* Row with gap utility (Bootstrap g-3) */
.row.g-3 {
    margin: -0.5rem;
}

.row.g-3 > [class*="col"] {
    padding: 0.5rem;
}

.align-items-end {
    align-items: flex-end !important;
}

/* ============================================
   Responsive - Tablet (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

    .sidebar-overlay {
        display: block;
    }

    .sidebar-close-btn {
        display: block;
    }

    .hamburger-btn {
        display: flex;
    }

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

    .col-4, .col-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-2 {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }

    .col-md-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .content-area {
        padding: 1.5rem;
    }

    .top-header {
        padding: 0 1rem;
    }

    /* Hide user info text, keep avatar */
    .user-info {
        display: none;
    }
}

/* ============================================
   Responsive - Mobile (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .col-6, .col-4, .col-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .col-md-2, .col-md-3, .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

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

    .page-header > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }

    .page-header .btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .page-breadcrumb {
        font-size: 0.75rem;
    }

    .content-area {
        padding: 1rem;
    }

    /* Tabs: horizontal scroll */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    /* Tables: compact */
    .table th, .table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8rem;
    }

    .table th {
        font-size: 0.7rem;
    }

    /* Cards: reduce padding */
    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    /* Stat cards: stack */
    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .stat-content h3 {
        font-size: 1.35rem;
    }

    .stat-content p {
        font-size: 0.8rem;
    }

    /* Top header compact */
    .top-header {
        height: 52px;
        padding: 0 0.75rem;
    }

    .site-label {
        font-size: 0.8rem;
        display: none;
    }

    .header-right {
        gap: 0.5rem;
    }

    .user-menu {
        padding: 0.25rem 0.5rem;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    /* Notification dropdown: full width on mobile */
    .notification-dropdown {
        position: fixed !important;
        top: 52px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: calc(100vh - 52px);
        border-radius: 0;
    }

    /* Modals: near full screen on mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-dialog-centered {
        min-height: calc(100% - 1rem);
    }

    .modal-content {
        max-height: calc(100vh - 1rem);
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .modal-footer .btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }

    /* Forms compact */
    .form-control {
        padding: 0.625rem 0.75rem;
        font-size: 0.85rem;
    }

    .form-label {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }

    /* Filters row: stack */
    .row.g-3 {
        margin: -0.375rem;
    }

    .row.g-3 > [class*="col"] {
        padding: 0.375rem;
    }

    /* Buttons */
    .btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.875rem;
    }

    .btn-sm {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Badges */
    .badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.65rem;
    }

    /* Empty state */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state-icon {
        font-size: 3rem;
    }

    /* Login page */
    .login-page {
        padding: 1rem;
    }

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

    .login-header {
        padding: 1.5rem;
    }

    .login-body {
        padding: 1.5rem;
    }

    /* Alert */
    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   Responsive - Small phone (max-width: 480px)
   ============================================ */
@media (max-width: 480px) {
    .content-area {
        padding: 0.75rem;
    }

    .page-title {
        font-size: 1.1rem;
    }

    /* Action buttons: icon-only on very small screens */
    .table .btn-sm {
        padding: 0.25rem 0.4rem;
        font-size: 0.7rem;
    }

    /* Sidebar wider on very small phones */
    .sidebar {
        width: 85vw;
    }

    .card-body {
        padding: 0.75rem;
    }

    .table th, .table td {
        padding: 0.5rem 0.375rem;
        font-size: 0.75rem;
    }

    h1 { font-size: 1.25rem; }
    h2 { font-size: 1.1rem; }
    h3 { font-size: 1rem; }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: var(--gray-600); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.w-100 { width: 100%; }

/* ============================================
   Modal de reconnexion SignalR
   ============================================ */

#components-reconnect-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

#components-reconnect-modal.components-reconnect-show {
    display: flex;
}

#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

.reconnect-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 360px;
}
.reconnect-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid var(--primary-color, #1a5f7a);
    border-radius: 50%;
    animation: reconnect-spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes reconnect-spin {
    to { transform: rotate(360deg); }
}

.reconnect-text {
    font-size: 1rem;
    color: #6c757d;
    margin: 0;
}

.reconnect-failed-text {
    display: none;
    font-size: 0.95rem;
    color: var(--danger-color, #e74c3c);
    margin: 0 0 1rem;
}

.reconnect-reload-btn {
    display: none;
    background-color: var(--primary-color, #1a5f7a);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
}

.reconnect-reload-btn:hover {
    background-color: var(--primary-dark, #134b61);
}

/* Echec de reconnexion : cacher spinner, montrer message + bouton */
#components-reconnect-modal.components-reconnect-failed .reconnect-spinner,
#components-reconnect-modal.components-reconnect-rejected .reconnect-spinner {
    display: none;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-text,
#components-reconnect-modal.components-reconnect-rejected .reconnect-text {
    display: none;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-failed-text,
#components-reconnect-modal.components-reconnect-rejected .reconnect-failed-text {
    display: block;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-reload-btn,
#components-reconnect-modal.components-reconnect-rejected .reconnect-reload-btn {
    display: inline-block;
}
