/* CRM GeoGaming : un seul fichier de styles, pas de style en ligne (cf. la politique de sécurité des pages). */

:root {
    --blue-700: #0559c4;
    --blue-600: #0680d8;
    --blue-500: #0794e3;
    --blue-50: #e8f3fd;
    --cyan: #23b7ff;
    --ink: #0a1b2d;
    --text: #1f2937;
    --slate: #5b6b78;
    --muted: #8a96a3;
    --line: #e5e9ec;
    --bg: #f4f6fa;
    --card: #ffffff;
    --yellow-50: #fff8e1;
    --yellow-300: #ffd21f;
    --red: #d9480f;
    --red-50: #fff0e6;
    --green: #2b8a3e;
    --green-50: #ebfbee;
    --violet: #6741d9;
    --violet-50: #f3f0ff;
    --amber: #e67700;
    --amber-50: #fff4e0;
    --gray-50: #f1f3f5;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .04);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--font);
}

a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 15px; height: 15px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------------ barre du haut */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 22px;
    height: 58px;
    padding: 0 22px;
    background: linear-gradient(100deg, #0559c4 0%, #0680d8 45%, #0794e3 100%);
    color: #fff;
    box-shadow: 0 2px 12px rgba(5, 89, 196, .25);
}

.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, .18); }
.brand-mark .ico { width: 19px; height: 19px; }
.brand small { font-weight: 600; opacity: .8; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .16); }

.nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 12px; border-radius: 10px;
    color: rgba(255, 255, 255, .88); font-weight: 600; white-space: nowrap;
}
.nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; text-decoration: none; }
.nav a.is-active { background: rgba(255, 255, 255, .2); color: #fff; }
.nav .count {
    min-width: 20px; padding: 0 6px; border-radius: 999px;
    background: var(--yellow-300); color: var(--ink); font-size: 11px; font-weight: 800; line-height: 20px; text-align: center;
}

.me { display: flex; align-items: center; gap: 8px; }
.me a.avatar-link:hover { text-decoration: none; }
.me form { margin: 0; }
.btn-quiet-light {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; border: 0; border-radius: 10px; background: transparent;
    color: rgba(255, 255, 255, .85); font: inherit; font-weight: 600; cursor: pointer;
}
.btn-quiet-light:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* ------------------------------------------------------------------ page */

.page { max-width: 1320px; margin: 0 auto; padding: 24px 22px 60px; }
.page-narrow { max-width: 760px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--slate); }
.crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--slate); font-size: 13px; }
.crumbs a { color: var(--slate); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }

.flash, .error-box {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px; padding: 11px 14px; border-radius: 12px; font-weight: 550;
}
.flash { background: var(--green-50); color: #1e6b31; border: 1px solid #c3eacb; }
.error-box { background: var(--red-50); color: #a33a0b; border: 1px solid #ffd2b8; }

.empty { padding: 48px 20px; text-align: center; color: var(--slate); }
.empty .ico { width: 34px; height: 34px; color: var(--muted); margin-bottom: 8px; }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

.muted { color: var(--slate); }
.small { font-size: 12.5px; }

/* ------------------------------------------------------------------ boutons et champs */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 9px 15px; border: 1px solid transparent; border-radius: 10px;
    font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap;
    background: var(--blue-600); color: #fff;
    transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--blue-700); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--gray-50); }
