/* ==========================================================================
   ONE5 CRM NEXT v3 — CALM ENTERPRISE DESIGN SYSTEM
   90-8-2 Color Discipline · Hairline Surfaces · Tabular Typography
   ========================================================================== */

:root {
  --bg-app: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-hover: #F8FAFC;

  --border-hairline: #E2E8F0;
  --border-strong: #CBD5E1;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --accent-primary: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-soft: #EFF6FF;
  --accent-border: #BFDBFE;

  --success-text: #047857;
  --success-bg: #ECFDF5;
  --success-dot: #10B981;

  --warning-text: #B45309;
  --warning-bg: #FFFBEB;
  --warning-dot: #F59E0B;

  --danger-text: #B91C1C;
  --danger-bg: #FEF2F2;
  --danger-dot: #EF4444;

  --info-text: #0369A1;
  --info-bg: #F0F9FF;
  --info-dot: #0EA5E9;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;

  --sidebar-w: 236px;
  --sidebar-w-collapsed: 64px;
  --topbar-h: 52px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   CUSTOM SUBTLE SCROLLBARS
   ========================================================================== */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

/* ==========================================================================
   COLLAPSIBLE ACCORDION SIDEBAR SHELL (6-Pillar Enterprise Nav)
   ========================================================================== */

.app-sidebar {
  width: var(--sidebar-w);
  transition: width 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.app-sidebar.collapsed,
.app-sidebar.sidebar-collapsed {
  width: var(--sidebar-w-collapsed);
}

.app-sidebar.collapsed .sidebar-label,
.app-sidebar.sidebar-collapsed .sidebar-label,
.app-sidebar.collapsed .nav-group-label,
.app-sidebar.sidebar-collapsed .nav-group-label,
.app-sidebar.collapsed .nav-badge-full,
.app-sidebar.sidebar-collapsed .nav-badge-full,
.app-sidebar.collapsed .nav-chevron,
.app-sidebar.sidebar-collapsed .nav-chevron,
.app-sidebar.collapsed .nav-sublist,
.app-sidebar.sidebar-collapsed .nav-sublist,
.app-sidebar.collapsed .sidebar-user-meta,
.app-sidebar.sidebar-collapsed .sidebar-user-meta {
  display: none;
}

.app-sidebar.collapsed .nav-item,
.app-sidebar.sidebar-collapsed .nav-item,
.app-sidebar.collapsed .nav-parent,
.app-sidebar.sidebar-collapsed .nav-parent {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.app-sidebar.collapsed .nav-badge-dot,
.app-sidebar.sidebar-collapsed .nav-badge-dot {
  display: block;
}

/* Mobile (<768px) Drawer Controls (U1-M10) */
.mobile-menu-btn {
  display: none;
}

.mobile-sidebar-backdrop {
  display: none;
}

@media (max-width: 768px) {
  #app-sidebar,
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px !important;
    max-width: 82vw;
    transform: translateX(-100%);
    transition: transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 60;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
  }

  #app-sidebar.mobile-open,
  .app-sidebar.mobile-open {
    transform: translateX(0);
  }

  #app-sidebar.collapsed .sidebar-label,
  #app-sidebar.sidebar-collapsed .sidebar-label,
  #app-sidebar.collapsed .nav-group-label,
  #app-sidebar.sidebar-collapsed .nav-group-label,
  #app-sidebar.collapsed .nav-badge-full,
  #app-sidebar.sidebar-collapsed .nav-badge-full,
  #app-sidebar.collapsed .nav-chevron,
  #app-sidebar.sidebar-collapsed .nav-chevron,
  #app-sidebar.collapsed .nav-sublist,
  #app-sidebar.sidebar-collapsed .nav-sublist,
  #app-sidebar.collapsed .sidebar-user-meta,
  #app-sidebar.sidebar-collapsed .sidebar-user-meta {
    display: initial;
  }

  #app-sidebar.collapsed .nav-sublist,
  #app-sidebar.sidebar-collapsed .nav-sublist {
    display: flex;
  }

  #app-sidebar.collapsed .nav-item,
  #app-sidebar.sidebar-collapsed .nav-item,
  #app-sidebar.collapsed .nav-parent,
  #app-sidebar.sidebar-collapsed .nav-parent {
    justify-content: flex-start;
    padding-left: 10px;
    padding-right: 10px;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .mobile-sidebar-backdrop.mobile-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    z-index: 55;
    backdrop-filter: blur(1px);
  }

  #app-main {
    width: 100%;
    max-width: 100vw;
  }

  /* FIX-48 (C2-M06): Compact 375px mobile topbar — secondary controls tucked into "…" menu */
  header {
    padding-left: 10px !important;
    padding-right: 10px !important;
    max-width: 100vw;
    gap: 8px !important;
  }

  .topbar-desktop-secondary {
    display: none !important;
  }

  .topbar-mobile-more-wrap {
    display: inline-flex !important;
  }

  #topbar-notif-popover {
    width: min(350px, calc(100vw - 16px)) !important;
    right: -38px !important;
  }

  #app-modal > div,
  .o5-modal-card,
  [role="dialog"] {
    max-width: 96vw !important;
  }
}

