/* 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;
}

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

/* CARD */
.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;

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

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

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

/* 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;
}

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

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

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

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

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

.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;
    border-radius: 10px;
}

/* 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-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    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;
}

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

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

.ticket-sidebar .btn {
    width: 100%;
    text-align: center;
}

/* MESSAGE */
.ticket-message {
    padding: 15px 18px;
    border-radius: 12px;
    margin-bottom: 15px;
    max-width: 75%;
    transition: 0.2s;
}

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

/* CLIENT */
.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 */
.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;
}

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

/* ===== GLOBAL ===== */
.page-header {
    margin-bottom: 25px;
}

.page-title {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

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

/* ===== CARD UPGRADE ===== */
.card {
    background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border-radius: 14px;
    padding: 22px;
    border: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    transition: all 0.25s ease;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 45px rgba(168,85,247,0.15);
}

/* ===== STATS ===== */
.stat h2 {
    font-size: 38px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat p {
    color: #9ca3af;
    font-size: 14px;
}

/* ===== TABLE ===== */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}

table th,
table td {
    padding: 14px 12px;
}

table tr {
    transition: 0.2s;
}

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

/* ===== BADGES ===== */
.badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

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

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

/* ===== BUTTON ===== */
.btn {
    padding: 9px 16px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: #fff;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(124,58,237,0.35);
}

/* ===== SECONDARY BUTTON ===== */
.btn.secondary {
    background: rgba(255,255,255,0.05);
    color: #cbd5f5;
}

.btn.secondary:hover {
    background: rgba(255,255,255,0.08);
}

/* ===== CARD HEADER (factures) ===== */
.card h3 {
    font-size: 16px;
    font-weight: 600;
}

/* ===== PREMIUM BLOCK ===== */
.card.premium {
    background: linear-gradient(135deg,#2563eb,#1e3a8a);
    color: white;
    border: none;
    box-shadow: 0 15px 50px rgba(37,99,235,0.3);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .page-title {
        font-size: 22px;
    }
}