:root {
    --color-primary: #0b3a66;
    --color-primary-light: #eaf2f9;
    --color-secondary: #166534;
    --color-background: #f4f7fb;
    --color-surface: #ffffff;
    --color-text: #182230;
    --color-muted: #667085;
    --color-border: #cbd5e1;
    --color-table-border: #9aa9bc;
    --color-table-header: #0b3a66;
    --color-table-even: #f2f6fa;
    --color-table-hover: #dceaf7;
    --color-danger: #b42318;
    --color-success: #067647;
    --sidebar-width: 270px;
    --border-radius: 10px;
    --shadow: 0 4px 16px rgb(15 23 42 / 8%);
}

* {
    box-sizing: border-box;
}

html {
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        sans-serif;
    color: var(--color-text);
    background: var(--color-background);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--color-background);
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* Structure générale */

.application-layout {
    display: flex;
    min-height: 100vh;
}

.application-content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    padding: 32px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

.page-header h1 {
    margin: 4px 0 8px;
    font-size: 30px;
    color: var(--color-primary);
}

.page-header p {
    margin: 0;
    color: var(--color-muted);
}

.page-header__subtitle {
    color: var(--color-secondary) !important;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Barre latérale */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    padding: 22px 16px;
    overflow-y: auto;
    color: white;
    background: var(--color-primary);
}

.sidebar__brand a {
    display: flex;
    flex-direction: column;
    padding: 8px 10px 20px;
    text-decoration: none;
}

.sidebar__brand-name {
    font-size: 23px;
    font-weight: 800;
}

.sidebar__brand-description {
    margin-top: 4px;
    color: #cbdced;
    font-size: 13px;
}

.sidebar__user {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid rgb(255 255 255 / 18%);
    border-radius: var(--border-radius);
    background: rgb(255 255 255 / 8%);
}

.sidebar__user-name {
    font-weight: 700;
}

.sidebar__user-role,
.sidebar__user-matricule {
    color: #dce8f3;
    font-size: 13px;
}

.sidebar__navigation {
    flex: 1;
}

.sidebar__menu,
.sidebar__submenu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sidebar__menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar__link,
.sidebar__sublink {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 7px;
    color: #e8f1f8;
    text-decoration: none;
    cursor: pointer;
}

.sidebar__link:hover,
.sidebar__sublink:hover {
    background: rgb(255 255 255 / 12%);
}

.sidebar__link--active,
.sidebar__sublink--active {
    color: var(--color-primary);
    font-weight: 700;
    background: white;
}

.sidebar__submenu summary {
    list-style: none;
}

.sidebar__submenu summary::-webkit-details-marker {
    display: none;
}

.sidebar__submenu ul {
    margin: 5px 0 8px 22px;
    padding-left: 10px;
    border-left: 1px solid rgb(255 255 255 / 25%);
}

.sidebar__sublink {
    padding: 9px 10px;
    font-size: 14px;
}

.sidebar__section {
    margin-top: 24px;
}

.sidebar__section-title {
    margin: 0 10px 8px;
    color: #aebfd0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar__logout {
    padding-top: 18px;
}

.sidebar__logout-button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid rgb(255 255 255 / 25%);
    border-radius: 7px;
    color: white;
    background: transparent;
    cursor: pointer;
}

.sidebar__logout-button:hover {
    background: #9b1c1c;
}

/* Cartes */

.content-card,
.kpi-card {
    margin-bottom: 24px;
    padding: 22px;
    border: 1px solid #e0e7ef;
    border-radius: var(--border-radius);
    background: var(--color-surface);
    box-shadow: var(--shadow);
}

.card-header,
.record-table__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.card-header h2,
.record-table__header h2 {
    margin: 0 0 5px;
    color: var(--color-primary);
    font-size: 20px;
}

.card-header p,
.record-table__header p {
    margin: 0;
    color: var(--color-muted);
}

/* Boutons */

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 42px;
    padding: 10px 17px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button--primary {
    color: white;
    background: var(--color-primary);
}

.button--primary:hover {
    background: #072d50;
}

.button--secondary {
    color: var(--color-primary);
    border-color: var(--color-border);
    background: white;
}

.button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Formulaires */

