/* ============================================================
   Bizna201 — Interface d'administration
   Thème : Orange (marque) sur fond clair, sidebar sombre
   ============================================================ */

:root {
  --orange: #ff7900;
  --orange-dark: #e56e00;
  --orange-light: #fff3e6;
  --ink: #1a2332;
  --ink-soft: #4b5568;
  --muted: #8a94a6;
  --line: #e6eaf0;
  --bg: #f4f6fa;
  --card: #ffffff;
  --sidebar-bg: #141c2b;
  --sidebar-ink: #aeb8c9;
  --green: #12b76a;
  --green-bg: #e7f9f0;
  --red: #f04438;
  --red-bg: #fdecea;
  --amber: #b54708;
  --amber-bg: #fff4e0;
  --blue: #175cd3;
  --blue-bg: #e9f0fd;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.16);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }
a { text-decoration: none; color: inherit; }

[hidden] { display: none !important; }
.hidden { display: none !important; }

/* ==================== Boutons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dark); box-shadow: 0 4px 12px rgba(255, 121, 0, 0.35); }

.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #0ea35c; box-shadow: 0 4px 12px rgba(18, 183, 106, 0.35); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #d92d20; box-shadow: 0 4px 12px rgba(240, 68, 56, 0.35); }

.btn-ghost { background: transparent; color: var(--sidebar-ink); border: 1px solid #2a3648; }
.btn-ghost:hover { background: #1f2a3c; color: #fff; }

.btn-outline {
  background: #fff;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-outline:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-light); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-label { display: inline-flex; }

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== Écran de connexion ==================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1000px 500px at 90% -10%, rgba(255, 121, 0, 0.18), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(23, 92, 211, 0.12), transparent 60%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  animation: fade-up 0.4s ease;
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.login-brand { text-align: center; margin-bottom: 28px; }
.login-logo {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--orange), #ff9a3d);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  box-shadow: 0 8px 20px rgba(255, 121, 0, 0.35);
}
.login-brand h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.login-subtitle { color: var(--muted); font-size: 13px; margin-top: 4px; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: #fbfcfe;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 121, 0, 0.15);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 80px; }

.form-error {
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 14px;
}

.login-hint {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.login-hint code {
  background: var(--orange-light);
  color: var(--orange-dark);
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 600;
}

/* Bascule connexion / inscription */
.auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.auth-switch a {
  color: var(--ink-soft);
  transition: color 0.15s ease;
}
.auth-switch a strong {
  color: var(--orange);
  font-weight: 700;
}
.auth-switch a:hover strong {
  color: var(--orange-dark);
  text-decoration: underline;
}

/* ==================== Layout application ==================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  min-width: 250px;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: transform 0.25s ease;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
  border-bottom: 1px solid #232f43;
  margin-bottom: 18px;
}
.sidebar-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--orange), #ff9a3d);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-text strong { display: block; color: #fff; font-size: 14px; }
.sidebar-brand-text small { font-size: 11px; color: var(--muted); }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  color: var(--sidebar-ink);
  transition: all 0.15s ease;
}
.nav-item:hover { background: #1d2839; color: #fff; }
.nav-item.active { background: rgba(255, 121, 0, 0.14); color: var(--orange); }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }

.nav-badge {
  margin-left: auto;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 8px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer { border-top: 1px solid #232f43; padding-top: 16px; }

.admin-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 12px;
}
.admin-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.admin-info { line-height: 1.2; overflow: hidden; }
.admin-info strong { display: block; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.admin-info small { font-size: 11px; color: var(--muted); }

/* ==================== Zone principale ==================== */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-title h2 { font-size: 18px; font-weight: 700; letter-spacing: -0.2px; }
.topbar-title p { font-size: 12.5px; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; align-items: center; }

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-bg);
  padding: 6px 12px;
  border-radius: 999px;
}
.live-dot .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}
.live-dot.offline { color: var(--red); background: var(--red-bg); }
.live-dot.offline .dot { background: var(--red); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(18, 183, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); }
}

