/* crm.p71.eu — Mobile-first production styles · v2 atraktivni */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }

:root {
  /* Sočna paleta */
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;

  --primary: #6366f1;       /* indigo */
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.4);

  --accent: #ec4899;         /* pink za FAB */
  --accent-dark: #db2777;

  --success: #10b981;
  --success-bg: #d1fae5;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --info: #3b82f6;
  --info-bg: #dbeafe;

  --header-grad: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
  --primary-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --accent-grad: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.08);
  --shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 12px 32px rgba(17, 24, 39, 0.18);
  --shadow-primary: 0 6px 20px rgba(99, 102, 241, 0.35);

  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: calc(80px + var(--safe-bottom));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================================================
   HEADER — gradient z živim videzom
   ======================================================================== */
header {
  background: var(--header-grad);
  color: white;
  padding: calc(14px + var(--safe-top)) 18px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(76, 29, 149, 0.25);
}
header h1 {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
  background: linear-gradient(90deg, #fff 30%, #c7d2fe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
header .user {
  font-size: 11px;
  opacity: 0.75;
  white-space: nowrap;
  max-width: 38%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

/* ========================================================================
   NAV — velik, ikonast, interaktiven (bottom-bar mobile / top-tabs desktop)
   ======================================================================== */
nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(229, 231, 235, 0.8);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 40;
  padding: 6px 4px calc(6px + var(--safe-bottom));
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  gap: 4px;
}
nav button {
  background: none;
  border: none;
  padding: 8px 4px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 60px;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
  color: var(--text-muted);
  touch-action: manipulation;
}
nav button .nav-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.3s var(--ease-bounce);
  display: block;
  filter: grayscale(0.4) opacity(0.7);
}
nav button .nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
  line-height: 1.1;
}
nav button:active {
  transform: scale(0.92);
  background: rgba(99, 102, 241, 0.08);
}
nav button.active {
  color: var(--primary);
  background: linear-gradient(180deg, transparent, rgba(99, 102, 241, 0.10));
}
nav button.active .nav-icon {
  transform: translateY(-2px) scale(1.18);
  filter: none;
}
nav button.active .nav-label {
  font-weight: 700;
}
/* Active indicator (top pill) */
nav button.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--primary-grad);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 6px var(--primary-glow);
}
/* Ripple effect (JS-free) */
nav button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
nav button:active::after { opacity: 0.4; transition: opacity 0s; }

/* ========================================================================
   MAIN content + page transitions
   ======================================================================== */
