/* ═══════════════════════════════════════════════════════════════════════
   KAIT — Compliance Suite Stylesheet
   Companion to /compliance-ui.js. Reuses CSS variables and many classes
   from index.html (--gold, --smoke*, --ink*, --line*, --f-*, .ftab,
   .filter-bar, .fhead, .ftitle, .fbadge). New classes below are scoped
   to .kc- prefix to avoid collisions.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Module shell — every module renders inside this ────────────────── */
.kc-module {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kc-module-head {
  flex-shrink: 0;
  padding: 24px 32px 16px;
  border-bottom: 1px solid rgba(160, 120, 32, 0.10);
}

.kc-module-head-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

.kc-module-eyebrow {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.kc-module-title {
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--smoke);
  line-height: 1.1;
}

.kc-module-subtitle {
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--smoke3);
  letter-spacing: 0.01em;
  margin-top: 6px;
  max-width: 800px;
}

.kc-module-meta {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--smoke4);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 14px;
}

.kc-module-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px 32px 48px;
  scrollbar-width: thin;
}

/* ── Today screen — two-column priority + health layout ─────────────── */
.kc-today-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1100px) {
  .kc-today-grid { grid-template-columns: 1fr; }
}

.kc-today-col-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;  /* lets long content wrap inside grid cell */
}

.kc-today-col-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Cards used across Today (and other modules later) ──────────────── */
.kc-card {
  background: linear-gradient(170deg,
    rgba(11, 14, 24, 1) 0%,
    rgba(8, 11, 20, 1) 50%,
    rgba(6, 8, 16, 1) 100%);
  border: 1px solid rgba(160, 120, 32, 0.12);
  border-radius: var(--r);
  box-shadow:
    inset 0 1px 0 rgba(210, 175, 90, 0.04),
    0 2px 8px rgba(0, 0, 0, 0.40);
  overflow: hidden;
}

body[data-theme="light"] .kc-card {
  background: linear-gradient(170deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(245, 248, 252, 0.90) 100%);
  border: 1px solid rgba(60, 100, 145, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.50),
    0 2px 8px rgba(60, 100, 145, 0.10);
}

.kc-card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(160, 120, 32, 0.10);
}

.kc-card-title {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--smoke);
}

.kc-card-meta {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--smoke4);
  text-transform: uppercase;
}

.kc-card-body { padding: 12px 0; }

.kc-card-empty {
  padding: 32px 18px;
  text-align: center;
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--smoke4);
  letter-spacing: 0.02em;
}

/* ── Priority row ────────────────────────────────────────────────────── */
.kc-prio-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(160, 120, 32, 0.06);
  cursor: pointer;
  transition: background 0.15s;
}
.kc-prio-row:last-child { border-bottom: none; }
.kc-prio-row:hover { background: rgba(160, 120, 32, 0.04); }
body[data-theme="light"] .kc-prio-row:hover { background: rgba(60, 100, 145, 0.04); }

.kc-prio-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  background: rgba(160, 120, 32, 0.08);
  color: var(--gold);
  border: 1px solid rgba(160, 120, 32, 0.20);
}
.kc-prio-icon.kc-icon-risk {
  background: rgba(192, 57, 43, 0.08);
  color: var(--red-lt);
  border-color: rgba(192, 57, 43, 0.30);
}
.kc-prio-icon.kc-icon-warn {
  background: rgba(196, 154, 22, 0.10);
  color: var(--amber-lt);
  border-color: rgba(196, 154, 22, 0.30);
}
.kc-prio-icon.kc-icon-ok {
  background: rgba(61, 179, 110, 0.08);
  color: var(--green-lt);
  border-color: rgba(61, 179, 110, 0.30);
}

.kc-prio-main { flex: 1; min-width: 0; }

.kc-prio-title {
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--smoke);
  letter-spacing: 0.01em;
  margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.kc-prio-sub {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--smoke3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kc-prio-due {
  flex-shrink: 0;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--smoke4);
  text-align: right;
}
.kc-prio-due.kc-due-overdue { color: var(--red-lt); font-weight: 500; }
.kc-prio-due.kc-due-soon    { color: var(--amber-lt); }

