/* ═══════════════════════════════════════════════════════════════
   Kasaloma BOS — Phase 1 UI Polish Layer
   Safe visual-only layer. No layout logic, DB logic, AJAX, or module behavior changed.
   Version: 2.6.9.21
   ═══════════════════════════════════════════════════════════════ */

body.kcrm-frontend-body {
  --kbos-bg: #f4f7fb;
  --kbos-surface: #ffffff;
  --kbos-surface-2: #f8fafc;
  --kbos-border: #e2e8f0;
  --kbos-border-soft: rgba(148,163,184,.22);
  --kbos-text: #0f172a;
  --kbos-muted: #64748b;
  --kbos-navy: #071a33;
  --kbos-navy-2: #0b1f3a;
  --kbos-navy-3: #15345b;
  --kbos-blue: #2563eb;
  --kbos-gold: #c8a45a;
  --kbos-green: #10b981;
  --kbos-red: #ef4444;
  --kbos-orange: #f59e0b;
  --kbos-radius-lg: 18px;
  --kbos-radius-md: 14px;
  --kbos-shadow-card: 0 1px 2px rgba(15,23,42,.04), 0 14px 36px rgba(15,23,42,.055);
  --kbos-shadow-soft: 0 10px 26px rgba(15,23,42,.06);
  background:
    radial-gradient(circle at 12% -8%, rgba(37,99,235,.10), transparent 24%),
    radial-gradient(circle at 90% 0%, rgba(200,164,90,.08), transparent 22%),
    var(--kbos-bg) !important;
  color: var(--kbos-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.kcrm-frontend-body .kcrm-wrap,
body.kcrm-frontend-body .kcrm-app-shell,
body.kcrm-frontend-body .kcrm-content-shell,
body.kcrm-frontend-body .kcrm-body-layout,
body.kcrm-frontend-body .kcrm-main-content-area,
body.kcrm-frontend-body .kbos-module-app {
  background: transparent !important;
}

/* App chrome */
body.kcrm-frontend-body .kcrm-app-sidebar {
  background:
    radial-gradient(circle at 30% 0%, rgba(37,99,235,.16), transparent 24%),
    linear-gradient(180deg, #071a33 0%, #0b1f3a 52%, #081a31 100%) !important;
  border-right: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: 18px 0 42px rgba(2,12,27,.18) !important;
}
body.kcrm-frontend-body .kcrm-sidebar-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,.35) transparent;
}
body.kcrm-frontend-body .kcrm-sidebar-scroll::-webkit-scrollbar { width: 6px; }
body.kcrm-frontend-body .kcrm-sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,.35); border-radius: 999px; }
body.kcrm-frontend-body .kcrm-side-title,
body.kcrm-frontend-body .kcrm-side-toggle,
body.kcrm-frontend-body .kcrm-side-subtitle {
  letter-spacing: .075em !important;
}
body.kcrm-frontend-body .kcrm-side-link {
  border: 1px solid transparent !important;
  color: rgba(235,242,252,.88) !important;
}
body.kcrm-frontend-body .kcrm-side-link:hover {
  background: rgba(255,255,255,.075) !important;
  border-color: rgba(255,255,255,.06) !important;
  transform: translateX(2px) !important;
}
body.kcrm-frontend-body .kcrm-side-link.active {
  background: linear-gradient(135deg, rgba(37,99,235,.30), rgba(255,255,255,.09)) !important;
  border-color: rgba(125,211,252,.18) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(2,12,27,.18) !important;
}
body.kcrm-frontend-body .kcrm-side-link.active:before {
  background: linear-gradient(180deg, #7dd3fc, #c8a45a) !important;
  box-shadow: 0 0 18px rgba(125,211,252,.45) !important;
}

/* Top/header and module tab chrome */
body.kcrm-frontend-body .kcrm-topbar,
body.kcrm-frontend-body .kcrm-header-only,
body.kcrm-frontend-body .kbos-module-topnav {
  background: rgba(255,255,255,.90) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226,232,240,.80) !important;
}
body.kcrm-frontend-body .kbos-module-topnav {
  box-shadow: 0 1px 0 rgba(255,255,255,.65), 0 10px 26px rgba(15,23,42,.035) !important;
}
body.kcrm-frontend-body .kbos-module-icon {
  box-shadow: 0 10px 24px rgba(37,99,235,.12) !important;
}
body.kcrm-frontend-body .kbos-module-title {
  letter-spacing: -.015em !important;
}
body.kcrm-frontend-body .kbos-module-tab {
  border-radius: 999px !important;
  transition: background .16s ease, color .16s ease, transform .16s ease, border-color .16s ease !important;
}
body.kcrm-frontend-body .kbos-module-tab:hover {
  transform: translateY(-1px) !important;
}
body.kcrm-frontend-body .kbos-module-tab.active {
  box-shadow: 0 8px 18px rgba(15,23,42,.08) !important;
}

