/* Actinia Group — interni protokoli
   Layout metaphor: operativni fascikel (binder) z barvnimi indeksnimi jezički po segmentih,
   kar posnema fizične mape "Mapa AG" iz samih protokolov. */

@font-face {
  font-family: "AG Mono Fallback";
  src: local("SF Mono"), local("Menlo"), local("Consolas");
}

[hidden] {
  display: none !important;
}

:root {
  --bg: #f2f1ee;
  --bg-tint: #ebe9e5;
  --surface: #ffffff;
  --surface-2: #f7f6f3;
  --border: #dcd9d3;
  --border-strong: #c7c3ba;
  --text: #1a1917;
  --text-dim: #6b675e;
  --text-faint: #9a958a;

  --brand: #c23a2c;
  --brand-ink: #ffffff;

  --tag-prodaja: #a3711f;
  --tag-prodaja-bg: #f4e6cd;
  --tag-poprodaja: #1f7a70;
  --tag-poprodaja-bg: #d9ede9;
  --tag-racun: #4a58a8;
  --tag-racun-bg: #e2e4f6;
  --tag-uprava: #3e7a3f;
  --tag-uprava-bg: #dcecdc;
  --tag-splosno: #6b675e;
  --tag-splosno-bg: #e7e5e0;
  --tag-imenik: #5b6472;
  --tag-dokumenti: #7d5a96;
  --tag-navodila: #2f7fa8;
  --tag-podjetja: #b5622a;
  --tag-gesla: #a3294a;

  --shadow: 0 1px 2px rgba(20, 18, 14, 0.06), 0 8px 24px -12px rgba(20, 18, 14, 0.18);
  --radius: 10px;

  --font-display: -apple-system, "Segoe UI Semibold", "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "AG Mono Fallback", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --bg-tint: #1d1e21;
    --surface: #1f2023;
    --surface-2: #26282b;
    --border: #34363a;
    --border-strong: #45484d;
    --text: #eeece7;
    --text-dim: #a8a49a;
    --text-faint: #767268;

    --brand: #e2604e;
    --brand-ink: #17181a;

    --tag-prodaja: #d9a44c;
    --tag-prodaja-bg: #3a3021;
    --tag-poprodaja: #5cbdb0;
    --tag-poprodaja-bg: #1c3532;
    --tag-racun: #8f9bef;
    --tag-racun-bg: #262a4a;
    --tag-uprava: #7fc082;
    --tag-uprava-bg: #223a26;
    --tag-splosno: #a8a49a;
    --tag-splosno-bg: #2c2d30;
    --tag-imenik: #9aa4b2;
    --tag-dokumenti: #b092c8;
    --tag-navodila: #5aa8d1;
    --tag-podjetja: #d99259;
    --tag-gesla: #e0789a;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  --bg: #17181a;
  --bg-tint: #1d1e21;
  --surface: #1f2023;
  --surface-2: #26282b;
  --border: #34363a;
  --border-strong: #45484d;
  --text: #eeece7;
  --text-dim: #a8a49a;
  --text-faint: #767268;
  --brand: #e2604e;
  --brand-ink: #17181a;
  --tag-prodaja: #d9a44c;
  --tag-prodaja-bg: #3a3021;
  --tag-poprodaja: #5cbdb0;
  --tag-poprodaja-bg: #1c3532;
  --tag-racun: #8f9bef;
  --tag-racun-bg: #262a4a;
  --tag-uprava: #7fc082;
  --tag-uprava-bg: #223a26;
  --tag-splosno: #a8a49a;
  --tag-splosno-bg: #2c2d30;
  --tag-imenik: #9aa4b2;
  --tag-dokumenti: #b092c8;
  --tag-navodila: #5aa8d1;
  --tag-podjetja: #d99259;
  --tag-gesla: #e0789a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
}