.kc-prio-arrow {
  flex-shrink: 0;
  color: var(--smoke4);
  font-family: var(--f-mono);
  font-size: 14px;
  opacity: 0.6;
  transition: transform 0.15s, opacity 0.15s, color 0.15s;
}
.kc-prio-row:hover .kc-prio-arrow {
  transform: translateX(2px);
  opacity: 1;
  color: var(--gold);
}

/* ── Activity row (similar but lighter) ─────────────────────────────── */
.kc-act-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(160, 120, 32, 0.05);
}
.kc-act-row:last-child { border-bottom: none; }

.kc-act-actor {
  flex-shrink: 0;
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(160, 120, 32, 0.08);
  border: 1px solid rgba(160, 120, 32, 0.15);
  color: var(--gold);
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.kc-act-text {
  flex: 1; min-width: 0;
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--smoke2);
  letter-spacing: 0.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.kc-act-when {
  flex-shrink: 0;
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--smoke4);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/* ── Location health card ───────────────────────────────────────────── */
.kc-health-summary {
  display: flex; gap: 10px; padding: 14px 18px 18px;
  border-bottom: 1px solid rgba(160, 120, 32, 0.08);
}

.kc-health-stat {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  border: 1px solid rgba(160, 120, 32, 0.12);
  border-radius: 4px;
  background: rgba(160, 120, 32, 0.03);
}

.kc-health-stat-num {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--smoke);
  line-height: 1.1;
}

.kc-health-stat-num.kc-stat-ok    { color: var(--green-lt); }
.kc-health-stat-num.kc-stat-watch { color: var(--amber-lt); }
.kc-health-stat-num.kc-stat-alert { color: var(--red-lt); }

.kc-health-stat-label {
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--smoke4);
  margin-top: 4px;
}

.kc-health-list {
  padding: 6px 0;
}

.kc-health-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.15s;
}
.kc-health-row:hover { background: rgba(160, 120, 32, 0.04); }
body[data-theme="light"] .kc-health-row:hover { background: rgba(60, 100, 145, 0.04); }

.kc-health-dot {
  flex-shrink: 0;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green-lt);
  box-shadow: 0 0 6px currentColor;
}
.kc-health-dot.kc-dot-watch { background: var(--amber-lt); }
.kc-health-dot.kc-dot-alert { background: var(--red-lt); }

.kc-health-name {
  flex: 1;
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--smoke2);
  letter-spacing: 0.02em;
}

.kc-health-issues {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.10em;
  color: var(--smoke4);
  text-transform: uppercase;
}

/* ── Inspector pack button ──────────────────────────────────────────── */
.kc-inspector-btn {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  padding: 14px 20px;
  background: linear-gradient(180deg,
    rgba(160, 120, 32, 0.18) 0%,
    rgba(160, 120, 32, 0.08) 100%);
  border: 1px solid rgba(160, 120, 32, 0.40);
  border-radius: var(--r);
  color: var(--gold-lt);
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow:
    inset 0 1px 0 rgba(210, 175, 90, 0.10),
    0 2px 8px rgba(0, 0, 0, 0.30);
}

.kc-inspector-btn:hover {
  background: linear-gradient(180deg,
    rgba(160, 120, 32, 0.24) 0%,
    rgba(160, 120, 32, 0.12) 100%);
  border-color: rgba(160, 120, 32, 0.60);
  color: var(--gold);
}

.kc-inspector-btn-icon {
  font-size: 14px;
  opacity: 0.85;
}

.kc-inspector-btn-sub {
  display: block;
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--smoke4);
  margin-top: 4px;
  text-align: center;
  padding: 0 8px;
}

/* ── View-as switcher (admin only) ───────────────────────────────────── */
.kc-viewas {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(160, 120, 32, 0.25);
  border-radius: 4px;
  background: rgba(160, 120, 32, 0.04);
  color: var(--smoke3);
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}
.kc-viewas:hover {
  border-color: rgba(160, 120, 32, 0.45);
  color: var(--smoke2);
  background: rgba(160, 120, 32, 0.08);
}
.kc-viewas.kc-viewas-impersonating {
  border-color: var(--gold);
  color: var(--gold-lt);
  background: rgba(160, 120, 32, 0.10);
}
.kc-viewas-arrow { font-size: 8px; opacity: 0.7; }

