/**
 * CRM & B2B Premium Enhancements
 * Loads after thiq-premium-overrides.css
 *
 * Enhancements:
 * - Refined shadows (base + hover states)
 * - Smooth transitions (0.3s ease)
 * - Enhanced hover effects (lift + module accent)
 * - Premium typography
 * - Improved interactive states
 */

/* ===== CARD ENHANCEMENTS ===== */

.card {
  box-shadow: 0 1px 3px rgba(13, 107, 104, 0.06);
  transition: all 0.3s ease;
}

.crm-toolbar-premium--dashboard {
  margin-bottom: 4px;
  padding: 6px;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92));
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.05);
}

#customersModuleRoot {
  --ops-accent: #2563eb;
  --ops-accent-soft: rgba(37, 99, 235, 0.12);
  --ops-accent-strong: #06b6d4;
  --ops-danger: #dc2626;
}

#b2bModuleRoot {
  --ops-accent: #8b5cf6;
  --ops-accent-soft: rgba(139, 92, 246, 0.14);
  --ops-accent-strong: #d946ef;
  --ops-danger: #dc2626;
}

.ops-dashboard-shell,
.ops-dashboard {
  display: grid;
  gap: 22px;
}

.ops-dashboard {
  padding: 4px 0 12px;
  animation: opsDashboardFade 0.2s ease-out both;
}

.ops-dashboard-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 2px 0;
}

.ops-dashboard-head h2 {
  margin: 6px 0 6px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.ops-dashboard-head p {
  margin: 0;
  max-width: 560px;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

.ops-eyebrow,
.ops-panel-kicker,
.ops-icon-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ops-eyebrow {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--ops-accent-soft);
  color: var(--ops-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ops-head-note {
  min-width: 180px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.96));
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
  display: grid;
  gap: 4px;
}

.ops-head-note strong {
  font-size: 26px;
  line-height: 1;
  color: #0f172a;
}

.ops-head-note small {
  color: #64748b;
  font-size: 12px;
}

.ops-icon,
.ops-icon-chip,
.ops-row-icon,
.ops-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ops-icon svg,
.ops-icon-chip svg,
.ops-row-icon svg,
.ops-action-icon svg {
  display: block;
}

.ops-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.ops-kpi-card,
.ops-panel-card {
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.95));
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.05);
  transition: transform 160ms ease, box-shadow 180ms ease, border-color 160ms ease;
}

.ops-kpi-card {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.ops-kpi-card:hover,
.ops-panel-card:hover,
.ops-action-btn:hover,
.ops-list-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 58px rgba(15, 23, 42, 0.08);
  border-color: color-mix(in srgb, var(--ops-accent) 18%, #e2e8f0);
}

.ops-kpi-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ops-icon-chip {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--ops-accent-soft);
  color: var(--ops-accent);
}

.ops-kpi-label {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ops-kpi-card strong {
  font-size: clamp(24px, 2vw, 30px);
  line-height: 1.05;
  color: #0f172a;
}

.ops-kpi-card small {
  color: #64748b;
  font-size: 12px;
}

.ops-split-grid {
  display: grid;
  gap: 18px;
}

.ops-split-grid--primary {
  grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.95fr);
}

.ops-split-grid--secondary {
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
}

.ops-panel-card {
  padding: 22px;
  display: grid;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.ops-panel-card:has(.ops-calendar-surface) {
  grid-column: 1 / -1;
}

.ops-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ops-panel-head h3 {
  margin: 8px 0 0;
  font-size: 22px;
  line-height: 1.1;
  color: #0f172a;
}

.ops-panel-kicker {
  color: var(--ops-accent);
  font-size: 12px;
  font-weight: 700;
}

.ops-panel-meta {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.ops-stage-grid,
.ops-agenda-groups,
.ops-health-grid,
.ops-conversion-grid {
  display: grid;
  gap: 12px;
}

.ops-stage-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ops-stage-card,
.ops-agenda-group,
.ops-conversion-card {
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.ops-stage-head,
.ops-agenda-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ops-stage-head strong,
.ops-agenda-head span,
.ops-conversion-card strong {
  font-size: 22px;
  line-height: 1;
  color: #0f172a;
}

.ops-stage-card p,
.ops-conversion-card span {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 12px;
}

.ops-stage-bar {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.ops-stage-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ops-accent), var(--ops-accent-strong));
}

.ops-stage-bar--wide {
  margin-top: 2px;
  height: 10px;
}

.ops-list,
.ops-timeline,
.ops-action-stack {
  display: grid;
  gap: 10px;
}

.ops-list-row,
.ops-timeline-row,
.ops-action-btn {
  width: 100%;
  min-height: 44px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.88);
  background: rgba(255, 255, 255, 0.94);
  padding: 14px 16px;
  color: inherit;
  text-align: left;
  transition: transform 160ms ease, box-shadow 180ms ease, border-color 160ms ease, background-color 160ms ease;
}