:root[data-theme="light"] {
  --bg: #f2f1ee;
  --bg-tint: #ebe9e5;
  --surface: #ffffff;
  --surface-2: #f7f6f3;
  --border: #dcd9d3;
  --border-strong: #c7c3ba;
  --text: #1a1917;
  --text-dim: #6b675e;
  --text-faint: #9a958a;
  --brand: #c23a2c;
  --brand-ink: #ffffff;
  --tag-prodaja: #a3711f;
  --tag-prodaja-bg: #f4e6cd;
  --tag-poprodaja: #1f7a70;
  --tag-poprodaja-bg: #d9ede9;
  --tag-racun: #4a58a8;
  --tag-racun-bg: #e2e4f6;
  --tag-uprava: #3e7a3f;
  --tag-uprava-bg: #dcecdc;
  --tag-splosno: #6b675e;
  --tag-splosno-bg: #e7e5e0;
  --tag-imenik: #5b6472;
  --tag-dokumenti: #7d5a96;
  --tag-navodila: #2f7fa8;
  --tag-podjetja: #b5622a;
  --tag-gesla: #a3294a;
  --shadow: 0 1px 2px rgba(20, 18, 14, 0.06), 0 8px 24px -12px rgba(20, 18, 14, 0.18);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); text-wrap: balance; margin: 0; }

a { color: var(--brand); }

::selection { background: var(--brand); color: var(--brand-ink); }

button { font-family: inherit; }

.skip-link {
  position: absolute; left: -999px; top: 0;
}
.skip-link:focus {
  left: 8px; top: 8px; z-index: 100;
  background: var(--brand); color: var(--brand-ink);
  padding: 8px 14px; border-radius: 6px;
}

/* ---------- App shell ---------- */

.app {
  display: grid;
  grid-template-columns: 268px 1fr;
  min-height: 100vh;
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: sticky; top: 0; z-index: 20; }
}

/* ---------- Rail / binder spine ---------- */

.rail {
  background: var(--bg-tint);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 22px 0 16px;
  gap: 18px;
}

.brand {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand .mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.brand .mark em {
  font-style: normal;
  color: var(--brand);
}
.brand .sub {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 20px;
}
.quick-link {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px;
}
.quick-link:hover { border-color: var(--border-strong); color: var(--text); }
.quick-link-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--badge, #c23a2c);
  color: #ffffff;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}
.quick-link-badge--img {
  background: var(--surface-2);
}
.quick-link-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.segments {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}

.seg-tab {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 11px 12px 11px 14px;
  cursor: pointer;
  color: var(--text-dim);
}
.seg-tab::before {
  content: "";
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--tab-color, transparent);
  opacity: 0;
  transition: opacity .15s ease;
}
.seg-tab .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.seg-tab .lbl {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.seg-tab .lbl strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
}
.seg-tab .lbl small {
  font-size: 11.5px;
  color: var(--text-faint);
}
.seg-tab:hover { background: var(--surface); }
.seg-tab.active {
  background: var(--surface);
  box-shadow: var(--shadow);
}
.seg-tab.active::before { opacity: 1; }
.seg-tab.active .num { color: var(--tab-color); }

.seg-tab[data-segment="prodaja"] { --tab-color: var(--tag-prodaja); }
.seg-tab[data-segment="poprodaja"] { --tab-color: var(--tag-poprodaja); }
.seg-tab[data-segment="racunovodstvo"] { --tab-color: var(--tag-racun); }
.seg-tab[data-segment="uprava"] { --tab-color: var(--tag-uprava); }
.seg-tab[data-segment="imenik"] { --tab-color: var(--tag-imenik); }
.seg-tab[data-segment="dokumenti"] { --tab-color: var(--tag-dokumenti); }
.seg-tab[data-segment="podjetja"] { --tab-color: var(--tag-podjetja); }
.seg-tab[data-segment="gesla"] { --tab-color: var(--tag-gesla); }
.seg-tab[data-segment="navodila"] { --tab-color: var(--tag-navodila); }

.rail-search {
  padding: 0 20px;
}
.rail-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13.5px;
  color: var(--text);
}
.rail-search input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.rail-search .hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
  padding: 0 2px;
}

.rail-foot {
  padding: 0 20px;
  font-size: 11px;
  color: var(--text-faint);
}