.topbar-mobile-more-wrap {
  display: none;
  align-items: center;
}

.topbar-mobile-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 232px;
  max-width: calc(100vw - 16px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  z-index: 65;
  overflow: hidden;
  padding: 4px 0;
}

.topbar-mobile-more-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: #1e293b;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.topbar-mobile-more-item:hover {
  background: #f8fafc;
}

.nav-group-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #94A3B8;
  padding: 0 10px 6px;
}

.nav-accordion {
  display: flex;
  flex-direction: column;
}

.nav-item,
.nav-parent {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
  text-align: left;
}

.nav-item:hover,
.nav-parent:hover {
  background-color: #F8FAFC;
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--accent-soft);
  color: var(--accent-primary);
  border-color: #DBEAFE;
  font-weight: 600;
}

.nav-item.active svg {
  color: var(--accent-primary);
}

.nav-parent.active-parent {
  color: var(--text-primary);
  background-color: #F8FAFC;
  font-weight: 600;
}

.nav-parent.active-parent svg.nav-parent-icon {
  color: var(--accent-primary);
}

.app-sidebar.collapsed .nav-parent.active-parent,
.app-sidebar.sidebar-collapsed .nav-parent.active-parent {
  background-color: var(--accent-soft);
  border-color: #DBEAFE;
  color: var(--accent-primary);
}

.nav-chevron {
  width: 14px;
  height: 14px;
  color: #94A3B8;
  flex-shrink: 0;
  transition: transform 160ms ease, color 140ms ease;
  transform: rotate(-90deg);
}

.nav-accordion.expanded .nav-chevron {
  transform: rotate(0deg);
  color: #64748B;
}

.nav-sublist {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-left: 17px;
  margin-top: 2px;
  margin-bottom: 4px;
  padding-left: 10px;
  border-left: 1.5px solid #E2E8F0;
}

.nav-subitem {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12.25px;
  font-weight: 450;
  color: #475569;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
  text-align: left;
}

.nav-subitem:hover {
  background-color: #F1F5F9;
  color: #0F172A;
}

.nav-subitem.active {
  background-color: var(--accent-soft);
  color: var(--accent-primary);
  font-weight: 600;
}

.nav-subitem.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 5px;
  bottom: 5px;
  width: 2.5px;
  border-radius: 999px;
  background-color: var(--accent-primary);
}

.nav-sub-badge {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  background-color: #F1F5F9;
  color: #475569;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.nav-subitem.active .nav-sub-badge {
  background-color: #DBEAFE;
  color: #1D4ED8;
}

.nav-sub-badge.badge-alert {
  background-color: #FEF2F2;
  color: #DC2626;
}

.nav-sub-badge.badge-warn {
  background-color: #FFFBEB;
  color: #D97706;
}

.nav-badge-full {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  padding: 2.5px 6px;
  border-radius: 999px;
  background-color: #F1F5F9;
  color: #475569;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.nav-item.active .nav-badge-full {
  background-color: #DBEAFE;
  color: #1D4ED8;
}

.nav-badge-full.badge-alert {
  background-color: #FEF2F2;
  color: #DC2626;
}

.nav-badge-full.badge-warn {
  background-color: #FFFBEB;
  color: #D97706;
}

.nav-badge-dot {
  display: none;
  position: absolute;
  top: 6px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background-color: var(--accent-primary);
  border: 1.5px solid #FFFFFF;
}

.nav-badge-dot.badge-alert {
  background-color: #EF4444;
}

.nav-badge-dot.badge-warn {
  background-color: #F59E0B;
}

/* ==========================================================================
   SURFACE CARDS, BUTTONS & KBD
   ========================================================================== */

.surface-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
}

.surface-card-interactive {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.surface-card-interactive:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: var(--accent-primary);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-primary);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: #FFFFFF;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.btn-secondary:hover {
  background-color: #F8FAFC;
  border-color: var(--border-strong);
}