.form-grid,
.search-form,
.dashboard-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.search-form {
    grid-template-columns:
        minmax(240px, 2fr)
        minmax(170px, 1fr)
        minmax(150px, 1fr)
        auto;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group--wide {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 700;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--color-border);
    border-radius: 7px;
    color: var(--color-text);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: 3px solid rgb(11 58 102 / 14%);
    border-color: var(--color-primary);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.record-form .form-actions {
    justify-content: flex-end;
    margin-top: 24px;
}

.publication-summary,
.publication-warning {
    margin-top: 22px;
    padding: 18px;
    border-radius: 8px;
}

.publication-summary {
    border-left: 4px solid var(--color-primary);
    background: var(--color-primary-light);
}

.publication-warning {
    border: 1px solid #f5c451;
    background: #fff8e1;
}

/* Messages */

.alert {
    margin-bottom: 20px;
    padding: 15px 18px;
    border: 1px solid;
    border-radius: 8px;
}

.alert--success {
    color: #055f3d;
    border-color: #85d5b4;
    background: #ecfdf3;
}

.alert--error {
    color: #912018;
    border-color: #f0a7a0;
    background: #fff1f0;
}

.alert--information {
    color: #1849a9;
    border-color: #84adff;
    background: #eff4ff;
}

/* Sélecteur TEL TRANSIT / LISTING */

.table-switcher {
    display: inline-flex;
    gap: 5px;
    margin-bottom: 22px;
    padding: 5px;
    border: 1px solid var(--color-border);
    border-radius: 9px;
    background: #edf2f7;
}

.table-switcher__button {
    padding: 10px 18px;
    border: 0;
    border-radius: 6px;
    color: var(--color-muted);
    font-weight: 700;
    background: transparent;
    cursor: pointer;
}

.table-switcher__button--active {
    color: white;
    background: var(--color-primary);
}

/* Tableaux avec séparations visibles */

.table-container {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-table-border);
    border-radius: 8px;
    background: white;
}

table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    border-spacing: 0;
}

thead {
    color: white;
    background: var(--color-table-header);
}

th,
td {
    padding: 12px 13px;
    border-right: 1px solid var(--color-table-border);
    border-bottom: 1px solid var(--color-table-border);
    text-align: left;
    vertical-align: middle;
}

th {
    position: sticky;
    top: 0;
    z-index: 2;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

td {
    font-size: 14px;
}

th:last-child,
td:last-child {
    border-right: 0;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:nth-child(even) {
    background: var(--color-table-even);
}

tbody tr:hover {
    background: var(--color-table-hover);
}

tbody td:first-child {
    font-weight: 700;
    color: var(--color-primary);
}

/* Journal d’audit */

details summary {
    color: var(--color-primary);
    font-weight: 700;
    cursor: pointer;
}

pre {
    max-width: 420px;
    padding: 12px;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f8fafc;
}

/* Dashboard */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.kpi-card__label {
    color: var(--color-muted);
    font-size: 14px;
}

.kpi-card__value {
    margin: 8px 0;
    color: var(--color-primary);
    font-size: 32px;
    font-weight: 800;
}

.kpi-card__description {
    color: var(--color-muted);
    font-size: 13px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.chart-placeholder {
    display: grid;
    min-height: 260px;
    place-items: center;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    color: var(--color-muted);
    background: #f8fafc;
}

.realtime-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-success);
    font-weight: 700;
}

.realtime-indicator__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-success);
}

/* Téléphones et tablettes */

@media (max-width: 1050px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .application-layout {
        display: block;
    }

    .sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    .application-content {
        width: 100%;
        margin-left: 0;
        padding: 20px;
    }

    .form-grid,
    .search-form,
    .dashboard-filters,
    .dashboard-grid,
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .page-header,
    .card-header,
    .record-table__header {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions {
        flex-wrap: wrap;
    }
}/* Transit Kribi — theme et navigation mobile */
:root{--color-primary:#126d70;--color-primary-dark:#0d5056;--color-background:#f3f6f6}
.sidebar{background:#102f3d}.sidebar__brand-name{letter-spacing:.03em}.sidebar__link--active,.sidebar__sublink--active{background:#1c505b!important}.tk-menu-toggle{display:none}
@media(max-width:780px){.sidebar{padding:16px 20px;position:relative}.sidebar__brand{padding-right:90px;margin-bottom:0}.sidebar__user,.sidebar__navigation,.sidebar__logout{display:none}.sidebar.tk-menu-open .sidebar__user,.sidebar.tk-menu-open .sidebar__navigation,.sidebar.tk-menu-open .sidebar__logout{display:block}.tk-menu-toggle{display:block;position:absolute;right:18px;top:18px;background:#224d59;color:#fff;border:1px solid #52717c;border-radius:7px;padding:10px 12px;font-size:14px}.application-content{min-width:0}.record-table{overflow-x:auto}input,select,textarea{font-size:16px}}