.ops-list-row,
.ops-action-btn {
  cursor: pointer;
}

.ops-list-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.ops-timeline-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.ops-action-btn {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.ops-row-icon,
.ops-action-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: var(--ops-accent-soft);
  color: var(--ops-accent);
}

.ops-row-copy,
.ops-action-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.ops-row-copy strong,
.ops-action-copy strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 750;
}

.ops-row-copy small,
.ops-action-copy small,
.ops-health-row span,
.ops-health-row b {
  color: #64748b;
  font-size: 12px;
}

.ops-health-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-health-column {
  padding: 16px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.88);
  display: grid;
  gap: 10px;
}

.ops-health-column > strong {
  font-size: 13px;
  color: #0f172a;
}

.ops-health-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ops-empty,
.ops-placeholder-panel {
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(203, 213, 225, 0.94);
  background: rgba(248, 250, 252, 0.9);
  color: #64748b;
  font-size: 13px;
}

.ops-dashboard-placeholder {
  display: grid;
}

.ops-kpi-card.is-loading {
  opacity: 0.86;
}

.ops-inline-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.ops-inline-head h3 {
  margin: 8px 0 4px;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.ops-inline-head p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  max-width: 560px;
}

.ops-calendar-surface {
  display: grid;
  gap: 12px;
  width: 100%;
  grid-column: 1 / -1;
}

.ops-calendar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.ops-calendar-window {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.ops-calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  pointer-events: all;
}

.ops-calendar-main-panel,
.ops-calendar-support-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.ops-calendar-main-panel {
  padding: 14px;
  min-height: 420px;
  width: 100%;
  overflow: hidden;
}

.ops-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-calendar-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.ops-calendar-legend-chip i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

.ops-calendar-support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
}

