/* ParkTi — Styles communs */
:root {
    --green:      #1D9E75;
    --green-light:#E1F5EE;
    --green-dark: #0F6E56;
    --orange:     #EF9F27;
    --orange-light:#FAEEDA;
    --red:        #E24B4A;
    --red-light:  #FCEBEB;
    --gray-50:    #F8F9FA;
    --gray-100:   #F1F3F4;
    --gray-200:   #E8EAED;
    --gray-400:   #9AA0A6;
    --gray-600:   #5F6368;
    --gray-800:   #3C4043;
    --text:       #202124;
    --border:     #DADCE0;
    --white:      #FFFFFF;
    --radius:     8px;
    --radius-lg:  12px;
    --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--gray-50);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Boutons ───────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer;
    border: 1px solid transparent; text-decoration: none;
    transition: background .15s, opacity .15s;
    min-height: 40px;
}
.btn-primary   { background: var(--green); color: #fff; border-color: var(--green-dark); }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: var(--white); color: var(--gray-800); border-color: var(--border); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-danger    { background: var(--red-light); color: #7F1D1D; border-color: #FECACA; }
.btn-danger:hover { background: #FEE2E2; }
.btn-sm        { padding: 6px 12px; font-size: 13px; min-height: 34px; }
.btn-full      { width: 100%; justify-content: center; }

/* ── Formulaires ───────────────────────────────────────── */
.form-group    { margin-bottom: 16px; }
.form-label    { display: block; font-size: 13px; font-weight: 500; color: var(--gray-600); margin-bottom: 5px; }
.form-control  {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 15px; background: var(--white);
    transition: border-color .15s; outline: none;
}
.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,158,117,.12); }
.form-error    { font-size: 13px; color: var(--red); margin-top: 4px; }

/* ── Cartes ─────────────────────────────────────────────── */
.card {
    background: var(--white); border-radius: var(--radius-lg);
    border: 1px solid var(--border); padding: 20px;
}
.card-sm { padding: 14px 16px; }

/* ── Badges statut ─────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 8px; border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge-libre    { background: var(--gray-100); color: var(--gray-600); }
.badge-actif    { background: var(--green-light); color: var(--green-dark); }
.badge-depass   { background: var(--orange-light); color: #92400E; }
.badge-signale  { background: var(--red-light); color: #7F1D1D; }

/* ── Alertes ────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px; }
.alert-error   { background: var(--red-light); color: #7F1D1D; border-left: 3px solid var(--red); }
.alert-success { background: var(--green-light); color: var(--green-dark); border-left: 3px solid var(--green); }
.alert-info    { background: #EFF6FF; color: #1E40AF; border-left: 3px solid #3B82F6; }

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th { padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 500;
           color: var(--gray-600); border-bottom: 1px solid var(--border); background: var(--gray-50); }
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--gray-100); }
tbody tr:hover td { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

/* ── Layout mairie / backoffice ─────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; background: var(--white); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; flex-shrink: 0;
    position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100;
}
.sidebar-logo {
    padding: 18px 20px 14px; font-size: 18px; font-weight: 700;
    color: var(--green); border-bottom: 1px solid var(--border); letter-spacing: -.3px;
}
.sidebar-logo span { font-weight: 400; font-size: 11px; color: var(--gray-400); display: block; margin-top: 2px; }
.nav-section { padding: 14px 12px 4px; font-size: 11px; font-weight: 500;
               color: var(--gray-400); text-transform: uppercase; letter-spacing: .06em; }
.nav-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 12px; border-radius: var(--radius); margin: 1px 8px;
    color: var(--gray-600); text-decoration: none; font-size: 14px;
    transition: background .12s, color .12s;
}
.nav-item:hover    { background: var(--gray-100); color: var(--text); }
.nav-item.active   { background: var(--green-light); color: var(--green-dark); font-weight: 500; }
.nav-item svg      { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer    { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); }

.main-content { margin-left: 220px; flex: 1; padding: 24px; max-width: 100%; }

.page-header { margin-bottom: 20px; }
.page-title  { font-size: 20px; font-weight: 600; color: var(--text); }
.page-sub    { font-size: 14px; color: var(--gray-600); margin-top: 2px; }

/* ── Stats rapides ──────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 12px; margin-bottom: 20px; }
.stat-box   { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; }
.stat-box .val { font-size: 26px; font-weight: 600; line-height: 1; }
.stat-box .lbl { font-size: 12px; color: var(--gray-600); margin-top: 3px; }
.stat-box.green .val { color: var(--green); }
.stat-box.red .val   { color: var(--red); }
.stat-box.orange .val { color: var(--orange); }

/* ── Places grille ──────────────────────────────────────── */
.places-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 10px; }
.place-card  {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 14px; position: relative;
    border-left-width: 4px;
}
.place-card.libre    { border-left-color: var(--gray-200); }
.place-card.actif    { border-left-color: var(--green); }
.place-card.depassement { border-left-color: var(--orange); }
.place-card.signale  { border-left-color: var(--red); }
.place-code  { font-size: 13px; font-weight: 600; color: var(--text); }
.place-immat { font-size: 12px; color: var(--gray-600); margin: 3px 0; }
.place-time  { font-size: 11px; color: var(--gray-400); }
.place-dep   { font-size: 12px; font-weight: 600; color: var(--red); margin-top: 4px; }

/* ── Responsive mobile ──────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; }
    .places-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid  { grid-template-columns: 1fr 1fr; }
    .mob-menu-btn { display: flex !important; }
}
.mob-topbar {
    display: none;
    position: sticky; top: 0; z-index: 90;
    background: var(--white); border-bottom: 1px solid var(--border);
    padding: 10px 16px; align-items: center; justify-content: space-between;
}
.mob-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
@media (max-width: 768px) {
    .mob-topbar { display: flex; }
}
.overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.35); z-index: 99;
}
.overlay.show { display: block; }
