/* ─── DESIGN TOKENS ─── */
:root {
  --bg:       #f7f9fc;
  --white:    #ffffff;
  --navy:     #0f2342;
  --blue:     #1a6bbd;
  --sky:      #2d9cdb;
  --orange:   #f47c20;
  --text:     #1a2a3a;
  --muted:    #6b7e96;
  --border:   #e3eaf3;
  --light:    #eef4fb;
  --green:    #16a34a;
  --green-bg: #dcfce7;
  --red:      #dc2626;
  --red-bg:   #fee2e2;
  --amber:    #d97706;
  --amber-bg: #fef3c7;
  --purple:   #7c3aed;
  --purple-bg:#ede9fe;
  --shadow-sm: 0 1px 3px rgba(15,35,66,.06), 0 1px 2px rgba(15,35,66,.04);
  --shadow-md: 0 4px 16px rgba(15,35,66,.08), 0 2px 6px rgba(15,35,66,.04);
  --shadow-lg: 0 8px 40px rgba(15,35,66,.10), 0 2px 8px rgba(15,35,66,.04);
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-full: 9999px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── APP SHELL — Sidebar + Layout ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Reset & tokens déjà dans auth.css — on importe uniquement le shell */
:root {
  --sidebar-w: 240px;
  --topbar-h: 60px;
}

/* ─── SHELL ─── */
.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.sb-header {
  padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sb-logo {
  font-size: 20px; font-weight: 800; color: #fff;
  letter-spacing: -.3px; text-decoration: none; display: block;
}
.sb-logo span { color: var(--orange); }
.sb-logo-img { display: block; text-decoration: none; }
.sb-logo-img img { max-width: 200px; object-fit: contain; display: block; }
.sb-depot {
  margin-top: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex; align-items: center; gap: 8px;
}
.sb-depot-icon { font-size: 15px; color: var(--orange); }
.sb-depot-icon .material-symbols-outlined { font-size: 15px; }
.sb-depot-name { font-size: 12px; font-weight: 600; color: #c5ddf5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-depot-loc  { font-family: 'JetBrains Mono', monospace; font-size: 9px; color: #4a7da8; margin-top: 1px; }

.sb-nav { flex: 1; padding: 12px 8px; }
.sb-section-label {
  font-size: 9px; font-weight: 700; color: #4a7da8;
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 10px 10px 4px;
}
.sb-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #7fadd4;
  cursor: pointer; text-decoration: none;
  transition: all .15s; margin-bottom: 2px;
  position: relative;
}
.sb-item .material-symbols-outlined { font-size: 18px; flex-shrink: 0; }
.sb-item:hover { background: rgba(255,255,255,.06); color: #c5ddf5; }
.sb-item.active { background: rgba(244,124,32,.15); color: #fff; }
.sb-item.active .material-symbols-outlined { color: var(--orange); }
.sb-badge {
  margin-left: auto;
  background: var(--orange); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}
.sb-badge.red { background: var(--red); }

.sb-footer {
  padding: 12px 8px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  cursor: pointer; transition: background .15s;
}
.sb-user:hover { background: rgba(255,255,255,.06); }
.sb-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(26,107,189,.3);
  border: 1.5px solid rgba(26,107,189,.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #c5ddf5;
  flex-shrink: 0;
}
.sb-user-name { font-size: 12px; font-weight: 700; color: #c5ddf5; }
.sb-user-role { font-size: 10px; color: #4a7da8; margin-top: 1px; }
.sb-user-arrow { margin-left: auto; color: #4a7da8; }
.sb-user-arrow .material-symbols-outlined { font-size: 16px; }
.sb-footer { position: relative; }
.sb-user-menu {
  position: absolute; bottom: calc(100% + 4px); left: 8px; right: 8px;
  background: #1a2f4e; border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; overflow: hidden;
  box-shadow: 0 -4px 16px rgba(0,0,0,.3);
}
.sb-user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 13px; font-weight: 500;
  color: #c5ddf5; text-decoration: none; transition: background .15s;
}
.sb-user-menu-item:hover { background: rgba(255,255,255,.06); }
.sb-user-menu-item .material-symbols-outlined { font-size: 17px; }
.sb-user-menu-item.logout { color: #fca5a5; border-top: 1px solid rgba(255,255,255,.08); }
.sb-user-menu-item.logout:hover { background: rgba(220,38,38,.15); }

/* ─── MAIN CONTENT ─── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── TOPBAR ─── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted);
}
.topbar-breadcrumb .sep { color: var(--border); }
.topbar-breadcrumb .current { color: var(--navy); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; position: relative;
  text-decoration: none;
}
.topbar-icon-btn:hover { background: var(--light); border-color: #c8dff5; }
.topbar-icon-btn .material-symbols-outlined { font-size: 18px; color: var(--muted); }
.topbar-notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--orange); border: 1.5px solid var(--white);
}
.topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: #c5ddf5;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; cursor: pointer;
  border: 2px solid var(--border); transition: border-color .15s;
}
.topbar-avatar:hover { border-color: var(--sky); }
.topbar-user-menu { position: relative; }
.topbar-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  min-width: 220px; z-index: 60; overflow: hidden;
}
.topbar-dropdown-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.topbar-dropdown-name { font-size: 13px; font-weight: 700; color: var(--navy); }
.topbar-dropdown-email { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }
.topbar-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--text); text-decoration: none; transition: background .1s;
}
.topbar-dropdown-item:hover { background: var(--bg); }
.topbar-dropdown-item .material-symbols-outlined { font-size: 17px; color: var(--muted); }
.topbar-dropdown-item.logout { color: var(--red); border-top: 1px solid var(--border); }
.topbar-dropdown-item.logout .material-symbols-outlined { color: var(--red); }
.topbar-dropdown-item.logout:hover { background: var(--red-bg); }

/* ─── PAGE CONTENT ─── */
.page-content { padding: 32px; flex: 1; }

.page-header-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.page-title-group {}
.page-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; color: var(--orange); margin-bottom: 4px;
}
.page-title {
  font-size: 24px; font-weight: 800; color: var(--navy);
  letter-spacing: -.3px; margin-bottom: 4px;
}
.page-sub { font-size: 13px; color: var(--muted); }
.page-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

/* ─── BUTTONS (app) ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--r-md);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; font-weight: 700;
  cursor: pointer; border: none; transition: all .15s;
  text-decoration: none; white-space: nowrap;
}
.btn .material-symbols-outlined { font-size: 16px; }
.btn-primary   { background: var(--orange); color: #fff; }
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-secondary { background: var(--navy); color: #fff; }
.btn-secondary:hover { opacity: .88; }
.btn-outline   { background: var(--white); color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--sky); color: var(--sky); }
.btn-ghost     { background: var(--light); color: var(--blue); border: 1px solid #c8dff5; }
.btn-ghost:hover { background: #dceffe; }
.btn-danger    { background: var(--red-bg); color: var(--red); border: 1px solid #fca5a5; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-sm .material-symbols-outlined { font-size: 14px; }
.btn-icon { padding: 7px; }

/* ─── CARDS ─── */
.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  background: var(--bg); display: flex; align-items: center; justify-content: space-between;
}
.card-title {
  font-size: 14px; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}
.card-title .material-symbols-outlined { font-size: 17px; color: var(--orange); }
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px; border-top: 1px solid var(--border);
  background: var(--bg); display: flex; align-items: center; justify-content: space-between;
}

/* ─── STATS ROW ─── */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon .material-symbols-outlined { font-size: 20px; }
.stat-val { font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1; }
.stat-lbl { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }

/* ─── FILTERS BAR ─── */
.filters-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-wrap .material-symbols-outlined {
  position: absolute; top: 50%; left: 10px; transform: translateY(-50%);
  font-size: 16px; color: var(--muted); pointer-events: none;
}
.search-input {
  width: 100%; padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; color: var(--text); background: var(--white);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search-input::placeholder { color: #adb8c5; }
.search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,107,189,.10); }

.filter-select {
  padding: 8px 32px 8px 12px; border: 1.5px solid var(--border);
  border-radius: var(--r-md); font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; color: var(--text); background: var(--white);
  outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7e96' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color .15s;
}
.filter-select:focus { border-color: var(--blue); }
.filters-count { margin-left: auto; font-size: 12px; color: var(--muted); font-family: 'JetBrains Mono', monospace; white-space: nowrap; }

/* ─── TABLE ─── */
.table-wrap { overflow-x: auto; }
.ds-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ds-table thead th {
  background: var(--bg); border-bottom: 1.5px solid var(--border);
  padding: 10px 16px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
  cursor: pointer; user-select: none;
}
.ds-table thead th:hover { color: var(--navy); }
.ds-table thead th .sort-icon { font-size: 13px; vertical-align: middle; opacity: .4; }
.ds-table thead th.sorted .sort-icon { opacity: 1; color: var(--blue); }
.ds-table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
.ds-table tbody tr:last-child { border-bottom: none; }
.ds-table tbody tr:hover { background: var(--bg); }
.ds-table td { padding: 13px 16px; color: var(--text); vertical-align: middle; }

/* User cell */
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.user-email { font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }

/* Role pill */
.role-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.role-pill .material-symbols-outlined { font-size: 12px; }
.role-admin    { background: #fdf2f8; color: #be185d; }
.role-gate     { background: var(--light); color: var(--blue); }
.role-inspect  { background: var(--green-bg); color: var(--green); }
.role-shipping { background: var(--amber-bg); color: var(--amber); }
.role-platform { background: var(--navy); color: #fff; }

/* Status pill */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600;
}
.status-pill .dot { width: 5px; height: 5px; border-radius: 50%; }
.pill-active  { background: var(--green-bg); color: var(--green); }
.pill-active .dot { background: var(--green); }
.pill-inactive { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.pill-inactive .dot { background: var(--muted); }
.pill-pending { background: var(--amber-bg); color: var(--amber); }
.pill-pending .dot { background: var(--amber); }

/* Actions */
.row-actions { display: flex; gap: 6px; align-items: center; }
.action-btn {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s; color: var(--muted);
}
.action-btn:hover { background: var(--light); border-color: #c8dff5; color: var(--blue); }
.action-btn.danger:hover { background: var(--red-bg); border-color: #fca5a5; color: var(--red); }
.action-btn .material-symbols-outlined { font-size: 15px; }

/* Pagination */
.pagination {
  display: flex; align-items: center; gap: 4px;
}
.page-btn {
  min-width: 32px; height: 32px; border-radius: 7px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted);
  transition: all .15s; padding: 0 8px;
}
.page-btn:hover { background: var(--light); border-color: #c8dff5; color: var(--navy); }
.page-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.page-btn .material-symbols-outlined { font-size: 15px; }

/* Empty state */
.empty-state {
  text-align: center; padding: 56px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-icon { font-size: 48px; color: var(--border); }
.empty-icon .material-symbols-outlined { font-size: 48px; }
.empty-title { font-size: 16px; font-weight: 700; color: var(--navy); }
.empty-sub { font-size: 13px; color: var(--muted); max-width: 300px; line-height: 1.6; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,35,66,.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(20px); transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-title {
  font-size: 16px; font-weight: 800; color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}
.modal-title .material-symbols-outlined { font-size: 18px; color: var(--orange); }
.modal-close {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); transition: all .15s;
}
.modal-close:hover { background: var(--red-bg); border-color: #fca5a5; color: var(--red); }
.modal-close .material-symbols-outlined { font-size: 17px; }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  background: var(--bg); display: flex; gap: 10px; justify-content: flex-end;
  position: sticky; bottom: 0;
}

/* ─── FORM (modal) ─── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 12px; font-weight: 700; color: var(--navy);
  letter-spacing: .3px; margin-bottom: 6px;
}
.form-label .req { color: var(--orange); margin-left: 3px; }
.form-control {
  width: 100%; background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--r-md); padding: 9px 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px; color: var(--text);
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.form-control::placeholder { color: #adb8c5; }
.form-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,107,189,.10); }
.form-control.is-error { border-color: var(--red); }
.form-control select { cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error-msg {
  font-size: 11px; color: var(--red); margin-top: 4px;
  display: none; align-items: center; gap: 4px;
}
.form-error-msg.show { display: flex; }
.form-error-msg .material-symbols-outlined { font-size: 13px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.form-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--muted); margin: 20px 0 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

/* Alert in modal */
.modal-alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid; font-size: 12px; line-height: 1.5;
  margin-bottom: 18px; display: none;
}
.modal-alert.show { display: flex; }
.modal-alert.is-error   { background: var(--red-bg);   border-color: #fca5a5; color: var(--red); }
.modal-alert.is-success { background: var(--green-bg); border-color: #86efac; color: var(--green); }
.modal-alert .material-symbols-outlined { font-size: 16px; flex-shrink: 0; }

/* Confirm modal */
.confirm-modal { max-width: 400px; }
.confirm-body { padding: 28px 24px; text-align: center; }
.confirm-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.confirm-icon.danger { background: var(--red-bg); }
.confirm-icon .material-symbols-outlined { font-size: 28px; }
.confirm-icon.danger .material-symbols-outlined { color: var(--red); }
.confirm-title { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.confirm-sub { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* Spinner */
.btn-spinner {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  animation: spin .7s linear infinite; display: none;
}
.btn.loading .btn-label { display: none; }
.btn.loading .btn-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 16px;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--navy);
  min-width: 280px; transform: translateX(120%); transition: transform .3s;
}
.toast.show { transform: translateX(0); }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.success .material-symbols-outlined { color: var(--green); }
.toast.error   .material-symbols-outlined { color: var(--red); }

/* ─── PROFIL PAGE ─── */
.profil-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }

.avatar-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 28px 20px; display: flex; flex-direction: column;
  align-items: center; gap: 16px; position: sticky; top: 84px;
}
.avatar-wrap { position: relative; width: 96px; height: 96px; }
.avatar-circle {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 1px; overflow: hidden;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-btn {
  position: absolute; bottom: 0; right: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--orange); color: #fff;
  border: 2px solid var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s;
}
.avatar-upload-btn:hover { background: #d96c10; }
.avatar-upload-btn .material-symbols-outlined { font-size: 15px; }
#avatarInput { display: none; }
.avatar-name { font-size: 16px; font-weight: 700; color: var(--text); text-align: center; }
.avatar-role {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  background: var(--light); color: var(--blue);
}
.avatar-meta {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%; border-top: 1px solid var(--border); padding-top: 16px;
}
.meta-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.meta-row .material-symbols-outlined { font-size: 16px; }

.activity-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 20px; margin-top: 16px;
}
.activity-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.activity-list { display: flex; flex-direction: column; gap: 12px; }
.activity-item { display: flex; gap: 10px; align-items: flex-start; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); margin-top: 5px; flex-shrink: 0; }
.activity-dot.blue   { background: var(--blue); }
.activity-dot.green  { background: var(--green); }
.activity-dot.orange { background: var(--orange); }
.activity-text { font-size: 12px; color: var(--muted); line-height: 1.5; }
.activity-text strong { color: var(--text); font-weight: 500; }
.activity-time { font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }

/* Profil tabs */
.profil-tabs-nav {
  display: flex; gap: 2px;
  border-bottom: 2px solid var(--border); margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 18px; font-size: 13px; font-weight: 500;
  color: var(--muted); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.tab-btn .material-symbols-outlined { font-size: 18px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Profil section title */
.section-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* Password toggle + strength (profil & reset) */
.pw-wrap { position: relative; }
.pw-wrap .form-control { padding-right: 40px; width: 100%; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted); display: flex; align-items: center; padding: 0;
}
.pw-toggle .material-symbols-outlined { font-size: 18px; }
.pw-toggle:hover { color: var(--text); }
.pw-strength-wrap { display: none; gap: 8px; align-items: center; margin-top: 4px; }
.pw-strength-track { flex: 1; height: 4px; background: var(--border); border-radius: var(--r-full); overflow: hidden; }
.pw-strength-fill { height: 100%; width: 0; border-radius: var(--r-full); transition: width .3s, background .3s; }
.pw-strength-label { font-size: 12px; font-weight: 500; min-width: 60px; }

/* Security rules */
.security-rules { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.rule-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); transition: color .2s; }
.rule-item.ok { color: var(--green); }
.rule-icon {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .2s;
}
.rule-item.ok .rule-icon { border-color: var(--green); background: var(--green); color: #fff; }
.rule-icon .material-symbols-outlined { font-size: 11px; }

/* Toggle switch */
.toggle-group {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.toggle-group:last-child { border-bottom: none; }
.toggle-info { flex: 1; }
.toggle-label { font-size: 13px; font-weight: 500; color: var(--text); }
.toggle-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.toggle-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0; background: var(--border);
  border-radius: var(--r-full); cursor: pointer; transition: background .2s;
}
.toggle-track::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px;
  transition: transform .2s; box-shadow: var(--shadow-sm);
}
.toggle-switch input:checked + .toggle-track { background: var(--blue); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(18px); }

/* Sessions */
.session-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.session-item:last-child { border-bottom: none; }
.session-icon {
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--light); display: flex; align-items: center; justify-content: center;
  color: var(--blue); flex-shrink: 0;
}
.session-icon .material-symbols-outlined { font-size: 20px; }
.session-info { flex: 1; }
.session-name { font-size: 13px; font-weight: 500; color: var(--text); }
.session-meta { font-size: 12px; color: var(--muted); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }
.session-current {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--green);
  background: var(--green-bg); padding: 2px 8px; border-radius: var(--r-full);
}
.session-revoke {
  font-size: 12px; color: var(--red); background: none;
  border: none; cursor: pointer; font-weight: 500;
  padding: 4px 8px; border-radius: var(--r-sm); transition: background .15s;
}
.session-revoke:hover { background: var(--red-bg); }
.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th {
  text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  padding: 10px 12px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.history-table td { padding: 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.history-table tr:last-child td { border-bottom: none; }
.history-table td.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.status-ok   { color: var(--green); font-weight: 600; }
.status-fail { color: var(--red);   font-weight: 600; }
.pref-select {
  height: 40px; padding: 0 12px;
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  font-size: 13px; font-family: inherit; color: var(--text);
  background: var(--white); outline: none; transition: border-color .2s; width: 100%;
}
.pref-select:focus { border-color: var(--blue); }

/* ─── PARCS / GÉO ─── */
.parcs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

.parc-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  overflow: hidden; transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.parc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.parc-map-preview {
  height: 120px; background: linear-gradient(135deg, #0f2342 0%, #1a3a5c 60%, #1a6bbd 100%);
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.parc-map-preview .map-pattern {
  position: absolute; inset: 0; opacity: .07;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 20px, #fff 20px, #fff 21px),
                    repeating-linear-gradient(90deg, transparent, transparent 20px, #fff 20px, #fff 21px);
}
.parc-map-badge {
  position: relative; z-index: 1;
  background: rgba(244,124,32,.9); color: #fff;
  font-size: 20px; font-weight: 800; padding: 8px 16px;
  border-radius: var(--r-md); letter-spacing: 2px;
  font-family: 'JetBrains Mono', monospace;
}
.parc-status-badge {
  position: absolute; top: 10px; right: 10px; z-index: 1;
}
.parc-card-body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 12px; }
.parc-name { font-size: 15px; font-weight: 700; color: var(--navy); }
.parc-location { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.parc-location .material-symbols-outlined { font-size: 14px; }
.parc-mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.parc-stat { text-align: center; padding: 8px 4px; background: var(--bg); border-radius: var(--r-md); }
.parc-stat-val { font-size: 15px; font-weight: 800; color: var(--navy); }
.parc-stat-lbl { font-size: 10px; color: var(--muted); margin-top: 1px; }
.parc-capacity-wrap { display: flex; flex-direction: column; gap: 4px; }
.parc-capacity-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.parc-capacity-label span { font-weight: 600; }
.capacity-track { height: 6px; background: var(--border); border-radius: var(--r-full); overflow: hidden; }
.capacity-fill { height: 100%; border-radius: var(--r-full); transition: width .4s; }
.capacity-fill.low    { background: var(--green); }
.capacity-fill.medium { background: var(--amber); }
.capacity-fill.high   { background: var(--red); }
.parc-card-footer {
  padding: 10px 18px; border-top: 1px solid var(--border);
  background: var(--bg); display: flex; gap: 6px; justify-content: flex-end;
}

/* ─── YARD — Vue graphique ─── */

/* Légende */
.yard-legend {
  display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
  font-size: 12px; align-items: center;
}
.yard-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.yard-legend-dot {
  width: 14px; height: 14px; border-radius: 3px; border: 1px solid;
}

/* Bloc rangée */
.yard-row-block {
  margin-bottom: 16px; background: var(--bg); border-radius: var(--r-md);
  border: 1px solid var(--border); overflow: hidden;
}
.yard-row-header {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  background: var(--navy); color: #fff; font-size: 12px;
}
.yard-row-code {
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px;
}
.yard-row-info {
  color: rgba(255,255,255,.6); font-size: 11px; margin-left: auto;
}
.yard-row-grid {
  display: flex; gap: 8px; padding: 14px; flex-wrap: wrap; align-items: flex-end;
}

/* Stack = 1 position (colonne de tiers) */
.yard-stack {
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.yard-stack-label {
  font-size: 9px; font-weight: 700; font-family: 'JetBrains Mono', monospace;
  color: var(--muted); margin-top: 4px; text-align: center;
}
.yard-stack-tiers {
  display: flex; flex-direction: column; gap: 2px;
}

/* Tier (chaque cellule empilée) */
.yard-tier {
  width: 44px; height: 22px; border-radius: 3px; display: flex;
  align-items: center; justify-content: center; cursor: default;
  font-size: 9px; font-weight: 700; font-family: 'JetBrains Mono', monospace;
  transition: transform .1s, box-shadow .1s; position: relative;
}
.yard-tier:hover { transform: scale(1.12); z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.yard-tier-num { line-height: 1; }

.yard-tier--free     { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.yard-tier--occupied { background: #3b82f6; border: 1px solid #2563eb; color: #fff; cursor: pointer; }
.yard-tier--reserved { background: #fbbf24; border: 1px solid #f59e0b; color: #78350f; }
.yard-tier--blocked  { background: #ef4444; border: 1px solid #dc2626; color: #fff; cursor: not-allowed; }

/* Ancien format (compat) */
.yard-slot {
  width: 36px; height: 36px; border-radius: 4px; display: inline-flex;
  align-items: center; justify-content: center; cursor: default;
  font-size: 10px; font-weight: 700; font-family: 'JetBrains Mono', monospace;
  transition: transform .1s, box-shadow .1s; position: relative;
}
.yard-slot:hover { transform: scale(1.15); z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.yard-slot-pos { line-height: 1; }
.yard-slot--free     { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.yard-slot--occupied { background: #3b82f6; border: 1px solid #2563eb; color: #fff; cursor: pointer; }
.yard-slot--reserved { background: #fbbf24; border: 1px solid #f59e0b; color: #78350f; }
.yard-slot--blocked  { background: #ef4444; border: 1px solid #dc2626; color: #fff; cursor: not-allowed; }

/* Responsive yard */
@media (max-width: 640px) {
  .yard-row-grid { gap: 6px; padding: 10px; }
  .yard-tier { width: 36px; height: 18px; font-size: 8px; }
  .yard-stack-label { font-size: 8px; }
}

/* ─── DÉTAIL PARC ─── */
.detail-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }

.info-list { display: flex; flex-direction: column; gap: 0; }
.info-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.info-item:last-child { border-bottom: none; }
.info-label { color: var(--muted); font-weight: 500; flex-shrink: 0; min-width: 110px; }
.info-value { color: var(--text); font-weight: 600; text-align: right; }
.info-value.mono { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

.gps-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--navy); color: #c5ddf5;
  padding: 4px 10px; border-radius: var(--r-full);
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
}
.gps-tag .material-symbols-outlined { font-size: 13px; color: var(--orange); }

.map-placeholder {
  height: 220px; background: linear-gradient(135deg, #0f2342, #1a3a5c 60%, #1a6bbd);
  border-radius: var(--r-md); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  position: relative; overflow: hidden;
}
.map-placeholder .map-pattern {
  position: absolute; inset: 0; opacity: .05;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 20px, #fff 20px, #fff 21px),
                    repeating-linear-gradient(90deg, transparent, transparent 20px, #fff 20px, #fff 21px);
}
.map-placeholder-icon { font-size: 40px; color: rgba(255,255,255,.3); position: relative; z-index: 1; }
.map-placeholder-icon .material-symbols-outlined { font-size: 40px; }
.map-placeholder-text { color: rgba(255,255,255,.5); font-size: 13px; position: relative; z-index: 1; }

/* ─── CONFIG ZONES ─── */
.zone-type-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.zone-type-pill .material-symbols-outlined { font-size: 12px; }
.zone-stockage   { background: var(--light);      color: var(--blue); }
.zone-transit    { background: #fff7ed;            color: var(--amber); }
.zone-repair     { background: var(--red-bg);      color: var(--red); }
.zone-inspection { background: var(--green-bg);    color: var(--green); }
.zone-dangerous  { background: var(--purple-bg);   color: var(--purple); }
.zone-washing    { background: #f0f9ff;            color: var(--sky); }

.zone-capacity-cell { min-width: 140px; }
.zone-capacity-row { display: flex; flex-direction: column; gap: 4px; }
.zone-capacity-info { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.zone-capacity-info span { font-weight: 600; color: var(--text); }

/* ─── YARD GRID ─── */
.yard-zone-tabs { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:16px; }
.yard-zone-tab {
  padding:6px 14px; border-radius:var(--r-full);
  font-size:12px; font-weight:600;
  border:1.5px solid var(--border); background:var(--white); color:var(--muted);
  cursor:pointer; transition:all .15s;
}
.yard-zone-tab:hover { border-color:var(--sky); color:var(--blue); }
.yard-zone-tab.active { background:var(--navy); border-color:var(--navy); color:#fff; }

.yard-grid-wrap { overflow-x:auto; padding-bottom:8px; }
.yard-grid { display:inline-grid; gap:3px; }
.yard-cell {
  width:50px; height:50px; border-radius:var(--r-sm);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  font-family:'JetBrains Mono',monospace;
  cursor:pointer; transition:all .15s; border:1.5px solid transparent;
  position:relative; user-select:none;
}
.yard-cell.header-row { background:transparent; border:none; cursor:default; height:24px; font-size:10px; font-weight:700; color:var(--muted); }
.yard-cell.row-label  { background:transparent; border:none; cursor:default; width:32px; font-size:10px; font-weight:700; color:var(--muted); }
.yard-cell.free     { background:var(--green-bg); border-color:#86efac; color:var(--green); }
.yard-cell.occupied { background:var(--light);    border-color:#c8dff5; color:var(--blue); }
.yard-cell.occupied:hover { background:#dceffe; border-color:var(--blue); box-shadow:var(--shadow-sm); transform:scale(1.05); z-index:2; }
.yard-cell.reserved { background:var(--amber-bg); border-color:#fcd34d; color:var(--amber); }
.yard-cell.repair   { background:var(--red-bg);   border-color:#fca5a5; color:var(--red); }
.yard-cell-num  { font-size:9px;  font-weight:800; line-height:1; }
.yard-cell-code { font-size:7px; font-weight:500; line-height:1; margin-top:2px; opacity:.8; overflow:hidden; width:44px; text-align:center; white-space:nowrap; text-overflow:ellipsis; }

.yard-legend { display:flex; gap:16px; align-items:center; flex-wrap:wrap; padding:12px 0; }
.yard-legend-item { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted); }
.yard-legend-dot { width:14px; height:14px; border-radius:3px; border:1.5px solid transparent; }
.yard-legend-dot.free     { background:var(--green-bg); border-color:#86efac; }
.yard-legend-dot.occupied { background:var(--light);    border-color:#c8dff5; }
.yard-legend-dot.reserved { background:var(--amber-bg); border-color:#fcd34d; }
.yard-legend-dot.repair   { background:var(--red-bg);   border-color:#fca5a5; }

/* Tooltip yard */
.yard-tooltip {
  position:absolute; bottom:calc(100% + 8px); left:50%; transform:translateX(-50%);
  background:var(--navy); color:#fff; border-radius:var(--r-md);
  padding:8px 12px; font-size:11px; white-space:nowrap;
  box-shadow:var(--shadow-md); z-index:50; pointer-events:none;
  opacity:0; transition:opacity .15s;
}
.yard-tooltip.show { opacity:1; }
.yard-tooltip::after {
  content:''; position:absolute; top:100%; left:50%; transform:translateX(-50%);
  border:5px solid transparent; border-top-color:var(--navy);
}

/* ─── GATE STEPPER ─── */
.gate-stepper {
  display:flex; align-items:flex-start;
  margin-bottom:32px; position:relative;
}
.gate-step { display:flex; flex-direction:column; align-items:center; flex:1; }
.gate-step-circle {
  width:36px; height:36px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:700; z-index:1;
  border:2px solid var(--border); background:var(--white); color:var(--muted);
  transition:all .2s;
}
.gate-step.done   .gate-step-circle { background:var(--blue);   border-color:var(--blue);   color:#fff; }
.gate-step.active .gate-step-circle { background:var(--orange); border-color:var(--orange); color:#fff; box-shadow:0 0 0 4px rgba(244,124,32,.15); }
.gate-step-label { font-size:11px; font-weight:600; color:var(--muted); margin-top:8px; text-align:center; }
.gate-step.active .gate-step-label { color:var(--orange); }
.gate-step.done   .gate-step-label { color:var(--blue); }
.gate-connector { flex:1; height:2px; background:var(--border); margin-top:18px; transition:background .3s; }
.gate-connector.done { background:var(--blue); }
.gate-view { display:none; }
.gate-view.active { display:block; }

/* ─── MOVEMENT BADGES ─── */
.mvt-badge {
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 10px; border-radius:var(--r-full);
  font-size:11px; font-weight:600; white-space:nowrap;
}
.mvt-badge .material-symbols-outlined { font-size:13px; }
.mvt-in       { background:var(--green-bg); color:var(--green); }
.mvt-out      { background:#fff7ed;         color:var(--amber); }
.mvt-transfer { background:var(--light);    color:var(--blue);  }
.mvt-repair   { background:var(--red-bg);   color:var(--red);   }

/* ─── CONTAINER BADGES ─── */
.cont-size {
  display:inline-flex; align-items:center;
  background:var(--bg); border:1px solid var(--border);
  padding:2px 8px; border-radius:var(--r-full);
  font-size:11px; font-weight:700; color:var(--navy);
  font-family:'JetBrains Mono',monospace;
}
.cont-state { display:inline-flex; align-items:center; padding:2px 8px; border-radius:var(--r-full); font-size:11px; font-weight:600; }
.cont-plein  { background:var(--light);      color:var(--blue);   }
.cont-vide   { background:var(--bg);         color:var(--muted);  border:1px solid var(--border); }
.cont-dang   { background:var(--purple-bg);  color:var(--purple); }

/* ─── TIMELINE ─── */
.timeline { display:flex; flex-direction:column; position:relative; }
.timeline::before {
  content:''; position:absolute;
  left:15px; top:8px; bottom:8px; width:2px; background:var(--border);
}
.timeline-item { display:flex; gap:16px; padding-bottom:20px; position:relative; }
.timeline-item:last-child { padding-bottom:0; }
.timeline-dot {
  width:32px; height:32px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; z-index:1; border:2px solid var(--white);
}
.timeline-dot .material-symbols-outlined { font-size:16px; }
.timeline-dot.in       { background:var(--green-bg); color:var(--green); }
.timeline-dot.out      { background:#fff7ed;         color:var(--amber); }
.timeline-dot.transfer { background:var(--light);    color:var(--blue);  }
.timeline-dot.repair   { background:var(--red-bg);   color:var(--red);   }
.timeline-dot.inspect  { background:var(--green-bg); color:var(--green); }
.timeline-content { flex:1; padding-top:4px; }
.timeline-title { font-size:13px; font-weight:600; color:var(--text); }
.timeline-meta  { font-size:11px; color:var(--muted); margin-top:2px; font-family:'JetBrains Mono',monospace; }
.timeline-detail{ font-size:12px; color:var(--muted); margin-top:4px; line-height:1.5; }

/* ─── SÉJOUR / DURÉE ─── */
.duree-badge {
  display:inline-flex; align-items:center; gap:5px;
  background:var(--bg); border:1px solid var(--border);
  padding:3px 10px; border-radius:var(--r-full);
  font-size:12px; font-weight:700; color:var(--navy);
  font-family:'JetBrains Mono',monospace;
}
.duree-badge.warning { background:var(--amber-bg); border-color:#fcd34d; color:var(--amber); }
.duree-badge.danger  { background:var(--red-bg);   border-color:#fca5a5; color:var(--red);   }

/* ─── SUMMARY CARD (Gate confirmation) ─── */
.summary-card {
  background:var(--bg); border:1px solid var(--border);
  border-radius:var(--r-md); padding:16px;
  display:flex; flex-direction:column; gap:10px;
}
.summary-row { display:flex; justify-content:space-between; align-items:center; font-size:13px; padding:4px 0; border-bottom:1px solid var(--border); }
.summary-row:last-child { border-bottom:none; }
.summary-label { color:var(--muted); font-weight:500; }
.summary-value { color:var(--text); font-weight:700; }
.summary-value.mono { font-family:'JetBrains Mono',monospace; }
.summary-value.ok   { color:var(--green); }
.summary-value.warn { color:var(--amber); }

/* ─── PRINT BUTTON ─── */
.btn-print { background:var(--light); color:var(--blue); border:1.5px solid #c8dff5; }
.btn-print:hover { background:#dceffe; }

/* ─── SCAN INPUT ─── */
.scan-wrap { position:relative; }
.scan-wrap .form-control { padding-left:40px; font-family:'JetBrains Mono',monospace; font-size:15px; font-weight:700; letter-spacing:1px; text-transform:uppercase; }
.scan-icon { position:absolute; left:10px; top:50%; transform:translateY(-50%); color:var(--muted); }
.scan-icon .material-symbols-outlined { font-size:20px; }
.scan-found { border-color:var(--green) !important; box-shadow:0 0 0 3px rgba(22,163,74,.12) !important; }

/* ─── BACK LINK ─── */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  text-decoration: none; margin-bottom: 20px; transition: color .15s;
}
.back-link:hover { color: var(--blue); }
.back-link .material-symbols-outlined { font-size: 18px; }

/* ─── INSPECTIONS — Type pills ─── */
.insp-type-pill {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 10px; border-radius:var(--r-full);
  font-size:11px; font-weight:700;
}
.insp-routine   { background:var(--light);      color:var(--blue);   }
.insp-douane    { background:var(--purple-bg);  color:var(--purple); }
.insp-avant-rep { background:#fff7ed;            color:var(--amber);  }
.insp-apres-rep { background:var(--green-bg);   color:var(--green);  }
.insp-sortie    { background:var(--bg); color:var(--muted); border:1px solid var(--border); }

/* ─── INSPECTIONS — Result pills ─── */
.insp-result-pill {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 10px; border-radius:var(--r-full);
  font-size:11px; font-weight:700;
}
.insp-conforme     { background:var(--green-bg); color:var(--green); }
.insp-non-conforme { background:var(--red-bg);   color:var(--red);   }
.insp-en-cours     { background:var(--amber-bg); color:var(--amber); }

/* ─── CHECKLIST (inspection form) ─── */
.checklist-section { margin-bottom:24px; }
.checklist-section-title {
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.6px;
  color:var(--muted); padding:8px 0; border-bottom:1px solid var(--border);
  margin-bottom:12px;
}
.checklist-item {
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 12px; border:1px solid var(--border); border-radius:var(--r-md);
  margin-bottom:8px; gap:12px; background:var(--white);
}
.checklist-item-label { font-size:13px; font-weight:500; color:var(--text); flex:1; }
.checklist-radio-group { display:flex; gap:6px; flex-shrink:0; }
.checklist-radio {
  display:flex; align-items:center; gap:4px;
  padding:4px 10px; border-radius:var(--r-full);
  border:1.5px solid var(--border); cursor:pointer;
  font-size:11px; font-weight:700; transition:all .15s;
  user-select:none;
}
.checklist-radio input { display:none; }
.checklist-radio.ok:has(input:checked)  { background:var(--green-bg); border-color:var(--green); color:var(--green); }
.checklist-radio.bad:has(input:checked) { background:var(--red-bg);   border-color:var(--red);   color:var(--red);   }
.checklist-radio.na:has(input:checked)  { background:var(--bg);       border-color:var(--muted); color:var(--muted); }

/* ─── RAPPORT INSPECTION ─── */
.rapport-wrap {
  max-width:860px; margin:0 auto;
  background:var(--white); border-radius:var(--r-lg);
  border:1px solid var(--border); box-shadow:var(--shadow-md);
  padding:40px;
}
.rapport-header {
  display:flex; justify-content:space-between; align-items:flex-start;
  padding-bottom:24px; border-bottom:2px solid var(--border); margin-bottom:28px;
}
.rapport-title    { font-size:22px; font-weight:800; color:var(--navy); }
.rapport-subtitle { font-size:13px; color:var(--muted); margin-top:4px; }
.rapport-meta     { text-align:right; }
.rapport-meta-num  { font-size:16px; font-weight:800; color:var(--orange); font-family:'JetBrains Mono',monospace; }
.rapport-meta-date { font-size:12px; color:var(--muted); margin-top:4px; font-family:'JetBrains Mono',monospace; }

.rapport-section { margin-bottom:28px; }
.rapport-section-title {
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.6px;
  color:var(--muted); padding-bottom:8px; border-bottom:2px solid var(--border);
  margin-bottom:16px; display:flex; align-items:center; gap:6px;
}
.rapport-section-title .material-symbols-outlined { font-size:15px; }

.rapport-info-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.rapport-info-item { padding:10px 14px; background:var(--bg); border-radius:var(--r-md); }
.rapport-info-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); }
.rapport-info-value { font-size:14px; font-weight:700; color:var(--text); margin-top:2px; }
.rapport-info-value.mono { font-family:'JetBrains Mono',monospace; }

.rapport-checklist-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 12px; border-bottom:1px solid var(--border); font-size:12px;
}
.rapport-checklist-row:last-child { border-bottom:none; }
.rapport-checklist-label  { color:var(--text); flex:1; }
.rapport-checklist-result { font-weight:700; min-width:110px; text-align:right; }
.rapport-checklist-result.ok  { color:var(--green); }
.rapport-checklist-result.bad { color:var(--red);   }
.rapport-checklist-result.na  { color:var(--muted); }

.rapport-result-banner {
  padding:16px 20px; border-radius:var(--r-md);
  display:flex; align-items:center; gap:14px; margin-bottom:24px;
}
.rapport-result-banner.ok  { background:var(--green-bg); border:2px solid #86efac; }
.rapport-result-banner.bad { background:var(--red-bg);   border:2px solid #fca5a5; }
.rapport-result-banner .material-symbols-outlined { font-size:30px; }
.rapport-result-banner.ok  .material-symbols-outlined { color:var(--green); }
.rapport-result-banner.bad .material-symbols-outlined { color:var(--red);   }
.rapport-result-label { font-size:16px; font-weight:800; }
.rapport-result-banner.ok  .rapport-result-label { color:var(--green); }
.rapport-result-banner.bad .rapport-result-label { color:var(--red);   }
.rapport-result-sub { font-size:12px; color:var(--muted); margin-top:2px; }

.rapport-signatures { display:grid; grid-template-columns:1fr 1fr; gap:24px; margin-top:8px; }
.rapport-sign-box {
  border:1.5px dashed var(--border); border-radius:var(--r-md);
  padding:20px 20px 14px; min-height:96px;
  display:flex; flex-direction:column; justify-content:flex-end;
}
.rapport-sign-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); border-top:1px solid var(--border); padding-top:8px; margin-top:12px; }

/* ─── RÉPARATIONS — Priorité pills ─── */
.rep-priority-pill {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 10px; border-radius:var(--r-full);
  font-size:11px; font-weight:700;
}
.rep-haute   { background:var(--red-bg);   color:var(--red);   }
.rep-moyenne { background:var(--amber-bg); color:var(--amber); }
.rep-basse   { background:var(--light);    color:var(--blue);  }

/* ─── RÉPARATIONS — Statut pills ─── */
.rep-status-pill {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 10px; border-radius:var(--r-full);
  font-size:11px; font-weight:700;
}
.rep-en-cours   { background:var(--light);    color:var(--blue);  }
.rep-terminee   { background:var(--green-bg); color:var(--green); }
.rep-en-attente { background:var(--amber-bg); color:var(--amber); }

/* ─── RÉPARATIONS — Progress bar ─── */
.rep-progress { height:6px; background:var(--border); border-radius:3px; overflow:hidden; }
.rep-progress-fill { height:100%; border-radius:3px; transition:width .3s; }
.rep-progress-fill.low  { background:var(--red);   }
.rep-progress-fill.mid  { background:var(--amber); }
.rep-progress-fill.high { background:var(--green); }

/* ─── RÉPARATIONS — Pièces table ─── */
.pieces-table { width:100%; border-collapse:collapse; font-size:12px; }
.pieces-table th { text-align:left; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); padding:8px 10px; border-bottom:2px solid var(--border); }
.pieces-table td { padding:8px 10px; border-bottom:1px solid var(--border); }
.pieces-table tr:last-child td { border-bottom:none; }
.pieces-total { font-weight:800; color:var(--navy); }

/* ─── TRANSPORTEURS — Statut ─── */
.transp-badge {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 10px; border-radius:var(--r-full);
  font-size:11px; font-weight:700;
}
.transp-actif   { background:var(--green-bg); color:var(--green); }
.transp-inactif { background:var(--bg); color:var(--muted); border:1px solid var(--border); }

/* ─── TRANSPORTEURS — Rating stars ─── */
.rating-stars { display:inline-flex; gap:2px; color:var(--amber); }
.rating-stars .material-symbols-outlined { font-size:16px; }
.rating-stars .empty { color:var(--border); }

/* ─── TRANSPORTEURS — Véhicules ─── */
.vehicule-list { display:flex; flex-direction:column; gap:8px; }
.vehicule-card {
  display:flex; align-items:center; gap:12px;
  padding:12px; background:var(--bg); border-radius:var(--r-md); border:1px solid var(--border);
}
.vehicule-icon {
  width:38px; height:38px; border-radius:var(--r-md);
  display:flex; align-items:center; justify-content:center;
  background:var(--light); color:var(--blue);
}
.vehicule-icon .material-symbols-outlined { font-size:20px; }
.vehicule-info { flex:1; }
.vehicule-plate { font-family:'JetBrains Mono',monospace; font-size:13px; font-weight:700; color:var(--navy); }
.vehicule-type  { font-size:11px; color:var(--muted); }
.vehicule-status { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; }
.vehicule-status.actif       { color:var(--green); }
.vehicule-status.maintenance { color:var(--amber); }
.vehicule-status.inactif     { color:var(--muted); }

/* ─── GED / DOCUMENTS ─── */
.doc-type-pill {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 10px; border-radius:var(--r-full);
  font-size:11px; font-weight:700;
}
.doc-bl          { background:var(--light);     color:var(--blue);   }
.doc-autorisation{ background:var(--green-bg);  color:var(--green);  }
.doc-certificat  { background:var(--purple-bg); color:var(--purple); }
.doc-facture     { background:#fff7ed;           color:var(--amber);  }
.doc-autre       { background:var(--bg);         color:var(--muted); border:1px solid var(--border); }

.doc-preview-zone {
  min-height:420px; background:var(--bg); border:2px dashed var(--border);
  border-radius:var(--r-lg); display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:12px; color:var(--muted);
}
.doc-preview-zone .material-symbols-outlined { font-size:48px; opacity:.4; }
.doc-preview-title { font-size:14px; font-weight:700; }
.doc-preview-sub   { font-size:12px; }

.doc-file-size {
  font-family:'JetBrains Mono',monospace; font-size:11px;
  color:var(--muted); font-weight:500;
}

/* ─── TARIFICATION ─── */
.tarif-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr));
  gap:16px;
}
.tarif-card {
  background:var(--white); border:1.5px solid var(--border);
  border-radius:var(--r-md); padding:20px; transition:border-color .15s, box-shadow .15s;
}
.tarif-card:hover { border-color:var(--blue); box-shadow:var(--shadow-sm); }
.tarif-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.tarif-card-title { font-size:14px; font-weight:800; color:var(--navy); }
.tarif-card-size  { font-family:'JetBrains Mono',monospace; font-size:12px; font-weight:700; padding:2px 8px; background:var(--bg); border-radius:var(--r-full); color:var(--navy); }
.tarif-price {
  font-family:'JetBrains Mono',monospace; font-size:24px; font-weight:800;
  color:var(--orange); margin-bottom:4px;
}
.tarif-price-sub { font-size:11px; color:var(--muted); margin-bottom:14px; }
.tarif-detail { display:flex; flex-direction:column; gap:6px; }
.tarif-detail-row { display:flex; justify-content:space-between; font-size:12px; padding:4px 0; border-bottom:1px solid var(--border); }
.tarif-detail-row:last-child { border-bottom:none; }
.tarif-detail-label { color:var(--muted); }
.tarif-detail-value { font-weight:700; color:var(--text); font-family:'JetBrains Mono',monospace; }

/* ─── FACTURATION ─── */
.fact-status-pill {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 10px; border-radius:var(--r-full);
  font-size:11px; font-weight:700;
}
.fact-payee    { background:var(--green-bg); color:var(--green); }
.fact-attente  { background:var(--amber-bg); color:var(--amber); }
.fact-retard   { background:var(--red-bg);   color:var(--red);   }
.fact-annulee  { background:var(--bg);       color:var(--muted); border:1px solid var(--border); }

.fact-amount {
  font-family:'JetBrains Mono',monospace; font-size:13px;
  font-weight:800; color:var(--navy);
}

.fact-lines-table { width:100%; border-collapse:collapse; font-size:12px; }
.fact-lines-table th {
  text-align:left; font-size:10px; font-weight:700; text-transform:uppercase;
  letter-spacing:.5px; color:var(--muted); padding:10px 14px; border-bottom:2px solid var(--border);
}
.fact-lines-table td { padding:10px 14px; border-bottom:1px solid var(--border); }
.fact-lines-table tr:last-child td { border-bottom:none; }
.fact-total-row td { font-weight:800; color:var(--navy); background:var(--bg); }

/* ─── DASHBOARD ─── */
.dash-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:20px; }
.dash-chart-box {
  background:var(--white); border:1.5px solid var(--border); border-radius:var(--r-md);
  padding:20px; min-height:260px; display:flex; flex-direction:column;
}
.dash-chart-title {
  font-size:13px; font-weight:700; color:var(--navy); margin-bottom:16px;
  display:flex; align-items:center; gap:8px;
}
.dash-chart-title .material-symbols-outlined { font-size:17px; color:var(--orange); }
.dash-chart-area { flex:1; display:flex; align-items:flex-end; gap:6px; padding-top:8px; }
.dash-bar {
  flex:1; border-radius:4px 4px 0 0; transition:height .4s ease;
  position:relative; cursor:default;
}
.dash-bar:hover { opacity:.85; }
.dash-bar-label {
  position:absolute; bottom:-20px; left:50%; transform:translateX(-50%);
  font-size:9px; color:var(--muted); white-space:nowrap;
}
.dash-bar-val {
  position:absolute; top:-18px; left:50%; transform:translateX(-50%);
  font-size:10px; font-weight:700; color:var(--navy); white-space:nowrap;
}
.dash-donut-wrap { flex:1; display:flex; align-items:center; justify-content:center; gap:24px; }
.dash-donut {
  width:140px; height:140px; border-radius:50%;
  position:relative; display:flex; align-items:center; justify-content:center;
}
.dash-donut-center {
  position:absolute; text-align:center;
}
.dash-donut-center .big { font-size:22px; font-weight:800; color:var(--navy); display:block; }
.dash-donut-center .sub { font-size:10px; color:var(--muted); }
.dash-legend { display:flex; flex-direction:column; gap:8px; }
.dash-legend-item { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--text); }
.dash-legend-dot { width:10px; height:10px; border-radius:50%; flex-shrink:0; }
.dash-activity-list { display:flex; flex-direction:column; gap:0; }
.dash-activity-item {
  display:flex; align-items:flex-start; gap:12px; padding:12px 0;
  border-bottom:1px solid var(--border); font-size:13px;
}
.dash-activity-item:last-child { border-bottom:none; }
.dash-activity-icon {
  width:32px; height:32px; border-radius:var(--r-full); display:flex;
  align-items:center; justify-content:center; flex-shrink:0; font-size:16px;
}
.dash-activity-text { flex:1; }
.dash-activity-time { font-size:11px; color:var(--muted); flex-shrink:0; }

/* ─── GPS MAP ─── */
.map-layout {
  display:grid; grid-template-columns:320px 1fr; gap:16px;
}
.map-parc-sidebar {
  height:calc(100vh - 200px); min-height:500px;
  overflow-y:auto; display:flex; flex-direction:column; gap:12px;
  padding-right:4px;
}
.map-parc-sidebar::-webkit-scrollbar { width:5px; }
.map-parc-sidebar::-webkit-scrollbar-track { background:transparent; }
.map-parc-sidebar::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }
.map-parc-sidebar::-webkit-scrollbar-thumb:hover { background:var(--muted); }
.map-container {
  width:100%; height:calc(100vh - 200px); min-height:500px;
  border-radius:var(--r-md); overflow:hidden; border:1.5px solid var(--border);
}
.map-toolbar {
  display:flex; align-items:center; gap:12px; margin-bottom:16px; flex-wrap:wrap;
}
.map-legend {
  display:flex; align-items:center; gap:16px; margin-left:auto; font-size:12px; color:var(--text);
}
.map-legend-item { display:flex; align-items:center; gap:6px; }
.map-legend-dot { width:10px; height:10px; border-radius:50%; }
.map-parc-card {
  background:var(--white); border:1.5px solid var(--border); border-radius:var(--r-md);
  padding:16px; cursor:pointer; transition:border-color .15s, box-shadow .15s;
  flex-shrink:0;
}
.map-parc-card:hover { border-color:var(--blue); box-shadow:var(--shadow-sm); }
.map-parc-card.active { border-color:var(--blue); box-shadow:0 0 0 3px rgba(37,99,235,.12); background:rgba(37,99,235,.02); }
.map-parc-card-header { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.map-parc-card-icon {
  width:36px; height:36px; border-radius:var(--r-md); display:flex;
  align-items:center; justify-content:center; flex-shrink:0; font-size:18px;
}
.map-parc-card-name { font-size:13px; font-weight:800; color:var(--navy); margin-bottom:1px; }
.map-parc-card-addr { font-size:10px; color:var(--muted); }
.map-parc-card-footer {
  display:flex; align-items:center; gap:6px; margin-top:10px; padding-top:10px;
  border-top:1px solid var(--border); font-size:11px; color:var(--muted);
}
.map-parc-card-stats { display:grid; grid-template-columns:1fr 1fr 1fr; gap:6px; }
.map-parc-stat { text-align:center; }
.map-parc-stat-val { font-family:'JetBrains Mono',monospace; font-size:15px; font-weight:800; color:var(--navy); }
.map-parc-stat-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.3px; }
.map-parc-bar { height:6px; border-radius:3px; background:var(--bg); margin-top:10px; overflow:hidden; }
.map-parc-bar-fill { height:100%; border-radius:3px; transition:width .4s ease; }

/* ─── NOTIFICATIONS ─── */
.notif-list { display:flex; flex-direction:column; gap:0; }
.notif-item {
  display:flex; align-items:flex-start; gap:14px; padding:16px 20px;
  border-bottom:1px solid var(--border); transition:background .15s; cursor:pointer;
}
.notif-item:last-child { border-bottom:none; }
.notif-item:hover { background:var(--bg); }
.notif-item.unread { background:rgba(37,99,235,.03); }
.notif-item.unread::before {
  content:''; width:6px; height:6px; border-radius:50%; background:var(--blue);
  flex-shrink:0; margin-top:8px;
}
.notif-icon {
  width:36px; height:36px; border-radius:var(--r-full);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.notif-body { flex:1; min-width:0; }
.notif-title { font-size:13px; font-weight:700; color:var(--navy); margin-bottom:2px; }
.notif-desc { font-size:12px; color:var(--muted); line-height:1.5; }
.notif-time { font-size:11px; color:var(--muted); flex-shrink:0; white-space:nowrap; margin-top:2px; }
.notif-type-pill {
  display:inline-flex; align-items:center; gap:4px; padding:2px 8px;
  border-radius:var(--r-full); font-size:10px; font-weight:700;
}

/* ─── RAPPORT TEMPLATES ─── */
.rapport-templates {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:12px;
}
.rapport-tpl-card {
  background:var(--white); border:1.5px solid var(--border); border-radius:var(--r-md);
  padding:16px; cursor:pointer; transition:border-color .15s, box-shadow .15s;
}
.rapport-tpl-card:hover { border-color:var(--blue); box-shadow:var(--shadow-sm); }
.rapport-tpl-card.selected { border-color:var(--blue); box-shadow:0 0 0 3px rgba(37,99,235,.12); background:rgba(37,99,235,.02); }
.rapport-tpl-icon {
  width:40px; height:40px; border-radius:var(--r-md); display:flex;
  align-items:center; justify-content:center; margin-bottom:10px; font-size:20px;
}
.rapport-tpl-name { font-size:13px; font-weight:800; color:var(--navy); margin-bottom:4px; }
.rapport-tpl-desc { font-size:11px; color:var(--muted); line-height:1.5; }

/* ─── EDI ─── */
.edi-partners {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(280px, 1fr)); gap:12px;
}
.edi-partner-card {
  display:flex; align-items:center; gap:12px; padding:14px 16px;
  background:var(--bg); border-radius:var(--r-md); border:1px solid var(--border);
}
.edi-partner-icon {
  width:38px; height:38px; border-radius:var(--r-md); display:flex;
  align-items:center; justify-content:center; flex-shrink:0; font-size:20px;
}
.edi-partner-body { flex:1; min-width:0; }
.edi-partner-name { font-size:13px; font-weight:700; color:var(--navy); }
.edi-partner-proto { font-size:11px; color:var(--muted); }
.edi-partner-status { display:flex; align-items:center; gap:4px; flex-shrink:0; }
.edi-status-dot { width:7px; height:7px; border-radius:50%; }
.edi-partner-time { font-size:10px; color:var(--muted); flex-shrink:0; white-space:nowrap; }
.edi-type-badge {
  display:inline-flex; padding:2px 8px; border-radius:var(--r-full);
  font-family:'JetBrains Mono',monospace; font-size:11px; font-weight:700;
  background:var(--light); color:var(--blue);
}

/* ─── ABONNEMENT / SUBSCRIPTION ─── */
.sub-plan-highlight { text-align:center; padding:20px; background:var(--bg); border-radius:var(--r-md); margin-bottom:20px; }
.sub-plan-name { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:1px; color:var(--blue); margin-bottom:4px; }
.sub-plan-price { font-size:32px; font-weight:800; color:var(--navy); }
.sub-plan-cycle { font-size:14px; font-weight:400; color:var(--muted); }
.sub-plan-since { font-size:11px; color:var(--muted); margin-top:4px; }
.sub-features-title { font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; margin-bottom:12px; }
.sub-feature-item { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text); padding:6px 0; }
.sub-usage-item { margin-bottom:16px; }
.sub-usage-item:last-child { margin-bottom:0; }
.sub-usage-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.sub-usage-label { font-size:13px; font-weight:600; color:var(--text); }
.sub-usage-val { font-family:'JetBrains Mono',monospace; font-size:12px; font-weight:700; }
.sub-usage-bar { height:8px; border-radius:4px; background:var(--bg); overflow:hidden; }
.sub-usage-fill { height:100%; border-radius:4px; transition:width .4s ease; }

/* ─── PLANS GRID (Admin) ─── */
.plans-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:16px; }
.plan-card {
  background:var(--white); border:1.5px solid var(--border); border-radius:var(--r-md);
  display:flex; flex-direction:column; position:relative; overflow:hidden;
}
.plan-card.plan-popular { border-color:var(--blue); box-shadow:0 0 0 3px rgba(37,99,235,.1); }
.plan-popular-badge {
  position:absolute; top:12px; right:-28px; transform:rotate(45deg);
  background:var(--blue); color:white; font-size:10px; font-weight:700;
  padding:2px 32px; text-transform:uppercase; letter-spacing:.5px;
}
.plan-card-header { padding:20px 20px 12px; text-align:center; border-bottom:2px solid var(--border); }
.plan-name { font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:1px; margin-bottom:4px; }
.plan-price { font-size:28px; font-weight:800; color:var(--navy); }
.plan-cycle { font-size:12px; color:var(--muted); }
.plan-features { padding:16px 20px; flex:1; }
.plan-feature { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text); padding:4px 0; }
.plan-footer { padding:12px 20px 20px; }
.plan-subs { font-size:12px; color:var(--muted); text-align:center; margin-bottom:10px; }

/* ─── PRINT ─── */
@media print {
  .sidebar, .topbar, .back-link, .page-header-row, .toast-container { display:none !important; }
  .main-content { margin-left:0 !important; }
  .page-content { padding:0 !important; }
  .rapport-wrap { box-shadow:none; border:none; padding:20px 0; max-width:100%; }
  body { background:white; }
}

/* ─── AUTH (single card) ─── */
.auth-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px; background: var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  padding: 40px 36px;
}
.auth-header { text-align: center; margin-bottom: 32px; }
.auth-title { font-size: 24px; font-weight: 800; color: var(--navy); margin-bottom: 8px; }
.auth-sub { font-size: 14px; color: var(--muted); }
.auth-logo { font-size: 24px; font-weight: 800; color: var(--navy); text-decoration: none; display: inline-block; margin-bottom: 20px; }
.auth-logo span { color: var(--orange); }
.auth-form { display: flex; flex-direction: column; gap: 0; }
.auth-options { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.auth-remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.auth-remember input { accent-color: var(--orange); }
.auth-forgot { font-size: 13px; color: var(--blue); font-weight: 600; text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; }
.auth-submit { margin-top: 8px; }
.auth-alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); margin-bottom: 20px; font-size: 13px; }
.auth-alert-error { background: var(--red-bg); border: 1px solid #fca5a5; color: var(--red); }
.auth-alert-success { background: var(--green-bg); border: 1px solid #86efac; color: var(--green); }
.auth-alert .material-symbols-outlined { font-size: 18px; }

/* ─── PAGE HEADER ─── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-blue   { background: var(--light); color: var(--blue); }
.badge-sky    { background: #e0f2fe; color: var(--sky); }
.badge-orange { background: #fff7ed; color: var(--orange); }
.badge-navy   { background: var(--navy); color: #c5ddf5; }
.badge-purple { background: var(--purple-bg); color: var(--purple); }
.badge-muted  { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
.badge-light  { background: var(--bg); color: var(--text); border: 1px solid var(--border); font-family: 'JetBrains Mono', monospace; font-size: 10px; }

/* ─── DATA TABLE (users) ─── */
.card-table {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  background: var(--bg); border-bottom: 1.5px solid var(--border);
  padding: 10px 16px; text-align: left;
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
}
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--bg); }
.data-table td { padding: 13px 16px; color: var(--text); vertical-align: middle; }
.th-actions { width: 60px; text-align: center; }

.avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: #c5ddf5;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.status-dot.green { background: var(--green); }
.status-dot.red { background: var(--red); }
.text-muted { color: var(--muted); }
.text-danger { color: var(--red) !important; }
.text-success { color: var(--green) !important; }

/* ─── FILTER TABS ─── */
.filter-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.filter-tab {
  padding: 6px 14px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--border); background: var(--white); color: var(--muted);
  cursor: pointer; text-decoration: none; transition: all .15s;
}
.filter-tab:hover { border-color: var(--sky); color: var(--blue); }
.filter-tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.filter-search { margin-left: auto; }
.filter-search .form-control { padding: 7px 12px 7px 34px; font-size: 13px; min-width: 200px; }

/* ─── DROPDOWN ─── */
.actions-group { position: relative; }
.btn-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); transition: all .15s;
}
.btn-icon:hover { background: var(--light); border-color: #c8dff5; color: var(--blue); }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md);
  min-width: 180px; z-index: 50; overflow: hidden;
}
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-size: 13px; font-weight: 500;
  color: var(--text); cursor: pointer; transition: background .1s;
  text-decoration: none; border: none; background: none; width: 100; text-align: left;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-item .material-symbols-outlined { font-size: 16px; color: var(--muted); }
.dropdown-item.text-danger .material-symbols-outlined { color: var(--red); }
.dropdown-item.text-success .material-symbols-outlined { color: var(--green); }

/* ─── FORM CARD (create/edit) ─── */
.create-user-layout { max-width: 680px; }
.form-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 28px;
}
.form-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-section-title {
  font-size: 14px; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
}
.form-section-title .material-symbols-outlined { font-size: 18px; color: var(--orange); }

/* ─── CHECKBOX GRID (depots) ─── */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.checkbox-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 1.5px solid var(--border); background: var(--white);
  cursor: pointer; transition: all .15s;
}
.checkbox-card:has(input:checked) { border-color: var(--blue); background: var(--light); }
.checkbox-card input { accent-color: var(--blue); width: 16px; height: 16px; }
.checkbox-card-body strong { display: block; font-size: 13px; font-weight: 700; color: var(--navy); }
.checkbox-card-body span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ─── BUTTONS VARIANTS ─── */
.btn-primary-sm { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--r-md); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; border: none; background: var(--orange); color: #fff; text-decoration: none; transition: all .15s; }
.btn-primary-sm:hover { opacity: .9; }
.btn-primary-sm .material-symbols-outlined { font-size: 16px; }
.btn-outline-sm { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: var(--r-md); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer; border: 1.5px solid var(--border); background: var(--white); color: var(--text); text-decoration: none; transition: all .15s; }
.btn-outline-sm:hover { border-color: var(--sky); color: var(--sky); }
.btn-outline-sm .material-symbols-outlined { font-size: 16px; }

/* ─── PROFILE PAGE ─── */
.profile-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
.profile-grid > .card:first-child { grid-column: 1 / -1; max-width: 400px; justify-self: center; }
.profile-avatar-lg {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--navy); color: #fff;
  font-size: 32px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto; overflow: hidden;
}
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.info-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--muted); font-weight: 500; }

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .page-content { padding: 20px 16px; }
  .stats-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .parcs-grid { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .profil-layout { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .parcs-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-layout { grid-template-columns: 1fr; }
  .map-layout { grid-template-columns: 1fr; }
  .map-parc-sidebar { height:auto; max-height:200px; flex-direction:row; overflow-x:auto; overflow-y:hidden; }
  .map-parc-sidebar .map-parc-card { min-width:260px; }
  .dash-grid { grid-template-columns: 1fr; }
}

/* ─── MODULE 2 — PARCS (Depots) ─── */

/* Grille de cartes parcs */
.depot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.depot-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.depot-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
}
.depot-card.depot-inactive {
  opacity: .65;
}
.depot-card.depot-inactive:hover {
  border-color: var(--border);
}

.depot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.depot-code-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--navy);
  color: #c5ddf5;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-sm);
  letter-spacing: .5px;
}

.depot-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.3;
}

.depot-card-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  flex: 1;
}
.depot-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.depot-meta-item .material-symbols-outlined {
  font-size: 18px;
  color: var(--blue);
}

.depot-card-coords {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
  border-top: 1px solid var(--border);
  margin-bottom: 14px;
}
.depot-card-coords .material-symbols-outlined {
  font-size: 16px;
  color: var(--orange);
}
.depot-card-coords .mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.depot-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Tenant section grouping */
.tenant-section {
  margin-bottom: 28px;
}
.tenant-section:last-child {
  margin-bottom: 0;
}
.tenant-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.tenant-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}
.tenant-section-title .material-symbols-outlined {
  font-size: 22px;
  color: var(--blue);
}

/* Detail layout (2 colonnes : main + sidebar) */
.depot-detail-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}
.depot-detail-main { display: flex; flex-direction: column; gap: 20px; }
.depot-detail-side { display: flex; flex-direction: column; gap: 20px; }

/* Zone type pills */
.zone-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
}
.zone-type-pill .material-symbols-outlined { font-size: 15px; }
.zone-full       { background: #eff6ff; color: #1a6bbd; }
.zone-empty      { background: #f0fdf4; color: #16a34a; }
.zone-reefer     { background: #ecfeff; color: #0891b2; }
.zone-dangerous  { background: var(--amber-bg); color: var(--amber); }
.zone-repair     { background: var(--purple-bg); color: var(--purple); }

/* btn-sm for smaller buttons */
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  gap: 4px;
}
.btn-sm .material-symbols-outlined { font-size: 16px; }

/* Mono helper */
.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Depot form layout (formulaire + carte) */
.depot-form-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.depot-form-layout > form {
  display: contents;
}
.depot-form-main { min-width: 0; }
.depot-form-map {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
}

/* Carte Leaflet */
.depot-map {
  height: 420px;
  width: 100%;
  border-top: 1px solid var(--border);
}
.depot-map-show {
  height: 260px;
  width: 100%;
  border-top: 1px solid var(--border);
}
.depot-map-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.depot-map-hint .material-symbols-outlined {
  font-size: 16px;
  color: var(--blue);
}

/* Marqueur custom Leaflet */
.depot-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
}
.depot-marker .material-symbols-outlined {
  font-size: 36px;
  color: var(--red);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}

@media (max-width: 1100px) {
  .depot-grid { grid-template-columns: repeat(2, 1fr); }
  .depot-detail-layout { grid-template-columns: 1fr; }
  .depot-form-layout { grid-template-columns: 1fr; }
  .depot-form-map { position: static; }
}
@media (max-width: 700px) {
  .depot-grid { grid-template-columns: 1fr; }
}

/* ── Two-column layout (platform pages) ── */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}
.col-main { display: flex; flex-direction: column; gap: 20px; }
.col-side { display: flex; flex-direction: column; gap: 20px; }

@media (max-width: 1100px) {
  .two-col-layout { grid-template-columns: 1fr; }
}

/* ── Progress bars (usage) ── */
.progress-bar-bg {
  height: 8px;
  background: var(--border);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: var(--r-full);
  transition: width .4s ease;
}
.progress-bar-fill.bar-warning { background: var(--amber); }
.progress-bar-fill.bar-danger  { background: var(--red); }

/* ═══════════════════════════════════════════════════
   PWA — MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════ */

/* ── Mobile hamburger button (hidden on desktop) ── */
.mobile-menu-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: var(--r-sm);
  color: var(--navy); flex-shrink: 0;
}
.mobile-menu-btn:hover { background: var(--light); }
.mobile-menu-btn .material-symbols-outlined { font-size: 24px; }

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(15,35,66,.5); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .25s;
}
.sidebar-overlay.open { display: block; opacity: 1; }

/* ── Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
  .mobile-menu-btn { display: flex; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w); z-index: 100;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0 !important; }

  .topbar { padding: 0 16px; }
  .topbar-breadcrumb { font-size: 12px; }

  .page-header-row { flex-direction: column; gap: 12px; }
  .page-actions { width: 100%; }
  .page-actions .btn { width: 100%; justify-content: center; }

  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Tables horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ds-table { min-width: 700px; }

  /* Cards grid responsive */
  .two-col-layout { grid-template-columns: 1fr !important; }
}

/* ── Mobile (≤ 640px) ── */
@media (max-width: 640px) {
  :root {
    --topbar-h: 52px;
  }

  .page-content { padding: 16px 12px; }

  .page-title { font-size: 18px; }
  .page-sub { font-size: 12px; }
  .page-label { font-size: 10px; }

  .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-val { font-size: 18px; }
  .stat-lbl { font-size: 10px; }
  .stat-icon { width: 36px; height: 36px; }
  .stat-icon .material-symbols-outlined { font-size: 18px; }

  .card { border-radius: var(--r-md); }
  .card-header { padding: 14px 16px; flex-wrap: wrap; gap: 8px; }
  .card-body { padding: 16px; }
  .card-footer { padding: 12px 16px; }
  .card-title { font-size: 13px; }

  .form-grid,
  .form-grid-2 { grid-template-columns: 1fr !important; }
  .form-control { font-size: 16px; } /* prevent iOS zoom */
  select.form-control { font-size: 16px; }

  .btn { font-size: 13px; padding: 8px 14px; min-height: 42px; }
  .btn-primary, .btn-outline { width: 100%; justify-content: center; }

  .row-actions { gap: 4px; }
  .action-btn { width: 32px; height: 32px; }

  .topbar-right { gap: 4px; }
  .topbar-icon-btn { width: 36px; height: 36px; }
  .topbar-avatar { width: 32px; height: 32px; font-size: 12px; }

  .modal { margin: 8px; max-width: calc(100vw - 16px) !important; max-height: 90vh; }
  .modal-body { padding: 16px; }
  .modal-header { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; }

  .back-link { font-size: 12px; }

  /* Toast on mobile */
  .toast-container { left: 12px; right: 12px; bottom: 12px; }
  .toast { font-size: 12px; }

  /* Hide less important table columns on very small screens */
  .ds-table .hide-mobile { display: none; }

  /* Pagination compact */
  .card-footer { gap: 2px; }
}

/* ── Dashboard responsive grids ── */
.resp-grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.resp-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.resp-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); }
.resp-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); }
.resp-grid-sidebar { display: grid; grid-template-columns: 280px 1fr; }

@media (max-width: 1024px) {
  .resp-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .resp-grid-5 { grid-template-columns: repeat(2, 1fr) !important; }
  .resp-grid-3 { grid-template-columns: 1fr 1fr !important; }
  .resp-grid-2 { grid-template-columns: 1fr 1fr !important; }
  .resp-grid-sidebar { grid-template-columns: 1fr !important; }
}
@media (max-width: 640px) {
  .resp-grid-2 { grid-template-columns: 1fr !important; }
  .resp-grid-3 { grid-template-columns: 1fr !important; }
  .resp-grid-4 { grid-template-columns: 1fr !important; }
  .resp-grid-5 { grid-template-columns: repeat(2, 1fr) !important; }
  .resp-grid-sidebar { grid-template-columns: 1fr !important; }
  .page-header-row { flex-direction: column; align-items: flex-start !important; }
  .page-header-row .page-actions { width: 100%; }
  .page-header-row .page-actions .btn { width: 100%; justify-content: center; }
}
@media (max-width: 380px) {
  .resp-grid-5 { grid-template-columns: 1fr !important; }
}

/* ── Very small phones (≤ 380px) ── */
@media (max-width: 380px) {
  .stats-row { grid-template-columns: 1fr; }
  .page-content { padding: 12px 8px; }
  .topbar { padding: 0 10px; }
}

/* ── PWA standalone (installed) ── */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
  .page-content { padding-bottom: env(safe-area-inset-bottom); }
}

/* ── Touch friendly ── */
@media (pointer: coarse) {
  .sb-item { min-height: 44px; padding: 10px 16px; }
  .action-btn { min-width: 40px; min-height: 40px; }
  .topbar-icon-btn { min-width: 40px; min-height: 40px; }
  .btn { min-height: 44px; }
  input[type="text"], input[type="number"], input[type="email"],
  input[type="password"], input[type="date"], select, textarea {
    min-height: 44px;
  }
}

/* ─── SEARCHABLE SELECT — handled by Select2 library ─── */

/* ─── LOADING OVERLAY ─── */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 35, 66, .25);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--white);
  padding: 32px 48px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}

.spinner-ring {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: .875rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .02em;
}