.ops-calendar-support-card {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.ops-calendar-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ops-calendar-day-view {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 6px;
}

.ops-calendar-time-label {
  font-size: 11px;
  color: #64748b;
  padding-top: 8px;
}

.ops-calendar-time-slot {
  min-height: 42px;
  border: 1px solid #e2ecfb;
  border-radius: 12px;
  background: #fff;
  padding: 6px 8px;
}

.ops-calendar-time-slot.is-active {
  background: #f8fbff;
  border-color: #cfe0ff;
}

.ops-calendar-week-view {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.ops-calendar-fifteen-view {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.ops-calendar-day-card {
  border: 1px solid #dce7fb;
  border-radius: 14px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 8px;
}

.ops-calendar-day-card--compact {
  min-height: 108px;
  align-content: start;
}

.ops-calendar-day-trigger {
  min-height: 38px;
  border: 1px solid #dce7fb;
  border-radius: 10px;
  background: #f8fbff;
  color: #163a63;
  font-weight: 700;
  padding: 6px 8px;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  pointer-events: all;
}

.ops-calendar-day-trigger:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--ops-accent) 30%, #dce7fb);
  box-shadow: 0 10px 18px rgba(29, 78, 216, 0.08);
}

.ops-calendar-day-trigger--month {
  min-height: 30px;
  justify-content: flex-start;
  padding: 4px 6px;
}

.ops-calendar-day-number {
  font-size: 12px;
  font-weight: 800;
}

.ops-calendar-month-head,
.ops-calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.ops-calendar-weekday {
  font-size: 11px;
  color: #64748b;
  text-align: center;
}

.ops-calendar-month-cell {
  border: 1px solid #dbe7fb;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  min-height: 92px;
  display: grid;
  gap: 6px;
  align-content: start;
}

.ops-calendar-month-cell.is-muted {
  background: #f9fbff;
  border-color: #edf2fb;
}

.ops-calendar-entry-stack {
  display: grid;
  gap: 5px;
}

.ops-calendar-mini-entry {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  border: 1px solid color-mix(in srgb, var(--ops-entry-tone, #2563eb) 22%, #dce7fb);
  border-radius: 10px;
  background: color-mix(in srgb, var(--ops-entry-tone, #2563eb) 8%, white);
  padding: 6px 8px;
  text-align: left;
  font-size: 11px;
  color: #163a63;
  cursor: pointer;
  box-shadow: inset 3px 0 0 var(--ops-entry-tone, #2563eb);
  pointer-events: all;
}

.ops-calendar-mini-entry.is-overdue {
  background: rgba(255, 247, 237, 0.98);
}

.ops-calendar-mini-entry-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.ops-calendar-mini-entry-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ops-calendar-mini-entry-copy strong {
  font-size: 11px;
  line-height: 1.2;
}

.ops-calendar-mini-entry-copy small {
  color: #64748b;
  font-size: 10px;
}

.ops-calendar-overflow-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 28px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 10px;
  color: #64748b;
  cursor: pointer;
}

.ops-calendar-empty {
  font-size: 11px;
  color: #94a3b8;
}

.ops-calendar-signal-strip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ops-calendar-signal-strip b {
  font-size: 11px;
  color: #1e3a5f;
}

.ops-calendar-month-cluster {
  border: 1px solid #dbe7fb;
  border-radius: 14px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.ops-calendar-month-cluster-title {
  font-weight: 700;
  font-size: 12px;
  color: #1b3d68;
}

.ops-calendar-multi-months {
  display: grid;
  gap: 10px;
}

.ops-calendar-cluster-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.ops-calendar-cluster-day {
  border: 1px solid #e2ebfb;
  background: #fff;
  border-radius: 8px;
  min-height: 34px;
  font-size: 10px;
  padding: 3px;
  display: grid;
  place-items: center;
  color: #163a63;
  cursor: pointer;
}

.ops-calendar-cluster-day.is-muted {
  background: #f9fbff;
  border-color: #f0f4fc;
}

.ops-calendar-cluster-dots {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.ops-calendar-timeline-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

#customersModuleRoot .finance-chip.active,
#b2bModuleRoot .finance-chip.active {
  background: linear-gradient(135deg, var(--ops-accent), var(--ops-accent-strong));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ops-accent) 20%, transparent);
}

.ops-calendar-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-badge-danger {
  background: rgba(220, 38, 38, 0.1);
  color: var(--ops-danger);
  border-color: rgba(220, 38, 38, 0.18);
}

.ops-calendar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 1.45fr);
  gap: 12px;
}

.ops-calendar-timeline,
.ops-calendar-board,
.ops-calendar-bucket {
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
}

.ops-calendar-timeline {
  max-height: 520px;
  overflow: auto;
  padding: 8px;
}

.ops-calendar-event {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 0;
  border-radius: 14px;
  background: transparent;
  padding: 8px;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.ops-calendar-event:hover {
  background: rgba(15, 23, 42, 0.04);
  transform: translateX(2px);
}

.ops-calendar-event.is-overdue {
  background: rgba(254, 242, 242, 0.92);
}

.ops-calendar-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 6px;
}

.ops-calendar-copy {
  display: grid;
  gap: 4px;
}

.ops-calendar-copy strong {
  color: #0f172a;
  font-size: 13px;
}

.ops-calendar-copy small {
  color: #64748b;
  font-size: 12px;
}

.crm-calendar-drawer {
  width: min(540px, 96vw);
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.crm-firms-drawer-head,
.crm-calendar-drawer-head {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  pointer-events: all;
}

.crm-firms-drawer-head > div:first-child {
  flex: 1;
  min-width: 0;
}

.crm-firms-drawer-head > div:last-child {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.crm-firms-drawer-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.crm-firms-drawer-head .muted {
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
}

.crm-firms-drawer-head .secondary-action,
.crm-calendar-drawer-head .secondary-action {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
}

.crm-firms-drawer-head .secondary-action:hover {
  border-color: color-mix(in srgb, var(--ops-accent) 30%, #e2e8f0);
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.crm-firms-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  pointer-events: all;
}

.ops-calendar-drawer-section {
  display: grid;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.88);
}

.ops-calendar-drawer-section:last-child {
  border-bottom: none;
  padding-bottom: 24px;
}

.ops-calendar-drawer-section > strong {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.ops-calendar-drawer-list {
  display: grid;
  gap: 8px;
}

.ops-calendar-drawer-item {
  width: 100%;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--ops-entry-tone, #2563eb) 16%, #e2e8f0);
  border-radius: 12px;
  background: color-mix(in srgb, var(--ops-entry-tone, #2563eb) 3%, white);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: all 160ms ease;
}

.ops-calendar-drawer-item:hover {
  border-color: color-mix(in srgb, var(--ops-entry-tone, #2563eb) 28%, #dce7fb);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--ops-entry-tone, #2563eb) 10%, transparent);
  transform: translateY(-1px);
}

.ops-calendar-drawer-item.is-overdue {
  background: rgba(255, 247, 237, 0.96);
  border-color: rgba(251, 146, 60, 0.2);
}

.ops-calendar-drawer-item.is-overdue:hover {
  border-color: rgba(251, 146, 60, 0.32);
  box-shadow: 0 6px 16px rgba(251, 146, 60, 0.08);
}

.ops-calendar-drawer-item-accent {
  background: var(--ops-entry-tone, #2563eb);
}

.ops-calendar-drawer-item-copy {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  min-width: 0;
}

.ops-calendar-drawer-item-copy strong {
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-word;
}

.ops-calendar-drawer-item-copy small {
  color: #64748b;
  font-size: 11px;
  font-weight: 500;
}

.ops-calendar-task-form {
  display: grid;
  gap: 14px;
  padding: 16px 24px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.96), rgba(255, 255, 255, 0.98));
  border-top: 1px solid rgba(226, 232, 240, 0.88);
}

.ops-calendar-task-form .form-grid {
  display: grid;
  gap: 12px;
}

.ops-calendar-task-form label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ops-calendar-task-form input,
.ops-calendar-task-form textarea,
.ops-calendar-task-form select {
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  padding: 8px 12px;
  font-size: 13px;
  transition: all 160ms ease;
}

.ops-calendar-task-form input:focus,
.ops-calendar-task-form textarea:focus,
.ops-calendar-task-form select:focus {
  border-color: color-mix(in srgb, var(--ops-accent) 40%, #e2e8f0);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ops-accent) 8%, transparent);
  outline: none;
}

.task-reminder-chip--custom {
  display: grid;
  grid-template-columns: auto minmax(90px, 110px) auto;
  align-items: center;
  gap: 8px;
}

.task-reminder-custom-input {
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 12px;
}

.task-reminder-custom-input:focus {
  border-color: color-mix(in srgb, var(--ops-accent) 40%, #e2e8f0);
}

.ops-calendar-drawer-empty {
  padding: 32px 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.ops-calendar-drawer-empty svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  opacity: 0.4;
}

.ops-calendar-boards {
  display: grid;
  gap: 12px;
}

.ops-calendar-board {
  padding: 14px;
}

.ops-calendar-buckets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.ops-calendar-buckets--wide {
  margin-top: 0;
}

.ops-calendar-bucket {
  padding: 12px;
}

.ops-agenda-group--overdue {
  border-color: rgba(220, 38, 38, 0.18);
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.92), rgba(255, 255, 255, 0.98));
}

.ops-agenda-group--today {
  border-color: color-mix(in srgb, var(--ops-accent) 18%, #e2e8f0);
}

.ops-action-btn {
  position: relative;
  overflow: hidden;
}

.ops-action-btn::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--ops-accent), var(--ops-accent-strong));
  opacity: 0;
  transition: opacity 160ms ease;
}

.ops-action-btn:hover::after {
  opacity: 1;
}

.ops-list-row:focus-visible,
.ops-action-btn:focus-visible,
.finance-chip:focus-visible {
  outline: 3px solid rgba(59, 130, 246, 0.18);
  outline-offset: 2px;
}

.crm-contact-detail-drawer {
  width: min(680px, 96vw);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(242, 247, 255, 0.96));
}

.crm-contact-drawer-shell {
  display: grid;
  gap: 16px;
}

.crm-contact-drawer-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.crm-contact-drawer-topbar-copy {
  display: grid;
  gap: 4px;
}

.crm-contact-drawer-topbar-copy p {
  margin: 0;
}

.crm-contact-drawer-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(191, 219, 254, 0.92);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.crm-contact-drawer-avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1d4ed8, #06b6d4);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.2);
}

.crm-contact-drawer-hero-copy {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.crm-contact-drawer-hero-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-contact-drawer-hero-line strong {
  font-size: 18px;
  color: #0f172a;
}

.crm-contact-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--crm-status-bg, rgba(148, 163, 184, 0.16));
  color: var(--crm-status-tone, #475569);
  font-size: 12px;
  font-weight: 700;
}

.crm-contact-drawer-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #475569;
  font-size: 13px;
}

.crm-contact-drawer-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.crm-contact-drawer-quick-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-contact-drawer-quick-actions .ops-action-btn {
  min-height: 38px;
  border: 1px solid rgba(191, 219, 254, 0.92);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  padding: 0 12px;
  color: #1e3a5f;
  font-weight: 700;
}

.crm-contact-drawer-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  width: fit-content;
}

.crm-contact-drawer-tab {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #475569;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.crm-contact-drawer-tab:hover:not(:disabled) {
  transform: translateY(-1px);
}

.crm-contact-drawer-tab.is-active {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
}

.crm-contact-drawer-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.crm-contact-drawer-body,
.crm-contact-drawer-pane {
  display: grid;
  gap: 12px;
}

.crm-contact-drawer-block {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
}

.crm-contact-drawer-block--composer {
  border-color: rgba(191, 219, 254, 0.96);
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.98), rgba(255, 255, 255, 0.98));
}