.theme-toggle {
  margin: 0 20px;
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}
.theme-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  padding: 6px 0;
  border-radius: 6px;
  cursor: pointer;
}
.theme-toggle button.active {
  background: var(--bg-tint);
  color: var(--text);
}

/* ---------- Main pane ---------- */

.pane {
  padding: 34px 40px 80px;
  max-width: 980px;
}
@media (max-width: 640px) {
  .pane { padding: 22px 16px 60px; }
}

.segment-panel { display: none; }
.segment-panel.active { display: block; }

.panel-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.panel-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--seg-color);
}
.panel-head h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.panel-head p {
  margin: 0;
  color: var(--text-dim);
  max-width: 62ch;
  font-size: 14.5px;
}

#panel-prodaja { --seg-color: var(--tag-prodaja); }
#panel-poprodaja { --seg-color: var(--tag-poprodaja); }
#panel-racunovodstvo { --seg-color: var(--tag-racun); }
#panel-uprava { --seg-color: var(--tag-uprava); }
#panel-imenik { --seg-color: var(--tag-imenik); }
#panel-dokumenti { --seg-color: var(--tag-dokumenti); }
#panel-podjetja { --seg-color: var(--tag-podjetja); }
#panel-gesla { --seg-color: var(--tag-gesla); }
#panel-navodila { --seg-color: var(--tag-navodila); }

.jump-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 28px;
}
.jump-row a {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.jump-row a:hover { border-color: var(--seg-color); color: var(--text); }

/* ---------- Cards / accordion ---------- */

.group-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 30px 0 10px;
}
.group-label:first-child { margin-top: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.card[open] { box-shadow: var(--shadow); border-color: var(--border-strong); }

.card > summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
}
.card > summary::-webkit-details-marker { display: none; }
.card > summary::before {
  content: "";
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--seg-color);
}
.card > summary .chevron {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 12px;
  transition: transform .15s ease;
  flex: none;
}
.card[open] > summary .chevron { transform: rotate(90deg); }

.card > summary .s-title {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
}
.card > summary .s-desc {
  font-size: 12.5px;
  color: var(--text-faint);
  font-weight: 400;
  display: none;
}
@media (min-width: 720px) {
  .card > summary { flex-wrap: nowrap; }
  .card > summary .s-desc { display: inline; }
  .card > summary .s-title::after { content: "—"; margin: 0 8px; color: var(--border-strong); }
}

.card-body {
  padding: 4px 16px 18px 33px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.card-body h4 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin: 16px 0 6px;
}
.card-body h4:first-child { margin-top: 0; }

.card-body p { margin: 0 0 10px; color: var(--text); }
.card-body ul, .card-body ol {
  margin: 0 0 10px;
  padding-left: 20px;
}
.card-body li { margin-bottom: 5px; }
.card-body li::marker { color: var(--text-faint); }
.card-body ul ul, .card-body ol ul {
  margin-top: 5px;
}

.note {
  background: var(--surface-2);
  border-left: 3px solid var(--seg-color);
  border-radius: 0 6px 6px 0;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-dim);
  margin: 10px 0;
}
.note strong { color: var(--text); }

.warn {
  border-left-color: var(--brand);
}
.warn strong { color: var(--brand); }

/* role / tag chips */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 5px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-prodaja { background: var(--tag-prodaja-bg); color: var(--tag-prodaja); }
.tag-poprodaja { background: var(--tag-poprodaja-bg); color: var(--tag-poprodaja); }
.tag-racun { background: var(--tag-racun-bg); color: var(--tag-racun); }
.tag-uprava { background: var(--tag-uprava-bg); color: var(--tag-uprava); }
.tag-splosno { background: var(--tag-splosno-bg); color: var(--tag-splosno); }

.role-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 7px;
  font-size: 13.5px;
}
.role-line .who {
  flex: none;
  min-width: 118px;
  font-weight: 600;
  color: var(--text);
}

/* tables */
.table-wrap { overflow-x: auto; margin: 10px 0 14px; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  min-width: 420px;
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
th {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 600;
  border-bottom: 1px solid var(--border-strong);
}
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--font-mono); }

