:root {
  --klus-red: #e30613;
  --klus-red-dark: #a9000a;
  --klus-black: #080808;
  --klus-panel: #151515;
  --klus-border: #2a2a2a;
}

html[data-brand="klus-r"] body {
  background: #f4f4f5 !important;
}

html[data-brand="klus-r"] ::selection {
  background: rgba(227, 6, 19, .22);
}

#admin-sidebar.klus-r-sidebar {
  background: var(--klus-black) !important;
  border-right-color: var(--klus-border) !important;
  box-shadow: 10px 0 28px rgba(0, 0, 0, .13);
}

#admin-sidebar.klus-r-sidebar > div:first-child > div:first-child {
  border-bottom-color: #262626 !important;
  background: linear-gradient(145deg, #050505, #131313);
}

.klus-r-logo {
  background: var(--klus-red) !important;
  border-color: #ff4450 !important;
  color: #fff !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(227, 6, 19, .28);
  font-size: 22px !important;
  font-weight: 900 !important;
  letter-spacing: -.08em;
}

.klus-r-logo svg { display: none !important; }
.klus-r-logo span { transform: translateX(-1px); }

.klus-r-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.klus-r-menu-section {
  margin: 15px 10px 4px;
  padding-top: 10px;
  border-top: 1px solid #252525;
  color: #7f7f86;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.klus-r-menu-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#admin-sidebar button[id^="nav-item-"] {
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  min-height: 42px;
}

#admin-sidebar button[id^="nav-item-"]:hover {
  background: #191919 !important;
  border-color: #2b2b2b !important;
}

#admin-sidebar button[id^="nav-item-"][class*="bg-stone-800"] {
  background: linear-gradient(90deg, rgba(227, 6, 19, .20), #1a1a1a 36%) !important;
  border-color: rgba(227, 6, 19, .55) !important;
  box-shadow: inset 3px 0 0 var(--klus-red) !important;
}

#admin-sidebar button[id^="nav-item-"][class*="bg-stone-800"] svg,
#admin-sidebar button[id^="nav-item-"] svg.text-amber-400 {
  color: #ff3340 !important;
}

html[data-brand="klus-r"] [class*="text-amber-3"],
html[data-brand="klus-r"] [class*="text-amber-4"],
html[data-brand="klus-r"] [class*="text-amber-5"],
html[data-brand="klus-r"] [class*="text-amber-6"],
html[data-brand="klus-r"] [class*="text-amber-7"] {
  color: #d90b18 !important;
}

html[data-brand="klus-r"] [class*="border-amber-"] {
  border-color: rgba(227, 6, 19, .42) !important;
}

html[data-brand="klus-r"] [class*="bg-amber-500"] {
  background-color: var(--klus-red) !important;
}

html[data-brand="klus-r"] [class*="selection:bg-amber"]::selection {
  background: rgba(227, 6, 19, .22) !important;
}

html[data-brand="klus-r"] main h1,
html[data-brand="klus-r"] main h2 {
  letter-spacing: -.025em;
}

html[data-brand="klus-r"] main h1::after {
  content: "";
  display: block;
  width: 38px;
  height: 3px;
  margin-top: 9px;
  border-radius: 99px;
  background: var(--klus-red);
}

.klus-r-status-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  width: min(310px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid #2e2e31;
  border-top: 3px solid var(--klus-red);
  border-radius: 14px;
  background: rgba(8, 8, 8, .96);
  color: #f4f4f5;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .32);
  backdrop-filter: blur(16px);
  font-family: inherit;
}

.klus-r-status-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.klus-r-status-title strong { font-size: 13px; }
.klus-r-status-title span { color: #8f8f96; font-size: 10px; text-transform: uppercase; letter-spacing: .11em; }

.klus-r-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: #d4d4d8;
  font-size: 11px;
}

.klus-r-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .13);
}
.klus-r-status-dot.is-ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .13); }

.klus-r-status-counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 10px 0;
}