.crm-contact-drawer-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crm-contact-drawer-block-head h4 {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
}

.crm-contact-drawer-block-head span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.crm-contact-drawer-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.crm-contact-drawer-kv-grid div {
  display: grid;
  gap: 5px;
}

.crm-contact-drawer-kv-grid span {
  color: #64748b;
  font-size: 12px;
}

.crm-contact-drawer-kv-grid strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
}

.crm-contact-drawer-note {
  margin: 0;
  color: #334155;
  line-height: 1.6;
}

.crm-contact-drawer-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.crm-contact-drawer-summary div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(219, 234, 254, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
}

.crm-contact-drawer-summary span {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
}

.crm-contact-drawer-summary strong {
  color: #0f172a;
  font-size: 18px;
}

.crm-contact-drawer-list {
  display: grid;
  gap: 8px;
}

.crm-contact-drawer-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 10px;
  padding: 0;
  border: 1px solid rgba(226, 232, 240, 0.94);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
}

.crm-contact-drawer-list-item--static {
  cursor: default;
}

.crm-contact-drawer-list-accent {
  background: var(--crm-drawer-tone, #2563eb);
}

.crm-contact-drawer-list-copy {
  display: grid;
  gap: 3px;
  padding: 11px 12px 11px 2px;
}

.crm-contact-drawer-list-copy strong {
  font-size: 13px;
  color: #0f172a;
}

.crm-contact-drawer-list-copy small {
  font-size: 11px;
  color: #64748b;
}

.crm-contact-drawer-empty {
  padding: 12px;
  border: 1px dashed rgba(203, 213, 225, 0.96);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.96);
  color: #64748b;
  font-size: 13px;
}

