/* TESLAELECTRIC - Radno vreme i plata
   Čist, poslovno orijentisan dizajn u duhu elektro-struke: bela pozadina
   sa plavim akcentima (bez tamno-teget/crne palete). */

:root {
  --brand-950: #0a3866;
  --brand-900: #0f4c86;
  --brand-800: #14609f;
  --brand-700: #1c74b8;
  --brand-600: #2f8ed6;
  --brand-100: #e9f3fc;
  --brand-on-dark: #7ec8f5;

  --gray-50: #f6f7fa;
  --gray-100: #eef0f4;
  --gray-200: #e2e5ec;
  --gray-300: #cbd0db;
  --gray-500: #7c8494;
  --gray-600: #5b6473;
  --gray-700: #3b4453;
  --gray-900: #1c222e;

  --green-600: #1c8a52;
  --green-100: #e2f6ec;
  --red-600: #c0392b;
  --red-100: #fbe6e3;
  --blue-600: #2563eb;
  --blue-100: #e7effe;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 10px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 32px rgba(11, 31, 58, 0.16);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";

  --topbar-h: 64px;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
/* Fallback canvas colour behind the document (iOS Safari rubber-band
   overscroll, and any sliver outside the painted body) - brand navy reads
   far better than the default white flash, on every page. */
html { background: var(--brand-950); }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--gray-50);
  color: var(--gray-900);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, h4 { margin: 0 0 4px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 8px; }
a { color: inherit; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

.app-root { min-height: 100%; display: flex; flex-direction: column; }

/* ---------- Boot loader ---------- */
.boot-loader {
  height: 100vh;
  height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  background: linear-gradient(160deg, var(--brand-950), var(--brand-700));
  color: var(--gray-100);
}
.boot-mark { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: .6; transform: scale(.92);} }

/* ---------- Login page ---------- */
.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, var(--brand-700), var(--brand-950) 65%);
  /* viewport-fit=cover lets this bleed under the notch/home-indicator on
     iOS - pad the content itself in from those safe-area insets so the
     card never sits under the notch, while the background still fully
     covers the screen edge to edge instead of leaving a white sliver. */
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  position: relative;
  overflow: hidden;
}
.login-bg-logo {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  z-index: 0;
}
.login-bg-logo img {
  width: min(980px, 82vw);
  max-width: none;
  opacity: 0.2;
  user-select: none;
}
@media (max-width: 640px) {
  .login-bg-logo { align-items: flex-start; padding-top: 64px; }
  .login-bg-logo img { width: min(640px, 92vw); opacity: 0.22; }
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 28px;
  position: relative;
  z-index: 1;
}
.brand-mark {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  margin-bottom: 22px;
}
.brand-mark svg { flex-shrink: 0; }
.brand-mark .brand-text {
  font-size: 22px; font-weight: 800; letter-spacing: 0.02em;
  color: var(--brand-950);
}
.brand-mark .brand-text span { color: var(--brand-600); }
.version-tag {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: 0.04em; padding: 2px 7px; border-radius: 999px;
  vertical-align: middle; margin-left: 7px; text-transform: uppercase;
}
.brand-mark .version-tag { background: var(--brand-100); color: var(--brand-600); }
.brand-sub {
  text-align: center; color: var(--gray-500); font-size: 13px; margin-bottom: 26px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 13px; font-weight: 600; color: var(--gray-700);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  color: var(--gray-900);
  transition: border-color .15s, background .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand-600); background: #fff;
}
.field-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
/* "Prikaži lozinku" dugme (oko ikonica) unutar polja za lozinku. */
.password-field-wrap { position: relative; }
.password-field-wrap input { padding-right: 44px; }
.password-toggle-btn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--radius-sm);
  color: var(--gray-500); cursor: pointer; padding: 0;
}
.password-toggle-btn:hover { color: var(--gray-700); background: var(--gray-100); }
.password-toggle-btn:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 1px; }
/* Amount fields where scrolling/clicking the native spinner could
   accidentally change a typed value - digits must be typed by hand. */
