
:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #1d2433;
    --muted: #778093;
    --border: #e5e9f0;
    --dark: #171a21;
    /* Bleu du O du logo DOEMO Print (#00a0e0), fonce pour garder un bon
       contraste avec le texte blanc - couleur d'accent UNIQUE de
       l'appli (boutons, liens, menu, bordures), demande utilisateur du
       08/10/2026 pour remplacer le violet partout, pas seulement le menu. */
    --primary: #0077a8;
    --nav-bg: var(--primary);
    --danger: #c93838;
    --success: #16864f;
}

* {
    box-sizing: border-box;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

.topbar {
    height: 64px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 51;
}

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

.top-logo {
    max-width: 150px;
    max-height: 38px;
    object-fit: contain;
}

.user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
}

.logout-btn svg {
    width: 15px;
    height: 15px;
    flex: none;
}

.logout-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

/* Barre de navigation coloree - sous le bandeau logo, pour garder le
   logo (texte noir + O multicolore) lisible sur fond blanc tout en
   donnant au menu lui-meme un vrai repere visuel de marque. */
.navbar {
    display: flex;
    align-items: stretch;
    gap: 2px;
    background: var(--nav-bg);
    padding: 0 20px;
    position: sticky;
    top: 64px;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(0,60,85,.18);
}

.top-link,
.menu > button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.88);
    padding: 9px 16px 8px;
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    white-space: nowrap;
}

.nav-icon {
    display: flex;
}

.nav-icon svg {
    width: 19px;
    height: 19px;
}

.top-link:hover,
.menu:hover > button,
.menu.active > button {
    color: #fff;
    border-bottom-color: #fff;
    background: rgba(255,255,255,.07);
}

.chevron {
    width: 9px;
    height: 9px;
    margin-left: 1px;
    opacity: .75;
}

.menu {
    position: relative;
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 14px 34px rgba(23,16,60,.16);
    padding: 7px;
    border-radius: 0 0 10px 10px;
}

.menu:hover .submenu {
    display: block;
}

.submenu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #303644;
    border-radius: 7px;
    font-size: 13.5px;
}

.submenu a svg {
    width: 16px;
    height: 16px;
    flex: none;
    color: var(--nav-bg);
}

.submenu a:hover {
    background: #eaf6fb;
    color: var(--nav-bg);
}

.page {
    max-width: 1500px;
    margin: 0 auto;
    padding: 34px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.page-head h1 {
    margin: 0 0 5px;
    font-size: 28px;
}

.page-head p {
    margin: 0;
    color: var(--muted);
}

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

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

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

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 11px 11px 13px 13px;
    padding: 18px 20px 20px;
    transition: box-shadow .15s ease, transform .15s ease;
}

.stat-card:hover {
    box-shadow: 0 8px 20px rgba(39,25,110,.1);
    transform: translateY(-1px);
}

.stat-card span {
    display: block;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--muted);
    margin-bottom: 11px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
    color: var(--dark);
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 22px;
    margin-bottom: 24px;
    overflow-x: auto;
}

