html {
  font-size: 16px;
}

@media (min-width: 768px) {
  html {
    font-size: 17px;
  }
}

/* ---------- Large, accessible input forms (mobile / low-vision) ---------- */
.big-form .form-label {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: .25rem;
}

.big-form .form-control,
.big-form .form-select,
.big-form textarea {
  font-size: 1.35rem;
  padding: .6rem .8rem;
  min-height: 3.2rem;
}

.big-form .form-check-label {
  font-size: 1.2rem;
}

.big-form .form-check-input {
  width: 1.5rem;
  height: 1.5rem;
  margin-top: .15rem;
}

.big-form .btn {
  font-size: 1.2rem;
  padding: .7rem 1.1rem;
}

/* Primary save button: extra large, full width, easy to tap */
.big-form .btn-save {
  font-size: 1.5rem;
  font-weight: 600;
  padding: .9rem;
  width: 100%;
}

/* Collapsible "Iz slik" (create-from-photos) header */
.ocr-toggle {
  border: 0;
  background: transparent;
  box-shadow: none !important;
}
.ocr-chevron {
  transition: transform .2s ease;
}
.ocr-toggle:not(.collapsed) .ocr-chevron {
  transform: rotate(180deg);
}
.ocr-preview {
  display: block;
  height: 64px;
  width: auto;
  max-width: 100%;
  border-radius: .4rem;
  border: 2px solid var(--bs-success, #198754);
  margin-bottom: .35rem;
}
.ocr-ready .badge {
  font-size: .95rem;
}

.ocr-zoomable {
  cursor: zoom-in;
}

/* Full-screen image lightbox (tap thumbnail to open, tap anywhere to close) */
.ocr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .85);
  cursor: zoom-out;
}
.ocr-lightbox.show {
  display: flex;
}
.ocr-lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  border-radius: .5rem;
  box-shadow: 0 0 30px rgba(0, 0, 0, .6);
}
.ocr-lightbox-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  font-size: 1.4rem;
  line-height: 1;
}

/* Quick switch between new drive / new refuel */
.entry-switch {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
}