/* contact cards */
.contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 8px 0 4px;
}
.contact {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 13px;
}
.contact .org {
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 4px;
}
.contact .line {
  font-size: 12.5px;
  color: var(--text-dim);
  display: block;
}
.contact .line a { color: var(--text-dim); }
.contact .line a:hover { color: var(--brand); }

/* email template blocks */
.mail {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 8px 0;
  font-size: 13px;
}
.mail .subj {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 6px;
}
.mail p { margin: 0 0 8px; color: var(--text-dim); }
.mail p:last-child { margin-bottom: 0; }

/* checklist */
.checklist { list-style: none; padding-left: 0; }
.checklist li {
  padding-left: 24px;
  position: relative;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 3px;
  width: 14px; height: 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 3px;
}

kbd, code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.92em;
}

.badge-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
}

footer.site-foot {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-top: 16px;
  font-size: 12px;
  color: var(--text-faint);
}

.no-results {
  display: none;
  padding: 40px 0;
  color: var(--text-faint);
  font-size: 13.5px;
}

/* ---------- Imenik ---------- */

.imenik-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.imenik-toolbar input[type="search"] {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text);
}
.imenik-toolbar input[type="search"]:focus {
  outline: 2px solid var(--seg-color, var(--brand));
  outline-offset: 1px;
}

.btn-primary {
  background: var(--seg-color, var(--brand));
  color: var(--brand-ink);
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-secondary {
  background: transparent;
  color: var(--seg-color, var(--brand));
  border: 1px dashed var(--seg-color, var(--brand));
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}
.btn-secondary:hover { background: var(--surface-2); }

.trr-row {
  display: grid;
  grid-template-columns: 2fr 1.4fr 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.trr-row input {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  width: 100%;
}
.trr-row input:focus {
  outline: 2px solid var(--seg-color, var(--brand));
  outline-offset: 1px;
}
@media (max-width: 640px) {
  .trr-row { grid-template-columns: 1fr 1fr; }
}

.trr-list {
  font-size: 12.5px;
  color: var(--text-dim);
}
.trr-list div { margin-bottom: 3px; }
.trr-list .trr-num { font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; }

/* ---------- Podjetja: kartice namesto suhoparne tabele ---------- */

.podj-cards {
  min-width: 760px;
}
.podj-cards-head {
  display: grid;
  grid-template-columns: 1.7fr 1.1fr 1.1fr 1.4fr 1.3fr 1.3fr 44px;
  gap: 14px;
  padding: 0 16px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 600;
}
.podj-card {
  display: grid;
  grid-template-columns: 1.7fr 1.1fr 1.1fr 1.4fr 1.3fr 1.3fr 44px;
  gap: 14px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(20, 18, 15, 0.06), 0 1px 1px rgba(20, 18, 15, 0.04);
  font-size: 13px;
}
.podj-card:nth-child(odd) {
  background: var(--bg-tint);
}
.podj-card:hover {
  border-color: var(--border-strong);
}
.podj-card a { color: var(--tag-navodila); }
.podj-card .cell-sub { margin-top: 2px; color: var(--text-dim); font-size: 12px; }
.podj-card .zavezanec-tag-wrap { margin-top: 4px; }
.podj-card .row-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}
@media (prefers-color-scheme: dark) {
  .podj-card { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
}
:root[data-theme="dark"] .podj-card { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
:root[data-theme="light"] .podj-card { box-shadow: 0 1px 3px rgba(20, 18, 15, 0.06), 0 1px 1px rgba(20, 18, 15, 0.04); }

@media (max-width: 860px) {
  .podj-cards-head { display: none; }
  .podj-card { grid-template-columns: 1fr; }
}

.p-dok-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 7px;
  background: var(--surface-2);
  margin-bottom: 6px;
  font-size: 12.5px;
}
.p-dok-item .p-dok-title { flex: 1; min-width: 0; overflow-wrap: break-word; }
.p-dok-item .size { color: var(--text-faint); font-size: 11px; }

/* ---------- Gesla: vstopna vrata + maskirana gesla ---------- */

.gesla-naslov-cell {
  cursor: pointer;
}
.gesla-naslov-cell:hover strong {
  text-decoration: underline;
}

#panel-gesla.segment-panel.active {
  max-width: 1320px;
}

#gesla-table {
  table-layout: fixed;
}
#gesla-table th:nth-child(1), #gesla-table td:nth-child(1) { width: 22%; }
#gesla-table th:nth-child(2), #gesla-table td:nth-child(2) { width: 20%; }
#gesla-table th:nth-child(3), #gesla-table td:nth-child(3) { width: 22%; }
#gesla-table th:nth-child(4), #gesla-table td:nth-child(4) { width: 12%; }
#gesla-table th:nth-child(5), #gesla-table td:nth-child(5) { width: 18%; }
#gesla-table th:nth-child(6), #gesla-table td:nth-child(6) { width: 56px; }

