/* Frontend-Styles für [ffn_eb_dashboard] */
.ffn-eb-dashboard-frontend {
  font-family: inherit;
  max-width: 1100px;
  margin: 0 auto;
}

.ffn-eb-dashboard-frontend .wrap { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 0;
}

.ffn-eb-dashboard-frontend h1,
.ffn-eb-dashboard-frontend h2 {
  margin: 14px 0 10px;
  line-height: 1.15;
}

.ffn-eb-dashboard-frontend .ffn-eb-card,
.ffn-eb-dashboard-frontend .postbox,
.ffn-eb-dashboard-frontend .ffn-eb-panel,
.ffn-eb-dashboard-frontend .ffn-eb-box {
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(27,31,36,.04);
}

.ffn-eb-dashboard-frontend .ffn-eb-panel {
  padding: 14px 16px;
  margin: 12px 0;
}

/* Filterbereich */
.ffn-eb-dashboard-frontend form.ffn-eb-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px 14px;
  border: 1px solid #d0d7de;
  border-radius: 14px;
  background: #fff;
  margin-bottom: 12px;
}

.ffn-eb-dashboard-frontend form.ffn-eb-filters label {
  display: block;
  font-size: 12px;
  opacity: .8;
  margin-bottom: 4px;
}

.ffn-eb-dashboard-frontend form.ffn-eb-filters input[type="date"],
.ffn-eb-dashboard-frontend form.ffn-eb-filters select,
.ffn-eb-dashboard-frontend form.ffn-eb-filters input[type="text"]{
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d0d7de;
  border-radius: 10px;
  background: #fff;
}

.ffn-eb-dashboard-frontend form.ffn-eb-filters .button,
.ffn-eb-dashboard-frontend form.ffn-eb-filters button,
.ffn-eb-dashboard-frontend form.ffn-eb-filters input[type="submit"]{
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #d0d7de;
  font-weight: 700;
}

/* Tabs */
.ffn-eb-dashboard-frontend .ffn-eb-tabs {
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}

.ffn-eb-dashboard-frontend .ffn-eb-tabs a {
  display:inline-block;
  padding: 8px 12px;
  border: 1px solid #d0d7de;
  border-radius: 999px;
  background: #fff;
  text-decoration: none !important;
  font-weight: 700;
  font-size: 13px;
  opacity: .9;
}

.ffn-eb-dashboard-frontend .ffn-eb-tabs a:hover {
  opacity: 1;
}

/* Tabellen */
.ffn-eb-dashboard-frontend table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #d0d7de;
  border-radius: 14px;
  overflow: hidden;
}

.ffn-eb-dashboard-frontend table th,
.ffn-eb-dashboard-frontend table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eaeef2;
  text-align: left;
  vertical-align: top;
}

.ffn-eb-dashboard-frontend table thead th {
  background: #f6f8fa;
  color: #1e1e1e;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.ffn-eb-dashboard-frontend table tr:last-child td {
  border-bottom: none;
}

