/* ================================================
   ADMIN.CSS — Console d'Administration Jëlsima
   Feuille de style autonome, sans héritage de app.css
   ================================================ */

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0b1120;
    --panel: #111827;
    --panel2: #1f2937;
    --border: #334155;
    --text: #f8fafc;
    --muted: #94a3b8;
    --primary: #3b82f6;
    --green: #22c55e;
    --orange: #f59e0b;
    --red: #ef4444;
    --purple: #8b5cf6;
}

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-y: auto; /* SCROLLABLE - contrairement à app.css */
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ===== APP WRAPPER ===== */
#admin-app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== LAYOUT ===== */
.admin-page {
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.admin-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 20px;
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-tables-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 992px) {
    .admin-layout { grid-template-columns: 1fr; }
}

/* ===== HEADER (identique au simulateur) ===== */
.header {
    height: 70px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 1;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
}

.header-center h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, #f8fafc 30%, #93c5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-center p {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.header-right {
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 1;
}

.logo-container {
    width: 110px;
    height: 110px;
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
}

.logo-container:hover {
    transform: scale(1.05);
    filter: brightness(1.15);
}

.logo-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: screen;
    filter: drop-shadow(0 2px 8px rgba(59,130,246,0.4));
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}



/* ===== PANELS ===== */
.panel {
    background: var(--panel);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border);
}

.panel h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.panel p.sub {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ===== FORMS ===== */
label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 6px;
    margin-top: 14px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

label:first-child { margin-top: 0; }

input[type="file"],
input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--panel2);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}

input[type="file"]:hover,
input[type="number"]:focus,
input[type="text"]:focus {
    border-color: var(--primary);
}

/* ===== BUTTONS ===== */
.btn,
.btn-primary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn {
    background: var(--panel2);
    color: var(--text);
}

.btn:hover { background: var(--border); }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: transparent;
}

.btn-primary:hover { background: #2563eb; }

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-danger {
    background: var(--red);
    color: #fff;
    border-color: transparent;
}

/* ===== MAP ===== */
#adminMap {
    width: 100%;
    border-radius: 10px;
    z-index: 1;
    position: relative;
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

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

.matrix-table th, .matrix-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.matrix-table th {
    background: var(--panel2);
    font-weight: 600;
}

.matrix-table td {
    background: var(--panel);
}

.matrix-table input[type="text"], .matrix-table input[type="number"] {
    padding: 4px 8px;
    font-size: 13px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    width: 100%;
    box-sizing: border-box;
}

.matrix-table input[type="color"] {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 4px;
    padding: 0;
    cursor: pointer;
    background: transparent;
}

/* ===== BADGE ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--primary);
    color: white;
}

/* ===== CONSOLE LOG ===== */
.log-box {
    min-height: 140px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    color: #a8b2d1;
    line-height: 1.6;
}

.log-success { color: #10b981; }
.log-error   { color: #ef4444; }
.log-info    { color: #a8b2d1; }

/* ===== PANEL HEADER ===== */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

/* ===== PROGRESS ===== */
.progress-bar-wrap {
    width: 100%;
    height: 6px;
    background: var(--panel2);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
    display: none;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.4s ease;
}

/* ===== LEAFLET FIX ===== */
.leaflet-container {
    font-family: 'Inter', sans-serif !important;
}

.leaflet-control-attribution {
    font-size: 10px !important;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--panel); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
