/* ============================================================
   GestaVOZit — Back-office (thème marine / cyan, police Poppins)
   Identité de marque VOZit alignée sur l'app mobile :
     marine #003D68 + cyan #00AEEF
   ============================================================ */

:root {
    --brand-navy:         #003D68;
    --brand-navy-700:     #002b4a;
    --brand-cyan:         #00AEEF;
    --brand-cyan-600:     #0098cf;
    --brand-primary:      var(--brand-navy);
    --danger:             #E53935;

    --sidebar-width:      262px;
    --sidebar-bg:         #003D68;
    --sidebar-bg-2:       #002b4a;
    --sidebar-text:       rgba(255,255,255,.66);
    --sidebar-border:     rgba(255,255,255,.08);
    --topbar-height:      62px;
    --content-bg:         #F4F6FA;
    --card-radius:        16px;
    --transition:         all .2s ease;
}

[data-bs-theme="dark"] {
    --content-bg:  #101418;
    --sidebar-bg:  #0c2740;
    --sidebar-bg-2:#081c2e;
}

/* ─── Base ───────────────────────────────────────────────────── */
html, body { height: 100%; }

body {
    background: var(--content-bg);
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
    font-size: .9rem;
    color: #1f2933;
}
[data-bs-theme="dark"] body { color: #e6edf3; }

a { color: var(--brand-cyan-600); }
a:hover { color: var(--brand-cyan); }

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

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(185deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: var(--sidebar-text);
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-x: hidden;
}

.sidebar-brand {
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: var(--topbar-height);
    text-decoration: none;
}

.sidebar-brand-logo,
.sidebar-brand-logo-placeholder {
    width: 40px; height: 40px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-weight: 700; font-size: 1rem; color: #fff;
    background: linear-gradient(135deg, var(--brand-cyan) 0%, var(--brand-cyan-600) 100%);
    box-shadow: 0 4px 12px rgba(0,174,239,.35);
}
.sidebar-brand-logo { object-fit: contain; background: rgba(255,255,255,.12); padding: 5px; box-shadow: none; }

.sidebar-brand-name { font-size: 1rem; font-weight: 700; color: #fff; line-height: 1.15; white-space: nowrap; }
.sidebar-brand-tagline { font-size: .68rem; color: rgba(255,255,255,.5); font-weight: 400; }

/* Navigation */
.sidebar-section-title {
    font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
    color: rgba(255,255,255,.32);
    padding: 1.15rem 1.4rem .35rem;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: .5rem 0 1rem; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 2px; }

.sidebar-nav .nav-item { padding: 0 .7rem; }

.sidebar-nav .nav-link {
    color: var(--sidebar-text);
    padding: .6rem .9rem;
    border-radius: 11px;
    margin-bottom: 2px;
    transition: var(--transition);
    font-size: .865rem; font-weight: 500;
    display: flex; align-items: center; gap: .8rem;
    white-space: nowrap;
}
.sidebar-nav .nav-link i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; opacity: .8; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav .nav-link:hover i { opacity: 1; }

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--brand-cyan) 0%, var(--brand-cyan-600) 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,174,239,.35);
}
.sidebar-nav .nav-link.active i { opacity: 1; }
.sidebar-nav .nav-link .badge { margin-left: auto; font-size: .62rem; }

/* Footer utilisateur */
.sidebar-footer { padding: .9rem .7rem; border-top: 1px solid var(--sidebar-border); }
.sidebar-user {
    display: flex; align-items: center; gap: .7rem;
    padding: .55rem .8rem; border-radius: 11px; cursor: pointer;
    transition: var(--transition); color: var(--sidebar-text);
}
.sidebar-user:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-cyan) 0%, var(--brand-cyan-600) 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700; color: #fff; flex-shrink: 0; overflow: hidden;
}
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: .7rem; color: rgba(255,255,255,.5); }

