:root {
    --mil-olive-950: #161c12;
    --mil-olive-900: #1e2618;
    --mil-olive-800: #2a3520;
    --mil-olive-700: #3a4a2b;
    --mil-olive-600: #4b5d38;
    --mil-khaki: #c2b07a;
    --mil-brass: #a8893a;
    --mil-field: #eef2e8;
    --mil-panel: #f7f8f4;
    --mil-ink: #1c2416;
    --mil-muted: #66705a;
    --mil-line: #d7ddcf;
    --mil-danger: #8b3a2f;
    --mil-success: #3f6b3a;
    --sidebar-width: 280px;
    --topbar-height: 64px;
    --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body.app-body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--mil-ink);
    background:
        radial-gradient(circle at top right, rgba(168, 137, 58, 0.08), transparent 28%),
        linear-gradient(180deg, #f4f6f0 0%, var(--mil-field) 45%, #e7ecdf 100%);
}

a {
    color: var(--mil-olive-700);
}

a:hover {
    color: var(--mil-olive-900);
}

h1, h2, h3, h4, h5, .brand-title, .page-title {
    font-family: var(--font-display);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.btn-primary {
    --bs-btn-bg: var(--mil-olive-700);
    --bs-btn-border-color: var(--mil-olive-700);
    --bs-btn-hover-bg: var(--mil-olive-800);
    --bs-btn-hover-border-color: var(--mil-olive-800);
    --bs-btn-active-bg: var(--mil-olive-900);
    --bs-btn-active-border-color: var(--mil-olive-900);
    --bs-btn-disabled-bg: var(--mil-olive-600);
    --bs-btn-disabled-border-color: var(--mil-olive-600);
    border-radius: 0.35rem;
    font-weight: 600;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
    border-radius: 0.35rem;
}

.btn-outline-primary {
    --bs-btn-color: var(--mil-olive-700);
    --bs-btn-border-color: var(--mil-olive-700);
    --bs-btn-hover-bg: var(--mil-olive-700);
    --bs-btn-hover-border-color: var(--mil-olive-700);
    --bs-btn-active-bg: var(--mil-olive-800);
    --bs-btn-active-border-color: var(--mil-olive-800);
}

.btn-outline-danger {
    --bs-btn-color: var(--mil-danger);
    --bs-btn-border-color: var(--mil-danger);
    --bs-btn-hover-bg: var(--mil-danger);
    --bs-btn-hover-border-color: var(--mil-danger);
}

.form-control,
.form-select {
    border-color: var(--mil-line);
    border-radius: 0.35rem;
    background: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--mil-olive-600);
    box-shadow: 0 0 0 0.2rem rgba(58, 74, 43, 0.15);
}

.table {
    --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--mil-line);
}

.table thead th {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.85rem;
    color: var(--mil-olive-800);
    background: rgba(58, 74, 43, 0.06);
}

.badge.text-bg-primary {
    background: var(--mil-olive-700) !important;
}

.alert {
    border-radius: 0.4rem;
}

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

.app-shell--auth .app-main {
    background:
        linear-gradient(180deg, rgba(238, 242, 232, 0.78), rgba(231, 236, 223, 0.72)),
        url("https://media.istockphoto.com/id/1287561722/photo/camouflage-cloth-texture-abstract-background-and-texture-for-design.jpg?s=612x612&w=0&k=20&c=MrNR7xi7ZByp3YZkDmDHxcNO6XQzMBM_3MB_Stvc7jw=") center center / cover no-repeat fixed;
}

.app-shell--auth .app-topbar {
    background: rgba(247, 248, 244, 0.82);
}

.app-shell--auth .content-panel {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
}

.app-shell--auth .app-footer {
    background: transparent;
    color: var(--mil-olive-800);
}

.app-sidebar {
    width: var(--sidebar-width);
    background:
        linear-gradient(180deg, rgba(168, 137, 58, 0.12), transparent 18%),
        linear-gradient(180deg, var(--mil-olive-900), var(--mil-olive-950));
    color: #edf0e7;
    border-right: 1px solid rgba(194, 176, 122, 0.18);
}