.crm-contact-drawer-form .form-grid,
.crm-contact-task-form .form-grid {
  gap: 12px;
}

@media (max-width: 720px) {
  .crm-contact-drawer-hero {
    grid-template-columns: 1fr;
  }

  .crm-contact-drawer-kv-grid,
  .crm-contact-drawer-summary {
    grid-template-columns: 1fr;
  }
}

.ops-kpi-grid > * {
  animation: opsCardStagger 220ms ease-out both;
}

.ops-kpi-grid > *:nth-child(2) { animation-delay: 30ms; }
.ops-kpi-grid > *:nth-child(3) { animation-delay: 60ms; }
.ops-kpi-grid > *:nth-child(4) { animation-delay: 90ms; }
.ops-kpi-grid > *:nth-child(5) { animation-delay: 120ms; }

@keyframes opsDashboardFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes opsCardStagger {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .ops-kpi-grid,
  .ops-stage-grid,
  .ops-health-grid,
  .ops-conversion-grid,
  .ops-calendar-grid,
  .ops-calendar-support-grid,
  .ops-calendar-buckets,
  .ops-split-grid--primary,
  .ops-split-grid--secondary {
    grid-template-columns: 1fr;
  }

  .ops-calendar-week-view,
  .ops-calendar-fifteen-view {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .ops-dashboard-head,
  .ops-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .ops-head-note {
    width: 100%;
  }

  .ops-calendar-day-view {
    grid-template-columns: 1fr;
  }

  .ops-calendar-week-view,
  .ops-calendar-fifteen-view,
  .ops-calendar-month-head,
  .ops-calendar-month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card:hover {
  box-shadow: 0 4px 12px rgba(13, 107, 104, 0.12);
}

/* Stat cards with lift effect */
.stat-card {
  box-shadow: 0 1px 3px rgba(13, 107, 104, 0.06);
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(13, 107, 104, 0.12);
  transform: translateY(-2px);
}

.stat-value {
  color: var(--primary);
  transition: color 0.3s ease;
}

/* ===== TABLE ENHANCEMENTS ===== */

table {
  transition: box-shadow 0.3s ease;
}

tbody tr {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

tbody tr:hover {
  background: rgba(13, 107, 104, 0.03);
  border-color: rgba(13, 107, 104, 0.1);
}

.crm-row {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.crm-row:hover {
  background: rgba(13, 107, 104, 0.03);
}

.crm-row.active {
  background: rgba(13, 107, 104, 0.08);
  border-left: 3px solid var(--primary);
}

/* ===== BADGE & STATUS ENHANCEMENTS ===== */

.badge,
.status-badge,
.company-badge,
.primary-badge {
  transition: all 0.2s ease;
}

.badge:hover,
.status-badge:hover,
.company-badge:hover {
  box-shadow: 0 2px 8px rgba(13, 107, 104, 0.15);
}

.status-badge {
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge.status-active,
.badge-active {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.status-badge.status-pending,
.badge-pending {
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
  border: 1px solid rgba(234, 88, 12, 0.2);
}

.status-badge.status-completed {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.company-badge {
  background: rgba(13, 107, 104, 0.08);
  color: var(--primary);
  border: 1px solid rgba(13, 107, 104, 0.2);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
}

.primary-badge {
  background: rgba(13, 107, 104, 0.12);
  color: var(--primary);
  border: 1px solid rgba(13, 107, 104, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ===== BUTTON ENHANCEMENTS ===== */

.finance-toolbar-btn,
.primary-btn,
.tab-btn,
.finance-chip {
  transition: all 0.2s ease;
}

.finance-toolbar-btn:hover,
.primary-btn:hover {
  box-shadow: 0 6px 16px rgba(13, 107, 104, 0.15);
  transform: translateY(-1px);
}

.finance-toolbar-btn.primary {
  background: linear-gradient(135deg, #0a5553, #0d6b68);
  box-shadow: 0 4px 12px rgba(13, 107, 104, 0.18);
}

.finance-toolbar-btn.primary:hover {
  box-shadow: 0 8px 20px rgba(13, 107, 104, 0.22);
}

.finance-toolbar-btn.soft {
  background: rgba(13, 107, 104, 0.06);
  color: var(--primary);
  border-color: rgba(13, 107, 104, 0.1);
}

.finance-toolbar-btn.soft:hover {
  background: rgba(13, 107, 104, 0.12);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(13, 107, 104, 0.1);
}

#customersModuleRoot .finance-toolbar-btn.primary,
#customersModuleRoot .primary-btn {
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24);
}

#customersModuleRoot .finance-toolbar-btn.primary:hover,
#customersModuleRoot .primary-btn:hover {
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

#customersModuleRoot .finance-toolbar-btn.soft {
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-color: rgba(37, 99, 235, 0.14);
}

#customersModuleRoot .finance-toolbar-btn.soft:hover {
  background: rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.24);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

#b2bModuleRoot .finance-toolbar-btn.primary,
#b2bModuleRoot .primary-btn {
  background: linear-gradient(135deg, #7c3aed, #c026d3);
  box-shadow: 0 8px 18px rgba(139, 92, 246, 0.24);
}

#b2bModuleRoot .finance-toolbar-btn.primary:hover,
#b2bModuleRoot .primary-btn:hover {
  box-shadow: 0 14px 28px rgba(139, 92, 246, 0.28);
}

#b2bModuleRoot .finance-toolbar-btn.soft {
  background: rgba(139, 92, 246, 0.08);
  color: #7c3aed;
  border-color: rgba(139, 92, 246, 0.14);
}

#b2bModuleRoot .finance-toolbar-btn.soft:hover {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(139, 92, 246, 0.24);
  box-shadow: 0 8px 18px rgba(139, 92, 246, 0.12);
}

.finance-toolbar-btn.danger {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.2);
}

.finance-toolbar-btn.danger:hover {
  background: rgba(220, 38, 38, 0.15);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
}

.tab-btn {
  position: relative;
}

.tab-btn.active {
  color: var(--primary);
  background: rgba(13, 107, 104, 0.05);
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.finance-chip {
  border-radius: 6px;
}

.finance-chip.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(13, 107, 104, 0.1);
}

/* ===== DETAIL VIEW ENHANCEMENTS ===== */

.crm-detail-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(13, 107, 104, 0.05);
  transition: box-shadow 0.3s ease;
}

.crm-detail-avatar {
  background: var(--primary-soft);
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: 0 2px 8px rgba(13, 107, 104, 0.1);
}

.crm-detail-title {
  color: var(--text-title);
  font-weight: 800;
}

/* ===== PANEL & MODAL ENHANCEMENTS ===== */

.finance-provider-layout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(13, 107, 104, 0.05);
  transition: box-shadow 0.3s ease;
}

