/* VITALSIM Admin - Refonte design 2026 */

/* Compatibilité anciennes classes (scenarios, login, etc.) */
.form-control-vitalsim, .form-select-vitalsim { background: rgba(0,0,0,0.35); border: 1px solid var(--vs-border); color: var(--vs-text); }
.form-control-vitalsim:focus, .form-select-vitalsim:focus { border-color: var(--vs-border-focus); box-shadow: 0 0 0 3px rgba(13,148,136,0.15); }
.card-vitalsim { background: var(--vs-surface); border: 1px solid var(--vs-border); border-radius: var(--vs-radius); }
.table-vitalsim { color: var(--vs-text); }
.table-vitalsim thead th { background: rgba(0,0,0,0.2); color: var(--vs-muted); border-color: var(--vs-border); }
.table-vitalsim td { border-color: var(--vs-border); }
.btn-teal { background: var(--vs-teal-dim); border-color: var(--vs-teal-dim); color: #fff; }
.btn-teal:hover { background: #0f766e; color: #fff; }
.btn-outline-teal { border-color: var(--vs-teal-dim); color: var(--vs-teal); }
.btn-outline-teal:hover { background: rgba(13,148,136,0.15); color: var(--vs-teal); }
.text-vitalsim-muted { color: var(--vs-muted); }

:root {
    --vs-bg: #0c1222;
    --vs-surface: #151d32;
    --vs-surface-hover: #1a2540;
    --vs-border: rgba(255, 255, 255, 0.08);
    --vs-border-focus: rgba(13, 148, 136, 0.5);
    --vs-teal: #14b8a6;
    --vs-teal-dim: #0d9488;
    --vs-orange: #f97316;
    --vs-text: #f1f5f9;
    --vs-muted: #94a3b8;
    --vs-muted-soft: #64748b;
    --vs-radius: 12px;
    --vs-radius-sm: 8px;
    --vs-sidebar-w: 260px;
    --vs-header-h: 60px;
}

* { box-sizing: border-box; }

body {
    background: var(--vs-bg);
    color: var(--vs-text);
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

/* Layout: sidebar + main */
.admin-wrap {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--vs-sidebar-w);
    flex-shrink: 0;
    background: var(--vs-surface);
    border-right: 1px solid var(--vs-border);
    display: flex;
    flex-direction: column;
}

.admin-sidebar .brand {
    height: var(--vs-header-h);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--vs-border);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--vs-teal);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.admin-sidebar .brand:hover { color: var(--vs-teal); opacity: 0.95; }

.admin-sidebar nav {
    padding: 1rem 0;
    flex: 1;
}

.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: var(--vs-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
}

.admin-sidebar .nav-link:hover {
    color: var(--vs-text);
    background: var(--vs-surface-hover);
}

.admin-sidebar .nav-link.active {
    color: var(--vs-teal);
    background: rgba(13, 148, 136, 0.12);
    border-left: 3px solid var(--vs-teal);
    padding-left: calc(1.25rem - 3px);
}

.admin-sidebar .nav-link i { font-size: 1.1rem; opacity: 0.9; }

.admin-sidebar .user-bar {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--vs-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.admin-sidebar .user-bar .user-name {
    font-size: 0.85rem;
    color: var(--vs-muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-content {
    flex: 1;
    padding: 1.75rem 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Page titles */
.page-header { margin-bottom: 1.75rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.25rem 0; color: var(--vs-text); }
.page-header .subtitle { font-size: 0.9rem; color: var(--vs-muted); }

/* Cards */
.vs-card {
    background: var(--vs-surface);
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.vs-card:hover { border-color: rgba(255,255,255,0.12); }

.vs-card .card-body { padding: 1.5rem; }

.vs-card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--vs-border);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--vs-text);
}

/* Stats / dashboard tiles */
.stat-tile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--vs-surface);
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.stat-tile:hover {
    border-color: var(--vs-teal-dim);
    background: rgba(13, 148, 136, 0.06);
    color: inherit;
}

.stat-tile .num { font-size: 1.75rem; font-weight: 700; color: var(--vs-text); }
.stat-tile .label { font-size: 0.85rem; color: var(--vs-muted); margin-top: 0.2rem; }
.stat-tile .icon { font-size: 1.5rem; color: var(--vs-teal); opacity: 0.9; }

/* Buttons */
.btn-vs {
    background: var(--vs-teal-dim);
    border: none;
    color: #fff;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--vs-radius-sm);
    transition: background 0.2s, transform 0.05s;
}

.btn-vs:hover { background: #0f766e; color: #fff; }
.btn-vs:active { transform: scale(0.98); }

.btn-vs-outline {
    background: transparent;
    border: 1px solid var(--vs-teal-dim);
    color: var(--vs-teal);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--vs-radius-sm);
    transition: background 0.2s, color 0.2s;
}

.btn-vs-outline:hover { background: rgba(13, 148, 136, 0.15); color: var(--vs-teal); }

.btn-vs-sm { padding: 0.35rem 0.75rem; font-size: 0.875rem; }
.btn-vs-danger { background: #dc2626; }
.btn-vs-danger:hover { background: #b91c1c; color: #fff; }

/* Forms */
.vs-input, .vs-select, .vs-textarea {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--vs-border);
    border-radius: var(--vs-radius-sm);
    color: var(--vs-text);
    padding: 0.5rem 0.75rem;
    width: 100%;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.vs-input:focus, .vs-select:focus, .vs-textarea:focus {
    outline: none;
    border-color: var(--vs-border-focus);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.vs-input::placeholder, .vs-textarea::placeholder { color: var(--vs-muted-soft); }

.vs-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--vs-muted);
    margin-bottom: 0.35rem;
}

/* Tables */
.vs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.vs-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--vs-muted);
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--vs-border);
}

