/* ============================================================
   SISSYL — Feuille de styles principale
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
    --sissyl-primary:   #0d6efd;
    --sissyl-dark:      #1a1a2e;
    --sidebar-width:    260px;
    --sidebar-bg:       #1e2130;
    --font-family:      'Tajawal', system-ui, -apple-system, sans-serif;
}

/* ── Base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font-family);
    font-size: 15px;
    color: #212529;
    background: #f4f6fb;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg) !important;
    flex-shrink: 0;
    transition: width .25s ease;
    overflow: hidden;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

#sidebar .nav-link {
    font-size: .9rem;
    padding: .45rem .75rem;
    transition: background .15s, color .15s;
    border-radius: 6px;
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
    background: rgba(255,255,255,.12);
    color: #fff !important;
}

#sidebar .sidebar-brand {
    min-height: 64px;
}

/* ── Wrapper ─────────────────────────────────────────────────── */
#wrapper {
    min-height: 100vh;
}

#page-content {
    min-width: 0;
    overflow-x: hidden;
}

/* ── Navbar top ───────────────────────────────────────────────── */
.navbar {
    min-height: 56px;
    z-index: 100;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,.07);
    font-weight: 600;
}

/* ── Stat cards (dashboard) ──────────────────────────────────── */
.stat-card {
    border-left: 4px solid var(--sissyl-primary);
    transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* ── Tables ──────────────────────────────────────────────────── */
.table th {
    font-weight: 600;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6c757d;
}

.table > :not(caption) > * > * {
    padding: .75rem 1rem;
}

/* ── Badges statut ───────────────────────────────────────────── */
.badge-CONFIRMEE, .badge-ACTIF    { background: #198754 !important; }
.badge-ANNULEE, .badge-INACTIF    { background: #dc3545 !important; }
.badge-EN_ATTENTE_PAIEMENT        { background: #fd7e14 !important; }
.badge-HOLD                       { background: #6f42c1 !important; }
.badge-EXPIREE                    { background: #6c757d !important; }
.badge-SUSPENDU                   { background: #ffc107 !important; color: #000 !important; }
.badge-PROGRAMME                  { background: #0dcaf0 !important; color: #000 !important; }
.badge-OUVERT                     { background: #198754 !important; }
.badge-COMPLET                    { background: #dc3545 !important; }

/* ── Formulaires ─────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--sissyl-primary);
    box-shadow: 0 0 0 .2rem rgba(13,110,253,.15);
}

/* ── RTL adjustments ─────────────────────────────────────────── */
[dir="rtl"] #sidebar .nav-link i {
    margin-right: 0 !important;
    margin-left: .5rem;
}

[dir="rtl"] .stat-card {
    border-left: none;
    border-right: 4px solid var(--sissyl-primary);
}

[dir="rtl"] .input-group-text { border-left: 0; border-right: 1px solid #dee2e6; }
[dir="rtl"] .input-group > .form-control:not(:last-child) { border-right: 0; border-left: 1px solid #dee2e6; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    [dir="rtl"] #sidebar {
        transform: translateX(100%);
    }
    #sidebar.show {
        transform: translateX(0) !important;
    }
    #page-content {
        width: 100%;
    }
}

/* ── Plan de sièges ──────────────────────────────────────────── */
.seat-map {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}
.seat-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.seat-aisle { width: 24px; }
.seat-btn {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.seat-btn.available  { background: #e9f7ef; border-color: #198754; color: #198754; }
.seat-btn.selected   { background: #0d6efd; border-color: #0a58ca; color: #fff; }
.seat-btn.occupied   { background: #f8d7da; border-color: #dc3545; color: #dc3545; cursor: not-allowed; }
.seat-btn.hold       { background: #fff3cd; border-color: #fd7e14; color: #fd7e14; cursor: not-allowed; }
.seat-btn.unavailable{ background: #e9ecef; border-color: #ced4da; color: #adb5bd; cursor: not-allowed; }
.seat-btn.driver     { background: #dee2e6; border-color: #adb5bd; color: #6c757d; cursor: default; }

/* Le plan de sièges ne s'inverse PAS en RTL — réalité physique */
.seat-map { direction: ltr !important; }
