@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #334155;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

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

/* Navbar */
.navbar {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand i { color: var(--accent); }

.nav-links { display: flex; gap: 1.5rem; }

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active { color: var(--accent); }

.user-menu { display: flex; align-items: center; gap: 1rem; }

.avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border); }

.logout {
    color: var(--danger);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.logout:hover { background: rgba(239, 68, 68, 0.1); }

/* Layout */
.container { max-width: 1200px; margin: 2rem auto; padding: 0 1.5rem; }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.title { font-size: 1.5rem; font-weight: 700; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

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

.icon-blue { background: rgba(99, 102, 241, 0.1); color: var(--accent); }
.icon-green { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.icon-orange { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.icon-red { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.stat-info h3 { font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; }
.stat-info p { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }

/* Table & Lists */
.card {
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-responsive { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    padding: 1rem 1.5rem;
    background: rgba(0,0,0,0.2);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-primary);
}

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

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.status-ouvert { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.status-fermé { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.status-en-attente { background: rgba(245, 158, 11, 0.1); color: var(--warning); }

.type-badge { background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid var(--border); }

/* Buttons & Filters */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

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

.filter-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.empty-state {
    padding: 4rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }

/* Tickets Grid (Dashboard) */
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.ticket-card {
    background: var(--bg-card);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}

.ticket-card:hover { transform: translateY(-2px); }

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.ticket-id {
    font-family: monospace;
    color: var(--accent);
    font-weight: 600;
    font-size: 1.1rem;
}

.ticket-type {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    color: var(--text-secondary);
}

.ticket-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.ticket-info div { margin-bottom: 0.25rem; }
.ticket-info strong { color: var(--text-primary); }

.ticket-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.view-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 0.5rem;
    background: var(--accent);
    color: white;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background 0.2s;
}

.view-btn:hover { background: var(--accent-hover); }

.section {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    margin-bottom: 3rem;
}

.no-tickets {
    text-align: center;
    padding: 3rem;
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

/* Mobile */
@media (max-width: 768px) {
    .navbar { padding: 1rem; }
    .nav-links { display: none; }
    .stats-grid { grid-template-columns: 1fr; }
    td, th { padding: 1rem; }
    .section-header { flex-direction: column; align-items: flex-start; }
}