:root {
    --navy: #0f1b33;
    --navy-light: #1d2d4d;
    --background: #f4f6f9;
    --surface: #ffffff;
    --text: #172033;
    --muted: #6b7280;
    --border: #e3e8ef;

    --green: #138a52;
    --blue: #2563eb;
    --purple: #7c3aed;
    --orange: #e67e22;
    --red: #dc2626;

    --radius-large: 20px;
    --radius-medium: 14px;

    --shadow:
        0 12px 35px rgba(15, 27, 51, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;
}

.application {
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;

    padding: 22px 38px;

    background: var(--navy);
    color: white;
}

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

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 54px;
    height: 54px;

    border-radius: 16px;

    background: white;
    color: var(--navy);

    font-size: 18px;
    font-weight: 900;
}

.brand h1 {
    margin: 0 0 4px;
    font-size: 25px;
}

.brand p {
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 14px;
}

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

    padding: 10px 16px;

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;

    background: rgba(255, 255, 255, 0.05);
}

.synchronisation strong,
.synchronisation small {
    display: block;
}

.synchronisation small {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.65);
}

.status-dot {
    width: 11px;
    height: 11px;

    border-radius: 50%;

    background: #3fd483;

    box-shadow:
        0 0 0 5px rgba(63, 212, 131, 0.16);
}

.main-content {
    padding: 30px 38px 50px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.stat-card {
    position: relative;
    overflow: hidden;

    min-height: 145px;
    padding: 20px;

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    background: var(--surface);

    box-shadow: var(--shadow);
}

.stat-card::before {
    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 5px;

    content: "";
    background: var(--blue);
}

.stat-card strong {
    display: block;

    margin: 12px 0 7px;

    font-size: 40px;
    line-height: 1;
}

.stat-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card small {
    color: var(--muted);
}

.stat-annoncees::before {
    background: #7c8798;
}

.stat-kpm::before,
.stat-herfurth::before {
    background: var(--blue);
}

.stat-transit::before {
    background: var(--purple);
}

.stat-reception::before {
    background: var(--orange);
}

.stat-anomalies::before {
    background: var(--red);
}

.workflow-panel,
.panel {
    margin-top: 22px;
    padding: 25px;

    border: 1px solid var(--border);
    border-radius: var(--radius-large);

    background: var(--surface);

    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;

    margin-bottom: 22px;
}

.section-header h2 {
    margin: 0 0 5px;
    font-size: 19px;
}

.section-header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.workflow {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 18px 10px 7px;
}

.workflow-step {
    min-width: 130px;
    text-align: center;
}

.workflow-step span {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 45px;
    height: 45px;
    margin: 0 auto 10px;

    border-radius: 50%;

    background: var(--navy);
    color: white;

    font-weight: 800;
}

.workflow-step strong,
.workflow-step small {
    display: block;
}

.workflow-step small {
    margin-top: 4px;
    color: var(--muted);
}

.workflow-line {
    flex: 1;
    height: 3px;
    margin: 0 10px 36px;

    border-radius: 10px;

    background: #dfe5ee;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
    gap: 22px;
}

.link-button {
    color: var(--blue);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

td {
    font-size: 14px;
}

.status-badge {
    display: inline-flex;

    padding: 7px 10px;

    border-radius: 999px;

    background: #eef2ff;
    color: #4338ca;

    font-size: 12px;
    font-weight: 800;
}

.empty-state {
    padding: 42px 25px;
    text-align: center;
}

.empty-state.compact {
    padding: 28px 15px;
}

.empty-icon {
    margin-bottom: 12px;
    font-size: 34px;
}

.empty-state strong {
    display: block;
    margin-bottom: 7px;
}

.empty-state p {
    max-width: 450px;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.5;
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    gap: 13px;

    padding: 13px 0;

    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-marker {
    flex: 0 0 auto;

    width: 11px;
    height: 11px;
    margin-top: 6px;

    border-radius: 50%;

    background: var(--blue);
}

.activity-content strong {
    display: block;
    font-size: 14px;
}

.activity-content p {
    margin: 5px 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.activity-content small {
    color: #9ca3af;
}

.mail-warning {
    display: flex;
    flex-direction: column;
    gap: 5px;

    padding: 18px;

    border: 1px solid #f4c88d;
    border-radius: var(--radius-medium);

    background: #fff8eb;
    color: #92400e;
}

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

.mail-card {
    padding: 17px;

    border: 1px solid var(--border);
    border-radius: var(--radius-medium);

    background: #f9fafc;
}

.mail-card-header {
    display: flex;
    align-items: center;
    gap: 10px;

    margin-bottom: 8px;
}

.mail-card small {
    color: var(--muted);
}

.mail-status {
    width: 10px;
    height: 10px;

    border-radius: 50%;
}

.mail-status.online {
    background: var(--green);
}

.mail-status.offline {
    background: var(--red);
}

.mail-error {
    margin: 10px 0 0;
    color: var(--red);
    font-size: 13px;
}

@media (max-width: 1300px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .main-content {
        padding: 22px;
    }

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

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .workflow {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .workflow-line {
        width: 3px;
        height: 25px;
        margin: 0 auto;
        flex: none;
    }

    .mail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 550px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 20px;
    }

    .brand h1 {
        font-size: 21px;
    }
}