.app-sidebar .brand,
.app-offcanvas .brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(237, 240, 231, 0.08);
    text-decoration: none;
    color: inherit;
}

.app-sidebar .brand-mark,
.app-offcanvas .brand-mark {
    width: 42px;
    height: 42px;
    border: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: transparent;
    flex-shrink: 0;
}

.app-sidebar .brand-mark img,
.app-offcanvas .brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.app-sidebar .brand-title,
.app-offcanvas .brand-title {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1;
    color: #fff;
}

.app-sidebar .brand-subtitle,
.app-offcanvas .brand-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: rgba(237, 240, 231, 0.65);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-nav {
    padding: 1rem 0.85rem 1.5rem;
    overflow-y: auto;
}

.sidebar-section {
    margin-top: 1rem;
    margin-bottom: 0.45rem;
    padding: 0 0.85rem;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(194, 176, 122, 0.85);
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.2rem;
    color: rgba(237, 240, 231, 0.82);
    text-decoration: none;
    border-radius: 0.4rem;
    border: 1px solid transparent;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(194, 176, 122, 0.2);
    transform: translateX(2px);
}

.sidebar-link.active {
    color: #fff;
    background: rgba(194, 176, 122, 0.16);
    border-color: rgba(194, 176, 122, 0.35);
}

.sidebar-link .nav-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    flex-shrink: 0;
    border-radius: 0.4rem;
    background: rgba(194, 176, 122, 0.12);
    border: 1px solid rgba(194, 176, 122, 0.22);
    color: #d4c48a;
    font-size: 0.95rem;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-link:hover .nav-ico {
    background: rgba(194, 176, 122, 0.22);
    color: #f0e6c0;
    border-color: rgba(194, 176, 122, 0.4);
}

.sidebar-link.active .nav-ico {
    background: rgba(194, 176, 122, 0.28);
    color: #fff8e1;
    border-color: rgba(194, 176, 122, 0.55);
    box-shadow: 0 0 0 1px rgba(194, 176, 122, 0.15);
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #c0392b;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.unread-badge-sm {
    min-width: 1.1rem;
    height: 1.1rem;
    font-size: 0.65rem;
}

.entity-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 0.35rem;
    background: #f4f6f1;
    border: 1px solid rgba(45, 58, 40, 0.12);
    padding: 2px;
}

.entity-logo-lg {
    width: 72px;
    height: 72px;
}

.entity-logo-xl {
    width: 88px;
    height: 88px;
}

.entity-logo-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(45, 58, 40, 0.45);
    font-size: 1.1rem;
}

.sidebar-user {
    margin-top: auto;
    padding: 1rem 1.15rem 1.25rem;
    border-top: 1px solid rgba(237, 240, 231, 0.08);
}

.sidebar-user .name {
    font-weight: 600;
    color: #fff;
}

.sidebar-user .role {
    font-size: 0.8rem;
    color: var(--mil-khaki);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background: rgba(247, 248, 244, 0.88);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--mil-line);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-topbar .page-heading {
    min-width: 0;
}

.app-topbar .page-title {
    margin: 0;
    font-size: 1.35rem;
    color: var(--mil-olive-900);
}

.app-topbar .page-subtitle {
    margin: 0.15rem 0 0;
    color: var(--mil-muted);
    font-size: 0.92rem;
}

.app-content {
    flex: 1;
    padding: 1.35rem 1.25rem 2rem;
}

.content-panel {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--mil-line);
    border-radius: 0.65rem;
    padding: 1.25rem;
}

.stat-tile {
    background: linear-gradient(180deg, #fff, var(--mil-panel));
    border: 1px solid var(--mil-line);
    border-radius: 0.65rem;
    padding: 1rem 1.1rem;
    height: 100%;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(58, 74, 43, 0.35);
}

.stat-tile .label {
    color: var(--mil-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-display);
}

.stat-tile .value {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--mil-olive-800);
    line-height: 1.1;
    margin-top: 0.35rem;
}

.app-footer {
    padding: 0.9rem 1.25rem 1.25rem;
    color: var(--mil-muted);
    font-size: 0.85rem;
}

.public-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(90deg, var(--mil-olive-900), var(--mil-olive-800));
    color: #fff;
}

