*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,sans-serif;background:#f4f7fb;color:#132238}header{height:70px;background:#fff;border-bottom:1px solid #e7ebf0;display:flex;align-items:center;justify-content:space-between;padding:0 24px 0 18px;position:fixed;top:0;left:0;right:0;z-index:10}.brand{display:flex;align-items:center;gap:12px}.logo{width:38px;height:38px;border-radius:10px;background:#1677ed;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:800}.brand small{display:block;color:#8a9bb0;font-size:10px;letter-spacing:2px}.top{font-size:13px;color:#1c3b5b}.top:first-letter{color:#0aa35b}.icon{border:0;background:#f4f7fb;border-radius:10px;padding:10px 14px;margin-left:20px}aside{position:fixed;top:70px;bottom:0;left:0;width:250px;background:#0b1b2c;color:#cbd6e3;padding:28px 12px}.section{font-size:10px;letter-spacing:1.5px;color:#70839a;padding:0 12px 14px}.nav{display:block;color:#cbd6e3;text-decoration:none;padding:13px 16px;border-radius:9px;margin-bottom:4px;cursor:pointer}.nav.active,.nav:hover{background:#2169c7;color:#fff}main{margin-left:250px;padding:94px 26px 30px}.page-title{font-size:30px;font-weight:800;margin:0 0 5px}.muted{color:#8494a8}.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:24px 0}.card{background:#fff;border:1px solid #e5eaf0;border-radius:14px;padding:20px;box-shadow:0 2px 10px #12243b08}.stat b{font-size:25px;display:block;margin-top:6px}.toolbar{display:flex;justify-content:space-between;align-items:center;margin:20px 0}.button{background:#1677ed;color:#fff;border:0;border-radius:9px;padding:11px 16px;font-weight:700;cursor:pointer}.button.secondary{background:#fff;color:#1664c4;border:1px solid #d9e3ef}.table{width:100%;border-collapse:collapse;background:#fff;border-radius:14px;overflow:hidden}.table th,.table td{padding:15px;border-bottom:1px solid #edf0f4;text-align:left;font-size:13px}.table th{color:#8494a8;font-size:11px}.badge{font-size:11px;font-weight:700;border-radius:12px;padding:5px 9px;background:#e7f8ed;color:#098844}.map{height:560px;border-radius:15px;overflow:hidden;background:#ddd}.split{display:grid;grid-template-columns:330px 1fr;gap:14px}.vehicle-list{background:#fff;border-radius:15px;overflow:auto}.vehicle{padding:15px;border-bottom:1px solid #edf0f4;cursor:pointer}.vehicle.selected{background:#edf5ff}.vehicle b{display:block}.detail{margin-top:15px}.io-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.io-card{padding:18px}.io-items{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.io-item{border:1px solid #e2e8ef;border-radius:10px;padding:12px;font-size:13px;display:flex;justify-content:space-between}.on{color:#0a9c50}.off{color:#68798d}.login{display:flex;align-items:center;justify-content:center;height:100vh;background:#f4f7fb}.login-card{background:#fff;padding:38px;border-radius:16px;width:360px;box-shadow:0 10px 40px #14273d16}.login-card input{display:block;width:100%;margin:12px 0;padding:13px;border:1px solid #dce3ec;border-radius:9px}.login-card button{width:100%;padding:13px;background:#1677ed;color:white;border:0;border-radius:9px;font-weight:700}.login-card .logo{margin-bottom:14px}.error{color:#c52d2d;margin-top:12px;font-size:13px;min-height:18px}@media(max-width:900px){aside{width:190px}.split{grid-template-columns:1fr}.io-grid{grid-template-columns:1fr}.grid{grid-template-columns:1fr 1fr}main{margin-left:190px}}

/* =========================================================
   EURO Parcel WEBGPS - KNIHA JÍZD
   Historie jízd / denní přehled / jednotlivé jízdy
   ========================================================= */

/* Filtry historie */
.history-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: flex-end;
    padding: 20px;
}

.history-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #10243a;
}

.history-filter input,
.history-filter select {
    height: 40px;
    padding: 0 10px;
    border: 1px solid #d7e0ea;
    border-radius: 7px;
    background: #fff;
    color: #10243a;
    font-size: 14px;
}

.history-filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Rychlé období */
.history-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.history-presets .button {
    white-space: nowrap;
}

/* Statistiky */
.history-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.history-stat {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(15, 35, 55, 0.04);
}

.history-stat-label {
    color: #60758c;
    font-size: 15px;
    margin-bottom: 7px;
}