input.no-spinner::-webkit-outer-spin-button,
input.no-spinner::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input.no-spinner {
  -moz-appearance: textfield;
  appearance: textfield;
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.checkbox-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  padding: 10px 12px; background: var(--gray-50); border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
}
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand-600); }
.checkbox-row label { font-weight: 600; font-size: 14px; color: var(--gray-700); cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-sm);
  padding: 11px 18px; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: transform .05s, box-shadow .15s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-700); }
.btn-block { width: 100%; }
.btn-secondary { background: var(--brand-900); color: #fff; }
.btn-secondary:hover { background: var(--brand-800); }
.btn-ghost { background: transparent; color: var(--brand-900); border: 1.5px solid var(--gray-300); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger { background: var(--red-100); color: var(--red-600); }
.btn-danger:hover { background: #f7d3ce; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-icon { padding: 8px; border-radius: 8px; }

.login-error {
  background: var(--red-100); color: var(--red-600); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13px; margin-bottom: 16px; font-weight: 600;
}
.login-credit {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 1;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.02em;
  pointer-events: none;
}
@media (max-width: 640px) {
  .login-credit {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    font-size: 11px;
  }
}

/* ---------- Shell layout (post-login) ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand-950), var(--brand-900));
  color: var(--gray-100);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 40;
  transition: transform .2s ease;
}
.sidebar-brand {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-brand .brand-text { font-size: 17px; font-weight: 800; color: #fff; letter-spacing: .02em; }
.sidebar-brand .brand-text span { color: var(--brand-on-dark); }
.sidebar-close {
  display: none; background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 18px; line-height: 1; padding: 6px; cursor: pointer; border-radius: 6px;
}
.sidebar-close:hover { background: rgba(255,255,255,0.1); color: #fff; }
.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 9px; margin-bottom: 3px;
  color: rgba(255,255,255,0.75); font-weight: 600; font-size: 14px;
  cursor: pointer; transition: background .15s, color .15s;
}
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav .nav-link.active { background: #fff; color: var(--brand-900); }
.nav-badge {
  margin-left: auto; min-width: 19px; height: 19px; padding: 0 5px !important;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; flex-shrink: 0;
}
.nav-badge:hover { filter: brightness(1.08); }
.sidebar-nav .nav-section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,0.45); padding: 14px 12px 6px;
}
.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-footer .btn-ghost {
  color: #fff;
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.04);
}
.sidebar-footer .btn-ghost:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.4); }
.sidebar-footer .btn-ghost svg { stroke: #fff; }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.user-meta .user-name { font-size: 13.5px; font-weight: 700; color: #fff; }
.user-meta .user-role { font-size: 11.5px; color: rgba(255,255,255,0.55); text-transform: capitalize; }

.main-col { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: #fff; border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-size: 18px; font-weight: 800; color: var(--brand-900); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.hamburger { display: none; }

/* Extra bottom padding (beyond the 24px on every other side) leaves room
   for .notif-fab, which - unlike the mobile-only quick-add .fab - can float
   over the bottom of any page at any screen width, so the last card's
   content never ends up hidden behind it. */
.content { padding: 24px 24px 100px; flex: 1; width: 100%; max-width: 1200px; }

/* ---------- Cards / dashboard ---------- */
.card {
  background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200); padding: 20px;
}
.card + .card { margin-top: 18px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.card-header h2, .card-header h3 { font-size: 16px; color: var(--brand-900); }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.stat-card {
  background: #fff; border-radius: var(--radius-md); border: 1px solid var(--gray-200);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat-card .stat-label {
  font-size: 12px; color: var(--gray-500); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px;
}
.stat-card .stat-value { font-size: 22px; font-weight: 800; color: var(--brand-900); }
.stat-card .stat-sub { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.stat-card.accent { border-color: var(--brand-600); background: linear-gradient(160deg, #fff, var(--brand-100)); }
.stat-card.accent .stat-value { color: var(--brand-950); }
.stat-card.total { background: linear-gradient(160deg, var(--brand-900), var(--brand-700)); border: none; }
.stat-card.total .stat-label { color: rgba(255,255,255,0.65); }
.stat-card.total .stat-value { color: #fff; font-size: 26px; }
.stat-card.rate-hidden .stat-value {
  font-size: 15px; font-weight: 700; color: var(--brand-600);
  text-decoration: underline; text-underline-offset: 2px;
}
.stat-card.rate-toggle .stat-sub {
  color: var(--brand-600); font-weight: 700; text-decoration: underline;
  text-underline-offset: 2px; cursor: pointer;
}

/* ---------- Month picker (sole month navigation on the month page) ------ */
.month-picker-row {
  display: flex; align-items: center; justify-content: flex-start; gap: 12px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.month-picker-input {
  padding: 9px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--gray-200);
  background: #fff; color: var(--brand-900); font-weight: 700; font-size: 13.5px;
  flex-shrink: 0; cursor: pointer; text-align: left; font-family: var(--font-sans);
}
.month-picker-input:hover, .month-picker-input:focus { outline: none; border-color: var(--brand-600); }
/* Standalone trigger showing just the current month - bigger and clearer
   since it's the only month control on the page now (no more chip row). */
.current-month-picker .month-picker-input {
  padding: 13px 20px 13px 44px; font-size: 17px; border-radius: var(--radius-md);
  border-width: 2px; position: relative;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230a3866' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center;
}
.current-month-picker .month-picker-input::after {
  content: '▾'; margin-left: 10px; color: var(--gray-500); font-size: 12px;
}

/* ---------- Custom Serbian date/month picker (components/datePicker.js) --
   Native <input type="date"/"month"> pop-up calendars follow the browser's
   own language, not the page's - so entry dates and month navigation use
   this custom dropdown instead, always shown in Serbian. --------------- */
.date-picker { position: relative; width: 100%; }
.date-picker.month-picker { width: auto; }
.date-picker-trigger {
  width: 100%; text-align: left; cursor: pointer; font-family: var(--font-sans);
  padding: 11px 13px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  background: var(--gray-50); color: var(--gray-900); font-size: 14px;
  transition: border-color .15s, background .15s;
}
.date-picker-trigger:hover, .date-picker-trigger:focus {
  outline: none; border-color: var(--brand-600); background: #fff;
}
.date-picker-popup {
  position: fixed; z-index: 250; background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 12px;
  animation: fadeIn .1s ease;
}
.date-picker-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.date-picker-title { font-weight: 700; font-size: 13.5px; color: var(--brand-900); }
.date-picker-nav {
  width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--gray-200);
  background: #fff; color: var(--brand-800); font-size: 15px; line-height: 1; cursor: pointer;
}
.date-picker-nav:hover { border-color: var(--brand-600); background: var(--brand-100); }
.date-picker-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.date-picker-dow span { text-align: center; font-size: 11px; font-weight: 700; color: var(--gray-500); padding: 4px 0; }
.date-picker-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-picker-cell {
  width: 34px; height: 34px; border: none; background: none; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--gray-900); cursor: pointer;
}
.date-picker-cell:hover { background: var(--brand-100); }
.date-picker-cell.today { font-weight: 700; color: var(--brand-800); box-shadow: inset 0 0 0 1.5px var(--brand-600); }
.date-picker-cell.selected { background: var(--brand-900); color: #fff; font-weight: 700; }
.date-picker-cell.empty { cursor: default; }
.date-picker-cell.empty:hover { background: none; }
.date-picker-cell.disabled { color: var(--gray-300); cursor: not-allowed; }
.date-picker-cell.disabled:hover { background: none; }
.month-picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; min-width: 200px; }
.month-picker-cell {
  padding: 10px 6px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  background: #fff; color: var(--gray-700); font-size: 13px; font-weight: 600; cursor: pointer;
}
.month-picker-cell:hover { border-color: var(--brand-600); color: var(--brand-800); }
.month-picker-cell.selected { background: var(--brand-900); border-color: var(--brand-900); color: #fff; }
.month-picker-cell.disabled { color: var(--gray-300); cursor: not-allowed; }
.month-picker-cell.disabled:hover { border-color: var(--gray-200); color: var(--gray-300); }

/* Stat card showing a total that isn't final yet (month still in progress) */
.stat-card.pending { border-style: dashed; }
.stat-card.total.pending { background: linear-gradient(160deg, var(--gray-600), var(--gray-700)); }
.stat-card.total.pending .stat-value { color: rgba(255,255,255,0.85); font-size: 20px; }
.stat-card.total.pending .stat-sub { color: rgba(255,255,255,0.65); }
/* Stat card for an amount that subtracts from the total (deductions) */
.stat-card.negative .stat-value { color: var(--red-600); }

/* ---------- Salary breakdown ("receipt") ---------- */
.calc-breakdown {
  margin-top: 4px; padding-top: 16px; border-top: 1px dashed var(--gray-200);
}
.calc-breakdown-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 6px 0; font-size: 14px; color: var(--gray-700);
}
.calc-breakdown-row .calc-label { color: var(--gray-600); }
.calc-breakdown-row .calc-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.calc-breakdown-row.total {
  margin-top: 6px; padding-top: 14px; border-top: 2px solid var(--brand-900);
  font-size: 17px; font-weight: 800; color: var(--brand-950);
}
.calc-breakdown-row.total .calc-value { font-size: 19px; }

/* ---------- Lock badge / header actions ---------- */
.badge-locked { background: var(--gray-700); color: #fff; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- "Ko danas radi" panel ---------- */
.today-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.today-col-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.today-col-title.working { color: var(--green-600); }
.today-col-title.off { color: var(--gray-500); }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.person-chip { padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.person-chip.working { background: var(--green-100); color: var(--green-600); }
.person-chip.off { background: var(--gray-100); color: var(--gray-600); }

/* ---------- Missing-hours alert panel ---------- */
.alert-card { border-color: var(--red-100); background: linear-gradient(160deg, #fff, #fdf4f3); }
.alert-line { font-size: 14px; color: var(--red-600); font-weight: 600; padding: 4px 0; }
tr.row-alert { background: #fdf4f3; }
tr.row-alert:hover { background: #fbe8e6; }

/* ---------- Informational notice box (e.g. "these figures are approximate") ---------- */
.notice-box {
  background: #fdf6e8; border: 1px solid #f0dba6; color: #7a5a10;
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px;
  line-height: 1.5; margin-bottom: 16px;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--gray-200); }
table.data-table { width: 100%; border-collapse: collapse; min-width: 640px; background: #fff; }
table.data-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray-500); font-weight: 700; padding: 12px 14px; background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200); white-space: nowrap;
}
table.data-table td {
  padding: 12px 14px; border-bottom: 1px solid var(--gray-100); font-size: 14px; vertical-align: top;
}
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: var(--gray-50); }
table.data-table tr.clickable { cursor: pointer; }
th.sortable-th {
  cursor: pointer; user-select: none;
}
th.sortable-th:hover { color: var(--brand-900); }
th.sortable-th.active { color: var(--brand-900); }
th.sortable-th .sort-arrow { display: inline-block; font-size: 10px; }
.cell-muted { color: var(--gray-500); font-size: 13px; }
.cell-strong { font-weight: 700; color: var(--brand-900); }
.expense-tag {
  display: inline-block; background: var(--blue-100); color: var(--blue-600);
  border-radius: 6px; padding: 2px 7px; font-size: 12px; font-weight: 600; margin: 1px 3px 1px 0;
}
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-amber { background: var(--brand-100); color: var(--brand-900); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-green { background: var(--green-100); color: var(--green-600); }
.badge-red { background: var(--red-100); color: var(--red-600); }
.badge-blue { background: var(--blue-100); color: var(--blue-600); }

/* Inline "wasn't at work" marker on the monthly entries table, for a
   weekday with no logged work entry but a matching announced absence
   (godišnji/slava show as a badge instead; unexcused "odsutan" gets this
   bold red X so it stands out as something the admin should notice). */
.absence-x { color: var(--red-600); font-weight: 800; font-size: 16px; }

.row-actions { display: flex; gap: 6px; }

.empty-state {
  text-align: center; padding: 46px 20px; color: var(--gray-500);
}
.empty-state svg { margin-bottom: 10px; opacity: .5; }
.empty-state p { font-size: 14px; }

/* ---------- Učinak (grouped by employee) ---------- */
.ucinak-emp-section { border-top: 1px solid var(--gray-200); padding: 14px 0; }
.ucinak-emp-section:first-child { border-top: none; padding-top: 4px; }
.ucinak-emp-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ucinak-emp-name { font-weight: 700; color: var(--brand-900); font-size: 14.5px; }
.ucinak-emp-count { margin-left: auto; font-size: 12px; color: var(--gray-500); font-weight: 600; }
.ucinak-emp-empty { margin: 0 0 0 38px; }

/* ---------- Absences ("odsustva") list ---------- */
.absence-list { display: flex; flex-direction: column; }
.absence-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  padding: 14px 2px; border-bottom: 1px solid var(--gray-200);
}
.absence-row:last-child { border-bottom: none; }
.absence-row.own { background: var(--brand-100); margin: 0 -14px; padding-left: 14px; padding-right: 14px; border-radius: var(--radius-sm); border-bottom-color: transparent; }
.absence-row.unseen { background: var(--red-100); margin: 0 -14px; padding-left: 14px; padding-right: 14px; border-radius: var(--radius-sm); border-bottom-color: transparent; }
.absence-row-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.absence-name { font-weight: 700; color: var(--brand-900); font-size: 14px; }
.absence-range { font-size: 14px; color: var(--gray-700); font-weight: 600; }
.absence-note { font-size: 13px; color: var(--gray-500); flex-basis: 100%; }
@media (max-width: 640px) {
  .absence-row { flex-direction: column; align-items: flex-start; }
  .absence-row .row-actions { width: 100%; }
  .absence-row .row-actions .btn { flex: 1; }
}

/* ---------- Forms / modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 56, 102, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 32px 16px; overflow-y: auto; z-index: 100;
  animation: fadeIn .12s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: var(--radius-lg); width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}

/* Short informational notices (e.g. "bolji pregled na računaru") are
   centered in the middle of the screen, unlike the regular top-aligned
   (and, on mobile, edge-to-edge) modals used for forms. */
.modal-backdrop.notice-modal { align-items: center; }
.modal-backdrop.notice-modal .modal { max-width: 420px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 16.5px; color: var(--brand-900); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--gray-500); font-size: 20px; line-height: 1; padding: 4px; }
.modal-body { padding: 20px 22px; max-height: 70vh; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--gray-200); background: var(--gray-50); }

.expense-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.expense-row .field { margin-bottom: 0; flex: 1; }
.expense-row .field.amount { max-width: 130px; }
.add-expense-btn { margin-top: 4px; }

.form-error { background: var(--red-100); color: var(--red-600); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; margin-bottom: 14px; font-weight: 600; }
.form-success { background: var(--green-100); color: var(--green-600); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; margin-bottom: 14px; font-weight: 600; }

.divider { height: 1px; background: var(--gray-200); margin: 18px 0; }

.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.helper-text { color: var(--gray-500); font-size: 13px; }

/* Field-work allowance readout inside forms */
.allowance-readout {
  background: var(--brand-100); border: 1.5px dashed var(--brand-600); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 13.5px; color: var(--brand-900); font-weight: 600; margin-bottom: 16px;
}

/* Fab (mobile quick-add) */
.fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand-600); color: #fff;
  display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); border: none; cursor: pointer; font-size: 26px;
}

/* Notification fab - bottom-left, floats above the main content (not the
   sidebar itself, so it never sits under/behind the sidebar's own footer
   card). Only ever in the DOM when there's something unread/unseen to show
   - see attachNotificationFab() in shell.js - so it simply isn't there the
   rest of the time, same as the small inline sidebar badges it complements. */
.notif-fab {
  position: fixed; left: calc(var(--sidebar-w) + 20px); bottom: 20px; z-index: 45;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--brand-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); border: none; cursor: pointer;
  animation: notifFabPop .18s ease;
}
.notif-fab:hover { background: var(--brand-700); }
.notif-fab-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--red-600); color: #fff; font-size: 14px; font-weight: 900;
  min-width: 25px; height: 25px; border-radius: 13px; padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  border: 2.5px solid #fff; line-height: 1;
  box-shadow: 0 2px 5px rgba(192, 57, 43, 0.5);
}
@keyframes notifFabPop { from { transform: scale(.6); opacity: 0 } to { transform: scale(1); opacity: 1 } }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-500); margin-bottom: 14px; }
.breadcrumb a, .breadcrumb .crumb-link { color: var(--brand-800); font-weight: 700; cursor: pointer; }
.breadcrumb a:hover, .breadcrumb .crumb-link:hover { text-decoration: underline; }