.finance-report-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(13, 107, 104, 0.05);
}

/* ===== FORM INPUTS ===== */

.module-input,
.module-select,
.module-textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.module-input:focus,
.module-select:focus,
.module-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 107, 104, 0.08), inset 0 1px 2px rgba(13, 107, 104, 0.05);
}

/* ===== SECTION GRID ===== */

.section-grid,
.section-grid-5 {
  gap: 16px;
}

.section-grid > button,
.section-grid-5 > button {
  transition: all 0.3s ease;
}

.section-grid > button:hover,
.section-grid-5 > button:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

/* ===== TIMELINE & ACTIVITY ===== */

.crm-rail-summary-row {
  padding: 10px 0;
  border-bottom: 1px solid rgba(13, 107, 104, 0.05);
  transition: background-color 0.2s ease;
}

.crm-rail-summary-row:hover {
  background: rgba(13, 107, 104, 0.02);
}

.crm-rail-dt {
  font-weight: 600;
  color: var(--text-title);
}

.crm-rail-dd {
  color: var(--text-muted);
}

/* ===== IMPORT & SPECIAL SECTIONS ===== */

.crm-import-shell {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.crm-import-shell:hover {
  border-color: var(--primary);
  background: rgba(13, 107, 104, 0.02);
}

.module-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* ===== DRAWER BACKDROP & OVERLAY ===== */

.crm-firms-drawer-backdrop,
.crm-calendar-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  animation: fadeInBackdrop 180ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: all;
}

