:root {
    --fr-blue: #002654;
    --fr-red: #ce1126;
    --fr-white: #ffffff;
    --ink: #172033;
    --muted: #64748b;
    --surface: #f6f8fb;
    --line: #dbe3ef;
}

* {
    box-sizing: border-box;
}

body.modern-france {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(90deg, rgba(0, 38, 84, 0.08) 0 33.33%, rgba(255, 255, 255, 0.72) 33.33% 66.66%, rgba(206, 17, 38, 0.08) 66.66% 100%),
        var(--surface);
    color: var(--ink);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

body.app-layout {
    display: flex;
    flex-direction: column;
}

.france-topline {
    height: 6px;
    background: linear-gradient(90deg, var(--fr-blue) 0 33.33%, var(--fr-white) 33.33% 66.66%, var(--fr-red) 66.66% 100%);
    border-bottom: 1px solid rgba(0, 38, 84, 0.12);
}

.login-shell {
    min-height: calc(100vh - 6px);
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.login-card {
    width: min(100%, 460px);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(0, 38, 84, 0.12);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 38, 84, 0.18);
    overflow: hidden;
}

.login-brand {
    padding: 28px 28px 18px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.login-brand img {
    max-width: 240px;
    width: 72%;
    height: auto;
    margin-bottom: 16px;
}

.login-brand h1 {
    margin: 0;
    color: var(--fr-blue);
    font-size: 1.45rem;
    font-weight: 800;
}

.login-brand p {
    margin: 8px 0 0;
    color: var(--muted);
}

.login-card .form-control {
    min-height: 46px;
    border-color: var(--line);
}

.btn-france {
    --bs-btn-bg: var(--fr-blue);
    --bs-btn-border-color: var(--fr-blue);
    --bs-btn-hover-bg: #001f45;
    --bs-btn-hover-border-color: #001f45;
    --bs-btn-active-bg: #001a3a;
    --bs-btn-active-border-color: #001a3a;
    color: #fff;
}

.app-navbar {
    background: linear-gradient(90deg, #002654 0%, #073b7a 52%, #ce1126 160%);
    box-shadow: 0 12px 32px rgba(0, 38, 84, 0.18);
    backdrop-filter: blur(12px);
}

.app-navbar .navbar-brand,
.app-navbar .nav-link,
.app-navbar .dropdown-item {
    font-weight: 600;
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    color: var(--fr-blue);
}

.brand-text {
    white-space: nowrap;
}

.app-navbar .navbar-brand,
.app-navbar .nav-link {
    color: #fff;
}

.app-navbar .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 3px;
    padding: 9px 10px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus,
.app-navbar .navbar-brand:hover,
.app-navbar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 6px;
}

.app-navbar .nav-link:hover {
    transform: translateY(-1px);
}

.app-navbar .dropdown-menu {
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(0, 38, 84, 0.18);
    min-width: 270px;
    overflow: hidden;
}

.app-navbar .dropdown-item:hover {
    background: rgba(0, 38, 84, 0.08);
    color: var(--fr-blue);
}

.app-navbar .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}

.app-navbar .dropdown-item i {
    width: 20px;
    color: var(--fr-blue);
}

.app-navbar .dropdown-item.active,
.app-navbar .dropdown-item:active {
    background: rgba(206, 17, 38, 0.1);
    color: var(--fr-blue);
}

.dropdown-menu-animated {
    animation: dropdownFade 0.18s ease both;
    transform-origin: top center;
}

.user-chip {
    align-items: center;
    gap: 8px;
    max-width: 260px;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 7px 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-strip {
    background: #fff;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    padding: 12px 24px;
}

.system-panel {
    width: min(100% - 32px, 980px);
    margin: 80px auto 32px;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 55px rgba(0, 38, 84, 0.12);
}

.system-panel h1 {
    color: var(--fr-blue);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
}

.page-main {
    flex: 1 0 auto;
    width: 100%;
}

.dashboard-hero {
    width: min(100% - 32px, 1120px);
    margin: 40px auto 32px;
}

.home-hero {
    flex: 1;
    width: min(100% - 32px, 1180px);
    margin: 38px auto;
}

.home-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    gap: 28px;
    align-items: stretch;
    padding: clamp(24px, 4vw, 46px);
    background:
        linear-gradient(135deg, rgba(0, 38, 84, 0.96), rgba(0, 38, 84, 0.82)),
        #002654;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 28px 75px rgba(0, 38, 84, 0.24);
    position: relative;
    overflow: hidden;
}

.home-hero-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 7px;
    background: linear-gradient(90deg, var(--fr-blue) 0 33.33%, #fff 33.33% 66.66%, var(--fr-red) 66.66% 100%);
}

.home-copy,
.home-summary {
    position: relative;
    z-index: 1;
}

.eyebrow {
    display: inline-flex;
    color: #fff;
    background: rgba(206, 17, 38, 0.9);
    border-radius: 999px;
    padding: 6px 12px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.78rem;
    margin-bottom: 16px;
}

.home-copy h1 {
    font-size: clamp(2rem, 5vw, 4.1rem);
    line-height: 1;
    font-weight: 900;
    margin-bottom: 18px;
}

.home-copy p {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.1rem;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.home-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.home-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.quick-card {
    display: flex;
    flex-direction: column;
    min-height: 150px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.quick-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.quick-card i {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    color: var(--fr-blue);
    font-size: 1.2rem;
    margin-bottom: 14px;
}

.quick-card strong {
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.quick-card span {
    color: rgba(255, 255, 255, 0.78);
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 55px rgba(0, 38, 84, 0.12);
}

.metric-tile {
    min-height: 120px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 18px;
}

.metric-tile strong {
    color: var(--fr-blue);
    display: block;
    font-size: 1.1rem;
}

.site-footer {
    flex-shrink: 0;
    margin-top: auto;
    background: #fff;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.site-footer .footer-stripe {
    height: 4px;
    background: linear-gradient(90deg, var(--fr-blue) 0 33.33%, var(--fr-white) 33.33% 66.66%, var(--fr-red) 66.66% 100%);
    border-bottom: 1px solid rgba(0, 38, 84, 0.08);
}

.accent-rule {
    height: 4px;
    width: 160px;
    background: linear-gradient(90deg, var(--fr-blue) 0 33.33%, var(--fr-white) 33.33% 66.66%, var(--fr-red) 66.66% 100%);
    border: 1px solid rgba(0, 38, 84, 0.12);
    margin: 16px auto 24px;
}

.security-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
    padding: 16px;
}

.security-panel__image {
    width: 170px;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 6px;
}

@media (max-width: 991.98px) {
    .app-navbar .nav-link {
        padding-inline: 12px;
    }

    .user-strip {
        padding-inline: 16px;
    }
}

@media (max-width: 1199.98px) {
    .app-navbar .navbar-collapse {
        padding-top: 12px;
    }

    .app-navbar .nav-link {
        width: 100%;
        justify-content: flex-start;
    }

    .app-navbar .dropdown-menu {
        box-shadow: none;
        border-color: rgba(255, 255, 255, 0.15);
        margin: 0 0 8px 16px;
    }

    .nav-actions {
        padding: 12px 0 6px;
    }
}

@media (max-width: 900px) {
    .home-hero-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .brand-text {
        max-width: 190px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .home-summary {
        grid-template-columns: 1fr;
    }

    .home-actions .btn {
        width: 100%;
        justify-content: center;
    }
}
