/* ==========================================================
   WAYS DIAGNOSTICS
   Design system
   ========================================================== */


/* ----------------------------------------------------------
   FONTS
   Jost  = titres / navigation / boutons / structure
   Dosis = texte courant
   ---------------------------------------------------------- */

@font-face {
    font-family: "Jost";
    src: url("fonts/Jost-VariableFont_wght.ttf") format("truetype");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Jost";
    src: url("fonts/Jost-Italic-VariableFont_wght.ttf") format("truetype");
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "Dosis";
    src: url("fonts/Dosis-VariableFont_wght.ttf") format("truetype");
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
}


/* ----------------------------------------------------------
   WAYS PALETTE
   ---------------------------------------------------------- */

:root {
    --ways-red: #D54645;
    --ways-yellow: #F1AE45;
    --ways-green: #73A79F;
    --ways-blue: #4B5B78;

    --ways-white: #FFFFFF;
    --ways-background: #F7F8FA;
    --ways-surface: #FFFFFF;

    --ways-text: #263142;
    --ways-text-soft: #667085;
    --ways-border: #E4E7EC;

    --ways-blue-soft: #EEF1F6;
    --ways-green-soft: #EDF6F4;
    --ways-yellow-soft: #FFF6E7;
    --ways-red-soft: #FCEEEE;

    --ways-radius: 14px;
    --ways-radius-small: 8px;

    --ways-shadow:
        0 4px 18px rgba(43, 55, 78, 0.07);

    --ways-transition: 160ms ease;
}


/* ----------------------------------------------------------
   BASE
   ---------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    background: var(--ways-background);
    color: var(--ways-text);

    font-family: "Dosis", Arial, sans-serif;
    font-size: 17px;
    font-weight: 450;
    line-height: 1.55;

    -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
    font: inherit;
}


/* ----------------------------------------------------------
   TYPOGRAPHY
   ---------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6,
.ways-title {
    margin-top: 0;

    color: var(--ways-blue);

    font-family: "Jost", Arial, sans-serif;
    font-weight: 500;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2rem, 3vw, 2.7rem);
    letter-spacing: -0.035em;
}

h2 {
    font-size: 1.65rem;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 1.15rem;
}

p {
    margin-top: 0;
}

.ways-muted {
    color: var(--ways-text-soft);
}


/* ----------------------------------------------------------
   LAYOUT
   ---------------------------------------------------------- */

.ways-page {
    min-height: 100vh;
}

.ways-content {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 48px 0;
}

.ways-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.ways-page-header p {
    margin-bottom: 0;
    color: var(--ways-text-soft);
}


/* ----------------------------------------------------------
   CARDS
   ---------------------------------------------------------- */

.ways-card {
    background: var(--ways-surface);
    border: 1px solid var(--ways-border);
    border-radius: var(--ways-radius);
    box-shadow: var(--ways-shadow);
    padding: 26px;
}

.ways-card + .ways-card {
    margin-top: 20px;
}


/* ----------------------------------------------------------
   BUTTONS
   ---------------------------------------------------------- */

.ways-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-height: 42px;
    padding: 10px 18px;

    border: 1px solid transparent;
    border-radius: var(--ways-radius-small);

    cursor: pointer;

    font-family: "Jost", Arial, sans-serif;
    font-size: 0.92rem;
    font-weight: 500;

    transition:
        background var(--ways-transition),
        border-color var(--ways-transition),
        transform var(--ways-transition);
}

.ways-button:hover {
    transform: translateY(-1px);
}

.ways-button-primary {
    background: var(--ways-blue);
    color: var(--ways-white);
}

.ways-button-primary:hover {
    background: #3F4E69;
}

.ways-button-secondary {
    background: var(--ways-white);
    color: var(--ways-blue);
    border-color: var(--ways-border);
}

.ways-button-secondary:hover {
    border-color: var(--ways-blue);
}

.ways-button-danger {
    background: var(--ways-red);
    color: var(--ways-white);
}


/* ----------------------------------------------------------
   STATUS BADGES
   ---------------------------------------------------------- */

.ways-badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 10px;
    border-radius: 999px;

    font-family: "Jost", Arial, sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
}

.ways-badge-completed {
    background: var(--ways-green-soft);
    color: #477B73;
}

.ways-badge-progress {
    background: var(--ways-yellow-soft);
    color: #9A681C;
}

.ways-badge-pending {
    background: var(--ways-blue-soft);
    color: var(--ways-blue);
}

.ways-badge-alert {
    background: var(--ways-red-soft);
    color: var(--ways-red);
}


/* ----------------------------------------------------------
   TABLES
   ---------------------------------------------------------- */

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

    background: var(--ways-white);
    border: 1px solid var(--ways-border);
    border-radius: var(--ways-radius);
}

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

.ways-table th,
.ways-table td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid var(--ways-border);
}

.ways-table th {
    background: #FAFBFC;
    color: var(--ways-blue);

    font-family: "Jost", Arial, sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
}

.ways-table tbody tr:last-child td {
    border-bottom: 0;
}

