/* MED IN MLEKO Tools – oblikovni sistem (docs/oblikovni-sistem.md) */

@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Medium.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-SemiBold.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("fonts/PlayfairDisplay-Variable.woff") format("woff"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("fonts/SpecialElite-Regular.woff") format("woff"); font-weight: 400; font-display: swap; }

:root {
  --creme: #fffbf7;
  --white: #ffffff;
  --brown: #3c2415;
  --brown-2: #5a4334;
  --gold: #c49a6c;
  --gold-text: #8a6337;
  --gold-tint: #f6ede3;
  --magenta: #ec008c;
  --magenta-text: #b8006d;
  --magenta-tint: #fde8f3;
  --night: #2e388e;
  --night-tint: #eceefa;
  --muted: #7a6a5e;
  --line: #eadfd3;
  --line-2: #f1e8de;
  --input: #d9c9b8;
  --head: #fdf8f2;
  --sand: #f3ece4;
  --success: #2f7a4f; --success-tint: #e7f3ec;
  --warning: #8a5200; --warning-tint: #fdf1dc;
  --danger: #b42318;  --danger-tint: #fdeceb;
  --r-sm: 6px;
  --r-md: 10px;
  --font: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--creme); color: var(--brown); font-family: var(--font); font-size: 15px; line-height: 1.5; min-width: 320px; }