.entry-switch .btn {
  flex: 1 1 0;
  font-size: 1.25rem;
  font-weight: 600;
  padding: .8rem .5rem;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Work-hours list: flat day shading, one consistent colour per state.
   table-striped/table-hover in Bootstrap 5.3 tint rows via an inset box-shadow
   overlay (not background-color), so we must clear that overlay too — otherwise
   odd/even overtime rows show two different greens. */
.wh-over > td,
.wh-under > td,
.wh-partial > td { box-shadow: none !important; }
.wh-over > td { background-color: #d1e7dd !important; }    /* nad pričakovanim (nadure) */
.wh-under > td { background-color: #f8d7da !important; }   /* ni vnosa dela (primanjkljaj) */
.wh-partial > td { background-color: #fff8e1 !important; } /* delno delo (manj kot pričakovano) */

/* ---------- Mobile grid views (phones): fit the screen ---------- */
@media (max-width: 575.98px) {
  /* Tables that aren't converted to cards scroll horizontally in their own
     panel instead of pushing the page wider than the screen. */
  table.table:not(.table-cards) {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Card tables: each row becomes a stacked "label: value" card. */
  .table-cards thead { display: none; }
  .table-cards,
  .table-cards tbody,
  .table-cards tfoot { display: block; width: 100%; }

  .table-cards tr {
    display: block;
    border: 1px solid #dee2e6;
    border-radius: .6rem;
    overflow: hidden;          /* clip cell backgrounds to the rounded corners */
    margin-bottom: .6rem;
    background: #fff;          /* whole-card background lives on the row */
  }

  .table-cards td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border: 0 !important;
    padding: .4rem .8rem !important;  /* padding on the cell so the row colour reaches the edges */
    text-align: right;
    white-space: normal !important;   /* override text-nowrap on phones */
    overflow-wrap: anywhere;
    background: transparent !important;   /* let the row colour show through */
    box-shadow: none !important;          /* drop stripe/hover overlays in card mode */
  }
  .table-cards td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #6c757d;
    text-align: left;
    white-space: nowrap;
  }
  /* Cells without a label (actions / spacers): no label, content to the right. */
  .table-cards td:not([data-label]) { justify-content: flex-end; }
  .table-cards td:not([data-label])::before { content: none; }

  /* Note cell: label on top, text left-aligned below (reads better than right-aligned). */
  .table-cards td.td-note {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: .1rem;
  }

  /* Whole-card colours (row-level, so they fill edge to edge). */
  .table-cards tr.wh-over { background: #d1e7dd; }
  .table-cards tr.wh-under { background: #f8d7da; }
  .table-cards tr.wh-partial { background: #fff8e1; }
  .table-cards tr.table-info { background: var(--bs-info-bg-subtle, #cff4fc); }
  .table-cards tr.table-secondary { background: var(--bs-secondary-bg-subtle, #e2e3e5); }
}

/* ---------- Work-hours calendar (Koledar) ---------- */
/* Wrapper hosts the loading spinner overlay shown while the next month page loads. */
.cal-wrap { position: relative; }
.cal-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .65);
  z-index: 10;
}
.wh-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .35rem;
  position: relative;   /* positioning context for the Dopust span bar */
}
/* Continuous bar spanning consecutive Dopust (vacation) days; drawn/positioned in JS.
   Clickable: clicking the bar deletes the whole vacation block. */
.wh-cal .cal-dopust-bar {
  position: absolute;
  height: 1.4rem;
  background: #3d8b40;
  color: #fff;
  font-size: .8em;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .3rem;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  z-index: 3;
}
.wh-cal .cal-dopust-bar:hover { background: #2f6d32; }
.wh-cal .cal-head {
  text-align: center;
  font-weight: 600;
  color: #6c757d;
  padding: .25rem 0;
}
.wh-cal .cal-day {
  border: 1px solid #dee2e6;
  border-radius: .45rem;
  min-height: 6.5rem;
  padding: .3rem .4rem;
  font-size: .85rem;
  background: #fff;
  overflow: hidden;
}
.wh-cal button.cal-day {
  display: flex;               /* buttons center content by default → force top-aligned column */
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.wh-cal button.cal-day:hover { border-color: #0d6efd; background: #eef5ff; }
.wh-cal .cal-day.other { background: #f8f9fa; color: #adb5bd; }
.wh-cal .cal-day.weekend { background: #f6f7f9; }
.wh-cal .cal-day.holiday { background: #fff3cd; }
/* Work-status shading for in-month workdays: red = no work logged, amber = partial day. */
.wh-cal .cal-day.cal-deficit { background: #f8d7da; }
.wh-cal .cal-day.cal-partial { background: #fff8e1; }
.wh-cal button.cal-day.cal-deficit:hover { background: #f5c2c7; }
.wh-cal button.cal-day.cal-partial:hover { background: #fdeec0; }
.wh-cal .cal-day.today { border-color: #0d6efd; }
.wh-cal .cal-day.selected { border-color: #0d6efd; box-shadow: inset 0 0 0 2px #0d6efd; }
/* Day number is the largest text; everything else is smaller info below it. */
/* Day number keeps the base size; all other info is a bit smaller than it. */
.wh-cal .cal-daynum { font-weight: 700; }
.wh-cal .cal-bottom { margin-top: auto; text-align: right; }   /* total above delta, pinned bottom-right */
.wh-cal .cal-worked { font-size: .8em; }                       /* total: not bold */
.wh-cal .cal-ot { font-weight: 700; font-size: .8em; }         /* overtime delta below total (blank row reserved when 0) */
.wh-cal .cal-session { color: #0d6efd; font-weight: 600; font-size: .8em; }
.wh-cal .cal-holiday-name { color: #b02a37; font-size: .8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-cal .cal-used { color: #0d6efd; font-size: .8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-cal .cal-note { color: #6c757d; font-size: .8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 575.98px) {
  .wh-cal { gap: .15rem; }
  .wh-cal .cal-head { font-size: .68rem; }
  .wh-cal .cal-day { min-height: 4.5rem; padding: .15rem .2rem; font-size: .62rem; border-radius: .3rem; }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}