.ways-table tbody tr:hover {
    background: #FAFBFC;
}


/* ----------------------------------------------------------
   FORMS
   ---------------------------------------------------------- */

.ways-field {
    margin-bottom: 20px;
}

.ways-field label {
    display: block;
    margin-bottom: 7px;

    color: var(--ways-blue);

    font-family: "Jost", Arial, sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
}

.ways-field input,
.ways-field select,
.ways-field textarea {
    width: 100%;

    padding: 11px 13px;

    background: var(--ways-white);
    color: var(--ways-text);

    border: 1px solid var(--ways-border);
    border-radius: var(--ways-radius-small);

    outline: none;

    transition:
        border-color var(--ways-transition),
        box-shadow var(--ways-transition);
}

.ways-field input:focus,
.ways-field select:focus,
.ways-field textarea:focus {
    border-color: var(--ways-green);
    box-shadow: 0 0 0 3px rgba(115, 167, 159, 0.14);
}


/* ----------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 720px) {

    .ways-content {
        width: min(100% - 28px, 1180px);
        padding: 28px 0;
    }

    .ways-page-header {
        flex-direction: column;
    }

    .ways-card {
        padding: 20px;
    }

    body {
        font-size: 16px;
    }
}

/* ==========================================================
   WAYS STAFF APP
   ========================================================== */

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


/* ----------------------------------------------------------
   SIDEBAR
   ---------------------------------------------------------- */

.ways-sidebar {
    position: fixed;
    inset: 0 auto 0 0;

    display: flex;
    flex-direction: column;

    width: 250px;
    min-height: 100vh;
    padding: 30px 22px 24px;

    background: var(--ways-white);
    border-right: 1px solid var(--ways-border);
}

.ways-sidebar-brand {
    padding: 4px 8px 34px;
}

.ways-sidebar-logo {
    display: block;
    width: 100%;
    max-width: 185px;
    height: auto;
}


/* ----------------------------------------------------------
   NAVIGATION
   ---------------------------------------------------------- */

.ways-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ways-nav-item {
    display: flex;
    align-items: center;

    min-height: 44px;
    padding: 10px 14px;

    color: var(--ways-blue);

    border-radius: var(--ways-radius-small);

    font-family: "Jost", Arial, sans-serif;
    font-size: 0.95rem;
    font-weight: 450;

    transition:
        background var(--ways-transition),
        color var(--ways-transition);
}

.ways-nav-item:hover {
    background: var(--ways-blue-soft);
}

.ways-nav-item.active {
    background: var(--ways-blue);
    color: var(--ways-white);
}


/* ----------------------------------------------------------
   SIDEBAR FOOTER
   ---------------------------------------------------------- */

.ways-sidebar-footer {
    margin-top: auto;
    padding: 22px 8px 0;

    border-top: 1px solid var(--ways-border);
}

.ways-user {
    margin-bottom: 8px;

    color: var(--ways-blue);

    font-family: "Jost", Arial, sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
}

.ways-logout {
    padding: 0;

    background: transparent;
    color: var(--ways-text-soft);

    border: 0;
    cursor: pointer;

    font-family: "Dosis", Arial, sans-serif;
    font-size: 0.92rem;

    transition: color var(--ways-transition);
}

.ways-logout:hover {
    color: var(--ways-red);
}


/* ----------------------------------------------------------
   MAIN CONTENT
   ---------------------------------------------------------- */

.ways-main {
    flex: 1;
    min-width: 0;
    min-height: 100vh;

    margin-left: 250px;
    padding: 48px;

    background: var(--ways-background);
}


/* ----------------------------------------------------------
   STAFF RESPONSIVE
   ---------------------------------------------------------- */

@media (max-width: 850px) {

    .ways-sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .ways-app {
        flex-direction: column;
    }

    .ways-sidebar-brand {
        padding-bottom: 20px;
    }

    .ways-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .ways-sidebar-footer {
        margin-top: 22px;
    }

    .ways-main {
        margin-left: 0;
        padding: 28px 20px;
    }
}

/* ==========================================================
   MESSAGES
   ========================================================== */

.ways-messages {
    margin-bottom: 24px;
}

.ways-message {
    padding: 14px 18px;
    margin-bottom: 10px;
    border-radius: var(--ways-radius-small);
}

.ways-message-success {
    background: var(--ways-green-soft);
}

.ways-message-warning {
    background: var(--ways-yellow-soft);
}

.ways-message-error {
    background: var(--ways-red-soft);
}


/* ==========================================================
   FORMULAIRES
   ========================================================== */

.ways-form-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--ways-border);
}

.ways-form-section:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.ways-form-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 18px;
}

.ways-form-grid label,
.ways-card label {
    display: block;
    margin-bottom: 7px;
    font-family: "Jost", sans-serif;
    font-weight: 500;
}

.ways-card input[type="text"],
.ways-card input[type="email"],
.ways-card input[type="date"],
.ways-card input[type="password"],
.ways-card select {
    box-sizing: border-box;
    width: 100%;
    max-width: 520px;
    padding: 11px 13px;
    border: 1px solid var(--ways-border);
    border-radius: var(--ways-radius-small);
    background: var(--ways-white);
    font-family: "Dosis", sans-serif;
    font-size: 16px;
}