/* ─── Contenu principal ──────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1; display: flex; flex-direction: column; min-height: 100vh;
    transition: var(--transition);
}

/* ─── Topbar ─────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e7ebf0;
    display: flex; align-items: center; padding: 0 1.5rem; gap: 1rem;
    position: sticky; top: 0; z-index: 1030;
}
[data-bs-theme="dark"] .topbar { background: #161b22; border-bottom-color: rgba(255,255,255,.07); }

.topbar-toggle, .topbar-btn {
    background: none; border: none; border-radius: 10px;
    color: #6b7785; cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center; position: relative;
}
.topbar-toggle { padding: .4rem .55rem; font-size: 1.2rem; display: none; }
.topbar-btn { padding: .45rem .55rem; font-size: 1.1rem; }
.topbar-btn:hover, .topbar-toggle:hover { background: var(--content-bg); color: var(--brand-navy); }
[data-bs-theme="dark"] .topbar-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.topbar-title { font-weight: 600; font-size: .95rem; }
.topbar-btn .notif-dot {
    width: 8px; height: 8px; background: var(--danger); border-radius: 50%;
    position: absolute; top: 5px; right: 5px; border: 2px solid #fff;
}

/* ─── Page ───────────────────────────────────────────────────── */
.page-content { flex: 1; padding: 1.75rem; }
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.page-title { font-size: 1.4rem; font-weight: 700; margin: 0; color: var(--brand-navy); }
[data-bs-theme="dark"] .page-title { color: #fff; }
.page-subtitle { font-size: .82rem; color: #6b7785; margin-top: .2rem; }

/* ─── Cartes ─────────────────────────────────────────────────── */
.card {
    border-radius: var(--card-radius);
    border: 1px solid rgba(0,61,104,.08);
    box-shadow: 0 1px 3px rgba(0,40,70,.06);
    transition: var(--transition);
}
[data-bs-theme="dark"] .card { border-color: rgba(255,255,255,.07); background: #1b2127; }
.card-header {
    background: transparent; border-bottom: 1px solid rgba(0,61,104,.08);
    padding: 1rem 1.25rem; font-weight: 600; font-size: .92rem;
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
[data-bs-theme="dark"] .card-header { border-bottom-color: rgba(255,255,255,.07); }

/* Stats */
.stat-card {
    border-radius: var(--card-radius); padding: 1.25rem;
    display: flex; align-items: center; gap: 1rem;
    background: #fff; border: 1px solid rgba(0,61,104,.08);
    box-shadow: 0 1px 3px rgba(0,40,70,.06);
    height: 100%;
}
[data-bs-theme="dark"] .stat-card { background: #1b2127; border-color: rgba(255,255,255,.07); }
.stat-card-icon {
    width: 54px; height: 54px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.45rem; flex-shrink: 0; color: #fff;
}
.stat-card-value { font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--brand-navy); }
[data-bs-theme="dark"] .stat-card-value { color: #fff; }
.stat-card-label { font-size: .78rem; color: #6b7785; margin-top: .25rem; }

.bg-navy   { background: var(--brand-navy) !important; }
.bg-cyan   { background: var(--brand-cyan) !important; }
.text-navy { color: var(--brand-navy) !important; }
.text-cyan { color: var(--brand-cyan-600) !important; }

/* ─── Tables ─────────────────────────────────────────────────── */
.table { font-size: .86rem; }
.table th {
    font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
    color: #6b7785; border-top: none;
}
.table td { vertical-align: middle; }
.table-hover tbody tr { transition: background .12s ease; }
.table-hover tbody tr:hover { cursor: pointer; }
.table-actions { display: flex; gap: .35rem; }
.table-actions .btn { padding: .25rem .55rem; font-size: .78rem; }

/* ─── Boutons ────────────────────────────────────────────────── */
.btn { border-radius: 11px; font-weight: 500; }
.btn-primary {
    --bs-btn-bg: var(--brand-navy); --bs-btn-border-color: var(--brand-navy);
    --bs-btn-hover-bg: var(--brand-navy-700); --bs-btn-hover-border-color: var(--brand-navy-700);
    --bs-btn-active-bg: var(--brand-navy-700); --bs-btn-active-border-color: var(--brand-navy-700);
    --bs-btn-disabled-bg: var(--brand-navy); --bs-btn-disabled-border-color: var(--brand-navy);
}
.btn-cyan {
    --bs-btn-color: #fff; --bs-btn-bg: var(--brand-cyan); --bs-btn-border-color: var(--brand-cyan);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-cyan-600); --bs-btn-hover-border-color: var(--brand-cyan-600);
    --bs-btn-active-bg: var(--brand-cyan-600); --bs-btn-active-border-color: var(--brand-cyan-600);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand-navy); --bs-btn-border-color: var(--brand-navy);
    --bs-btn-hover-bg: var(--brand-navy); --bs-btn-hover-border-color: var(--brand-navy);
    --bs-btn-active-bg: var(--brand-navy); --bs-btn-active-border-color: var(--brand-navy);
}

/* ─── Formulaires ────────────────────────────────────────────── */
.form-label { font-weight: 500; font-size: .83rem; margin-bottom: .35rem; }
.form-control, .form-select { font-size: .875rem; border-radius: 11px; padding: .55rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand-cyan); box-shadow: 0 0 0 .2rem rgba(0,174,239,.18); }
.input-group-text { border-radius: 11px 0 0 11px; background: var(--content-bg); border-color: #dee3ea; }
[data-bs-theme="dark"] .input-group-text { background: #20262d; border-color: rgba(255,255,255,.1); }
.form-check-input:checked { background-color: var(--brand-cyan); border-color: var(--brand-cyan); }
.form-switch .form-check-input { width: 2.4em; height: 1.25em; }

/* ─── Badges doux ────────────────────────────────────────────── */
.badge { font-weight: 500; font-size: .72rem; padding: .38em .7em; border-radius: 8px; }
.badge-soft-success  { background: rgba(40,167,69,.13);  color: #1e7e34; }
.badge-soft-danger   { background: rgba(229,57,53,.13);  color: #c62828; }
.badge-soft-warning  { background: rgba(255,159,10,.18); color: #b26a00; }
.badge-soft-info     { background: rgba(0,174,239,.14);  color: #0078a5; }
.badge-soft-primary  { background: rgba(0,61,104,.12);   color: var(--brand-navy); }
.badge-soft-secondary{ background: rgba(108,117,125,.14);color: #495057; }
[data-bs-theme="dark"] .badge-soft-success  { background: rgba(40,167,69,.22);  color: #75d18c; }
[data-bs-theme="dark"] .badge-soft-danger   { background: rgba(229,57,53,.22);  color: #ef9a9a; }
[data-bs-theme="dark"] .badge-soft-warning  { background: rgba(255,159,10,.22); color: #ffcb73; }
[data-bs-theme="dark"] .badge-soft-info     { background: rgba(0,174,239,.22);  color: #6fd3f7; }
[data-bs-theme="dark"] .badge-soft-primary  { background: rgba(79,195,247,.2);  color: #8ed3f7; }
[data-bs-theme="dark"] .badge-soft-secondary{ background: rgba(255,255,255,.1); color: #ced4da; }

/* ─── Avatars / pastilles ────────────────────────────────────── */
.avatar-sm, .avatar-md {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-weight: 700; flex-shrink: 0; color: #fff;
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-cyan-600) 100%);
}
.avatar-sm { width: 34px; height: 34px; font-size: .72rem; }
.avatar-md { width: 46px; height: 46px; font-size: .9rem; }

.sev-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ─── Timeline incident ──────────────────────────────────────── */
.timeline { position: relative; padding-left: 1.9rem; }
.timeline::before { content: ''; position: absolute; left: .45rem; top: .2rem; bottom: .2rem; width: 2px; background: rgba(0,61,104,.12); }
[data-bs-theme="dark"] .timeline::before { background: rgba(255,255,255,.12); }
.timeline-item { position: relative; padding-bottom: 1.3rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute; left: -1.68rem; top: .15rem; width: 15px; height: 15px;
    border-radius: 50%; border: 3px solid #fff; background: var(--brand-cyan);
}
[data-bs-theme="dark"] .timeline-dot { border-color: #1b2127; }
.timeline-date { font-size: .73rem; color: #6b7785; }

/* ─── Auth ───────────────────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--brand-navy) 0%, #001f36 100%);
    padding: 1.5rem; position: relative; overflow: hidden;
}
.auth-wrapper::before {
    content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%;
    background: radial-gradient(circle, rgba(0,174,239,.25) 0%, transparent 70%);
    top: -160px; right: -120px;
}
.auth-card {
    width: 100%; max-width: 430px; background: #fff; border-radius: 22px;
    box-shadow: 0 24px 64px rgba(0,0,0,.35); overflow: hidden; position: relative; z-index: 1;
}
.auth-header { background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-700) 100%); padding: 2.1rem 2rem 1.8rem; text-align: center; color: #fff; }
.auth-logo {
    width: 62px; height: 62px; border-radius: 17px; margin: 0 auto .85rem;
    display: flex; align-items: center; justify-content: center; font-size: 1.7rem; color: #fff;
    background: linear-gradient(135deg, var(--brand-cyan) 0%, var(--brand-cyan-600) 100%);
    box-shadow: 0 8px 22px rgba(0,174,239,.45);
}
.auth-body { padding: 2rem; }

/* ─── Divers ─────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: #6b7785; }
.empty-state i { font-size: 2.6rem; color: var(--brand-cyan); opacity: .6; display: block; margin-bottom: .75rem; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1039; }

@media (max-width: 991.98px) {
    .topbar-toggle { display: flex; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0 !important; }
}

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .22s ease forwards; }