/* Toast */
#toast-root { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--brand-950); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600; max-width: 320px;
  animation: slideIn .15s ease;
}
.toast.success { background: var(--green-600); }
.toast.error { background: var(--red-600); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0 } to { transform: translateX(0); opacity: 1 } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main-col { margin-left: 0; }
  .hamburger {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 8px; border: 1px solid var(--gray-200);
    background: #fff; cursor: pointer;
  }
  .sidebar-scrim {
    display: none; position: fixed; inset: 0; background: rgba(10,56,102,0.4); z-index: 39;
  }
  .sidebar-scrim.show { display: block; }
  .fab { display: flex; }
  /* Sidebar is off-canvas below this width (main-col spans full width), so
     the fab belongs at the true left edge of the screen here, not offset
     past a sidebar that's no longer taking up any horizontal space. */
  /* Bigger circle and an even more prominent red number on phones, where
     this button matters most (that's where employees actually use the
     app day to day) - a larger, easier-to-tap target with a badge that
     reads at a glance without squinting. */
  .notif-fab { left: 16px; bottom: 16px; width: 60px; height: 60px; }
  .notif-fab-badge {
    top: -7px; right: -7px; min-width: 27px; height: 27px; font-size: 15px;
    border-width: 3px;
  }
  .sidebar-nav .nav-link { padding: 13px 12px; }
  .sidebar-close { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
}

