/* =============================================================
   OMNNEA DASHBOARD — Design System v2.6
   Reference: omnnea-dashboard_26.html
   Load order: after dashboard.css (overrides via specificity)
   ============================================================= */

/* ── 1. CSS VARIABLES ─────────────────────────────────────── */
:root {
    /* Color palette */
    --bg: #f4f3ee;
    --surface: #ffffff;
    --surface-2: #faf9f5;
    --surface-hover: #f0efea;
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.14);
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #4a5568;
    /* Brand */
    --primary: #5179a8;
    --primary-soft: #e4ecf5;
    --primary-dark: #3b5d85;
    /* Semantic */
    --success: #16a34a;
    --success-soft: #dcfce7;
    --warning: #d97706;
    --warning-soft: #fef3c7;
    --danger: #dc2626;
    --danger-soft: #fee2e2;
    /* Shape */
    --radius: 10px;
    --radius-lg: 14px;
    /* Elevation */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    /* Typography */
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    /* Layout */
/*    --sidebar-width: 248px;*/
    --sidebar-width: 248px;

    --sidebar-collapsed-width: 64px;
    --topbar-height: 64px;
    /* ── Backwards-compat aliases (for views using old var names) */
    --primary-color: #5179a8;
    --primary-gradient: linear-gradient(180deg, #5179a8 0%, #3b5d85 100%);
    --primary-light: #7295be;
    --primary-pale: #c7d8ed;
    --accent-glow: rgba(81, 121, 168, 0.25);
    --text-dark: #0f172a;
    --text-light: #475569;
    --text-soft: #94a3b8;
    --border-color: rgba(15, 23, 42, 0.08);
}

/* ── 2. GLOBAL RESET & BASE ───────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: var(--font) !important;
  background: var(--bg) !important;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
  margin-bottom: 0 !important;
}

a { text-decoration: none; color: inherit; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

/* ── 3. LAYOUT SHELL ──────────────────────────────────────── */
.dashboard-wrapper {
  display: flex !important;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* ── 4. SIDEBAR ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width) !important;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  display: flex !important;
  flex-direction: column;
  color: white;
  padding: 18px 14px !important;
  position: fixed !important;
  left: 0; top: 0;
  height: 100vh;
  z-index: 1000;
  overflow: visible !important;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: none !important;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width) !important;
}

/* ── 4a. Sidebar brand / header ── */
.sidebar-header {
  background: transparent !important;
  padding: 0 0 18px !important;
  height: auto !important;
  border: none !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.sidebar-header::before,
.sidebar-header::after { display: none !important; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: 100%;
}

/* Logo image — inverted to white */
.brand-img-wrap {
  max-width: 160px;
  overflow: hidden;
  transition: max-width 0.3s, opacity 0.25s;
  display: flex;
  align-items: center;
}
.brand-img-wrap img {
  width: 150px;
  height: 52px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  display: block;
}

/* Collapsed: hide image, show icon */
.sidebar.collapsed .brand-img-wrap {
  max-width: 0;
  opacity: 0;
}
.brand-icon-mini {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: white;
  flex-shrink: 0;
  opacity: 0;
  position: absolute;
  transition: opacity 0.25s;
}
.sidebar.collapsed .brand-icon-mini {
  opacity: 1;
  position: relative;
}

/* ── 4b. Sidebar toggle button ── */
.sidebar-toggle {
  position: absolute !important;
  right: -15px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  color: var(--primary-dark) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.06) !important;
  z-index: 1001;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  padding: 0 !important;
  cursor: pointer !important;
}
.sidebar-toggle:hover {
  background: var(--primary-dark) !important;
  color: white !important;
  border-color: var(--primary-dark) !important;
  transform: translateY(-50%) scale(1.15) !important;
  box-shadow: 0 6px 14px rgba(81, 121, 168, 0.35) !important;
}
.sidebar-toggle i {
  font-size: 13px !important;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s !important;
  display: inline-block !important;
}
.sidebar-toggle:hover i {
  color: white !important;
  transform: translateX(-2px) !important;
}
.sidebar.collapsed .sidebar-toggle i {
  transform: rotate(180deg) !important;
}
.sidebar.collapsed .sidebar-toggle:hover i {
  color: white !important;
  transform: rotate(180deg) translateX(-2px) !important;
}