.ways-card input:focus,
.ways-card select:focus {
    outline: 2px solid var(--ways-blue-soft);
    border-color: var(--ways-blue);
}

.ways-participant-actions {
    margin: 18px 0 24px;
}


/* ==========================================================
   AUTHENTIFICATION PARTICIPANT
   ========================================================== */

.ways-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    box-sizing: border-box;
    background: var(--ways-background);
}

.ways-auth-card {
    width: 100%;
    max-width: 520px;
    padding: 42px;
    box-sizing: border-box;
    background: var(--ways-white);
    border-radius: var(--ways-radius);
    box-shadow: var(--ways-shadow);
}

.ways-auth-logo {
    display: block;
    width: 190px;
    max-width: 100%;
    margin-bottom: 34px;
}

.ways-auth-card h1 {
    margin-top: 0;
}

.ways-auth-card form p {
    margin-bottom: 20px;
}

.ways-auth-card form input {
    box-sizing: border-box;
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--ways-border);
    border-radius: var(--ways-radius-small);
    font-family: "Dosis", sans-serif;
    font-size: 16px;
}

.ways-auth-card ul {
    color: var(--ways-text-soft);
}

/* =========================================================
   FORMULAIRES — ACTIONS
   ========================================================= */

.ways-form-card {
    max-width: 900px;
}

.ways-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ways-form-actions,
.ways-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ways-form-actions {
    margin-top: 24px;
}

.ways-empty-state {
    padding: 36px 20px;
    text-align: center;
}

.ways-empty-state h2 {
    margin-top: 0;
}

.ways-empty-state p {
    margin-bottom: 24px;
    color: var(--ways-text-soft);
}

/* =========================================================
   DIAGNOSTICS & RAPPORTS
   ========================================================= */

.ways-table-card {
    overflow: hidden;
}

.ways-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.ways-reports-table {
    min-width: 1050px;
}

.ways-table-secondary {
    margin-top: 4px;
    font-size: 0.9rem;
    color: var(--ways-text-soft);
}

.ways-table-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ways-table-link {
    font-family: "Jost", sans-serif;
    font-weight: 500;
    color: var(--ways-blue);
    text-decoration: none;
}

.ways-table-link:hover {
    text-decoration: underline;
}


/* Statuts */

.ways-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-family: "Jost", sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}

.ways-status-active,
.ways-status-completed,
.ways-status-available {
    background: var(--ways-green-soft);
    color: var(--ways-green);
}

.ways-status-pending,
.ways-status-generated {
    background: var(--ways-yellow-soft);
    color: #9A681A;
}

.ways-status-progress {
    background: var(--ways-blue-soft);
    color: var(--ways-blue);
}

.ways-status-inactive,
.ways-status-warning {
    background: var(--ways-red-soft);
    color: var(--ways-red);
}

/* =========================================================
   RAPPORTS — FILTRES
   ========================================================= */

.ways-filters-card {
    margin-bottom: 22px;
    padding: 24px;
}

.ways-filters-form {
    width: 100%;
}

.ways-filters-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.ways-filter-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.ways-filter-field label {
    font-family: "Jost", sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ways-text);
}

.ways-filter-field input,
.ways-filter-field select {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--ways-border);
    border-radius: var(--ways-radius-small);
    background: var(--ways-white);
    color: var(--ways-text);
    font-family: "Dosis", sans-serif;
    font-size: 1rem;
}

.ways-filter-field input:focus,
.ways-filter-field select:focus {
    outline: 2px solid var(--ways-green);
    outline-offset: 1px;
}

.ways-filters-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}


/* =========================================================
   RAPPORTS — INDICATEURS
   ========================================================= */

.ways-report-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.ways-stat-card {
    background: var(--ways-white);
    border: 1px solid var(--ways-border);
    border-radius: var(--ways-radius);
    padding: 20px 24px;
    box-shadow: var(--ways-shadow);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ways-stat-number {
    font-family: "Jost", sans-serif;
    font-size: 2rem;
    font-weight: 600;
    color: var(--ways-blue);
    line-height: 1.2;
}

.ways-stat-label {
    font-family: "Dosis", sans-serif;
    font-size: 1rem;
    color: var(--ways-text-soft);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {

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

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

@media (max-width: 650px) {

    .ways-filters-grid,
    .ways-report-stats {
        grid-template-columns: 1fr;
    }

    .ways-filters-actions {
        justify-content: stretch;
    }

    .ways-filters-actions .ways-button {
        flex: 1;
        text-align: center;
    }
}

/* =====================================================
   CONSERVATION DES RAPPORTS
   ===================================================== */

.ways-retention-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.ways-retention-section h3 {
    margin-bottom: 18px;
}

.ways-retention-section h4 {
    margin-top: 24px;
    margin-bottom: 16px;
}

.ways-retention-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: end;
}

.ways-retention-form > div:last-child {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .ways-retention-form {
        grid-template-columns: 1fr;
    }
}