: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(
      4,
      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%;
  }
}