body { display: flex; flex-direction: column; min-height: 100vh; }
body > main { flex: 1 0 auto; }
.topbar, .app-head, .site-footer { flex-shrink: 0; }
a { color: var(--night); }
a:hover { color: #1f2766; }
:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
img, svg { display: block; }
.i { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex-grow: 1; }
.inline { display: inline; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 500; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.wrap-anywhere { overflow-wrap: anywhere; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

/* Naslovi */
.h1, .h2, .h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.025em; line-height: 1.2; margin: 0; }
.h1 { font-size: 34px; }
.h-xl { font-size: 42px; }
.h2 { font-size: 22px; }
.h3 { font-size: 18px; }
.h-regular { font-weight: 400; }
p { margin: 0; }

/* Postavitev */
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 40px 64px; }
.wrap.narrow { max-width: 520px; padding-top: 56px; }
.app-head-inner { padding-top: 20px; padding-bottom: 0; }

/* Vrhnja vrstica */
.topbar { background: var(--brown); color: #fff; }
.topbar-inner { max-width: 1280px; margin: 0 auto; height: 64px; padding: 0 40px; display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.wordmark { font-family: "Special Elite", var(--mono); font-size: 26px; color: #fff; line-height: 1; }
.brand-tools { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.topbar-link { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; color: #fff; text-decoration: none; font: 500 14px var(--font); background: none; border: 0; border-radius: var(--r-sm); cursor: pointer; }
.topbar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--brown); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; margin: 0 4px; }

/* Glava aplikacije */
.app-head { background: #fff; border-bottom: 1px solid var(--line); }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brown); text-decoration: underline; }
.crumbs [aria-current] { color: var(--brown); }
.app-title-row { display: flex; align-items: center; gap: 16px; margin: 14px 0 16px; }
.app-title-row .h1 { flex-grow: 1; }
.tabs { display: flex; gap: 28px; font-size: 14px; font-weight: 500; }
.tabs a { padding: 4px 0 12px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--brown); }
.tabs a.on { color: var(--brown); border-bottom-color: var(--brown); }
.tabs.accent-night a.on { border-bottom-color: var(--night); }
.tabs.accent-gold a.on { border-bottom-color: var(--gold); }
.tabs.accent-magenta a.on { border-bottom-color: var(--magenta); }
.tabs-spacer { height: 8px; }

/* Znak aplikacije */
.chip-app { display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-md); flex-shrink: 0; }
.chip-md { width: 48px; height: 48px; }
.chip-lg { width: 56px; height: 56px; }
.chip-sm { width: 32px; height: 32px; border-radius: 8px; }
.chip-sm .i { width: 18px; height: 18px; }
.chip-night { background: var(--night-tint); color: var(--night); }
.chip-gold { background: var(--gold-tint); color: var(--gold-text); }
.chip-magenta { background: var(--magenta-tint); color: var(--magenta-text); }

/* Kartice */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
.pad { padding: 28px; }
.pad-x { padding: 20px 20px 4px; }
.empty { align-items: flex-start; }

/* Gumbi */
.btn { font: 500 14px var(--font); letter-spacing: -0.01em; height: 44px; padding: 0 18px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--brown); color: #fff; }
.btn-primary:hover { background: var(--brown-2); color: #fff; }
.btn-secondary { background: #fff; color: var(--brown); border-color: var(--input); }
.btn-secondary:hover { background: var(--head); color: var(--brown); }
.btn-ghost { background: transparent; color: var(--brown); }
.btn-ghost:hover { background: var(--sand); color: var(--brown); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1c13; color: #fff; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; }
.btn-icon-sm { width: 30px; height: 30px; padding: 0; }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] { background: #efe6dc; color: #9d8b7c; border-color: transparent; cursor: not-allowed; }
.btn-ghost:disabled { background: transparent; opacity: .35; }

/* Obrazci */
.field { display: flex; flex-direction: column; }
.label { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); }
.input { height: 44px; border: 1px solid var(--input); border-radius: var(--r-sm); background: #fff; padding: 0 14px; font: 400 14px var(--font); color: var(--brown); width: 100%; }
.input:focus { outline: 2px solid var(--magenta); outline-offset: 1px; }
.input.has-error, .input-prefix.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
.input-prefix { display: flex; align-items: stretch; height: 44px; border: 1px solid var(--input); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.input-prefix span { background: var(--head); color: var(--muted); display: flex; align-items: center; padding: 0 10px; border-right: 1px solid var(--input); font-size: 13px; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.input-prefix input { border: 0; flex-grow: 1; min-width: 0; padding: 0 10px; font: 400 14px var(--mono); color: var(--brown); }
.input-prefix:focus-within { outline: 2px solid var(--magenta); outline-offset: 1px; }
.input-prefix input:focus { outline: none; }
.input-icon { display: flex; align-items: center; gap: 10px; }
.input-icon input { border: 0; outline: none; flex-grow: 1; min-width: 0; height: 40px; font: inherit; color: inherit; background: transparent; }
.input-icon:focus-within { outline: 2px solid var(--magenta); outline-offset: 1px; }
.select { appearance: auto; }
.help { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.help-error { color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brown); }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset[disabled] { opacity: .55; }
.access-grid { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.access-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 16px; align-items: center; }
.access-app { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 500; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.form-narrow { max-width: 720px; }
.copy-row { display: flex; gap: 10px; }
.copy-row .input { flex-grow: 1; min-width: 0; font-size: 13px; }

/* Obvestila */
.alert { display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--r-md); font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.stack > .alert, .card .alert { margin-bottom: 0; }
.alert-info { background: var(--night-tint); color: var(--night); }
.alert-success { background: var(--success-tint); color: var(--success); }
.alert-warning { background: var(--warning-tint); color: var(--warning); }
.alert-error { background: var(--danger-tint); color: var(--danger); }
.alert a { color: inherit; }

/* Značke */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-neutral { background: var(--sand); color: var(--brown-2); }
.b-night { background: var(--night-tint); color: var(--night); }
.b-gold { background: var(--gold-tint); color: var(--gold-text); }
.b-magenta { background: var(--magenta-tint); color: var(--magenta-text); }
.b-success { background: var(--success-tint); color: var(--success); }
.b-warning { background: var(--warning-tint); color: var(--warning); }
.b-danger { background: var(--danger-tint); color: var(--danger); }

/* Filtri */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.search { width: 320px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; flex-grow: 1; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--input); background: #fff; font-size: 13px; font-weight: 500; color: var(--brown); display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.chip:hover { color: var(--brown); background: var(--head); }
.chip.on { background: var(--brown); border-color: var(--brown); color: #fff; }
.segmented { display: flex; border: 1px solid var(--input); border-radius: var(--r-sm); overflow: hidden; background: #fff; }
.segmented a { height: 42px; padding: 0 14px; display: flex; align-items: center; font-size: 13px; font-weight: 500; color: var(--brown); text-decoration: none; border-right: 1px solid var(--line); }
.segmented a:last-child { border-right: 0; }
.segmented a.on { background: var(--brown); color: #fff; }

/* Tabele */
.table-card { overflow: hidden; margin-bottom: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--head); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.row-link { color: var(--brown); text-decoration: none; }
.row-link:hover { text-decoration: underline; color: var(--brown); }
.short-row { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.short { font-size: 13px; color: var(--night); }
.target { max-width: 300px; }
.target span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-grip { width: 1%; white-space: nowrap; padding-right: 0 !important; }
.grip { display: inline-flex; color: #b8a898; cursor: grab; padding: 4px; border-radius: var(--r-sm); vertical-align: middle; }
.grip:hover { background: var(--sand); }
.move-buttons { display: inline-flex; gap: 0; vertical-align: middle; }
.move-buttons form { margin: 0; }
tr.is-archived td { background: #fdfaf6; color: var(--muted); }
tr.dragging { opacity: .4; }
tr.drop-before td { box-shadow: inset 0 2px 0 var(--magenta); }

/* Začetna stran */
.home-head { display: flex; flex-direction: column; gap: 8px; margin: 28px 0 32px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.tile { padding: 28px; display: flex; flex-direction: column; gap: 20px; min-height: 280px; text-decoration: none; color: var(--brown); }
.tile:hover { border-color: var(--gold); color: var(--brown); }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile-body { display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.tile-body .h2 { font-size: 28px; }
.tile-foot { border-top: 1px solid var(--line-2); padding-top: 16px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 500; }
.admin-strip { margin-top: 32px; padding: 20px 28px; display: flex; align-items: center; gap: 32px; background: var(--head); }
.admin-links { display: flex; gap: 28px; flex-wrap: wrap; font-size: 14px; font-weight: 500; }
.admin-links a { color: var(--brown); text-decoration: none; }
.admin-links a:hover { text-decoration: underline; }

/* Podrobnosti */
.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.history li { border-left: 2px solid var(--line); padding-left: 12px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.confirm summary { list-style: none; width: fit-content; }
.confirm summary::-webkit-details-marker { display: none; }
.confirm[open] summary { margin-bottom: 12px; }
.confirm-body { border: 1px solid var(--line); background: var(--warning-tint); border-radius: var(--r-md); padding: 16px; }
.confirm-body ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi-mini { display: flex; align-items: baseline; gap: 10px; }
.num-lg { font-family: var(--serif); font-weight: 700; font-size: 32px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.invite { margin-bottom: 20px; }

/* Statistika */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.kpi { padding: 22px 24px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi-note { font-size: 12px; color: var(--muted); }
.num-xl { font-family: var(--serif); font-weight: 700; font-size: 36px; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.bars { height: 200px; display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; }
.bar { width: 100%; height: var(--h); background: var(--gold); border-radius: 3px 3px 0 0; min-height: 0; }
.bar-today { background: var(--brown); }
.bars-axis { display: flex; justify-content: space-between; }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.meter-track { height: 8px; border-radius: 999px; background: var(--sand); }
.meter-fill { height: 8px; border-radius: 999px; background: var(--gold); width: var(--w); }

/* Administracija */
.app-form { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: start; }
.app-form-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; }
.app-form-fields .check { grid-column: 1 / -1; }

.show-sm { display: none; }

/* Noga */
.site-footer { border-top: 1px solid var(--line); background: var(--head); font-size: 13px; color: var(--muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 20px !important; padding-bottom: 20px !important; }
.site-footer a { display: inline-flex; align-items: center; gap: 6px; color: var(--brown); font-weight: 500; text-decoration: none; min-height: 44px; }
.site-footer a:hover { text-decoration: underline; }

/* Telefon */
@media (max-width: 760px) {
  .wrap { padding: 16px 16px 96px; }
  .wrap.narrow { padding-top: 24px; }
  .topbar-inner { height: 56px; padding: 0 8px 0 16px; }
  .wordmark { font-size: 21px; }
  .brand-tools { font-size: 10px; }
  .hide-sm { display: none !important; }
  .show-sm { display: block; }
  .h1 { font-size: 26px; }
  .h-xl { font-size: 30px; }
  .pad { padding: 18px; }
  .app-head-inner { padding-top: 14px; padding-bottom: 0; }
  .app-title-row { margin: 10px 0 12px; gap: 12px; }
  .chip-md { width: 40px; height: 40px; }
  .tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; text-align: center; }
  .tabs a { padding: 10px 0 12px; }
  .home-head { margin: 8px 0 20px; }
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .tile { min-height: 0; padding: 16px; flex-direction: row; align-items: center; gap: 14px; }
  .tile .chip-lg { width: 48px; height: 48px; }
  .tile-top { order: 0; }
  .tile-body { gap: 2px; }
  .tile-body .h2 { font-size: 20px; }
  .tile-body .muted { font-size: 13px; line-height: 1.4; }
  .tile-foot { border: 0; padding: 0; }
  .tile-foot span { display: none; }
  .admin-strip { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .toolbar { gap: 10px; }
  .search { width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
  .segmented { width: 100%; }
  .segmented a { flex: 1; justify-content: center; }
  .two-col, .grid-2-1 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .num-xl { font-size: 26px; }
  .bars { height: 140px; gap: 2px; }
  .access-row { grid-template-columns: 1fr; gap: 6px; }
  .app-form { grid-template-columns: 1fr; }
  .app-form-fields { grid-template-columns: 1fr; }
  .site-footer { padding-bottom: 80px; }
  .sticky-action { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px 20px; background: var(--creme); border-top: 1px solid var(--line); z-index: 10; }
  .sticky-action .btn { height: 48px; }

  /* Tabele postanejo kartice */
  .table-card { background: transparent; border: 0; overflow: visible; }
  .table.resp thead { display: none; }
  .table.resp, .table.resp tbody, .table.resp tr, .table.resp td { display: block; width: 100%; }
  .table.resp tr { background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px; position: relative; }
  .table.resp tr.is-archived { background: #fdfaf6; }
  .table.resp td { border: 0; padding: 4px 0; text-align: left; background: transparent !important; }
  .table.resp td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
  .table.resp td.num { text-align: left; }
  .table.resp td.cell-main .row-link { display: block; padding-right: 76px; }
  .table.resp td.actions { text-align: left; padding-top: 10px; }
  .table.resp .col-grip { position: absolute; top: 10px; right: 10px; width: auto; padding: 0; }
  .table.resp .col-grip .grip { display: none; }
  .table.resp .btn-icon-sm { width: 36px; height: 36px; }
  .target { max-width: none; }
  .table.resp td.m-inline { display: inline-block; width: auto; margin-right: 20px; vertical-align: top; }
  .short { overflow-wrap: break-word; min-width: 0; }
  .table.resp td.m-rank { position: absolute; top: 14px; right: 16px; margin: 0; }
}