.vs-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--vs-border);
    vertical-align: middle;
}

.vs-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.vs-table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.vs-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
}

.vs-badge-teal { background: rgba(13, 148, 136, 0.25); color: var(--vs-teal); }
.vs-badge-orange { background: rgba(249, 115, 22, 0.2); color: var(--vs-orange); }
.vs-badge-muted { background: rgba(148, 163, 184, 0.2); color: var(--vs-muted); }

/* Grades A/B/C/D */
.grade-A { color: #22c55e; font-weight: 700; }
.grade-B { color: #4ade80; font-weight: 600; }
.grade-C { color: #f97316; font-weight: 600; }
.grade-D { color: #ef4444; font-weight: 700; }

/* Alerts */
.vs-alert {
    padding: 0.85rem 1rem;
    border-radius: var(--vs-radius-sm);
    font-size: 0.9rem;
}

.vs-alert-success { background: rgba(13, 148, 136, 0.15); border: 1px solid rgba(13, 148, 136, 0.3); color: #5eead4; }
.vs-alert-danger { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }

/* Utilities */
.text-vs-muted { color: var(--vs-muted); }
.text-vs-teal { color: var(--vs-teal); }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* List group (form editor) */
.admin-content .list-group-item {
    background: rgba(0, 0, 0, 0.25);
    border-color: var(--vs-border);
    color: var(--vs-text);
}

/* Modal dark */
.modal-content { border-radius: var(--vs-radius); }
.modal-header, .modal-footer { border-color: var(--vs-border); }

.alert-vs { background: rgba(13,148,136,0.15); border: 1px solid var(--vs-teal); color: var(--vs-teal); border-radius: var(--vs-radius); }
.alert-vs-danger { background: rgba(220,38,38,0.15); border: 1px solid rgba(220,38,38,0.5); color: #fca5a5; border-radius: var(--vs-radius); }

/* Page login standalone */
body.login-page { background: var(--vs-bg); min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--vs-text); }
body.login-page .login-card { max-width: 380px; width: 100%; }

/* Responsive: collapse sidebar on small */
@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1030;
        transform: translateX(-100%);
        transition: transform 0.25s;
    }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 1rem; }
}
