:root {
  color-scheme: dark;

  --bg: #0a111d;
  --surface: #132238;
  --surface-2: #0f1d30;
  --surface-3: #1a2d48;
  --border: #304761;

  --text: #f4f7fb;
  --muted: #91a5bf;
  --muted-2: #6f849f;

  --primary: #3187f4;
  --primary-hover: #4b95f5;

  --success: #36d483;
  --warning: #f0b64e;
  --danger: #e15b50;

  --header-h: 72px;
  --nav-w: 235px;

  --shadow:
    0 20px 60px rgba(0, 0, 0, .30);
}

html[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef4fb;
  --border: #d9e2ec;

  --text: #172033;
  --muted: #607086;
  --muted-2: #8090a5;

  --primary: #2f75e8;
  --primary-hover: #2167d8;

  --success: #1e9c5a;
  --warning: #b7791f;
  --danger: #c43d34;

  --shadow:
    0 18px 55px rgba(15, 23, 42, .10);
}


* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}


/* =========================================================
 * LOGIN
 * ========================================================= */

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;

  background:
    radial-gradient(
      circle at 88% 4%,
      rgba(49, 135, 244, .18),
      transparent 34%
    ),
    var(--bg);
}

.login-card {
  width: min(100%, 520px);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 22px;

  background:
    linear-gradient(
      160deg,
      color-mix(in srgb, var(--surface) 96%, transparent),
      color-mix(in srgb, var(--surface-2) 98%, transparent)
    );

  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 13px;
  background: white;
}

.brand-eyebrow,
.header-brand-top {
  color: #78affb;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.brand-title {
  margin-top: 2px;
  font-size: clamp(23px, 5vw, 30px);
  font-weight: 900;
  line-height: 1.05;
}

.login-tagline {
  margin-top: 26px;
  color: var(--muted);
  font-size: 13px;
}

.login-card h1 {
  margin: 34px 0 8px;
  font-size: clamp(34px, 7vw, 46px);
}

.login-intro {
  margin: 0 0 27px;
  color: var(--muted);
  line-height: 1.55;
}

.login-card label {
  display: block;
  margin: 17px 0 8px;
  font-weight: 800;
}

.login-card input[type="email"],
.login-card input[type="password"],
.login-card input[type="text"] {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 13px;

  outline: none;

  background: var(--surface-2);
  color: var(--text);

  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    background .15s ease;
}

.login-card input:focus {
  border-color: var(--primary);
  background: var(--surface-3);

  box-shadow:
    0 0 0 3px rgba(49, 135, 244, .17);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 82px !important;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;

  min-height: 36px;
  padding: 7px 9px;

  transform: translateY(-50%);

  border: 0;
  border-radius: 9px;

  background: transparent;
  color: var(--muted);

  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.password-toggle:hover {
  background: color-mix(
    in srgb,
    var(--text) 7%,
    transparent
  );

  color: var(--text);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  margin-top: 17px;
}

.remember {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;

  margin: 0 !important;

  color: var(--muted);
  cursor: pointer;
}

.remember input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.link-button {
  border: 0;
  background: transparent;
  color: #82b4fb;
  padding: 6px 0;

  font-weight: 800;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.version-note {
  margin-top: 20px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}


/* =========================================================
 * COMMON BUTTONS / MESSAGES
 * ========================================================= */

.button {
  min-height: 44px;
  padding: 10px 16px;

  border-radius: 11px;
  border: 1px solid transparent;

  font-weight: 800;
  cursor: pointer;

  transition:
    background .15s ease,
    border-color .15s ease,
    opacity .15s ease,
    transform .05s ease;
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button:disabled {
  cursor: wait;
  opacity: .60;
}

.button-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.button-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.button-secondary:hover:not(:disabled) {
  border-color:
    color-mix(
      in srgb,
      var(--primary) 65%,
      var(--border)
    );

  background:
    color-mix(
      in srgb,
      var(--primary) 7%,
      transparent
    );
}

.button-wide {
  width: 100%;
  margin-top: 20px;
}

.message {
  margin-top: 18px;
  padding: 13px 14px;

  border: 1px solid var(--border);
  border-radius: 12px;

  color: var(--muted);
  line-height: 1.5;
}

.message:empty {
  display: none;
}

.message.success {
  border-color:
    color-mix(
      in srgb,
      var(--success) 65%,
      transparent
    );

  background:
    color-mix(
      in srgb,
      var(--success) 12%,
      transparent
    );

  color:
    color-mix(
      in srgb,
      var(--success) 55%,
      white
    );
}

.message.warning {
  border-color:
    color-mix(
      in srgb,
      var(--warning) 65%,
      transparent
    );

  background:
    color-mix(
      in srgb,
      var(--warning) 12%,
      transparent
    );

  color:
    color-mix(
      in srgb,
      var(--warning) 60%,
      white
    );
}

.message.error {
  border-color:
    color-mix(
      in srgb,
      var(--danger) 70%,
      transparent
    );

  background:
    color-mix(
      in srgb,
      var(--danger) 12%,
      transparent
    );

  color:
    color-mix(
      in srgb,
      var(--danger) 50%,
      white
    );
}


/* =========================================================
 * HEADER
 * ========================================================= */

.app-shell {
  min-height: 100vh;
  background: var(--bg);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;

  min-height: var(--header-h);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding: 10px 22px;

  border-bottom: 1px solid var(--border);
  background:
    color-mix(
      in srgb,
      var(--surface) 95%,
      transparent
    );

  backdrop-filter: blur(14px);
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 11px;

  border: 0;
  padding: 0;
  background: transparent;
  color: var(--text);

  text-align: left;
  cursor: pointer;
}

.header-logo {
  width: 43px;
  height: 43px;
  border-radius: 10px;
  object-fit: contain;
  background: white;
}

.header-brand-text {
  display: block;
}

.header-brand-top {
  display: block;
  font-size: 10px;
}

.header-brand-bottom {
  display: block;
  margin-top: 1px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.05;
}

.icon-button {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: transparent;
  color: var(--text);

  cursor: pointer;
}

.icon-button:hover {
  border-color:
    color-mix(
      in srgb,
      var(--primary) 60%,
      var(--border)
    );

  background:
    color-mix(
      in srgb,
      var(--primary) 8%,
      transparent
    );
}

.menu-button {
  display: none;
  font-size: 20px;
}

.role-chip {
  display: flex;
  align-items: center;
  gap: 8px;

  min-height: 42px;
  padding: 7px 11px;

  border: 1px solid var(--border);
  border-radius: 11px;

  background: var(--surface-2);
}

.role-chip-label {
  color: var(--muted);
  font-size: 11px;
}

.role-chip strong {
  font-size: 13px;
}

.loading-chip {
  opacity: .72;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 11px;
}

.user-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: right;
}

.user-copy strong {
  font-size: 13px;
}

.user-copy span {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: var(--muted);
  font-size: 11px;
}

.logout-button {
  min-height: 42px;
}


/* =========================================================
 * NAV
 * ========================================================= */

.shell-body {
  display: grid;
  grid-template-columns:
    var(--nav-w)
    minmax(0, 1fr);

  min-height:
    calc(
      100vh -
      var(--header-h)
    );
}

.app-nav {
  position: sticky;
  top: var(--header-h);

  height:
    calc(
      100vh -
      var(--header-h)
    );

  display: flex;
  flex-direction: column;

  padding: 18px 12px;

  overflow-y: auto;

  border-right: 1px solid var(--border);
  background: var(--surface);
}

.nav-section-title {
  padding: 2px 10px 9px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-modules {
  display: grid;
  gap: 4px;
}

.nav-item {
  width: 100%;
  min-height: 43px;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 9px 11px;

  border: 1px solid transparent;
  border-radius: 10px;

  background: transparent;
  color: var(--muted);

  text-align: left;
  font-weight: 700;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item.active {
  border-color:
    color-mix(
      in srgb,
      var(--primary) 25%,
      transparent
    );

  background:
    color-mix(
      in srgb,
      var(--primary) 14%,
      transparent
    );

  color:
    color-mix(
      in srgb,
      var(--primary) 75%,
      white
    );
}

.nav-icon {
  width: 21px;
  flex: 0 0 auto;
  text-align: center;
  font-size: 17px;
}

.nav-footer {
  margin-top: auto;
  padding: 15px 9px 4px;
  border-top: 1px solid var(--border);
}

.nav-footer-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;

  margin-top: 7px;

  color: var(--muted-2);
  font-size: 10px;
}

.nav-footer-row strong {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.nav-overlay {
  display: none;
}


/* =========================================================
 * CONTENT
 * ========================================================= */

.app-content {
  min-width: 0;
  padding: 28px;
}

.view {
  width: min(1220px, 100%);
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;

  margin-bottom: 22px;
}

.page-kicker,
.panel-kicker {
  color: #72aaf6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.page-head h1,
.placeholder-card h1 {
  margin: 4px 0 5px;
  font-size: clamp(30px, 4vw, 42px);
}

.page-head p,
.placeholder-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.context-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;

  margin-bottom: 18px;
}

.context-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  min-height: 35px;
  padding: 7px 10px;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: var(--surface);
  color: var(--muted);

  font-size: 11px;
}

.context-pill strong {
  color: var(--text);
}

.dashboard-cards,
.dashboard-loading {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.skeleton-card,
.panel,
.placeholder-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow:
    0 8px 28px
    color-mix(
      in srgb,
      black 9%,
      transparent
    );
}

.metric-card {
  min-height: 144px;
  padding: 18px;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.metric-value {
  margin-top: 14px;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -.025em;
}

.metric-note {
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 11px;
}

.skeleton-card {
  height: 144px;

  background:
    linear-gradient(
      90deg,
      var(--surface) 25%,
      var(--surface-3) 42%,
      var(--surface) 62%
    );

  background-size: 260% 100%;
  animation: skeleton 1.35s ease infinite;
}

@keyframes skeleton {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns:
    1.35fr
    .65fr;

  gap: 14px;

  margin-top: 14px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.panel h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.status-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
}

.status-ok {
  background: var(--success);
  box-shadow:
    0 0 0 4px
    color-mix(
      in srgb,
      var(--success) 15%,
      transparent
    );
}

.info-list {
  margin-top: 17px;

  overflow: hidden;

  border: 1px solid var(--border);
  border-radius: 12px;
}

.info-list > div {
  display: flex;
  justify-content: space-between;
  gap: 15px;

  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
}

.info-list > div:last-child {
  border-bottom: 0;
}

.info-list span {
  color: var(--muted);
  font-size: 12px;
}

.info-list strong {
  font-size: 12px;
  text-align: right;
}

.performance-value {
  display: flex;
  align-items: baseline;
  gap: 6px;

  margin-top: 27px;
}

.performance-value strong {
  font-size: 42px;
  letter-spacing: -.03em;
}

.performance-value span {
  color: var(--muted);
  font-size: 13px;
}

.panel-note {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}


/* =========================================================
 * PLACEHOLDER
 * ========================================================= */

.placeholder-card {
  max-width: 720px;
  margin: 58px auto;
  padding: 34px;
}

.placeholder-icon {
  width: 54px;
  height: 54px;

  display: grid;
  place-items: center;

  margin-bottom: 19px;

  border-radius: 14px;

  background:
    color-mix(
      in srgb,
      var(--primary) 14%,
      transparent
    );

  color:
    color-mix(
      in srgb,
      var(--primary) 75%,
      white
    );

  font-size: 25px;
}

.placeholder-security {
  display: flex;
  align-items: center;
  gap: 9px;

  margin: 21px 0;
  padding: 12px 13px;

  border: 1px solid
    color-mix(
      in srgb,
      var(--success) 38%,
      var(--border)
    );

  border-radius: 11px;

  background:
    color-mix(
      in srgb,
      var(--success) 9%,
      transparent
    );

  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}


/* =========================================================
 * TOAST
 * ========================================================= */

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;

  max-width: min(410px, calc(100vw - 36px));

  padding: 12px 14px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--surface);
  box-shadow: var(--shadow);

  color: var(--text);
  font-size: 12px;
}


/* =========================================================
 * RESPONSIVE
 * ========================================================= */

@media (max-width: 980px) {

  .menu-button {
    display: grid;
  }

  .role-chip {
    display: none;
  }

  .user-copy {
    display: none;
  }

  .shell-body {
    display: block;
  }

  .app-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    z-index: 80;

    width: min(82vw, 285px);
    height:
      calc(
        100vh -
        var(--header-h)
      );

    transform: translateX(-103%);
    transition: transform .18s ease;

    box-shadow: var(--shadow);
  }

  .app-nav.open {
    transform: translateX(0);
  }

  .nav-overlay {
    position: fixed;
    inset:
      var(--header-h)
      0
      0
      0;

    z-index: 70;

    display: block;

    background: rgba(0, 0, 0, .38);
  }

  .app-content {
    padding: 22px;
  }

  .dashboard-cards,
  .dashboard-loading {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }
}

@media (max-width: 650px) {

  .app-header {
    padding: 9px 12px;
  }

  .header-brand-bottom {
    font-size: 15px;
  }

  .header-logo {
    width: 39px;
    height: 39px;
  }

  .logout-button {
    display: none;
  }

  .app-content {
    padding: 17px 14px 25px;
  }

  .page-head {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .page-head .button {
    width: 100%;
  }

  .dashboard-cards,
  .dashboard-loading,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .context-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .context-pill:last-child {
    grid-column: 1 / -1;
  }

  .login-view {
    display: block;
    padding: 0;
  }

  .login-card {
    min-height: 100vh;
    width: 100%;

    padding:
      max(24px, env(safe-area-inset-top))
      22px
      max(25px, env(safe-area-inset-bottom));

    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .info-list > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .info-list strong {
    text-align: left;
  }
}


/* =========================================================
 * V1.6 – CORE REGISTERS READ-ONLY
 * ========================================================= */

.core-page-head {
  margin-bottom: 16px;
}

.core-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.readonly-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid
    color-mix(
      in srgb,
      var(--primary) 35%,
      var(--border)
    );
  border-radius: 999px;
  background:
    color-mix(
      in srgb,
      var(--primary) 10%,
      transparent
    );
  color:
    color-mix(
      in srgb,
      var(--primary) 78%,
      white
    );
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
}

.core-toolbar {
  display: grid;
  grid-template-columns:
    minmax(150px, .45fr)
    minmax(260px, 1.55fr)
    auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.core-control {
  display: grid;
  gap: 6px;
}

.core-control > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.core-control input,
.core-control select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
}

.core-control input:focus,
.core-control select:focus {
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px
    color-mix(
      in srgb,
      var(--primary) 15%,
      transparent
    );
}

.core-toolbar-buttons {
  display: flex;
  gap: 8px;
}

.core-toolbar-buttons .button {
  min-height: 42px;
}

.core-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 9px 2px 12px;
  color: var(--muted);
  font-size: 11px;
}

.core-meta strong {
  color: var(--text);
}

.core-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.core-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 12px;
}