/* ── 4c. User profile card in sidebar ── */
.user-profile {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  margin: 0 0 10px !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  overflow: hidden;
  transition: all 0.3s;
}
.sidebar.collapsed .user-profile {
  padding: 6px !important;
  justify-content: center;
  margin: 0 0 8px !important;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22) !important;
  display: flex; align-items: center; justify-content: center;
  color: white !important;
  flex-shrink: 0;
  box-shadow: none !important;
}
.user-avatar i { color: white !important; font-size: 14px !important; }
.user-info {
  flex: 1; overflow: hidden;
  transition: opacity 0.22s, width 0.3s;
}
.sidebar.collapsed .user-info { opacity: 0; width: 0; }
.user-name { font-weight: 600; font-size: 13px; color: white !important; white-space: nowrap; }
.user-role { font-size: 11px; color: rgba(255,255,255,0.7) !important; margin-top: 1px; }

/* ── 4d. Navigation ── */
.sidebar-nav-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 !important;
}
.sidebar-nav-wrap::-webkit-scrollbar { width: 3px; }
.sidebar-nav-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 3px; }

.sidebar-nav {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-item { margin: 0 !important; position: relative; }

.nav-link {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.85) !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  border-left: none !important;
  background: transparent !important;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: white !important;
  transform: none !important;
}
.nav-link.active {
  background: white !important;
  color: var(--primary-dark) !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  border-left: none !important;
}
.nav-link.active .nav-icon { color: var(--primary-dark) !important; opacity: 1 !important; }
.nav-link.active i { color: var(--primary-dark) !important; }

.nav-icon {
  font-size: 18px !important;
  display: flex !important;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
  opacity: 0.9;
  color: inherit !important;
}
.nav-label { flex: 1; transition: opacity 0.22s; }
.nav-tooltip { display: none !important; }
.nav-section-label { display: none !important; }
.nav-divider {
  height: 1px !important;
  background: rgba(255, 255, 255, 0.15) !important;
  margin: 8px 0 !important;
}

/* Collapsed state */
.sidebar.collapsed .nav-label { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 10px !important; }

/* Settings submenu */
.sidebar.collapsed #collapseSettingsImproved { display: none !important; }
.collapse.show .nav-link { padding-left: 20px !important; }

