:root {
    /* Couleurs de base - Thème clair */
    --bg: #f5f5f5;
    --bg-alt: #ffffff;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --card-border: #e5e5e5;
    
    /* Couleurs d'accent basées sur l'arc du logo (jaune → orange → rouge → violet) */
    --accent: #fbbf24;        /* Jaune du logo */
    --accent-orange: #f97316; /* Orange du logo */
    --accent-red: #ef4444;    /* Rouge du logo */
    --accent-purple: #7c3aed; /* Violet du logo */
    --accent-soft: rgba(251,191,36,0.15);
    
    /* Texte - En noir pour thème clair */
    --text: #1a1a1a;
    --text-muted: #666666;
    
    /* États */
    --danger: #ef4444;
    --success: #22c55e;
    --yellow: #fbbf24;
    
    /* Design */
    --radius: 14px;
    --shadow-soft: 0 18px 45px rgba(0,0,0,0.1);
    --transition-fast: 0.18s ease-out;
    --border-color: rgba(0,0,0,0.1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #f5f5f5 50%, #ffffff 100%);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

body {
    display: flex;
    position: relative;
}

.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-orange) 100%);
    border: none;
    color: #000000;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(251,191,36,0.4);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.mobile-menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(251,191,36,0.5);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: all;
}

/* Layout */

.layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #ffffff 0%, #ffffff 50%, #f8f8f8 100%);
    border-right: 1px solid rgba(0,0,0,0.1);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(251,191,36,0.8) 0%,
        rgba(249,115,22,0.8) 25%,
        rgba(239,68,68,0.8) 50%,
        rgba(124,58,237,0.8) 75%,
        rgba(251,191,36,0.8) 100%);
    opacity: 0.7;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    flex-wrap: wrap;
    position: relative;
}

.sidebar-logo .logo-image {
    display: block;
}

.logo-circle {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0, #60a5fa, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: white;
    box-shadow: 0 12px 25px rgba(37,99,235,0.8);
}

.logo-image {
    width: 180px;
    height: auto;
    max-height: 50px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0.95) contrast(1.1);
}

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

.logo-title {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 14px;
}

.logo-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    flex: 1;
}

.nav-item {
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    color: var(--text);
    border-radius: 999px;
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast), color var(--transition-fast);
}

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

.nav-item:hover {
    background: rgba(251,191,36,0.1);
    transform: translateX(3px);
    color: var(--accent);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-orange) 100%);
    color: #000000;
    box-shadow: 0 4px 15px rgba(251,191,36,0.3);
    font-weight: 600;
}

.nav-item.active i {
    color: white;
}

.sidebar-footer {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(251,191,36,0.05);
    border-radius: 10px;
    margin-bottom: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.user-info i {
    color: var(--accent);
    font-size: 16px;
}

.user-info span {
    font-size: 11px;
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(239,68,68,0.3);
    color: #ef4444;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout:hover {
    background: rgba(239,68,68,0.1);
    border-color: #ef4444;
    transform: translateY(-1px);
}

.btn-logout:active {
    transform: translateY(0);
}

.sidebar-credits {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.credits-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.credits-logo-img {
    max-width: 120px;
    height: auto;
    max-height: 30px;
    object-fit: contain;
    filter: brightness(1.1);
}

.credits-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

.credits-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.8;
}

.credits-version {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
}

.sidebar-time,
.sidebar-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-time i {
    color: var(--accent);
    filter: drop-shadow(0 0 4px rgba(251,191,36,0.5));
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6b7280;
    box-shadow: 0 0 0 0 rgba(34,197,94,0.0);
    transition: 0.25s ease-out;
}
.status-dot.ok {
    background: var(--success);
    box-shadow: 0 0 0 6px rgba(34,197,94,0.25);
}
.status-dot.warn {
    background: var(--yellow);
    box-shadow: 0 0 0 6px rgba(234,179,8,0.25);
}
.status-dot.err {
    background: var(--danger);
    box-shadow: 0 0 0 6px rgba(239,68,68,0.25);
}

/* Main */

.main {
    flex: 1;
    padding: 18px 22px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-header h1 {
    margin: 0;
    font-size: 24px;
}

.subtitle {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

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

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Cards */

.card {
    background: radial-gradient(circle at top left, rgba(251,191,36,0.08), transparent 55%),
                linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.card-header {
    padding: 14px 16px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    background: rgba(251,191,36,0.03);
}

.card-header h2 {
    margin: 0;
    font-size: 16px;
}

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

/* Badge pour les cartes */
.card-badge {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-orange) 100%);
    color: #000;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(251,191,36,0.3);
}

.card-metric {
    text-align: left;
    padding: 18px 20px 20px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card-metric::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-orange) 50%, var(--accent-red) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.card-metric:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.card-metric:hover::before {
    opacity: 1;
}

.card-metric .card-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
}

.card-metric .card-value {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    transition: transform var(--transition-fast);
}

.card-metric:hover .card-value {
    transform: scale(1.05);
}

.card-metric .card-footer {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.card-metric .card-footer i {
    color: var(--accent);
    font-size: 14px;
}

/* Grid - Utilise maintenant le système responsive moderne */

.grid {
    display: grid;
    gap: 14px;
}

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

.mt-24 { margin-top: 24px; }
.mt-8  { margin-top: 8px; }

/* Buttons */

.btn {
    border-radius: 999px;
    padding: 7px 14px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-orange) 100%);
    color: #000000;
    box-shadow: 0 10px 24px rgba(251,191,36,0.4);
    font-weight: 600;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-red) 100%);
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(249,115,22,0.5);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(251,191,36,0.6);
}
.btn-outline:hover {
    background: rgba(251,191,36,0.1);
    border-color: var(--accent);
}

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

