/* ═══════════════════════════════════════════════════════
   TACHO MODULE — tacho.css
   Paleta: mapaopp.pl (#E8001D red, dark bg)
   ═══════════════════════════════════════════════════════ */

:root {
  --c-bg0:      #0D0D0D;
  --c-bg1:      #1A1A1A;
  --c-bg2:      #242424;
  --c-bg3:      #2E2E2E;
  --c-border:   #383838;
  --c-text:     #F0F0F0;
  --c-muted:    #888;
  --c-red:      #E8001D;
  --c-drive:    #3A8DDE;
  --c-pause:    #F5A623;
  --c-rest:     #27AE60;
  --c-other:    #7B7B7B;
  --c-ok:       #27AE60;
  --c-warn:     #F5A623;
  --c-err:      #E8001D;
  --radius:     6px;
  --font-main:  'Barlow', sans-serif;
  --font-cond:  'Barlow Condensed', sans-serif;
}

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

body {
  background: var(--c-bg0);
  color: var(--c-text);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────── */
.t-header {
  background: var(--c-bg1);
  border-bottom: 2px solid var(--c-red);
  padding: 14px 24px;
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
}
.t-logo { text-decoration: none; font-family: var(--font-cond); font-size: 22px; font-weight: 700; }
.t-logo__mapa { color: var(--c-text); }
.t-logo__opp  { color: var(--c-red); }
.t-header__title { font-family: var(--font-cond); font-size: 20px; font-weight: 600; }
.t-header__sub   { color: var(--c-muted); font-size: 13px; margin-left: auto; }

/* ── Layout ──────────────────────────────────────────── */
.t-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  padding: 20px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .t-wrap { grid-template-columns: 1fr; }
}

/* ── Calendar nav ────────────────────────────────────── */
.t-cal__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.t-cal__range {
  font-family: var(--font-cond);
  font-size: 17px;
  font-weight: 600;
  color: var(--c-text);
}

/* ── Week grid ───────────────────────────────────────── */
.t-weeks { display: flex; flex-direction: column; gap: 24px; }

.t-week { background: var(--c-bg1); border-radius: var(--radius); overflow: hidden; }
.t-week__head {
  background: var(--c-bg2);
  padding: 10px 16px;
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 600;
  color: var(--c-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.t-week__limit { font-size: 13px; }
.t-week__limit span { color: var(--c-text); }

/* ── Day row ─────────────────────────────────────────── */
.t-day {
  display: grid;
  grid-template-columns: 48px 1fr 110px 36px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--c-border);
  cursor: pointer;
  transition: background .15s;
}
.t-day:hover { background: var(--c-bg2); }
.t-day--today { border-left: 3px solid var(--c-red); padding-left: 13px; }

.t-day__label {
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 600;
  color: var(--c-muted);
  white-space: nowrap;
}
.t-day__label small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--c-bg3);
}

/* ── Timeline bar ────────────────────────────────────── */
.t-timeline {
  position: relative;
  height: 28px;
  background: var(--c-bg3);
  border-radius: 4px;
  overflow: hidden;
}
.t-timeline__seg {
  position: absolute;
  top: 0;
  height: 100%;
  transition: opacity .2s;
}
.t-timeline__seg:hover { opacity: .8; }
.t-timeline__seg--drive  { background: var(--c-drive); }
.t-timeline__seg--pause  { background: var(--c-pause); }
.t-timeline__seg--rest   { background: var(--c-rest); }
.t-timeline__seg--other  { background: var(--c-other); }

/* ── Day stats ───────────────────────────────────────── */
.t-day__stats {
  font-size: 12px;
  color: var(--c-muted);
  text-align: right;
  line-height: 1.6;
}
.t-day__stats strong { color: var(--c-text); }
.t-day__alert { font-size: 16px; }
.t-day__alert--ok   { color: var(--c-ok); }
.t-day__alert--warn { color: var(--c-warn); }
.t-day__alert--err  { color: var(--c-err); }

/* ── Progress bar ────────────────────────────────────── */
.t-progress {
  background: var(--c-bg3);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin: 4px 0;
}
.t-progress__bar {
  height: 100%;
  background: var(--c-drive);
  border-radius: 4px;
  transition: width .4s ease;
}
.t-progress--biweek .t-progress__bar { background: var(--c-red); }

/* ── Report panel ────────────────────────────────────── */
.t-report {
  background: var(--c-bg1);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 20px;
}
.t-report__title {
  font-family: var(--font-cond);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 10px;
}
.t-report__block { margin-bottom: 16px; }
.t-report__label { font-size: 12px; color: var(--c-muted); margin-bottom: 4px; }
.t-report__val   { font-size: 13px; font-weight: 600; margin-top: 4px; }
.t-report__violations { margin-top: 16px; }
.t-violation {
  background: rgba(232,0,29,.12);
  border-left: 3px solid var(--c-err);
  padding: 8px 12px;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
  margin-bottom: 8px;
  color: #ff6b6b;
}

/* ── Legend ──────────────────────────────────────────── */
.t-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--c-muted);
}
.t-legend__dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

/* ── Modal ───────────────────────────────────────────── */
.t-modal { position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center; }
.t-modal[hidden] { display: none; }
.t-modal__overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(2px);
}
.t-modal__box {
  position: relative;
  background: var(--c-bg1);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  animation: modalIn .18s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.t-modal__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.t-modal__date  { font-family: var(--font-cond); font-size: 20px; font-weight: 700; }
.t-modal__close { background: none; border: none; color: var(--c-muted); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.t-modal__close:hover { color: var(--c-text); }

.t-modal__blocks { margin-bottom: 16px; min-height: 20px; }
.t-block-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--c-bg2);
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 13px;
}
.t-block-item__dot {
  width: 10px; height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.t-block-item__del {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--c-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}
.t-block-item__del:hover { color: var(--c-err); }

.t-modal__form { border-top: 1px solid var(--c-border); padding-top: 16px; }
.t-modal__row {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.t-modal__row label { font-size: 13px; color: var(--c-muted); }
.t-modal__row input,
.t-modal__row select {
  background: var(--c-bg2);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 7px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--font-main);
  width: 100%;
}
.t-modal__row input:focus,
.t-modal__row select:focus {
  outline: none;
  border-color: var(--c-drive);
}
.t-modal__err {
  background: rgba(232,0,29,.15);
  color: #ff6b6b;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* ── Buttons ─────────────────────────────────────────── */
.t-btn {
  font-family: var(--font-cond);
  font-size: 15px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
}
.t-btn:active { transform: scale(.97); }
.t-btn--primary {
  background: var(--c-red);
  color: #fff !important;
  width: 100%;
}
.t-btn--primary:hover { opacity: .9; }
.t-btn--ghost {
  background: var(--c-bg2);
  color: var(--c-text);
  border: 1px solid var(--c-border);
}
.t-btn--ghost:hover { background: var(--c-bg3); }

/* ── Misc ────────────────────────────────────────────── */
.t-loading { text-align: center; color: var(--c-muted); padding: 40px; }
.t-footer  { text-align: center; color: var(--c-muted); font-size: 12px; padding: 24px; border-top: 1px solid var(--c-border); margin-top: 40px; }