/* Kleine KPI-Zeilen/Boxen */
.ffn-eb-dashboard-frontend .ffn-eb-kpis {
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.ffn-eb-dashboard-frontend .ffn-eb-kpi {
  padding: 12px 14px;
  border: 1px solid #d0d7de;
  border-radius: 14px;
  background:#fff;
}
.ffn-eb-dashboard-frontend .ffn-eb-kpi .label {
  font-size: 12px;
  opacity: .8;
}
.ffn-eb-dashboard-frontend .ffn-eb-kpi .value {
  font-size: 20px;
  font-weight: 900;
  margin-top: 4px;
}

/* Fahrzeugvergleich (Ausrückezeit) */
.ffn-eb-dashboard-frontend .ffn-eb-vehicle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ffn-eb-dashboard-frontend .ffn-eb-vehicle-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ffn-eb-dashboard-frontend .ffn-eb-vehicle-bar {
  display: grid;
  grid-template-columns: 120px 1fr 110px;
  gap: 10px;
  align-items: center;
}

.ffn-eb-dashboard-frontend .ffn-eb-vehicle-bar .left {
  font-size: 12px;
  font-weight: 800;
  opacity: .9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ffn-eb-dashboard-frontend .ffn-eb-vehicle-bar .mid {
  height: 10px;
  border-radius: 999px;
  background: #eaeef2;
  overflow: hidden;
}

.ffn-eb-dashboard-frontend .ffn-eb-vehicle-bar .mid .bar {
  display:block;
  height: 100%;
  background: #0969da;
  border-radius: 999px;
}

.ffn-eb-dashboard-frontend .ffn-eb-vehicle-bar .right {
  font-size: 12px;
  text-align: right;
  opacity: .9;
}

/* “Lade…” / Hinweise */
.ffn-eb-dashboard-frontend .ffn-eb-note {
  font-size: 12px;
  opacity: .8;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 980px) {
  .ffn-eb-dashboard-frontend form.ffn-eb-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ffn-eb-dashboard-frontend .ffn-eb-kpis {
    grid-template-columns: 1fr;
  }

  .ffn-eb-dashboard-frontend .ffn-eb-vehicle-grid {
    grid-template-columns: 1fr;
  }

  .ffn-eb-dashboard-frontend .ffn-eb-vehicle-bar {
    grid-template-columns: 90px 1fr 90px;
  }
}


/* ---------- Overrides & Vereinheitlichung ---------- */
.ffn-eb-dashboard-frontend .ffn-eb-card { padding: 12px 14px; }
.ffn-eb-dashboard-frontend .ffn-eb-filters { 
  display:grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) 220px !important;
  gap: 10px !important;
  align-items: end !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters .field { margin: 0 !important; }
.ffn-eb-dashboard-frontend .ffn-eb-filters .field label { font-weight: 700; }

.ffn-eb-dashboard-frontend .ffn-eb-filters .field input,
.ffn-eb-dashboard-frontend .ffn-eb-filters .field select {
  height: 42px !important;
  padding: 8px 10px !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child {
  display:flex !important;
  gap: 10px !important;
  justify-content:flex-end !important;
  align-items: end !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child .button,
.ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child button,
.ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child a.button {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  height: 42px !important;
  min-width: 0 !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child .button-primary {
  border-color: #b6c2cf !important;
}

/* Tabs gleichmäßig */
.ffn-eb-dashboard-frontend .ffn-eb-tabs a { height: 36px; display:inline-flex; align-items:center; }

/* Grid/Karten im Dashboard: gleichmäßige Optik */
.ffn-eb-dashboard-frontend .ffn-eb-dash-grid { 
  display:grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  align-items: stretch !important;
}
.ffn-eb-dashboard-frontend .ffn-eb-dash-grid .ffn-eb-card { height: 100% !important; }

/* Tabellen/Detailboxen */
.ffn-eb-dashboard-frontend .ffn-eb-table,
.ffn-eb-dashboard-frontend table { border-radius: 14px !important; }

@media (max-width: 980px) {
  .ffn-eb-dashboard-frontend .ffn-eb-filters { grid-template-columns: 1fr 1fr !important; }
  .ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child { justify-content: stretch !important; }
  .ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child .button,
  .ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child a.button { width: 100% !important; }
  .ffn-eb-dashboard-frontend .ffn-eb-dash-grid { grid-template-columns: 1fr !important; }
}


/* ---------- FINAL UI FIX: kompakt & saubere Buttons ---------- */
.ffn-eb-dashboard-frontend form.ffn-eb-filters,
.ffn-eb-dashboard-frontend .ffn-eb-filters{
  display:flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: flex-end !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters .field{
  flex: 1 1 170px !important;
  min-width: 150px !important;
  margin: 0 !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters .field label{
  font-size: 12px !important;
  opacity: .8 !important;
  margin-bottom: 4px !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters input[type="date"],
.ffn-eb-dashboard-frontend .ffn-eb-filters input[type="text"],
.ffn-eb-dashboard-frontend .ffn-eb-filters select{
  height: 34px !important;
  padding: 6px 10px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child{
  flex: 0 0 auto !important;
  display:flex !important;
  gap: 10px !important;
  align-items: flex-end !important;
  justify-content: flex-start !important;
}

/* Buttons wie im Wizard (kompakt, abgerundet, klar) */
.ffn-eb-dashboard-frontend .ffn-eb-filters .button,
.ffn-eb-dashboard-frontend .ffn-eb-filters button,
.ffn-eb-dashboard-frontend .ffn-eb-filters a.button,
.ffn-eb-dashboard-frontend .ffn-eb-filters input[type="submit"]{
  height: 34px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  border: 1px solid #d0d7de !important;
  background: #fff !important;
  font-weight: 700 !important;
  line-height: 34px !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-shadow: 0 1px 0 rgba(27,31,36,.04) !important;
  text-decoration: none !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters .button-primary{
  background: #fff !important; /* bewusst wie Wizard-Button */
  border-color: #b6c2cf !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters .button:hover,
.ffn-eb-dashboard-frontend .ffn-eb-filters button:hover,
.ffn-eb-dashboard-frontend .ffn-eb-filters a.button:hover{
  filter: brightness(0.98);
}

/* Pagination optisch beruhigen */
.ffn-eb-dashboard-frontend .tablenav,
.ffn-eb-dashboard-frontend .tablenav-pages{
  font-size: 12px !important;
}
.ffn-eb-dashboard-frontend .tablenav-pages a,
.ffn-eb-dashboard-frontend .tablenav-pages span{
  display:inline-block !important;
  padding: 4px 8px !important;
  border: 1px solid #d0d7de !important;
  border-radius: 10px !important;
  margin-right: 6px !important;
  text-decoration: none !important;
  background:#fff !important;
}


/* ---------- CONSISTENT CONTROLS (iOS/Safari) ---------- */
.ffn-eb-dashboard-frontend .ffn-eb-filters,
.ffn-eb-dashboard-frontend .ffn-eb-filters * {
  box-sizing: border-box !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters .field {
  display: flex !important;
  flex-direction: column !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-filters .field input[type="date"],
.ffn-eb-dashboard-frontend .ffn-eb-filters .field input[type="text"],
.ffn-eb-dashboard-frontend .ffn-eb-filters .field select {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 32px !important;
  padding: 4px 10px !important;
  margin: 0 !important;
  border: 1px solid #d0d7de !important;
  border-radius: 10px !important;
  background: #fff !important;
  font-size: 14px !important;
  line-height: 22px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

/* Date inputs: Safari/iOS Sonderfälle */
.ffn-eb-dashboard-frontend .ffn-eb-filters input[type="date"]{
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

/* Buttons exakt gleiche Höhe wie Felder */
.ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child .button,
.ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child button,
.ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child a.button,
.ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child input[type="submit"]{
  height: 32px !important;
  line-height: 32px !important;
  padding: 0 12px !important;
}

/* Letztes Feld (Buttons) darf niemals überlappen */
.ffn-eb-dashboard-frontend .ffn-eb-filters .field:last-child{
  align-self: flex-end !important;
}


/* ---------- DETAILS (dynamisch) Live-Filter: gleiche Optik ---------- */
.ffn-eb-dashboard-frontend .ffn-eb-livefilters,
.ffn-eb-dashboard-frontend .ffn-eb-livefilters *{
  box-sizing: border-box !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-livefilters{
  display:flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: flex-end !important;
  padding: 10px 12px !important;
  border: 1px solid #d0d7de !important;
  border-radius: 14px !important;
  background: #fff !important;
  margin: 10px 0 12px !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-livefilters .field{
  flex: 1 1 170px !important;
  min-width: 150px !important;
  margin: 0 !important;
  display:flex !important;
  flex-direction: column !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-livefilters .field label{
  font-size: 12px !important;
  opacity: .8 !important;
  margin-bottom: 4px !important;
  font-weight: 700 !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-livefilters input[type="text"],
.ffn-eb-dashboard-frontend .ffn-eb-livefilters select{
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 32px !important;
  padding: 4px 10px !important;
  margin: 0 !important;
  border: 1px solid #d0d7de !important;
  border-radius: 10px !important;
  background: #fff !important;
  font-size: 14px !important;
  line-height: 22px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}

.ffn-eb-dashboard-frontend .ffn-eb-livefilters button,
.ffn-eb-dashboard-frontend .ffn-eb-livefilters .button,
.ffn-eb-dashboard-frontend .ffn-eb-livefilters a.button{
  height: 32px !important;
  line-height: 32px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  border: 1px solid #d0d7de !important;
  background: #fff !important;
  font-weight: 700 !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-shadow: 0 1px 0 rgba(27,31,36,.04) !important;
}

/* Apply-Button soll nicht untergehen */
.ffn-eb-dashboard-frontend #ffn-eb-apply-live{
  white-space: nowrap !important;
}

@media (max-width: 980px){
  .ffn-eb-dashboard-frontend .ffn-eb-livefilters .field{ flex: 1 1 100% !important; }
}
