/* ==========================================================================
   ZATIS — Surcharge AdminLTE v2 / Bootstrap 3
   ==========================================================================
   Basé sur la charte graphique Zatis v1.0.
   À charger APRÈS bootstrap.css et AdminLTE.css (et après le skin choisi,
   ex. skin-blue.css), dans le layout par défaut de l'application.

   Structure de ce fichier :
     1. Polices
     2. Variables (custom properties)
     3. Base & typographie
     4. Back-office AdminLTE — structure (header, sidebar, footer)
     5. Back-office AdminLTE — composants (box, boutons, formulaires,
        tableaux, badges/labels, alertes, modales, pagination,
        small-box / info-box, page de connexion)
     6. Utilitaires (statuts, monospace, etc.)
     7. Responsive / mobile pour le back-office
     8. Espace client (portail public, mobile-first)

   NB : les couleurs sont posées en variables CSS ; un navigateur ne
   supportant pas les custom properties (IE11) retombera sur les valeurs
   codées en dur ci-dessous à chaque règle, donc aucune dépendance dure.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Polices
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* --------------------------------------------------------------------------
   2. Variables
   -------------------------------------------------------------------------- */
:root {
  /* Marque */
  --z-ink:        #0B2545;
  --z-blue:       #105BAC;
  --z-blue-light: #3E85D6;
  --z-blue-dark:  #0C4685;
  --z-sky:        #E1F3FF;
  --z-paper:      #FAFBFC;
  --z-slate:      #57708A;
  --z-line:       #D8E3EE;

  /* Statuts fonctionnels */
  --z-green:      #1E8E5A;
  --z-green-bg:   #E7F5EC;
  --z-amber:      #C97A1A;
  --z-amber-bg:   #FBF0DE;
  --z-red:        #C4432E;
  --z-red-bg:     #FBE9E5;

  /* Typographie */
  --z-font-display: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
  --z-font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;
  --z-font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  /* Rayon / ombres communs */
  --z-radius:     10px;
  --z-radius-lg:  14px;
  --z-shadow:     0 1px 2px rgba(11,37,69,0.06), 0 1px 1px rgba(11,37,69,0.04);
}

/* --------------------------------------------------------------------------
   3. Base & typographie
   -------------------------------------------------------------------------- */
body {
  font-family: var(--z-font-body);
  color: var(--z-ink);
  background: var(--z-paper);
}

h1, h2, h3, h4, h5, h6,
.box-title,
.content-header > h1,
.login-box-msg,
.navbar-brand,
.main-header .logo {
  font-family: var(--z-font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--z-ink);
}

a {
  color: var(--z-blue);
}
a:hover,
a:focus {
  color: var(--z-blue-dark);
}