.history-stat-value {
    color: #10243a;
    font-size: 28px;
    font-weight: 700;
}

/* Denní blok */
.history-day {
    background: #fff;
    border: 1px solid #e1e7ef;
    border-radius: 14px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 35, 55, 0.04);
}

/* Hlavička dne */
.history-day-header {
    width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    box-sizing: border-box;
    border: 0 !important;
    border-bottom: 1px solid #e4e9f0 !important;
    border-radius: 0 !important;

    background: #fff !important;
    color: #10243a !important;

    padding: 17px 20px !important;
    min-height: 62px;

    cursor: pointer;
    text-align: left;

    font-size: 15px;
    font-weight: 600;

    transition:
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.history-day-header:hover {
    background: #f5f8fc !important;
}

.history-day-header .history-day-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.history-day-header .history-day-date {
    font-weight: 700;
    color: #10243a;
}

.history-day-header .history-day-summary {
    color: #657b92;
    font-weight: 500;
}

.history-day-arrow {
    display: inline-flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;

    border-radius: 50%;
    background: #edf3f9;
    color: #176fd1;

    font-size: 14px;
    font-weight: 700;

    transition: transform 0.15s ease;
}

.history-day.open .history-day-arrow {
    transform: rotate(90deg);
}

/* Obsah dne */
.history-day-content {
    display: none;
    padding: 14px 18px 18px;
    background: #fafcfe;
}

.history-day.open .history-day-content {
    display: block;
}

/* Jednotlivá jízda */
.history-trip {
    background: #fff;
    border: 1px solid #e1e7ef;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.history-trip:last-child {
    margin-bottom: 0;
}

/* Hlavička jízdy */
.history-trip-header {
    width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    box-sizing: border-box;
    border: 0 !important;
    background: #fff !important;
    color: #10243a !important;

    padding: 13px 15px !important;

    cursor: pointer;
    text-align: left;

    font-size: 14px;
    font-weight: 600;
}

.history-trip-header:hover {
    background: #f7faff !important;
}

.history-trip-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.history-trip-arrow {
    color: #176fd1;
    font-weight: 700;
    flex: 0 0 auto;
}

.history-trip-time {
    font-weight: 700;
    color: #10243a;
}

.history-trip-distance {
    color: #176fd1;
    font-weight: 700;
}

.history-trip-duration {
    color: #60758c;
}

.history-trip-speed {
    color: #60758c;
}

/* Detail jízdy */
.history-trip-content {
    display: none;
    border-top: 1px solid #e6ebf1;
    padding: 15px;
    background: #fbfdff;
}

.history-trip.open .history-trip-content {
    display: block;
}

/* Detailní hodnoty */
.history-trip-details {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.history-detail-item {
    background: #fff;
    border: 1px solid #e2e8ef;
    border-radius: 8px;
    padding: 10px 12px;
}

.history-detail-label {
    color: #71849a;
    font-size: 12px;
    margin-bottom: 4px;
}

.history-detail-value {
    color: #10243a;
    font-size: 14px;
    font-weight: 600;
}

/* Trasa */
.history-route {
    height: 300px;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 12px;
    border: 1px solid #dfe6ee;
}

/* Tlačítko mapa */
.history-map-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    border: 0;
    border-radius: 7px;

    background: #1976e8;
    color: #fff;

    padding: 9px 14px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

.history-map-button:hover {
    background: #1266cc;
}

/* Prázdná historie */
.history-empty {
    padding: 35px 20px;
    text-align: center;
    color: #71849a;
}

.history-empty strong {
    display: block;
    margin-bottom: 7px;
    color: #263b52;
    font-size: 17px;
}

/* Chybová zpráva */
.history-error {
    padding: 15px 18px;
    border-radius: 10px;
    background: #fff1f1;
    border: 1px solid #f1caca;
    color: #c62828;
}

/* Loading */
.history-loading {
    padding: 30px;
    text-align: center;
    color: #71849a;
}

/* Mobil */
@media (max-width: 1000px) {
    .history-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-trip-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .history-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .history-filter-group {
        width: 100%;
    }

    .history-filter input,
    .history-filter select {
        width: 100%;
        box-sizing: border-box;
    }

    .history-stats {
        grid-template-columns: 1fr;
    }

    .history-trip-details {
        grid-template-columns: 1fr;
    }

    .history-day-header {
        padding: 14px !important;
    }

    .history-trip-header {
        padding: 12px !important;
    }
}
/* =========================================================
   WEBGPS – KNIHA JÍZD – FINAL OVERRIDE
   Sladění CSS s aktuálním app.js
   ========================================================= */

/* ---------- FILTRY ---------- */

.history-filter{
  margin-bottom:20px !important;
}

.history-filter-grid{
  display:grid !important;
  grid-template-columns:
    minmax(180px,1fr)
    minmax(220px,1fr)
    minmax(220px,1fr)
    auto !important;
  gap:16px !important;
  align-items:end !important;
  width:100% !important;
}

.history-filter-grid > div{
  min-width:0;
}

.history-filter-grid label{
  display:block !important;
  margin-bottom:7px !important;
  font-size:13px !important;
  font-weight:600 !important;
  color:#52657a !important;
}

.history-filter-grid select,
.history-filter-grid input{
  width:100% !important;
  min-height:42px !important;
  box-sizing:border-box !important;
  border:1px solid #d8e1eb !important;
  border-radius:9px !important;
  background:#fff !important;
  padding:9px 12px !important;
  font-size:14px !important;
  color:#102a43 !important;
}

.history-action{
  display:flex !important;
  align-items:flex-end !important;
}

.history-action .button{
  min-height:42px !important;
  min-width:110px !important;
}

.history-presets{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:8px !important;
  margin-top:14px !important;
}


/* ---------- SOUHRNNÉ STATISTIKY ---------- */

.history-summary{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:16px !important;
  margin-top:20px !important;
  margin-bottom:20px !important;
}


/* ---------- DEN ---------- */

.history-day{
  width:100% !important;
  background:#fff !important;
  border:1px solid #e1e7ef !important;
  border-radius:14px !important;
  margin-bottom:14px !important;
  overflow:hidden !important;
  box-shadow:0 2px 8px rgba(15,35,55,.04) !important;
  padding:0 !important;
}


/* ---------- HLAVIČKA DNE ---------- */

.history-day-header{
  width:100% !important;
  min-height:58px !important;
  box-sizing:border-box !important;

  display:grid !important;
  grid-template-columns:
    30px
    180px
    minmax(0,1fr) !important;

  align-items:center !important;
  gap:12px !important;

  margin:0 !important;
  padding:0 18px !important;

  border:0 !important;
  border-bottom:1px solid #e4e9f0 !important;
  border-radius:0 !important;

  background:#fff !important;
  color:#102a43 !important;

  text-align:left !important;
  font-family:inherit !important;
  font-size:14px !important;
  font-weight:600 !important;

  cursor:pointer !important;
  appearance:none !important;
  -webkit-appearance:none !important;
}

.history-day-header:hover{
  background:#f5f9ff !important;
}

.history-day-arrow{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  width:26px !important;
  height:26px !important;

  color:#2878df !important;
  font-size:15px !important;
  font-weight:700 !important;
}

.history-day-date{
  font-weight:700 !important;
  color:#102a43 !important;
  white-space:nowrap !important;
}

.history-day-stats{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:24px !important;

  color:#64778b !important;
  white-space:nowrap !important;
  font-size:13px !important;
}

.history-day-stats b{
  color:#102a43 !important;
}


/* ---------- OBSAH DNE ---------- */

.history-day-body{
  width:100% !important;
  box-sizing:border-box !important;

  border-top:0 !important;

  padding:10px 14px 16px !important;
  background:#f7f9fc !important;
}


/* ---------- JEDNOTLIVÁ JÍZDA ---------- */

.history-trip{
  width:100% !important;
  box-sizing:border-box !important;

  background:#fff !important;
  border:1px solid #dfe6ed !important;
  border-radius:9px !important;

  margin:8px 0 !important;
  overflow:hidden !important;
}

.history-trip:last-child{
  margin-bottom:0 !important;
}


/* ---------- HLAVIČKA JÍZDY ---------- */

.history-trip-header{
  width:100% !important;
  min-height:48px !important;
  box-sizing:border-box !important;

  display:grid !important;
  grid-template-columns:
    28px
    minmax(150px,1fr)
    100px
    110px
    120px !important;

  align-items:center !important;
  gap:10px !important;

  margin:0 !important;
  padding:12px 14px !important;

  border:0 !important;
  border-radius:0 !important;

  background:#fff !important;
  color:#102a43 !important;

  text-align:left !important;
  font-family:inherit !important;
  font-size:14px !important;
  font-weight:600 !important;

  cursor:pointer !important;
  appearance:none !important;
  -webkit-appearance:none !important;
}

.history-trip-header:hover{
  background:#f7fbff !important;
}

.history-trip-arrow{
  color:#2878df !important;
  font-weight:700 !important;
}

.history-trip-time{
  font-weight:700 !important;
  color:#102a43 !important;
  white-space:nowrap !important;
}

.history-trip-distance{
  color:#2878df !important;
  font-weight:700 !important;
  white-space:nowrap !important;
}

.history-trip-header > span:nth-child(4),
.history-trip-header > span:nth-child(5){
  color:#64778b !important;
  white-space:nowrap !important;
}


/* ---------- DETAIL JÍZDY ---------- */

.history-trip-body{
  width:100% !important;
  box-sizing:border-box !important;

  border-top:1px solid #e5ebf1 !important;
  padding:16px !important;

  background:#fbfcfe !important;
}

.history-trip-detail{
  display:grid !important;
  grid-template-columns:
    repeat(6,minmax(0,1fr)) !important;

  gap:10px !important;
}

.history-trip-detail > div{
  background:#fff !important;
  border:1px solid #e0e6ec !important;
  border-radius:8px !important;
  padding:10px 12px !important;
}

.history-trip-detail span{
  display:block !important;
  color:#75879a !important;
  font-size:12px !important;
  margin-bottom:4px !important;
}

.history-trip-detail b{
  display:block !important;
  color:#17324d !important;
  font-size:13px !important;
}

.history-trip-actions{
  margin-top:12px !important;
}


/* ---------- MOBIL ---------- */

@media(max-width:1000px){

  .history-filter-grid{
    grid-template-columns:
      repeat(2,minmax(0,1fr)) !important;
  }

  .history-summary{
    grid-template-columns:
      repeat(2,minmax(0,1fr)) !important;
  }

  .history-day-header{
    grid-template-columns:
      28px
      150px
      minmax(0,1fr) !important;
  }

  .history-day-stats{
    justify-content:flex-start !important;
    flex-wrap:wrap !important;
    gap:8px 18px !important;
  }

  .history-trip-header{
    grid-template-columns:
      28px
      minmax(130px,1fr)
      90px
      100px
      100px !important;
  }

  .history-trip-detail{
    grid-template-columns:
      repeat(2,minmax(0,1fr)) !important;
  }
}

@media(max-width:760px){

  .history-filter-grid{
    grid-template-columns:1fr !important;
  }

  .history-summary{
    grid-template-columns:1fr !important;
  }

  .history-day-header{
    grid-template-columns:
      28px
      1fr !important;

    padding:10px 12px !important;
  }

  .history-day-stats{
    grid-column:2 !important;
    justify-content:flex-start !important;
  }

  .history-trip-header{
    grid-template-columns:
      24px
      1fr !important;

    gap:5px !important;
    padding:10px 12px !important;
  }

  .history-trip-header > span:nth-child(3),
  .history-trip-header > span:nth-child(4),
  .history-trip-header > span:nth-child(5){
    grid-column:2 !important;
  }

  .history-trip-detail{
    grid-template-columns:1fr !important;
  }
}
/* =========================================================
   WEBGPS – KNIHA JÍZD – MAPA TRASY
   ========================================================= */

.history-map-overlay{
  position:fixed;
  inset:0;
  z-index:9999;

  background:rgba(8,25,42,.62);

  display:flex;
  align-items:center;
  justify-content:center;

  padding:30px;
  box-sizing:border-box;
}

.history-map-window{
  width:min(1200px,96vw);
  height:min(760px,90vh);

  background:#fff;
  border-radius:14px;

  overflow:hidden;

  box-shadow:
    0 20px 70px rgba(0,0,0,.28);

  display:flex;
  flex-direction:column;
  box-sizing:border-box;
}

.history-map-header{
  min-height:58px;

  padding:0 16px 0 20px;

  display:flex;
  align-items:center;
  justify-content:space-between;

  gap:10px;

  border-bottom:1px solid #e3e9ef;

  color:#102a43;
  background:#fff;
}

.history-trip-map{
  flex:1;
  min-height:0;
  width:100%;
}


/* Mobil */

@media(max-width:760px){

  .history-map-overlay{
    padding:10px;
  }

  .history-map-window{
    width:100%;
    height:95vh;
  }

  .history-map-header{
    min-height:52px;
    padding:0 10px;
  }
}
.history-map-overlay{
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgba(8,25,42,.62);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:30px;
}

.history-map-window{
  width:96vw;
  max-width:1200px;
  height:90vh;
  background:#fff;
  border-radius:14px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.history-map-header{
  min-height:58px;
  padding:0 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid #e3e9ef;
}

.history-trip-map{
  flex:1;
  min-height:600px;
  width:100%;
}