@media (max-width: 640px) {
  .content { padding: 14px 14px 88px; }
  .topbar { padding: 0 14px; }
  .topbar-title { font-size: 16px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 13px 14px; }
  .stat-card .stat-value { font-size: 19px; }
  .stat-card.total .stat-value { font-size: 22px; }
  .card { padding: 16px; }
  .modal { max-width: 100%; margin: 0; border-radius: var(--radius-md); }
  .modal-backdrop { padding: 0; align-items: flex-start; }
  .modal-backdrop .modal { border-radius: 0; min-height: 0; }
  /* Short informational notices stay centered, small, and rounded even on
     mobile - not the edge-to-edge full-screen treatment used for forms. */
  .modal-backdrop.notice-modal { align-items: center; padding: 20px 16px; }
  .modal-backdrop.notice-modal .modal { max-width: 420px; border-radius: var(--radius-lg); margin: 0; }
  .field-row { flex-direction: column; gap: 0; }
  .login-card { padding: 28px 20px; }

  /* Bigger, easier-to-tap controls on touch screens. */
  .btn { min-height: 44px; padding: 11px 16px; }
  .btn-sm { min-height: 38px; }
  .field input, .field select, .field textarea, .date-picker-trigger,
  .month-picker-input, .checkbox-row input[type="checkbox"] {
    font-size: 16px; /* prevents iOS Safari from auto-zooming on focus */
  }
  .field input, .field select, .field textarea, .date-picker-trigger { min-height: 44px; }
  .checkbox-row input[type="checkbox"] { width: 22px; height: 22px; }
  .month-picker-row { flex-direction: column; align-items: stretch; }
  .month-picker-input { min-height: 44px; width: 100%; }
  .card-header { gap: 12px; }
  .card-header .btn { width: 100%; }
  .header-actions { width: 100%; }
  .header-actions .btn { width: 100%; }
  .header-actions .month-picker-input { width: 100%; }
  .today-cols { grid-template-columns: 1fr; gap: 16px; }
  /* Full-width, stacked footer buttons instead of a cramped single row -
     there's plenty of vertical room in the full-screen mobile modal. */
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; }

  /* Stacked "card" layout for wide tables instead of horizontal scrolling. */
  table.responsive-table { min-width: 0; }
  table.responsive-table thead { display: none; }
  table.responsive-table, table.responsive-table tbody, table.responsive-table tr, table.responsive-table td {
    display: block; width: 100%;
  }
  table.responsive-table tr { padding: 12px 14px; border-bottom: 1px solid var(--gray-200); }
  table.responsive-table tr:last-child { border-bottom: none; }
  table.responsive-table td {
    border: none; padding: 5px 0; display: flex; align-items: flex-start;
    justify-content: space-between; gap: 12px; font-size: 13.5px;
  }
  table.responsive-table td::before {
    content: attr(data-label); font-weight: 700; color: var(--gray-500);
    font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
    flex-shrink: 0; padding-top: 1px;
  }
  table.responsive-table td:empty,
  table.responsive-table td.cell-actions { justify-content: flex-end; }
  table.responsive-table td.cell-actions::before { content: none; }
  table.responsive-table td.cell-actions .btn { width: auto; min-width: 84px; }
  table.responsive-table td.cell-actions .row-actions { flex-wrap: wrap; justify-content: flex-end; }

  /* Compact single-line-per-day layout just for "Radni unosi" (work-entry
     days) - the generic stacked layout above put every field (Datum, Dan,
     Sati, Lokacija, Teren, Troškovi...) on its own line, so each day ate up
     6-7 lines and the list got very long. Every value here already reads
     fine without an uppercase label in front of it (dates, "7 h", a place
     name, self-labelled badges) so this drops the labels and lays the
     whole day out as one wrapping line instead. */
  table.entries-table tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px;
  }
  table.entries-table td {
    display: inline-flex; width: auto; padding: 0; font-size: 13.5px;
  }
  table.entries-table td::before { content: none; }
  table.entries-table td.cell-strong { font-weight: 700; }
  table.entries-table td[data-label="Troškovi"]:has(.expense-tag) { flex-basis: 100%; }
  /* The whole row is already tappable (canEdit) - the explicit button just
     duplicated that and forced its own extra line when wrapped, so it's
     replaced with a small trailing chevron, same idea as a native list row. */
  table.entries-table td.cell-actions .btn { display: none; }
  table.entries-table tr.clickable::after {
    content: '›'; margin-left: auto; color: var(--gray-400);
    font-size: 20px; line-height: 1; align-self: center;
  }
}