/* champs de données (plaques, n° de contrôle, montants, codes promo) */
.z-mono,
.text-mono,
td.plate,
.plate-number,
.promo-code {
  font-family: var(--z-font-mono);
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   4. Back-office — structure
   -------------------------------------------------------------------------- */

/* Barre supérieure */
.main-header {
  box-shadow: var(--z-shadow);
}
.main-header .navbar {
  background: var(--z-ink) !important;
}
.main-header .logo {
  background: var(--z-ink) !important;
  color: #fff !important;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-weight: 800;
}
.main-header .logo:hover {
  background: #0E2E58 !important;
}
.main-header .navbar-toggle {
  color: #fff;
}
.main-header .navbar .nav > li > a {
  color: #CBDFF5;
}
.main-header .navbar .nav > li > a:hover,
.main-header .navbar .nav > li > a:focus {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.main-header .navbar .sidebar-toggle {
  color: #CBDFF5;
}
.main-header .navbar .sidebar-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}

/* Barre latérale */
.main-sidebar,
.left-side {
  background: var(--z-ink);
}
.sidebar-menu > li.header {
  color: #7FA3CC;
  background: transparent;
  font-family: var(--z-font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 20px 8px;
}
.sidebar-menu > li > a {
  color: #C7D9EC;
  border-left: 3px solid transparent;
}
.sidebar-menu > li > a:hover,
.sidebar-menu > li.active > a,
.sidebar-menu > li:hover > a {
  background: #0E3765;
  color: #fff;
  border-left-color: var(--z-blue-light);
}
.sidebar-menu > li.treeview.active > a,
.sidebar-menu > li.treeview.menu-open > a {
  background: #0E3765;
  color: #fff;
}
.sidebar-menu .treeview-menu > li > a {
  color: #A9C3DE;
}
.sidebar-menu .treeview-menu > li.active > a,
.sidebar-menu .treeview-menu > li > a:hover {
  color: #fff;
}
.sidebar-menu > li > a > .fa,
.sidebar-menu > li > a > .glyphicon,
.sidebar-menu > li > a > .ion {
  color: #7FA3CC;
}
.sidebar-menu > li.active > a > .fa,
.sidebar-menu > li:hover > a > .fa {
  color: var(--z-blue-light);
}
.user-panel > .info,
.user-panel > .info > a {
  color: #fff;
}
.sidebar-form input[type="text"] {
  background: #0E2E58;
  border-color: #164A82;
  color: #fff;
}
.sidebar-form .btn {
  background: #0E2E58;
  border-color: #164A82;
  color: #A9C3DE;
}

/* Sous-menus (treeview) : les items enfants doivent être visuellement
   indentés par rapport à leur parent, quel que soit leur niveau. */
.sidebar-menu li.treeview > .treeview-menu {
  padding-left: 0;
}
.sidebar-menu .treeview-menu > li > a {
  padding-left: 38px;
}
.sidebar-menu .treeview-menu .treeview-menu > li > a {
  padding-left: 58px;
}
.sidebar-menu .treeview-menu > li > a > .fa,
.sidebar-menu .treeview-menu > li > a > .fas,
.sidebar-menu .treeview-menu > li > a > .far,
.sidebar-menu .treeview-menu > li > a > .glyphicon,
.sidebar-menu .treeview-menu > li > a > .ion {
  display: inline-block;
  width: 20px;
  text-align: center;
}

/* Zone de contenu */
.content-wrapper,
.right-side {
  background: var(--z-paper);
}
.content-header > h1 small {
  color: var(--z-slate);
}
.breadcrumb {
  background: #fff;
  border: 1px solid var(--z-line);
  border-radius: var(--z-radius);
}
.breadcrumb > li + li::before {
  color: var(--z-line);
}
.breadcrumb > .active {
  color: var(--z-slate);
}

/* Pied de page */
.main-footer {
  background: #fff;
  border-top: 1px solid var(--z-line);
  color: var(--z-slate);
  font-size: 12.5px;
}

/* --------------------------------------------------------------------------
   5. Back-office — composants
   -------------------------------------------------------------------------- */

/* Boîtes (.box) */
.box {
  border-radius: var(--z-radius-lg);
  border-top: none;
  box-shadow: var(--z-shadow);
  border: 1px solid var(--z-line);
}
.box.box-solid.box-primary,
.box.box-primary {
  border-top: none;
}
.box-header {
  padding: 18px 20px;
}
.box-header.with-border {
  border-bottom: 1px solid var(--z-line);
}
.box-title {
  font-size: 16px;
  font-weight: 700;
}
.box-body {
  padding: 20px;
}
.box-footer {
  background: var(--z-paper);
  border-top: 1px solid var(--z-line);
}
.box.box-primary {
  border-top: 3px solid var(--z-blue);
}
.box.box-success { border-top: 3px solid var(--z-green); }
.box.box-warning { border-top: 3px solid var(--z-amber); }
.box.box-danger  { border-top: 3px solid var(--z-red); }

/* Boutons */
.btn {
  font-family: var(--z-font-body);
  font-weight: 600;
  border-radius: 8px;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--z-blue);
  border-color: var(--z-blue);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: var(--z-blue-dark);
  border-color: var(--z-blue-dark);
}
.btn-default {
  background: #fff;
  border: 1.5px solid var(--z-blue);
  color: var(--z-blue);
}
.btn-default:hover,
.btn-default:focus {
  background: var(--z-sky);
  color: var(--z-blue-dark);
  border-color: var(--z-blue-dark);
}
.btn-success {
  background: var(--z-green);
  border-color: var(--z-green);
}
.btn-warning {
  background: var(--z-amber);
  border-color: var(--z-amber);
}
.btn-danger {
  background: var(--z-red);
  border-color: var(--z-red);
}
.btn-link {
  color: var(--z-blue);
}

/* Formulaires */
.form-control {
  border-radius: 8px;
  border: 1px solid var(--z-line);
  box-shadow: none;
  font-family: var(--z-font-body);
}
.form-control:focus {
  border-color: var(--z-blue-light);
  box-shadow: 0 0 0 3px rgba(16,91,172,0.12);
}
label {
  font-weight: 600;
  color: var(--z-ink);
  font-size: 13.5px;
}
.input-group-addon {
  background: var(--z-paper);
  border: 1px solid var(--z-line);
  color: var(--z-slate);
}
.has-error .form-control {
  border-color: var(--z-red);
}
.has-error .help-block,
.has-error .control-label {
  color: var(--z-red);
}
.has-success .form-control {
  border-color: var(--z-green);
}

/* Tableaux / DataTables */
.table > thead > tr > th {
  border-bottom: 1px solid var(--z-line);
  color: var(--z-slate);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  background: var(--z-paper);
}
.table > tbody > tr > td {
  border-top: 1px solid var(--z-line);
  vertical-align: middle;
}
.table-hover > tbody > tr:hover {
  background: var(--z-sky);
}
.table-bordered {
  border: 1px solid var(--z-line);
}
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td {
  border: 1px solid var(--z-line);
}
div.dataTables_wrapper .dataTables_filter input,
div.dataTables_wrapper .dataTables_length select {
  border-radius: 8px;
  border: 1px solid var(--z-line);
}
div.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--z-blue) !important;
  border-color: var(--z-blue) !important;
  color: #fff !important;
}