.icon-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  width: 38px; height: 38px;
  font-size: 17px;
  color: var(--ink-soft);
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.icon-btn:hover { border-color: var(--orange); color: var(--orange); }

.content { padding: 28px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ==================== Cartes de statistiques ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--accent, var(--orange));
}
.stat-card .stat-label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.stat-card .stat-value { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-card .stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.stat-card.accent-green { --accent: var(--green); }
.stat-card.accent-blue { --accent: var(--blue); }
.stat-card.accent-amber { --accent: var(--amber); }
.stat-card.accent-red { --accent: var(--red); }

/* ==================== Cartes d'action (pending) ==================== */
.pending-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 26px;
}
.pending-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.pending-card:hover { box-shadow: var(--shadow-md); border-color: var(--orange); }
.pending-card .pc-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--orange-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.pending-card .pc-body { flex: 1; min-width: 0; }
.pending-card .pc-body strong { display: block; font-size: 14.5px; }
.pending-card .pc-body span { font-size: 12.5px; color: var(--muted); }

/* ==================== Panneau (tableau / liste) ==================== */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 26px;
}
.panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-title { font-size: 15px; font-weight: 700; }
.panel-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.panel-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Onglets */
.tabs { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.tab {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--ink); }
.tab.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.tab .tab-count {
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  min-width: 18px;
  text-align: center;
}
.tab .tab-count.zero { background: var(--muted); }

/* Recherche */
.search-input {
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: #fbfcfe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='6.5' cy='6.5' r='4.5'/%3E%3Cpath d='M10 10l3 3'/%3E%3C/svg%3E") no-repeat 13px center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 200px;
}
.search-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 121, 0, 0.12); }

/* ==================== Tableaux ==================== */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 12px 20px;
  background: #fafbfd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data tbody td {
  padding: 13px 20px;
  border-bottom: 1px solid #f0f3f8;
  vertical-align: middle;
}
table.data tbody tr { transition: background 0.12s ease; }
table.data tbody tr:hover { background: #fafbfd; }
table.data tbody tr:last-child td { border-bottom: none; }

.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }

/* Badges de statut */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge.pending { background: var(--amber-bg); color: var(--amber); }
.badge.approved, .badge.delivered, .badge.active { background: var(--green-bg); color: var(--green); }
.badge.rejected, .badge.failed, .badge.inactive { background: var(--red-bg); color: var(--red); }
.badge.sent, .badge.uncertain { background: var(--blue-bg); color: var(--blue); }

/* Actions dans le tableau */
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ==================== État vide ==================== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 10px; }
.empty-state strong { display: block; color: var(--ink-soft); font-size: 15px; margin-bottom: 4px; }
.empty-state p { font-size: 13px; }

/* ==================== Modale ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 43, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fade-in 0.18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
  animation: pop 0.22s ease;
  overflow: hidden;
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: none; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--muted);
  width: 30px; height: 30px;
  border-radius: 8px;
  transition: all 0.15s ease;
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }
.modal-body { padding: 20px 22px; max-height: 72vh; overflow-y: auto; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #fafbfd;
}

.modal-info {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-info strong { font-size: 14px; }

/* ==================== Gestionnaire d'expéditeurs (modale client) ==================== */
.sender-manager {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}
.sender-manager-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
}
.sender-manager-title { font-size: 13px; font-weight: 700; }
#client-senders table.data thead th { padding: 8px 12px; font-size: 10.5px; }
#client-senders table.data tbody td { padding: 9px 12px; font-size: 13px; }
.sender-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.sender-add-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: #fafbfd;
}
.sender-add-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #fbfcfe;
}
.sender-add-row input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 121, 0, 0.15);
  background: #fff;
}
.sender-edit-input {
  padding: 6px 8px;
  font-size: 13px;
  width: 130px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.sender-edit-input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 121, 0, 0.15);
}