main {
  padding: 18px 16px;
  max-width: 1500px;
  margin: 0 auto;
}
.page { display: none; }
.page.active {
  display: block;
  animation: page-in 0.32s var(--ease);
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.4px;
  background: linear-gradient(90deg, var(--text), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.subtitle {
  color: var(--text-muted);
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 500;
}

/* ========================================================================
   FORMS — bolj polished, gradient gumbi
   ======================================================================== */
.form-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  max-width: 760px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.form-field { display: flex; flex-direction: column; }
.form-field.full { grid-column: 1 / -1; }
label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #4b5563;
  margin-bottom: 6px;
  letter-spacing: 0.4px;
}
input, select, textarea {
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  background: white;
  min-height: 46px;
  width: 100%;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}
textarea { resize: vertical; min-height: 90px; }
.auto-number {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 2px dashed #10b981;
  color: #065f46;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-family: ui-monospace, monospace;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 1px;
}
.form-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* Bolj atraktivni gumbi z gradientom + scale on press */
button.primary, button.secondary {
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  min-height: 48px;
  touch-action: manipulation;
  width: 100%;
  border: none;
  transition: transform 0.12s var(--ease), box-shadow 0.2s var(--ease), opacity 0.2s var(--ease);
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}
button.primary {
  background: var(--primary-grad);
  color: white;
  box-shadow: var(--shadow-primary);
}
button.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px var(--primary-glow); }
button.primary:active { transform: scale(0.97); }
button.primary:disabled { background: #cbd5e1; cursor: wait; box-shadow: none; transform: none; opacity: 0.7; }
button.secondary {
  background: white;
  color: #4b5563;
  border: 2px solid var(--border);
}
button.secondary:hover { border-color: var(--primary); color: var(--primary); }
button.secondary:active { transform: scale(0.97); }

.info-box {
  background: linear-gradient(135deg, #eef2ff, #ede9fe);
  border-left: 4px solid var(--primary);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 13px;
  color: #3730a3;
  font-weight: 500;
}
.info-box ul { margin-left: 18px; margin-top: 6px; }

/* ========================================================================
   TOOLBAR + Filters
   ======================================================================== */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  position: sticky;
  top: calc(56px + var(--safe-top));
  background: var(--bg);
  padding: 10px 0;
  z-index: 30;
}
.toolbar select, .toolbar input {
  font-size: 14px;
  padding: 10px 12px;
  min-height: 42px;
}
.search { width: 100%; }
.toolbar-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#btn-clear-filters, #btn-sort {
  padding: 10px;
  font-size: 13px;
  min-height: 42px;
  width: 100%;
}
.sort-toggle {
  background: linear-gradient(135deg, #eef2ff, #fff)!important;
  border-color: var(--primary-light)!important;
  color: var(--primary)!important;
  font-weight: 700!important;
}

/* ========================================================================
   PREGLED — atraktivne kartice
   ======================================================================== */
.table-wrapper { background: transparent; }
table { display: none; }

.row-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.row-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  border-left: 4px solid var(--primary);
  touch-action: manipulation;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
  position: relative;
}
.row-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.row-card:active { transform: scale(0.98); }
.row-card[data-status="V delu"]         { border-left-color: var(--warning); }
.row-card[data-status="Poslano"]        { border-left-color: #f97316; }
.row-card[data-status="Na čakanju"]     { border-left-color: #6b7280; }
.row-card[data-status="Zaključeno"]     { border-left-color: var(--success); }
.row-card[data-status="Ni opravljeno"]  { border-left-color: var(--danger); }
.row-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
  margin-bottom: 4px;
}
.row-card .stev {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
  letter-spacing: 0.2px;
}
.row-card .title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
  font-size: 15px;
}
.row-card .meta {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.row-card .meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}