/* Badges / labels de statut — vocabulaire métier (contrôle, paiement, sms) */
.label {
  font-weight: 600;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
}
.label-primary { background: var(--z-blue); }
.label-default { background: #EEF2F6; color: var(--z-slate); }
.label-success,
.z-badge-ok {
  background: var(--z-green-bg);
  color: var(--z-green);
}
.label-warning,
.z-badge-pending {
  background: var(--z-amber-bg);
  color: var(--z-amber);
}
.label-danger,
.z-badge-ko {
  background: var(--z-red-bg);
  color: var(--z-red);
}
.badge {
  background: var(--z-blue);
  border-radius: 20px;
}

/* Alertes / callouts */
.alert {
  border-radius: var(--z-radius);
  border: 1px solid transparent;
}
.alert-success { background: var(--z-green-bg); color: var(--z-green); border-color: #C9E7D6; }
.alert-warning { background: var(--z-amber-bg); color: var(--z-amber); border-color: #F0DCB6; }
.alert-danger  { background: var(--z-red-bg);   color: var(--z-red);   border-color: #F0CFC7; }
.alert-info    { background: var(--z-sky);      color: var(--z-blue-dark); border-color: #C6E3FA; }
.callout {
  border-radius: var(--z-radius);
}

/* Modales */
.modal-content {
  border-radius: var(--z-radius-lg);
  border: none;
  box-shadow: 0 12px 32px rgba(11,37,69,0.18);
}
.modal-header {
  border-bottom: 1px solid var(--z-line);
  padding: 18px 22px;
}
.modal-title {
  font-family: var(--z-font-display);
  font-weight: 700;
}
.modal-footer {
  border-top: 1px solid var(--z-line);
}

/* Pagination générique */
.pagination > li > a,
.pagination > li > span {
  color: var(--z-blue);
  border-color: var(--z-line);
}
.pagination > .active > a,
.pagination > .active > span {
  background: var(--z-blue);
  border-color: var(--z-blue);
}

/* Petites boîtes / info-box de tableau de bord */
.small-box {
  border-radius: var(--z-radius-lg);
  box-shadow: var(--z-shadow);
}
.small-box.bg-aqua,
.small-box.bg-blue    { background: var(--z-blue) !important; }
.small-box.bg-green   { background: var(--z-green) !important; }
.small-box.bg-yellow  { background: var(--z-amber) !important; }
.small-box.bg-red     { background: var(--z-red) !important; }
.small-box h3, .small-box p {
  font-family: var(--z-font-display);
}
.info-box {
  border-radius: var(--z-radius-lg);
  box-shadow: var(--z-shadow);
  border: 1px solid var(--z-line);
}
.info-box-icon {
  background: var(--z-sky);
  color: var(--z-blue);
  border-radius: var(--z-radius-lg) 0 0 var(--z-radius-lg);
}
.info-box-number {
  font-family: var(--z-font-display);
  font-weight: 700;
  color: var(--z-ink);
}

/* Page de connexion */
.login-page,
.register-page {
  background: var(--z-sky);
}
.login-box, .register-box {
  margin-top: 8%;
}
.login-logo, .register-logo {
  font-family: var(--z-font-display);
  font-weight: 800;
  color: var(--z-ink);
}
.login-box-body, .register-box-body {
  border-radius: var(--z-radius-lg);
  box-shadow: 0 12px 32px rgba(11,37,69,0.12);
  border: none;
}
.login-box-msg {
  font-weight: 600;
  color: var(--z-slate);
}

/* --------------------------------------------------------------------------
   6. Utilitaires
   -------------------------------------------------------------------------- */
.z-text-slate { color: var(--z-slate); }
.z-text-blue  { color: var(--z-blue); }
.z-bg-sky     { background: var(--z-sky); }
.z-divider {
  height: 1px;
  background: var(--z-line);
  border: none;
  margin: 20px 0;
}
/* puce de statut (point coloré devant un badge) */
.z-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
}
.z-dot.ok      { background: var(--z-green); }
.z-dot.pending { background: var(--z-amber); }
.z-dot.ko      { background: var(--z-red); }

/* --------------------------------------------------------------------------
   7. Responsive / mobile — back-office
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* on ne garde que le symbole en en-tête sur mobile, le mot "zatis" prend
     trop de place à côté du bouton de menu */
  .main-header .logo .logo-lg { display: none; }
  .main-header .logo .logo-mini { display: block; }

  .content-header > h1 {
    font-size: 20px;
  }
  .box-header, .box-body, .box-footer {
    padding: 14px 16px;
  }

  /* cibles tactiles plus grandes */
  .btn {
    padding: 10px 16px;
    font-size: 14px;
  }
  .sidebar-menu > li > a {
    padding: 14px 16px;
  }

  /* tableaux : défilement horizontal contrôlé plutôt qu'un tableau tassé */
  .table-responsive {
    border: 1px solid var(--z-line);
    border-radius: var(--z-radius);
  }

  /* action principale d'un formulaire fixée en bas de l'écran, à portée
     du pouce (ex. "Enregistrer le contrôle") */
  .z-mobile-action-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    border-top: 1px solid var(--z-line);
    padding: 10px 14px;
    display: flex;
    gap: 10px;
    z-index: 900;
  }
  .z-mobile-action-bar .btn {
    flex: 1;
    margin: 0;
  }
}

@media (min-width: 768px) {
  .z-mobile-action-bar { display: none; }
}

/* --------------------------------------------------------------------------
   8. Espace client — portail public (mobile-first)
   --------------------------------------------------------------------------
   Ce module habille les pages destinées au propriétaire de véhicule
   (consultation de l'échéance de contrôle, historique, reçu de paiement).
   Il ne dépend pas d'AdminLTE : à utiliser sur un layout public distinct,
   sans sidebar ni sidebar-toggle. Toutes les classes sont préfixées
   `zc-` (Zatis Client) pour ne jamais entrer en collision avec AdminLTE.
   -------------------------------------------------------------------------- */

.zc-body {
  background: var(--z-paper);
  font-family: var(--z-font-body);
  color: var(--z-ink);
  padding-bottom: 72px; /* place pour la barre de navigation mobile */
}

.zc-header {
  background: var(--z-ink);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 800;
}
.zc-header .zc-logo {
  height: 26px;
}
.zc-header .zc-title {
  font-family: var(--z-font-display);
  font-weight: 700;
  font-size: 16px;
}

.zc-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 0;
}

/* carte de statut principale — la première chose vue par le client */
.zc-status-card {
  background: #fff;
  border: 1px solid var(--z-line);
  border-radius: var(--z-radius-lg);
  box-shadow: var(--z-shadow);
  padding: 22px;
  margin-bottom: 16px;
}
.zc-status-card .zc-plate {
  font-family: var(--z-font-mono);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.zc-status-card .zc-owner {
  color: var(--z-slate);
  font-size: 13.5px;
  margin-top: 2px;
}
.zc-status-card .zc-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-weight: 600;
  font-size: 14.5px;
}
.zc-status-card.ok      { border-left: 4px solid var(--z-green); }
.zc-status-card.pending { border-left: 4px solid var(--z-amber); }
.zc-status-card.ko      { border-left: 4px solid var(--z-red); }

/* liste type "historique des contrôles" */
.zc-card {
  background: #fff;
  border: 1px solid var(--z-line);
  border-radius: var(--z-radius);
  padding: 16px;
  margin-bottom: 12px;
}
.zc-card .zc-card-title {
  font-weight: 600;
  font-size: 14.5px;
}
.zc-card .zc-card-meta {
  color: var(--z-slate);
  font-size: 12.5px;
  margin-top: 4px;
}

/* boutons client — cibles tactiles généreuses */
.zc-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 14px 18px;
  border-radius: 10px;
  font-family: var(--z-font-body);
  font-weight: 600;
  font-size: 15px;
  border: none;
  text-decoration: none;
}
.zc-btn-primary {
  background: var(--z-blue);
  color: #fff;
}
.zc-btn-primary:hover, .zc-btn-primary:focus {
  background: var(--z-blue-dark);
  color: #fff;
}
.zc-btn-ghost {
  background: #fff;
  border: 1.5px solid var(--z-blue);
  color: var(--z-blue);
}

