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

body {
    font-family: "Segoe UI", sans-serif;
    background: #0b0f1a;
    color: #e5e7eb;
}

/* HEADER */
.header {
    background: rgba(10, 14, 30, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: bold;
    font-size: 20px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav a {
    margin: 0 15px;
    text-decoration: none;
    color: #cbd5f5;
    font-weight: 500;
}

.nav a:hover {
    color: #a855f7;
}

/* CONTAINER */
.container {
    padding: 30px;
}

/* CARDS */
.card {
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 40px rgba(168,85,247,0.15);
}

/* GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* STATS */
.stat {
    text-align: center;
}

.stat h2 {
    font-size: 40px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    text-align: left;
}

table th {
    color: #9ca3af;
    font-weight: 500;
}

table tr:hover {
    background: rgba(255,255,255,0.02);
}

/* BUTTON */
.btn {
    padding: 8px 15px;
    border-radius: 6px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #fff;
    text-decoration: none;
    display: inline-block;
    border: none;
    transition: 0.3s;
}

.btn:hover {
    opacity: 0.9;
}

/* STATUS */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.badge.green { 
    background: rgba(34,197,94,0.15); 
    color: #22c55e; 
}

.badge.orange { 
    background: rgba(251,191,36,0.15); 
    color: #fbbf24; 
}

.badge.red { 
    background: rgba(239,68,68,0.15); 
    color: #ef4444; 
}

/* LOGIN PAGE */
.auth-container {
    display: flex;
    height: 100vh;
}

.auth-left {
    flex: 1;
    background: radial-gradient(circle at top, #1e1b4b, #0b0f1a);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 40px;
}

.auth-left h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.auth-left p {
    opacity: 0.8;
}

.auth-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0f1a;
}

.auth-box {
    width: 350px;
    background: rgba(255,255,255,0.03);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
}

.auth-box h2 {
    margin-bottom: 20px;
}

.auth-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    background: rgba(255,255,255,0.02);
    color: #fff;
}

.auth-box input::placeholder {
    color: #888;
}

.auth-box button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #a855f7, #6366f1);
    border: none;
    color: white;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.auth-box button:hover {
    opacity: 0.9;
}

.auth-error {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

.auth-footer {
    text-align: center;
    margin-top: 15px;
}

.auth-footer a {
    color: #a855f7;
    text-decoration: none;
    font-weight: 500;
}

.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}

.card .btn {
    margin-top: auto;
    align-self: flex-start;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #9ca3af;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
    color: #fff;
    outline: none;
    transition: 0.2s;
}

.form-control:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 2px rgba(168,85,247,0.2);
}

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

.form-container {
    max-width: 600px;
    margin: auto;
}

.badge.open {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.badge.pending {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
}

.badge.closed {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

/* ===== TICKETS LAYOUT ===== */
.ticket-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
}

/* SIDEBAR */
.ticket-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* MESSAGES */
.ticket-message {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    position: relative;
    transition: 0.2s;
}

.ticket-message.client {
    background: rgba(168,85,247,0.08);
    border: 1px solid rgba(168,85,247,0.25);
}

.ticket-message.admin {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

/* HEADER MESSAGE */
.ticket-header {
    font-size: 13px;
    color: #9ca3af;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

/* CONTENU MESSAGE */
.ticket-message div:last-child {
    line-height: 1.5;
}

/* REPLY BOX */
.ticket-reply textarea {
    width: 100%;
    margin-bottom: 10px;
}

/* ACTION BUTTON (close) */
.ticket-sidebar .btn {
    width: 100%;
    text-align: center;
}

/* BADGES STATUT (upgrade visuel) */
.badge.open {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}

.badge.pending {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
}

.badge.closed {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}

/* HOVER MESSAGE */
.ticket-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(168,85,247,0.1);
}

.ticket-message {
    padding: 15px 18px;
    border-radius: 12px;
    margin-bottom: 15px;
    max-width: 75%;
}

/* CLIENT (droite) */
.ticket-message.client {
    background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(99,102,241,0.1));
    border: 1px solid rgba(168,85,247,0.3);
    margin-left: auto;
}

/* ADMIN (gauche) */
.ticket-message.admin {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    margin-right: auto;
}

.ticket-header {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.ticket-content {
    font-size: 14px;
    line-height: 1.6;
}

/* INPUT PLUS PRO */
textarea.form-control {
    min-height: 120px;
    border-radius: 10px;
}