.kbd-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 5px;
  font-family: 'Inter', monospace;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  color: #64748B;
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   STATUS PILLS (Subtle Pastel + 6px Dot, Zero Rainbow Clutter)
   ========================================================================== */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  flex-shrink: 0;
}

.status-pill-neutral {
  background-color: #F1F5F9;
  color: #475569;
  border-color: #E2E8F0;
}

.status-pill-blue {
  background-color: #EFF6FF;
  color: #1D4ED8;
  border-color: #DBEAFE;
}

.status-pill-green {
  background-color: var(--success-bg);
  color: var(--success-text);
  border-color: #D1FAE5;
}

.status-pill-amber {
  background-color: var(--warning-bg);
  color: var(--warning-text);
  border-color: #FEF3C7;
}

.status-pill-red {
  background-color: var(--danger-bg);
  color: var(--danger-text);
  border-color: #FEE2E2;
}

.status-pill-purple {
  background-color: #F5F3FF;
  color: #6D28D9;
  border-color: #EDE9FE;
}

/* ==========================================================================
   SEGMENTED CONTROL
   ========================================================================== */

.segmented-control {
  display: inline-flex;
  align-items: center;
  background-color: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.segmented-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
  white-space: nowrap;
}

.segmented-btn:hover {
  color: #0F172A;
}

.segmented-btn.active {
  background-color: #FFFFFF;
  color: #0F172A;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

/* ==========================================================================
   LEAD ROWS & CONVERSATION LIST ITEMS
   ========================================================================== */

.lead-row {
  position: relative;
  display: block;
  width: 100%;
  padding: 11px 13px;
  border-bottom: 1px solid #F1F5F9;
  background-color: #FFFFFF;
  cursor: pointer;
  transition: background-color 120ms ease;
  text-align: left;
}

.lead-row:hover {
  background-color: #F8FAFC;
}

.lead-row.active {
  background-color: #EFF6FF;
}

.lead-row.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background-color: var(--accent-primary);
}

/* ==========================================================================
   PANCAKE PRO CHAT BUBBLES
   ========================================================================== */

.chat-bubble-customer {
  max-width: 78%;
  background-color: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  border-radius: 12px 12px 12px 4px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.48;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.02);
}

.chat-bubble-agent {
  max-width: 78%;
  background-color: #2563EB;
  color: #FFFFFF;
  border: 1px solid #1D4ED8;
  border-radius: 12px 12px 4px 12px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.48;
}

.chat-bubble-bot {
  max-width: 78%;
  background-color: #F8FAFC;
  color: #1E293B;
  border: 1px solid #CBD5E1;
  border-radius: 12px 12px 4px 12px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.48;
}

.chat-bubble-internal {
  max-width: 82%;
  background-color: #FFFBEB;
  color: #92400E;
  border: 1px dashed #FCD34D;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.45;
}

.chat-bubble-system {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #F1F5F9;
  color: #64748B;
  border: 1px solid #E2E8F0;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11.5px;
  line-height: 1.3;
}

/* ==========================================================================
   KANBAN COLUMNS & CARDS
   ========================================================================== */

.kanban-col {
  display: flex;
  flex-direction: column;
  min-width: 264px;
  max-width: 300px;
  flex: 1 0 264px;
  background-color: #F8FAFC;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.kanban-col-header {
  padding: 10px 12px;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background-color: #FFFFFF;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 10px 11px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
  cursor: pointer;
}

.kanban-card:hover {
  border-color: #93C5FD;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

/* ==========================================================================
   BOTCAKE VISUAL FLOW NODES
   ========================================================================== */

.flow-canvas-bg {
  background-color: #F8FAFC;
  background-image: radial-gradient(#CBD5E1 1px, transparent 1px);
  background-size: 18px 18px;
}

.flow-node {
  position: relative;
  background-color: #FFFFFF;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.flow-node:hover {
  border-color: #93C5FD;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}

.flow-node.active {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.flow-connector {
  width: 2px;
  height: 22px;
  background-color: #CBD5E1;
  margin: 0 auto;
  position: relative;
}

.flow-connector::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: -3px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #94A3B8;
}

/* ==========================================================================
   ENTERPRISE DATA TABLES
   ========================================================================== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #F8FAFC;
  color: #475569;
  font-weight: 600;
  font-size: 11.5px;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-hairline);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid #F1F5F9;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background-color: #F8FAFC;
}

/* ==========================================================================
   COMMAND PALETTE, DRAWER, MODAL & TOAST ANIMATIONS
   ========================================================================== */

.cmd-overlay,
.drawer-overlay,
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.cmd-overlay.hidden,
.drawer-overlay.hidden,
.modal-overlay.hidden {
  display: none;
}

.cmd-backdrop,
.drawer-backdrop,
.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(2px);
  animation: fadeIn 140ms ease-out;
}

.cmd-panel {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 32px));
  margin: 10vh auto 0;
  background-color: #FFFFFF;
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  animation: scaleIn 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cmd-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 100ms ease;
}