.klus-r-status-counts span {
  padding: 8px;
  border: 1px solid #2e2e31;
  border-radius: 9px;
  background: #141416;
  color: #a1a1aa;
  font-size: 10px;
}
.klus-r-status-counts b { display: block; color: #fff; font-size: 16px; }

#klus-r-test-ai {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ff3542;
  border-radius: 9px;
  background: var(--klus-red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
#klus-r-test-ai:hover { background: #ff1220; }
#klus-r-test-ai:disabled { cursor: not-allowed; opacity: .45; }

.klus-r-status-help { margin: 8px 0 0; color: #a1a1aa; font-size: 9px; line-height: 1.4; }
.klus-r-status-help code { color: #fda4af; word-break: break-all; }

.klus-r-readiness-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 16px 0 4px;
  padding: 14px 16px;
  border: 1px solid #d4d4d8;
  border-left: 4px solid var(--klus-red);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .04);
}
.klus-r-readiness-card strong { color: #18181b; font-size: 13px; }
.klus-r-readiness-card p { margin: 3px 0 0; color: #71717a; font-size: 11px; }
.klus-r-readiness-numbers { display: flex; gap: 8px; flex: 0 0 auto; }
.klus-r-readiness-numbers span { min-width: 100px; padding: 8px 10px; border-radius: 9px; background: #f4f4f5; color: #71717a; font-size: 10px; }
.klus-r-readiness-numbers b { display: block; color: #18181b; font-size: 17px; }

.klus-r-inline-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 120;
  max-width: min(560px, calc(100vw - 32px));
  transform: translate(-50%, 24px);
  opacity: 0;
  padding: 11px 16px;
  border-radius: 10px;
  color: #fff;
  background: #18181b;
  box-shadow: 0 15px 45px rgba(0,0,0,.28);
  font-size: 12px;
  font-weight: 700;
  transition: opacity .2s ease, transform .2s ease;
}
.klus-r-inline-toast.klus-r-tone-warn { background: #991b1b; }
.klus-r-inline-toast.klus-r-toast-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .klus-r-status-widget { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
  .klus-r-readiness-card { align-items: flex-start; flex-direction: column; }
  .klus-r-readiness-numbers { width: 100%; }
  .klus-r-readiness-numbers span { flex: 1; min-width: 0; }
}

/* Klus-R bulk AI-teksten */
.klus-r-custom-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 16px);
  min-height: 42px;
  margin: 2px 8px;
  padding: 9px 12px;
  border: 1px solid rgba(227, 6, 19, .35);
  border-radius: 9px;
  background: rgba(227, 6, 19, .10);
  color: #f4f4f5;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.klus-r-custom-nav:hover { background: rgba(227, 6, 19, .18); border-color: rgba(255, 51, 64, .7); }
.klus-r-custom-nav.is-running { box-shadow: inset 3px 0 0 var(--klus-red); }
.klus-r-custom-nav svg { width: 18px; height: 18px; color: #ff3340; flex: 0 0 auto; }
.klus-r-custom-nav > span:nth-child(2) { flex: 1; }
.klus-r-nav-progress { color: #fda4af; font-size: 10px; font-variant-numeric: tabular-nums; }

.klus-r-status-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
#klus-r-status-widget #klus-r-test-ai,
#klus-r-status-widget #klus-r-open-bulk {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border-radius: 9px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
#klus-r-status-widget #klus-r-test-ai { border: 1px solid #ff3542; background: var(--klus-red); }
#klus-r-status-widget #klus-r-open-bulk { border: 1px solid #3f3f46; background: #202024; }
#klus-r-status-widget #klus-r-open-bulk:hover { border-color: #ff3542; background: #2a1719; }
#klus-r-status-widget button:disabled { cursor: not-allowed; opacity: .45; }
.klus-r-bulk-mini { height: 4px; margin: 0 0 9px; overflow: hidden; border-radius: 99px; background: #2d2d31; }
.klus-r-bulk-mini span { display: block; height: 100%; border-radius: inherit; background: var(--klus-red); transition: width .25s ease; }

.klus-r-bulk-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(6px);
}
.klus-r-bulk-modal.is-open { display: flex; }
.klus-r-bulk-panel {
  width: min(680px, 100%);
  max-height: min(820px, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid #2d2d31;
  border-top: 4px solid var(--klus-red);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .42);
}
.klus-r-bulk-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  background: #09090b;
  color: #fff;
}
.klus-r-bulk-header span { color: #ff5260; font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.klus-r-bulk-header h2 { margin: 4px 0 2px; font-size: 21px; line-height: 1.2; }
.klus-r-bulk-header p { margin: 0; color: #a1a1aa; font-size: 12px; }
.klus-r-bulk-header > button {
  width: 34px;
  height: 34px;
  border: 1px solid #343439;
  border-radius: 9px;
  background: #18181b;
  color: #d4d4d8;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.klus-r-bulk-header > button:hover { border-color: #ff3542; color: #fff; }
.klus-r-bulk-body { display: grid; gap: 16px; padding: 24px; }
.klus-r-bulk-loading { display: flex; align-items: center; gap: 10px; padding: 30px 0; color: #52525b; font-size: 13px; }
.klus-r-bulk-loading span { width: 18px; height: 18px; border: 2px solid #d4d4d8; border-top-color: var(--klus-red); border-radius: 50%; animation: klus-r-spin .8s linear infinite; }
@keyframes klus-r-spin { to { transform: rotate(360deg); } }
.klus-r-bulk-info { padding: 14px 16px; border: 1px solid #e4e4e7; border-left: 4px solid var(--klus-red); border-radius: 11px; background: #fafafa; }
.klus-r-bulk-info strong { color: #18181b; font-size: 14px; }
.klus-r-bulk-info p { margin: 4px 0 0; color: #71717a; font-size: 11px; }
.klus-r-field { display: grid; gap: 6px; }
.klus-r-field > span { color: #3f3f46; font-size: 11px; font-weight: 800; }
.klus-r-field select,
.klus-r-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #d4d4d8;
  border-radius: 9px;
  background: #fff;
  color: #18181b;
  font: inherit;
  font-size: 12px;
  outline: none;
}
.klus-r-field select:focus,
.klus-r-field input:focus { border-color: var(--klus-red); box-shadow: 0 0 0 3px rgba(227, 6, 19, .10); }
.klus-r-check { display: flex; align-items: center; gap: 9px; color: #3f3f46; font-size: 12px; font-weight: 650; cursor: pointer; }
.klus-r-check input { accent-color: var(--klus-red); }
.klus-r-bulk-warning { padding: 13px 15px; border: 1px solid #fecdd3; border-radius: 10px; background: #fff1f2; color: #881337; }
.klus-r-bulk-warning strong { font-size: 11px; }
.klus-r-bulk-warning p { margin: 4px 0 0; font-size: 10px; line-height: 1.55; }
.klus-r-bulk-key-warning { margin: 0; color: #b91c1c; font-size: 10px; line-height: 1.5; }
.klus-r-bulk-progress-head { display: flex; justify-content: space-between; gap: 16px; color: #27272a; font-size: 13px; }
.klus-r-bulk-progress-head span { font-variant-numeric: tabular-nums; color: #71717a; }
.klus-r-bulk-progress { height: 12px; overflow: hidden; border-radius: 99px; background: #e4e4e7; }
.klus-r-bulk-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #a9000a, #e30613); transition: width .3s ease; }
.klus-r-bulk-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.klus-r-bulk-stats span { padding: 10px; border: 1px solid #e4e4e7; border-radius: 9px; background: #fafafa; color: #71717a; font-size: 9px; }
.klus-r-bulk-stats b { display: block; margin-bottom: 2px; color: #18181b; font-size: 17px; }
.klus-r-bulk-message { margin: 0; padding: 11px 13px; border-radius: 9px; background: #f4f4f5; color: #52525b; font-size: 11px; line-height: 1.5; }
.klus-r-bulk-errors { border: 1px solid #fecaca; border-radius: 9px; padding: 10px 12px; background: #fef2f2; color: #991b1b; font-size: 10px; }
.klus-r-bulk-errors summary { cursor: pointer; font-weight: 800; }
.klus-r-bulk-errors p { margin: 9px 0 0; padding-top: 9px; border-top: 1px solid #fecaca; line-height: 1.45; }
.klus-r-bulk-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.klus-r-bulk-actions button { min-height: 38px; padding: 8px 13px; border-radius: 9px; font-size: 11px; font-weight: 800; cursor: pointer; }
.klus-r-bulk-actions button.primary { border: 1px solid var(--klus-red); background: var(--klus-red); color: #fff; }
.klus-r-bulk-actions button.secondary { border: 1px solid #27272a; background: #27272a; color: #fff; }
.klus-r-bulk-actions button.ghost { border: 1px solid #d4d4d8; background: #fff; color: #52525b; }
.klus-r-bulk-actions button:hover:not(:disabled) { transform: translateY(-1px); }
.klus-r-bulk-actions button:disabled { cursor: not-allowed; opacity: .45; }
.klus-r-bulk-note { margin: 0; color: #71717a; font-size: 10px; line-height: 1.5; }

@media (max-width: 640px) {
  .klus-r-status-actions { grid-template-columns: 1fr; }
  .klus-r-bulk-modal { align-items: flex-end; padding: 0; }
  .klus-r-bulk-panel { max-height: 92vh; border-radius: 18px 18px 0 0; }
  .klus-r-bulk-header, .klus-r-bulk-body { padding: 18px; }
  .klus-r-bulk-stats { grid-template-columns: repeat(2, 1fr); }
  .klus-r-bulk-actions { flex-direction: column; }
  .klus-r-bulk-actions button { width: 100%; }
}