.btn-note { background: #f5b700; color: var(--ink); }
.btn-note:hover { background: #e6a800; }
.btn-danger { background: #fff; color: var(--red); border-color: #ffd2b8; }
.btn-danger:hover { background: var(--red-50); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 5px; color: var(--slate); font-size: 12.5px; font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { margin: -8px 0 14px; color: var(--muted); font-size: 12px; }

input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel], input[type=date],
input[type=number], select, textarea {
    width: 100%; padding: 9px 11px;
    border: 1px solid #d5dbe1; border-radius: 10px; background: #fff;
    color: var(--text); font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(7, 148, 227, .15); }
textarea { resize: vertical; min-height: 96px; line-height: 1.5; }

.search { position: relative; flex: 1; max-width: 360px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; }

/* ------------------------------------------------------------------ badges et pastilles */

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 9px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; line-height: 20px; white-space: nowrap;
    background: var(--gray-50); color: var(--slate);
}
.status-waiting-team { background: var(--red-50); color: var(--red); }
.status-answered { background: var(--green-50); color: var(--green); }
.status-closed { background: var(--gray-50); color: var(--muted); }
.stage-new { background: var(--blue-50); color: var(--blue-700); }
.stage-discussion { background: var(--violet-50); color: var(--violet); }
.stage-quote { background: var(--amber-50); color: var(--amber); }
.stage-won { background: var(--green-50); color: var(--green); }
.stage-lost { background: var(--gray-50); color: var(--muted); }
.badge-late { background: var(--red-50); color: var(--red); }
.badge-soon { background: var(--yellow-50); color: #8a6d00; }
.badge-quote { background: var(--yellow-300); color: var(--ink); }
/* Demande venue d'un autre site que geo-gaming.com (SeriousGaming) */
.badge-brand { background: var(--violet-50); color: var(--violet); }
/* Essai (version de test) : hachuré, pour qu'on ne le prenne pas pour une vraie demande */
.badge-test {
    background: #fff repeating-linear-gradient(-45deg, transparent 0 5px, rgba(138, 150, 163, .14) 5px 10px);
    color: var(--slate); box-shadow: inset 0 0 0 1px #c3ccd5;
}

.avatar {
    display: inline-grid; place-items: center; flex: none;
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, #d6ecfd, #b9dcfb); color: var(--blue-700);
    font-size: 13px; font-weight: 800; letter-spacing: .02em;
}
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar-lg { width: 52px; height: 52px; font-size: 17px; }
.avatar-me { background: rgba(255, 255, 255, .22); color: #fff; width: 32px; height: 32px; font-size: 12px; }
.avatar-team { background: linear-gradient(135deg, #ffe8a3, #ffd21f); color: var(--ink); }

/* ------------------------------------------------------------------ boîte de réception */

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #e9edf2; overflow-x: auto; max-width: 100%; }
.tabs a {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 9px;
    color: var(--slate); font-weight: 650; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .1); }
.tabs .count { padding: 0 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; }
.tabs .count-muted { background: #c3ccd5; color: var(--ink); }

.test-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-bottom: 14px; padding: 12px 16px; border-radius: 12px;
    background: var(--gray-50); color: var(--slate); font-size: 13px; line-height: 1.5;
}
.test-banner p { margin: 0; max-width: 72ch; }
.test-banner form { margin: 0; }

.leads { list-style: none; margin: 0; padding: 0; }
.lead-row { border-bottom: 1px solid var(--line); }
.lead-row:last-child { border-bottom: 0; }
.lead-row > a {
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start;
    padding: 14px 18px; color: inherit;
}
.lead-row > a:hover { background: #f8fafc; text-decoration: none; }
.lead-row.is-unread > a { background: #f5faff; }
.lead-main { min-width: 0; }
.lead-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lead-who strong { color: var(--ink); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-who .org { color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue-600); flex: none; }
.lead-subject { margin-top: 2px; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-preview { margin-top: 2px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-preview .from-team { color: var(--muted); }
.lead-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lead-meta time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.lead-badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

/* ------------------------------------------------------------------ fiche d'une demande */

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.detail-head h1 { font-size: 20px; }
.detail-head .lead-badges { justify-content: flex-start; margin-top: 8px; }

.thread { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; max-width: 86%; }
.msg-body { min-width: 0; }
.msg-who { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; color: var(--slate); font-size: 12px; }
.msg-who strong { color: var(--ink); font-size: 12.5px; }
.msg-text {
    padding: 10px 14px; border-radius: 4px 14px 14px 14px;
    background: #eef6fd; color: var(--text);
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.is-team { align-self: flex-end; flex-direction: row-reverse; }
.msg.is-team .msg-who { justify-content: flex-end; }
.msg.is-team .msg-text { border-radius: 14px 4px 14px 14px; background: #fff; border: 1px solid #cfe3f7; }
.msg.is-note { align-self: stretch; max-width: none; }
.msg.is-note .msg-text { border-radius: 12px; background: var(--yellow-50); border: 1px dashed #f0c64d; }
.msg-page { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.event { align-self: center; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; text-align: center; }
.event .ico { width: 13px; height: 13px; }
.system { align-self: center; max-width: 80%; color: var(--muted); font-size: 12px; font-style: italic; text-align: center; }

.composer { border-top: 1px solid var(--line); padding: 14px 20px 18px; background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }
.composer-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.composer-tabs button {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border: 0; border-radius: 9px; background: transparent;
    color: var(--slate); font: inherit; font-weight: 650; cursor: pointer;
}
.composer-tabs button.is-active { background: var(--blue-50); color: var(--blue-700); }
.composer-tabs button.is-active[data-mode=note] { background: var(--yellow-50); color: #8a6d00; }
.composer form { margin: 0; }
.composer textarea { min-height: 110px; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.composer-foot .hint { margin: 0; }
.composer [hidden] { display: none !important; }

.side .card-pad h2 { margin-bottom: 12px; }
.contact-card { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.contact-card strong { display: block; color: var(--ink); font-size: 15px; }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; }
.facts dt { color: var(--muted); font-size: 12.5px; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.side .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 8px 0; border-top: 1px solid var(--line); }
.mini-list li:first-child { border-top: 0; padding-top: 0; }
.mini-list a { font-weight: 600; }

/* ------------------------------------------------------------------ pipeline */

.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.column { display: flex; flex-direction: column; min-height: 200px; border-radius: var(--radius); background: #e9edf2; }
.column-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 8px; }
.column-head h2 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.column-head .sum { color: var(--slate); font-size: 12px; font-weight: 650; }
.column-cards { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 6px 10px 12px; min-height: 80px; border-radius: 0 0 var(--radius) var(--radius); transition: background .15s; }
.column.is-over .column-cards { background: rgba(7, 148, 227, .1); }
.deal {
    display: block; padding: 10px 12px; border-radius: 11px; background: #fff;
    border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    color: inherit; cursor: grab;
}
.deal:hover { border-color: #b9dcfb; text-decoration: none; }
.deal.is-dragging { opacity: .5; }
.deal strong { display: block; color: var(--ink); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal .who { color: var(--slate); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.deal .amount { color: var(--ink); font-weight: 700; }
.column .more { padding: 0 14px 12px; color: var(--slate); font-size: 12px; }

/* ------------------------------------------------------------------ tableaux */

.table { width: 100%; border-collapse: collapse; }
.table th { padding: 10px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 650; text-align: left; white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-off td { color: var(--muted); }
.table .who { display: flex; align-items: center; gap: 10px; }
.table .who strong { color: var(--ink); }
.table .row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table .row-actions form { margin: 0; }
.table-wrap { overflow-x: auto; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }

/* ------------------------------------------------------------------ connexion */

.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, #0559c4 0%, #0794e3 55%, #23b7ff 100%); }
.auth-card { width: 100%; max-width: 400px; padding: 30px 28px; border-radius: 18px; background: #fff; box-shadow: 0 20px 50px rgba(5, 40, 90, .25); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; color: var(--ink); font-size: 18px; font-weight: 800; }
.auth-brand .brand-mark { background: var(--blue-50); color: var(--blue-600); }
.auth-card h1 { font-size: 20px; margin-bottom: 6px; }
.auth-card > p { margin: 0 0 20px; color: var(--slate); }
.auth-links { margin-top: 16px; text-align: center; font-size: 13px; }

/* ------------------------------------------------------------------ petits écrans */

@media (max-width: 980px) {
    .detail, .split { grid-template-columns: 1fr; }
    .board { grid-template-columns: repeat(5, 260px); }
}

@media (max-width: 640px) {
    .topbar { gap: 12px; padding: 0 12px; }
    .brand span.brand-name, .brand small { display: none; }
    .nav a span.label { display: none; }
    .page { padding: 16px 16px 48px; }
    .lead-row > a { grid-template-columns: auto 1fr; padding: 12px 14px; }
    .lead-meta { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
    .msg { max-width: 100%; }
    .field-row { grid-template-columns: 1fr; }
    .me .btn-quiet-light span { display: none; }
}