/* Status badges — vibrant z gradient hint */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge.povprasevanje { background: var(--info-bg); color: #1e40af; border-color: #93c5fd; }
.badge.v-delu        { background: var(--warning-bg); color: #92400e; border-color: #fcd34d; }
.badge.poslano       { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
.badge.cakanje       { background: #e5e7eb; color: #374151; border-color: #d1d5db; }
.badge.zakljuceno    { background: var(--success-bg); color: #065f46; border-color: #6ee7b7; }
.badge.ni-opravljeno { background: var(--danger-bg); color: #991b1b; border-color: #fca5a5; }

.prov-tag {
  display: inline-block;
  background: var(--info-bg);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
}
.price { font-family: ui-monospace, monospace; font-weight: 700; color: var(--success); white-space: nowrap; font-size: 13px; }
.price.estimate { color: var(--text-muted); font-weight: 600; font-style: italic; }

/* ========================================================================
   DASHBOARD
   ======================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.stat-card {
  background: var(--surface);
  padding: 14px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--primary-grad);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.stat-card .label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  line-height: 1.2;
  position: relative;
}
.stat-card .value {
  font-size: 26px;
  font-weight: 800;
  margin-top: 4px;
  color: var(--text);
  font-family: ui-monospace, monospace;
  letter-spacing: -0.5px;
  position: relative;
}
.stat-card .delta { font-size: 11px; color: var(--text-muted); margin-top: 2px; position: relative; }
.stat-card.alert {
  background: linear-gradient(135deg, #fee2e2, #fef2f2);
  border: 1px solid #fca5a5;
}
.stat-card.alert .value { color: var(--danger); }
.stat-card.success {
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
  border: 1px solid #6ee7b7;
}
.stat-card.success .value { color: var(--success); font-size: 22px; }

.dashboard-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
  gap: 8px;
}
.dashboard-controls .sort-toggle {
  width: auto;
  min-width: 200px;
  padding: 10px 14px;
  font-size: 13px;
  min-height: 42px;
}

.kanban {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.kanban-col {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  transition: background 0.2s var(--ease);
}
.kanban-col.drag-over {
  background: linear-gradient(135deg, #eef2ff, #ede9fe);
  box-shadow: inset 0 0 0 2px var(--primary), 0 8px 24px var(--primary-glow);
}
.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 2px;
}
.kanban-col-header h3 {
  font-size: 12px;
  text-transform: uppercase;
  color: #4b5563;
  letter-spacing: 0.6px;
  font-weight: 800;
}
.count {
  background: var(--primary-grad);
  color: white;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  min-width: 28px;
  text-align: center;
  box-shadow: 0 2px 6px var(--primary-glow);
}
.kanban-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--primary);
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kanban-card:active { transform: scale(0.97); }
.kanban-card.alert { border-left-color: var(--danger); }
.kanban-card.alert::after {
  content: "⚠";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 14px;
  filter: drop-shadow(0 0 3px var(--danger));
}
.kanban-card.dragging { opacity: 0.5; cursor: grabbing; transform: scale(1.02); }
.kanban-card .stev { font-size: 11px; color: var(--primary); font-family: ui-monospace, monospace; font-weight: 700; }
.kanban-card .title { font-size: 13px; font-weight: 700; margin-top: 2px; line-height: 1.3; color: var(--text); }
.kanban-card .meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.kanban-card .meta-row { display: flex; justify-content: space-between; margin-top: 6px; flex-wrap: wrap; gap: 4px; }
.kanban-card .city { color: var(--primary); font-weight: 600; font-size: 11px; }
.kanban-card .status-mini-select {
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 13px;
  min-height: 38px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: white;
  font-weight: 600;
  cursor: pointer;
}
.kanban-card .status-mini-select:focus { border-color: var(--primary); }

/* ========================================================================
   CHARTS
   ======================================================================== */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.chart-card {
  background: var(--surface);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.chart-card h3 { font-size: 14px; margin-bottom: 12px; color: var(--text); font-weight: 700; }
.chart-card canvas { max-height: 240px; }

/* ========================================================================
   MODAL — bottom-sheet style
   ======================================================================== */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  animation: backdrop-in 0.2s var(--ease);
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.modal-backdrop.open {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal {
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slide-up 0.3s var(--ease-bounce);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
}
@keyframes slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal header {
  background: var(--header-grad);
  padding: 16px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  position: static;
  border-radius: 0;
  box-shadow: none;
}
.modal header h3 { font-size: 16px; font-family: ui-monospace, monospace; font-weight: 700; }
.modal-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s var(--ease);
}
.modal-close:hover, .modal-close:active { background: rgba(255,255,255,0.3); }
.link-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  font-size: 14px;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 6px;
  font-family: inherit;
  margin-left: 6px;
  transition: background 0.2s var(--ease);
}
.link-btn:hover, .link-btn:active { background: rgba(255,255,255,0.25); }
.modal-body {
  padding: 18px 22px;
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-body .form-row { grid-template-columns: 1fr; }
.modal-actions {
  padding: 14px 18px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-direction: column-reverse;
  background: var(--bg);
}
.modal-actions button { width: 100%; }

/* ========================================================================
   SCAN review (PDF parsed data)
   ======================================================================== */
.scan-btn {
  background: var(--primary-grad);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 8px var(--primary-glow);
  transition: transform 0.12s var(--ease), box-shadow 0.2s var(--ease);
  flex: 1;
  min-width: 200px;
}
.scan-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px var(--primary-glow); }
.scan-btn:active { transform: scale(0.97); }
.scan-fields {
  background: #f9fafb;
  border-radius: var(--radius-sm);
  padding: 4px 14px;
}
.scan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.scan-row:last-child { border-bottom: none; }
.scan-label { font-size: 12px; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.scan-value { font-size: 13px; color: var(--text); font-weight: 700; text-align: right; word-break: break-word; }

/* ========================================================================
   FAB — Floating Action Button (Nova ponudba shortcut)
   ======================================================================== */
.fab {
  position: fixed;
  bottom: calc(86px + var(--safe-bottom));
  right: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: white;
  border: none;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.45);
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s var(--ease);
  font-family: inherit;
  font-weight: 300;
  line-height: 1;
}
.fab:hover { transform: scale(1.08) rotate(90deg); }
.fab:active { transform: scale(0.92); }

/* ========================================================================
   TOAST
   ======================================================================== */
#toast {
  position: fixed;
  bottom: calc(96px + var(--safe-bottom));
  left: 16px;
  right: 16px;
  z-index: 200;
  padding: 14px 18px;
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: none;
  text-align: center;
  animation: toast-in 0.25s var(--ease-bounce);
}
@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
#toast.success { background: linear-gradient(135deg, #10b981, #059669); display: block; }
#toast.error   { background: linear-gradient(135deg, #ef4444, #dc2626); display: block; }
#toast.info    { background: var(--primary-grad); display: block; }

/* ========================================================================
   TABLET (>=640px)
   ======================================================================== */
@media (min-width: 640px) {
  body { padding-bottom: 0; }
  header { padding: 16px 24px; }
  header h1 { font-size: 19px; }
  header .user { font-size: 13px; max-width: none; }

  nav {
    position: sticky;
    bottom: auto;
    top: calc(56px + var(--safe-top));
    grid-template-columns: repeat(4, auto);
    justify-content: start;
    border-top: none;
    border-bottom: 1px solid var(--border);
    padding: 4px 18px;
    gap: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    background: rgba(255,255,255,0.95);
  }
  nav button {
    flex-direction: row;
    font-size: 14px;
    padding: 12px 18px;
    min-height: 48px;
  }
  nav button .nav-icon { font-size: 18px; }
  nav button .nav-label { font-size: 14px; font-weight: 600; }
  nav button.active::before {
    top: auto;
    bottom: -1px;
    width: calc(100% - 24px);
    height: 3px;
    border-radius: 3px 3px 0 0;
  }

  .fab { display: none; }
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .kanban { display: grid; grid-template-columns: repeat(3, 1fr); }
  .kanban-col { min-height: 400px; }
  .charts-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr 1fr; }
  .form-row.three { grid-template-columns: 2fr 1fr 1fr; }
  .toolbar { flex-direction: row; flex-wrap: wrap; }
  .toolbar-filters { display: contents; }
  .search { flex: 1; min-width: 200px; max-width: 280px; }
  .form-actions { flex-direction: row; }
  .form-actions button { width: auto; }
  .modal-backdrop.open { align-items: center; padding: 20px; }
  .modal { border-radius: var(--radius-lg); max-width: 720px; max-height: 86vh; }
  .modal header { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-actions { flex-direction: row; justify-content: flex-end; }
  .modal-actions button { width: auto; }
  .modal-body .form-row { grid-template-columns: 1fr 1fr; }
  .modal-body .form-row.three { grid-template-columns: 2fr 1fr 1fr; }
  #toast { left: auto; right: 24px; max-width: 380px; bottom: 24px; }
}

/* ========================================================================
   DESKTOP (>=1024px)
   ======================================================================== */
@media (min-width: 1024px) {
  .kanban { grid-template-columns: repeat(6, 1fr); }
  .row-card-list { display: none; }
  .table-wrapper {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    overflow-x: auto;
  }
  table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
  }
  thead { background: linear-gradient(135deg, #f5f7fb, #fff); border-bottom: 1px solid var(--border); }
  th {
    text-align: left;
    padding: 12px 14px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.4px;
    white-space: nowrap;
  }
  td { padding: 14px; border-bottom: 1px solid #f3f4f6; font-size: 13px; vertical-align: top; }
  tr.row { cursor: pointer; transition: background 0.15s var(--ease); }
  tr.row:hover { background: linear-gradient(90deg, #eef2ff, transparent 40%); }
}

/* ========================================================================
   REDUCED MOTION — spoštuj preferenco
   ======================================================================== */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