.gesla-whoami {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.gesla-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--surface-2);
  margin-bottom: 6px;
  font-size: 12.5px;
}
.gesla-user-row .gu-name { font-weight: 600; flex: 1; min-width: 0; }
.gesla-user-row .gu-tags { color: var(--text-faint); font-size: 11px; }
.gesla-user-row .gu-admin-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--seg-color, var(--brand));
  border: 1px solid var(--seg-color, var(--brand));
  border-radius: 5px;
  padding: 1px 6px;
}
.gesla-user-row button { flex: none; }

.vault-gate {
  display: flex;
  justify-content: center;
  padding: 60px 20px;
}
.vault-gate form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 340px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
}
.vault-gate h2 {
  font-size: 16px;
  margin-bottom: 4px;
}
.vault-gate input {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  text-align: center;
}
.vault-gate input:focus {
  outline: 2px solid var(--seg-color, var(--brand));
  outline-offset: 1px;
}

.secret-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.secret-text {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  letter-spacing: 0.04em;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.filter-group-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-right: 4px;
  flex: none;
}
.filter-chip {
  font-size: 12px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.filter-chip:hover { border-color: var(--seg-color, var(--brand)); }
.filter-chip.active {
  background: var(--seg-color, var(--brand));
  border-color: var(--seg-color, var(--brand));
  color: var(--brand-ink);
}

.imenik-status {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--text-faint);
  margin: 0 0 8px;
}
.imenik-status.is-error { color: var(--brand); }

#imenik-table th:first-child, #imenik-table td:first-child { width: 32px; }
#imenik-table td .cell-sub {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
}
#imenik-table .row-actions {
  white-space: nowrap;
  text-align: right;
}
.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-faint);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: var(--bg);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 30;
  font-size: 13px;
}
.selection-bar button {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--bg) 40%, transparent);
  color: var(--bg);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12.5px;
  cursor: pointer;
}
.selection-bar button:hover { background: color-mix(in srgb, var(--bg) 15%, transparent); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 8, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal h2 {
  font-size: 17px;
  margin-bottom: 2px;
}
.modal label, .inline-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.modal input, .modal select, .inline-form input, .inline-form select {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
  width: 100%;
}
.modal input:focus, .modal select:focus,
.inline-form input:focus, .inline-form select:focus {
  outline: 2px solid var(--seg-color, var(--brand));
  outline-offset: 1px;
}

.inline-form {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.inline-form h2 {
  font-size: 15px;
  margin-bottom: 14px;
}
.inline-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px 14px;
}
.inline-form datalist { display: none; }

.skupine-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px 14px;
  margin: 14px 0 0;
}
.skupine-fieldset legend {
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 0 4px;
}
.legend-hint {
  font-size: 11px;
  color: var(--text-faint);
  font-weight: 400;
}
.skupina-check {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text);
  margin: 4px 14px 4px 0;
  cursor: pointer;
}
.skupina-check input { width: auto; }

.cell-groups {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 2px;
}

