/* CRM Dixie — Dark Cyber Neon palette */
:root {
    --teal:        #00C8D4;
    --teal-dark:   #009aa3;
    --bg:          #060f1a;
    --bg-card:     #0A192F;
    --bg-sidebar:  #07111f;
    --text:        #e2e8f0;
    --text-muted:  #64748b;
    --border:      #1e2d45;
    --danger:      #ef4444;
    --warning:     #f59e0b;
    --success:     #22c55e;
    --radius:      8px;
    --shadow:      0 2px 12px rgba(0,200,212,.08);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

/* ---- Layout ---- */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    font-size: 1.3rem;
    color: var(--teal);
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.sidebar-user {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-menu li { margin-bottom: .2rem; }

.nav-menu a {
    display: block;
    padding: .5rem .75rem;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(0,200,212,.12);
    color: var(--teal);
}

.nav-separator {
    border-top: 1px solid var(--border);
    margin: .75rem 0;
}

.main-content {
    margin-left: 220px;
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
}

.page-header h1 {
    font-size: 1.6rem;
    color: var(--teal);
    margin-bottom: 1.5rem;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--teal);
}

/* ---- KPI grid ---- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--teal);
    line-height: 1.2;
}

.kpi-label {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .25rem;
}

/* ---- Table ---- */
.table {
    width: 100%;
    border-collapse: collapse;
}

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

.table th {
    background: rgba(0,200,212,.06);
    color: var(--teal);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.table tr:hover td { background: rgba(0,200,212,.04); }

.table a {
    color: var(--teal);
    text-decoration: none;
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: .2em .6em;
    border-radius: 4px;
    font-size: .75rem;
    background: rgba(0,200,212,.15);
    color: var(--teal);
}

.badge-role { background: rgba(100,116,139,.2); color: var(--text-muted); }

/* ---- Formulaires ---- */
.form-group { margin-bottom: 1.1rem; }

label {
    display: block;
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: .35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    background: #0d1e33;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: .55rem .85rem;
    font-size: .95rem;
    transition: border-color .15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0,200,212,.15);
}

/* ---- Boutons ---- */
.btn {
    display: inline-block;
    padding: .55rem 1.2rem;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity .15s, transform .1s;
    text-decoration: none;
}

.btn:hover { opacity: .88; transform: translateY(-1px); }

.btn-primary {
    background: var(--teal);
    color: #000;
}

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

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

.btn-logout {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: .4rem .8rem;
    border-radius: var(--radius);
    cursor: pointer;
    width: 100%;
    margin-top: 1rem;
}

.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ---- Alertes ---- */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: .9rem;
}

.alert-danger  { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: #fca5a5; }
.alert-warning { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: #fcd34d; }
.alert-success { background: rgba(34,197,94,.1);  border: 1px solid rgba(34,197,94,.3);  color: #86efac; }

/* ---- Login ---- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    font-size: 1.5rem;
    color: var(--teal);
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .5rem;
    border-radius: 4px;
    font-size: .85rem;
    text-decoration: none;
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: background .1s, color .1s;
}

.page-btn:hover { background: rgba(0,200,212,.12); color: var(--teal); border-color: var(--teal); }
.page-btn.active { background: var(--teal); color: #000; border-color: var(--teal); font-weight: 600; }

.page-gap { color: var(--text-muted); padding: 0 .2rem; }
.page-info { color: var(--text-muted); font-size: .8rem; margin-left: .5rem; }

/* ---- Utilitaires ---- */
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex { display: flex; }
.gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