/* ==================== Toasts ==================== */
.toasts {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 360px;
  animation: toast-in 0.25s ease;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.info { background: var(--blue); }
.toast.warning { background: var(--amber); }
.toast.out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ==================== Squelette de chargement ==================== */
.skeleton {
  background: linear-gradient(90deg, #eef1f6 25%, #f7f9fc 50%, #eef1f6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ==================== Responsive ==================== */
@media (max-width: 860px) {
  .sidebar { position: fixed; transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .icon-btn { display: inline-flex; }
  .content { padding: 20px 16px; }
  .topbar { padding: 14px 16px; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .live-dot span:not(.dot) { display: none; }
  .pending-actions { grid-template-columns: 1fr; }
  .search-input { min-width: 0; width: 100%; }
  .panel-actions { margin-left: 0; width: 100%; }
}

/* Champ mot de passe avec bouton afficher/masquer */
.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 17px; cursor: pointer; padding: 6px; border-radius: 6px; line-height: 1; }
.password-toggle:hover { background: var(--orange-light); }
/* ==================== Nouvelles vues : envoi, historique, CRUD clients ==================== */

/* Corps du formulaire de composition */
.compose-body { padding: 22px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
}

.field-hint {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

/* Compteur de caractères du message */
.char-counter {
  float: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border-radius: 999px;
  padding: 2px 9px;
  margin-top: -2px;
}
#send-text { min-height: 120px; }

/* Coût de l'envoi (estimation) */
#send-cost {
  font-size: 13.5px;
  transition: all 0.15s ease;
}
#send-cost.cost-error {
  background: var(--red-bg);
  color: var(--red);
}
.text-danger { color: var(--red); font-weight: 600; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.form-actions .btn { min-width: 180px; }

/* Sélecteurs de filtre (historique) */
.filter-select {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: #fbfcfe;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-width: 170px;
}
.filter-select:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 121, 0, 0.12);
}

/* Cellule message (historique) : troncature propre */
.msg-cell {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-soft);
}
.mono { font-family: 'Consolas', 'Menlo', monospace; font-size: 12.5px; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fafbfd;
}
.page-info { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.pagination .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Actions de ligne (CRUD clients) : autorise le retour à la ligne */
.row-actions-wrap { flex-wrap: wrap; justify-content: flex-end; max-width: 420px; }
.row-actions .btn-sm { white-space: nowrap; }

/* Boutons activer/désactiver */
.btn-toggle-off:hover { border-color: var(--amber); color: var(--amber); background: var(--amber-bg); }
.btn-toggle-on:hover { border-color: var(--green); color: var(--green); background: var(--green-bg); }

/* ==================== Widget Crédit Orange (dashboard) ==================== */

.orange-panel { overflow: hidden; }
.orange-panel .panel-header { border-bottom-color: rgba(255, 121, 0, 0.18); }

.orange-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.4fr);
  gap: 20px;
  padding: 22px;
  align-items: center;
}
@media (max-width: 700px) {
  .orange-grid { grid-template-columns: 1fr; }
}

/* Bloc solde principal */
.orange-amount {
  background: linear-gradient(135deg, #ff7900, #ff9a3d);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: 0 10px 24px rgba(255, 121, 0, 0.28);
  position: relative;
  overflow: hidden;
}
.orange-amount::after {
  content: '📡';
  position: absolute;
  right: -8px;
  bottom: -18px;
  font-size: 88px;
  opacity: 0.14;
  transform: rotate(-14deg);
}
.orange-amount-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; opacity: 0.85; }
.orange-amount-value { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.orange-amount-sub { font-size: 12.5px; opacity: 0.92; }

/* Détails (validité, statut, mode) */
.orange-details { display: flex; flex-direction: column; gap: 10px; }
.orange-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
}
.orange-detail > span { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.orange-detail-value { display: flex; align-items: center; gap: 10px; }
.orange-days {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-bg);
  padding: 2px 9px;
  border-radius: 999px;
}
.orange-expiring { color: var(--amber) !important; }
.orange-days.orange-expiring { background: var(--amber-bg); color: var(--amber) !important; }
.orange-mode { font-weight: 600; color: var(--ink-soft); }

/* État indisponible */
.orange-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 26px;
}
.orange-empty-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--amber-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.orange-empty strong { display: block; font-size: 15px; }
.orange-empty p { font-size: 13px; color: var(--muted); margin-top: 2px; }
