:root {
    --yak-navy: #0f172a;
    --yak-navy-light: #1e293b;
    --yak-amber: #f59e0b;
    --yak-amber-dark: #b45309;
    --yak-success: #16a34a;
    --yak-danger: #dc2626;
    --yak-sidebar-width: 260px;
    --yak-topbar-height: 64px;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background-color: #f4f6f9;
}

[data-bs-theme="dark"] body {
    background-color: #11151c;
}

a {
    text-decoration: none;
}

/* ---------- App shell (pages internes) ---------- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--yak-sidebar-width);
    flex-shrink: 0;
    background-color: var(--yak-navy);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1030;
    transform: translateX(0);
    transition: transform 0.2s ease-in-out;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.1rem 1.25rem;
    font-weight: 600;
    font-size: 1.05rem;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
}

.sidebar-nav {
    padding: 0.75rem 0.6rem;
    overflow-y: auto;
    flex: 1;
}

.sidebar-nav .nav-link {
    color: #cbd5e1;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.92rem;
    margin-bottom: 0.15rem;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--yak-navy-light);
    color: #fff;
}

.sidebar-nav .nav-link.active {
    background-color: var(--yak-amber);
    color: var(--yak-navy);
    font-weight: 600;
}

.sidebar-nav .nav-section-title {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: #64748b;
    padding: 1rem 0.85rem 0.35rem;
}

.app-main {
    margin-left: var(--yak-sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--yak-topbar-height);
    background-color: #fff;
    border-bottom: 1px solid #e5e9f0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

[data-bs-theme="dark"] .topbar {
    background-color: #161b24;
    border-bottom-color: #232a36;
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-content {
    padding: 1.5rem;
    flex: 1;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .app-main {
        margin-left: 0;
    }
}

/* ---------- Pages publiques (accueil / connexion) ---------- */

.public-page {
    background: linear-gradient(135deg, var(--yak-navy) 0%, #1e293b 60%, var(--yak-amber-dark) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-navbar {
    background-color: rgba(15, 23, 42, 0.55);
}

.public-navbar .navbar-brand {
    color: #fff;
    font-weight: 600;
}

.public-logo {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
}

.public-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

.public-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    padding: 1rem 0;
    font-size: 0.85rem;
}

.auth-card {
    max-width: 420px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 14px;
    padding: 2rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
}

.hero-card {
    background-color: rgba(255, 255, 255, 0.96);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
}

/* ---------- Composants partagés ---------- */

.kpi-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    height: 100%;
}

.kpi-card .kpi-value {
    font-size: 1.7rem;
    font-weight: 700;
}

.kpi-card .kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
    background-color: var(--yak-amber);
}

.section-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    margin-bottom: 1.5rem;
}

.table-responsive-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.badge-expired {
    background-color: var(--yak-danger);
}

.badge-expiring {
    background-color: var(--yak-amber);
    color: var(--yak-navy);
}

.btn-amber {
    background-color: var(--yak-amber);
    border-color: var(--yak-amber);
    color: var(--yak-navy);
    font-weight: 600;
}

.btn-amber:hover {
    background-color: var(--yak-amber-dark);
    border-color: var(--yak-amber-dark);
    color: #fff;
}