/* Page canvas */
body.kcrm-frontend-body .kcrm-page,
body.kcrm-frontend-body .kbos-module-content,
body.kcrm-frontend-body .ksales-page,
body.kcrm-frontend-body .kwmc-wrap,
body.kcrm-frontend-body .ktc-wrap,
body.kcrm-frontend-body .kce-wrap,
body.kcrm-frontend-body .kpw-wrap,
body.kcrm-frontend-body .kads-wrap,
body.kcrm-frontend-body .kinstagram-wrap {
  color: var(--kbos-text) !important;
}
body.kcrm-frontend-body .kcrm-page {
  padding: 22px !important;
}

/* Cards, panels and widgets */
body.kcrm-frontend-body .kcrm-card,
body.kcrm-frontend-body .kdash-card,
body.kcrm-frontend-body .kdash-stat,
body.kcrm-frontend-body .kcrm-stat-card,
body.kcrm-frontend-body .kcrm-widget,
body.kcrm-frontend-body .kbos-card,
body.kcrm-frontend-body .ksales-card,
body.kcrm-frontend-body .ktc-card,
body.kcrm-frontend-body .kwmc-card,
body.kcrm-frontend-body .kce-card,
body.kcrm-frontend-body .kpw-card,
body.kcrm-frontend-body .kads-card,
body.kcrm-frontend-body .kin-card,
body.kcrm-frontend-body .kaa-card,
body.kcrm-frontend-body .kfb-card,
body.kcrm-frontend-body .kcrm-form-section {
  background: rgba(255,255,255,.94) !important;
  border: 1px solid var(--kbos-border-soft) !important;
  border-radius: var(--kbos-radius-lg) !important;
  box-shadow: var(--kbos-shadow-card) !important;
}
body.kcrm-frontend-body .kcrm-card,
body.kcrm-frontend-body .kdash-card,
body.kcrm-frontend-body .ksales-card,
body.kcrm-frontend-body .ktc-card,
body.kcrm-frontend-body .kwmc-card,
body.kcrm-frontend-body .kce-card,
body.kcrm-frontend-body .kpw-card,
body.kcrm-frontend-body .kads-card,
body.kcrm-frontend-body .kin-card {
  overflow: visible !important;
}
body.kcrm-frontend-body .kcrm-card h2,
body.kcrm-frontend-body .kcrm-card h3,
body.kcrm-frontend-body .kdash-card h2,
body.kcrm-frontend-body .ksales-card h2,
body.kcrm-frontend-body .ksales-card h3,
body.kcrm-frontend-body .ktc-card h2,
body.kcrm-frontend-body .kwmc-card h2,
body.kcrm-frontend-body .kce-card h2,
body.kcrm-frontend-body .kpw-card h2,
body.kcrm-frontend-body .kads-card h2 {
  color: var(--kbos-text) !important;
  letter-spacing: -.02em !important;
}