/* --- PDF izvještaj (adminReport.js) - full-page printable report, no sidebar/topbar --- */
/* padding-top (not 0) deliberately stops .report-locked's top margin from
   collapsing through this container and the body above it - without it,
   the whole page shifts down and the navy html fallback colour shows
   through at the top. */
.report-app { min-height: 100vh; background: var(--gray-50); padding-top: 1px; }
.report-page {
  max-width: 980px; margin: 0 auto; background: #fff; padding: 26px 34px 40px;
  font-size: 12.5px; color: #1a2b3c; min-height: 100vh;
}
.report-toolbar { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.report-locked {
  max-width: 480px; margin: 60px auto; text-align: center; padding: 28px;
  background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.report-locked p { margin: 0 0 10px; }
.report-locked .btn { margin-top: 10px; }

.report-header-centered {
  text-align: center;
  border-bottom: 2px solid var(--brand-900); padding-bottom: 16px; margin-bottom: 20px;
}
.report-brand-mark-centered {
  width: 40px; height: 40px; border-radius: 9px; background: var(--brand-900);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 10px;
  overflow: hidden;
}
.report-brand-big { font-size: 26px; font-weight: 900; letter-spacing: 0.5px; color: var(--brand-950); text-transform: uppercase; }
.report-brand-big span { color: var(--brand-600); }
.report-subtitle-big { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--gray-600); text-transform: uppercase; margin-top: 5px; }
.report-meta-centered { margin-top: 14px; }
.report-title { font-size: 16px; font-weight: 700; color: var(--brand-950); }
.report-sub { font-size: 11.5px; color: var(--gray-500); margin-top: 3px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.summary-card { border: 1px solid var(--gray-200); border-radius: 8px; padding: 10px 12px; background: var(--gray-50); }
.summary-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; color: var(--gray-600); font-weight: 600; }
.summary-value { font-size: 16px; font-weight: 700; color: var(--brand-950); margin-top: 3px; }
.summary-card.total { background: var(--brand-100); border-color: var(--brand-600); }
.summary-card.total .summary-value { color: var(--brand-900); }

.report-section-title { font-size: 13px; color: var(--brand-950); margin: 22px 0 10px; }

table.report-table { width: 100%; border-collapse: collapse; margin-bottom: 4px; }
.report-table th, .report-table td { padding: 7px 9px; text-align: left; border-bottom: 1px solid var(--gray-200); }
.report-table th { background: var(--gray-100); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.2px; color: var(--gray-600); font-weight: 700; }
.report-table td { font-size: 12px; }
.report-table td.strong, .report-table th.strong { font-weight: 700; color: var(--brand-950); }
.report-table tbody tr:nth-child(even) { background: var(--gray-50); }
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.report-footer {
  margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--gray-200);
  display: flex; justify-content: space-between; font-size: 10.5px; color: var(--gray-500);
}

