:root {
    color-scheme: dark;
    --bg: #070b16;
    --bg-2: #0b1020;
    --surface: rgba(17, 24, 43, .86);
    --surface-2: rgba(23, 31, 55, .82);
    --surface-3: rgba(255, 255, 255, .06);
    --line: rgba(255, 255, 255, .11);
    --line-strong: rgba(255, 255, 255, .18);
    --ink: #f7f9ff;
    --muted: #aab4c8;
    --soft: #75819a;
    --blue: #6d8dff;
    --teal: #28d6cf;
    --pink: #ff6ea8;
    --coral: #ff9b75;
    --violet: #9a84ff;
    --success: #46ddb0;
    --danger: #ff7a8a;
    --shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% -8%, rgba(109, 141, 255, .28), transparent 34%),
        radial-gradient(circle at 92% 10%, rgba(255, 110, 168, .18), transparent 30%),
        linear-gradient(180deg, #090e1c 0%, #070b16 52%, #060914 100%);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(32px, 4.5vw, 58px);
    line-height: .95;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0;
    font-size: 21px;
    letter-spacing: 0;
}

button,
input {
    font: inherit;
}

button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    color: #06101e;
    cursor: pointer;
    font-weight: 900;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

button:hover {
    box-shadow: 0 18px 34px rgba(40, 214, 207, .18);
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.login-shell {
    display: grid;
    min-height: 100dvh;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(7, 11, 22, .88), rgba(28, 42, 82, .72)),
        url("https://images.unsplash.com/photo-1611162618071-b39a2ec055fb?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.login-panel {
    width: min(100%, 430px);
    padding: 34px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: rgba(14, 20, 36, .88);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.brand-mark {
    display: inline-grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), var(--teal));
    color: #06101e;
    font-weight: 950;
}

.eyebrow,
.section-kicker {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-panel .eyebrow {
    margin-top: 18px;
}

.login-copy {
    margin-bottom: 0;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 16px;
    margin-top: 28px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, .06);
}

.alert {
    margin-top: 18px;
    border: 1px solid rgba(255, 122, 138, .35);
    border-radius: 8px;
    padding: 12px 14px;
    background: rgba(255, 122, 138, .11);
    color: #ffd2d8;
    font-weight: 800;
}

.app-shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    min-height: 100dvh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    height: 100dvh;
    padding: 22px;
    border-right: 1px solid var(--line);
    background: rgba(8, 12, 24, .82);
    backdrop-filter: blur(22px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand strong {
    font-size: 18px;
}

.brand small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.nav {
    display: grid;
    gap: 7px;
}

.nav a,
.logout {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 13px;
    color: var(--muted);
    font-weight: 850;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.nav a.active,
.nav a:hover,
.logout:hover {
    border-color: var(--line);
    background: rgba(255, 255, 255, .07);
    color: var(--ink);
}

.nav a.active {
    box-shadow: inset 3px 0 0 var(--teal);
}

.sidebar-card {
    display: grid;
    gap: 8px;
    margin-top: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background:
        linear-gradient(135deg, rgba(109, 141, 255, .15), rgba(255, 110, 168, .08)),
        rgba(255, 255, 255, .04);
}

.sidebar-card span,
.sidebar-card small {
    color: var(--muted);
}

.sidebar-card strong {
    line-height: 1.18;
}

.logout {
    margin-top: 0;
}

.content {
    width: min(100%, 1500px);
    padding: 34px;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-pill,
.range-pill,
mark {
    display: inline-flex;
    align-items: center;
    width: max-content;
    min-height: 32px;
    border: 1px solid rgba(40, 214, 207, .24);
    border-radius: 999px;
    padding: 7px 12px;
    background: rgba(40, 214, 207, .1);
    color: #98fff4;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.range-pill {
    border-color: var(--line);
    background: rgba(255, 255, 255, .05);
    color: var(--muted);
}

.command-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 18px;
    margin-bottom: 18px;
}

.hero-copy,
.hero-board,
.metrics article,
.panel,
.client-card,
.day-card,
.platform-card,
.platform-analytics-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 18px 54px rgba(0, 0, 0, .2);
    backdrop-filter: blur(18px);
}

.hero-copy {
    position: relative;
    min-height: 300px;
    overflow: hidden;
    padding: 30px;
    background:
        radial-gradient(circle at 88% 18%, rgba(255, 110, 168, .22), transparent 30%),
        linear-gradient(135deg, rgba(109, 141, 255, .18), rgba(40, 214, 207, .08)),
        rgba(16, 23, 43, .9);
}

.hero-copy::after {
    position: absolute;
    right: 26px;
    bottom: 24px;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    content: "";
}

.hero-copy h2 {
    position: relative;
    z-index: 1;
    max-width: 800px;
    font-size: clamp(34px, 5vw, 66px);
    line-height: .96;
}

.hero-copy p {
    position: relative;
    z-index: 1;
    max-width: 650px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.5;
}

.hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.primary-action,
.secondary-action {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    border-radius: 8px;
    padding: 0 16px;
    font-weight: 900;
}

.secondary-action {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .06);
}