/* Dashboard command-center polish */
body.kcrm-frontend-body .kdash-hero {
  background:
    radial-gradient(circle at 88% 12%, rgba(125,211,252,.25), transparent 20%),
    radial-gradient(circle at 18% -6%, rgba(200,164,90,.20), transparent 28%),
    linear-gradient(135deg, #071a33 0%, #0b2d55 58%, #15345b 100%) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 18px !important;
  box-shadow: 0 14px 34px rgba(7,26,51,.14) !important;
  padding: 12px 16px !important;
  position: relative !important;
  overflow: hidden !important;
}
body.kcrm-frontend-body .kdash-hero:after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  opacity: .45;
  pointer-events: none;
}
body.kcrm-frontend-body .kdash-hero > * { position: relative; z-index: 1; }
body.kcrm-frontend-body .kdash-hero h1 {
  font-size: clamp(16px, 1.35vw, 22px) !important;
  letter-spacing: -.045em !important;
}
body.kcrm-frontend-body .kdash-hero p {
  color: rgba(226,232,240,.82) !important;
  max-width: 760px !important;
  font-size: 10.5px !important;
}
body.kcrm-frontend-body .kdash-tabs {
  background: rgba(255,255,255,.74) !important;
  border: 1px solid rgba(226,232,240,.86) !important;
  border-radius: 16px !important;
  padding: 6px !important;
  width: fit-content !important;
  box-shadow: 0 10px 26px rgba(15,23,42,.045) !important;
}
body.kcrm-frontend-body .kdash-tab {
  border-radius: 12px !important;
  border: 0 !important;
  background: transparent !important;
}
body.kcrm-frontend-body .kdash-tab.active {
  background: var(--kbos-navy-2) !important;
  color: #fff !important;
  box-shadow: 0 10px 20px rgba(11,31,58,.14) !important;
}
body.kcrm-frontend-body .kdash-grid { gap: 12px !important; }
body.kcrm-frontend-body .kdash-stat {
  border-top: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  padding: 15px 14px !important;
  min-height: 100px !important;
}
body.kcrm-frontend-body .kdash-stat:before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--c, #2563eb);
  border-radius: 18px 0 0 18px;
}
body.kcrm-frontend-body .kdash-stat:after {
  content: "";
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  right: -45px;
  top: -42px;
  background: color-mix(in srgb, var(--c, #2563eb) 13%, transparent);
  pointer-events: none;
}
body.kcrm-frontend-body .kdash-stat strong {
  font-size: clamp(22px, 2vw, 32px) !important;
  letter-spacing: -.045em !important;
}
body.kcrm-frontend-body .kdash-stat span {
  color: #64748b !important;
  font-size: 10px !important;
  letter-spacing: .06em !important;
}
body.kcrm-frontend-body .kdash-alert {
  border-radius: 16px !important;
  box-shadow: none !important;
}
body.kcrm-frontend-body .kdash-feed-item,
body.kcrm-frontend-body .kdash-empty {
  border-radius: 14px !important;
}

/* Tables */
body.kcrm-frontend-body .kcrm-table,
body.kcrm-frontend-body .kdash-table,
body.kcrm-frontend-body .ksales-table,
body.kcrm-frontend-body .ktc-table,
body.kcrm-frontend-body .kwmc-table,
body.kcrm-frontend-body .kce-table,
body.kcrm-frontend-body .kpw-table,
body.kcrm-frontend-body table.widefat,
body.kcrm-frontend-body table.form-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
body.kcrm-frontend-body .kcrm-table thead th,
body.kcrm-frontend-body .kdash-table th,
body.kcrm-frontend-body .ksales-table thead th,
body.kcrm-frontend-body .ktc-table thead th,
body.kcrm-frontend-body .kwmc-table thead th,
body.kcrm-frontend-body .kce-table thead th,
body.kcrm-frontend-body .kpw-table thead th,
body.kcrm-frontend-body table.widefat thead th {
  background: #f8fafc !important;
  color: #64748b !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: .075em !important;
  text-transform: uppercase !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
body.kcrm-frontend-body .kcrm-table tbody td,
body.kcrm-frontend-body .kdash-table td,
body.kcrm-frontend-body .ksales-table tbody td,
body.kcrm-frontend-body .ktc-table tbody td,
body.kcrm-frontend-body .kwmc-table tbody td,
body.kcrm-frontend-body .kce-table tbody td,
body.kcrm-frontend-body .kpw-table tbody td,
body.kcrm-frontend-body table.widefat tbody td {
  border-bottom: 1px solid rgba(226,232,240,.76) !important;
}
body.kcrm-frontend-body .kcrm-table tbody tr:hover,
body.kcrm-frontend-body .kdash-table tbody tr:hover,
body.kcrm-frontend-body .ksales-table tbody tr:hover,
body.kcrm-frontend-body .ktc-table tbody tr:hover,
body.kcrm-frontend-body .kwmc-table tbody tr:hover,
body.kcrm-frontend-body .kce-table tbody tr:hover,
body.kcrm-frontend-body .kpw-table tbody tr:hover,
body.kcrm-frontend-body table.widefat tbody tr:hover {
  background: #f8fbff !important;
}

/* Forms, inputs and selectors */
body.kcrm-frontend-body .kbos-module-content input[type="text"],
body.kcrm-frontend-body .kbos-module-content input[type="email"],
body.kcrm-frontend-body .kbos-module-content input[type="password"],
body.kcrm-frontend-body .kbos-module-content input[type="number"],
body.kcrm-frontend-body .kbos-module-content input[type="tel"],
body.kcrm-frontend-body .kbos-module-content input[type="url"],
body.kcrm-frontend-body .kbos-module-content input[type="date"],
body.kcrm-frontend-body .kbos-module-content input[type="time"],
body.kcrm-frontend-body .kbos-module-content select,
body.kcrm-frontend-body .kbos-module-content textarea,
body.kcrm-frontend-body .kcrm-card input[type="text"],
body.kcrm-frontend-body .kcrm-card input[type="email"],
body.kcrm-frontend-body .kcrm-card input[type="password"],
body.kcrm-frontend-body .kcrm-card input[type="number"],
body.kcrm-frontend-body .kcrm-card input[type="tel"],
body.kcrm-frontend-body .kcrm-card input[type="url"],
body.kcrm-frontend-body .kcrm-card input[type="date"],
body.kcrm-frontend-body .kcrm-card input[type="time"],
body.kcrm-frontend-body .kcrm-card select,
body.kcrm-frontend-body .kcrm-card textarea {
  border: 1px solid #dbe5ef !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: 0 1px 0 rgba(15,23,42,.02) !important;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease !important;
}
body.kcrm-frontend-body .kbos-module-content input:focus,
body.kcrm-frontend-body .kbos-module-content select:focus,
body.kcrm-frontend-body .kbos-module-content textarea:focus,
body.kcrm-frontend-body .kcrm-card input:focus,
body.kcrm-frontend-body .kcrm-card select:focus,
body.kcrm-frontend-body .kcrm-card textarea:focus {
  border-color: rgba(37,99,235,.70) !important;
  box-shadow: 0 0 0 4px rgba(37,99,235,.10) !important;
  outline: none !important;
}
body.kcrm-frontend-body .kcrm-field label,
body.kcrm-frontend-body .ksales-field label,
body.kcrm-frontend-body .ktc-field label,
body.kcrm-frontend-body .kwmc-field label,
body.kcrm-frontend-body .kce-field label,
body.kcrm-frontend-body .kpw-field label {
  color: #334155 !important;
  font-weight: 800 !important;
}

/* Buttons */
body.kcrm-frontend-body .kcrm-btn,
body.kcrm-frontend-body .kcrm-btn-add,
body.kcrm-frontend-body .kdash-btn,
body.kcrm-frontend-body .ksales-btn,
body.kcrm-frontend-body .ktc-btn,
body.kcrm-frontend-body .kwmc-btn,
body.kcrm-frontend-body .kce-btn,
body.kcrm-frontend-body .kpw-btn,
body.kcrm-frontend-body .kads-btn,
body.kcrm-frontend-body .kin-btn,
body.kcrm-frontend-body button.button-primary,
body.kcrm-frontend-body .button.button-primary {
  border-radius: 12px !important;
  font-weight: 850 !important;
  letter-spacing: -.005em !important;
  box-shadow: 0 10px 22px rgba(15,23,42,.08) !important;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, border-color .14s ease !important;
}
body.kcrm-frontend-body .kcrm-btn:hover,
body.kcrm-frontend-body .kcrm-btn-add:hover,
body.kcrm-frontend-body .kdash-btn:hover,
body.kcrm-frontend-body .ksales-btn:hover,
body.kcrm-frontend-body .ktc-btn:hover,
body.kcrm-frontend-body .kwmc-btn:hover,
body.kcrm-frontend-body .kce-btn:hover,
body.kcrm-frontend-body .kpw-btn:hover,
body.kcrm-frontend-body .kads-btn:hover,
body.kcrm-frontend-body .kin-btn:hover,
body.kcrm-frontend-body button.button-primary:hover,
body.kcrm-frontend-body .button.button-primary:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 14px 30px rgba(15,23,42,.12) !important;
}
body.kcrm-frontend-body .kcrm-btn.secondary,
body.kcrm-frontend-body .kcrm-btn-ghost,
body.kcrm-frontend-body .button:not(.button-primary) {
  border-radius: 12px !important;
}

/* Badges and status labels */
body.kcrm-frontend-body .kcrm-badge,
body.kcrm-frontend-body .kdash-pill,
body.kcrm-frontend-body .ksales-badge,
body.kcrm-frontend-body .ktc-badge,
body.kcrm-frontend-body .kwmc-badge,
body.kcrm-frontend-body .kce-badge,
body.kcrm-frontend-body .kpw-badge,
body.kcrm-frontend-body .status-badge {
  border-radius: 999px !important;
  font-weight: 900 !important;
  letter-spacing: .01em !important;
}
body.kcrm-frontend-body .kcrm-notice,
body.kcrm-frontend-body .notice,
body.kcrm-frontend-body .updated,
body.kcrm-frontend-body .error {
  border-radius: 14px !important;
}

/* Right dashboard widgets */
body.kcrm-frontend-body .kcrm-right-widgets .kcrm-widget {
  border-radius: 18px !important;
}
body.kcrm-frontend-body .kcrm-cal-cell.today {
  box-shadow: inset 0 0 0 2px rgba(37,99,235,.30) !important;
}

/* Mobile polish */
@media (max-width: 1024px) {
  body.kcrm-frontend-body .kcrm-app-sidebar {
    border-radius: 0 24px 24px 0 !important;
  }
  body.kcrm-frontend-body .kcrm-mobile-sidebar-backdrop.active {
    background: rgba(2,12,27,.46) !important;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }
}
@media (max-width: 782px) {
  body.kcrm-frontend-body .kcrm-page {
    padding: 14px !important;
  }
  body.kcrm-frontend-body .kbos-module-content {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  body.kcrm-frontend-body .kdash-hero {
    border-radius: 16px !important;
    padding: 12px 14px !important;
  }
  body.kcrm-frontend-body .kdash-tabs {
    width: 100% !important;
  }
  body.kcrm-frontend-body .kdash-tabs .kdash-tab {
    flex: 1 1 0 !important;
    text-align: center !important;
  }
  body.kcrm-frontend-body .kcrm-card,
  body.kcrm-frontend-body .kdash-card,
  body.kcrm-frontend-body .kdash-stat,
  body.kcrm-frontend-body .kcrm-widget,
  body.kcrm-frontend-body .ksales-card,
  body.kcrm-frontend-body .ktc-card,
  body.kcrm-frontend-body .kwmc-card,
  body.kcrm-frontend-body .kce-card,
  body.kcrm-frontend-body .kpw-card {
    border-radius: 16px !important;
  }
  body.kcrm-frontend-body .kcrm-mobile-bottom-nav {
    box-shadow: 0 -14px 32px rgba(15,23,42,.10) !important;
    border-top: 1px solid rgba(226,232,240,.88) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  body.kcrm-frontend-body .kcrm-mobile-bottom-nav a.active {
    color: #0b1f3a !important;
  }
}

/* Login page micro-polish only */
body.kcrm-login-body .kcrm-login-card,
body.kcrm-login-body .kcrm-reset-card,
body.kcrm-login-body .kcrm-forgot-card {
  filter: drop-shadow(0 18px 38px rgba(11,30,61,.08));
}
body.kcrm-login-body input:focus {
  box-shadow: 0 0 0 4px rgba(37,99,235,.11) !important;
}

/* Accessibility/focus */
body.kcrm-frontend-body a:focus-visible,
body.kcrm-frontend-body button:focus-visible,
body.kcrm-frontend-body input:focus-visible,
body.kcrm-frontend-body select:focus-visible,
body.kcrm-frontend-body textarea:focus-visible {
  outline: 3px solid rgba(37,99,235,.22) !important;
  outline-offset: 2px !important;
}

/* Keep AI inbox composer and chat bubbles stable. Only light polish, no sizing changes. */
body.kcrm-frontend-body .kaa-composer,
body.kcrm-frontend-body .kaa-chat-composer,
body.kcrm-frontend-body .kaa-message-input-wrap {
  border-color: rgba(226,232,240,.88) !important;
}
