:root {
    --green:       #7cb109;
    --green-dark:  #5c8506;
    --blue:        #1f282f;
    --blue-light:  #2f3d47;
    --red:         #ae160b;
    --orange:      #f0a500;
    --bg:          #f5f7f9;
    --text:        #1f282f;
    --text-muted:  #5a6872;
    --border:      #e1e6ea;
    --radius:      8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Manrope', -apple-system, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER */
.site-header {
    background: var(--blue);
    color: #fff;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
    border-radius: 8px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    margin-left: auto;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 6px;
    color: rgba(255,255,255,.75);
    font-weight: 500;
    transition: all .15s;
}

.main-nav a:hover {
    color: #fff;
    background: rgba(255,255,255,.08);
}

.main-nav a.nav-cta {
    color: var(--blue);
    background: #fff;
    font-weight: 600;
}
.main-nav a.nav-cta:hover {
    background: var(--green);
    color: #fff;
}
.main-nav a.nav-cta svg {
    stroke: var(--blue);
}

.main-nav a.nav-icon {
    padding: 8px;
}

.site-header.is-guest .header-inner {
    justify-content: center;
}
.site-header.is-logged .header-inner {
    justify-content: space-between;
}

/* BOUTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}

.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }

.btn-block { width: 100%; }

/* PAGE HEAD */
.page-head {
    padding: 32px 0 24px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.page-head-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.page-head h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 4px;
}

.page-head p { color: var(--text-muted); font-size: 14px; }

/* AUTH */
.auth-wrap {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
}

.auth-card h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 6px;
}

.auth-sub {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.auth-card form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-card label {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    margin-top: 10px;
}

.auth-card input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}

.auth-card input:focus { border-color: var(--green); }

.auth-card .btn { margin-top: 20px; }

.auth-alt {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-alt a { color: var(--green-dark); font-weight: 600; }

.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}

.alert-error {
    background: #fde8e6;
    color: var(--red);
    border: 1px solid #f5c6c1;
}

/* KPI */
.kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    padding: 24px 0;
}

.kpi {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--blue);
}

.kpi-value.green  { color: var(--green-dark); }
.kpi-value.orange { color: var(--orange); }

/* SECTION */
.section { padding: 8px 0 40px; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-head h2 { font-size: 16px; font-weight: 700; color: var(--blue); }
.section-head a { font-size: 13px; color: var(--green-dark); font-weight: 600; }

/* TICKETS */
.tickets {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.ticket-row {
    display: grid;
    grid-template-columns: 110px 1fr 120px 110px 90px;
    gap: 12px;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    transition: background .15s;
}

.ticket-row:last-child { border-bottom: 0; }
.ticket-row:hover { background: #fafbfc; }

.ticket-ref { font-weight: 700; color: var(--blue); font-size: 13px; }

.ticket-title {
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ticket-date {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.prio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.prio-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* EMPTY */
.empty {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
}

.empty h3 { font-size: 16px; color: var(--blue); margin-bottom: 6px; }
.empty p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

/* FOOTER */
.site-footer {
    padding: 24px 0;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .main-nav a span { display: none; }
    .main-nav a { padding: 8px; }
    .ticket-row {
        grid-template-columns: 1fr auto;
        gap: 6px;
    }
    .ticket-row > *:nth-child(3),
    .ticket-row > *:nth-child(4) { display: none; }
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
}

.logo-img {
    height: 40px;
    width: auto;
    display: block;
    border-radius: 8px;
}
 
/* FORMULAIRES */
.form-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 720px;
    margin: 0 auto;
}

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

.form-card label {
    font-size: 13px;
    font-weight: 600;
    color: var(--blue);
    margin-top: 14px;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="tel"],
.form-card input[type="password"],
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color .15s;
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
    border-color: var(--green);
}

.form-card textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* BOUTON OUTLINE */
.btn-outline {
    background: #fff;
    color: var(--blue);
    border-color: var(--border);
}
.btn-outline:hover {
    border-color: var(--blue);
}

/* ALERTES */
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}
.alert-error {
    background: #fde8e6;
    color: var(--red);
    border: 1px solid #f5c6c1;
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
}

/* ═══ TICKET — DÉTAIL ═══ */

.breadcrumb {
    padding: 20px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}
.breadcrumb a:hover { color: var(--green-dark); }
.breadcrumb span { margin: 0 6px; }

.ticket-head {
    padding: 16px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.ticket-head-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.ticket-head .ticket-ref {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: .05em;
    margin-bottom: 4px;
}

.ticket-head h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 8px;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}
.ticket-meta strong { color: var(--blue); font-weight: 600; }

.ticket-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    padding-bottom: 40px;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.card h2 {
    font-size: 13px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.description {
    font-size: 14px;
    color: var(--text);
}

.thread-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.thread-head h2 { margin-bottom: 0; }

.message {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.message:last-child { border-bottom: 0; }

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}
.message-avatar.client { background: var(--blue); }
.message-avatar.agent  { background: var(--green); }

.message-body { flex: 1; min-width: 0; }

.message-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

.message-author { font-weight: 700; color: var(--blue); }

.message-role {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef1f3;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.message-role.agent {
    background: #eaf5d0;
    color: var(--green-dark);
}

.message-time {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.message-content {
    font-size: 14px;
    color: var(--text);
}

/* RÉPONSE */
.reply-box textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    resize: vertical;
    outline: none;
    transition: border-color .15s;
}
.reply-box textarea:focus { border-color: var(--green); }

.reply-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 12px;
    flex-wrap: wrap;
}

.reply-hint {
    font-size: 12px;
    color: var(--text-muted);
}

/* SIDEBAR */
.sidebar .card { padding: 18px; }

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: 0; }
.info-row .label { color: var(--text-muted); }
.info-row .value { color: var(--blue); font-weight: 600; text-align: right; }

@media (max-width: 860px) {
    .ticket-layout { grid-template-columns: 1fr; }
}

/* Header non connecté — centré */
.site-header.is-guest .header-inner {
    justify-content: center;
}
.site-header.is-logged .header-inner {
    justify-content: space-between;
}

	
/* Footer : lien déconnexion */
.footer-inner a {
    color: var(--text-muted);
    font-weight: 600;
}
.footer-inner a:hover {
    color: var(--red);
}

/* FAQ */
.faq-group {
    margin-bottom: 32px;
}

.faq-group-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.faq-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    padding: 14px 18px;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--blue);
    font-size: 14px;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    font-size: 20px;
    color: var(--text-muted);
    font-weight: 400;
    transition: transform .2s;
}
.faq-item[open] summary::after {
    content: '−';
    color: var(--green-dark);
}

.faq-content {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
}
