:root { color-scheme: dark; }
html, body { font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui; background: #080c14; color: #e2e8f0; }
.label-k { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: #94a3b8; }
.panel { background: #0f172a; border: 1px solid rgba(30, 41, 59, .8); }
.elev { background: #1e293b; border: 1px solid rgba(51, 65, 85, .55); }
.hair { border-color: rgba(30, 41, 59, .8); }
.tabular { font-variant-numeric: tabular-nums; }
.scrollbar-thin::-webkit-scrollbar { width: 8px; height: 8px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #334155; border-radius: 99px; }
.scrollbar-none { scrollbar-width: none; -ms-overflow-style: none; }
.scrollbar-none::-webkit-scrollbar { display: none; width: 0; height: 0; }
.side-bar { background: #25293c; color: #b6bee0; }
.side-sec { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: #6d748f; }
.nav-item { color: #a8b0c8; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #e8eaf4; }
.nav-item.is-on { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.is-on .nav-ico { color: #fff; }
.nav-ico { color: #8b92ab; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #28c76f; color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.brand-word { font-family: Fredoka, 'Plus Jakarta Sans', sans-serif; }
.dash-card { background: #1a2336; border: 1px solid rgba(148,163,184,.12); border-radius: 1rem; }
.dash-ico { width: 42px; height: 42px; border-radius: 999px; display: grid; place-items: center; }
.dash-sticky { background: #1a2336; }
.btn-primary-maniac {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  font-weight: 600;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 13px;
}
.btn-primary-maniac:hover { filter: brightness(1.08); }
.btn-ghost-maniac {
  border: 1px solid #475569;
  color: #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 13px;
  background: transparent;
}
.btn-ghost-maniac:hover { background: rgba(148, 163, 184, .16); }
.field-inp {
  background: #0f172a;
  border: 1px solid rgba(51, 65, 85, .55);
  border-radius: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 13px;
  width: 100%;
  color: #e2e8f0;
}
.field-inp:focus { outline: none; border-color: #7367f0; box-shadow: 0 0 0 3px rgba(115, 103, 240, .2); }
html.light { color-scheme: light; background: #f4f6f9; }
html.light body, html.light .page-shell { background: #f4f6f9 !important; color: #2f3349; }
html.light .brand-word { color: #2f3349; }
html.light .side-bar { background: #fff; color: #4b5675; border-right: 1px solid #e7eaf3; }
html.light .side-sec { color: #a1a9c3; }
html.light .nav-item { color: #6d748f; }
html.light .nav-item:hover { background: #f5f6fa; color: #2f3349; }
html.light .nav-item.is-on { background: #f1f0ff; color: #7367f0; }
html.light .nav-ico { color: #a8aaae; }
html.light .nav-item.is-on .nav-ico { color: #7367f0; }
html.light .dash-card { background: #fff; border-color: #e8ecf4; }
html.light .dash-sticky { background: #fff; }
html.light .panel { background: #fff; border-color: #e2e8f0; }
html.light .label-k { color: #8b92ab; }
html.light .page-chrome { background: rgba(255,255,255,.92) !important; border-color: #e7eaf3; color: #2f3349; }
html.light .field-inp { background: #fff !important; color: #2f3349 !important; border-color: #d8dbe6 !important; }
html.light .btn-ghost-maniac { border-color: #d8dbe6; color: #5d6480; }
html.light .scrollbar-thin::-webkit-scrollbar-thumb { background: #cfd4e0; }

.maniac-sidebar { width: 268px; }
@media (max-width: 767px) {
  .maniac-sidebar { transform: translateX(-100%); }
}
@media (min-width: 768px) {
  #main-shell { margin-left: 268px; }
  .maniac-sidebar { transform: translateX(0); }
  html.maniac-layout-ready #main-shell { transition: margin-left .2s ease; }
  html.maniac-layout-ready .maniac-sidebar {
    transition: width .2s ease, padding-left .2s ease, padding-right .2s ease, transform .2s ease;
  }
  html[data-sidebar-collapsed="1"] #main-shell { margin-left: 76px; }
  html[data-sidebar-collapsed="1"] .maniac-sidebar { width: 76px !important; padding-left: 0.5rem; padding-right: 0.5rem; }
  html[data-sidebar-collapsed="1"] .maniac-sidebar-text { display: none; }
  html[data-sidebar-collapsed="1"] .maniac-sidebar-collapse-btn { display: none !important; }
  html[data-sidebar-collapsed="1"] .maniac-sidebar-expand-btn { display: inline-flex !important; }
  html[data-sidebar-collapsed="1"] .maniac-sidebar-brand { justify-content: center; }
  html[data-sidebar-collapsed="1"] .maniac-sidebar-footer { display: none; }
  html[data-sidebar-collapsed="1"] [data-nav-panel] { display: none !important; }
}
[data-mobile-overlay] { display: none; }
body[data-sidebar-open="1"] .maniac-sidebar { transform: translateX(0); }
body[data-sidebar-open="1"] [data-mobile-overlay] { display: block; }
@media (max-width: 767px) {
  #main-shell { margin-left: 0 !important; }
}
.badge-maniac {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  background: rgba(51, 65, 85, .55);
  color: #cbd5e1;
  border: 1px solid rgba(71, 85, 105, .45);
}
.badge-maniac.is-violet { background: rgba(124, 58, 237, .2); color: #c4b5fd; border-color: rgba(124, 58, 237, .35); }
.badge-maniac.is-cyan { background: rgba(6, 182, 212, .18); color: #67e8f9; border-color: rgba(6, 182, 212, .35); }
.badge-maniac.is-emerald { background: rgba(16, 185, 129, .18); color: #6ee7b7; border-color: rgba(16, 185, 129, .35); }
.badge-maniac.is-rose { background: rgba(244, 63, 94, .18); color: #fda4af; border-color: rgba(244, 63, 94, .35); }
html.light .badge-maniac.is-cyan { background: rgba(6, 182, 212, .12); color: #0e7490; }
html.light .badge-maniac.is-emerald { background: rgba(16, 185, 129, .12); color: #047857; }
html.light .badge-maniac.is-rose { background: rgba(244, 63, 94, .12); color: #be123c; }
html.light .quote-line { background: #fff; border-color: #e2e8f0; }
.btn-ghost-maniac.is-active-ghost { background: rgba(148, 163, 184, .16); border-color: #64748b; }
.field-error { font-size: 11px; color: #f87171; margin-top: 0.25rem; }
.field-inp.is-invalid { border-color: #f87171; }

.glass {
  background: rgba(15, 23, 42, .96);
  border: 1px solid rgba(51, 65, 85, .65);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
html.light .glass { background: rgba(255, 255, 255, .98); border-color: #e2e8f0; box-shadow: 0 12px 32px rgba(15, 23, 42, .12); }

.kpi-mini-ico {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.maniac-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #1e293b;
  overflow: hidden;
}
.maniac-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #06b6d4);
}

.maniac-tag-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
  border: 1px solid rgba(30, 41, 59, .9);
  color: #94a3b8;
}

.maniac-segmented-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(30, 41, 59, .8);
  color: #94a3b8;
  text-decoration: none;
}
.maniac-segmented-btn.is-active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}

.maniac-doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.5rem;
  font-size: 11px;
  font-weight: 600;
  color: #ddd6fe;
  background: rgba(139, 92, 246, .1);
  border: 1px solid rgba(139, 92, 246, .25);
  border-radius: 6px;
  padding: 4px 8px;
  text-decoration: none;
  max-width: 100%;
}
.maniac-doc-chip.is-cyan { color: #a5f3fc; background: rgba(6, 182, 212, .1); border-color: rgba(6, 182, 212, .25); }
.maniac-doc-chip.is-amber { color: #fde68a; background: rgba(245, 158, 11, .1); border-color: rgba(245, 158, 11, .25); }
.maniac-doc-chip:hover { filter: brightness(1.08); }

.maniac-empty-ico {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(51, 65, 85, .35);
  display: grid;
  place-items: center;
}

.maniac-combo-option.is-selected { background: rgba(124, 58, 237, .15); }

.no-zoom, input, select, textarea, [contenteditable="true"] { font-size: 13px !important; line-height: 1.35; }
.wysiwyg:empty:before { content: attr(data-placeholder); color: #64748b; pointer-events: none; }
.wysiwyg ul { list-style: disc; padding-left: 1.1rem; margin: .35rem 0; }
.wysiwyg ol { list-style: decimal; padding-left: 1.1rem; margin: .35rem 0; }
.wysiwyg h2 { font-size: .95rem; font-weight: 700; margin: .15rem 0; }
.wysiwyg p { margin: .4rem 0; }
.wysiwyg a { color: #22d3ee; text-decoration: underline; }
html.light .wysiwyg a { color: #0e7490; }

.task-kanban-board {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: flex-start;
}
.task-kanban-col {
  min-width: 260px;
  width: 260px;
  flex: 1 0 auto;
  min-height: 320px;
}

.crm-kanban-col { min-width: 250px; width: 250px; }
#crm-kanban-board { overflow-x: auto; }
.lead-card .crm-stage-combo .field-inp { font-size: 11px; }
.crm-stage-combo .maniac-combo-panel { max-height: min(16rem, 70vh); }
.lead-card-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  width: 24px;
  border-radius: 6px;
  border: 1px solid rgba(51, 65, 85, .8);
  background: #080c14;
  color: #94a3b8;
}
.lead-card-ico:hover { color: #67e8f9; border-color: #475569; }
.lead-highlight, .lead-highlight-row {
  box-shadow: 0 0 0 2px rgba(6, 182, 212, .55);
  transition: box-shadow .3s ease;
}

.maniac-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, .65);
}
.maniac-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 71;
  width: min(100%, 420px);
  height: 100%;
  background: #0f172a;
  border-left: 1px solid rgba(51, 65, 85, .65);
  box-shadow: -12px 0 40px rgba(0, 0, 0, .35);
  transform: translateX(100%);
  transition: transform .2s ease;
  overflow-y: auto;
}
.maniac-drawer.is-open { transform: translateX(0); }
html.light .maniac-drawer { background: #fff; }

.client-tab-btn.is-active {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
}
.maniac-switch { position: relative; }
.maniac-switch-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.maniac-switch-track {
  display: block;
  width: 2.5rem;
  height: 1.35rem;
  border-radius: 9999px;
  background: rgba(51, 65, 85, .9);
  border: 1px solid rgba(71, 85, 105, .8);
  transition: background .15s ease, border-color .15s ease;
  position: relative;
}
.maniac-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background: #e2e8f0;
  transition: transform .15s ease;
}
.maniac-switch-input:focus-visible + .maniac-switch-track {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}
.maniac-switch-input:checked + .maniac-switch-track {
  background: #7c3aed;
  border-color: #6d28d9;
}
.maniac-switch-input:checked + .maniac-switch-track::after {
  transform: translateX(1.1rem);
}

.client-tab-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(30, 41, 59, .8);
  color: #94a3b8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
