: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;
}