.kc-viewas-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--ink2);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.50);
  z-index: 1000;
  overflow: hidden;
  display: none;
}
.kc-viewas-menu.open { display: block; }
.kc-viewas-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(160, 120, 32, 0.06);
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.kc-viewas-menu-item:last-child { border-bottom: none; }
.kc-viewas-menu-item:hover { background: rgba(160, 120, 32, 0.06); }
.kc-viewas-menu-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.10em;
  color: var(--smoke);
  text-transform: uppercase;
}
.kc-viewas-menu-sub {
  font-family: var(--f-body);
  font-size: 11px;
  color: var(--smoke3);
  margin-top: 2px;
}
.kc-viewas-menu-item.active {
  background: rgba(160, 120, 32, 0.10);
}
.kc-viewas-menu-item.active .kc-viewas-menu-label { color: var(--gold); }

/* ── Loading & error states ─────────────────────────────────────────── */
.kc-loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px 20px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--smoke4);
  text-transform: uppercase;
}
.kc-loading::before {
  content: '';
  display: inline-block;
  width: 12px; height: 12px;
  margin-right: 14px;
  border: 1.5px solid rgba(160, 120, 32, 0.20);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: kc-spin 0.8s linear infinite;
}
@keyframes kc-spin { to { transform: rotate(360deg); } }

.kc-error {
  margin: 24px 32px;
  padding: 14px 18px;
  border: 1px solid rgba(192, 57, 43, 0.40);
  background: rgba(192, 57, 43, 0.06);
  border-radius: var(--r);
  color: var(--red-lt);
  font-family: var(--f-mono);
  font-size: 11px;
  line-height: 1.6;
}

/* ── Mini-tabs inside a module body (used by Today's right column later) ─ */
.kc-tabs {
  display: flex; gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(160, 120, 32, 0.10);
  padding-bottom: 0;
}
.kc-tab {
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--smoke3);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
}
.kc-tab:hover { color: var(--smoke); }
.kc-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ═══════════════════════════════════════════════════════════════════════
   AUDITS module — list, detail, walking, generate, pack
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Action buttons (used across modules) ───────────────────────────── */
.kc-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--r);
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  border: 1px solid;
  background: transparent;
  color: var(--smoke2);
  border-color: rgba(160,120,32,0.25);
}
.kc-action-btn:hover {
  border-color: rgba(160,120,32,0.50);
  color: var(--smoke);
  background: rgba(160,120,32,0.06);
}
.kc-action-btn:disabled {
  opacity: 0.40; cursor: not-allowed;
}

.kc-action-btn-primary {
  background: linear-gradient(180deg,
    rgba(160,120,32,0.20) 0%,
    rgba(160,120,32,0.10) 100%);
  border-color: rgba(160,120,32,0.50);
  color: var(--gold-lt);
  box-shadow:
    inset 0 1px 0 rgba(210,175,90,0.10),
    0 2px 6px rgba(0,0,0,0.30);
}
.kc-action-btn-primary:hover {
  background: linear-gradient(180deg,
    rgba(160,120,32,0.28) 0%,
    rgba(160,120,32,0.14) 100%);
  border-color: rgba(160,120,32,0.70);
  color: var(--gold);
}
.kc-action-btn-ghost {
  background: transparent;
  border-color: rgba(160,120,32,0.18);
  color: var(--smoke3);
}
.kc-action-btn-destructive {
  border-color: rgba(192,57,43,0.40);
  color: var(--red-lt);
  background: rgba(192,57,43,0.06);
}
.kc-action-btn-destructive:hover {
  border-color: rgba(192,57,43,0.70);
  color: #ff7060;
  background: rgba(192,57,43,0.10);
}

/* ── Inputs (filters, search) ───────────────────────────────────────── */
.kc-input {
  padding: 8px 12px;
  background: rgba(11,14,24,0.85);
  border: 1px solid rgba(160,120,32,0.20);
  border-radius: var(--r);
  color: var(--smoke);
  font-family: var(--f-body);
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: border-color 0.15s;
  outline: none;
}
.kc-input:focus {
  border-color: rgba(160,120,32,0.50);
}
.kc-input::placeholder { color: var(--smoke4); }
body[data-theme="light"] .kc-input {
  background: rgba(255,255,255,0.85);
  border-color: rgba(60,100,145,0.22);
  color: var(--smoke);
}