.hero-board {
    display: grid;
    min-height: 300px;
    padding: 24px;
    background:
        linear-gradient(145deg, rgba(40, 214, 207, .12), rgba(109, 141, 255, .1)),
        rgba(14, 20, 38, .92);
}

.hero-board-top,
.hero-board-bottom,
.panel-heading,
.platform-card header,
.platform-card footer,
.rank-row,
.delivery-item,
.content-row,
.platform-analytics-card header,
.share-row > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.hero-board-top span,
.hero-board-bottom span {
    color: var(--muted);
    font-weight: 800;
}

.hero-board-top strong {
    color: var(--teal);
    font-size: 58px;
    line-height: .9;
}

.hero-bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    align-items: end;
    gap: 9px;
    min-height: 150px;
    margin: 24px 0;
}

.hero-bars i {
    display: block;
    min-height: 28px;
    border-radius: 8px 8px 3px 3px;
    background: linear-gradient(180deg, var(--pink), var(--teal));
}

.hero-board-bottom {
    align-self: end;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metrics article {
    padding: 20px;
}

.metrics span,
.metrics em,
.panel-heading span,
.platform-card span,
.platform-card small,
.rank-row span,
.delivery-item span,
.client-card span,
.client-card p,
.content-row span,
.day-card span,
.platform-analytics-card span,
.platform-analytics-card small,
.analytics-summary p,
.action-stack span,
.action-stack p {
    color: var(--muted);
}

.metrics strong {
    display: block;
    margin-top: 14px;
    font-size: 34px;
    letter-spacing: 0;
}

.metrics em {
    display: inline-block;
    margin-top: 12px;
    color: var(--success);
    font-style: normal;
    font-weight: 900;
}

.platform-section,
.analytics-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(330px, .72fr);
    gap: 18px;
    margin-bottom: 18px;
}

.grid-two {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr);
    gap: 18px;
}

.bottom-grid {
    margin-top: 18px;
}

.panel {
    padding: 22px;
}

.panel-heading {
    margin-bottom: 18px;
}

.platform-list,
.platform-analytics-grid,
.action-stack {
    display: grid;
    gap: 14px;
}

.platform-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.platform-card {
    display: grid;
    gap: 16px;
    padding: 18px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .025)),
        rgba(13, 19, 36, .92);
}

.platform-identity,
.platform-analytics-card header {
    display: flex;
    align-items: center;
    gap: 11px;
}

.platform-dot {
    display: inline-block;
    width: 12px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--platform);
    box-shadow: 0 0 24px rgba(40, 214, 207, .2);
}

.platform-card strong,
.platform-card span,
.platform-card small,
.platform-card b,
.rank-row strong,
.rank-row span,
.delivery-item strong,
.delivery-item span,
.content-row strong,
.content-row span,
.platform-analytics-card strong,
.platform-analytics-card span,
.platform-analytics-card small {
    display: block;
}

.platform-score {
    display: grid;
    grid-template-columns: 70px 1fr;
    align-items: end;
    gap: 14px;
}