/* ── 4e. AI Agent Status section ── */
.ai-agent-status-section {
  background: rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  margin: 8px 0 !important;
  flex-shrink: 0;
}
.ai-status-label {
  font-size: 10.5px !important;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  opacity: 0.75;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px !important;
  color: white !important;
}
.ai-status-list { display: flex; flex-direction: column; gap: 6px; }
.ai-status-item {
  display: flex; align-items: center; justify-content: space-between;
}
.ai-status-branch {
  font-size: 12px; font-weight: 500; color: white;
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 140px;
}
.ai-status-branch i { font-size: 12px; opacity: 0.7; }
.ai-status-badge {
  font-size: 10.5px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 10px !important;
  letter-spacing: 0 !important;
}
.badge-enabled { background: rgba(74, 222, 128, 0.2) !important; color: #bbf7d0 !important; }
.badge-disabled { background: rgba(239, 68, 68, 0.2) !important; color: #fca5a5 !important; }
.sidebar.collapsed .ai-agent-status-section { display: none !important; }

/* ── 4f. Sidebar bottom / version ── */
.sidebar-bottom { flex-shrink: 0; }
.sidebar-version {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55) !important;
  margin-top: 10px;
/*  font-family: var(--mono);*/
  white-space: nowrap;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.sidebar-version i { font-size: 10px; }
.sidebar.collapsed .sidebar-version span { display: none; }

/* ── 5. MAIN CONTENT ──────────────────────────────────────── */
.main-content {
  flex: 1 !important;
  margin-left: var(--sidebar-width) !important;
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  min-height: 0;
  padding-top: 0 !important;
}
.main-content.expanded { margin-left: var(--sidebar-collapsed-width) !important; }

/* ── 5a. Topbar (user utility bar) ── */
.user-utility-bar {
  height: var(--topbar-height) !important;
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding: 0 28px !important;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  gap: 10px;
}

/* Hide the old company name bar */
.top-header { display: none !important; }

/* ── 5b. Topbar user dropdown ── */
.user-dropdown { position: relative; }

.user-dropdown-trigger {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 6px 12px 6px 6px !important;
  border: 1px solid var(--border) !important;
  border-radius: 30px !important;
  background: var(--surface) !important;
  cursor: pointer;
  transition: all 0.15s;
}
.user-dropdown-trigger:hover {
  background: var(--surface-hover) !important;
  border-color: var(--border-strong) !important;
}

.user-avatar-dropdown {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary-soft) !important;
  color: var(--primary-dark) !important;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.user-avatar-dropdown i { color: var(--primary-dark) !important; font-size: 14px !important; }

.user-info-dropdown { line-height: 1.2; }
.user-name-dropdown { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role-dropdown { font-size: 11px; color: var(--text-3); }
.dropdown-arrow { font-size: 12px !important; color: var(--text-3); transition: transform 0.2s; }
.user-dropdown.open .dropdown-arrow { transform: rotate(180deg); }

.dropdown-menu-custom {
  position: absolute !important;
  right: 0 !important;
  top: calc(100% + 8px) !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  padding: 5px !important;
  min-width: 185px !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transform: translateY(-4px) scale(0.97) !important;
  transform-origin: top right;
  transition: all 0.15s ease !important;
  z-index: 500;
}
.user-dropdown.open .dropdown-menu-custom {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

.dropdown-item-custom {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 9px 12px !important;
  border-radius: 7px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  transition: background 0.12s;
  cursor: pointer;
  text-decoration: none !important;
}
.dropdown-item-custom:hover { background: var(--surface-hover) !important; }
.dropdown-item-custom.text-danger { color: var(--danger) !important; }
.dropdown-item-custom.text-danger:hover { background: var(--danger-soft) !important; }
.dropdown-item-custom i { font-size: 15px; color: var(--text-3); }
.dropdown-item-custom.text-danger i { color: var(--danger) !important; }
.dropdown-divider {
  height: 1px !important;
  background: var(--border) !important;
  margin: 4px 0 !important;
  border: none !important;
}

/* ── 5c. Mobile menu ── */
.mobile-menu-btn {
  position: fixed;
  top: 14px; left: 14px;
  z-index: 1100;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--primary) !important;
  color: white !important;
  display: none;
  align-items: center; justify-content: center;
  border: none !important;
  box-shadow: var(--shadow-md);
}
.mobile-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.mobile-overlay.show { opacity: 1; pointer-events: auto; }

/* ── 5d. Content area ── */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
/*  padding: 24px 28px !important;*/
  background: var(--bg) !important;
  min-height: 0;
}
.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ── 6. MAIN CARD / CARD ──────────────────────────────────── */
.main-card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  margin-bottom: 16px;
  padding: 0 !important;
  overflow: hidden;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.card-title {
  font-size: 15px; font-weight: 600;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}
.card-title i { color: var(--primary); font-size: 18px; }

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  transition: all 0.15s;
}
.info-card:hover { border-color: var(--border-strong); }

/* Header inside main-card */
.main-card .header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 2px 22px !important;
  border-bottom: 1px solid var(--border) !important;
  background: var(--surface) !important;
  flex-wrap: wrap;
  gap: 12px;
}
.main-card .header-title {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
}
.main-card .header-icon {
  width: 38px; height: 38px;
  border-radius: 10px;




  color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

/* Standalone .header (outside main-card) */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.header-title { font-size: 20px; font-weight: 700; color: var(--text); }

/* ── 7. BUTTONS ───────────────────────────────────────────── */
.btn-primary,
.btn-add {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 9px 16px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  background: var(--primary) !important;
  color: white !important;
  border: 1px solid var(--primary) !important;
  transition: all 0.15s !important;
  cursor: pointer;
  font-family: var(--font) !important;
  text-decoration: none !important;
  box-shadow: 0 2px 6px rgba(81, 121, 168, 0.25);
}
.btn-primary:hover,
.btn-add:hover {
  background: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(81, 121, 168, 0.35);
  transform: translateY(-1px);
}

.btn-secondary,
.btn-reset,
.btn-filter {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 9px 16px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  border: 1px solid var(--border-strong) !important;
  transition: all 0.15s !important;
  cursor: pointer;
  font-family: var(--font) !important;
}
.btn-secondary:hover,
.btn-reset:hover { background: var(--surface-hover) !important; }

.btn-filter {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}
.btn-filter:hover { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; }

.btn-edit {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 5px 12px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  background: var(--primary-soft) !important;
  color: var(--primary-dark) !important;
  border: 1px solid rgba(81, 121, 168, 0.2) !important;
  transition: all 0.15s !important;
  cursor: pointer;
  text-decoration: none !important;
}
.btn-edit:hover {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

.btn-delete {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 5px 12px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  background: var(--danger-soft) !important;
  color: var(--danger) !important;
  border: 1px solid rgba(220, 38, 38, 0.2) !important;
  transition: all 0.15s !important;
  cursor: pointer;
  text-decoration: none !important;
}
.btn-delete:hover {
  background: var(--danger) !important;
  color: white !important;
  border-color: var(--danger) !important;
}

.action-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all 0.15s;
  cursor: pointer;
  font-size: 15px;
}
.action-icon:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-color: rgba(81, 121, 168, 0.3);
}