.public-topbar a {
    color: #fff;
    text-decoration: none;
}

.public-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.public-brand .mark {
    width: 38px;
    height: 38px;
    border: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: transparent;
    flex-shrink: 0;
}

.public-brand .mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.login-brand-mark {
    width: 64px;
    height: 64px;
    border: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: transparent;
}

.login-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.public-hero {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 2.5rem 1.25rem;
    position: relative;
    background:
        linear-gradient(120deg, rgba(30, 38, 24, 0.88), rgba(58, 74, 43, 0.72)),
        repeating-linear-gradient(
            -45deg,
            rgba(255, 255, 255, 0.03) 0,
            rgba(255, 255, 255, 0.03) 8px,
            transparent 8px,
            transparent 16px
        ),
        radial-gradient(circle at 20% 20%, rgba(194, 176, 122, 0.25), transparent 40%);
    color: #fff;
}

/* ===== PUBG-like cinematic battlefield (landing + login) ===== */
.public-hero--landing,
.public-hero--login {
    overflow: hidden;
    isolation: isolate;
    background: #0b0e0a;
    box-shadow: inset 0 3px 0 0 rgba(242, 169, 0, 0.55);
}

.public-hero--landing::before,
.public-hero--login::before {
    content: "";
    position: absolute;
    inset: -4%;
    z-index: 0;
    background:
        linear-gradient(105deg, rgba(8, 10, 7, 0.55) 8%, rgba(18, 24, 14, 0.22) 48%, rgba(8, 10, 7, 0.5) 92%),
        radial-gradient(ellipse at 50% 120%, rgba(242, 169, 0, 0.14), transparent 55%),
        url("https://cdn.fondecranvip.com/2025/02/wqKKjSiu-fond-decran-Militaire-68.webp") center center / cover no-repeat;
    filter: saturate(0.7) contrast(1.1) brightness(0.78);
    transform: scale(1.08);
    animation: pubg-bg-drift 10s ease-in-out infinite alternate;
    pointer-events: none;
}

.public-hero--login::before {
    background:
        linear-gradient(115deg, rgba(8, 10, 7, 0.58) 10%, rgba(20, 26, 16, 0.28) 50%, rgba(8, 10, 7, 0.55) 90%),
        radial-gradient(ellipse at 70% 20%, rgba(242, 169, 0, 0.12), transparent 50%),
        url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQPHpvXpq0DWUzKc0rjBoANN4eJvUwMd1jxUq17sFT4DtRAdVLJKQqL5P61&s=10") center center / cover no-repeat;
    filter: saturate(0.65) contrast(1.12) brightness(0.75);
}

.public-hero--landing::after,
.public-hero--login::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, transparent 28%, rgba(0, 0, 0, 0.72) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 22%, transparent 70%, rgba(0, 0, 0, 0.7) 100%),
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.015) 0,
            rgba(255, 255, 255, 0.015) 1px,
            transparent 1px,
            transparent 3px
        ),
        radial-gradient(circle at 18% 72%, rgba(242, 169, 0, 0.08), transparent 12%),
        radial-gradient(circle at 82% 28%, rgba(255, 255, 255, 0.05), transparent 8%);
    box-shadow: inset 0 0 0 1px rgba(242, 169, 0, 0.12);
}

.public-hero--landing > *,
.public-hero--login > * {
    position: relative;
    z-index: 2;
}

.public-shell--landing .public-topbar,
.public-shell--login .public-topbar {
    background: linear-gradient(90deg, rgba(8, 10, 7, 0.88), rgba(18, 22, 14, 0.72));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(242, 169, 0, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.public-shell--landing .app-footer,
.public-shell--login .app-footer {
    background: rgba(8, 10, 7, 0.9) !important;
    border-top: 1px solid rgba(242, 169, 0, 0.18);
    color: rgba(237, 240, 231, 0.65) !important;
}

.public-hero-card {
    width: min(640px, 100%);
    text-align: center;
    padding: 2.25rem 1.75rem;
    border: 1px solid rgba(242, 169, 0, 0.35);
    background:
        linear-gradient(160deg, rgba(12, 16, 10, 0.72), rgba(22, 28, 18, 0.55));
    backdrop-filter: blur(12px) saturate(0.9);
    border-radius: 0.35rem;
    animation: rise-in 0.55s ease both;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.4),
        0 18px 50px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
}

.public-hero-card::before,
.public-hero-card::after,
.login-panel::before,
.login-panel::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(242, 169, 0, 0.85);
    pointer-events: none;
}

