/* Dashboard Flotte Mobile - CLS */
/* Dark theme */

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0a0a1a;
  color: #e0e0e0;
  min-height: 100vh;
}

/* Top bar */
.topbar {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 18px; color: #fff; }
.topbar .sub { margin-left: auto; font-size: 12px; color: #a7f3d0; }
.topbar a {
  color: #fff;
  font-size: 12px;
  text-decoration: none;
  background: rgba(255,255,255,.15);
  padding: 5px 12px;
  border-radius: 6px;
}
.topbar a:hover { background: rgba(255,255,255,.25); }

.content { padding: 20px 24px; max-width: 1400px; margin: 0 auto; }

/* Date selector */
.date-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.date-selector label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.date-selector select {
  background: #1a1a2e;
  border: 1px solid #334155;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
}
.date-selector select:focus { border-color: #14b8a6; }
.date-selector .date-nav { display: flex; gap: 4px; }
.date-selector .date-nav button {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.date-selector .date-nav button:hover { background: #334155; color: #fff; }
.date-selector .date-nav button:disabled { opacity: .3; cursor: default; }

.date-compare {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.date-compare.up { background: rgba(239,68,68,.15); color: #ef4444; }
.date-compare.down { background: rgba(34,197,94,.15); color: #22c55e; }
.date-compare.neutral { background: rgba(148,163,184,.1); color: #94a3b8; }

/* Cost banner */
.cost-banner {
  background: linear-gradient(135deg, #16213e, #1a1a2e);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 18px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cost-banner .cost-item { text-align: center; }
.cost-banner .cost-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.cost-banner .cost-value { font-size: 32px; font-weight: 800; margin: 2px 0; }
.cost-banner .cost-value.green { color: #22c55e; }
.cost-banner .cost-value.blue { color: #3b82f6; }
.cost-banner .cost-detail { font-size: 11px; color: #94a3b8; }
.cost-banner .sep { width: 1px; height: 40px; background: #334155; }

/* KPI cards */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.kpi {
  background: #1a1a2e;
  border-radius: 10px;
  padding: 14px 16px;
  border-left: 4px solid #14b8a6;
  cursor: pointer;
  transition: all .2s;
}
.kpi:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.kpi.active { background: #16213e; box-shadow: inset 0 0 0 2px #14b8a6; }
.kpi.b { border-color: #3b82f6; }
.kpi.b.active { box-shadow: inset 0 0 0 2px #3b82f6; }
.kpi.o { border-color: #f97316; }
.kpi.o.active { box-shadow: inset 0 0 0 2px #f97316; }
.kpi.s { border-color: #ef4444; }
.kpi.s.active { box-shadow: inset 0 0 0 2px #ef4444; }
.kpi.f { border-color: #a855f7; }
.kpi.f.active { box-shadow: inset 0 0 0 2px #a855f7; }
.kpi .label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.kpi .value { font-size: 24px; font-weight: 700; color: #fff; margin: 2px 0; }
.kpi .detail { font-size: 11px; color: #94a3b8; }

/* Filter pills row */
.filters-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group .fg-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.filter-group .fg-pills { display: flex; gap: 4px; flex-wrap: wrap; }

.pill {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #334155;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.pill:hover { background: #334155; color: #fff; }
.pill.active { background: #0f766e; color: #fff; border-color: #14b8a6; }
.pill.ios.active { background: #3b82f6; border-color: #3b82f6; }
.pill.android.active { background: #22c55e; border-color: #22c55e; }

/* Filter banner */
.filter-banner {
  display: none;
  background: #16213e;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 16px;
  margin-bottom: 14px;
  font-size: 13px;
  color: #94a3b8;
  align-items: center;
  gap: 8px;
}
.filter-banner.show { display: flex; }
.filter-banner .tag {
  background: #0f766e;
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 12px;
}
.filter-banner .clear {
  margin-left: auto;
  color: #ef4444;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}
.filter-banner .clear:hover { color: #f87171; }

/* Charts */
.charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.chart-box { background: #1a1a2e; border-radius: 12px; padding: 16px; }
.chart-box h3 { font-size: 13px; color: #94a3b8; margin-bottom: 10px; }
.bar-chart { display: flex; flex-direction: column; gap: 5px; }
.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 4px;
  padding: 1px 0;
  transition: background .15s;
}
.bar-row:hover { background: rgba(255,255,255,.05); }
.bar-row.active { background: rgba(20,184,166,.15); }
.bar-label {
  width: 140px;
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  flex: 1;
  background: #0f0f23;
  border-radius: 4px;
  height: 18px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  min-width: 24px;
  transition: width .5s;
}

/* Table / Card */
.card {
  background: #1a1a2e;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.card h2 { font-size: 15px; color: #14b8a6; margin-bottom: 14px; }
.loading { text-align: center; padding: 60px; color: #64748b; font-size: 14px; }

/* DataTables dark theme overrides */
table.dataTable { border-collapse: collapse !important; width: 100% !important; }
table.dataTable thead th {
  background: #16213e !important;
  color: #94a3b8 !important;
  border-bottom: 1px solid #334155 !important;
  padding: 8px 10px !important;
  font-size: 11px !important;
  white-space: nowrap;
}
table.dataTable tbody td {
  background: #1a1a2e !important;
  color: #e0e0e0 !important;
  border-bottom: 1px solid #1e293b !important;
  padding: 6px 10px !important;
  font-size: 11px !important;
}
table.dataTable tbody tr:hover td { background: #16213e !important; }

.dataTables_wrapper .dataTables_filter input {
  background: #0f0f23 !important;
  border: 1px solid #334155 !important;
  color: #fff !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
}
.dataTables_wrapper .dataTables_length select {
  background: #0f0f23 !important;
  border: 1px solid #334155 !important;
  color: #fff !important;
  border-radius: 6px !important;
  padding: 4px !important;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  color: #64748b !important;
  font-size: 12px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: #1e293b !important;
  color: #94a3b8 !important;
  border: 1px solid #334155 !important;
  border-radius: 4px !important;
  margin: 0 2px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: #14b8a6 !important;
  color: #fff !important;
  border-color: #14b8a6 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #0f766e !important;
  color: #fff !important;
}
.dt-buttons .dt-button {
  background: #1e293b !important;
  color: #14b8a6 !important;
  border: 1px solid #334155 !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  padding: 6px 12px !important;
}
.dt-buttons .dt-button:hover {
  background: #0f766e !important;
  color: #fff !important;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid #334155;
}
.tab {
  padding: 12px 24px;
  cursor: pointer;
  color: #94a3b8;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}
.tab:hover { color: #e0e0e0; }
.tab.active { color: #14b8a6; border-bottom-color: #14b8a6; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Migration */
.mig-bar {
  height: 28px;
  border-radius: 8px;
  background: #0f172a;
  overflow: hidden;
  display: flex;
  margin: 10px 0;
}
.mig-bar div {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.mig-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.mig-kpi {
  background: #1e293b;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.mig-kpi .val { font-size: 26px; font-weight: 800; color: #fff; }
.mig-kpi .lbl { font-size: 11px; color: #94a3b8; margin-top: 4px; }

.phase-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}
.phase-1 { background: rgba(239,68,68,.2); color: #ef4444; }
.phase-2 { background: rgba(249,115,22,.2); color: #f97316; }
.phase-3 { background: rgba(234,179,8,.2); color: #eab308; }
.phase-4 { background: rgba(34,197,94,.2); color: #22c55e; }

.status-fait { color: #22c55e; font-weight: 700; }
.status-encours { color: #f59e0b; font-weight: 700; }
.status-afaire { color: #94a3b8; }

.mig-edit-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  transition: all .2s;
}
.mig-edit-btn:hover { background: #334155; color: #fff; }
.mig-save-btn {
  background: #0f766e;
  border: none;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
}
.mig-del-btn {
  background: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  margin-left: 4px;
}
.mig-del-btn:hover { background: #ef4444; color: #fff; }

/* Migration modal */
.mig-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.mig-modal-box {
  background: #1a1a2e;
  border-radius: 16px;
  padding: 28px;
  width: 440px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.mig-modal-box h3 { color: #fff; margin-bottom: 16px; font-size: 18px; }
.mig-field { margin-bottom: 14px; }
.mig-field label { display: block; font-size: 12px; color: #94a3b8; margin-bottom: 4px; }
.mig-field input,
.mig-field select,
.mig-field textarea {
  width: 100%;
  background: #0f0f23;
  border: 1px solid #334155;
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.mig-field textarea { height: 60px; resize: vertical; }
.mig-field select { appearance: auto; }

.mig-modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.mig-modal-actions button {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}
.mig-btn-save { background: linear-gradient(135deg, #0f766e, #14b8a6); color: #fff; }
.mig-btn-cancel { background: #334155; color: #94a3b8; }
.mig-btn-add {
  background: #1e293b;
  border: 1px dashed #14b8a6;
  color: #14b8a6;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  display: inline-block;
}
.mig-btn-add:hover { background: rgba(20,184,166,0.13); }

/* Toast notification */
.mig-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #22c55e;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 2000;
  animation: fadeIn .3s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Security banner */
.sec-banner {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 20px;
  margin-bottom: 16px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.sec-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sec-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sec-val { font-weight: 700; font-size: 15px; }

/* Responsive */
@media (max-width: 768px) {
  .charts { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .cost-banner { flex-direction: column; gap: 12px; }
  .cost-banner .sep { display: none; }
}