.platform-score strong {
    font-size: 34px;
}

.score-track,
.share-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
}

.score-track i,
.share-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--platform), var(--teal));
}

.score-track i {
    width: var(--score);
}

.share-track i {
    width: var(--share);
}

.platform-stats,
.analytics-numbers,
.summary-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.platform-stats div,
.analytics-numbers div,
.summary-metrics div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, .045);
}

.platform-stats strong,
.analytics-numbers strong,
.summary-metrics strong {
    margin-top: 6px;
    font-size: 18px;
}

.share-row {
    display: grid;
    gap: 8px;
}

.platform-card footer {
    align-items: flex-start;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.platform-card footer strong {
    max-width: 240px;
    text-align: right;
}

.objective-panel {
    background:
        linear-gradient(145deg, rgba(154, 132, 255, .16), rgba(255, 155, 117, .08)),
        rgba(14, 20, 38, .9);
}

.action-stack article {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, .045);
}

.action-stack strong {
    display: block;
    margin-top: 8px;
}

.action-stack p {
    margin: 8px 0 0;
    line-height: 1.45;
}

.analytics-main,
.analytics-summary {
    min-height: 340px;
}

.analytics-summary {
    display: grid;
    align-content: space-between;
    background:
        linear-gradient(145deg, rgba(109, 141, 255, .15), rgba(40, 214, 207, .09)),
        rgba(14, 20, 38, .92);
}

.analytics-summary p {
    margin: 16px 0;
    line-height: 1.55;
}

.platform-analytics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.platform-analytics-card {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.platform-analytics-card header {
    justify-content: flex-start;
}

.platform-analytics-card header mark {
    margin-left: auto;
}

.platform-analytics-card footer {
    color: var(--ink);
    font-weight: 800;
}

.bar-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(34px, 1fr));
    align-items: end;
    gap: 16px;
    height: 300px;
    padding: 24px 10px 34px;
    border-top: 1px solid var(--line);
}

.bar-chart i {
    position: relative;
    display: block;
    min-height: 44px;
    border-radius: 8px 8px 2px 2px;
    background: linear-gradient(180deg, var(--pink), var(--teal));
}

.bar-chart span {
    position: absolute;
    bottom: -28px;
    left: 0;
    width: 100%;
    color: var(--muted);
    font-style: normal;
    font-weight: 900;
    text-align: center;
}

.cards-grid,
.calendar-grid {
    display: grid;
    gap: 16px;
}

.cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-grid {
    margin-top: 18px;
}

.client-card,
.day-card {
    padding: 22px;
}

.client-card h2 {
    margin-top: 12px;
}

.client-card strong {
    display: inline-block;
    margin-top: 24px;
    color: var(--platform, var(--teal));
}

.calendar-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.day-card {
    min-height: 190px;
}

.day-card div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.day-card strong {
    font-size: 20px;
}

.day-card p {
    border-radius: 8px;
    padding: 10px;
    background: rgba(255, 255, 255, .055);
    font-size: 13px;
    font-weight: 800;
}

.content-row {
    display: grid;
    grid-template-columns: 1fr 120px 180px;
    border-top: 1px solid var(--line);
    padding: 16px 0;
}

.content-row:first-of-type,
.rank-row:first-of-type,
.delivery-item:first-of-type {
    border-top: 0;
}

.rank-row,
.delivery-item {
    border-top: 1px solid var(--line);
    padding: 16px 0;
}

.progress {
    width: 170px;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
}

.progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--violet), var(--teal), var(--pink));
}

.quick-actions {
    display: grid;
    gap: 10px;
}

.quick-actions button {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .055);
    color: var(--ink);
    text-align: left;
    padding: 0 16px;
}

.ghost-button {
    width: auto;
    min-height: 40px;
    padding: 0 16px;
}

.settings-panel {
    max-width: 760px;
}

code {
    border-radius: 6px;
    padding: 3px 6px;
    background: rgba(255, 255, 255, .08);
}

.modal {
    width: min(92vw, 420px);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
    background: #10182c;
    color: var(--ink);
    box-shadow: var(--shadow);
}