/* Onglets de la fiche contact : Coordonnees + un par appel. */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 18px;
    overflow-x: auto;
}
.tab-btn {
    appearance: none;
    border: none;
    background: transparent;
    padding: 11px 16px;
    font-weight: 600;
    font-size: 13.5px;
    color: #6b7280;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    font-family: inherit;
}
.tab-btn:hover { color: #1f2937; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
.qual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 14px 0;
}
.qual-item span { display: block; font-size: 11px; color: #6b7280; text-transform: uppercase; letter-spacing: .02em; margin-bottom: 3px; }
.qual-item strong { font-size: 14px; }
.prompt-box {
    background: #f8f9fb;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px 14px;
    font-size: 12px;
    white-space: pre-wrap;
    max-height: 320px;
    overflow-y: auto;
    font-family: ui-monospace, monospace;
}

.panel h2 {
    margin-top: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.panel-title h2 {
    margin: 0;
}

.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

th {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
    padding: 12px 10px;
    background: #f8f9fb;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }

td {
    padding: 13px 10px;
    border-bottom: 1px solid #eef0f4;
    vertical-align: middle;
    font-size: 14px;
}

tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: #f8fbfd;
}

/* Table pleine largeur hors .panel (fiches tres larges, ex. historique
   des appels) - meme traitement visuel que .panel, juste une classe
   differente pour marquer qu'elle n'embarque pas d'autre contenu. */
.table-wrap {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 6px 22px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 20px;
    background: #f0eefc;
    color: #5642b9;
    padding: 5px 9px;
    font-size: 12px;
}

/* Couleur par SENS de statut, commune aux trois vocabulaires de l'appli
   (contact, campagne, appel) - voir status_color() dans app.py. */
.badge-green  { background: #e7f7ee; color: #156b43; }
.badge-blue   { background: #e8f0fe; color: #1a56c4; }
.badge-amber  { background: #fff4e0; color: #8a5a00; }
.badge-red    { background: #feecec; color: #9c2525; }
.badge-gray   { background: #eef0f4; color: #5b6472; }

.btn {
    appearance: none;
    border: 1px solid #d8dce5;
    background: #fff;
    color: #303644;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:hover {
    background: #f5f6f8;
}

.btn.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn.primary:hover {
    opacity: .93;
}

.btn.danger {
    border-color: #f1c2c2;
    color: var(--danger);
}

.btn.large {
    padding: 14px 22px;
    font-size: 15px;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--border);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.filters input,
.filters select {
    /* La regle generique plus bas (input, select { width:100% }) ne porte
       pas sur .filters specifiquement : width:100% s'applique quand meme
       (ce n'est pas la propriete que min-width redefinit), chaque champ
       occupe alors toute la ligne et pousse les suivants en dessous -
       c'etait le bug signale le 08/10/2026 ("un en dessous des autres").
       width:auto + flex-basis le neutralise, tout en gardant le wrap sur
       mobile via flex-wrap sur .filters. */
    width: auto;
    flex: 1 1 190px;
    min-width: 150px;
}

.filters button[type="submit"] {
    flex: 0 0 auto;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #dce0e8;
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 14px;
    background: #fff;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

label {
    display: block;
    margin: 5px 0 7px;
    font-size: 13px;
    font-weight: 600;
}

.form-panel form {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

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

.form-section {
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.form-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--primary);
    margin: 0 0 13px;
}

.form-section .form-grid {
    gap: 11px 15px;
}

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

.import-result > div {
    background: #fff;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.import-result span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.import-result strong {
    display: block;
    margin-top: 8px;
    font-size: 25px;
}

.alert {
    border-radius: 9px;
    padding: 13px 15px;
    margin-bottom: 18px;
}

.alert.error {
    background: #feecec;
    color: #9c2525;
}

.alert.success {
    background: #e7f7ee;
    color: #156b43;
}

/* V9 phase 1 : signal non bloquant (creneau supplementaire necessaire). */
.alert.warn {
    background: #fff4e0;
    color: #8a5a00;
}

.info-box {
    padding: 14px;
    background: #f1f3f8;
    border-radius: 9px;
    color: #5d6472;
    font-size: 13px;
    margin: 15px 0;
}

.action-row {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
}

.duplicate-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 20px;
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: 1fr 50px 1fr auto;
    gap: 18px;
    align-items: center;
}

.duplicate-side h3 {
    color: var(--muted);
    font-size: 13px;
    margin-top: 0;
}

.duplicate-side p {
    margin: 5px 0;
    color: #586071;
}

.duplicate-arrow {
    text-align: center;
    font-size: 22px;
}

.duplicate-actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

/* Groupe de doublons par numero (contacts deja en base, pas la file
   d'import) - distinct de .duplicate-card : pas de flèche ni d'actions,
   juste un numero et la liste des fiches qui le partagent. Reutiliser
   .duplicate-card (grille a 4 colonnes 1fr/50px/1fr/auto) ici ecrasait le
   texte dans la colonne de 50px prevue pour la fleche (bug trouve le
   08/10/2026, page jugee "inutilisable" par l'utilisateur a cause de ca).
*/
.duplicate-group-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 20px;
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
}

.duplicate-group-card .duplicate-side p {
    margin: 2px 0 0;
    font-size: 12.5px;
}

.duplicate-group-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.duplicate-group-list .dg-row {
    padding: 9px 12px;
    background: #f8f9fb;
    border-radius: 8px;
    font-size: 13.5px;
}

.duplicate-group-list .dg-row a {
    font-weight: 600;
}

@media (max-width: 720px) {
    .duplicate-group-card {
        grid-template-columns: 1fr;
    }
}

.empty-state {
    background: #fff;
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 13px;
    text-align: center;
    color: var(--muted);
}

.campaign-info {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 18px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(5,1fr);
    gap: 15px;
}

.campaign-info span {
    color: var(--muted);
    font-size: 12px;
    display: block;
    margin-bottom: 6px;
}

.campaign-submit {
    display: flex;
    justify-content: flex-end;
    margin: 22px 0 50px;
}

.muted {
    color: var(--muted);
    font-size: 14px;
    font-weight: normal;
}

.account-wrap {
    max-width: 720px;
    margin: 0 auto;
}

.account-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 30px;
}

.account-card form {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.account-card hr {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--border);
    margin: 15px 0;
}

.login-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f4f5f8;
}

.login-shell {
    width: 420px;
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.1);
}

.login-logo {
    width: 180px;
    max-height: 80px;
    object-fit: contain;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.login-card button {
    margin-top: 8px;
    border: 0;
    border-radius: 8px;
    padding: 12px;
    background: var(--primary);
    color: white;
    cursor: pointer;
}

@media (max-width: 1000px) {

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

    .two-cols,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .topbar {
        height: auto;
        flex-wrap: wrap;
        padding: 12px 15px;
    }

    .navbar {
        position: static;
        flex-wrap: wrap;
        padding: 0 8px;
    }

    .user span {
        display: none;
    }

    .duplicate-card {
        grid-template-columns: 1fr;
    }

    .duplicate-arrow {
        display: none;
    }

    .campaign-info {
        grid-template-columns: repeat(2,1fr);
    }
}

/* Calendrier des relances (demande utilisateur du 08/10/2026). */
.calendar-panel {
    overflow-x: auto;
}
.calendar-table {
    table-layout: fixed;
    border: 1px solid var(--border);
}
.calendar-table th {
    text-align: center;
    padding: 8px;
    background: #f8f9fb;
}
.cal-cell {
    vertical-align: top;
    width: 14.28%;
    height: 108px;
    padding: 6px;
    border: 1px solid var(--border);
}
.cal-cell.empty {
    background: #fafafb;
}
.cal-cell.today {
    background: #eaf6fb;
    box-shadow: inset 0 0 0 2px var(--nav-bg);
}
.cal-cell.has-items {
    background: #fcfcff;
}
.cal-daynum {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 4px;
}
.cal-cell.today .cal-daynum {
    color: var(--nav-bg);
}
.cal-item {
    display: block;
    font-size: 10.5px;
    padding: 2px 5px;
    border-radius: 5px;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-more {
    font-size: 10px;
    color: var(--muted);
    padding: 2px 5px;
}

@media (max-width: 900px) {
    .calendar-table { min-width: 700px; }
}