@media print {
  .report-toolbar { display: none; }
  .report-app { background: #fff; }
  .report-page { max-width: none; margin: 0; padding: 0; box-shadow: none; }
  @page { size: A4; margin: 10mm; }

  /* Compressed sizing so the whole report (header, summary, full employee
     table, notice, footer) fits on a single printed page instead of
     spilling onto a second one - screen viewing is untouched, these rules
     only apply once actually printing/saving as PDF. */
  .report-header-centered { padding-bottom: 8px; margin-bottom: 10px; }
  .report-brand-mark-centered { width: 26px; height: 26px; border-radius: 6px; margin: 0 auto 5px; }
  .report-brand-big { font-size: 17px; }
  .report-subtitle-big { font-size: 9px; letter-spacing: 0.6px; margin-top: 3px; }
  .report-meta-centered { margin-top: 7px; }
  .report-meta-centered .report-title { font-size: 12px; }
  .report-meta-centered .report-sub { font-size: 8.5px; margin-top: 2px; }

  .summary-grid { gap: 5px; margin-bottom: 10px; }
  .summary-card { padding: 5px 7px; }
  .summary-label { font-size: 7px; }
  .summary-value { font-size: 11px; margin-top: 1px; }

  .report-section-title { font-size: 10px; margin: 10px 0 5px; }

  .report-table th, .report-table td { padding: 3px 5px; }
  .report-table th { font-size: 7.5px; }
  .report-table td { font-size: 9px; }

  .notice-box { padding: 5px 8px; font-size: 8px; margin-top: 10px !important; }

  .report-footer { margin-top: 10px; padding-top: 6px; font-size: 7.5px; }
}