/* ── Native <select> — strip OS default chrome and draw our own chevron ── */
/* Without this, every dropdown in the suite shows the browser-default
   arrow + native menu panel, which clashes badly with the rest of the UI. */
select.kc-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 32px;
  cursor: pointer;
  /* Gold chevron SVG, inline so it works without a separate asset */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23a07820' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M2 2l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 7px;
}
select.kc-input:hover {
  border-color: rgba(160,120,32,0.40);
}
select.kc-input:focus {
  border-color: rgba(160,120,32,0.60);
}
/* The options panel is OS-painted — we can't restyle it across browsers,
   but at least make sure the option text matches the field background
   so it doesn't render as blinding white in dark mode. */
select.kc-input option {
  background: rgba(11,14,24,1);
  color: var(--smoke);
}
body[data-theme="light"] select.kc-input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%233c6491' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M2 2l4 4 4-4'/></svg>");
}
body[data-theme="light"] select.kc-input option {
  background: #fff;
  color: var(--smoke);
}

/* ── Date inputs — normalize across browsers ─────────────────────────── */
input[type="date"].kc-input,
input[type="datetime-local"].kc-input,
input[type="time"].kc-input {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--f-body);
  cursor: pointer;
  color-scheme: dark;
}
body[data-theme="light"] input[type="date"].kc-input,
body[data-theme="light"] input[type="datetime-local"].kc-input,
body[data-theme="light"] input[type="time"].kc-input {
  color-scheme: light;
}
/* Recolor the WebKit calendar-picker indicator to match our palette */
input[type="date"].kc-input::-webkit-calendar-picker-indicator,
input[type="datetime-local"].kc-input::-webkit-calendar-picker-indicator,
input[type="time"].kc-input::-webkit-calendar-picker-indicator {
  filter: invert(60%) sepia(70%) saturate(380%) hue-rotate(2deg);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}
input[type="date"].kc-input::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"].kc-input::-webkit-calendar-picker-indicator:hover,
input[type="time"].kc-input::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}
body[data-theme="light"] input[type="date"].kc-input::-webkit-calendar-picker-indicator,
body[data-theme="light"] input[type="datetime-local"].kc-input::-webkit-calendar-picker-indicator,
body[data-theme="light"] input[type="time"].kc-input::-webkit-calendar-picker-indicator {
  filter: invert(35%) sepia(45%) saturate(380%) hue-rotate(170deg);
}

/* ── Custom checkbox — replaces OS-default visuals ──────────────────── */
/* Applied to any bare <input type="checkbox"> inside the suite. */
.kc-module input[type="checkbox"]:not(.kc-native-cb),
.kc-module input[type="radio"]:not(.kc-native-cb) {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 16px;
  height: 16px;
  background: rgba(11,14,24,0.85);
  border: 1px solid rgba(160,120,32,0.40);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  vertical-align: middle;
  transition: background 0.15s, border-color 0.15s;
  margin: 0;
}
.kc-module input[type="radio"]:not(.kc-native-cb) {
  border-radius: 50%;
}
.kc-module input[type="checkbox"]:not(.kc-native-cb):hover,
.kc-module input[type="radio"]:not(.kc-native-cb):hover {
  border-color: rgba(160,120,32,0.70);
}
.kc-module input[type="checkbox"]:not(.kc-native-cb):checked,
.kc-module input[type="radio"]:not(.kc-native-cb):checked {
  background: rgba(160,120,32,0.85);
  border-color: rgba(160,120,32,0.85);
}
/* Checkmark — drawn with a positioned ::after */
.kc-module input[type="checkbox"]:not(.kc-native-cb):checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0px;
  width: 5px;
  height: 9px;
  border-right: 2px solid rgba(11,14,24,0.95);
  border-bottom: 2px solid rgba(11,14,24,0.95);
  transform: rotate(45deg);
}
.kc-module input[type="radio"]:not(.kc-native-cb):checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(11,14,24,0.95);
}
.kc-module input[type="checkbox"]:not(.kc-native-cb):focus-visible,
.kc-module input[type="radio"]:not(.kc-native-cb):focus-visible {
  box-shadow: 0 0 0 2px rgba(160,120,32,0.35);
  outline: none;
}
body[data-theme="light"] .kc-module input[type="checkbox"]:not(.kc-native-cb),
body[data-theme="light"] .kc-module input[type="radio"]:not(.kc-native-cb) {
  background: #fff;
  border-color: rgba(60,100,145,0.45);
}
body[data-theme="light"] .kc-module input[type="checkbox"]:not(.kc-native-cb):checked,
body[data-theme="light"] .kc-module input[type="radio"]:not(.kc-native-cb):checked {
  background: rgba(60,100,145,0.95);
  border-color: rgba(60,100,145,0.95);
}
body[data-theme="light"] .kc-module input[type="checkbox"]:not(.kc-native-cb):checked::after,
body[data-theme="light"] .kc-module input[type="radio"]:not(.kc-native-cb):checked::after {
  border-right-color: #fff;
  border-bottom-color: #fff;
  background: #fff;
}