.core-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.core-table td {
  max-width: 260px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.core-table tbody tr:last-child td {
  border-bottom: 0;
}

.core-table tbody tr:hover td {
  background:
    color-mix(
      in srgb,
      var(--primary) 5%,
      transparent
    );
}

.core-link {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #82b4fb;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}

.core-link:hover {
  border-color:
    color-mix(
      in srgb,
      var(--primary) 60%,
      var(--border)
    );
  background:
    color-mix(
      in srgb,
      var(--primary) 8%,
      transparent
    );
}

.core-cards {
  display: none;
}

.core-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.core-card-line {
  display: grid;
  grid-template-columns: 125px minmax(0, 1fr);
  gap: 11px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.core-card-line:last-of-type {
  border-bottom: 0;
}

.core-card-line span {
  color: var(--muted);
  font-size: 11px;
}

.core-card-line strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.core-card-actions {
  margin-top: 11px;
}

.core-loading {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.core-loading-bar {
  height: 16px;
  margin: 10px 0;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      var(--surface-2) 20%,
      var(--surface-3) 45%,
      var(--surface-2) 70%
    );
  background-size: 240% 100%;
  animation: skeleton 1.25s ease infinite;
}

.core-loading-bar.short {
  width: 64%;
}

.core-empty {
  padding: 34px 20px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.core-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.core-pager strong {
  min-width: 74px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

@media (max-width: 900px) {
  .core-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .core-search-control {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .core-toolbar-buttons {
    justify-content: flex-end;
  }
}

@media (max-width: 650px) {
  .core-head-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .readonly-badge {
    justify-content: center;
  }

  .core-toolbar {
    grid-template-columns: 1fr;
  }

  .core-search-control,
  .core-toolbar-buttons {
    grid-column: auto;
    grid-row: auto;
  }

  .core-toolbar-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .core-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .core-table-wrap {
    display: none;
  }

  .core-cards {
    display: grid;
    gap: 10px;
  }

  .core-card-line {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .core-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .core-pager strong {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}


/* =========================================================
 * V1.7 – DELO / CRM / PODPORA READ-ONLY
 * ========================================================= */

.v17-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 12px;
}

.v17-tab {
  min-height: 39px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.v17-tab:hover {
  color: var(--text);
  border-color:
    color-mix(
      in srgb,
      var(--primary) 45%,
      var(--border)
    );
}

.v17-tab.active {
  background:
    color-mix(
      in srgb,
      var(--primary) 15%,
      var(--surface)
    );
  border-color:
    color-mix(
      in srgb,
      var(--primary) 55%,
      var(--border)
    );
  color:
    color-mix(
      in srgb,
      var(--primary) 72%,
      white
    );
}

.v17-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.v17-control {
  display: grid;
  gap: 5px;
  min-width: 165px;
}

.v17-control > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.v17-control input,
.v17-control select {
  min-height: 41px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
}

.v17-control input[type="search"] {
  min-width: min(360px, 60vw);
}

.v17-control input:focus,
.v17-control select:focus {
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px
    color-mix(
      in srgb,
      var(--primary) 14%,
      transparent
    );
}

.v17-checkbox {
  min-height: 41px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.v17-checkbox input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
}

.v17-meta {
  min-height: 20px;
  margin: 4px 2px 10px;
  color: var(--muted);
  font-size: 11px;
}

.v17-loading {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.v17-metrics {
  display: grid;
  grid-template-columns:
    repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.v17-metrics.four {
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
}

.v17-metric {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}

.v17-metric-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.v17-metric-value {
  margin-top: 10px;
  font-size: 27px;
  font-weight: 900;
  letter-spacing: -.02em;
}

.v17-metric-note {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 10px;
}

.v17-summary-line {
  margin: 8px 2px 11px;
  color: var(--muted);
  font-size: 11px;
}

.v17-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.v17-table {
  width: 100%;
  min-width: 930px;
  border-collapse: collapse;
  font-size: 12px;
}

.v17-table th {
  padding: 10px 11px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  text-align: left;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.v17-table td {
  max-width: 280px;
  padding: 10px 11px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v17-table tbody tr:last-child td {
  border-bottom: 0;
}

.v17-table tbody tr:hover td {
  background:
    color-mix(
      in srgb,
      var(--primary) 5%,
      transparent
    );
}

@media (max-width: 1100px) {
  .v17-metrics {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }

  .v17-metrics.four {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .v17-controls {
    display: grid;
    grid-template-columns: 1fr;
  }

  .v17-control {
    min-width: 0;
  }

  .v17-control input[type="search"] {
    min-width: 0;
    width: 100%;
  }

  .v17-metrics,
  .v17-metrics.four {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .v17-table {
    min-width: 820px;
  }
}


/* =========================================================
 * V1.8/1.9 extra READ styles
 * ========================================================= */

.v189-inline-note {
  flex: 1 1 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.v189-subtitle {
  margin: 22px 0 10px;
  font-size: 18px;
}


/* V2.0/2.1 – WRITE + PHONE RESPONSIVE */

.core-row-actions,
.core-card-actions,
.ldm-write-actions,
.ldm-write-lifecycle {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.write-mini-button {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}

.write-mini-button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.write-mini-button.danger {
  border-color: color-mix(in srgb, var(--danger) 65%, var(--border));
  color: color-mix(in srgb, var(--danger) 55%, white);
}

.write-mini-button:disabled {
  opacity: .58;
  cursor: wait;
}

body.ldm-modal-open {
  overflow: hidden;
}

.ldm-write-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(4, 10, 18, .76);
  backdrop-filter: blur(5px);
}

.ldm-write-modal {
  width: min(820px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
}

.ldm-write-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.ldm-write-modal-head h2 {
  margin: 4px 0;
  font-size: 28px;
}

.ldm-write-modal-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.ldm-write-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ldm-write-field {
  display: grid;
  gap: 6px;
}

.ldm-write-field.span-2 {
  grid-column: 1 / -1;
}

.ldm-write-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.ldm-write-field input,
.ldm-write-field textarea {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
}

.ldm-write-field textarea {
  min-height: 120px;
  resize: vertical;
}

.ldm-write-field input:focus,
.ldm-write-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.ldm-write-note {
  margin-top: 13px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.ldm-write-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.ldm-write-lifecycle {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.ldm-write-loading {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 650px) {
  .ldm-write-overlay {
    align-items: end;
    padding: 0;
  }

  .ldm-write-modal {
    width: 100%;
    max-height: 94dvh;
    border-radius: 18px 18px 0 0;
    padding: 17px 14px max(18px, env(safe-area-inset-bottom));
  }

  .ldm-write-grid {
    grid-template-columns: 1fr;
  }

  .ldm-write-field.span-2 {
    grid-column: auto;
  }

  .ldm-write-field input,
  .ldm-write-field textarea {
    min-height: 48px;
    font-size: 16px;
  }

  .write-mini-button {
    min-height: 42px;
    padding: 9px 11px;
  }

  .ldm-write-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ldm-write-actions .write-mini-button {
    width: 100%;
  }

  .core-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .core-card-actions > * {
    width: 100%;
  }
}


/* =========================================================
 * V2.2 – Evidenca ur WRITE pilot
 * ========================================================= */

.evidence-write-modal {
  width: min(900px, 100%);
}

.evidence-user-note {
  margin-top: 0;
  margin-bottom: 14px;
}

.evidence-write-grid select {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
}

.evidence-write-grid select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.evidence-preview {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--success) 55%, var(--border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--success) 8%, var(--surface-2));
}

.evidence-preview.stale {
  opacity: .58;
  border-color: var(--border);
}

.evidence-preview-title {
  margin-bottom: 10px;
  color: var(--success);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.evidence-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.evidence-preview-grid > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
}

.evidence-preview-grid span,
.evidence-preview-grid strong {
  display: block;
}

.evidence-preview-grid span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.evidence-preview-grid strong {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.evidence-preview-warning {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(245, 158, 11, .1);
  color: #fbbf24;
  line-height: 1.45;
}

.v220-add-hours {
  margin-left: auto;
}

@media (max-width: 800px) {
  .evidence-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 650px) {
  .evidence-write-grid select {
    min-height: 48px;
    font-size: 16px;
  }

  .evidence-write-actions {
    grid-template-columns: 1fr;
  }

  .evidence-preview-grid {
    grid-template-columns: 1fr 1fr;
  }

  .v220-add-hours {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 390px) {
  .evidence-preview-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
 * V2.3 – Delo WRITE expansion
 * ========================================================= */

.work-write-section {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.work-write-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.work-write-section-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.work-write-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.work-write-section-actions,
.work-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.work-write-detail-holder {
  margin-top: 14px;
}

.work-write-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.work-write-table {
  min-width: 720px;
  margin: 0;
}

.work-check-field {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.work-check-field input {
  width: auto;
  min-height: 0;
}

.billing-detail-grid {
  margin-bottom: 16px;
}

@media (max-width: 650px) {
  .work-write-section {
    padding: 13px;
  }

  .work-write-section-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .work-write-section-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .work-write-section-actions .write-mini-button,
  .work-inline-actions .write-mini-button {
    min-height: 44px;
  }

  .work-inline-actions {
    min-width: 180px;
  }
}


/* =========================================================
 * V2.4 – Cloud API pilot diagnostic banner
 * ========================================================= */

.v17-cloud-pilot {
  margin: 12px 0 16px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

@media (max-width: 650px) {
  .v17-cloud-pilot {
    font-size: 12px;
    line-height: 1.5;
  }
}


/* =========================================================
 * V2.5 – Evidence hybrid performance / clarity
 * ========================================================= */

.evidence-speed-note {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.evidence-recent-section {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.evidence-recent-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.evidence-recent-head h3 {
  margin: 0;
  font-size: 16px;
}

.evidence-recent-head span {
  color: var(--muted);
  font-size: 10px;
}

.evidence-recent-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.evidence-recent-item {
  position: relative;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}

.evidence-recent-item.just-saved {
  border-color: var(--success);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 13%, transparent);
}

.evidence-recent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.evidence-recent-top strong {
  font-size: 12px;
}

.evidence-recent-top span {
  color: var(--primary);
  font-weight: 900;
}

.evidence-recent-main {
  margin-top: 5px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-recent-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.evidence-just-saved-badge {
  display: inline-flex;
  margin-top: 7px;
  padding: 3px 7px;
  border: 1px solid var(--success);
  border-radius: 999px;
  color: var(--success);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

@media (max-width: 650px) {
  .evidence-recent-list {
    grid-template-columns: 1fr;
  }

  .evidence-recent-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .evidence-recent-item {
    padding: 12px;
  }

  .evidence-speed-note {
    font-size: 12px;
  }
}


/* =========================================================
 * V2.6 – Graphical monthly calendar
 * ========================================================= */

.ldm-calendar {
  margin: 8px 0 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}

.ldm-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 12px;
}

.ldm-calendar-header h3 {
  margin: 0;
  font-size: 22px;
  text-transform: capitalize;
}

.ldm-calendar-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.ldm-calendar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-nav-button {
  min-width: 42px;
}

.ldm-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0 18px 14px;
  color: var(--muted);
  font-size: 10px;
}

.ldm-calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ldm-calendar-legend-item::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.calendar-type-evidenca_ur {
  color: var(--primary);
}

.calendar-type-lastni_vnos {
  color: var(--success);
}

.calendar-type-praznik {
  color: #eab308;
}

.ldm-calendar-scroll {
  overflow: hidden;
  border-top: 1px solid var(--border);
}

.ldm-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.ldm-calendar-weekday {
  padding: 9px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.ldm-calendar-weekday:nth-child(7) {
  border-right: 0;
}

.ldm-calendar-day {
  position: relative;
  min-width: 0;
  min-height: 116px;
  padding: 8px;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.ldm-calendar-day:nth-child(7n) {
  border-right: 0;
}

.ldm-calendar-day:hover {
  background: var(--surface-2);
}

.ldm-calendar-day.outside {
  background: color-mix(in srgb, var(--surface-2) 45%, transparent);
  cursor: default;
}

.ldm-calendar-day.weekend {
  background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.ldm-calendar-day.holiday {
  background: color-mix(in srgb, #eab308 8%, var(--surface));
}

.ldm-calendar-day.today .ldm-calendar-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 27px;
  height: 27px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
}

.ldm-calendar-day.selected {
  box-shadow: inset 0 0 0 2px var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.ldm-calendar-day-number {
  display: inline-block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 900;
}

.ldm-calendar-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ldm-calendar-event {
  display: block;
  overflow: hidden;
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ldm-calendar-event.calendar-type-evidenca_ur {
  border-left: 3px solid var(--primary);
  color: var(--text);
}

.ldm-calendar-event.calendar-type-lastni_vnos {
  border-left: 3px solid var(--success);
  color: var(--text);
}

.ldm-calendar-event.calendar-type-praznik {
  border-left: 3px solid #eab308;
  color: var(--text);
}

.ldm-calendar-more {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.ldm-calendar-mobile-dots {
  display: none;
}

.ldm-calendar-detail {
  padding: 16px 18px 18px;
  background: var(--surface-2);
}

.ldm-calendar-detail-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 900;
  text-transform: capitalize;
}

.ldm-calendar-detail-empty {
  color: var(--muted);
  font-size: 11px;
}

.ldm-calendar-detail-event {
  padding: 10px 12px;
  margin-top: 7px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 10px;
  background: var(--surface);
}

.ldm-calendar-detail-event.calendar-type-evidenca_ur {
  border-left-color: var(--primary);
}

.ldm-calendar-detail-event.calendar-type-lastni_vnos {
  border-left-color: var(--success);
}

.ldm-calendar-detail-event.calendar-type-praznik {
  border-left-color: #eab308;
}

.ldm-calendar-detail-event-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ldm-calendar-detail-event-top strong {
  font-size: 12px;
}

.ldm-calendar-detail-event-top span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.ldm-calendar-detail-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

@media (max-width: 650px) {
  .ldm-calendar {
    border-radius: 14px;
  }

  .ldm-calendar-header {
    align-items: flex-start;
    padding: 14px 12px 10px;
  }

  .ldm-calendar-header h3 {
    font-size: 18px;
  }

  .ldm-calendar-subtitle {
    font-size: 10px;
  }

  .ldm-calendar-nav button {
    min-width: 38px;
    padding-left: 9px;
    padding-right: 9px;
  }

  .ldm-calendar-legend {
    padding: 0 12px 10px;
    font-size: 9px;
  }

  .ldm-calendar-weekday {
    padding: 7px 2px;
    font-size: 8px;
  }

  .ldm-calendar-day {
    min-height: 58px;
    padding: 5px 3px;
    text-align: center;
  }

  .ldm-calendar-day-number {
    margin-bottom: 4px;
    font-size: 10px;
  }

  .ldm-calendar-day.today .ldm-calendar-day-number {
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
  }

  .ldm-calendar-events {
    display: none;
  }

  .ldm-calendar-mobile-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    min-height: 7px;
  }

  .ldm-calendar-mobile-dots i {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--muted);
  }

  .ldm-calendar-mobile-dots i.calendar-type-evidenca_ur {
    background: var(--primary);
  }

  .ldm-calendar-mobile-dots i.calendar-type-lastni_vnos {
    background: var(--success);
  }

  .ldm-calendar-mobile-dots i.calendar-type-praznik {
    background: #eab308;
  }

  .ldm-calendar-detail {
    padding: 12px;
  }

  .ldm-calendar-detail-event-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}


/* =========================================================
 * V2.7 – Operational automation + clickable calendar details
 * ========================================================= */

.ldm-calendar-detail-event.clickable {
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.ldm-calendar-detail-event.clickable:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.ldm-calendar-detail-event.clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.ldm-calendar-detail-open {
  margin-top: 7px;
  color: var(--primary);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.automation-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface-2);
}

.automation-hero > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.automation-hero strong {
  font-size: 13px;
}

.automation-hero span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.automation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.automation-section {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}

.automation-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 13px 10px;
  border-bottom: 1px solid var(--border);
}

.automation-section-head h3 {
  margin: 0;
  font-size: 14px;
}

.automation-section-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.automation-count {
  font-size: 24px;
  line-height: 1;
}

.automation-list {
  max-height: 430px;
  overflow: auto;
  padding: 8px;
}

.automation-row {
  display: block;
  width: 100%;
  margin: 0 0 7px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.automation-row:last-child {
  margin-bottom: 0;
}

.automation-row:hover,
.automation-row.selected {
  border-color: var(--primary);
}

.automation-row.selected {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 12%, transparent);
}

.automation-row-main {
  min-width: 0;
}

.automation-row-main > strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 11px;
}

.automation-row-meta,
.automation-row-match {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.automation-row-match {
  color: var(--text);
}

.automation-otp-badge {
  display: inline-flex;
  margin-top: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 8px;
  font-weight: 900;
}

.automation-otp-badge.state-zanesljivo {
  border-color: var(--success);
  color: var(--success);
}

.automation-otp-badge.state-predlog,
.automation-otp-badge.state-nedokoncano,
.automation-otp-badge.state-caka_pregled,
.automation-otp-badge.state-vec_kandidatov {
  border-color: #eab308;
  color: #eab308;
}

.automation-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}

.automation-action-note {
  width: 100%;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.automation-empty {
  padding: 22px 10px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.automation-jobs {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.automation-jobs h3 {
  margin: 0 0 9px;
  font-size: 13px;
}

.automation-job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid var(--border);
  font-size: 9px;
}

.automation-job-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.automation-job-row small {
  color: var(--muted);
}

@media (max-width: 980px) {
  .automation-grid {
    grid-template-columns: 1fr;
  }

  .automation-list {
    max-height: 330px;
  }
}

@media (max-width: 650px) {
  .automation-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .automation-hero .write-mini-button {
    width: 100%;
  }

  .automation-job-row {
    grid-template-columns: 1fr auto;
  }

  .automation-job-row small {
    grid-column: 1 / -1;
  }
}


/* =========================================================
 * V2.8 – advanced Native OTP modal
 * ========================================================= */
.automation-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 8, 23, .76);
  backdrop-filter: blur(3px);
}
.automation-modal-overlay.hidden { display: none; }
.automation-modal {
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}
.automation-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.automation-modal-head h3 { margin: 0; font-size: 18px; }
.automation-modal-close {
  width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text); font-size: 24px; cursor: pointer;
}
.automation-modal-body { padding: 18px; }
.automation-modal-actions {
  display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px 18px;
}
.automation-modal-status { min-height: 20px; padding: 0 18px; color: var(--muted); font-size: 12px; }
.automation-modal-status.success { color: var(--success); }
.automation-modal-status.error { color: #f87171; }
.automation-modal-info,
.automation-warning {
  padding: 12px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--surface-2);
  font-size: 12px; line-height: 1.45;
}
.automation-warning { border: 1px solid rgba(245,158,11,.45); }
.automation-candidate-list { display: grid; gap: 8px; margin: 12px 0 16px; }
.automation-candidate {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.automation-candidate:hover { background: var(--surface-2); }
.automation-candidate span { display: grid; gap: 3px; }
.automation-candidate small { color: var(--muted); line-height: 1.35; }
.automation-confirm-check {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; color: var(--text); font-size: 12px;
}
.automation-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.automation-form-field { display: grid; gap: 6px; font-size: 11px; color: var(--muted); }
.automation-form-field input,
.automation-form-field select,
.automation-form-field textarea {
  width: 100%; box-sizing: border-box; padding: 10px 11px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface-2); color: var(--text); font: inherit;
}
@media (max-width: 650px) {
  .automation-modal-overlay { padding: 0; align-items: flex-end; }
  .automation-modal { width: 100%; max-height: 94vh; border-radius: 18px 18px 0 0; }
  .automation-form-grid { grid-template-columns: 1fr; }
  .automation-modal-actions { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); }
  .automation-modal-actions .write-mini-button { min-height: 46px; }
}

/* =========================================================
 * V2.9 – event-level calendar interaction
 * ========================================================= */
.ldm-calendar-event.clickable {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  text-align: left;
  cursor: pointer;
}

.ldm-calendar-event.clickable:hover {
  filter: brightness(.98);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.ldm-calendar-event.clickable:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.ldm-calendar-day:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* =========================================================
 * V2.10 – FUNCTIONAL PARITY + CLOUD STABILIZATION OVERRIDES
 * ========================================================= */

.message.compact-status {
  display: inline-flex;
  width: auto;
  min-height: 0;
  margin-top: 10px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
}

.core-toolbar {
  grid-template-columns: auto minmax(300px, 1fr) auto;
}

.core-dynamic-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.core-filter-control {
  min-width: 135px;
}

.core-table-wrap,
.v17-table-wrap {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.core-table {
  width: max(100%, 1120px);
}

.core-table th,
.core-table td {
  white-space: nowrap;
}

.core-table th:nth-child(5),
.core-table td:nth-child(5) {
  max-width: 310px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.core-table .core-actions-column {
  position: sticky;
  right: 0;
  z-index: 3;
  min-width: 132px;
  background: var(--surface);
  box-shadow: -10px 0 14px -14px rgba(0,0,0,.75);
}

.core-table thead .core-actions-column {
  z-index: 5;
  background: var(--surface-2);
}

.core-table tbody tr:hover .core-actions-column {
  background: var(--surface-2);
}

.v210-sticky-action {
  position: sticky;
  right: 0;
  z-index: 3;
  min-width: 110px;
  background: var(--surface);
  box-shadow: -10px 0 14px -14px rgba(0,0,0,.75);
}

.v17-table thead .v210-sticky-action {
  z-index: 5;
  background: var(--surface-2);
}

.v210-detail-panel,
.v210-lazy-section {
  margin: 14px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.v210-detail-panel > h2,
.v210-lazy-section > h2 {
  margin: 10px 0 8px;
}

.v210-detail-grid {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 0;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.v210-detail-key,
.v210-detail-value {
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.v210-detail-key {
  color: var(--muted);
  font-weight: 800;
  background: var(--surface-2);
}

.v210-detail-value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.v210-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v210-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.v210-kanban-column {
  min-height: 250px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.v210-kanban-column h3 {
  margin: 0 0 10px;
  font-size: 13px;
}

.v210-task-card,
.v210-task-calendar-item {
  display: grid;
  width: 100%;
  gap: 4px;
  margin: 0 0 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.v210-task-card small {
  color: var(--muted);
}

.v210-task-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  gap: 1px;
  min-width: 920px;
  border: 1px solid var(--border);
  background: var(--border);
}

.v210-calendar-weekday,
.v210-task-day {
  background: var(--surface);
  padding: 9px;
}

.v210-calendar-weekday {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.v210-task-day {
  min-height: 120px;
}

.v210-task-day.outside {
  opacity: .35;
}

.v210-task-calendar-item {
  margin-top: 6px;
  padding: 6px 7px;
  font-size: 11px;
}

/* Event detail in graphical calendar: clear label/value separation. */
.ldm-calendar-detail-meta,
.ldm-write-detail-grid,
.evidence-detail-grid {
  display: grid;
  grid-template-columns: minmax(110px, 165px) minmax(0, 1fr);
  gap: 6px 14px;
  align-items: start;
}

.ldm-calendar-detail-meta > *,
.ldm-write-detail-grid > *,
.evidence-detail-grid > * {
  min-width: 0;
  overflow-wrap: anywhere;
}


.evidence-detail-key {
  color: var(--muted);
  font-weight: 800;
}

.evidence-detail-value {
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .core-toolbar {
    grid-template-columns: 1fr;
  }

  .core-dynamic-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v210-detail-grid {
    grid-template-columns: 1fr;
  }

  .v210-detail-key {
    border-bottom: 0;
    padding-bottom: 3px;
  }

  .v210-detail-value {
    padding-top: 3px;
  }

  .evidence-detail-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .evidence-detail-key {
    margin-top: 7px;
  }
}

@media (max-width: 560px) {
  .core-dynamic-filters {
    grid-template-columns: 1fr;
  }

  .v210-kanban {
    grid-template-columns: repeat(5, minmax(78vw, 1fr));
  }
}

.ldm-write-note.compact {
  display: inline-flex;
  width: auto;
  margin: 10px 0 0;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12px;
}

/* =========================================================
 * V2.11 – ACTION SAFETY + ASYNC COMMAND UX
 * ========================================================= */

/* Global modal convention:
 * destructive actions stay visually separated on the far left;
 * normal/primary close/save actions stay on the right. */
.ldm-write-actions,
.evidence-write-actions {
  width: 100%;
  justify-content: flex-end;
}

.ldm-write-actions > .write-mini-button.danger,
.evidence-write-actions > .write-mini-button.danger {
  order: -1;
  margin-right: auto;
}

.v211-actions-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}

.v211-danger-zone,
.v211-safe-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.v211-danger-zone {
  justify-content: flex-start;
}

.v211-safe-zone {
  justify-content: flex-end;
  margin-left: auto;
}

.v211-permission-note {
  margin-top: 10px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.v211-comments {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.v211-comments h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.v211-comment-list {
  display: grid;
  gap: 8px;
}

.v211-comment {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  line-height: 1.45;
}

.v211-comment small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
}

.v211-comment.pending {
  border-style: dashed;
  opacity: .82;
}

.v211-comment-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
}

.v211-comment-compose textarea {
  width: 100%;
  min-height: 66px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

.v210-task-card .pending-mark,
.v210-task-calendar-item .pending-mark {
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 650px) {
  .v211-actions-split {
    display: grid;
    grid-template-columns: 1fr;
  }

  .v211-danger-zone,
  .v211-safe-zone {
    width: 100%;
    margin-left: 0;
  }

  .v211-danger-zone .write-mini-button,
  .v211-safe-zone .write-mini-button {
    flex: 1 1 140px;
  }

  .v211-comment-compose {
    grid-template-columns: 1fr;
  }

  /* On mobile destructive buttons still remain first, with close/save last. */
  .ldm-write-actions,
  .evidence-write-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .ldm-write-actions > .write-mini-button,
  .evidence-write-actions > .write-mini-button {
    flex: 1 1 140px;
  }

  .ldm-write-actions > .write-mini-button.danger,
  .evidence-write-actions > .write-mini-button.danger {
    margin-right: 0;
  }
}

/* Keep destructive actions separated in list/card action clusters as well. */
.core-row-actions > .write-mini-button.danger,
.core-card-actions > .write-mini-button.danger,
.v210-actions > .button-danger {
  order: -1;
  margin-right: auto;
}

.ldm-write-lifecycle > .write-mini-button.danger {
  order: -1;
  margin-right: auto;
}

/* =========================================================
   V2.12 / V2.12.1 – Functional parity, mobile cards and Kanban DnD
   ========================================================= */

.v212-task-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.v212-task-view-tabs .write-mini-button,
.v212-task-view-tabs button {
  min-height: 42px;
}

.v212-task-surface {
  min-width: 0;
}

.v212-mobile-cards {
  display: none;
}

.v212-mobile-card,
.v212-expandable-card {
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: clip;
}

.v212-mobile-card-summary,
.v212-expandable-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.v212-mobile-card-summary::-webkit-details-marker,
.v212-expandable-summary::-webkit-details-marker {
  display: none;
}

.v212-mobile-card-summary::after,
.v212-expandable-summary::after {
  content: '⌄';
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform .15s ease;
}

.v212-mobile-card[open] > .v212-mobile-card-summary::after,
.v212-expandable-card[open] > .v212-expandable-summary::after {
  transform: rotate(180deg);
}

.v212-mobile-card-title,
.v212-expandable-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.v212-mobile-card-meta,
.v212-expandable-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.v212-mobile-card-body,
.v212-expandable-body {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.v212-mobile-card-line {
  display: grid;
  grid-template-columns: minmax(92px, .42fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.v212-mobile-card-key {
  color: var(--muted);
  font-weight: 700;
}

.v212-mobile-card-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.v212-mobile-card-actions,
.v212-expandable-body .core-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.v212-mobile-card-actions button,
.v212-expandable-body button,
.v212-mobile-card-actions .write-mini-button {
  min-height: 44px;
}

/* Kanban */
.v212-kanban-note,
.v212-kanban-drag-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.v212-kanban-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  touch-action: manipulation;
}

.v212-kanban-card[draggable='true'] {
  cursor: grab;
}

.v212-kanban-card.dragging {
  opacity: .45;
  cursor: grabbing;
}

.v210-kanban-col.drag-over,
.v212-kanban-column.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
}

.v212-kanban-card.kanban-vstavi-pred::before,
.v212-kanban-card.kanban-vstavi-po::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.v212-kanban-card.kanban-vstavi-pred::before {
  top: -5px;
}

.v212-kanban-card.kanban-vstavi-po::after {
  bottom: -5px;
}

.v212-kanban-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.v212-kanban-open,
.v212-kanban-move {
  min-height: 40px;
}

.v212-kanban-move {
  max-width: 100%;
  min-width: 0;
}

/* Action clusters must never be clipped by horizontal table overflow. */
.v17-table td:last-child,
.v17-table th:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--surface-2);
}

@media (max-width: 760px), (pointer: coarse) {
  /* Tables remain available on desktop; mobile gets expandable cards instead. */
  .v17-table-wrap:has(+ .v212-mobile-cards) .v17-table,
  .v17-table-wrap:has(.v212-mobile-cards) .v17-table {
    display: none;
  }

  .v212-mobile-cards {
    display: grid;
    gap: 10px;
  }

  .v212-task-view-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v212-task-view-tabs > * {
    width: 100%;
    min-width: 0;
  }

  .v212-mobile-card-line {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .v212-mobile-card-actions,
  .v212-kanban-card-actions,
  .core-row-actions,
  .core-card-actions,
  .ldm-write-actions,
  .evidence-write-actions,
  .v211-safe-zone,
  .v211-danger-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
  }

  button,
  .write-mini-button,
  .core-action-button,
  .v210-button {
    min-height: 44px;
    touch-action: manipulation;
  }

  .v212-kanban-card {
    cursor: default;
  }

  .v212-kanban-drag-hint {
    display: none;
  }

  /* No key action may be pushed outside the viewport on mobile. */
  .v17-panel,
  .core-card,
  .v212-expandable-card,
  .v212-mobile-card,
  .v210-task-card,
  .v210-kanban-col {
    min-width: 0;
    max-width: 100%;
  }

  .v17-panel input,
  .v17-panel select,
  .v17-panel textarea,
  .v212-kanban-move {
    max-width: 100%;
  }
}

/* =========================================================
   V2.12.1 – compact Tasks controls + emphasized POGLED select
   ========================================================= */
.v212-task-controls-compact .v212-task-view-control select {
  border-color: color-mix(in srgb, var(--primary) 72%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-2));
  font-weight: 800;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}

.v212-task-controls-compact .v212-task-view-control > span {
  color: color-mix(in srgb, var(--primary) 76%, white);
}

@media (min-width: 1400px) {
  .v212-task-controls-compact {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .v212-task-controls-compact .v17-control {
    flex: 0 1 145px;
    min-width: 118px;
  }

  .v212-task-controls-compact .v212-task-view-control {
    flex-basis: 132px;
  }

  .v212-task-controls-compact .v212-task-search-control {
    flex: 1 1 300px;
    min-width: 240px;
  }

  .v212-task-controls-compact .v212-task-search-control input {
    width: 100%;
  }

  .v212-task-controls-compact > button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 760px), (pointer: coarse) {
  .v212-task-controls-compact {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .v212-task-controls-compact .v17-control,
  .v212-task-controls-compact .v212-task-search-control,
  .v212-task-controls-compact > button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
}


/* =========================================================
 * V2.13 – MOBILE RECOVERY + FUNCTIONAL PARITY
 * ========================================================= */

/* Critical: author CSS must never override the semantic hidden state. */
.nav-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

@media (min-width: 981px) {
  .nav-overlay { display: none !important; pointer-events: none !important; }
}

@media (max-width: 980px) {
  .nav-overlay:not([hidden]) {
    display: block;
    pointer-events: auto;
    visibility: visible;
  }
}

/* More breathing room between Kanban cards. */
.v210-kanban-column > .v212-kanban-card + .v212-kanban-card {
  margin-top: 14px;
}

.v213-task-filter-toggle { display: none; }
.v213-task-filter-body { display: contents; }

.v213-month-nav {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}
.v213-month-nav > button { min-width: 42px; min-height: 42px; padding-inline: 10px; }
.v213-month-nav input { min-width: 0; width: 100%; }

/* Desktop task toolbar: one predictable grid instead of mutually competing flex widths. */
@media (min-width: 1200px) {
  .v212-task-controls-compact {
    display: grid;
    grid-template-columns: 145px minmax(260px, 1.4fr) auto minmax(130px,.7fr) minmax(130px,.7fr) minmax(130px,.8fr) minmax(150px,.75fr) auto;
    gap: 10px;
    align-items: end;
  }
  .v212-task-controls-compact .v17-control,
  .v212-task-controls-compact .v212-task-search-control,
  .v212-task-controls-compact > button {
    min-width: 0;
    width: auto;
    max-width: 100%;
  }
  .v212-task-controls-compact .v213-task-filter-body { display: contents; }
  .v212-task-controls-compact .v213-task-filter-toggle { display: none; }
  .v212-task-controls-compact .v213-task-month-control { min-width: 300px; }
}

/* Mid desktop/tablet: wrapping is allowed but never overlap. */
@media (min-width: 761px) and (max-width: 1199px) {
  .v212-task-controls-compact { display:flex; flex-wrap:wrap; gap:10px; align-items:end; }
  .v213-task-filter-body { display: contents; }
  .v212-task-controls-compact .v17-control { flex:1 1 170px; min-width:150px; }
  .v212-task-controls-compact .v212-task-search-control { flex:2 1 300px; }
}

@media (max-width: 760px), (pointer: coarse) {
  .v212-task-controls-compact {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
  }
  .v212-task-controls-compact .v212-task-view-control { grid-column: 1; }
  .v212-task-controls-compact .v212-task-create-button { grid-column: 1 / -1; width:100%; }
  .v213-task-filter-toggle {
    display: inline-flex;
    grid-column: 2;
    min-height: 44px;
    align-items:center;
    justify-content:center;
    white-space:nowrap;
  }
  .v213-task-filter-body {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 4px;
  }
  .v213-task-filter-body.open { display: grid; }
  .v213-task-filter-body > *,
  .v213-task-filter-body .v17-control,
  .v213-task-filter-body input,
  .v213-task-filter-body select,
  .v213-task-filter-body button { width:100%; max-width:100%; min-width:0; }
  .v213-month-nav { grid-template-columns: 44px minmax(0,1fr) auto 44px; }

  /* Expandable cards must be actual touch targets, not blocked by decorative layers. */
  .v212-mobile-card-summary,
  .v212-expandable-summary,
  .adm-pril-card summary {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    touch-action: manipulation;
  }
}

.v213-opportunity-kpis {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin: 0 0 14px;
}
.v213-opportunity-kpi { min-height:100px; }
.v213-opportunity-kpi span { color:var(--muted); font-size:12px; font-weight:800; }
.v213-opportunity-kpi strong { display:block; margin-top:8px; font-size:24px; }

.ldm-write-checklist {
  margin-top: 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-2);
  overflow:hidden;
}
.ldm-write-checklist > summary { cursor:pointer; padding:12px 14px; font-weight:800; }
.ldm-write-checklist-body { display:grid; gap:7px; padding:0 14px 14px; max-height:240px; overflow:auto; }
.ldm-write-checklist-body label { display:flex; align-items:center; gap:9px; min-height:34px; }
.ldm-write-checklist-body input { width:auto; }

@media (max-width: 760px) {
  .v213-opportunity-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); }
}


/* =========================================================
 * V2.15 – DESKTOP SPACE + TABLE ROW ACTION PATTERN
 * Firebase frontend only. Apps Script UI is intentionally untouched.
 * ========================================================= */
.nav-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
}

.nav-section-head .nav-section-title {
  flex: 1 1 auto;
}

.nav-collapse-button {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.nav-collapse-button:hover,
.nav-collapse-button:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  outline: none;
}

@media (min-width: 981px) {
  .app-shell.nav-collapsed .shell-body {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .app-shell.nav-collapsed .app-nav {
    padding-inline: 8px;
  }

  .app-shell.nav-collapsed .nav-section-title,
  .app-shell.nav-collapsed .nav-footer,
  .app-shell.nav-collapsed .nav-item > span:not(.nav-icon) {
    display: none !important;
  }

  .app-shell.nav-collapsed .nav-section-head {
    justify-content: center;
  }

  .app-shell.nav-collapsed .nav-collapse-button {
    width: 42px;
  }

  .app-shell.nav-collapsed .nav-item {
    justify-content: center;
    gap: 0;
    padding-inline: 8px;
  }

  .app-shell.nav-collapsed .nav-icon {
    width: auto;
    font-size: 19px;
  }
}

@media (max-width: 980px) {
  .nav-collapse-button {
    display: none !important;
  }

  /* Mobile always uses the drawer, never the desktop collapsed state. */
  .app-shell.nav-collapsed .shell-body {
    display: block;
  }

  .app-shell.nav-collapsed .nav-section-title,
  .app-shell.nav-collapsed .nav-footer,
  .app-shell.nav-collapsed .nav-item > span:not(.nav-icon) {
    display: initial;
  }
}

/* Same-module view selectors are tabs, not action buttons. */
.v17-tabs {
  gap: 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-end;
  overflow-x: auto;
  scrollbar-width: thin;
}

.v17-tab {
  min-height: 42px;
  padding: 9px 15px 8px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
  box-shadow: none;
}

.v17-tab:hover {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

.v17-tab.active {
  background: transparent;
  border-color: var(--primary);
  color: var(--text);
}

/* One primary open action = row itself is the target. */
.v215-clickable-row {
  cursor: pointer;
}

.v215-clickable-row:hover > td,
.v215-clickable-row:focus-visible > td {
  background: color-mix(in srgb, var(--primary) 7%, var(--surface-2));
}

.v215-clickable-row:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 70%, white);
  outline-offset: -2px;
}

.v215-row-detail {
  margin: 0 0 14px;
}

.v215-row-detail .core-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v215-mobile-open-hint {
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 700;
}

.v215-calendar-date-open {
  cursor: pointer;
}

.v215-calendar-date-open:hover,
.v215-calendar-date-open:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--primary) 55%, transparent);
  outline-offset: -2px;
}

/* V2.13 sticky-last-column was action-column specific. V2.15 removed generic
 * action columns, therefore the last data column must not be sticky. */
.v17-table td:last-child,
.v17-table th:last-child {
  position: static;
  right: auto;
  z-index: auto;
  background: inherit;
  box-shadow: none;
}

.v17-table .v210-sticky-action,
.v17-table thead .v210-sticky-action {
  position: sticky;
  right: 0;
  z-index: 3;
}

.core-table tbody tr,
.v17-table tbody tr {
  transition: background .12s ease, box-shadow .12s ease;
}

@media (max-width: 760px), (pointer: coarse) {
  .v17-tabs {
    padding-bottom: 1px;
    flex-wrap: nowrap;
  }

  .v17-tab {
    min-height: 44px;
    flex: 0 0 auto;
  }
}

/* V2.15 Core parity Wave 1 tools */
.v215-modal-table-wrap {
  margin-top: 14px;
  max-height: 44vh;
  overflow: auto;
}

.v215-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 150px;
}

.v215-choice-list {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  max-height: 42vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-2);
}

.v215-choice-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 8px;
}

.v215-choice-row:hover {
  background: color-mix(in srgb, var(--primary) 7%, transparent);
}

.v215-choice-row input {
  width: auto;
  margin-top: 3px;
}

.v215-tools-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.v215-tools-toolbar .ldm-write-field {
  min-width: 180px;
  margin: 0;
}

.v215-tool-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.v215-tool-card {
  display: grid;
  gap: 6px;
  text-align: left;
  min-height: 105px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.v215-tool-card strong {
  font-size: 16px;
}

.v215-tool-card span {
  color: var(--muted);
  line-height: 1.45;
}

.v215-tool-card:hover,
.v215-tool-card:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 60%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, var(--surface-2));
  outline: none;
}

.v215-prepared-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface-2));
}

.v215-prepared-box h3 {
  margin-top: 0;
}

@media (max-width: 760px) {
  .v215-tool-cards {
    grid-template-columns: 1fr;
  }

  .v215-inline-actions {
    min-width: 0;
  }

  .v215-modal-table-wrap {
    max-height: none;
  }
}

/* =========================================================
 * V2.15 – FLUID CONTENT / RESPONSIVE TOOLBARS / PARITY FORMS
 * ========================================================= */
.app-content {
  width: 100%;
  min-width: 0;
  max-width: none;
}

/* V2.15: sproščena širina po collapse-u mora dejansko pripasti vsebini. */
.view {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.v17-table-wrap,
.core-table-wrap,
.v215-modal-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
}

/* Kontrole se krčijo in prelomijo preden se lahko začnejo prekrivati. */
.v17-controls {
  width: 100%;
  min-width: 0;
  align-items: end;
}

.v17-controls > .v17-control {
  flex: 1 1 176px;
  min-width: min(176px, 100%);
  max-width: 340px;
}

.v17-controls > .v17-control:has(input[type="search"]) {
  flex-basis: 250px;
  max-width: 430px;
}

.v17-controls > .button {
  flex: 0 1 auto;
  max-width: 100%;
}

.v215-inline-tabs {
  flex: 1 1 100%;
  width: 100%;
  margin-bottom: 2px;
}

.v215-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

.v215-form-grid > .v17-control {
  min-width: 0;
  max-width: none;
}

.v215-form-grid .span-2 {
  grid-column: 1 / -1;
}

.v215-form-grid textarea {
  min-height: 92px;
  resize: vertical;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

.v215-check-control {
  align-content: end;
}

.v215-check-control > input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  margin: 8px 0;
}

.v215-module-grid {
  display: grid;
  gap: 8px;
  margin: 10px 0 16px;
}

.v215-module-row {
  display: grid;
  grid-template-columns: minmax(145px, 1.4fr) repeat(6, minmax(76px, .65fr));
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.v215-module-perm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.v215-module-perm input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.v215-related-section,
.v215-connected-body,
.v215-external-body {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.v215-connected-modules {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1320px) {
  .v17-controls > .v17-control {
    flex-basis: 155px;
  }

  .v17-controls > .v17-control:has(input[type="search"]) {
    flex-basis: 220px;
  }
}

@media (max-width: 900px) {
  .v215-module-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v215-module-row > strong {
    grid-column: 1 / -1;
  }
}

@media (max-width: 650px) {
  .v215-form-grid,
  .v215-connected-modules {
    grid-template-columns: 1fr;
  }

  .v215-form-grid .span-2 {
    grid-column: auto;
  }

  .v17-controls > .v17-control,
  .v17-controls > .v17-control:has(input[type="search"]),
  .v17-controls > .button {
    width: 100%;
    max-width: none;
  }

  .v215-module-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
 * V2.16 – MODAL STANDARD / NESTED ROW-OPEN / DIAGNOSTICS
 * ========================================================= */
.ldm-write-field select,
.v215-form-grid .v17-control input:not([type="checkbox"]),
.v215-form-grid .v17-control select,
.v215-form-grid .v17-control textarea,
.ldm-write-grid .ldm-write-field input:not([type="checkbox"]),
.ldm-write-grid .ldm-write-field select,
.ldm-write-grid .ldm-write-field textarea {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
}

.ldm-write-field select:focus,
.v215-form-grid .v17-control input:not([type="checkbox"]):focus,
.v215-form-grid .v17-control select:focus,
.v215-form-grid .v17-control textarea:focus,
.ldm-write-grid .ldm-write-field input:not([type="checkbox"]):focus,
.ldm-write-grid .ldm-write-field select:focus,
.ldm-write-grid .ldm-write-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.ldm-write-grid input[type="checkbox"],
.v215-form-grid input[type="checkbox"],
.v215-check-control > input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 6px 0;
  accent-color: var(--primary);
}

.v216-nested-clickable-row {
  cursor: pointer;
}

.v216-nested-clickable-row:hover,
.v216-nested-clickable-row:focus-visible {
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  outline: none;
}

.diagnostics-header-button {
  min-height: 38px;
  padding-inline: 11px;
  white-space: nowrap;
}

.ldm-diagnostics-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 7, 14, .72);
  backdrop-filter: blur(5px);
}

.ldm-diagnostics-modal {
  width: min(1180px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ldm-diagnostics-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.ldm-diagnostics-head h2 {
  margin: 4px 0 6px;
}

.ldm-diagnostics-head p {
  margin: 0;
  color: var(--muted);
}

.ldm-diagnostics-kicker {
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
}

.ldm-diagnostics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 12px;
}

.ldm-diagnostics-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.ldm-diagnostics-status.enabled { color: var(--success); }
.ldm-diagnostics-status.disabled { color: var(--muted); }

.ldm-diagnostics-table-wrap {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.ldm-diagnostics-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.ldm-diagnostics-table-wrap th,
.ldm-diagnostics-table-wrap td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 12px;
}

.ldm-diagnostics-table-wrap th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--muted);
}

@media (max-width: 760px) {
  .diagnostics-header-button {
    display: none;
  }
  .ldm-diagnostics-overlay {
    padding: 0;
    align-items: end;
  }
  .ldm-diagnostics-modal {
    max-height: 94dvh;
    border-radius: 18px 18px 0 0;
  }
  .ldm-diagnostics-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.dashboard-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-card[data-accent="blue"] { border-color: color-mix(in srgb, var(--primary) 55%, var(--border)); }
.metric-card[data-accent="green"] { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); }
.metric-card[data-accent="orange"] { border-color: color-mix(in srgb, var(--warning) 58%, var(--border)); }
.metric-card[data-accent="violet"] { border-color: color-mix(in srgb, #9b7cff 58%, var(--border)); }
.metric-card[data-accent="red"] { border-color: color-mix(in srgb, var(--danger) 58%, var(--border)); }
.metric-card[data-accent="neutral"] { border-color: var(--border); }

.dashboard-card-wide {
  grid-column: span 2;
}

.dashboard-card-config-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.dashboard-card-config-row {
  display: grid;
  grid-template-columns: 28px minmax(160px, 1fr) 150px 150px 48px 48px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.dashboard-card-config-row select {
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text);
}

.performance-diagnostics-link {
  font-size: 17px;
}

@media (max-width: 760px) {
  .dashboard-card-config-row {
    grid-template-columns: 28px 1fr 1fr;
  }
  .dashboard-card-config-row strong {
    grid-column: 2 / -1;
  }
  .dashboard-card-wide {
    grid-column: auto;
  }
}


/* V2.18 Delo & Planiranje – Gantt V1 */
.v217-gantt { display:grid; gap:12px; min-width:0; }
.v217-gantt-summary { display:grid; grid-template-columns:auto 1fr; gap:5px 14px; align-items:center; padding:14px 16px; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.v217-gantt-summary strong { font-size:18px; }
.v217-gantt-summary span { color:var(--muted); }
.v217-gantt-summary small { grid-column:1 / -1; color:var(--muted); }
.v217-gantt-timeline { display:grid; grid-template-columns:minmax(180px,260px) repeat(var(--v217-days),minmax(25px,1fr)); overflow:auto; border:1px solid var(--border); border-radius:14px; background:var(--surface-2); }
.v217-gantt-label { position:sticky; left:0; z-index:3; min-height:38px; padding:8px 10px; border:0; border-right:1px solid var(--border); border-bottom:1px solid var(--border); background:var(--surface-2); color:var(--text); text-align:left; }
button.v217-gantt-project-label { cursor:pointer; font-weight:700; }
button.v217-gantt-project-label:hover { background:var(--surface-3); }
.v217-gantt-task-label { padding-left:25px; color:var(--muted); font-size:13px; }
.v217-gantt-day-head { min-width:25px; padding:7px 2px; border-left:1px solid var(--border); border-bottom:1px solid var(--border); text-align:center; color:var(--muted); font-size:11px; }
.v217-gantt-track { position:relative; display:grid; grid-template-columns:repeat(var(--v217-days),minmax(25px,1fr)); min-height:38px; border-bottom:1px solid var(--border); }
.v217-gantt-drop-day { grid-row:1; min-width:25px; border-left:1px solid color-mix(in srgb,var(--border) 60%, transparent); }
.v217-gantt-drop-day.is-saving { background:color-mix(in srgb,var(--primary) 16%, transparent); }
.v217-gantt-bar { z-index:2; grid-row:1; align-self:center; min-width:20px; margin:4px 2px; padding:5px 8px; overflow:hidden; border:1px solid color-mix(in srgb,var(--primary) 65%,var(--border)); border-radius:8px; background:color-mix(in srgb,var(--primary) 28%,var(--surface-3)); color:var(--text); white-space:nowrap; text-overflow:ellipsis; cursor:grab; font-size:12px; font-weight:700; }
.v217-gantt-bar:active { cursor:grabbing; }
.v217-gantt-conflict { border-color:var(--danger); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--danger) 65%,transparent); }
.v217-gantt-task-track { min-height:30px; }
.v217-gantt-task-dot { z-index:2; grid-row:1; align-self:center; justify-self:center; width:10px; height:10px; border-radius:50%; background:var(--warning); box-shadow:0 0 0 3px color-mix(in srgb,var(--warning) 20%,transparent); }
@media (max-width:650px) { .v217-gantt-summary { grid-template-columns:1fr; } .v217-gantt-summary small { grid-column:auto; } .v217-gantt-timeline { grid-template-columns:minmax(145px,180px) repeat(var(--v217-days),minmax(24px,1fr)); } }

.diagnostics-slow-row td { background: color-mix(in srgb, var(--warning) 10%, transparent); }

/* V2.18 Dashboard V2 – 4-column dense configurable grid */
.dashboard-cards,
.dashboard-loading {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: minmax(144px, auto);
}
.metric-card[role="button"] { cursor:pointer; transition:transform .12s ease, border-color .12s ease; }
.metric-card[role="button"]:hover { transform:translateY(-1px); }
.metric-card[role="button"]:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
.dashboard-card-w2 { grid-column: span 2; }
.dashboard-card-w4 { grid-column: 1 / -1; }
.dashboard-card-h2 { grid-row: span 2; }
.v218-dashboard-config-row { grid-template-columns:28px minmax(150px,1fr) 135px 135px 135px 48px 48px; }

/* V2.18 Gantt V2 */
.v218-gantt-backlog { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:12px 14px; border:1px dashed var(--border); border-radius:12px; background:var(--surface); }
.v218-gantt-backlog strong { margin-right:6px; }
.v218-gantt-backlog-card { cursor:grab; border:1px solid var(--border); border-radius:999px; padding:7px 10px; background:var(--surface-3); color:var(--text); font:inherit; }
.v218-gantt-backlog-card[data-kind="TASK"] { border-style:dashed; }
.v218-gantt-ticket-layer { margin-top:10px; }
.v218-gantt-ticket-dot { min-height:24px; margin:6px 2px; border-radius:8px; padding:4px 6px; background:color-mix(in srgb,var(--warning) 22%,var(--surface-3)); border:1px solid color-mix(in srgb,var(--warning) 55%,var(--border)); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; font-size:11px; }
.v218-gantt-tools { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }

@media (max-width: 1180px) {
  .dashboard-cards,.dashboard-loading { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-card-w4 { grid-column:1 / -1; }
  .dashboard-card-w2 { grid-column:span 2; }
}
@media (max-width: 760px) {
  .dashboard-cards,.dashboard-loading { grid-template-columns:1fr; }
  .dashboard-card-w2,.dashboard-card-w4,.dashboard-card-h2 { grid-column:auto; grid-row:auto; }
  .v218-dashboard-config-row { grid-template-columns:28px 1fr 1fr; }
}

/* V2.18 parity recovery – navigation badges, saved views, action center, support */
.nav-item { position: relative; }
.ldm-nav-badge {
  margin-left:auto;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:800;
  line-height:1;
  background:var(--danger,#d63b35);
  color:#fff;
  box-shadow:0 0 0 2px var(--surface,#0b1420);
}
.ldm-nav-badge.hidden { display:none; }
.nav-collapsed .ldm-nav-badge {
  position:absolute;
  top:3px;
  right:3px;
  margin:0;
  min-width:18px;
  height:18px;
  padding:0 4px;
  font-size:10px;
}

.ldm-nav-history-overlay {
  position:fixed;
  inset:0;
  z-index:1200;
  display:grid;
  place-items:center;
  padding:24px;
  background:rgba(3,9,16,.74);
  backdrop-filter:blur(5px);
}
.ldm-nav-history-modal {
  width:min(920px,100%);
  max-height:min(86vh,880px);
  overflow:auto;
  border:1px solid var(--border);
  border-radius:22px;
  background:var(--surface-2);
  box-shadow:0 28px 80px rgba(0,0,0,.38);
  padding:24px;
}
.ldm-nav-history-head,.ldm-nav-history-actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.ldm-nav-history-actions { justify-content:flex-start; margin:16px 0; }
.ldm-nav-history-section { margin-top:20px; }
.ldm-nav-history-list { display:grid; gap:8px; margin-top:10px; }
.ldm-nav-history-row {
  width:100%;
  text-align:left;
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px 14px;
  background:var(--surface);
  color:var(--text);
  cursor:pointer;
}
.ldm-nav-history-row:hover { border-color:var(--primary); }
.ldm-nav-history-row strong,.ldm-nav-history-row span { display:block; }
.ldm-nav-history-row span { margin-top:3px; color:var(--muted); font-size:13px; }
.ldm-nav-history-empty { color:var(--muted); padding:12px 0; }

.dashboard-action-center { margin-top:18px; }
.dashboard-action-total {
  min-width:42px;
  height:42px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  background:var(--primary);
  color:#fff;
}
.dashboard-action-summary {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  margin:12px 0 16px;
}
.dashboard-action-summary button {
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text);
  border-radius:12px;
  padding:12px;
  text-align:left;
  cursor:pointer;
}
.dashboard-action-summary button strong { display:block; font-size:22px; }
.dashboard-action-summary button span { color:var(--muted); font-size:12px; }
.dashboard-action-lists {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.dashboard-action-group {
  border:1px solid var(--border);
  border-radius:14px;
  overflow:hidden;
  min-width:0;
}
.dashboard-action-group h3 { margin:0; padding:12px 14px; font-size:15px; background:var(--surface); }
.dashboard-action-item {
  width:100%;
  border:0;
  border-top:1px solid var(--border);
  background:transparent;
  color:var(--text);
  padding:10px 14px;
  text-align:left;
  cursor:pointer;
}
.dashboard-action-item:hover { background:color-mix(in srgb,var(--primary) 8%,transparent); }
.dashboard-action-item strong,.dashboard-action-item span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dashboard-action-item span { margin-top:2px; color:var(--muted); font-size:12px; }

.v218-support-view-tabs { display:flex; flex-wrap:wrap; gap:8px; width:100%; }
.v218-support-view-tabs .button.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.v218-support-create { margin-left:auto; }
.v218-external-capabilities { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:12px 0; }
.v218-external-capability { border:1px solid var(--border); border-radius:12px; padding:12px; background:var(--surface); }
.v218-external-capability strong,.v218-external-capability span { display:block; }
.v218-external-capability span { color:var(--muted); margin-top:4px; font-size:12px; }
.v218-ticket-section { margin-top:10px; border:1px solid var(--border); border-radius:12px; padding:8px 12px; }
.v218-ticket-section summary { cursor:pointer; font-weight:800; }
.v218-ticket-section-list { display:grid; gap:6px; margin-top:8px; }
.v218-ticket-section-item { padding:8px 10px; border-radius:9px; background:var(--surface); }

@media (max-width: 900px) {
  .dashboard-action-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-action-lists { grid-template-columns:1fr; }
}
@media (max-width: 620px) {
  .ldm-nav-history-overlay { padding:8px; }
  .ldm-nav-history-modal { border-radius:16px; padding:16px; max-height:94vh; }
  .dashboard-action-summary { grid-template-columns:1fr; }
  .v218-external-capabilities { grid-template-columns:1fr; }
}

/* =========================================================
 * V2.20 – navigation + Ticketing parity + global row UX
 * ========================================================= */
.ldm-breadcrumbs{display:flex;align-items:center;gap:.55rem;margin:0 0 .8rem;color:var(--muted,#9eb2ce);font-size:.92rem;min-height:1.9rem}
.ldm-breadcrumbs button{appearance:none;border:0;background:transparent;color:#7eb4ff;padding:.2rem .1rem;cursor:pointer;font:inherit;font-weight:700}
.ldm-breadcrumbs button:hover{text-decoration:underline}
.ldm-breadcrumbs span:last-child{font-weight:700;color:var(--text,#f5f7fb)}

.v220-support-status-chips{display:flex;gap:.45rem;align-items:center;flex-wrap:wrap;grid-column:1/-1}
.v220-support-chip{display:inline-flex;align-items:center;gap:.45rem;border:1px solid var(--border,#324962);background:rgba(12,28,48,.62);color:var(--muted,#a7b8d2);border-radius:999px;padding:.52rem .78rem;font:inherit;font-weight:700;cursor:pointer}
.v220-support-chip strong{display:inline-grid;place-items:center;min-width:1.45rem;height:1.45rem;border-radius:999px;background:rgba(255,255,255,.1);font-size:.78rem}
.v220-support-chip.active{background:#2f86f6;color:white;border-color:#2f86f6}
.v220-support-chip-separator{width:1px;height:1.8rem;background:var(--border,#324962);margin:0 .3rem}
.v220-inline-hint{grid-column:1/-1;color:var(--muted,#a7b8d2);padding:.35rem 0}

.v220-support-kanban-head,.v220-support-admin-toolbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem;flex-wrap:wrap}
.v220-ticket-kanban{display:grid;grid-template-columns:repeat(4,minmax(230px,1fr));gap:.8rem;overflow-x:auto;padding-bottom:.5rem}
.v220-ticket-kanban-col{min-width:230px;border:1px solid var(--border,#324962);border-radius:16px;background:rgba(15,34,57,.72);overflow:hidden}
.v220-ticket-kanban-col.drag-over{outline:2px solid #4b9bff;outline-offset:2px}
.v220-ticket-kanban-col-head{display:flex;justify-content:space-between;align-items:center;padding:.85rem 1rem;border-bottom:1px solid var(--border,#324962)}
.v220-ticket-kanban-col-head span{display:inline-grid;place-items:center;min-width:1.7rem;height:1.7rem;border-radius:999px;background:rgba(255,255,255,.1)}
.v220-ticket-kanban-body{display:grid;gap:.65rem;padding:.7rem;min-height:130px}
.v220-ticket-card{display:grid;gap:.35rem;padding:.75rem;border:1px solid rgba(126,180,255,.22);background:rgba(8,24,43,.9);border-radius:12px;cursor:grab}
.v220-ticket-card:active{cursor:grabbing}.v220-ticket-card span{color:var(--muted,#9eb2ce);font-size:.86rem}
.v220-access-table input[type=checkbox]{width:1.2rem;height:1.2rem}

.v220-ticket-attachments{margin-top:1rem;border:1px solid var(--border,#324962);border-radius:14px;padding:.25rem 1rem 1rem}
.v220-ticket-attachments>summary{cursor:pointer;padding:.8rem 0;font-size:1.05rem;font-weight:800}
.v220-attachment-list{display:grid;gap:.55rem}
.v220-attachment-row{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.7rem;border:1px solid rgba(126,180,255,.18);border-radius:10px}
.v220-attachment-row>div:first-child{display:grid;gap:.2rem;min-width:0}.v220-attachment-row span{color:var(--muted,#9eb2ce);font-size:.85rem;overflow:hidden;text-overflow:ellipsis}
.v220-attachment-actions,.v220-attachment-upload{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap}
.v220-attachment-upload{margin-top:.85rem;padding-top:.85rem;border-top:1px solid var(--border,#324962)}
.v220-recurring-detail{margin-top:1rem}.v220-recurring-actions{justify-content:flex-start;flex-wrap:wrap}

.preview-check-page{max-width:720px;margin:10vh auto;padding:2rem;font-family:system-ui,sans-serif}

@media (max-width:900px){.v220-ticket-kanban{grid-template-columns:repeat(4,minmax(82vw,1fr))}.v220-attachment-row{align-items:flex-start;flex-direction:column}.v220-support-chip-separator{display:none}}

/* V2.20 Ticketing/Gantt stabilization */
.v220-support-filters{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:.8rem!important;min-width:0!important;overflow:hidden!important}
.v220-support-filter-chips{display:flex!important;flex-wrap:wrap!important;gap:.45rem!important;align-items:center!important}
.v220-support-filter-chips button{min-height:2.35rem!important;padding:.45rem .8rem!important;border-radius:999px!important;font-size:.92rem!important;white-space:nowrap!important}
.v220-support-filter-controls{display:grid!important;grid-template-columns:minmax(9rem,.8fr) minmax(9rem,.8fr) minmax(14rem,1.6fr) auto auto!important;gap:.65rem!important;align-items:end!important;min-width:0!important}
.v220-support-filter-controls>*{min-width:0!important;max-width:100%!important}
.v220-ticket-kanban{gap:1rem!important;overflow-x:auto!important;padding:.25rem .1rem 1rem!important}
.v220-ticket-kanban-col{border:1px solid var(--line,#29445f)!important;border-radius:1rem!important;overflow:hidden!important;min-width:18rem!important}
.v220-ticket-kanban-body{min-height:18rem!important;padding:1rem!important}
.v220-ticket-card{border:1px solid var(--line,#29445f)!important;border-radius:.9rem!important;cursor:grab!important;transition:transform .12s ease,opacity .12s ease!important}
.v220-ticket-card.is-dragging{opacity:.45!important;transform:scale(.985)!important}
.v220-ticket-kanban-col.drag-over{outline:2px solid #4d9cff!important;outline-offset:-3px!important;background:rgba(77,156,255,.08)!important}
.v217-gantt-label,.v217-gantt-track{min-height:3.45rem!important;height:3.45rem!important;box-sizing:border-box!important}
.v217-gantt-label{display:flex!important;align-items:center!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.v220-gantt-backlog{display:flex!important;align-items:center!important;gap:.45rem!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;padding:.55rem .2rem .75rem!important}
.v220-gantt-backlog-card{flex:0 0 auto!important;white-space:nowrap!important;max-width:28rem!important;overflow:hidden!important;text-overflow:ellipsis!important}
@media(max-width:1100px){.v220-support-filter-controls{grid-template-columns:1fr 1fr!important}}
@media(max-width:680px){.v220-support-filter-controls{grid-template-columns:1fr!important}}

.v220-gantt-backlog.drag-over{outline:2px dashed #4d9cff!important;outline-offset:-2px!important;background:rgba(77,156,255,.08)!important}
.v220-ticket-card[draggable="false"]{cursor:default!important;opacity:.9}

/* =========================================================
 * V2.22 – unified header / filters / admin / payment session
 * ========================================================= */

/* Page hierarchy: one visible page title; technical/module kickers no longer
 * repeat information already present in the breadcrumb and navigation. */
.page-head {
  align-items:center;
  gap:18px;
  margin-bottom:14px;
}
.page-head .page-kicker,
.page-head .readonly-badge {
  display:none !important;
}
.page-head h1 {
  margin:0 0 3px;
  font-size:clamp(30px,3.25vw,40px);
}
.page-head p {
  line-height:1.35;
}
.core-head-actions,
.dashboard-head-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.dashboard-page-head {
  align-items:center;
}
.dashboard-head-side {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
  flex:1 1 auto;
  min-width:0;
  flex-wrap:wrap;
}
.dashboard-meta-line {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:0;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
}
.dashboard-meta-line span {
  white-space:nowrap;
}
.dashboard-meta-line span + span::before {
  content:'·';
  margin:0 8px;
  color:var(--muted-2);
}
.dashboard-meta-line strong { color:var(--text); }

/* Secondary administration lives in its own navigation group instead of
 * competing visually with everyday operational modules. */
.nav-admin-section {
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--border);
}
.nav-group-label {
  padding:2px 10px 8px;
  color:var(--muted-2);
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.nav-admin-modules .nav-item {
  min-height:39px;
  color:var(--muted-2);
}
.nav-admin-modules .nav-item.active,
.nav-admin-modules .nav-item:hover {
  color:var(--text);
}

/* Core modules: one-line filters on wide screens. At widths where a clean
 * single line is no longer possible the secondary filters become explicitly
 * collapsible instead of wrapping into an accidental multi-row toolbar. */
.core-filters-toggle { display:none; }
@media (min-width:1301px) {
  .core-toolbar {
    display:flex;
    flex-wrap:nowrap;
    align-items:end;
    gap:10px;
  }
  .core-toolbar > .core-control { flex:0 1 170px; min-width:125px; }
  .core-toolbar > .core-search-control { flex:1 1 260px; min-width:210px; }
  .core-dynamic-filters {
    display:flex;
    flex:1 1 auto;
    flex-wrap:nowrap;
    min-width:0;
    gap:10px;
  }
  .core-dynamic-filters > .core-filter-control {
    flex:1 1 135px;
    min-width:105px;
  }
  .core-toolbar-buttons { flex:0 0 auto; }
}
@media (max-width:1300px) {
  .core-toolbar {
    display:grid;
    grid-template-columns:auto minmax(145px,210px) minmax(220px,1fr) auto;
    gap:10px;
    align-items:end;
  }
  .core-filters-toggle { display:inline-flex; align-items:center; justify-content:center; min-height:42px; }
  .core-dynamic-filters {
    grid-column:1 / -1;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
    gap:10px;
  }
  .core-toolbar.filters-collapsed .core-dynamic-filters { display:none; }
}
@media (max-width:720px) {
  .page-head,
  .dashboard-page-head {
    align-items:flex-start;
    flex-direction:column;
  }
  .dashboard-head-side {
    width:100%;
    align-items:flex-start;
    justify-content:flex-start;
  }
  .dashboard-meta-line { justify-content:flex-start; }
  .dashboard-head-actions,
  .core-head-actions { width:100%; justify-content:flex-start; }
  .core-toolbar {
    grid-template-columns:auto minmax(0,1fr);
  }
  .core-toolbar > .core-search-control { grid-column:1 / -1; }
  .core-toolbar-buttons { grid-column:1 / -1; width:100%; }
  .core-toolbar-buttons .button { flex:1 1 0; }
  .core-dynamic-filters { grid-template-columns:1fr; }
}

/* Errors: deliberate grid prevents controls from ever painting over one
 * another. The filter body collapses on narrower layouts. */
.v222-error-controls {
  display:grid !important;
  grid-template-columns:minmax(135px,.65fr) minmax(0,5fr);
  gap:10px !important;
  align-items:end !important;
  min-width:0;
}
.v222-error-filter-toggle { display:none !important; }
.v222-error-filter-body {
  display:grid;
  grid-template-columns:minmax(220px,1.45fr) auto repeat(4,minmax(125px,.8fr));
  gap:10px;
  align-items:end;
  min-width:0;
}
.v222-error-filter-body > * { min-width:0 !important; max-width:none !important; }
@media (max-width:1250px) {
  .v222-error-controls {
    grid-template-columns:minmax(135px,220px) auto 1fr;
  }
  .v222-error-filter-toggle { display:inline-flex !important; align-items:center; justify-content:center; }
  .v222-error-filter-body {
    display:none;
    grid-column:1 / -1;
    grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  }
  .v222-error-filter-body.open { display:grid; }
}
@media (max-width:650px) {
  .v222-error-controls { grid-template-columns:1fr auto; }
  .v222-error-filter-body { grid-template-columns:1fr; }
}

/* Payments – persistent selection and a compact payment-session workspace. */
.v222-payment-selection-bar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin:0 0 12px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--surface);
}
.v222-payment-selection-summary,
.v222-payment-selection-actions {
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.v222-payment-selection-summary span { color:var(--muted); font-size:12px; }
.v222-select-column { width:44px; min-width:44px; text-align:center; }
.v222-select-column input { width:18px; height:18px; }
.ldm-write-modal.v222-payment-session-modal {
  width:min(1280px,96vw);
  max-height:94vh;
}
.v222-payment-session-summary {
  display:flex;
  gap:8px 18px;
  align-items:center;
  flex-wrap:wrap;
  padding:10px 12px;
  margin-bottom:12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-2);
}
.v222-payment-session-summary span { color:var(--muted); font-size:12px; }
.v222-payment-session-grid {
  display:grid;
  grid-template-columns:minmax(230px,.32fr) minmax(0,1fr);
  gap:14px;
  min-height:560px;
}
.v222-payment-session-list {
  display:grid;
  align-content:start;
  gap:7px;
  max-height:68vh;
  overflow:auto;
  padding-right:2px;
}
.v222-payment-session-item {
  appearance:none;
  width:100%;
  display:grid;
  gap:3px;
  padding:10px 11px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface-2);
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.v222-payment-session-item:hover,
.v222-payment-session-item.active {
  border-color:var(--primary);
  background:color-mix(in srgb,var(--primary) 11%,var(--surface-2));
}
.v222-payment-session-item span { color:var(--muted); font-size:11px; overflow:hidden; text-overflow:ellipsis; }
.v222-payment-session-detail { min-width:0; }
.v222-payment-session-current-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.v222-payment-session-current-head > div:first-child { display:grid; gap:2px; min-width:0; }
.v222-payment-session-current-head span { color:var(--muted); font-size:12px; }
.v222-payment-session-nav { display:flex; align-items:center; gap:6px; }
.v222-payment-session-nav > span { min-width:52px; text-align:center; color:var(--muted); }
.v222-payment-session-tools { margin:10px 0; }
.v222-payment-session-pdf {
  width:100%;
  min-height:520px;
  border:1px solid var(--border);
  border-radius:12px;
  background:white;
}
.v222-upn-result {
  margin:8px 0 10px;
  padding:9px 11px;
  border:1px solid var(--border);
  border-radius:10px;
  color:var(--muted);
  font-size:12px;
  overflow-wrap:anywhere;
}
.v222-upn-result.success { border-color:color-mix(in srgb,#48d597 55%,var(--border)); color:#7ce7b6; }
.v222-upn-result.warning { border-color:color-mix(in srgb,#ffbf69 55%,var(--border)); color:#ffd39a; }
.v222-payment-session-footer { justify-content:flex-end; margin-top:14px; }
@media (max-width:860px) {
  .ldm-write-modal.v222-payment-session-modal { width:100%; }
  .v222-payment-session-grid { grid-template-columns:1fr; min-height:0; }
  .v222-payment-session-list {
    display:flex;
    max-height:none;
    overflow-x:auto;
    padding-bottom:4px;
  }
  .v222-payment-session-item { flex:0 0 min(78vw,290px); }
  .v222-payment-session-pdf { min-height:55vh; }
}

.v222-ticket-communication-body {
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:end;
  padding-top:10px;
}
.v222-ticket-communication-body .ldm-write-field.span-2 { grid-column:1 / -1; }
@media (max-width:650px) {
  .v222-ticket-communication-body { grid-template-columns:1fr; }
  .v222-ticket-communication-body .ldm-write-field.span-2 { grid-column:auto; }
}


/* V2.22 calendar parity layers. */
.calendar-type-naloga { --calendar-accent: var(--accent, #5aa7ff); }
.calendar-type-dokumentacija { --calendar-accent: var(--success, #49d39a); }
.ldm-calendar-event.calendar-type-naloga,
.ldm-calendar-detail-event.calendar-type-naloga { border-color: color-mix(in srgb, var(--calendar-accent) 55%, var(--border)); }
.ldm-calendar-event.calendar-type-dokumentacija,
.ldm-calendar-detail-event.calendar-type-dokumentacija { border-color: color-mix(in srgb, var(--calendar-accent) 55%, var(--border)); }
@media (max-width: 760px) {
  .ldm-calendar-mobile-dots i.calendar-type-naloga,
  .ldm-calendar-mobile-dots i.calendar-type-dokumentacija { background: var(--calendar-accent); }
}

/* V2.22 – compact working-role switch. */
.role-chip {
  position: relative;
}
.role-select {
  appearance: auto;
  max-width: 190px;
  min-width: 110px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.role-select:disabled { cursor: default; opacity: .8; }
.role-select option { color: initial; background: initial; }
.sr-only {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}

/* Dashboard KPIs: denser cards leave room for later visual KPI blocks without
 * turning the dashboard into a wall of large cards. */
@media (min-width: 1180px) {
  .dashboard-cards,
  .dashboard-loading {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }
  .metric-card {
    min-height: 112px;
    padding: 14px 16px;
  }
  .metric-value {
    margin-top: 8px;
    font-size: 32px;
  }
  .metric-note { margin-top: 5px; }
}

/* Tasks: keep every field in its own grid track. Search button had its own
 * sibling track and could visually collide with Dodeljeno on some widths. */
@media (min-width: 1280px) {
  .v212-task-controls-compact {
    grid-template-columns:
      minmax(130px,.7fr)
      minmax(220px,1.35fr)
      minmax(82px,auto)
      minmax(120px,.75fr)
      minmax(120px,.7fr)
      minmax(120px,.75fr)
      minmax(140px,.8fr)
      minmax(165px,auto);
    gap: 10px;
  }
  .v212-task-controls-compact > *,
  .v212-task-controls-compact .v213-task-filter-body > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .v212-task-controls-compact input,
  .v212-task-controls-compact select {
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* V2.22 – lightweight graphical KPIs, rendered from the same Cloud dashboard
 * snapshot. No extra data request and no charting dependency. */
.dashboard-visual-kpis {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
.dashboard-visual-card { padding:15px 16px; min-width:0; }
.dashboard-visual-card .panel-head { margin-bottom:10px; }
.dashboard-visual-card .panel-head h2 { font-size:16px; }
.dashboard-mini-chart { display:grid; gap:8px; }
.dashboard-mini-chart-row {
  display:grid;
  grid-template-columns:minmax(95px,1.15fr) minmax(80px,1.7fr) auto;
  gap:9px;
  align-items:center;
  min-width:0;
  font-size:12px;
}
.dashboard-mini-chart-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); }
.dashboard-mini-chart-track { display:block; height:7px; border-radius:999px; background:var(--surface-2); overflow:hidden; }
.dashboard-mini-chart-bar { display:block; height:100%; border-radius:inherit; background:var(--primary); }
.dashboard-mini-chart-row strong { min-width:22px; text-align:right; }
@media(max-width:1050px){.dashboard-visual-kpis{grid-template-columns:1fr 1fr}.dashboard-visual-card:last-child{grid-column:1/-1}}
@media(max-width:680px){.dashboard-visual-kpis{grid-template-columns:1fr}.dashboard-visual-card:last-child{grid-column:auto}.dashboard-mini-chart-row{grid-template-columns:minmax(90px,1fr) minmax(70px,1.3fr) auto}}

/* Ticketing parity: comments keep the old internal / portal / e-mail meaning. */
.v222-ticket-comment-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.v222-ticket-comment-list{display:grid;gap:8px;margin-bottom:12px;max-height:360px;overflow:auto}
.v222-ticket-comment-item{padding:10px 12px;border:1px solid var(--border);border-radius:12px;background:var(--surface-2)}
.v222-ticket-comment-item.external{border-style:dashed}
.v222-ticket-comment-meta{font-size:11px;color:var(--muted);margin-bottom:5px}
.v222-ticket-comment-text{white-space:pre-wrap;overflow-wrap:anywhere}
.v222-ticket-comment-option{display:flex;align-items:center;gap:7px;font-size:13px;color:var(--muted);margin:7px 0}
.v222-ticket-comment-option input{width:auto!important}

/* =========================================================
 * V2.25 – parity/navigation/performance UX
 * ========================================================= */

/* Windows native SELECT menus can render a white popup. Keep options legible. */
.role-select option,
.v17-control select option,
.ldm-write-field select option {
  color: #0f172a !important;
  background: #ffffff !important;
}

.v225-detail-breadcrumb {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  margin-bottom: 6px;
}

.v225-related-documents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.v225-related-document {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--primary);
  min-height: 38px;
  padding: 7px 11px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.v225-related-document:hover,
.v225-related-document:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 65%, var(--border));
  outline: none;
}

/* Tasks: primary row = Pogled + Iskanje + Filtri + Nova naloga.
 * Extra filters are one predictable second row on demand, at every width. */
.v212-task-controls-compact {
  display: grid !important;
  grid-template-columns: minmax(140px,.7fr) minmax(260px,1.6fr) auto auto !important;
  align-items: end !important;
  gap: 10px !important;
}
.v212-task-controls-compact .v212-task-view-control { grid-column: 1; }
.v212-task-controls-compact .v212-task-search-control { grid-column: 2; min-width:0 !important; max-width:none !important; }
.v212-task-controls-compact .v213-task-filter-toggle {
  display:inline-flex !important;
  grid-column:3;
  align-items:center;
  justify-content:center;
  min-height:43px;
}
.v212-task-controls-compact .v212-task-create-button { grid-column:4; white-space:nowrap; }
.v212-task-controls-compact .v213-task-filter-body {
  display:none !important;
  grid-column:1 / -1;
  grid-template-columns:repeat(5,minmax(140px,1fr));
  gap:10px;
  padding-top:2px;
}
.v212-task-controls-compact .v213-task-filter-body.open { display:grid !important; }
.v212-task-controls-compact .v213-task-filter-body > *,
.v212-task-controls-compact .v213-task-filter-body input,
.v212-task-controls-compact .v213-task-filter-body select,
.v212-task-controls-compact .v213-task-filter-body button { min-width:0 !important; max-width:100% !important; width:100%; }
.v212-task-controls-compact .v213-task-month-control { min-width:0 !important; }
@media (max-width: 980px) {
  .v212-task-controls-compact {
    grid-template-columns:minmax(130px,.75fr) minmax(180px,1.4fr) auto !important;
  }
  .v212-task-controls-compact .v212-task-create-button { grid-column:1 / -1; width:100%; }
  .v212-task-controls-compact .v213-task-filter-body { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 650px) {
  .v212-task-controls-compact { grid-template-columns:1fr auto !important; }
  .v212-task-controls-compact .v212-task-view-control { grid-column:1; }
  .v212-task-controls-compact .v212-task-search-control { grid-column:1 / -1; grid-row:2; }
  .v212-task-controls-compact .v213-task-filter-toggle { grid-column:2; grid-row:1; }
  .v212-task-controls-compact .v212-task-create-button { grid-column:1 / -1; }
  .v212-task-controls-compact .v213-task-filter-body { grid-template-columns:1fr; }
}

/* Layer legend is an actual filter in V2.25, not decorative text. */
.ldm-calendar-legend-item {
  appearance:none;
  border:1px solid var(--border);
  background:var(--surface-2);
  color:var(--text);
  border-radius:999px;
  padding:6px 10px;
  cursor:pointer;
  font:inherit;
  font-size:12px;
  font-weight:800;
}
.ldm-calendar-legend-item.active { opacity:1; }
.ldm-calendar-legend-item.inactive { opacity:.42; filter:saturate(.4); }
.ldm-calendar-legend-item:focus-visible { outline:2px solid var(--primary); outline-offset:2px; }

.v225-ticket-quick {
  padding: 4px 0 10px;
}
.v225-ticket-quick h3 { margin: 4px 0 8px; }

/* A opened inline detail must clearly separate itself from the list and remain
 * easy to rediscover after keyboard/mouse navigation. */
.v215-core-row-detail,
.v210-detail-panel[data-task-id] {
  scroll-margin-top: 18px;
  box-shadow: 0 12px 34px rgba(0,0,0,.14);
}

/* =========================================================
 * V2.25 – stabilization: one-row desktop filters + ticket editor
 * ========================================================= */
@media (min-width: 1450px) {
  /* Naloge: on a normal desktop every filter is visible in one line. */
  .v212-task-controls-compact {
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:flex-end !important;
    gap:8px !important;
    overflow-x:auto !important;
  }
  .v212-task-controls-compact .v213-task-filter-toggle { display:none !important; }
  .v212-task-controls-compact .v213-task-filter-body { display:contents !important; }
  .v212-task-controls-compact .v212-task-view-control { flex:0 0 118px !important; }
  .v212-task-controls-compact .v212-task-search-control { flex:1 1 230px !important; min-width:190px !important; }
  .v212-task-controls-compact .v213-task-filter-body > .v17-control,
  .v212-task-controls-compact .v213-task-filter-body > label { flex:0 1 132px !important; min-width:108px !important; width:auto !important; }
  .v212-task-controls-compact .v213-task-month-control { flex:0 0 300px !important; min-width:260px !important; }
  .v212-task-controls-compact .v212-task-create-button { flex:0 0 auto !important; width:auto !important; min-height:43px !important; white-space:nowrap !important; }
  .v212-task-controls-compact input,
  .v212-task-controls-compact select,
  .v212-task-controls-compact button { min-height:43px; box-sizing:border-box; }

  /* Podpora: status chips and conventional filters share the same desktop row. */
  .v17-controls.v225-support-controls,
  #v17-controls.v225-support-controls {
    display:flex !important;
    flex-wrap:nowrap !important;
    align-items:flex-end !important;
    gap:8px !important;
    overflow-x:auto !important;
  }
  .v225-support-controls .v220-support-status-chips {
    grid-column:auto !important;
    flex:0 1 auto !important;
    flex-wrap:nowrap !important;
    white-space:nowrap !important;
  }
  .v225-support-controls > .v17-control { flex:0 1 150px; min-width:125px; }
  .v225-support-controls > .v17-control:has(input[type="search"]) { flex:1 1 300px; min-width:240px; }
  .v225-support-controls > .v17-checkbox { flex:0 0 auto; min-height:43px; display:flex; align-items:center; white-space:nowrap; }
  .v225-support-controls > .button { flex:0 0 auto; min-height:43px !important; align-self:flex-end; }
  .v225-support-controls select,
  .v225-support-controls input[type="search"] { min-height:43px !important; box-sizing:border-box; }
  .v225-support-controls .v220-support-chip { min-height:43px !important; box-sizing:border-box; }
}

.v225-ticket-description textarea {
  min-height: 180px !important;
  resize: vertical !important;
}
