:root {
    --navy-950: #0d0f18;
    --navy-900: #141726;
    --navy-800: #1e2238;
    --navy-700: #2b304c;
    --brand-500: #5865F2;
    --brand-600: #4752C4;
    --brand-700: #3C45A5;
    --brand-50: #eef2ff;
    --bg-body: #f1f5f9;
    --bg-surface: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ==================== BOUTONS & ÉLÉMENTS GÉNÉRAUX ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.15rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 150, 255, 0.25);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 150, 255, 0.35);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-main);
    border-color: #cbd5e1;
}

.btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
}

.btn-danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    color: #ffffff;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 0.8rem 1.4rem;
    font-size: 0.98rem;
}

.btn-sm {
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

kbd {
    background: #e2e8f0;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.78rem;
    font-family: monospace;
    color: #0f172a;
}

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

.form-group {
    margin-bottom: 1.15rem;
}

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

.form-group label {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.45rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.72rem 0.9rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.94rem;
    font-family: inherit;
    color: var(--text-main);
    background-color: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-group input:disabled {
    background-color: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(0, 150, 255, 0.14);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ==================== VUE AUTHENTIFICATION ==================== */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

.auth-split {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    width: 100%;
    min-height: 100vh;
}

.auth-brand-panel {
    background: radial-gradient(circle at top left, #152647 0%, var(--navy-950) 75%);
    color: #ffffff;
    padding: 3.5rem 4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.brand-content {
    max-width: 480px;
    margin: auto 0;
}

.brand-logo-box {
    margin-bottom: 1.5rem;
}

.brand-logo-img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(0, 150, 255, 0.25);
    border: 2px solid rgba(0, 150, 255, 0.35);
}

.brand-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.brand-title .accent,
.sidebar-title .accent {
    color: var(--brand-500);
}

.brand-subtitle {
    color: var(--brand-500);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-top: 0.4rem;
    margin-bottom: 2.5rem;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.brand-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.2rem;
    border-radius: var(--radius-md);
}

.feature-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.brand-feature-item strong {
    display: block;
    font-size: 0.96rem;
    color: #f8fafc;
    margin-bottom: 0.2rem;
}

.brand-feature-item p {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.45;
}

.brand-footer {
    font-size: 0.8rem;
    color: #64748b;
}

.auth-form-panel {
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
}

.auth-card {
    background: var(--bg-surface);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.auth-card-header {
    margin-bottom: 1.75rem;
}

.auth-card-header h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.auth-card-header p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.security-badge {
    display: inline-block;
    background: var(--brand-50);
    color: var(--brand-600);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 99px;
    margin-bottom: 0.75rem;
    border: 1px solid #bae6fd;
}

.otp-input {
    text-align: center;
    font-size: 1.75rem !important;
    font-weight: 800;
    letter-spacing: 10px;
    color: var(--navy-900) !important;
}

.auth-card-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-card-footer a {
    color: var(--brand-600);
    font-weight: 600;
    text-decoration: none;
}

.auth-card-footer a:hover {
    text-decoration: underline;
}

/* ==================== LAYOUT PORTAIL (SIDEBAR + WORKSPACE) ==================== */

.portal-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: var(--navy-950);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.4rem 1.4rem 1.1rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(0, 150, 255, 0.4);
}

.sidebar-title {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.1;
}

.sidebar-subtitle {
    font-size: 0.68rem;
    color: var(--brand-500);
    font-weight: 700;
    letter-spacing: 2.5px;
    margin-top: 2px;
}

.sidebar-action {
    padding: 1.15rem 1.2rem 0.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0.85rem;
    overflow-y: auto;
}

.nav-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    letter-spacing: 1.2px;
    padding: 1rem 0.65rem 0.45rem;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.68rem 0.85rem;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.nav-item.active {
    background: rgba(0, 150, 255, 0.16);
    color: #38bdf8;
    font-weight: 600;
    border-left: 3px solid var(--brand-500);
}

.nav-icon {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.15rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-meta {
    overflow: hidden;
}

.user-name-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.user-name-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email-text {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-badge {
    background: var(--brand-500);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

/* ==================== WORKSPACE & TOPBAR ==================== */

.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 1.1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-heading {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
}

.page-subheading {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.content-area {
    padding: 1.75rem 2rem 3rem;
    max-width: 1360px;
    width: 100%;
    margin: 0 auto;
}

/* ==================== CARTES STATISTIQUES KPI ==================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.15rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.35rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.stat-icon.total { background: #eff6ff; color: #2563eb; }
.stat-icon.open { background: #fef3c7; color: #d97706; }
.stat-icon.progress { background: #e0f2fe; color: #0284c7; }
.stat-icon.closed { background: #d1fae5; color: #059669; }

.stat-label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

/* ==================== BARRE DE RECHERCHE & FILTRES ==================== */

.toolbar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.search-box {
    flex: 1;
    min-width: 260px;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: #94a3b8;
}

.search-box input {
    width: 100%;
    padding: 0.62rem 0.9rem 0.62rem 2.3rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--brand-500);
}

.filters-group {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.filters-group select {
    padding: 0.6rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    background: #ffffff;
    color: var(--text-main);
    font-weight: 500;
}

/* ==================== LISTE DES TICKETS ==================== */

.tickets-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.ticket-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.16s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
}

.ticket-card:hover {
    border-color: var(--brand-500);
    box-shadow: var(--shadow-md);
}

.ticket-card-left {
    flex: 1;
    min-width: 0;
}

.ticket-top-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.45rem;
    flex-wrap: wrap;
}

.ticket-id-tag {
    font-family: monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-600);
    background: var(--brand-50);
    padding: 2px 8px;
    border-radius: 5px;
    border: 1px solid #bae6fd;
}

.ticket-subject {
    font-size: 1.04rem;
    font-weight: 700;
    color: var(--text-main);
}

.ticket-excerpt {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-bottom-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.76rem;
    color: #475569;
}

.ticket-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.admin-inline-controls {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.admin-inline-controls select {
    padding: 0.38rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 0.8rem;
    background: #f8fafc;
    color: var(--text-main);
    font-weight: 500;
}

/* ==================== BADGES STATUT, PRIORITÉ, CATÉGORIE ==================== */

.status-badge,
.priority-badge,
.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.65rem;
    border-radius: 99px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.status-badge.open {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.status-badge.in_progress {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.status-badge.closed {
    background: #d1fae5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.priority-badge.low {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.priority-badge.medium {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.priority-badge.high {
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.priority-badge.urgent {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.category-badge {
    background: #f3e8ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

/* ==================== PANELS & DÉTAIL TICKET ==================== */

.panel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.65rem;
    box-shadow: var(--shadow-sm);
}

.form-panel {
    max-width: 820px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.panel-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.detail-top-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.15rem;
}

.ticket-detail-grid {
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 1.35rem;
    align-items: start;
}

.ticket-main-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.ticket-side-col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ticket-summary-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.ticket-id-pill {
    font-family: monospace;
    font-size: 0.95rem;
    font-weight: 800;
    background: var(--navy-900);
    color: var(--brand-500);
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
}

.detail-subject-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
}

.ticket-badges-bar {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.meta-date {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-left: auto;
}

.description-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.description-content {
    font-size: 0.96rem;
    line-height: 1.65;
    color: #1e293b;
    white-space: pre-wrap;
    background: #f8fafc;
    padding: 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #e2e8f0;
}

/* ==================== CONVERSATION & MESSAGES ==================== */

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.15rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

.conversation-header h3 {
    font-size: 1.08rem;
    font-weight: 700;
}

.count-pill {
    background: #f1f5f9;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 4px;
}

.message-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem 1.2rem;
    background: #ffffff;
}

.message-item.admin {
    background: #f0f9ff;
    border-color: #bae6fd;
    border-left: 4px solid var(--brand-500);
}

.message-item.internal {
    background: #fffbeb;
    border-color: #fde68a;
    border-left: 4px solid #f59e0b;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.55rem;
    font-size: 0.82rem;
}

.message-author {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    color: var(--text-main);
}

.role-tag {
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.role-tag.support {
    background: var(--brand-500);
    color: #ffffff;
}

.role-tag.internal-tag {
    background: #f59e0b;
    color: #ffffff;
}

.message-time {
    color: var(--text-muted);
}

.message-body {
    font-size: 0.94rem;
    line-height: 1.6;
    color: #1e293b;
    white-space: pre-wrap;
}

/* ==================== ZONE DE RÉPONSE & DROPZONE ==================== */

.reply-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1.15rem;
}

.reply-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.reply-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #334155;
}

.reply-tools-admin {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.reply-tools-admin select {
    padding: 0.4rem 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    background: #ffffff;
}

.internal-note-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #b45309;
    background: #fef3c7;
    padding: 0.32rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid #fde68a;
    cursor: pointer;
}

.reply-box textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.93rem;
    resize: vertical;
    background: #ffffff;
}

.reply-box textarea:focus {
    outline: none;
    border-color: var(--brand-500);
}

.reply-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.85rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.reply-attach-action {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.paste-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1.4rem;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dropzone:hover {
    border-color: var(--brand-500);
    background: var(--brand-50);
}

.dropzone-text {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dropzone-icon {
    font-size: 1.8rem;
}

.dropzone-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==================== PIÈCES JOINTES & APERÇU ==================== */

.attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.65rem;
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.65rem;
    font-size: 0.82rem;
    box-shadow: var(--shadow-sm);
}

.attachment-item img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 4px;
}

.attachment-remove-btn {
    border: none;
    background: #fee2e2;
    color: #dc2626;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
}

.message-attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.85rem;
}

.message-attachment {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-width: 240px;
}

.message-attachment a {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand-600);
    text-decoration: none;
    word-break: break-all;
}

.message-attachment a:hover {
    text-decoration: underline;
}

.message-attachment img {
    max-width: 210px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 5px;
    cursor: zoom-in;
    border: 1px solid #e2e8f0;
}

/* ==================== COLONNE LATÉRALE TICKET ==================== */

.side-info-card h3,
.side-admin-card h3 {
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border-color);
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-key {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.info-val {
    font-size: 0.9rem;
    color: var(--text-main);
    word-break: break-word;
}

/* ==================== TEMPLATES & UTILISATEURS ADMIN ==================== */

.templates-grid-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 1.35rem;
    align-items: start;
}

.templates-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.template-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.25rem;
    background: #f8fafc;
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.template-title {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.98rem;
}

.template-actions {
    display: flex;
    gap: 0.4rem;
}

.template-content {
    font-size: 0.88rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    line-height: 1.5;
}

.users-table-wrapper {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.users-table th,
.users-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background: #f8fafc;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

/* ==================== EMPTY STATE, TOAST & LIGHTBOX ==================== */

.empty-state {
    background: var(--bg-surface);
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.empty-state h3 {
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.toast {
    background: var(--navy-900);
    color: #ffffff;
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    font-weight: 500;
    border-left: 4px solid var(--brand-500);
    min-width: 280px;
    max-width: 400px;
    animation: slideIn 0.2s ease;
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.success {
    border-left-color: var(--success);
}

@keyframes slideIn {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 11, 22, 0.85);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 82vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: #0f172a;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.lightbox-caption {
    color: #e2e8f0;
    margin-top: 0.65rem;
    font-size: 0.9rem;
}

/* ==================== MAINTENANCE, TÉLÉMAINTENANCE & ENVIRONNEMENT ==================== */

.maintenance-alert-banner {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: var(--radius-md);
    padding: 1.15rem 1.35rem;
    margin-bottom: 1.25rem;
    color: #92400e;
    box-shadow: var(--shadow-sm);
}

.maint-title {
    font-weight: 800;
    font-size: 1rem;
    color: #b45309;
    margin-bottom: 0.35rem;
}

.maint-return {
    margin-top: 0.45rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: #78350f;
}

.portal-maintenance-strip {
    background: #fef3c7;
    border-bottom: 2px solid #f59e0b;
    color: #92400e;
    padding: 0.6rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
}

.maintenance-toggle-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1.15rem 1.35rem;
}

.switch-toggle {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 28px;
    flex-shrink: 0;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    transition: 0.25s;
    border-radius: 34px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.25s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-toggle input:checked + .switch-slider {
    background-color: #f59e0b;
}

.switch-toggle input:checked + .switch-slider:before {
    transform: translateX(26px);
}

.remote-tools-box {
    margin: 1rem 0.4rem 0.5rem;
    padding: 0.9rem;
    background: rgba(0, 150, 255, 0.08);
    border: 1px solid rgba(0, 150, 255, 0.22);
    border-radius: var(--radius-md);
}

.remote-tools-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #38bdf8;
    margin-bottom: 0.3rem;
}

.remote-tools-box p {
    font-size: 0.73rem;
    color: #94a3b8;
    line-height: 1.35;
    margin-bottom: 0.65rem;
}

.remote-links {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.remote-dl-btn {
    flex: 1;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.38rem 0.4rem;
    border-radius: 5px;
    text-decoration: none;
    color: #ffffff;
    transition: opacity 0.15s ease;
}

.remote-dl-btn:hover {
    opacity: 0.88;
}

.remote-dl-btn.anydesk { background: #ef443b; }
.remote-dl-btn.teamviewer { background: #0e8ee9; }
.remote-dl-btn.rustdesk { background: #059669; }

.tech-env-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 4px solid var(--brand-500);
    border-radius: var(--radius-md);
    padding: 1.15rem 1.25rem 0.4rem;
    margin-bottom: 1.2rem;
}

.tech-env-header {
    margin-bottom: 0.9rem;
}

.tech-env-header strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text-main);
}

.tech-env-header span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.remote-status-box {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.85rem;
}

.remote-id-active {
    background: #f0f9ff;
    border: 1px solid #7dd3fc;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.remote-id-code {
    font-family: monospace;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--navy-900);
    letter-spacing: 1px;
}

.remote-action-row {
    display: flex;
    gap: 0.4rem;
}

/* ==================== BASE DE CONNAISSANCES (FAQ) & SUGGESTIONS ==================== */

.kb-articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.15rem;
}

.kb-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kb-card:hover {
    border-color: var(--brand-500);
    box-shadow: var(--shadow-md);
}

.kb-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.kb-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.35;
}

.kb-card-content {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
    white-space: pre-wrap;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 0.95rem 1.1rem;
    border: 1px solid #e2e8f0;
}

.kb-suggestions-box {
    margin-top: 0.65rem;
    background: #f0f9ff;
    border: 1px solid #7dd3fc;
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
}

.kb-suggestions-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 0.5rem;
}

.kb-suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-top: 1px solid rgba(2, 132, 199, 0.15);
    font-size: 0.85rem;
}

.kb-suggestion-item:first-of-type {
    border-top: none;
}

/* ==================== ÉVALUATION CSAT 1-5 ÉTOILES ==================== */

.csat-box {
    margin-top: 1.25rem;
    padding: 1.2rem 1.35rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
}

.csat-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 0.35rem;
}

.csat-stars-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.65rem 0;
}

.csat-star-btn {
    border: 1px solid #fcd34d;
    background: #ffffff;
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    font-size: 1.15rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.csat-star-btn:hover,
.csat-star-btn.selected {
    background: #f59e0b;
    color: #ffffff;
    border-color: #d97706;
    transform: scale(1.06);
}

.csat-comment-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    background: #ffffff;
    margin-bottom: 0.65rem;
}

/* ==================== FACTURATION & PAIEMENT SUR TICKET ==================== */

.billing-banner {
    margin-top: 1.25rem;
    padding: 1.25rem 1.4rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.billing-banner.pending {
    background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
    border: 2px solid var(--brand-500);
}

.billing-banner.paid {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #10b981;
}

.billing-banner-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.billing-ref-tag {
    font-family: monospace;
    font-size: 0.76rem;
    font-weight: 800;
    color: #0369a1;
    text-transform: uppercase;
}

.billing-banner.paid .billing-ref-tag {
    color: #047857;
}

.billing-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.billing-amount-big {
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--brand-600);
}

.billing-banner.paid .billing-amount-big {
    color: #059669;
}

.billing-actions-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.payment-modal-card {
    background: #ffffff;
    width: 100%;
    max-width: 460px;
    border-radius: var(--radius-lg);
    padding: 1.85rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    text-align: left;
}

.payment-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.15rem;
}

.payment-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.payment-summary-banner {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 1rem 1.15rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.pay-modal-price {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--brand-600);
    white-space: nowrap;
}

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

@media (max-width: 1080px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ticket-detail-grid,
    .templates-grid-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    .auth-split {
        grid-template-columns: 1fr;
    }
    .auth-brand-panel {
        padding: 2rem;
    }
    .portal-wrapper {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .ticket-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .ticket-card-right {
        width: 100%;
        align-items: flex-start;
    }
}