/* ── Modal (centered dialog for confirm/prompt) ─────────────────────── */
/* Used by kcConfirm() and kcPrompt() to replace native window.confirm /
   window.prompt — those rendered with OS-default visuals. */
.kc-modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.62);
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.kc-modal-scrim.kc-modal-open {
  opacity: 1;
}
body[data-theme="light"] .kc-modal-scrim {
  background: rgba(20,30,50,0.45);
}

.kc-modal {
  background: linear-gradient(170deg,
    rgba(14,18,30,1) 0%,
    rgba(10,13,22,1) 100%);
  border: 1px solid rgba(160,120,32,0.30);
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  width: min(440px, 100%);
  max-height: 90vh;
  overflow: auto;
  transform: translateY(8px) scale(0.985);
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.kc-modal-scrim.kc-modal-open .kc-modal {
  transform: translateY(0) scale(1);
}
body[data-theme="light"] .kc-modal {
  background: #fff;
  border-color: rgba(60,100,145,0.30);
  box-shadow: 0 24px 60px rgba(60,100,145,0.20);
}

.kc-modal-head {
  padding: 22px 24px 8px;
}
.kc-modal-title {
  font-family: var(--f-display);
  font-size: 18px;
  letter-spacing: 0.01em;
  color: var(--smoke);
  line-height: 1.3;
  margin: 0;
}
.kc-modal-body {
  padding: 8px 24px 18px;
  font-family: var(--f-body);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--smoke2);
}
.kc-modal-input {
  width: 100%;
  margin-top: 12px;
}
.kc-modal-input textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--f-body);
}
.kc-modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 24px 20px;
  border-top: 1px solid rgba(160,120,32,0.08);
  background: rgba(0,0,0,0.12);
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}
body[data-theme="light"] .kc-modal-foot {
  border-top-color: rgba(60,100,145,0.10);
  background: rgba(60,100,145,0.04);
}

/* ── Shared list-card rows (used by every module's list view, not just Audits) ── */
.kc-list-card { }
.kc-list-rows { padding: 0; }

.kc-audit-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(160,120,32,0.06);
  cursor: pointer;
  transition: background 0.15s;
}
.kc-audit-row:last-child { border-bottom: none; }
.kc-audit-row:hover { background: rgba(160,120,32,0.04); }
body[data-theme="light"] .kc-audit-row:hover { background: rgba(60,100,145,0.04); }

.kc-audit-row-main { flex: 1; min-width: 0; }
.kc-audit-row-name {
  font-family: var(--f-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--smoke);
  letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 4px;
}
.kc-audit-row-sub {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--smoke3);
  letter-spacing: 0.06em;
}

.kc-audit-row-stats {
  display: flex; flex-direction: column; gap: 6px;
  flex-shrink: 0;
  width: 200px;
}

.kc-audit-progress { display: flex; align-items: center; gap: 8px; }
.kc-audit-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(160,120,32,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.kc-audit-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-lt) 100%);
  border-radius: 2px;
}
.kc-audit-progress-label {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--smoke3);
  letter-spacing: 0.10em;
  width: 36px;
  text-align: right;
}

.kc-audit-row-meta {
  display: flex; gap: 12px;
  font-family: var(--f-mono);
}
.kc-audit-meta-num {
  font-size: 12px;
  color: var(--smoke);
  font-weight: 500;
}
.kc-audit-meta-num.kc-meta-no { color: var(--red-lt); }
.kc-audit-meta-num.kc-meta-na { color: var(--smoke4); }
.kc-audit-meta-lbl {
  font-size: 8px;
  color: var(--smoke4);
  letter-spacing: 0.10em;
  margin-left: 2px;
  text-transform: uppercase;
}