.cmd-item:hover,
.cmd-item.selected {
  background-color: #EFF6FF;
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(520px, 100vw);
  background-color: #FFFFFF;
  border-left: 1px solid var(--border-hairline);
  box-shadow: -12px 0 36px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 1;
  animation: slideInRight 190ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(740px, calc(100vw - 32px));
  background-color: #FFFFFF;
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  animation: scaleIn 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: 10px;
  background-color: #FFFFFF;
  border: 1px solid var(--border-hairline);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--text-primary);
  animation: toastSlideUp 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast-item.toast-exit {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

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

/* ==========================================================================
   SLA & RESCUE LIVE TIMER EMPHASIS
   ========================================================================== */

.timer-urgent {
  color: #DC2626 !important;
  font-weight: 600;
}

.timer-warn {
  color: #D97706 !important;
  font-weight: 600;
}

/* ==========================================================================
   UNIFIED MODULE PAGE CONTAINERS & SHARED .o5-* PRIMITIVES
   Prevents style-ID collisions across Dashboard, Marketing, Telesales,
   Pipeline & Customers 360 regardless of navigation order
   ========================================================================== */

.o5-page,
.o5o-wrap,
.o5w-wrap,
.o5f-wrap,
.o5s-wrap,
.bc-studio {
  padding: 16px 20px 28px;
  box-sizing: border-box;
}

#o5-telesales-view.o5-page {
  padding: 12px 16px 16px;
}

.o5-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text-primary, #0F172A);
  font-size: 13.5px;
}

.o5-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.o5-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.o5-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary, #0F172A);
  margin: 0;
}

.o5-subtitle {
  font-size: 12.5px;
  color: var(--text-muted, #64748B);
  margin: 3px 0 0;
}

.o5-seg {
  display: inline-flex;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
  flex-wrap: wrap;
}

.o5-seg-btn {
  border: 0;
  background: transparent;
  color: #475569;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease;
}

.o5-seg-btn:hover {
  color: #0F172A;
}

.o5-seg-btn.active {
  background: #FFFFFF;
  color: #0F172A;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.o5-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 16px 18px;
}

.o5-card-tight {
  padding: 13px 15px;
}

.o5-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.o5-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #0F172A;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.o5-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.o5-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.o5-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.o5-grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1180px) {
  .o5-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .o5-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .o5-grid-4, .o5-grid-3, .o5-grid-2 { grid-template-columns: 1fr; }
}