.crm-firms-drawer,
.crm-calendar-drawer {
  position: relative;
  z-index: 100;
  width: clamp(420px, 90vw, 680px);
  max-height: 100vh;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: -12px 0 48px rgba(0, 0, 0, 0.18);
  border-radius: 24px 0 0 24px;
  animation: slideInDrawer 260ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: all;
  display: flex;
  flex-direction: column;
}

.crm-firms-drawer-head,
.crm-calendar-drawer-head {
  flex-shrink: 0;
  pointer-events: all;
}

.crm-firms-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  pointer-events: all;
}

.crm-firms-block {
  padding: 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.crm-firms-block:last-child {
  border-bottom: none;
}

.crm-firms-block h4 {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.form-sections {
  display: grid;
  gap: 0;
}

.form-section {
  padding: 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.form-section:last-child {
  border-bottom: none;
}

.form-section-title {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ops-accent, #8b5cf6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crm-firms-block--span {
  grid-column: 1 / -1;
}

@keyframes fadeInBackdrop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInDrawer {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== MOTION & ANIMATIONS ===== */

@media (prefers-reduced-motion: no-preference) {
  .card,
  .stat-card,
  .finance-toolbar-btn,
  .tab-btn,
  .finance-chip,
  table tbody tr,
  .crm-row {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* ===== FOCUS STATES ===== */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.finance-toolbar-btn:focus-visible,
.tab-btn:focus-visible,
.finance-chip:focus-visible {
  box-shadow: 0 0 0 3px rgba(13, 107, 104, 0.25);
}

/* ===== ACCESSIBILITY ===== */

@media (prefers-contrast: more) {
  .card {
    border-width: 2px;
  }

  .badge,
  .status-badge {
    font-weight: 700;
    border-width: 2px;
  }
}

/* ===== RESPONSIVE ENHANCEMENTS ===== */

/* Desktop/Large Screens (1200px+) */
.page-body,
.module-stack,
.finance-provider-layout,
.finance-report-shell {
  width: 100%;
  padding: 0;
}

/* Tablet (768px - 1200px) */
@media (max-width: 1200px) {
  .stat-card:hover {
    transform: translateY(-1px);
  }

  .finance-toolbar-btn:hover {
    transform: none;
  }

  .finance-provider-layout {
    gap: 16px;
  }

  .section-grid-5 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

/* Mobile (480px - 768px) */
@media (max-width: 768px) {
  .stat-card {
    min-height: 100px;
    padding: 16px;
  }

  .stat-card:hover {
    transform: translateY(-1px);
  }

  .stat-label {
    font-size: 11px;
  }

  .stat-value {
    font-size: 24px;
  }

  .finance-toolbar-btn {
    padding: 10px 12px;
    font-size: 12px;
  }

  .finance-toolbar-btn:hover {
    transform: none;
  }

  .tab-btn {
    padding: 12px 16px;
    font-size: 12px;
  }

  .card {
    padding: 16px;
  }

  .section-grid-5 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .finance-chip-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .crm-detail-workspace {
    padding: 0;
  }

  .crm-detail-header {
    border-radius: 8px 8px 0 0;
    padding: 16px;
  }

  .crm-detail-body {
    padding: 16px;
  }

  table {
    font-size: 12px;
  }

  th, td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .badge,
  .status-badge {
    padding: 3px 8px;
    font-size: 10px;
  }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
  .stat-card {
    min-height: 90px;
    padding: 14px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-label {
    font-size: 10px;
  }

  .finance-toolbar-btn {
    padding: 8px 10px;
    font-size: 11px;
  }

  .tab-btn {
    padding: 10px 12px;
    font-size: 11px;
  }

  .card {
    padding: 14px;
  }

  .section-grid-5 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .crm-detail-header {
    padding: 14px;
  }

  .crm-detail-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .crm-detail-title {
    font-size: 18px;
  }

  .crm-detail-lede {
    font-size: 12px;
  }

  .crm-detail-body {
    padding: 14px;
  }

  table {
    font-size: 11px;
  }

  th, td {
    padding: 8px 6px;
    font-size: 11px;
  }

  th {
    font-size: 10px;
  }

  .badge,
  .status-badge {
    padding: 2px 6px;
    font-size: 9px;
  }

  .demo-header {
    padding: 14px;
    margin-bottom: 20px;
  }

  .demo-header h1 {
    font-size: 18px;
  }

  .demo-header p {
    font-size: 11px;
  }

  .customer-card {
    padding: 14px;
  }

  .customer-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .customer-name {
    font-size: 14px;
  }

  .customer-email {
    font-size: 11px;
  }

  .customer-stat-value {
    font-size: 14px;
  }
}

/* ===== B2B Bayi / hesap listesi + drawer (Phase 2) ===== */

#b2bModuleRoot .b2b-accounts-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

#b2bModuleRoot .b2b-accounts-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

#b2bModuleRoot .b2b-accounts-toolbar__search {
  flex: 1 1 220px;
  min-width: min(100%, 220px);
}

#b2bModuleRoot .b2b-accounts-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}

#b2bModuleRoot .b2b-account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

#b2bModuleRoot .b2b-account-card {
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  padding: 14px 14px 12px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}

#b2bModuleRoot .b2b-account-card:hover {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 14px 32px rgba(139, 92, 246, 0.1);
  transform: translateY(-1px);
}

#b2bModuleRoot .b2b-account-card.is-active {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.14);
}

#b2bModuleRoot .b2b-account-card__top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

#b2bModuleRoot .b2b-account-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #5b21b6;
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.18), rgba(217, 70, 239, 0.12));
  flex-shrink: 0;
}

#b2bModuleRoot .b2b-account-card__titles {
  flex: 1;
  min-width: 0;
}