/* ── 8. STATUS BADGES ─────────────────────────────────────── */
.status-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 3px 10px !important;
  border-radius: 20px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  line-height: 1.2;
  white-space: nowrap;
}
.status-badge.success,
.status-badge.active { background: var(--success-soft) !important; color: var(--success) !important; }
.status-badge.danger,
.status-badge.inactive { background: var(--danger-soft) !important; color: var(--danger) !important; }
.status-badge.warn,
.status-badge.warning { background: var(--warning-soft) !important; color: var(--warning) !important; }
.status-badge.info,
.status-badge.primary { background: var(--primary-soft) !important; color: var(--primary-dark) !important; }

/* Legacy stats-badge from dashboard.css */
.stats-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 4px 12px !important;
  border-radius: 20px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}
.stats-badge.primary { background: var(--primary-soft) !important; color: var(--primary-dark) !important; }
.stats-badge.secondary { background: var(--success-soft) !important; color: var(--success) !important; }
.stats-badge.danger { background: var(--danger-soft) !important; color: var(--danger) !important; }
.stats-badge.warning { background: var(--warning-soft) !important; color: var(--warning) !important; }

/* ── 9. ALERTS ────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius) !important;
  padding: 12px 16px !important;
  margin-bottom: 14px !important;
  font-size: 13.5px !important;
  border-width: 1px !important;
  border-style: solid !important;
  display: flex; align-items: center; gap: 10px;
}
.alert-danger  { background: var(--danger-soft) !important;  color: var(--danger) !important;       border-color: rgba(220,38,38,0.2) !important; }
.alert-success { background: var(--success-soft) !important; color: var(--success) !important;      border-color: rgba(22,163,74,0.2) !important; }
.alert-info    { background: var(--primary-soft) !important; color: var(--primary-dark) !important; border-color: rgba(81,121,168,0.2) !important; }
.alert-warning { background: var(--warning-soft) !important; color: var(--warning) !important;      border-color: rgba(217,119,6,0.2) !important; }

.no-data {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-3);
  font-size: 14px;
}
.no-data i { font-size: 36px; display: block; margin-bottom: 10px; opacity: 0.4; }

/* ── 10. FORMS & INPUTS ───────────────────────────────────── */
.form-control,
.form-select {
  border: 1px solid var(--border-strong) !important;
  border-radius: 8px !important;
  font-size: 13.5px !important;
  padding: 9px 12px !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  transition: border 0.15s, box-shadow 0.15s !important;
  font-family: var(--font) !important;
}
.form-control:focus,
.form-select:focus {
  outline: none !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-soft) !important;
}