.o5-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.o5-pill-neutral { background: #F1F5F9; color: #334155; border-color: #E2E8F0; }
.o5-pill-bronze { background: #FEF3C7; color: #92400E; border-color: #FDE68A; }
.o5-pill-blue { background: #EFF6FF; color: #1D4ED8; border-color: #DBEAFE; }
.o5-pill-green { background: #ECFDF5; color: #047857; border-color: #D1FAE5; }
.o5-pill-amber { background: #FFFBEB; color: #B45309; border-color: #FDE68A; }
.o5-pill-rose { background: #FFF1F2; color: #BE123C; border-color: #FECDD3; }
.o5-pill-violet { background: #F5F3FF; color: #6D28D9; border-color: #DDD6FE; }

.o5-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid #CBD5E1;
  background: #FFFFFF;
  color: #0F172A;
  white-space: nowrap;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.o5-btn:hover:not(:disabled) { background: #F8FAFC; border-color: #94A3B8; }
.o5-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.o5-btn-primary { background: #0F172A; color: #FFFFFF; border-color: #0F172A; }
.o5-btn-primary:hover:not(:disabled) { background: #1E293B; border-color: #1E293B; }
.o5-btn-blue { background: #2563EB; color: #FFFFFF; border-color: #2563EB; }
.o5-btn-blue:hover:not(:disabled) { background: #1D4ED8; border-color: #1D4ED8; }
.o5-btn-emerald { background: #059669; color: #FFFFFF; border-color: #059669; }
.o5-btn-emerald:hover:not(:disabled) { background: #047857; border-color: #047857; }
.o5-btn-amber { background: #FFFBEB; color: #B45309; border-color: #FCD34D; }
.o5-btn-rose { background: #FFF1F2; color: #BE123C; border-color: #FDA4AF; }
.o5-btn-xs { padding: 4px 8px; font-size: 11.5px; border-radius: 7px; }
.o5-btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

.o5-input, .o5-select, .o5-textarea {
  width: 100%;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12.5px;
  color: #0F172A;
  background: #FFFFFF;
  box-sizing: border-box;
  font-family: inherit;
}
.o5-input:focus, .o5-select:focus, .o5-textarea:focus {
  outline: none;
  border-color: #2563EB;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
.o5-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

.o5-sla-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #F1F5F9;
  color: #334155;
  font-variant-numeric: tabular-nums;
}
.o5-sla-pill.is-urgent { background: #FFF1F2; color: #BE123C; border: 1px solid #FECDD3; }
.o5-golden-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #F59E0B;
  display: inline-block;
  box-shadow: 0 0 0 3px #FEF3C7;
  flex-shrink: 0;
}
.o5-banner-amber { background: #FFFBEB; border: 1px solid #FDE68A; border-left: 3.5px solid #D97706; border-radius: 10px; padding: 11px 14px; color: #78350F; }
.o5-banner-rose { background: #FFF1F2; border: 1px solid #FECDD3; border-left: 3.5px solid #E11D48; border-radius: 10px; padding: 11px 14px; color: #881337; }
.o5-banner-blue { background: #EFF6FF; border: 1px solid #BFDBFE; border-left: 3.5px solid #2563EB; border-radius: 10px; padding: 11px 14px; color: #1E3A8A; }
.o5-banner-green { background: #ECFDF5; border: 1px solid #A7F3D0; border-left: 3.5px solid #059669; border-radius: 10px; padding: 11px 14px; color: #065F46; }

/* Scroll & Paint Containment for Dense Lists */
.o5-tele-scroll,
#pk-thread-list,
#pk-messages-stream,
.kanban-col-body {
  contain: layout style;
}

/* ==========================================================================
   PRINT SUPPORT — THERMAL A6 / A7 / K80 / K58 SHIPPING LABELS (P-04 BATCH)
   ========================================================================== */

.o5w-batch-labels-sheet {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding: 6px 2px 10px;
}

.thermal-a6-label {
  box-sizing: border-box;
}

.o5w-a6-flavor-box {
  margin-bottom: 5px;
  padding: 4px 7px;
  border: 2px solid #000000;
  background: #ffffff;
  color: #000000;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.o5w-a6-flavor-tag {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 4px;
  background: #000000;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.o5w-a6-gift-box {
  margin-bottom: 5px;
  padding: 4px 7px;
  background: #0f172a;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

@media print {
  @page {
    size: 100mm 150mm;
    margin: 2mm;
  }

  @page thermal-a7 {
    size: 75mm 105mm;
    margin: 2mm;
  }

  @page thermal-k80 {
    size: 80mm auto;
    margin: 2mm;
  }

  @page thermal-k58 {
    size: 58mm auto;
    margin: 1.5mm;
  }

  body {
    background: #FFFFFF !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #app-sidebar,
  #app-topbar,
  #toast-container,
  #cmd-palette,
  .no-print,
  .o5w-batch-modal-toolbar,
  .o5w-size-switch {
    display: none !important;
  }

  #app-shell {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* If thermal A6/A7 batch or single label is open inside modal or drawer, print ONLY labels cleanly */
  .modal-overlay:not(.hidden),
  .drawer-overlay:not(.hidden) {
    position: static !important;
    display: block !important;
    background: #FFFFFF !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .modal-backdrop,
  .drawer-backdrop,
  .modal-header,
  #app-modal-close,
  #app-drawer-close {
    display: none !important;
  }

  .modal-panel,
  .drawer-panel,
  #app-modal-body {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .o5w-batch-labels-sheet {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .thermal-a6-label {
    width: 96mm !important;
    max-width: 96mm !important;
    min-height: 142mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 1.5pt solid #000000 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 9.5pt !important;
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .thermal-a6-label.thermal-size-a7 {
    page: thermal-a7;
    width: 71mm !important;
    max-width: 71mm !important;
    min-height: 99mm !important;
    font-size: 8.5pt !important;
  }

  .thermal-a6-label.thermal-size-k80 {
    page: thermal-k80;
    width: 76mm !important;
    max-width: 76mm !important;
    min-height: auto !important;
    font-size: 8.5pt !important;
  }

  .thermal-a6-label.thermal-size-k58 {
    page: thermal-k58;
    width: 54mm !important;
    max-width: 54mm !important;
    min-height: auto !important;
    font-size: 7.5pt !important;
  }

  .o5w-batch-labels-sheet .thermal-a6-label:last-child,
  .thermal-a6-label:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
}