#b2bModuleRoot .b2b-account-card__name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

#b2bModuleRoot .b2b-account-card__sub {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.35;
}

#b2bModuleRoot .b2b-account-card__badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  flex-shrink: 0;
}

#b2bModuleRoot .b2b-account-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 0 0 10px;
  font-size: 12px;
}

#b2bModuleRoot .b2b-account-card__meta dt {
  margin: 0;
  color: #64748b;
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#b2bModuleRoot .b2b-account-card__meta dd {
  margin: 0;
  color: #0f172a;
  font-weight: 600;
}

#b2bModuleRoot .b2b-account-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.85);
}

#b2bModuleRoot .b2b-risk-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

#b2bModuleRoot .b2b-risk-pill.is-low {
  background: rgba(34, 197, 94, 0.15);
  color: #166534;
}

#b2bModuleRoot .b2b-risk-pill.is-med {
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
}

#b2bModuleRoot .b2b-risk-pill.is-high {
  background: rgba(248, 113, 113, 0.2);
  color: #b91c1c;
}

#b2bModuleRoot .b2b-account-drawer {
  max-width: min(100vw - 24px, 520px);
}

#b2bModuleRoot .b2b-account-drawer__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 4px 12px;
}

#b2bModuleRoot .b2b-drawer-section {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

#b2bModuleRoot .b2b-drawer-section:last-child {
  border-bottom: none;
}

#b2bModuleRoot .b2b-drawer-section__title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

#b2bModuleRoot .b2b-drawer-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

#b2bModuleRoot .b2b-drawer-mini-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.85);
  font-size: 13px;
}

#b2bModuleRoot .b2b-risk-health {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

#b2bModuleRoot .b2b-account-drawer-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#b2bModuleRoot .crm-firms-drawer.b2b-account-drawer {
  display: flex;
  flex-direction: column;
  max-height: min(92vh, 900px);
}