.form-label,
.field-label {
  font-size: 10.5px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.7px !important;
  color: var(--text-3) !important;
  font-weight: 600 !important;
  margin-bottom: 6px !important;
  display: block !important;
}

.form-section {
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
/*  padding: 20px !important;*/
  margin-bottom: 16px !important;
}

.form-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 14px !important;
}

.form-actions {
  display: flex !important;
  gap: 10px !important;
  margin-top: 18px !important;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Switch/toggle */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cbd5e1; border-radius: 22px; transition: 0.2s;
}
.switch-slider::before {
  content: ''; position: absolute;
  width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-slider { background: var(--success); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }

/* Filter section */
.filter-section {
  background: var(--surface-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 14px 18px !important;
  margin-bottom: 18px !important;
}

/* ── 11. TABLES ───────────────────────────────────────────── */
.table-wrap,
.table-responsive {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; }

thead th,
th {
  text-align: left !important;
  font-size: 13px !important;
/*  text-transform: uppercase !important;*/
  letter-spacing: 0.6px !important;
  color: var(--text-3) !important;
  font-weight: 600 !important;
/*  padding: 12px 18px !important;*/
  background: var(--surface-2) !important;
  border-bottom: 1px solid var(--border) !important;
  white-space: nowrap;
}

tbody td,
td {
/*  padding: 13px 18px !important;*/
  border-bottom: 1px solid var(--border) !important;
  font-size: 12.5px !important;
  color: var(--text);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none !important; }
tbody tr:hover td { background: var(--surface-2) !important; }

/* Pagination */
.pagination-wrapper {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 16px !important;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.page-link {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text-2) !important;
  font-size: 13px;
  transition: all 0.15s;
  cursor: pointer;
}
.page-link:hover { background: var(--surface-hover) !important; }
.page-link.active,
.page-item.active .page-link {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
}

/* ── 12. TABS ─────────────────────────────────────────────── */
.nav-tabs {
  border-bottom: none !important;
  display: flex !important;
  gap: 2px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  padding: 4px !important;
  margin-bottom: 20px !important;
  box-shadow: var(--shadow-sm) !important;
  flex-wrap: nowrap;
}
.nav-tabs .nav-link {
  flex: 1 !important;
  padding: 8px 14px !important;
  border-radius: 7px !important;
  font-size: 13px !important;
  color: var(--text-2) !important;
  font-weight: 500 !important;
  border: none !important;
  background: transparent !important;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.15s !important;
  white-space: nowrap;
}
.nav-tabs .nav-link:hover {
  background: var(--surface-hover) !important;
  color: var(--text) !important;
}
.nav-tabs .nav-link.active {
  background: var(--primary) !important;
  color: white !important;
  box-shadow: 0 1px 3px rgba(81, 121, 168, 0.3) !important;
  font-weight: 600 !important;
}
.branch-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    position: relative;
}

    /* ONLINE */
    .branch-status-dot.online {
        background: #22c55e;
    }

        .branch-status-dot.online::after {
            content: '';
            position: absolute;
            inset: -4px;
            border-radius: 50%;
            background: rgba(34, 197, 94, 0.35);
            animation: pulseDot 1.6s infinite;
        }

    /* OFFLINE */
    .branch-status-dot.offline {
        background: #ef4444;
    }

        .branch-status-dot.offline::after {
            content: '';
            position: absolute;
            inset: -4px;
            border-radius: 50%;
            background: rgba(239, 68, 68, 0.25);
            animation: pulseDot 1.6s infinite;
        }

@keyframes pulseDot {
    0% {
        transform: scale(0.6);
        opacity: 0.8;
    }

    70% {
        transform: scale(1.4);
        opacity: 0;
    }

    100% {
        opacity: 0;
    }
}
/* ── 13. MODALS ───────────────────────────────────────────── */
.modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(4px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2000 !important;
    padding: 20px !important;
    display: none !important;
}
    .modal-overlay.active {
        display: flex !important;
    }
.modal-container {
  background: var(--surface) !important;
  border-radius: var(--radius-lg) !important;
  width: 100%; max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2) !important;
  animation: modalIn 0.25s ease;
}