.public-hero-card::before,
.login-panel::before {
    top: 8px;
    left: 8px;
    border-right: 0;
    border-bottom: 0;
}

.public-hero-card::after,
.login-panel::after {
    right: 8px;
    bottom: 8px;
    border-left: 0;
    border-top: 0;
}

.public-hero--landing .public-hero-card {
    background:
        linear-gradient(160deg, rgba(10, 14, 9, 0.7), rgba(20, 26, 16, 0.52));
    border-color: rgba(242, 169, 0, 0.42);
}

.public-hero--login .login-panel {
    background:
        linear-gradient(165deg, rgba(12, 16, 10, 0.82), rgba(22, 28, 18, 0.7));
    border: 1px solid rgba(242, 169, 0, 0.42);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.4),
        0 18px 50px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    border-radius: 0.35rem;
    position: relative;
    color: #edf0e7;
}

.public-hero--login .login-panel h1,
.public-hero--login .login-panel .h3 {
    color: #fff !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: var(--font-display);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.public-hero--login .login-panel .text-muted {
    color: rgba(237, 240, 231, 0.7) !important;
}

.public-hero--login .login-brand-mark {
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.45));
}

.public-hero--login .btn-google {
    background: linear-gradient(180deg, #f2a900, #c47f00);
    color: #1a1408;
    border-color: #f2a900;
}

.public-hero--login .btn-google:hover {
    background: linear-gradient(180deg, #ffb91a, #d48c00);
    color: #120e06;
    border-color: #ffb91a;
}

.public-hero-card h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    margin-bottom: 0.75rem;
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
    letter-spacing: 0.06em;
}

.public-hero-card p {
    color: rgba(237, 240, 231, 0.86);
    margin-bottom: 1.5rem;
}

.public-hero--landing .btn-primary,
.public-hero--landing .btn-google,
.public-hero--login .btn-google {
    border-radius: 0.25rem;
    border: 1px solid rgba(242, 169, 0, 0.55);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-family: var(--font-display);
    font-weight: 600;
}

.public-hero--landing .btn-primary {
    background: linear-gradient(180deg, #f2a900, #c47f00);
    border-color: #f2a900;
    color: #1a1408;
}

.public-hero--landing .btn-primary:hover {
    background: linear-gradient(180deg, #ffb91a, #d48c00);
    color: #120e06;
}

.login-panel {
    width: min(420px, 100%);
    background: rgba(247, 248, 244, 0.95);
    border: 1px solid rgba(194, 176, 122, 0.35);
    border-radius: 0.75rem;
    padding: 1.75rem;
    color: var(--mil-ink);
    animation: rise-in 0.55s ease both;
}

@keyframes pubg-bg-drift {
    from { transform: scale(1.08) translate3d(0, 0, 0); }
    to { transform: scale(1.18) translate3d(-2.5%, -1.8%, 0); }
}

.btn-google {
    background: #fff;
    color: var(--mil-ink);
    border: 1px solid var(--mil-line);
    font-weight: 600;
}

.btn-google:hover {
    background: var(--mil-panel);
    color: var(--mil-ink);
    border-color: var(--mil-olive-600);
}

.menu-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid var(--mil-line);
    background: #fff;
    color: var(--mil-olive-800);
    border-radius: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.offcanvas.app-offcanvas {
    width: min(var(--sidebar-width), 88vw);
    background: var(--mil-olive-900);
    color: #edf0e7;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sidebar-in {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (min-width: 992px) {
    .app-shell {
        display: grid;
        grid-template-columns: var(--sidebar-width) 1fr;
    }

    .app-sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
        animation: sidebar-in 0.35s ease both;
    }

    .mobile-only {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .desktop-only {
        display: none !important;
    }

    .app-content {
        padding: 1rem;
    }

    .content-panel {
        padding: 1rem;
    }
}
