/* TEC Admin — styles (Bootstrap 5 + charte Tout en Coach) */

/* ─── Palette TEC ───────────────────────────────────────────────── */
:root {
    --tec-blue:         #6BB6E3;
    --tec-blue-light:   #A0D2F3;
    --tec-blue-dark:    #4A9FD0;
    --tec-sidebar-bg:   #1b2a3b;
    --tec-sidebar-hover:#253a50;
    --tec-sidebar-active: var(--tec-blue-dark);
    --tec-content-bg:   #f0f6fb;

    /* Surcharge Bootstrap primary → couleur TEC */
    --bs-primary:       #6BB6E3;
    --bs-primary-rgb:   107,182,227;
    --bs-link-color:    var(--tec-blue-dark);
    --bs-link-hover-color: var(--tec-blue);
}

/* Override Bootstrap btn-primary pour la couleur TEC */
.btn-primary {
    background-color: var(--tec-blue-dark);
    border-color: var(--tec-blue-dark);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--tec-blue);
    border-color: var(--tec-blue);
    color: #fff;
}
.btn-outline-primary {
    color: var(--tec-blue-dark);
    border-color: var(--tec-blue-dark);
}
.btn-outline-primary:hover {
    background-color: var(--tec-blue-dark);
    border-color: var(--tec-blue-dark);
    color: #fff;
}
.text-primary { color: var(--tec-blue-dark) !important; }
.bg-primary    { background-color: var(--tec-blue-light) !important; }
.border-primary { border-color: var(--tec-blue) !important; }

body {
    background: var(--tec-content-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ─── Layout général ────────────────────────────────────────────── */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}
.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.admin-content { flex: 1; }

/* ─── Sidebar ───────────────────────────────────────────────────── */
.admin-sidebar {
    width: 250px;
    background: var(--tec-sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}

.sidebar-brand img.sidebar-logo {
    height: 36px;
    width: auto;
    filter: brightness(0) invert(1); /* logo blanc */
}

.sidebar-brand a:hover { opacity: 0.9; }

.sidebar-nav .nav-link {
    color: #c8dae8;
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    margin-bottom: 2px;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav .nav-link:hover {
    background: var(--tec-sidebar-hover);
    color: #fff;
}
.sidebar-nav .nav-link.active {
    background: var(--tec-blue-dark);
    color: #fff;
}

.sidebar-section {
    letter-spacing: 0.06em;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35) !important;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.08) !important;
}

/* ─── Bannière impersonation ────────────────────────────────────── */
.impersonate-banner {
    background: #1b2a3b;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
}
.impersonate-banner .btn-light {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

/* ─── Topbar ────────────────────────────────────────────────────── */
.admin-topbar {
    background: #fff;
    border-bottom: 1px solid #dde6ef !important;
}
.admin-topbar h1 { color: #1b2a3b; }

/* ─── Cartes KPI ────────────────────────────────────────────────── */
.kpi-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(107,182,227,0.1);
    border: 1px solid #dde6ef;
}
.kpi-card .kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.kpi-value {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1b2a3b;
    margin: 0.25rem 0 0;
}
.kpi-label {
    color: #6b7280;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* KPI icon backgrounds — harmonisés TEC */
.bg-primary.bg-opacity-10  { background-color: rgba(107,182,227,0.12) !important; }
.bg-info.bg-opacity-10     { background-color: rgba(160,210,243,0.2) !important; }
.bg-success.bg-opacity-10  { background-color: rgba(16,185,129,0.1) !important; }
.bg-warning.bg-opacity-10  { background-color: rgba(245,158,11,0.1) !important; }

/* ─── Cartes générales ──────────────────────────────────────────── */
.card {
    border: 1px solid #dde6ef;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(107,182,227,0.08);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #dde6ef;
    font-weight: 600;
}

/* ─── Tableaux ──────────────────────────────────────────────────── */
.table > :not(caption) > * > * { padding: 0.85rem 1rem; }
.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    border-bottom: 2px solid #dde6ef;
    background: #f5f9fd;
}

/* ─── Badges de statut ──────────────────────────────────────────── */
.badge-status-active    { background: #d1fae5; color: #065f46; }
.badge-status-inactive  { background: #f3f4f6; color: #4b5563; }
.badge-status-pending   { background: #fef3c7; color: #92400e; }
.badge-status-draft     { background: #dbeafe; color: #1e3a8a; }
.badge-status-sent      { background: #e0f2fe; color: #0369a1; }
.badge-status-paid      { background: #d1fae5; color: #065f46; }
.badge-status-cancelled { background: #fee2e2; color: #991b1b; }
.badge-status-overdue   { background: #fee2e2; color: #991b1b; }
.badge-status-ended     { background: #f3f4f6; color: #4b5563; }

.badge[class*="badge-status-"] {
    font-weight: 500;
    padding: 0.35em 0.7em;
    font-size: 0.75rem;
}

/* ─── Page de login / auth ──────────────────────────────────────── */
body.bg-light {
    background: linear-gradient(135deg, #A0D2F3 0%, #6BB6E3 50%, #4A9FD0 100%) !important;
    min-height: 100vh;
}

.login-card {
    max-width: 420px;
    width: 100%;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(74,159,208,0.25);
    border: none;
}

.login-card .bi.fs-1 { color: var(--tec-blue-dark) !important; }
.login-card h1 { color: #1b2a3b; }

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
    .admin-sidebar {
        position: fixed;
        left: -250px;
        transition: left 0.25s ease;
        z-index: 1040;
    }
    .admin-sidebar.show { left: 0; }
}
