/* Accessibilité — focus visible */
:focus-visible {
    outline: 2px solid #4A6FA5 !important;
    outline-offset: 2px;
}

/* Skip link accessibilité */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: #4A6FA5;
    color: #fff;
    padding: 8px 16px;
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 4px 0;
}
.skip-link:focus {
    top: 0;
}

/* Classe utilitaire — masqué visuellement mais accessible aux lecteurs d'écran */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Reset et base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
}

a {
    color: #5b6abf;
    text-decoration: none;
}

a:hover {
    color: #4a58a0;
}

/* ===== Navbar ===== */
.navbar {
    background: #2c3e50;
    color: white;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 56px;
}

.navbar-transparent {
    background: transparent;
    position: absolute;
    width: 100%;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.navbar-brand a {
    color: white;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-logo {
    height: 32px;
    max-width: 120px;
    object-fit: contain;
}

.navbar-username {
    color: #ecf0f1;
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- Hamburger toggle --- */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    z-index: 101;
}

.navbar-toggle-icon {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    position: relative;
    transition: background 0.2s;
}

.navbar-toggle-icon::before,
.navbar-toggle-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 22px;
    height: 2px;
    background: white;
    transition: transform 0.25s ease;
}

.navbar-toggle-icon::before { top: -7px; }
.navbar-toggle-icon::after { top: 7px; }

/* Hamburger -> X animation */
.navbar-toggle.active .navbar-toggle-icon {
    background: transparent;
}
.navbar-toggle.active .navbar-toggle-icon::before {
    transform: rotate(45deg);
    top: 0;
}
.navbar-toggle.active .navbar-toggle-icon::after {
    transform: rotate(-45deg);
    top: 0;
}

/* --- Collapse container (desktop: inline flex, mobile: dropdown) --- */
.navbar-collapse {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}

.navbar-nav a {
    color: #bdc3c7;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: white;
    background: #34495e;
}

/* --- Admin menu (monitoring) --- */
.navbar-admin {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    margin-left: auto;
    padding-left: 1rem;
    border-left: 1px solid #4a6274;
}

.navbar-admin a {
    color: #e67e22;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.navbar-admin a:hover,
.navbar-admin a.active {
    color: #f39c12;
    background: #34495e;
}

.navbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.navbar-admin ~ .navbar-right {
    margin-left: 1rem;
}

/* --- Notification bell (actualités) --- */
.navbar-notif {
    position: relative;
    color: #bdc3c7;
    font-size: 1.15rem;
    padding: 0.4rem;
    border-radius: 50%;
    transition: all 0.2s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-notif:hover,
.navbar-notif.active {
    color: white;
    background: #34495e;
}

/* --- Bandeau support --- */
.support-banner {
    background: linear-gradient(135deg, #5b6abf 0%, #7c3aed 100%);
    color: white;
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    position: relative;
}

.support-banner a {
    color: white;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.support-banner a:hover {
    opacity: 0.9;
}

.support-banner-close {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
}

.support-banner-close:hover {
    color: white;
}

/* Badge inline dans un menu navbar */
.navbar-menu-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.navbar-notif-badge {
    position: absolute;
    top: 0;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #e74c3c;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ecf0f1;
}

.avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.btn-logout {
    background: transparent;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #e74c3c;
    color: white;
}

/* ===== Container ===== */
.container {
    width: 80%;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* ---- Page header (titre + description) ---- */
.page-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-title i {
    font-size: 1.2rem;
    color: #4b5563;
}

.page-desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.container-wide {
    width: 100%;
    margin: 0;
    padding: 1rem 2rem;
}

@media (max-width: 768px) {
    .container-wide { padding: 0.75rem 1rem; }
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: #5b6abf;
    color: white;
}

.btn-primary:hover {
    background: #4a58a0;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid white;
    color: white;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* Bouton outline dans les modales (fond blanc) */
.modal-footer .btn-outline {
    border-color: #6c757d;
    color: #6c757d;
}

.modal-footer .btn-outline:hover {
    background: #f0f0f0;
    color: #495057;
}

/* Bouton outline dans la barre de sélection (fond clair) */
.doc-selection-bar .btn-outline {
    border-color: #6c757d;
    color: #6c757d;
}

.doc-selection-bar .btn-outline:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #495057;
}

.btn-google {
    background: white;
    color: #444;
    border: 1px solid #ddd;
    font-weight: 500;
}

.btn-google:hover {
    background: #f7f7f7;
    color: #333;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-lg {
    padding: 0.85rem 2rem;
    font-size: 1.05rem;
}

.btn-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.85rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* ===== Hero / Landing ===== */
.landing-page {
    background: #f8f9fa;
}

.hero {
    background: linear-gradient(135deg, #5b6abf 0%, #8b5cf6 100%);
    color: white;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
}

.hero-content {
    max-width: 700px;
}

.hero-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.hero-logo {
    height: 80px;
    max-width: 200px;
    object-fit: contain;
}

.hero-brand-name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Page Hero (sous-pages publiques) ===== */
.page-hero {
    background: linear-gradient(135deg, #5b6abf 0%, #8b5cf6 100%);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
}

.page-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== Features ===== */
.features {
    padding: 5rem 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.feature-card p {
    color: #666;
}

/* ===== Sections ===== */
.section {
    padding: 5rem 0;
}

.section-alt {
    background: white;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 3rem;
}

/* ===== Steps (Comment ça marche) ===== */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.step-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.step-number {
    width: 50px;
    height: 50px;
    background: #5b6abf;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0 auto 1.25rem;
}

.step-card h3 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.step-card p {
    color: #666;
    line-height: 1.6;
}

/* ===== Download section ===== */
.download-section {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
}

.download-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    max-width: 800px;
    margin: 0 auto;
}

.download-info h2 {
    font-size: 1.75rem;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.download-info p {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.btn-download {
    background: #27ae60;
    color: white;
    border: none;
    font-weight: 600;
}

.btn-download:hover {
    background: #219a52;
    color: white;
}

.btn-version {
    opacity: 0.8;
    font-size: 0.85em;
    margin-left: 0.25rem;
}

.download-qr {
    text-align: center;
    flex-shrink: 0;
}

.qr-code-image {
    width: 180px;
    height: 180px;
    border: 4px solid white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

/* ===== Auth pages - Two panel layout ===== */
.auth-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

.auth-container {
    display: flex;
    min-height: 100vh;
}

/* Left panel - Branding */
.auth-left-panel {
    width: 42%;
    background: linear-gradient(135deg, #5b6abf 0%, #3d2b7a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.auth-left-content {
    text-align: center;
    color: white;
}

.auth-left-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.auth-left-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-left-subtitle {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.85;
    margin-bottom: 0.75rem;
}

.auth-left-desc {
    font-size: 1.05rem;
    opacity: 0.7;
    max-width: 300px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Right panel - Form */
.auth-right-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    padding: 2rem;
}

.auth-box {
    width: 100%;
    max-width: 420px;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-header h2 {
    color: #333;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: #6b6b6b;
    font-size: 0.95rem;
}

.auth-footer-text {
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.auth-back-link {
    display: block;
    margin-top: 1.5rem;
    color: #6b6b6b;
    font-size: 0.9rem;
    text-align: center;
}

.auth-back-link:hover {
    color: #5b6abf;
}

.auth-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    color: #6b6b6b;
}

.auth-footer a {
    color: #5b6abf;
    text-decoration: none;
}

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

@media (max-width: 768px) {
    .auth-container { flex-direction: column; }
    .auth-left-panel { width: 100%; min-height: 200px; padding: 2rem 1rem; }
    .auth-left-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
    .auth-left-title { font-size: 1.5rem; }
    .auth-left-desc { font-size: 0.9rem; }
    .auth-right-panel { padding: 1.5rem; }
    .auth-footer { position: static; }
}

/* ===== Divider ===== */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #595959;
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.divider span {
    padding: 0 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: #444;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    background: #fafafa;
}

.form-group input:focus {
    outline: 2px solid transparent;
    border-color: #5b6abf;
    background: white;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
}

.link-small {
    font-size: 0.85rem;
    color: #5b6abf;
}

.field-error {
    color: #e74c3c;
    font-size: 0.8rem;
    display: block;
    margin-top: 0.3rem;
}

.field-hint {
    color: #595959;
    font-size: 0.8rem;
    display: block;
    margin-top: 0.3rem;
}

/* ===== Alerts ===== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    font-size: 0.9rem;
}

.alert-error {
    background: #fef2f2;
    color: #c0392b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ===== Cards ===== */
.card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}

.card h3 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

/* ===== Welcome banner ===== */
.welcome-banner {
    margin-bottom: 2rem;
}

.welcome-banner h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.welcome-banner p {
    color: #666;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #5b6abf;
}

.stat-label {
    color: #595959;
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ===== Progress Bar ===== */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.4rem 0;
}

.progress-bar {
    height: 100%;
    background: #5b6abf;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.progress-bar.progress-warning {
    background: #f39c12;
}

.progress-bar.progress-danger {
    background: #e74c3c;
}

/* ===== Stat card error ===== */
.stat-card-error {
    border-left: 4px solid #e74c3c;
}

.stat-card-error .stat-value {
    color: #e74c3c;
}

/* ===== Device grid ===== */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* ===== Device card enriched ===== */
.device-card {
    padding: 0;
}

.device-card-header {
    padding: 1.25rem 1.5rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.device-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.device-card-title h3 {
    margin: 0;
    font-size: 1.05rem;
}

.device-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-syncing {
    background: #fff3cd;
    color: #856404;
}

.badge-pending {
    background: #e2e3e5;
    color: #383d41;
}

.device-card-body {
    padding: 1rem 1.5rem 1.25rem;
}

.device-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0;
}

.device-info-label {
    font-size: 0.8rem;
    color: #6b6b6b;
}

.device-info-value {
    font-size: 0.85rem;
    color: #333;
    font-weight: 500;
}

.device-storage {
    margin: 0.5rem 0;
    padding: 0.5rem 0;
    border-top: 1px solid #f5f5f5;
    border-bottom: 1px solid #f5f5f5;
}

.device-storage-detail {
    font-size: 0.75rem;
    color: #595959;
    text-align: right;
}

.device-last-sync {
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f5f5f5;
}

/* ===== Settings Page - Unified Design ===== */

/* Page header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* Sections */
.settings-section {
    margin-bottom: 2.5rem;
}

.settings-section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-section-title i {
    color: #5b6abf;
    font-size: 1.1rem;
}

/* Card settings */
.settings-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.settings-hint {
    color: #6b7280;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
    padding: 0.65rem 1rem;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 3px solid #5b6abf;
}

/* Summary blocks grid (sauvegarde, etc.) */
.settings-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.settings-summary-block {
    text-align: center;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 12px;
    border: 1px solid #eef0f4;
}

.settings-summary-icon {
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.settings-summary-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1f2937;
}

.settings-summary-detail {
    font-size: 0.78rem;
    color: #6b7280;
}

.settings-empty {
    color: #595959;
    font-size: 0.9rem;
    padding: 1rem 0;
}

/* Empty state for settings sections */
.settings-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.settings-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.settings-empty-title {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    color: #1f2937;
}

.settings-empty-desc {
    color: #6b7280;
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
}

.settings-empty-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Subsection titles */
.settings-subsection-title {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.settings-subsection-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.settings-divider {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

/* Payment method display */
.settings-payment-method {
    margin-top: 0.8rem;
    padding: 0.65rem 1rem;
    background: #f8f9ff;
    border-radius: 8px;
    border: 1px solid #eef0f4;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.settings-payment-method i {
    font-size: 1.3rem;
    color: #5b6abf;
}

.settings-payment-text {
    font-size: 0.9rem;
}

.settings-payment-expiry {
    font-size: 0.82rem;
    color: #6b6b6b;
}

.settings-payment-edit {
    margin-left: auto;
    font-size: 0.82rem;
    color: #5b6abf;
    font-weight: 500;
}

/* Trial info */
.settings-trial-info {
    margin-top: 0.8rem;
    padding: 0.6rem 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #166534;
}

/* Offers section */
.settings-offers-section {
    margin-top: 2rem;
}

/* Pricing features list */
.pricing-features {
    font-size: 0.85rem;
    color: #666;
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.pricing-desc {
    font-size: 0.9rem;
    color: #666;
}

.btn-full {
    margin-top: 0.8rem;
    width: 100%;
}

/* Coming soon description */
.coming-soon-desc {
    font-size: 0.9rem;
    color: #555;
}

/* Footer help link */
.settings-footer-link {
    text-align: center;
    margin: 2rem 0 3rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.settings-footer-link a {
    color: #5b6abf;
    font-weight: 600;
}

/* Info rows - unified label/value pattern */
.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid #f0f1f3;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row-footer {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    border-bottom: none;
}

.info-row-editable {
    gap: 1rem;
}

.info-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    flex-shrink: 0;
    min-width: 140px;
}

.info-value {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 500;
    text-align: right;
}

/* Info grid (2 columns for sync preferences) */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
}

.info-grid .info-row {
    padding: 0.5rem 0;
}

/* Status dots - unified active/pending/error indicators */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
}

.status-dot::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-active {
    color: #155724;
    background: #d4edda;
}
.status-active::before { background: #27ae60; }

.status-syncing {
    color: #856404;
    background: #fff3cd;
}
.status-syncing::before { background: #f39c12; }

.status-error {
    color: #721c24;
    background: #f8d7da;
}
.status-error::before { background: #e74c3c; }

.status-pending {
    color: #6c757d;
    background: #e9ecef;
}
.status-pending::before { background: #adb5bd; }

/* Device cards */
.settings-card .device-card {
    background: #fafbfc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: box-shadow 0.2s;
}

.settings-card .device-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.settings-card .device-card .device-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.settings-card .device-card .device-card-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #2c3e50;
}

.settings-card .device-card .device-card-body {
    padding: 0.5rem 1.25rem 1rem;
}

.device-name-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-rename-device {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #9ca3af;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}

.btn-rename-device:hover {
    color: #5b6abf;
    background: #eef0fb;
}

.device-name-edit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.device-name-input {
    flex: 1;
    padding: 0.35rem 0.6rem;
    font-size: 0.95rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: 2px solid transparent;
    min-width: 0;
}

.device-name-input:focus {
    border-color: #5b6abf;
    box-shadow: 0 0 0 2px rgba(91, 106, 191, 0.15);
}

.device-name-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 5px;
    line-height: 1;
    min-width: 28px;
    cursor: pointer;
}

.device-storage-block {
    margin: 0.4rem 0;
    padding: 0.4rem 0;
    border-top: 1px solid #f5f5f5;
    border-bottom: 1px solid #f5f5f5;
}

/* Scan paths */
.scan-paths {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.scan-path {
    background: #f1f3f5;
    color: #495057;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Form input (settings page) */
.form-input {
    width: 100%;
    padding: 0.55rem 0.9rem;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    background: #fafafa;
}

.form-input:focus {
    outline: 2px solid transparent;
    border-color: #5b6abf;
    background: white;
}

.form-input-inline {
    flex: 1;
    max-width: 320px;
}

.input-with-hint {
    flex: 1;
    max-width: 320px;
}

.form-hint {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    color: #595959;
}

.form-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

/* ===== Tables ===== */
.table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.table tr:hover {
    background: #fafafa;
}

/* ===== Utility ===== */
.text-muted {
    color: #595959;
    font-size: 0.9rem;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 2rem;
    color: #595959;
    font-size: 0.85rem;
}

/* ===== Footer Pro ===== */
.footer-pro {
    background: #2c3e50;
    color: #bdc3c7;
    padding: 0.75rem 1.5rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

body {
    padding-bottom: 3rem;
}

.footer-pro-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-pro-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

.footer-pro-links a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-pro-links a:hover {
    color: #5b6abf;
}

.footer-pro-links .footer-sep {
    color: #7f8c8d;
    font-size: 0.75rem;
}

.footer-pro-copyright {
    font-size: 0.8rem;
    color: #95a5a6;
    margin: 0;
    white-space: nowrap;
}

.footer-pro-copyright a {
    color: #5b6abf;
    text-decoration: none;
}

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

@media (max-width: 768px) {
    .footer-pro {
        padding: 0.5rem 1rem;
    }

    .footer-pro-inner {
        flex-direction: column;
        gap: 0.25rem;
    }

    .footer-pro-links a {
        font-size: 0.75rem;
    }

    .footer-pro-links {
        gap: 0.4rem;
    }

    .footer-pro-copyright {
        font-size: 0.7rem;
    }
}

/* ===== Responsive - Tablette (max 1024px) ===== */
@media (max-width: 1024px) {
    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .offers-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .container {
        padding: 0 1.25rem;
    }
}

/* ===== Responsive - Mobile (max 768px) ===== */
@media (max-width: 768px) {
    /* Navbar: hamburger visible, collapse en dropdown */
    .navbar {
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
        gap: 0;
    }

    .navbar-toggle {
        display: block;
    }

    .navbar-username {
        font-size: 0.8rem;
    }

    .navbar-collapse {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
        padding-top: 0.75rem;
        border-top: 1px solid #3d5166;
        margin-top: 0.6rem;
    }

    .navbar-collapse.navbar-collapse-open {
        display: flex;
    }

    /* Fond solide pour le menu mobile sur navbar transparente */
    .navbar-transparent .navbar-collapse {
        background: #2c3e50;
        border-radius: 0 0 12px 12px;
        padding: 0.75rem;
        margin-top: 0;
        border-top: none;
    }

    .navbar-transparent .navbar-collapse.navbar-collapse-open {
        margin-top: 0.5rem;
    }

    /* Passer la navbar transparente en fond solide quand le menu est ouvert */
    .navbar-transparent:has(.navbar-collapse-open),
    .navbar-transparent.navbar-menu-open {
        background: #2c3e50;
    }

    .navbar-nav {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .navbar-nav li a {
        display: block;
        padding: 0.7rem 0.75rem;
        border-radius: 6px;
        font-size: 0.95rem;
    }

    .navbar-admin {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        padding-top: 0.5rem;
        border-top: 1px solid #3d5166;
        margin-top: 0.5rem;
        width: 100%;
        flex-direction: column;
    }

    .navbar-admin li a {
        display: block;
        padding: 0.7rem 0.75rem;
        border-radius: 6px;
        font-size: 0.95rem;
    }

    .navbar-right {
        margin-left: 0;
        padding-top: 0.75rem;
        border-top: 1px solid #3d5166;
        margin-top: 0.5rem;
        justify-content: flex-start;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding: 3rem 1.5rem;
    }

    .page-hero {
        padding: 2rem 1.5rem;
    }

    .page-hero h1 {
        font-size: 1.5rem;
    }

    .page-hero p {
        font-size: 0.95rem;
    }

    .hero h1 {
        font-size: 1.7rem;
        line-height: 1.25;
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    /* Grids */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .device-grid {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

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

    .info-row-editable {
        flex-direction: column;
        align-items: stretch;
    }

    .form-input-inline,
    .input-with-hint {
        max-width: 100%;
    }

    .info-label {
        min-width: auto;
    }

    /* Download */
    .download-box {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    /* Container */
    .container {
        margin: 1.25rem auto;
        padding: 0 1rem;
    }

    /* Cards */
    .card {
        padding: 1.25rem;
    }

    /* Welcome */
    .welcome-banner h1 {
        font-size: 1.4rem;
    }

    /* Stats */
    .stat-value {
        font-size: 2rem;
    }

    /* Section titles */
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }

    .section {
        padding: 3rem 0;
    }

    /* Tables responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.25rem;
    }

    .table-responsive table {
        min-width: 480px;
    }
}

/* ===== Responsive - Petit mobile (max 480px) ===== */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.4rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .navbar-brand a {
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .offers-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Subscription Hero Card (Dashboard) ===== */
.subscription-hero-card {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef0ff 100%);
    border: 1px solid #d4d8f0;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(91, 106, 191, 0.08);
}

.subscription-hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.subscription-hero-header h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0;
}

.subscription-hero-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.subscription-status-label {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.subscription-status-active {
    background: #d4edda;
    color: #155724;
}

.subscription-status-warning {
    background: #fff3cd;
    color: #856404;
}

.subscription-status-danger {
    background: #f8d7da;
    color: #721c24;
}

.subscription-hero-storage {
    margin-bottom: 1.5rem;
}

.storage-bar-detail-left {
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.storage-bar-track-lg {
    height: 14px;
    border-radius: 7px;
}

.subscription-hero-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.subscription-hero-price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.subscription-price-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #5b6abf;
}

.subscription-price-period {
    font-size: 0.95rem;
    color: #666;
}

.subscription-hero-next {
    font-size: 0.88rem;
    color: #555;
}

.subscription-hero-actions {
    padding-top: 0.75rem;
    border-top: 1px solid #e0e3f0;
}

/* ===== Stats Grid Compact (2x2) ===== */
.stats-grid-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card-mini {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card-mini-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.stat-card-mini-content {
    flex: 1;
    min-width: 0;
}

.stat-card-mini-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
    margin: 0;
}

.stat-card-mini-label {
    font-size: 0.82rem;
    color: #7f8c8d;
    margin: 0.15rem 0 0;
}

.stat-card-mini-detail {
    font-size: 0.78rem;
    color: #595959;
}

.stat-card-mini-link {
    font-size: 0.82rem;
    color: #5b6abf;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.stat-card-mini-link:hover {
    color: #4a58a0;
    text-decoration: underline;
}

/* ===== Coming Soon Section ===== */
.coming-soon-section {
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: #fafbfc;
    border-radius: 12px;
    border: 1px solid #eef0f4;
}

.coming-soon-title {
    font-size: 1rem;
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 0.75rem;
}

.coming-soon-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.coming-soon-list li {
    font-size: 0.88rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.coming-soon-icon {
    font-size: 1rem;
}

.coming-soon-note {
    font-size: 0.82rem;
    color: #595959;
    margin-top: 0.5rem;
    font-style: italic;
}

/* ===== Responsive Dashboard ===== */
@media (max-width: 768px) {
    .subscription-hero-card {
        padding: 1.25rem;
    }

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

    .subscription-hero-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .subscription-price-value {
        font-size: 1.5rem;
    }

    .stats-grid-compact {
        grid-template-columns: 1fr;
    }

    .coming-soon-list {
        flex-direction: column;
        gap: 0.4rem;
    }
}

@media (max-width: 480px) {
    .stat-card-mini {
        padding: 1rem;
    }

    .stat-card-mini-value {
        font-size: 1.2rem;
    }
}

/* ===== Badges (backoffice, etc.) ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-muted {
    background: #e2e3e5;
    color: #6c757d;
}

.badge-outline {
    background: transparent;
    border: 1px solid #ced4da;
    color: #495057;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-family: monospace;
}

/* ==========================================
   Navbar Dropdown (Supervision)
   ========================================== */

.navbar-dropdown {
    position: relative;
    list-style: none;
}

.navbar-dropdown-toggle {
    cursor: pointer;
}

.navbar-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #34495e;
    border-radius: 6px;
    list-style: none;
    padding: 0.35rem 0;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 200;
    margin-top: 0.25rem;
}

.navbar-dropdown:hover .navbar-dropdown-menu,
.navbar-dropdown-menu:hover {
    display: block;
}

.navbar-dropdown-menu li a {
    display: block;
    padding: 0.55rem 1.15rem;
    color: #ecf0f1;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: background 0.15s;
}

.navbar-dropdown-menu li a:hover {
    background: #4a6274;
    color: white;
}

.navbar-dropdown-divider {
    height: 1px;
    margin: 0.35rem 0;
    background: rgba(255, 255, 255, 0.15);
}

/* ==========================================
   DataTable (Supervision Logs)
   ========================================== */

/* Page header */
.page-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin-bottom: 0;
}

.page-header-count {
    font-size: 0.95rem;
    color: #7f8c8d;
    font-weight: 400;
}

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

.dt-search {
    flex: 1;
    min-width: 220px;
}

.dt-search-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
    background: white;
}

.dt-search-input:focus {
    outline: 2px solid transparent;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dt-filter-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dt-select {
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
    min-width: 140px;
    transition: border-color 0.2s;
}

.dt-select:focus {
    outline: 2px solid transparent;
    border-color: #667eea;
}

/* Table wrapper */
.dt-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

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

.dt-table th,
.dt-table td {
    padding: 0.75rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.88rem;
}

.dt-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    user-select: none;
}

.dt-table tbody tr:hover {
    background: #f8f9fa;
}

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

/* DataTable footer — length selector + pagination on same line */
.dt-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
}

.dt-footer .dt-length {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dt-footer .dt-length select {
    padding: 0.3rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.dt-footer .dt-paging {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dt-footer .dt-paging button {
    padding: 0.3rem 0.65rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.dt-footer .dt-paging button:hover:not(.disabled):not(.current) {
    background: #f3f4f6;
    border-color: #bbb;
}

.dt-footer .dt-paging button.current {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

.dt-footer .dt-paging button.disabled {
    opacity: 0.4;
    cursor: default;
}

.text-nowrap {
    white-space: nowrap;
}

.small {
    font-size: 0.85rem;
}

/* Toast */
.dt-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s;
    z-index: 1000;
    pointer-events: none;
}

.dt-toast-show {
    opacity: 1;
    transform: translateY(0);
}

.dt-toast-success {
    background: #27ae60;
    color: white;
}

.dt-toast-error {
    background: #e74c3c;
    color: white;
}

/* ==========================================
   Modal (Log Detail)
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #595959;
    padding: 0 0.25rem;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-text {
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.modal-text-muted {
    margin-bottom: 1rem;
    font-size: 0.88rem;
    color: #6b7280;
}

.modal-form-inline {
    display: inline;
}

.detail-row {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.detail-row strong {
    color: #555;
}

/* Responsive DataTable */
@media (max-width: 768px) {
    .dt-filters {
        flex-direction: column;
    }

    .dt-search {
        min-width: 100%;
    }

    .dt-filter-group {
        width: 100%;
    }

    .dt-select {
        flex: 1;
        min-width: 0;
    }

    .dt-table th,
    .dt-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .modal-content {
        max-width: 100%;
        margin: 0 1rem;
    }
}

/* Responsive dropdown navbar */
@media (max-width: 768px) {
    .navbar-dropdown-menu {
        position: static;
        box-shadow: none;
        background: #2c3e50;
        margin-top: 0;
        padding-left: 1rem;
    }
}

/* ===== Environment Badge ===== */
.env-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-left: 8px;
    vertical-align: middle;
    line-height: 1.4;
}

/* ==========================================
   Actualités
   ========================================== */

.actualite-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.actualite-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.actualite-card-read {
    opacity: 0.7;
}

.actualite-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.actualite-card-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.actualite-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

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

.actualite-badge-success {
    background: #d1fae5;
    color: #065f46;
}

.actualite-badge-maintenance {
    background: #f3e8ff;
    color: #6b21a8;
}

.actualite-badge-pinned {
    background: #fef3c7;
    color: #92400e;
}

.actualite-card-date {
    font-size: 0.8rem;
    color: #9ca3af;
}

.actualite-card-title {
    font-size: 1.05rem;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
}

.actualite-card-content {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.5;
}

.actualite-unread-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

/* Dev Login Selector */
.dev-login-section {
    margin-top: 0.5rem;
}

.dev-login-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}

.dev-login-table th {
    text-align: left;
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.72rem;
    text-transform: uppercase;
    padding: 0.35rem 0.4rem;
    border-bottom: 2px solid #eee;
}

.dev-login-table td {
    padding: 0.35rem 0.4rem;
    border-bottom: 1px solid #f0f0f0;
}

.dev-login-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.dev-login-table tbody tr:hover {
    background: #f8f5ff;
}

.dev-login-link {
    color: #333;
    text-decoration: none;
    display: block;
}

.dev-login-link:hover {
    color: #5b6abf;
}

.dev-login-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
}

.dev-login-badge-profile {
    background: #eef0fb;
    color: #5b6abf;
}

/* ===== Page Documents ===== */
.doc-page-header {
    margin-bottom: 1.5rem;
}
.doc-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.doc-page-header h1 i { color: #5b6abf; }
.doc-page-desc {
    color: #6b7280;
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

/* Explorateur documents — Layout 2 panneaux */
.doc-explorer {
    display: flex;
    min-height: calc(100vh - 200px);
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}
.doc-explorer-sidebar {
    width: 260px;
    min-width: 260px;
    border-right: 1px solid #e5e7eb;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.doc-explorer-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}
.doc-explorer-sidebar-title {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.doc-explorer-content {
    flex: 1;
    padding: 1rem 1.25rem;
    min-width: 0;
    overflow-x: auto;
}

/* Arbre sidebar */
#docFolderTree {
    padding: 0.5rem 0;
}
.doc-tree-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 0.4rem 0.75rem;
}
.doc-tree-node {
    user-select: none;
}
.doc-tree-node-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem 0.35rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #4b5563;
    border-radius: 4px;
    margin: 1px 0.5rem;
    transition: background 0.15s, color 0.15s;
}
.doc-tree-node-label:hover {
    background: #eef0f5;
}
.doc-tree-node-label.active {
    background: #eef0fb;
    color: #5b6abf;
    font-weight: 600;
}
.doc-tree-node-label.doc-drag-over {
    outline: 2px dashed #5b6abf;
    outline-offset: -2px;
    background: #e8ebff;
}
.doc-tree-trash-link {
    text-decoration: none;
    color: #4b5563;
}
.doc-tree-trash-link:hover {
    color: #e74c3c;
}
.doc-tree-trash-link.receiving {
    animation: doc-trash-receive 0.4s ease;
}
@keyframes doc-trash-receive {
    0% { transform: scale(1); }
    30% { transform: scale(1.15); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* Animation fly-to-trash (partagée photos + documents) */
.fly-to-trash {
    position: fixed;
    z-index: 9999;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
}
.fly-to-trash.flying {
    opacity: 0;
    transform: scale(0.15);
    border-radius: 50%;
}

.doc-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 0.7rem;
    color: #9ca3af;
    transition: transform 0.15s;
    flex-shrink: 0;
}
.doc-tree-toggle.expanded {
    transform: rotate(90deg);
}
.doc-tree-node-count {
    margin-left: auto;
    font-size: 0.72rem;
    color: #9ca3af;
    background: #f0f1f3;
    padding: 0 0.4rem;
    border-radius: 8px;
    min-width: 20px;
    text-align: center;
}
.doc-tree-node-children {
    padding-left: 1rem;
    display: none;
}
.doc-tree-node-children.expanded {
    display: block;
}

/* Menu contextuel */
.doc-context-menu {
    position: fixed;
    z-index: 1000;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 160px;
    padding: 0.3rem 0;
}
.doc-context-item {
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #333;
}
.doc-context-item:hover {
    background: #f3f4f6;
}
.doc-context-danger {
    color: #dc3545;
}
.doc-context-danger:hover {
    background: #fee2e2;
}

/* Filtres */
.doc-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.doc-filter-group { flex: 1; min-width: 180px; }
.doc-filter-input,
.doc-filter-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
    color: #333;
}
.doc-filter-input:focus,
.doc-filter-select:focus {
    outline: 2px solid transparent;
    border-color: #5b6abf;
    box-shadow: 0 0 0 2px rgba(91,106,191,0.15);
}

/* DataTable wrapper */
.doc-table-wrapper { overflow-x: auto; }
.doc-file-name {
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

/* Actions */
.doc-actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}
.doc-action-btn {
    background: none;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.25rem 0.4rem;
    cursor: pointer;
    color: #6b7280;
    font-size: 0.85rem;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.doc-action-btn:hover {
    background: #f3f4f6;
    color: #5b6abf;
}

/* Statut badges */
.doc-status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}
.doc-status-local { background: #f3f4f6; color: #6b7280; }
.doc-status-uploading { background: #fef3cd; color: #856404; }
.doc-status-synced { background: #d1fae5; color: #065f46; }
.doc-status-archived { background: #dbeafe; color: #1e40af; }
.doc-status-error { background: #fee2e2; color: #991b1b; }

/* Icône type document */
.doc-type-icon { font-size: 1.2rem; }

/* Breadcrumb */
.doc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}
.doc-breadcrumb-item {
    color: #6b7280;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.doc-breadcrumb-link {
    cursor: pointer;
    color: #5b6abf;
}
.doc-breadcrumb-link:hover { text-decoration: underline; }
.doc-breadcrumb-current {
    font-weight: 600;
    color: #333;
}
.doc-breadcrumb-sep {
    color: #d1d5db;
    font-size: 0.75rem;
}

/* DataTable lignes draggable */
#documentsTable tbody tr[draggable="true"] {
    cursor: grab;
}
#documentsTable tbody tr[draggable="true"]:active {
    cursor: grabbing;
}
#documentsTable tbody tr.dragging {
    opacity: 0.4;
}
#documentsTable .dt-cb {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #5b6abf;
}

/* État vide */
.doc-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}
.doc-empty-state p { margin-top: 0.5rem; }

/* Bannière info documents */
.doc-info-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    margin-bottom: 20px;
    background: #f0f2ff;
    border: 1px solid #d4d9f7;
    border-radius: 10px;
    color: #4a58a0;
    font-size: 0.92rem;
}
.doc-info-banner i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Upload drag & drop */
.doc-upload-zone {
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    padding: 16px 24px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.doc-upload-zone:hover,
.doc-upload-zone.doc-upload-dragover {
    border-color: #5b6abf;
    background: rgba(91, 106, 191, 0.04);
}
.doc-upload-zone-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6b6b6b;
    font-size: 0.95rem;
}
.doc-upload-zone-content i {
    font-size: 1.3rem;
    color: #5b6abf;
}
.doc-upload-browse-btn {
    background: none;
    border: none;
    color: #5b6abf;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: 0.95rem;
}
.doc-upload-browse-btn:hover {
    color: #4a59a8;
}
.doc-upload-progress {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 10px;
}
.doc-upload-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #555;
}
.doc-upload-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}
.doc-upload-progress-fill {
    height: 100%;
    background: #5b6abf;
    border-radius: 3px;
    transition: width 0.2s ease;
}

/* Sélection multiple documents */
.doc-selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #f0f2ff;
    border: 1px solid #5b6abf;
    border-radius: 8px;
    margin-bottom: 12px;
    gap: 12px;
}
.doc-selection-bar-left,
.doc-selection-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.doc-selection-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: #5b6abf;
}
.doc-drag-count-badge {
    position: fixed;
    pointer-events: none;
    background: #5b6abf;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Modale input */
.doc-modal-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.35rem;
}
.doc-modal-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
}
.doc-modal-input:focus {
    outline: 2px solid transparent;
    border-color: #5b6abf;
    box-shadow: 0 0 0 2px rgba(91,106,191,0.15);
}

/* Bouton danger */
.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}
.btn-danger:hover { background: #c82333; }

/* Arborescence dossiers (modale déplacer) */
.doc-folder-tree {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 0.5rem;
}
.doc-tree-item {
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.doc-tree-item:hover { background: #f3f4f6; }
.doc-tree-item.selected {
    background: #eef0fb;
    color: #5b6abf;
    font-weight: 600;
}
.doc-tree-children { padding-left: 1.25rem; }

/* Message vide dans la modale de déplacement */
.doc-move-empty {
    text-align: center;
    padding: 24px 16px;
    color: #6b6b6b;
}
.doc-move-empty i {
    font-size: 2rem;
    color: #767676;
    display: block;
    margin-bottom: 8px;
}
.doc-move-empty p {
    margin: 4px 0;
    font-size: 0.9rem;
}

/* Preview PDF */
.pdf-viewer-modal {
    max-width: 800px;
    width: 90vw;
}
.pdf-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
}
#pdfCanvas {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto !important;
}

/* Stats par catégorie (dashboard) */
.category-stats-section {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    margin-top: 1.25rem;
    border: 1px solid #e5e7eb;
}
.category-stats-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}
.category-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.category-stats-table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}
.category-stats-table tr:last-child td {
    border-bottom: none;
    font-weight: 600;
    border-top: 2px solid #e5e7eb;
}
.category-stats-icon {
    width: 30px;
    text-align: center;
    font-size: 1.1rem;
}
.category-stats-label { color: #333; }
.category-stats-count { text-align: right; color: #6b7280; }
.category-stats-size { text-align: right; color: #6b7280; min-width: 80px; }

@media (max-width: 768px) {
    .doc-explorer { flex-direction: column; }
    .doc-explorer-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    .doc-filters { flex-direction: column; }
    .doc-filter-group { min-width: 100%; }
}

/* ===== Export banner (Hub) ===== */
.export-banner {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.export-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.export-banner-icon {
    flex-shrink: 0;
    color: #3b82f6;
}
.export-banner-text {
    flex: 1;
    font-size: 0.95rem;
    color: #1e3a5f;
}
.export-banner-text strong {
    display: block;
    margin-bottom: 0.15rem;
}
.export-banner-text span {
    font-size: 0.85rem;
    color: #64748b;
}

/* Toolbar export button success state */
.toolbar-btn-success {
    background: #dcfce7 !important;
    color: #166534 !important;
    border-color: #86efac !important;
}