/* barre de navigation mobile (bas d'écran) — équivalent client du sidebar */
.zc-tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid var(--z-line);
  display: flex;
  z-index: 900;
}
.zc-tabbar a {
  flex: 1;
  text-align: center;
  padding: 10px 4px 8px;
  color: var(--z-slate);
  font-size: 11px;
  text-decoration: none;
}
.zc-tabbar a .zc-tab-icon {
  display: block;
  font-size: 18px;
  margin-bottom: 3px;
}
.zc-tabbar a.active {
  color: var(--z-blue);
}

/* au-delà du mobile, l'espace client se recentre dans une largeur de
   lecture confortable et la barre du bas disparaît au profit d'un pied
   de page classique */
@media (min-width: 768px) {
  .zc-body { padding-bottom: 0; }
  .zc-container { max-width: 560px; padding-top: 32px; }
  .zc-tabbar { display: none; }
}

/* --------------------------------------------------------------------------
   9. En-tête — lisibilité du logo & nom du tenant
   -------------------------------------------------------------------------- */

/* Le logo du tenant (ou de Zatis) est déposé sur l'en-tête bleu nuit
   (--z-ink). Quelle que soit sa couleur (souvent bleu foncé, donc illisible),
   on lui pose une pastille claire arrondie qui garantit le contraste. */
.main-header .logo > img {
  max-height: 38px;
  width: auto;
  background: #fff;
  padding: 3px 9px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Nom du tenant affiché dans la barre supérieure, à côté du bouton menu :
   repère permanent de l'espace de travail courant. */
.main-header .navbar > .navbar-tenant {
  float: left;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 50px;
  padding: 0 16px;
  color: #fff;
  font-family: var(--z-font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.01em;
  max-width: 38vw;
  border-left: 1px solid rgba(255,255,255,0.10);
}
.main-header .navbar > .navbar-tenant > i {
  color: var(--z-blue-light);
  font-size: 15px;
  flex-shrink: 0;
}
.main-header .navbar > .navbar-tenant .navbar-tenant-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .main-header .navbar > .navbar-tenant {
    max-width: 42vw;
    padding: 0 10px;
    font-size: 13px;
  }
  .main-header .navbar > .navbar-tenant > i { display: none; }
}