.modal-header {
  padding: 18px 22px 14px !important;
  border-bottom: 1px solid var(--border) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: var(--surface) !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-header h3,
.modal-title {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  display: flex; align-items: center; gap: 8px;
  background: none !important;
  padding: 0 !important;
  border: none !important;
}
.modal-header h3 i { color: var(--primary); }

.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 16px;
}
.modal-close:hover { background: var(--surface-hover) !important; }

.modal-body { padding: 20px 22px !important; }
.modal-footer {
  padding: 14px 22px 18px !important;
  border-top: 1px solid var(--border) !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  background: var(--surface-2) !important;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Bootstrap modal overrides */
.modal-content {
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2) !important;
}
.modal-content .modal-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
  color: white !important;
}
.modal-content .modal-header h5,
.modal-content .modal-header .modal-title { color: white !important; }
.modal-content .modal-header .btn-close { filter: brightness(0) invert(1); }
.modal-content .modal-footer { background: var(--surface-2) !important; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ── 14. UPLOAD ZONE ──────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-strong) !important;
  border-radius: var(--radius-lg) !important;
  padding: 40px 20px !important;
  text-align: center;
  background: var(--surface) !important;
  transition: all 0.2s !important;
  cursor: pointer;
}
.upload-zone:hover {
  border-color: var(--primary) !important;
  background: var(--primary-soft) !important;
}
.upload-zone > i:first-child { font-size: 36px; color: var(--text-3); display: block; margin-bottom: 10px; }
.upload-zone:hover > i:first-child { color: var(--primary); }
.upload-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.upload-sub { font-size: 13px; color: var(--text-2); }
.upload-hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }

.file-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 17px; }
.file-icon.pdf  { background: #fee2e2; color: #b91c1c; }
.file-icon.docx { background: #dbeafe; color: #1e40af; }
.file-icon.txt  { background: #f1f5f9; color: #475569; }
.file-icon.csv  { background: #dcfce7; color: #166534; }

/* ── 15. PAGE HEADER ──────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin-bottom: 2px; }
.page-subtitle { font-size: 13.5px; color: var(--text-2); }

/* ── 16. TIMELINE ─────────────────────────────────────────── */
.timeline { padding-left: 14px; position: relative; }
.timeline::before {
  content: ''; position: absolute;
  left: 5px; top: 8px; bottom: 8px;
  width: 1px; background: var(--border-strong);
}
.tl-item { position: relative; padding: 10px 0 10px 18px; }
.tl-item::before {
  content: ''; position: absolute;
  left: -10px; top: 17px;
  width: 10px; height: 10px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 50%;
}
.tl-item.success::before { border-color: var(--success); }
.tl-item.warn::before { border-color: var(--warning); }
.tl-item .time { font-size: 11.5px; color: var(--text-3); margin-bottom: 2px; font-family: var(--mono); }
.tl-item .text { font-size: 13.5px; color: var(--text); }
.tl-item .text strong { font-weight: 600; }
.tl-item .meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ── 17. ANIMATIONS ───────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
  70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.pulse {
  animation: pulse 2s infinite;
}

/* ── 18. EMBEDDED MODE ────────────────────────────────────── */
body.embedded-mode .sidebar,
body.embedded-mode .mobile-menu-btn,
body.embedded-mode .mobile-overlay,
body.embedded-mode .user-utility-bar { display: none !important; }
body.embedded-mode .main-content    { margin-left: 0 !important; }
body.embedded-mode .content-area    { padding: 0 !important; }

/* ── 19. RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 1024px) {
  .form-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 900px) {
  .sidebar {
    width: var(--sidebar-collapsed-width) !important;
    padding: 14px 8px !important;
  }
  .sidebar .nav-label,
  .sidebar .user-info,
  .sidebar .ai-agent-status-section,
  .sidebar .sidebar-version span { display: none !important; }
  .sidebar .nav-link { justify-content: center !important; padding: 10px !important; }
  .sidebar .brand-img-wrap { display: none !important; }
  .sidebar .brand-icon-mini { opacity: 1 !important; position: relative !important; }
  .main-content { margin-left: var(--sidebar-collapsed-width) !important; }
  .content-area { padding: 16px !important; }
}

@media (max-width: 768px) {
  body { overflow: auto !important; }
  .dashboard-wrapper { position: relative; }
  .sidebar {
    transform: translateX(-100%) !important;
    width: var(--sidebar-width) !important;
    padding: 18px 14px !important;
  }
  .sidebar.show-mobile { transform: translateX(0) !important; }
  .sidebar .nav-label { display: block !important; opacity: 1 !important; }
  .sidebar .user-info { display: block !important; opacity: 1 !important; width: auto !important; }
  .sidebar .ai-agent-status-section { display: block !important; }
  .sidebar .nav-link { justify-content: flex-start !important; padding: 10px 12px !important; }
  .sidebar .brand-img-wrap { display: flex !important; max-width: 160px !important; opacity: 1 !important; }
  .sidebar .brand-icon-mini { opacity: 0 !important; position: absolute !important; }
  .mobile-menu-btn { display: flex !important; }
  .mobile-overlay { display: block; }
  .main-content { margin-left: 0 !important; }
  .user-utility-bar { padding: 0 16px 0 60px !important; }
}

/* ── 20. SWEETALERT2 OVERRIDES ────────────────────────────── */
.swal2-popup {
  border-radius: var(--radius-lg) !important;
  font-family: var(--font) !important;
}
.swal2-confirm {
  background: var(--primary) !important;
  border-radius: 8px !important;
}
.swal2-cancel {
  border-radius: 8px !important;
}
/* Topbar with centered company name - matching Omnnea design */
.user-utility-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    gap: 20px;
}

.topbar-left {
    width: 120px;
    flex-shrink: 0;
}

/* Company Display - Centered (matching branch display style) */
.company-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 18px 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
/*    flex: 1;*/
    max-width: 400px;
    margin: 0 auto;
}

    .company-display:hover {
        border-color: var(--primary);
        box-shadow: 0 2px 8px rgba(81, 121, 168, 0.15);
        transform: translateY(-1px);
    }

.company-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(81, 121, 168, 0.3);
}

    .company-icon i {
        font-size: 20px;
    }

.company-text {
    line-height: 1.2;
    text-align: left;
}

.company-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-3);
    font-weight: 600;
    margin-bottom: 2px;
}

.company-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin: 0;
}

.company-website {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-3);
    text-decoration: none;
    max-width: 220px;
    transition: color 0.15s;
}

    .company-website i {
        font-size: 10px;
        color: var(--primary);
        flex-shrink: 0;
    }

    .company-website span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .company-website:hover {
        color: var(--primary);
        text-decoration: underline;
    }