.file-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
}
.file-meta .ext {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-dim);
}
.file-meta .size {
  color: var(--text-faint);
  font-size: 11px;
}
.file-missing {
  color: var(--text-faint);
  font-size: 12px;
  font-style: italic;
}
.file-meta .ext.is-link {
  color: var(--tag-dokumenti);
  border-color: currentColor;
}

/* ---------- Imenik: grouped sections ---------- */

.view-toggle {
  display: inline-flex;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 14px;
}
.view-toggle-btn {
  background: transparent;
  border: none;
  border-radius: 7px;
  padding: 9px 18px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-dim);
  cursor: pointer;
}
.view-toggle-btn:hover { background: var(--surface-2); }
.view-toggle-btn.active {
  background: var(--seg-color, var(--brand));
  color: var(--brand-ink);
}
.view-toggle-btn .count {
  font-family: var(--font-mono);
  font-weight: 400;
  opacity: 0.8;
  margin-left: 4px;
}

.imenik-select-all-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 16px;
  cursor: pointer;
  width: fit-content;
}

.imenik-section {
  margin-bottom: 32px;
}
.imenik-section-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  padding-bottom: 9px;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--section-accent, var(--border-strong));
}
.imenik-section-title .count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
}
.imenik-section-title .hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-faint);
  margin-left: auto;
}
.imenik-section-internal .imenik-section-title { --section-accent: var(--brand); }
.imenik-section-external {
  opacity: 0.94;
}
.imenik-section-external .imenik-section-title { --section-accent: var(--border-strong); color: var(--text-dim); }

.imenik-subgroup-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--subgroup-accent, var(--text-dim));
  background: var(--subgroup-accent-bg, var(--surface-2));
  border-left: 3px solid var(--subgroup-accent, var(--border-strong));
  padding: 5px 12px;
  margin: 24px 0 10px;
  border-radius: 0 7px 7px 0;
  display: inline-block;
}
.imenik-subgroup-label:first-of-type { margin-top: 4px; }

.imenik-subgroup-label.dept-uprava { --subgroup-accent: var(--tag-uprava); --subgroup-accent-bg: var(--tag-uprava-bg); }
.imenik-subgroup-label.dept-prodaja { --subgroup-accent: var(--tag-prodaja); --subgroup-accent-bg: var(--tag-prodaja-bg); }
.imenik-subgroup-label.dept-poprodaja { --subgroup-accent: var(--tag-poprodaja); --subgroup-accent-bg: var(--tag-poprodaja-bg); }
.imenik-subgroup-label.dept-racunovodstvo { --subgroup-accent: var(--tag-racun); --subgroup-accent-bg: var(--tag-racun-bg); }
.imenik-subgroup-label.dept-splosno { --subgroup-accent: var(--tag-splosno); --subgroup-accent-bg: var(--tag-splosno-bg); }

.imenik-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 8px;
  border-radius: 8px;
}
.imenik-row:hover { background: var(--surface-2); }
.imenik-row input[type="checkbox"] { margin-top: 3px; flex: none; }

.imenik-row .who {
  flex: 0 0 210px;
  min-width: 0;
}
.imenik-row .who strong {
  display: block;
  font-size: 13.5px;
  overflow-wrap: break-word;
}
.imenik-row .who .cell-sub { margin-top: 1px; }

.imenik-row .company-badge {
  font-size: 11px;
  color: var(--text-faint);
}

.imenik-row .contact {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 12.5px;
  color: var(--text-dim);
  min-width: 0;
}
.imenik-row .contact a { color: var(--text-dim); }
.imenik-row .contact a:hover { color: var(--brand); }

.imenik-row .row-actions {
  flex: none;
  margin-left: auto;
}

@media (max-width: 640px) {
  .imenik-row { flex-wrap: wrap; }
  .imenik-row .who { flex-basis: 100%; }
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.modal-actions button[type="button"] {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.modal-error {
  color: var(--brand);
  font-size: 12.5px;
  min-height: 16px;
  margin: 0;
}

@media print {
  .rail { display: none; }
  .app { display: block; }
  .card { break-inside: avoid; }
  .card-body { display: block !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