.btn-success {
    background: var(--success);
    color: #022c22;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11px;
    border: 1px solid rgba(148,163,184,0.4);
    color: var(--text-muted);
}
.badge-blue {
    background: var(--accent-soft);
    border-color: rgba(251,191,36,0.8);
    color: #ffffff;
}

/* Sections */

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

/* Video */

.video-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.1);
    background: #000000;
}

.video {
    width: 100%;
    height: 260px;
    display: block;
    background: #000000;
}

/* Table */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th, .table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.table th {
    text-align: left;
    font-weight: 500;
    color: var(--text);
    background: rgba(251,191,36,0.1);
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tr:nth-child(even) td {
    background: rgba(251,191,36,0.03);
}

.table tr:hover td {
    background: rgba(251,191,36,0.1);
}

.nowrap {
    white-space: nowrap;
}

/* Select */

.select {
    background: #ffffff;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.1);
    color: var(--text);
    padding: 5px 10px;
    font-size: 12px;
}

/* Logs */

.logs {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Service Status Cards */
.service-status-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.service-status-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.service-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #fff;
    font-size: 20px;
}

.service-info {
    flex: 1;
}

.service-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.service-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #808080;
    display: inline-block;
    animation: pulse 2s infinite;
}

.service-status[data-status="online"] .status-dot {
    background: #4ec9b0;
    animation: pulse 2s infinite;
}

.service-status[data-status="offline"] .status-dot {
    background: #f48771;
    animation: none;
}

.status-text {
    color: #666;
}

.service-status[data-status="online"] .status-text {
    color: #4ec9b0;
}

.service-status[data-status="offline"] .status-text {
    color: #f48771;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Logs Container */
#logsContainer {
    scrollbar-width: thin;
    scrollbar-color: #666 #1e1e1e;
}

#logsContainer::-webkit-scrollbar {
    width: 8px;
}

#logsContainer::-webkit-scrollbar-track {
    background: #1e1e1e;
}

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

#logsContainer::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Logs Controls */
.logs-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.logs-controls .select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

.logs-controls .select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Logs Search */
#logSearchInput {
    flex: 1;
    min-width: 200px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
}

#logSearchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Logs old style (fallback) */
.logs-old {
    background: #f8f8f8;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    padding: 10px 12px;
    max-height: 420px;
    overflow: auto;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text);
}

/* Links */

.link {
    color: var(--accent);
    text-decoration: none;
    font-size: 11px;
}
.link:hover {
    color: var(--accent-orange);
    text-decoration: underline;
}

/* Modal */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-dialog {
    width: 420px;
    max-width: 95%;
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(251,191,36,0.3);
    box-shadow: 0 22px 60px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(251,191,36,0.05);
}

.modal-header h2 {
    margin: 0;
    font-size: 16px;
}

.modal-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

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

.form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    margin-bottom: 10px;
}

.form input,
.form select {
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    padding: 7px 10px;
    color: var(--text);
    font-size: 13px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

/* Responsive - Utilise maintenant responsive.css pour un système moderne */
/* Les styles responsive sont maintenant dans responsive.css */

/* Mobile First - Petits écrans (Compatibilité) */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-width: 280px;
        position: fixed;
        top: 0;
        left: -100%;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease-out;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    .mobile-overlay {
        display: block;
    }
    
    .main {
        padding: 12px;
        width: 100%;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .main-header h1 {
        font-size: 20px;
    }
    
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .card-metric .card-value {
        font-size: 24px;
    }
    
    .logo-image {
        width: 140px;
        max-height: 40px;
    }
    
    .sidebar-logo {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .credits-logo-img {
        max-width: 100px;
        max-height: 25px;
    }
    
    .credits-text {
        font-size: 9px;
    }
    
    .credits-version {
        font-size: 10px;
    }
    
    .nav-item {
        padding: 12px;
        font-size: 15px;
    }
    
    .table-wrapper {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .modal-dialog {
        width: 95%;
        margin: 20px;
    }
    
    .video {
        height: 200px;
    }
}

/* Tablettes */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .main {
        padding: 16px;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .logo-image {
        width: 160px;
        max-height: 45px;
    }
}

/* Desktop - Grands écrans */
@media (min-width: 1025px) {
    .sidebar {
        width: 260px;
    }
    
    .main {
        padding: 18px 22px 22px;
    }
    
    .grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Très grands écrans */
@media (min-width: 1440px) {
    .main {
        max-width: 1400px;
        margin: 0 auto;
    }
}