/* User Dropdown - Right side */
.user-dropdown {
    width: 120px;
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .user-utility-bar {
        padding: 10px 16px;
        gap: 12px;
    }

    .topbar-left {
        width: 40px;
    }

    .company-display {
        padding: 4px 12px 4px 8px;
        max-width: 100%;
    }

    .company-icon {
        width: 32px;
        height: 32px;
    }

        .company-icon i {
            font-size: 16px;
        }

    .company-name {
        font-size: 14px;
    }

    .company-website {
        font-size: 10.5px;
        max-width: 160px;
    }

    .company-label {
        font-size: 9px;
    }

    .user-dropdown {
        width: auto;
    }
}

@media (max-width: 576px) {
    .company-name {
        font-size: 12px;
    }

    .company-icon {
        width: 28px;
        height: 28px;
    }

        .company-icon i {
            font-size: 14px;
        }
}
/* ── 21. BOOTSTRAP UTILITY OVERRIDES ─────────────────────── */
.text-muted { color: var(--text-3) !important; }
.bg-white { background: var(--surface) !important; }
.border { border-color: var(--border) !important; }
.rounded { border-radius: var(--radius) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow { box-shadow: var(--shadow) !important; }

/* ── 22. SCROLLBAR GLOBAL ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ──────────────────────────────────────────────────────────────
   23. RESPONSIVE OVERRIDES — applies to all embedded views
        (Business_Details, Get_Users, Get_Extension, Display_Logs,
         Business_Hours, Get_All_Notification_Settings, etc.)
   ────────────────────────────────────────────────────────────── */

/* Tables always horizontally scrollable on narrow screens */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive table { min-width: 600px; }

/* Tablet (≤ 900px) */
@media (max-width: 900px) {
    .main-card .header,
    .header {
        padding: 10px 14px !important;
        gap: 10px;
    }
    .main-card .header-title h1,
    .header-title h1 { font-size: 15px !important; }
    .main-card .header-title p,
    .header-title p { font-size: 11.5px; }

    .header-actions {
        flex-wrap: wrap;
        gap: 6px !important;
    }

    .stats-badge { font-size: 11.5px !important; padding: 5px 10px !important; }
    .action-buttons { flex-wrap: wrap; gap: 4px !important; }
    .action-btn { font-size: 11.5px !important; padding: 5px 9px !important; }

    .btn-add, .btn-primary, .btn-secondary,
    .btn-reset, .btn-filter {
        padding: 7px 12px !important;
        font-size: 12px !important;
    }
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
    .main-card .header,
    .header {
        flex-direction: column;
        align-items: stretch !important;
    }
    .main-card .header-title,
    .header-title { width: 100%; }

    .header-actions {
        width: 100%;
        justify-content: flex-start !important;
    }
    .header-actions > * { flex: 0 1 auto; }

    /* Force any 2/3/4-column grids to stack */
    .form-grid,
    .ext-fields-row,
    .filter-grid,
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Filter wrappers stack & take full width */
    .filter-select-wrapper,
    .call-filters {
        width: 100% !important;
        min-width: 0 !important;
    }
    .call-filters { grid-template-columns: 1fr !important; }

    /* Buttons: full width inside header-actions */
    .header-actions .btn-add,
    .header-actions .btn-primary,
    .header-actions .btn-secondary,
    .header-actions form { width: 100%; }
    .header-actions .btn-add,
    .header-actions .btn-primary,
    .header-actions .btn-secondary { justify-content: center; }

    /* Action buttons inside table rows: keep inline scroll */
    .action-buttons {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .action-btn { flex-shrink: 0; }

    /* Empty/no-data states: shrink */
    .no-data { padding: 32px 16px !important; }
    .no-data i { font-size: 2rem !important; }
    .no-data h3 { font-size: 14px !important; }
    .no-data p  { font-size: 12.5px !important; }

    /* Card body padding */
    .main-card { padding: 0 !important; }
}

/* Very small (≤ 400px) */
@media (max-width: 400px) {
    .main-card .header,
    .header { padding: 8px 10px !important; }
    .main-card .header-icon,
    .header-icon { width: 32px !important; height: 32px !important; font-size: 14px !important; }
    .stats-badge { font-size: 10.5px !important; }
}
