/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #E65100;
    --primary-light: #F57C00;
    --secondary: #FF9800;
    --accent: #FFB74D;
    --success: #4CAF50;
    --warning: #FF9800;
    --danger: #F44336;
    --bg: #FFF8F0;
    --card: #FFFFFF;
    --text: #1A1A2E;
    --text-secondary: #6B7280;
    --border: #F0E0D0;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --bottomnav-height: 60px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

.hidden { display: none !important; }

/* ========== LOGIN PAGE ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('https://mgx-backend-cdn.metadl.com/generate/images/361428/2026-03-03/00e33f03-9cc0-4019-83f1-3982e983b5f2.png') center/cover no-repeat;
    position: relative;
    padding: 16px;
}

.login-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 40, 0.75);
    backdrop-filter: blur(4px);
}

.login-container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.6s ease;
}

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

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

.login-logo .logo-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 12px;
}

.login-logo h1 {
    font-size: 28px;
    color: var(--primary);
    font-weight: 700;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

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

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.login-form label i {
    color: var(--secondary);
    margin-right: 6px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
    outline: none;
}

.login-form input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.15);
}

.error-msg {
    background: #FEE2E2;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}

/* Password Input Wrapper with Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-input-wrapper input {
    flex: 1;
    padding-right: 44px !important;
}
.password-input-wrapper .toggle-password-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary, #8899aa);
    cursor: pointer;
    padding: 6px 8px;
    font-size: 15px;
    transition: color 0.2s;
    z-index: 2;
}
.password-input-wrapper .toggle-password-btn:hover {
    color: var(--secondary, #FFD54F);
}

/* Lockout Message */
.lockout-msg {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #92400E;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
    border: 1px solid #F59E0B;
    animation: lockoutPulse 2s ease-in-out infinite;
}
.lockout-msg i {
    margin-right: 6px;
    font-size: 16px;
}
.lockout-timer {
    font-weight: 700;
    font-size: 18px;
    margin-top: 8px;
    color: #B45309;
    font-variant-numeric: tabular-nums;
}
@keyframes lockoutPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 6px;
    margin-bottom: 8px;
}
.password-strength-bar {
    height: 4px;
    border-radius: 4px;
    background: var(--border-color, #2a3a4a);
    overflow: hidden;
    margin-bottom: 4px;
}
.password-strength-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
    width: 0%;
}
.password-strength-text {
    font-size: 11px;
    font-weight: 500;
    text-align: right;
}
.strength-weak { background-color: #EF4444; }
.strength-fair { background-color: #F59E0B; }
.strength-good { background-color: #3B82F6; }
.strength-strong { background-color: #10B981; }
.strength-text-weak { color: #EF4444; }
.strength-text-fair { color: #F59E0B; }
.strength-text-good { color: #3B82F6; }
.strength-text-strong { color: #10B981; }

/* Session Timeout Warning */
.session-timeout-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.session-timeout-modal {
    background: var(--card-bg, #1e2a3a);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color, #2a3a4a);
}
.session-timeout-modal i {
    font-size: 48px;
    color: #F59E0B;
    margin-bottom: 16px;
}
.session-timeout-modal h3 {
    color: var(--text-primary, #e0e0e0);
    margin-bottom: 8px;
    font-size: 20px;
}
.session-timeout-modal p {
    color: var(--text-secondary, #8899aa);
    margin-bottom: 20px;
    font-size: 14px;
}
.session-timeout-modal .timeout-timer {
    font-size: 32px;
    font-weight: 700;
    color: #F59E0B;
    margin-bottom: 20px;
    font-variant-numeric: tabular-nums;
}
.session-timeout-modal .btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.session-timeout-modal .btn-group .btn {
    min-width: 120px;
}

/* Forgot Password Link */
.login-forgot {
    text-align: center;
    margin: 12px 0 0 0;
}
.login-forgot a {
    color: #25D366;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}
.login-forgot a:hover {
    color: #128C7E;
    text-decoration: underline;
}
.login-forgot a i {
    margin-right: 5px;
}

/* Reset Password Modal */
.modal-reset-password {
    max-width: 480px !important;
}
.reset-description {
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.reset-description i {
    color: #25D366;
    margin-right: 5px;
}
.form-hint {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    opacity: 0.8;
}
.reset-success-icon {
    text-align: center;
    margin: 10px 0 20px;
}
.reset-success-icon i {
    font-size: 64px;
    color: #25D366;
    animation: resetPulse 1.5s ease-in-out infinite;
}
@keyframes resetPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}
.reset-success-title {
    text-align: center;
    color: #25D366;
    font-size: 20px;
    margin-bottom: 12px;
}
.reset-success-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}
.reset-success-hint {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
}
.reset-success-hint i {
    color: #FFC107;
    margin-right: 5px;
}
.success-msg {
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.3);
    color: #25D366;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}
.btn-success {
    background: #25D366 !important;
    color: #fff !important;
    border: none;
}
.btn-success:hover {
    background: #128C7E !important;
}

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

.login-footer p {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    white-space: nowrap;
    touch-action: manipulation;
}

.btn i { font-size: 14px; }

.btn-primary {
    background: var(--secondary);
    color: #fff;
}
.btn-primary:hover { background: #F57C00; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3); }

.btn-secondary {
    background: #E5E7EB;
    color: var(--text);
}
.btn-secondary:hover { background: #D1D5DB; }

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: #388E3C; }

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover { background: #D32F2F; }

.btn-warning {
    background: var(--warning);
    color: #fff;
}
.btn-warning:hover { background: #E65100; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn-full { width: 100%; justify-content: center; padding: 14px; font-size: 16px; }

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text);
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
    touch-action: manipulation;
}
.btn-icon:hover { background: rgba(0,0,0,0.05); }

.btn-logout {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    width: 100%;
    justify-content: center;
    padding: 10px;
    font-size: 13px;
}
.btn-logout:hover { background: rgba(255,255,255,0.2); }

.btn-group { display: flex; gap: 10px; flex-wrap: wrap; }

/* ========== APP LAYOUT ========== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR OVERLAY ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary) 0%, #BF360C 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s;
}

.sidebar.collapsed { transform: translateX(-100%); }

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    flex: 1;
}

.btn-close-sidebar {
    display: none;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.3s;
}
.btn-close-sidebar:hover { color: #fff; background: rgba(255,255,255,0.1); }

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
}

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

.nav-item.active {
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.nav-item i { width: 20px; text-align: center; font-size: 16px; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
}

.user-info i { font-size: 32px; margin-bottom: 6px; color: var(--accent); }
.user-info span { font-size: 14px; font-weight: 600; }
.user-info small { font-size: 11px; color: rgba(255,255,255,0.6); text-transform: capitalize; }

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s;
    min-width: 0;
}

.sidebar.collapsed + .main-content { margin-left: 0; }

.top-bar {
    height: var(--topbar-height);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.top-bar h2 { font-size: 18px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-badge {
    background: var(--bg);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

.content-area {
    padding: 24px;
}

/* ========== PAGES ========== */
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }

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

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

.page-header h3 { font-size: 20px; font-weight: 700; }

/* ========== TABLE RESPONSIVE ========== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1.5px solid #F0D6B0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(230, 81, 0, 0.04);
}

.table-responsive .table {
    margin-bottom: 0;
}

/* When table-responsive is directly inside card-body, blend seamlessly */
.card-body > .table-responsive {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* When DataTables wrapper is inside card-body */
.card-body > .dataTables_wrapper .table-responsive {
    border: 1.5px solid #F0D6B0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(230, 81, 0, 0.04);
}

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

.stat-card {
    background: var(--card);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}

.stat-blue .stat-icon { background: linear-gradient(135deg, var(--secondary), #E65100); }
.stat-green .stat-icon { background: linear-gradient(135deg, var(--success), #2E7D32); }
.stat-cyan .stat-icon { background: linear-gradient(135deg, var(--accent), #F57C00); }
.stat-orange .stat-icon { background: linear-gradient(135deg, var(--warning), #BF360C); }

.stat-info h3 { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-info p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ========== CARDS ========== */
.card {
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i { color: var(--secondary); }

.card-body { padding: 24px; }

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

/* ========== TABLES ========== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px;
}

.table thead th {
    background: linear-gradient(180deg, #FFF3E0 0%, #FFE0B2 100%);
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--primary);
    border-bottom: 3px solid var(--secondary);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table thead th:first-child {
    border-radius: 8px 0 0 0;
}

.table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.table tbody td {
    padding: 13px 16px;
    font-size: 14px;
    border-bottom: 1px solid #FFF3E0;
    vertical-align: middle;
    transition: all 0.2s ease;
}

.table tbody td:first-child {
    font-weight: 600;
    color: #BF360C;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: #FFF3E0;
    box-shadow: inset 4px 0 0 var(--secondary);
}

.table tbody tr:nth-child(odd) {
    background: #FFFAF5;
}

.table tbody tr:nth-child(odd):hover {
    background: #FFF3E0;
    box-shadow: inset 4px 0 0 var(--secondary);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:last-child td:first-child {
    border-radius: 0 0 0 8px;
}

.table tbody tr:last-child td:last-child {
    border-radius: 0 0 8px 0;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 18px;
    flex: 1;
    min-width: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    outline: none;
    font-family: inherit;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}

.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.15);
}

textarea.form-control { resize: vertical; }

select.form-control { cursor: pointer; }

.form-row {
    display: flex;
    gap: 16px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.form-actions-inline {
    display: flex;
    align-items: flex-end;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group .form-control { flex: 1; }

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .form-control {
    max-width: 200px;
    border-color: #F0D6B0;
    background: #FFFAF5;
}

.filter-bar .form-control:focus {
    border-color: var(--secondary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 152, 0, 0.12);
}

/* ========== TABS ========== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--card);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
    color: var(--text-secondary);
    touch-action: manipulation;
}

.tab-btn.active {
    background: var(--secondary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.demande-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.demande-tab-btn {
    flex: 1;
    padding: 16px 24px;
    border: 2px solid var(--border);
    background: var(--card);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    touch-action: manipulation;
}

.demande-tab-btn.active {
    border-color: var(--secondary);
    color: var(--secondary);
    background: rgba(255, 152, 0, 0.05);
}

.demande-tab-content { display: none; }
.demande-tab-content.active { display: block; }

/* ========== QR SECTION ========== */
.qr-section {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.qr-scan-area {
    flex: 1;
    min-width: 250px;
}

.qr-reader-box {
    border: 3px dashed var(--border);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

.qr-reader-box:hover { border-color: var(--secondary); }

.qr-reader-box i { color: var(--secondary); margin-bottom: 12px; }
.qr-reader-box p { margin-bottom: 16px; font-size: 14px; }

#qrVideoEl {
    width: 100%;
    max-width: 300px;
    border-radius: 12px;
}

#qrVideo {
    text-align: center;
    margin-bottom: 16px;
}

#qrVideo video {
    border: 3px solid var(--secondary);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.2);
}

#qrCanvas {
    display: none;
}

.qr-manual { margin-top: 16px; }
.qr-manual label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }

.client-info-card {
    flex: 1;
    min-width: 250px;
    background: rgba(255, 152, 0, 0.05);
    border: 2px solid var(--secondary);
    border-radius: 14px;
    padding: 24px;
}

.client-info-card h4 {
    color: var(--secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== MODAL ========== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s;
    padding: 16px;
}

.modal-content {
    background: var(--card);
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    -webkit-overflow-scrolling: touch;
}

.modal-lg { max-width: 700px; }

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

.modal-header h3 { font-size: 18px; font-weight: 700; }

.btn-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    flex-shrink: 0;
}

.btn-close:hover { background: #E5E7EB; }

.modal-body { padding: 24px; }

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.2px;
    line-height: 1.3;
}

.badge-success { background: #E8F5E9; color: #2E7D32; border: 1px solid rgba(46, 125, 50, 0.15); }
.badge-warning { background: #FFF3E0; color: #E65100; border: 1px solid rgba(230, 81, 0, 0.15); }
.badge-danger { background: #FFEBEE; color: #C62828; border: 1px solid rgba(198, 40, 40, 0.15); }
.badge-info { background: #FFF3E0; color: #E65100; border: 1px solid rgba(230, 81, 0, 0.15); }
.badge-primary { background: #FFF3E0; color: var(--secondary); border: 1px solid rgba(255, 152, 0, 0.15); }

/* ========== FIDELITE CARD ========== */
.carte-preview {
    margin-top: 24px;
    text-align: center;
}

.fidelite-card {
    width: 340px;
    max-width: 100%;
    margin: 0 auto 24px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.fidelite-card-front {
    background: linear-gradient(160deg, #E65100 0%, #BF360C 60%, #8D2000 100%);
    padding: 32px 28px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.fidelite-card-front::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 140px;
    height: 140px;
    background: rgba(255, 152, 0, 0.12);
    border-radius: 50%;
}

.fidelite-card-front::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    background: rgba(255, 183, 77, 0.1);
    border-radius: 50%;
}

.fidelite-card-front > * { position: relative; z-index: 1; }

.fidelite-header-centered {
    margin-bottom: 16px;
}

.fidelite-logo-large {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.fidelite-id-centered {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.95);
    margin-bottom: 20px;
    padding: 6px 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.15);
}

.fidelite-qr-large {
    background: #fff;
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    display: inline-block;
}

.fidelite-qr-large canvas {
    display: block;
}

.fidelite-slogan {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.15);
    width: 100%;
}

.fidelite-slogan p {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #FFB74D;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.carte-actions { margin-top: 16px; }

/* ========== TICKET PRINT (ISO A8: 52mm x 74mm) ========== */
.ticket-print {
    display: none;
    page: ticket;
}

@page ticket {
    size: 52mm 74mm;
    margin: 1.5mm;
}

@media print {
    body * { visibility: hidden; }
    .ticket-print, .ticket-print * { visibility: visible; }
    .ticket-print {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 49mm;
        height: 71mm;
        max-height: 71mm;
        overflow: hidden;
        background: #fff;
        padding: 1.5mm;
        font-size: 7px;
        line-height: 1.2;
    }
}

.ticket-content {
    font-family: 'Courier New', monospace;
    font-size: 7px;
    line-height: 1.2;
}

.ticket-content .ticket-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 3px;
    margin-bottom: 3px;
}

.ticket-content .ticket-body { margin-bottom: 3px; }

.ticket-content .ticket-row {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
}

.ticket-content .ticket-footer {
    text-align: center;
    border-top: 1px dashed #000;
    padding-top: 3px;
    margin-top: 3px;
}

/* ========== TOAST ========== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: calc(100vw - 40px);
}

.toast {
    padding: 14px 20px;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 100%;
    word-break: break-word;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--secondary); }
.toast-warning { background: var(--warning); }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========== TOP CLIENTS ========== */
.top-clients-list .client-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.top-clients-list .client-item:last-child { border-bottom: none; }

.client-item-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.client-item-info .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--secondary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.client-item-name { font-weight: 600; font-size: 14px; }
.client-item-id { font-size: 12px; color: var(--text-secondary); }
.client-item-count { font-weight: 700; color: var(--secondary); font-size: 14px; white-space: nowrap; }

/* ========== PROFIL CLIENT DETAIL ========== */
.profil-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.profil-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF9800, #FFB74D);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    flex-shrink: 0;
}

.profil-info h3 { font-size: 20px; margin-bottom: 4px; }
.profil-info p { color: var(--text-secondary); font-size: 14px; }

.profil-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.profil-stat {
    text-align: center;
    padding: 16px;
    background: var(--bg);
    border-radius: 12px;
}

.profil-stat h4 { font-size: 24px; color: var(--secondary); }
.profil-stat p { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ========== CHART ========== */
canvas { max-width: 100%; }

/* ========== WHATSAPP SECTION ========== */
.wa-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.wa-status-ok {
    background: #E8F5E9;
    color: #2E7D32;
}

.wa-status-warning {
    background: #FFF3E0;
    color: #E65100;
}

.wa-status-error {
    background: #FFEBEE;
    color: #C62828;
}

.wa-filter-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.wa-filter-row .form-control {
    max-width: 250px;
}

.wa-select-all-label {
    font-size: 14px;
    white-space: nowrap;
}

.wa-selected-count {
    display: block;
    font-size: 13px;
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 12px;
}

.wa-clients-list {
    max-height: 300px;
    overflow-y: auto;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.wa-client-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.wa-client-item:hover {
    background: rgba(255, 152, 0, 0.05);
}

.wa-client-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.wa-client-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.wa-client-name {
    font-weight: 600;
    font-size: 14px;
}

.wa-client-phone {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========== WHATSAPP ATTACHMENT ========== */
.wa-attachment-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    transition: border-color 0.3s, background 0.3s;
    overflow: hidden;
}

.wa-attachment-zone.dragover {
    border-color: var(--secondary);
    background: rgba(255, 152, 0, 0.05);
}

.wa-attachment-empty {
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    color: var(--text-secondary);
}

.wa-attachment-empty i {
    font-size: 32px;
    color: var(--secondary);
    margin-bottom: 10px;
    display: block;
}

.wa-attachment-empty p {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.wa-attachment-empty small {
    font-size: 12px;
    color: var(--text-secondary);
    display: block;
}

.wa-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.wa-attachment-preview {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}

.wa-attachment-info {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.wa-attachment-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    background: #FFF3E0;
    color: var(--secondary);
}

.wa-attachment-icon.icon-image { background: #E8F5E9; color: #2E7D32; }
.wa-attachment-icon.icon-pdf { background: #FFEBEE; color: #C62828; }
.wa-attachment-icon.icon-doc { background: #FFF3E0; color: #E65100; }
.wa-attachment-icon.icon-excel { background: #E8F5E9; color: #2E7D32; }

.wa-attachment-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.wa-attachment-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-attachment-size {
    font-size: 12px;
    color: var(--text-secondary);
}

.wa-attachment-img-preview {
    width: 100%;
    max-width: 200px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.wa-attachment-img-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========== BOTTOM NAVIGATION (Mobile) ========== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottomnav-height);
    background: var(--card);
    border-top: 1px solid var(--border);
    z-index: 90;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 8px;
    transition: all 0.2s;
    gap: 2px;
    min-width: 56px;
    touch-action: manipulation;
}

.bottom-nav-item i {
    font-size: 18px;
}

.bottom-nav-item.active {
    color: var(--secondary);
}

.bottom-nav-item:active {
    background: rgba(255, 152, 0, 0.1);
}

/* ========== ACTION BUTTONS IN TABLE ========== */
.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.action-btns .btn {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(230, 81, 0, 0.1);
    transition: all 0.25s ease;
}

.action-btns .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 81, 0, 0.15);
}

.action-btns .btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, #E65100 100%);
    border: none;
}

.action-btns .btn-danger {
    background: linear-gradient(135deg, #F44336 0%, #D32F2F 100%);
    border: none;
}

.action-btns .btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    border: none;
}

.action-btns .btn-warning {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    border: none;
}

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

.empty-state i { font-size: 48px; margin-bottom: 16px; color: var(--border); }
.empty-state p { font-size: 15px; }

/* ========== SIDEBAR NAV DIVIDER ========== */
.sidebar-nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 12px 8px;
}

/* ========== ACCESS MANAGEMENT ========== */
.am-section-title {
    margin-bottom: 16px;
}

.am-section-title h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.am-section-title h4 i {
    color: var(--secondary);
}

.am-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
    padding: 12px 16px;
    background: rgba(255, 152, 0, 0.04);
    border-left: 3px solid var(--secondary);
    border-radius: 0 8px 8px 0;
}

/* Roles Grid */
.am-roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.am-role-card {
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.am-role-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.am-role-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.am-role-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}

.am-role-icon-administrateur { background: linear-gradient(135deg, #F44336, #D32F2F); }
.am-role-icon-comptable { background: linear-gradient(135deg, #4CAF50, #2E7D32); }
.am-role-icon-laveur { background: linear-gradient(135deg, #FF9800, #E65100); }
.am-role-icon-wrapper:not(.am-role-icon-administrateur):not(.am-role-icon-comptable):not(.am-role-icon-laveur) {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

.am-role-info {
    flex: 1;
    min-width: 0;
}

.am-role-info h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.am-role-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.am-role-stats {
    display: flex;
    padding: 14px 20px;
    gap: 16px;
}

.am-role-stat {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: var(--bg);
    border-radius: 10px;
}

.am-role-stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary);
}

.am-role-stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Access Management Table */
.am-table {
    min-width: auto;
}

.am-table thead th {
    text-align: center;
    padding: 12px 14px;
}

.am-page-label-th,
.am-action-label-th {
    text-align: left !important;
    min-width: 180px;
}

.am-role-th {
    min-width: 120px;
    text-align: center !important;
}

.am-page-cell {
    padding: 10px 16px !important;
}

.am-page-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.am-page-icon {
    width: 20px;
    text-align: center;
    color: var(--secondary);
    font-size: 14px;
}

.am-toggle-cell {
    text-align: center !important;
    padding: 8px 12px !important;
}

.am-action-label-cell {
    padding: 10px 16px !important;
}

.am-action-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* Toggle Switch */
.am-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.am-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.am-toggle-slider {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 24px;
    transition: all 0.3s;
}

.am-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.am-toggle input:checked + .am-toggle-slider {
    background: var(--success);
}

.am-toggle input:checked + .am-toggle-slider::before {
    transform: translateX(20px);
}

.am-toggle input:disabled + .am-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Module Cards */
.am-module-card {
    background: var(--bg);
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.am-module-header {
    padding: 14px 20px;
    background: rgba(255, 152, 0, 0.06);
    border-bottom: 1px solid var(--border);
}

.am-module-header h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.am-module-header h4 i {
    color: var(--secondary);
    font-size: 13px;
}

.am-module-card .table {
    min-width: auto;
    margin: 0;
}

.am-module-card .table thead th {
    background: transparent;
    border-bottom: 1px solid var(--border);
}

.am-module-card .table tbody td {
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.am-module-card .table tbody tr:last-child td {
    border-bottom: none;
}

/* ========== PAYMENT METHOD BADGES ========== */
.badge-espece { background: #E8F5E9; color: #2E7D32; }
.badge-wave { background: #FFF3E0; color: #E65100; }
.badge-orange { background: #FFF3E0; color: #E65100; }
.badge-mtn { background: #FFFDE7; color: #F57F17; }

.payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.payment-badge-espece { background: #E8F5E9; color: #2E7D32; }
.payment-badge-wave { background: #E0F7FA; color: #00838F; }
.payment-badge-orange { background: #FFF3E0; color: #E65100; }
.payment-badge-mtn { background: #FFFDE7; color: #F57F17; }

/* ========== COUT PREVIEW ========== */
.cout-preview {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.08), rgba(255, 183, 77, 0.08));
    border: 2px solid var(--secondary);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

.cout-preview-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.cout-preview-amount {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
}

/* ========== VALIDATION SUMMARY ========== */
.validation-summary {
    background: var(--bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.validation-summary .val-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.validation-summary .val-row:last-child {
    border-bottom: none;
    padding-top: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary);
}

.validation-summary .val-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.validation-summary .val-value {
    font-weight: 600;
    color: var(--text);
}

/* ========== PRINT CARTE ========== */
@media print {
    .fidelite-card {
        box-shadow: none;
        border: 2px solid #E65100;
    }
    .fidelite-card-front::before,
    .fidelite-card-front::after {
        display: none;
    }
}

/* ========== GESTION DES LAVEURS ========== */
.laveur-commission-amount {
    color: var(--warning);
    font-weight: 700;
    font-size: 14px;
}

.laveur-commission-total {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.laveur-total-row {
    background: linear-gradient(135deg, #E65100 0%, #F57C00 60%, #FF9800 100%);
    color: #fff;
}

.laveur-total-row td {
    color: #fff !important;
    padding: 14px 16px !important;
    font-size: 15px;
    border-bottom: none !important;
}

.laveur-detail-total {
    margin-top: 24px;
    background: var(--bg);
    border-radius: 12px;
    padding: 20px;
}

.laveur-detail-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
}

.laveur-detail-total-row:last-child {
    border-bottom: none;
    padding-top: 14px;
}

.laveur-detail-total-commission {
    font-size: 18px;
    color: var(--warning);
}

.laveur-detail-total-commission strong {
    color: var(--warning);
    font-size: 20px;
}

/* ========== FORMULE CAROUSEL ========== */
.demande-step {
    animation: fadeIn 0.3s ease;
}

.carousel-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.carousel-filter-btn {
    padding: 8px 16px;
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--card);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

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

.carousel-filter-btn.active {
    background: linear-gradient(135deg, var(--secondary), #FFB74D);
    color: #fff;
    border-color: transparent;
}

.formule-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.carousel-nav-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
}

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

.formule-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 8px 4px;
    flex: 1;
    scrollbar-width: none;
}

.formule-carousel::-webkit-scrollbar {
    display: none;
}

.formule-card {
    flex: 0 0 260px;
    scroll-snap-align: start;
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.formule-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: var(--secondary);
}

.formule-card.selected {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.3), 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

.formule-card.selected::after {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: var(--secondary);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.formule-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.formule-card-body {
    padding: 14px 16px;
}

.formule-card-type {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: rgba(255, 152, 0, 0.1);
    color: var(--secondary);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.formule-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.formule-card-detail {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.formule-card-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.formule-card-price small {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot.active {
    background: var(--secondary);
    width: 24px;
    border-radius: 4px;
}

/* Selected formule preview */
.selected-formule-preview {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), rgba(255, 183, 77, 0.08));
    border: 2px solid var(--secondary);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

.selected-formule-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.selected-formule-icon {
    color: var(--success);
    font-size: 24px;
    flex-shrink: 0;
}

.selected-formule-info strong {
    display: block;
    font-size: 14px;
    color: var(--text);
}

.selected-formule-detail {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.selected-formule-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Step recap */
.step-recap {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.08), rgba(255, 183, 77, 0.06));
    border-left: 4px solid var(--secondary);
    border-radius: 0 12px 12px 0;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.step-recap-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-recap-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.step-recap-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.step-recap-text strong {
    display: block;
    font-size: 14px;
    color: var(--text);
}

.step-recap-text span {
    font-size: 12px;
    color: var(--text-secondary);
}

.step-recap-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--secondary);
}

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

/* ========== LARGE TABLET (max-width: 1024px) ========== */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== TABLET & MOBILE (max-width: 768px) ========== */
@media (max-width: 768px) {
    /* --- Sidebar --- */
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }

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

    /* --- Main content --- */
    .main-content {
        margin-left: 0;
        padding-bottom: var(--bottomnav-height);
    }

    /* --- Bottom nav --- */
    .bottom-nav {
        display: flex;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* --- Content area --- */
    .content-area {
        padding: 16px;
    }

    /* --- Top bar --- */
    .top-bar {
        padding: 0 12px;
        gap: 8px;
        height: 56px;
    }

    .top-bar h2 {
        font-size: 15px;
    }

    .top-bar-right #currentDate { display: none; }

    .user-badge {
        padding: 4px 10px;
        font-size: 12px;
    }

    /* --- Form rows stack on mobile --- */
    .form-row { 
        flex-direction: column; 
        gap: 0; 
    }

    /* --- Stats grid --- */
    .stats-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px; 
    }

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
        border-radius: 10px;
    }

    .stat-info h3 { font-size: 18px; }
    .stat-info p { font-size: 11px; }

    /* --- Filter bars --- */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar .form-control { max-width: 100%; }

    /* --- Demande tabs --- */
    .demande-tabs { 
        flex-direction: column; 
        gap: 8px; 
    }
    .demande-tab-btn { 
        padding: 14px 16px; 
        font-size: 14px; 
    }

    /* --- Carousel mobile --- */
    .formule-card {
        flex: 0 0 220px;
    }
    .formule-card-img {
        height: 110px;
    }
    .carousel-nav-btn {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }
    .carousel-filter-tabs {
        gap: 6px;
    }
    .carousel-filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .selected-formule-preview {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 12px 14px;
    }
    .selected-formule-info {
        flex-direction: column;
        text-align: center;
    }
    .step-recap {
        flex-direction: column;
        text-align: center;
    }

    /* --- QR section --- */
    .qr-section { flex-direction: column; }
    .qr-scan-area { min-width: 0; }
    .client-info-card { min-width: 0; }

    /* --- Fidelite card --- */
    .fidelite-card { width: 100%; max-width: 340px; }

    /* --- Profil stats --- */
    .profil-stats { grid-template-columns: 1fr; }
    .profil-header { 
        flex-direction: column; 
        text-align: center; 
    }

    /* --- Page header --- */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .page-header h3 { font-size: 17px; }

    .btn-group {
        width: 100%;
    }
    .btn-group .btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
    }

    /* --- Cards --- */
    .card-body { padding: 16px; }
    .card-header { padding: 14px 16px; }
    .card-header h3 { font-size: 14px; }

    /* --- Modal: bottom sheet style --- */
    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        animation: slideUpModal 0.3s ease;
    }

    @keyframes slideUpModal {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .modal-lg { max-width: 100%; }

    .modal-header {
        padding: 16px 20px;
        position: sticky;
        top: 0;
        background: var(--card);
        z-index: 1;
    }

    .modal-header h3 { font-size: 16px; }

    .modal-body { padding: 16px 20px; }

    /* --- Dashboard grid --- */
    .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }

    /* --- Tabs --- */
    .tabs { gap: 2px; padding: 3px; }
    .tab-btn { padding: 10px 12px; font-size: 13px; }

    /* --- WhatsApp --- */
    .wa-filter-row { flex-direction: column; align-items: stretch; }
    .wa-filter-row .form-control { max-width: 100%; }
    .wa-clients-list { max-height: 200px; }

    /* --- QR reader --- */
    .qr-reader-box { padding: 24px; }

    /* --- Hide button text on small screens --- */
    .btn-text { display: none; }

    /* --- Buttons: bigger touch targets --- */
    .btn {
        padding: 12px 16px;
        min-height: 44px;
    }
    .btn-sm { 
        padding: 8px 12px; 
        min-height: 36px; 
    }

    /* --- Form controls: bigger touch targets --- */
    .form-control {
        padding: 12px 14px;
        font-size: 16px; /* Prevents iOS zoom on focus */
        min-height: 44px;
    }

    /* --- Table adjustments --- */
    .table thead th {
        padding: 10px 12px;
        font-size: 11px;
        letter-spacing: 0.4px;
    }
    .table tbody td {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .table-responsive {
        border-radius: 8px;
    }

    /* --- Action buttons in table --- */
    .action-btns {
        flex-wrap: wrap;
        gap: 4px;
    }
    .action-btns .btn {
        padding: 8px 10px;
        min-height: 36px;
    }

    /* --- Toast on mobile --- */
    .toast-container {
        top: auto;
        bottom: calc(var(--bottomnav-height) + 12px);
        right: 12px;
        left: 12px;
        max-width: 100%;
    }

    .toast {
        min-width: 0;
        width: 100%;
        font-size: 13px;
        padding: 12px 16px;
    }

    /* --- Cout preview --- */
    .cout-preview {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 14px 16px;
    }
    .cout-preview-amount { font-size: 20px; }

    /* --- Validation summary --- */
    .validation-summary { padding: 14px; }
    .validation-summary .val-row { 
        font-size: 13px; 
        flex-wrap: wrap;
        gap: 4px;
    }
    .validation-summary .val-row:last-child { font-size: 16px; }

    /* --- Form actions --- */
    .form-actions {
        flex-direction: column;
    }
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* --- Access management --- */
    .am-roles-grid {
        grid-template-columns: 1fr;
    }

    .am-page-label-th,
    .am-action-label-th {
        min-width: 130px;
    }

    .am-role-th {
        min-width: 90px;
        font-size: 11px;
    }

    .am-toggle {
        width: 38px;
        height: 22px;
    }

    .am-toggle-slider::before {
        width: 16px;
        height: 16px;
    }

    .am-toggle input:checked + .am-toggle-slider::before {
        transform: translateX(16px);
    }

    .am-description {
        font-size: 12px;
        padding: 10px 12px;
    }

    /* --- Laveur detail --- */
    .laveur-detail-total { padding: 14px; }
    .laveur-detail-total-row { 
        font-size: 13px; 
        flex-wrap: wrap;
        gap: 4px;
    }
    .laveur-detail-total-commission { font-size: 15px; }
    .laveur-detail-total-commission strong { font-size: 17px; }

    /* --- Login adjustments --- */
    .login-container {
        padding: 32px 24px;
        border-radius: 16px;
    }

    .login-logo .logo-img {
        width: 64px;
        height: 64px;
    }

    .login-logo h1 { font-size: 22px; }
    .login-logo p { font-size: 12px; }

    .login-footer p { font-size: 10px; }

    /* --- Fidelite card mobile --- */
    .fidelite-card-front { padding: 24px 20px; }
    .fidelite-logo-large { width: 60px; height: 60px; }
    .fidelite-id-centered { font-size: 14px; }
    .fidelite-slogan p { font-size: 13px; }

    /* --- Input group --- */
    .input-group {
        flex-direction: row;
    }
    .input-group .btn {
        min-width: 44px;
        padding: 10px 14px;
    }

    /* --- Profil client --- */
    .profil-avatar {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    .profil-info h3 { font-size: 18px; }

    .profil-stat h4 { font-size: 20px; }
    .profil-stat p { font-size: 11px; }

    /* --- Empty state --- */
    .empty-state {
        padding: 32px 16px;
    }
    .empty-state i { font-size: 36px; }
    .empty-state p { font-size: 13px; }
}

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

    .content-area { padding: 10px; }

    .top-bar { 
        padding: 0 10px; 
        height: 52px;
    }
    .top-bar h2 { font-size: 14px; }

    /* --- Stat cards compact --- */
    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
        border-radius: 8px;
    }

    .stat-info h3 { font-size: 16px; }
    .stat-info p { font-size: 10px; }

    /* --- Cards --- */
    .card { border-radius: 12px; margin-bottom: 12px; }
    .card-body { padding: 12px; }
    .card-header { padding: 12px; }
    .card-header h3 { font-size: 13px; gap: 8px; }

    /* --- Page header --- */
    .page-header { margin-bottom: 16px; }
    .page-header h3 { font-size: 16px; }

    /* --- Buttons --- */
    .btn-group .btn {
        font-size: 12px;
        padding: 10px 8px;
    }

    /* --- Bottom nav compact --- */
    .bottom-nav-item {
        font-size: 9px;
        min-width: 48px;
        padding: 4px 6px;
    }
    .bottom-nav-item i { font-size: 16px; }

    /* --- Table compact --- */
    .table thead th {
        padding: 8px 8px;
        font-size: 10px;
    }
    .table tbody td {
        padding: 8px 8px;
        font-size: 12px;
    }

    /* --- Badge compact --- */
    .badge { padding: 3px 8px; font-size: 10px; }
    .payment-badge { padding: 3px 8px; font-size: 10px; }

    /* --- Demande tabs compact --- */
    .demande-tab-btn {
        padding: 12px;
        font-size: 13px;
        gap: 8px;
    }
    .demande-tab-btn i { font-size: 16px; }

    /* --- QR reader compact --- */
    .qr-reader-box {
        padding: 20px;
    }
    .qr-reader-box i { font-size: 2em; }
    .qr-reader-box p { font-size: 13px; margin-bottom: 12px; }

    /* --- Client info card compact --- */
    .client-info-card { padding: 16px; }

    /* --- Modal compact --- */
    .modal-content {
        max-height: 95vh;
    }
    .modal-header { padding: 14px 16px; }
    .modal-header h3 { font-size: 15px; }
    .modal-body { padding: 14px 16px; }

    /* --- Form group compact --- */
    .form-group { margin-bottom: 14px; }
    .form-group label { font-size: 12px; margin-bottom: 4px; }

    /* --- Cout preview compact --- */
    .cout-preview { padding: 12px; }
    .cout-preview-label { font-size: 13px; }
    .cout-preview-amount { font-size: 18px; }

    /* --- WhatsApp compact --- */
    .wa-clients-list { max-height: 180px; padding: 6px; }
    .wa-client-item { padding: 8px 10px; gap: 10px; }
    .wa-client-name { font-size: 13px; }
    .wa-client-phone { font-size: 11px; }

    /* --- Access management compact --- */
    .am-role-card-header { padding: 14px 16px; gap: 10px; }
    .am-role-icon-wrapper { width: 38px; height: 38px; font-size: 16px; }
    .am-role-info h4 { font-size: 14px; }
    .am-role-stats { padding: 10px 16px; gap: 10px; }
    .am-role-stat { padding: 8px; }
    .am-role-stat-value { font-size: 16px; }
    .am-role-stat-label { font-size: 10px; }

    /* --- Top clients compact --- */
    .client-item-info .avatar {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .client-item-name { font-size: 13px; }
    .client-item-id { font-size: 11px; }
    .client-item-count { font-size: 13px; }

    /* --- Laveur tables compact --- */
    .laveur-total-row td {
        padding: 10px 8px !important;
        font-size: 13px;
    }
}

/* ========== VERY SMALL PHONES (max-width: 360px) ========== */
@media (max-width: 360px) {
    .content-area { padding: 8px; }

    .top-bar {
        height: 48px;
        padding: 0 8px;
    }
    .top-bar h2 { font-size: 13px; }

    .user-badge { 
        padding: 3px 8px; 
        font-size: 11px; 
    }

    .stat-card {
        padding: 10px;
        gap: 8px;
    }
    .stat-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .stat-info h3 { font-size: 14px; }
    .stat-info p { font-size: 9px; }

    .card-body { padding: 10px; }
    .card-header { padding: 10px; }

    .bottom-nav-item {
        font-size: 8px;
        min-width: 44px;
    }
    .bottom-nav-item i { font-size: 15px; }

    .page-header h3 { font-size: 15px; }

    .btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 16px;
    }

    .demande-tab-btn {
        padding: 10px;
        font-size: 12px;
    }

    .login-container {
        padding: 24px 16px;
    }
    .login-logo h1 { font-size: 20px; }
    .login-logo .logo-img { width: 50px; height: 50px; }
}

/* ========== SAFE AREA SUPPORT (iPhone notch) ========== */
@supports (padding: env(safe-area-inset-bottom)) {
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(var(--bottomnav-height) + env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .main-content {
            padding-bottom: calc(var(--bottomnav-height) + env(safe-area-inset-bottom));
        }

        .toast-container {
            bottom: calc(var(--bottomnav-height) + env(safe-area-inset-bottom) + 12px);
        }
    }
}

/* ========== LANDSCAPE MOBILE ========== */
@media (max-width: 768px) and (orientation: landscape) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .modal-content {
        max-height: 95vh;
    }

    .login-container {
        padding: 24px 32px;
    }

    .login-logo { margin-bottom: 16px; }
    .login-logo .logo-img { width: 48px; height: 48px; }
    .login-logo h1 { font-size: 20px; }

    .bottom-nav {
        height: 50px;
    }
    .bottom-nav-item i { font-size: 16px; }
    .bottom-nav-item { font-size: 9px; }
}

/* ========== HOVER STATES ONLY ON NON-TOUCH DEVICES ========== */
@media (hover: hover) and (pointer: fine) {
    .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }

    .am-role-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    }
}

/* Disable hover effects on touch devices */
@media (hover: none) {
    .stat-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }

    .am-role-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }

    .btn-primary:hover {
        transform: none;
        box-shadow: none;
    }
}

/* ========== TICKET FORMAT SELECTION ========== */
.ticket-format-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.ticket-format-card {
    position: relative;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ticket-format-card:hover {
    border-color: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.ticket-format-card.selected {
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.25), 0 6px 20px rgba(0,0,0,0.1);
}

.ticket-format-badge {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: var(--secondary);
    color: #fff;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.ticket-format-card.selected .ticket-format-badge {
    display: flex;
}

.ticket-format-preview {
    height: 200px;
    overflow: hidden;
    padding: 12px;
    background: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

.ticket-format-preview .ticket-mini {
    transform-origin: top center;
    font-family: 'Courier New', monospace;
    color: #000;
    width: 100%;
    max-width: 180px;
}

.ticket-format-info {
    padding: 14px 16px;
    text-align: center;
}

.ticket-format-info strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.ticket-format-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Ticket format: Standard 80mm */
.ticket-standard {
    font-family: 'Courier New', monospace;
    font-size: 8px;
    line-height: 1.3;
    color: #000;
    width: 100%;
}

.ticket-standard .ts-header {
    text-align: center;
    padding-bottom: 4px;
    border-bottom: 1px dashed #000;
    margin-bottom: 4px;
}

.ticket-standard .ts-header h2 {
    font-size: 11px;
    font-weight: 700;
    margin: 2px 0;
}

.ticket-standard .ts-header p {
    font-size: 7px;
    color: #555;
    margin: 0;
}

.ticket-standard .ts-divider {
    border-top: 1px dashed #000;
    margin: 3px 0;
}

.ticket-standard .ts-row {
    display: flex;
    justify-content: space-between;
    padding: 1px 0;
    font-size: 8px;
}

.ticket-standard .ts-row-label {
    font-weight: 600;
    color: #555;
}

.ticket-standard .ts-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 11px;
    font-weight: 700;
}

.ticket-standard .ts-footer {
    text-align: center;
    padding-top: 4px;
    border-top: 1px dashed #000;
    font-size: 7px;
    color: #666;
}

/* Ticket format: Detailed A5 */
.ticket-detailed {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 8px;
    line-height: 1.4;
    color: #000;
    width: 100%;
}

.ticket-detailed .td-header {
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 2px solid #E65100;
    margin-bottom: 6px;
}

.ticket-detailed .td-header h2 {
    font-size: 12px;
    font-weight: 700;
    color: #E65100;
    margin: 2px 0;
}

.ticket-detailed .td-header p {
    font-size: 7px;
    color: #777;
    margin: 0;
}

.ticket-detailed .td-section-title {
    font-size: 8px;
    font-weight: 700;
    color: #E65100;
    margin: 6px 0 3px 0;
    padding-bottom: 2px;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticket-detailed .td-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 8px;
}

.ticket-detailed .td-row-label {
    color: #777;
    font-weight: 500;
}

.ticket-detailed .td-row-value {
    font-weight: 600;
}

.ticket-detailed .td-total-box {
    background: #FFF3E0;
    border: 1px solid #FFB74D;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ticket-detailed .td-total-label {
    font-size: 9px;
    font-weight: 700;
    color: #E65100;
}

.ticket-detailed .td-total-value {
    font-size: 12px;
    font-weight: 800;
    color: #E65100;
}

.ticket-detailed .td-footer {
    text-align: center;
    padding-top: 6px;
    border-top: 2px solid #E65100;
    margin-top: 6px;
    font-size: 7px;
    color: #999;
}

/* Ticket format: Modern */
.ticket-modern {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 8px;
    line-height: 1.3;
    color: #000;
    width: 100%;
}

.ticket-modern .tm-header {
    background: linear-gradient(135deg, #E65100, #FF9800);
    color: #fff;
    text-align: center;
    padding: 8px 10px;
    border-radius: 6px 6px 0 0;
    margin: -12px -12px 8px -12px;
}

.ticket-modern .tm-header h2 {
    font-size: 11px;
    font-weight: 700;
    margin: 0 0 1px 0;
}

.ticket-modern .tm-header p {
    font-size: 6px;
    margin: 0;
    opacity: 0.85;
}

.ticket-modern .tm-id-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 7px;
    font-weight: 700;
    margin-top: 3px;
}

.ticket-modern .tm-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 8px;
}

.ticket-modern .tm-row-label {
    color: #888;
    font-size: 7px;
}

.ticket-modern .tm-row-value {
    font-weight: 600;
    font-size: 8px;
}

.ticket-modern .tm-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #FFB74D, transparent);
    margin: 4px 0;
}

.ticket-modern .tm-total {
    background: #FFF3E0;
    border-radius: 6px;
    padding: 5px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
}

.ticket-modern .tm-total-label {
    font-size: 9px;
    font-weight: 700;
    color: #E65100;
}

.ticket-modern .tm-total-value {
    font-size: 11px;
    font-weight: 800;
    color: #E65100;
}

.ticket-modern .tm-footer {
    text-align: center;
    padding-top: 4px;
    font-size: 6px;
    color: #aaa;
}

.ticket-modern .tm-status {
    display: inline-block;
    background: #E8F5E9;
    color: #2E7D32;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 7px;
    font-weight: 700;
    margin-bottom: 3px;
}

/* Print styles for different formats */
@page ticket-standard {
    size: 80mm auto;
    margin: 2mm;
}

@page ticket-detailed {
    size: 148mm 210mm;
    margin: 8mm;
}

@page ticket-modern {
    size: 80mm auto;
    margin: 2mm;
}

@media print {
    .ticket-print[data-format="standard"] {
        width: 76mm;
        max-width: 76mm;
        height: auto;
        max-height: none;
        font-size: 10px;
        page: ticket-standard;
    }

    .ticket-print[data-format="detailed"] {
        width: 132mm;
        max-width: 132mm;
        height: auto;
        max-height: none;
        font-size: 11px;
        padding: 4mm;
        page: ticket-detailed;
    }

    .ticket-print[data-format="modern"] {
        width: 76mm;
        max-width: 76mm;
        height: auto;
        max-height: none;
        font-size: 10px;
        page: ticket-modern;
    }

    .ticket-print[data-format="compact"] {
        width: 49mm;
        height: 71mm;
        max-height: 71mm;
        font-size: 7px;
        page: ticket;
    }
}

@media (max-width: 768px) {
    .ticket-format-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .ticket-format-preview {
        height: 160px;
        padding: 8px;
    }
    .ticket-format-info {
        padding: 10px 12px;
    }
    .ticket-format-info strong {
        font-size: 13px;
    }
    .ticket-format-info span {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .ticket-format-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .ticket-format-preview {
        height: 140px;
        padding: 6px;
    }
}

/* ========== SCROLLBAR STYLING ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.25);
}

/* Hide scrollbar on mobile for cleaner look */
@media (max-width: 768px) {
    .sidebar-nav::-webkit-scrollbar,
    .wa-clients-list::-webkit-scrollbar {
        width: 3px;
    }
}

/* ========== LOGIN TABS ========== */
.login-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border, #2a3a4a);
}

.login-tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: var(--card-bg, #1e2a3a);
    color: var(--text-secondary, #aaa);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.login-tab-btn:first-child {
    border-right: 1px solid var(--border, #2a3a4a);
}

.login-tab-btn.active {
    background: var(--secondary);
    color: #fff;
}

.login-tab-btn:hover:not(.active) {
    background: rgba(255, 152, 0, 0.1);
    color: var(--text);
}

.login-tab-content {
    display: none;
}

.login-tab-content.active {
    display: block;
}

.login-hint {
    margin-top: 12px;
    padding: 10px 14px;
    background: rgba(255, 152, 0, 0.08);
    border: 1px solid rgba(255, 152, 0, 0.2);
    border-radius: 8px;
}

.login-hint p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.login-hint strong {
    color: var(--secondary);
}

/* ========== CLIENT DASHBOARD ========== */
.client-welcome-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, #E65100, #FF9800);
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.client-welcome-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.client-welcome-icon i {
    font-size: 32px;
    color: #fff;
}

.client-welcome-text h2 {
    margin: 0 0 4px 0;
    font-size: 22px;
    color: #fff;
}

.client-welcome-text p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

/* Fidelity Progress */
.fidelite-progress-container {
    text-align: center;
}

.fidelite-progress-bar {
    width: 100%;
    height: 20px;
    background: var(--card-bg, #1e2a3a);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border, #2a3a4a);
    margin-bottom: 10px;
}

.fidelite-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF9800, #E65100);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.fidelite-progress-text {
    font-size: 14px;
    color: var(--text-secondary, #aaa);
    margin: 0;
}

/* ========== CREDENTIALS MODAL ========== */
#modalCredentials .modal-footer {
    border-top: 1px solid var(--border, #2a3a4a);
}

@media (max-width: 768px) {
    .login-tabs {
        flex-direction: column;
    }
    .login-tab-btn:first-child {
        border-right: none;
        border-bottom: 1px solid var(--border, #2a3a4a);
    }
    .client-welcome-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    .client-welcome-text h2 {
        font-size: 18px;
    }
}

/* ========== CHANGE PASSWORD FORM ========== */
.change-password-form .form-group {
    margin-bottom: 16px;
}

.change-password-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text, #e0e0e0);
}

.change-password-form label i {
    margin-right: 6px;
    color: var(--primary, #4fc3f7);
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .form-control {
    padding-right: 44px;
    width: 100%;
}

.toggle-password-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted, #8899aa);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    transition: color 0.2s;
}

.toggle-password-btn:hover {
    color: var(--primary, #4fc3f7);
}

.change-password-form .alert {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.change-password-form .alert-danger {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.change-password-form .alert-success {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}