.modal::backdrop {
    background: rgba(0, 0, 0, .62);
}

@media (max-width: 1260px) {
    .command-hero,
    .platform-section,
    .analytics-layout,
    .grid-two {
        grid-template-columns: 1fr;
    }

    .platform-analytics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cards-grid,
    .calendar-grid,
    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    body {
        background:
            radial-gradient(circle at 30% -10%, rgba(109, 141, 255, .24), transparent 38%),
            linear-gradient(180deg, #090e1c 0%, #070b16 100%);
    }

    .app-shell {
        display: block;
        min-height: 100dvh;
    }

    .sidebar {
        position: sticky;
        z-index: 10;
        top: 0;
        height: auto;
        gap: 14px;
        padding: 14px 16px 12px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        background: rgba(7, 11, 22, .86);
    }

    .brand {
        justify-content: space-between;
    }

    .brand .brand-mark {
        width: 42px;
        height: 42px;
    }

    .brand strong {
        font-size: 16px;
    }

    .brand small {
        font-size: 12px;
    }

    .nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    .nav a {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 10px 13px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: rgba(255, 255, 255, .045);
        white-space: nowrap;
    }

    .nav a.active {
        border-color: rgba(40, 214, 207, .4);
        background: rgba(40, 214, 207, .12);
        box-shadow: none;
        color: #d7fffb;
    }

    .sidebar-card {
        display: none;
    }

    .logout {
        position: absolute;
        right: 16px;
        top: 19px;
        min-height: 34px;
        padding: 8px 10px;
        border: 1px solid var(--line);
        background: rgba(255, 255, 255, .045);
        font-size: 0;
    }

    .logout::after {
        font-size: 13px;
        content: "Sortir";
    }

    .content {
        padding: 18px 16px 28px;
    }

    .topbar {
        margin-bottom: 16px;
    }

    .topbar .eyebrow {
        display: none;
    }

    .platform-list {
        grid-template-columns: 1fr;
    }

    .content-row {
        grid-template-columns: 1fr;
        align-items: start;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 19px;
    }

    .login-panel {
        padding: 22px;
    }

    .topbar {
        display: block;
    }

    .top-actions {
        margin-top: 12px;
    }

    .command-hero {
        gap: 12px;
    }

    .hero-copy,
    .hero-board,
    .panel,
    .platform-card,
    .platform-analytics-card,
    .metrics article {
        padding: 16px;
    }

    .hero-copy {
        min-height: auto;
    }

    .hero-copy::after {
        width: 90px;
        height: 90px;
        right: 18px;
        bottom: 18px;
        opacity: .45;
    }

    .hero-copy h2 {
        max-width: 300px;
        font-size: 32px;
        line-height: 1;
    }

    .hero-copy p {
        max-width: 310px;
        margin-top: 14px;
        font-size: 15px;
        line-height: 1.48;
    }

    .hero-actions {
        margin-top: 18px;
    }

    .primary-action,
    .secondary-action {
        flex: 1 1 140px;
        justify-content: center;
    }

    .hero-board {
        min-height: 220px;
    }

    .hero-board-top strong {
        font-size: 44px;
    }

    .hero-bars {
        min-height: 108px;
        margin: 18px 0;
    }

    .metrics,
    .platform-analytics-grid,
    .cards-grid,
    .calendar-grid,
    .platform-stats,
    .analytics-numbers,
    .summary-metrics {
        grid-template-columns: 1fr;
    }

    .metrics {
        gap: 10px;
    }

    .metrics article {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
    }

    .metrics strong {
        margin-top: 0;
        font-size: 26px;
        text-align: right;
    }

    .metrics em {
        display: none;
    }

    .platform-score {
        grid-template-columns: 58px 1fr;
    }

    .platform-score strong {
        font-size: 30px;
    }

    .platform-card header,
    .platform-card footer,
    .panel-heading,
    .rank-row,
    .delivery-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .platform-card footer strong {
        max-width: none;
        text-align: left;
    }

    .share-row > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .progress {
        width: 100%;
    }

    .bar-chart {
        gap: 10px;
        height: 230px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