.kc-audit-row-status {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  flex-shrink: 0;
  width: 110px;
}
.kc-audit-row-when {
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--smoke4);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.kc-audit-row-arrow {
  flex-shrink: 0;
  color: var(--smoke4);
  font-family: var(--f-mono);
  font-size: 16px;
  opacity: 0.5;
  transition: all 0.15s;
}
.kc-audit-row:hover .kc-audit-row-arrow {
  transform: translateX(2px);
  opacity: 1;
  color: var(--gold);
}

/* ── Status badges ──────────────────────────────────────────────────── */
.kc-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
}
.kc-badge-default { background: rgba(160,120,32,0.06); border-color: rgba(160,120,32,0.25); color: var(--smoke3); }
.kc-badge-warn    { background: rgba(196,154,22,0.08); border-color: rgba(196,154,22,0.40); color: var(--amber-lt); }
.kc-badge-ok      { background: rgba(61,179,110,0.08); border-color: rgba(61,179,110,0.40); color: var(--green-lt); }
.kc-badge-mute    { background: rgba(160,120,32,0.04); border-color: rgba(160,120,32,0.18); color: var(--smoke4); }

/* ── Pack mode ──────────────────────────────────────────────────────── */
.kc-pack-banner {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 32px;
  padding: 12px 16px;
  border: 1px solid rgba(160,120,32,0.40);
  background: rgba(160,120,32,0.06);
  border-radius: var(--r);
}
.kc-pack-banner-text { font-family: var(--f-body); font-size: 13px; color: var(--smoke2); }
.kc-pack-banner-text strong {
  font-weight: 500; color: var(--gold-lt);
  margin-right: 8px;
}
.kc-pack-count {
  margin-left: 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--gold);
  text-transform: uppercase;
}
.kc-pack-banner-actions { display: flex; gap: 10px; }

.kc-pack-check {
  display: inline-flex; align-items: center;
  cursor: pointer; flex-shrink: 0;
  padding: 6px;
  margin-right: -4px;
}
.kc-pack-check input { display: none; }
.kc-pack-check-box {
  display: inline-block;
  width: 18px; height: 18px;
  border: 1.5px solid rgba(160,120,32,0.50);
  border-radius: 3px;
  background: rgba(11,14,24,0.40);
  position: relative;
}
.kc-pack-check input:checked + .kc-pack-check-box {
  background: var(--gold);
  border-color: var(--gold);
}
.kc-pack-check input:checked + .kc-pack-check-box::after {
  content: '✓';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

/* ── Detail view ────────────────────────────────────────────────────── */
.kc-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 1100px) {
  .kc-detail-grid { grid-template-columns: 1fr; }
}

.kc-bigprog {
  margin-bottom: 18px;
}
.kc-bigprog-bar {
  height: 8px;
  background: rgba(160,120,32,0.08);
  border-radius: 4px;
  overflow: hidden;
}
.kc-bigprog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-lt) 100%);
  border-radius: 4px;
}

.kc-bigstats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.kc-bigstat {
  text-align: center;
  padding: 10px 6px;
  border: 1px solid rgba(160,120,32,0.10);
  border-radius: 4px;
  background: rgba(160,120,32,0.03);
}
.kc-bigstat-num {
  font-family: var(--f-display);
  font-size: 22px;
  color: var(--smoke);
  line-height: 1.1;
}
.kc-bigstat-num.kc-stat-ok    { color: var(--green-lt); }
.kc-bigstat-num.kc-stat-watch { color: var(--amber-lt); }
.kc-bigstat-num.kc-stat-alert { color: var(--red-lt); }
.kc-bigstat-lbl {
  font-family: var(--f-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--smoke4);
  margin-top: 4px;
}

.kc-meta-row {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(160,120,32,0.06);
}
.kc-meta-row:last-child { border-bottom: none; }
.kc-meta-label {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--smoke4);
  text-transform: uppercase;
}
.kc-meta-value {
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--smoke);
  text-align: right;
  letter-spacing: 0.01em;
}

.kc-detail-actions {
  display: flex; gap: 10px;
  padding: 16px 0;
  border-top: 1px solid rgba(160,120,32,0.10);
  margin-top: 16px;
}

