
/* T2 Falcon Admin — pixel-match refs */

:root {
  /* Brand */
  --teal: #0d3f44;
  --teal-dark: #0a3338;
  --teal-deep: #082a2e;
  --teal-hover: #124c52;
  --teal-light: #e8f0f1;
  --accent: #0d3f44;

  /* Neutrals */
  --text: #1a1a1a;
  --text-2: #3d3d3d;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --border: #e5e7eb;
  --border-2: #eef0f2;
  --bg: #ffffff;
  --bg-panel: #fafafa;
  --bg-hover: #f5f7f8;
  --bg-page: #f5f6f7;

  /* Status */
  --green: #16a34a;
  --green-bg: #d9f2e4;
  --gray-status: #9ca3af;
  --gray-status-bg: #e7eaee;
  --red: #dc2626;
  --red-bg: #fde2e4;
  --orange: #f59e0b;
  --orange-bg: #ffeccb;

  /* Layout */
  --sidebar-w: 224px;
  --sidebar-w-collapsed: 68px;
  --topbar-h: 72px;
  --clients-w: 272px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Poppins', 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-size: 14px;
}
body[dir="rtl"] { font-family: 'IBM Plex Sans Arabic', 'Poppins', sans-serif; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; }
input, textarea, select { outline: none; }
a { color: inherit; text-decoration: none; }

/* ============ APP LAYOUT ============ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  transition: grid-template-columns 0.2s ease;
}
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg-page);
  overflow: hidden;
}

/* ============ SIDEBAR ============ */
.sidebar {
  background: var(--teal);
  color: white;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 20px 20px;
  height: var(--topbar-h);
  flex-shrink: 0;
}
/* When collapsed: stack logo on top, collapse arrow underneath — keeps both
   centered within the narrow 68px rail. */
.app.collapsed .sidebar-head {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
  height: auto;
  min-height: var(--topbar-h);
}
.app.collapsed .sidebar-logo { gap: 0; }
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: white;
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-logo img {
  width: 30px; height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-collapse {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.sidebar-collapse:hover { background: rgba(255,255,255,0.2); }
.app.collapsed .sidebar-collapse svg { transform: rotate(180deg); }
body[dir="rtl"] .sidebar-collapse svg { transform: rotate(180deg); }
body[dir="rtl"] .app.collapsed .sidebar-collapse svg { transform: rotate(0deg); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-section-label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  padding: 16px 12px 6px;
  letter-spacing: 0.02em;
}
.app.collapsed .nav-section-label { visibility: hidden; height: 24px; padding: 12px 0 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,0.82);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
  width: 100%;
  text-align: start;
  transition: background 0.12s, color 0.12s;
  line-height: 1.3;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active {
  background: var(--teal-deep);
  color: white;
}
/* Parent of the selected submenu item: expanded + brighter text, but NOT the selected pill
   (the selected highlight belongs to the child, not the section header). */
.nav-item.has-active-child { color: #fff; }
.nav-item svg { flex-shrink: 0; }
.nav-item .label {
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.app.collapsed .nav-item { justify-content: center; padding: 10px; }
.app.collapsed .nav-item .label { display: none; }

/* Submenu items */
.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 6px;
  padding-inline-start: 22px;
  position: relative;
}
.nav-sub::before {
  content: "";
  position: absolute;
  inset-inline-start: 22px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: rgba(255,255,255,0.18);
}
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  border-radius: 8px;
}
.nav-sub-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-sub-item.active { background: var(--teal-deep); color: white; font-weight: 600; }
.nav-sub-chev { color: rgba(255,255,255,0.6); font-weight: 400; }
body[dir="rtl"] .nav-sub-chev { transform: scaleX(-1); display: inline-block; }
.app.collapsed .nav-sub { display: none; }

.sidebar-foot {
  padding: 10px 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

/* ============ TOPBAR ============ */
.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 32px;
  background: white;
  border-bottom: 1px solid var(--border);
  gap: 24px;
}
.topbar-titles { flex: 1; min-width: 0; }
.topbar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.breadcrumb svg { opacity: 0.6; }
.breadcrumb .crumb { color: var(--text-muted); }
.breadcrumb .crumb.current { color: var(--text); font-weight: 500; }
.breadcrumb .sep { color: var(--text-faint); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}
.icon-btn {
  width: 38px; height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--text-2);
  transition: background 0.15s;
  position: relative;
}
.icon-btn:hover { background: var(--bg-hover); }
/* Ask AI button (global header) — Gemini-style gradient sparkle with animation (native title tooltip) */
.ask-ai-btn { overflow: visible; }
.ask-ai-btn::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: conic-gradient(from 0deg, #2dd4d9, #2e8b80, #0d3f44, #6cc0a8, #2dd4d9); opacity: 0; filter: blur(7px); transition: opacity .25s; z-index: 0; animation: askAiSpin 6s linear infinite; }
.ask-ai-btn:hover { background: transparent; }
.ask-ai-btn:hover::before { opacity: .55; }
.ask-ai-spark { position: relative; z-index: 1; display: inline-flex; transform-origin: center; animation: askAiTwinkle 2.8s ease-in-out infinite; }
.ask-ai-btn:hover .ask-ai-spark { animation-duration: 1.1s; }
@keyframes askAiTwinkle { 0%, 100% { transform: scale(1) rotate(0deg); } 42% { transform: scale(1.18) rotate(10deg); } 70% { transform: scale(.95) rotate(-5deg); } }
@keyframes askAiSpin { to { transform: rotate(360deg); } }
.icon-btn .badge-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid white;
}

.topbar-divider {
  width: 1px; height: 30px; background: var(--border);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 6px 6px;
  border-radius: 12px;
  transition: background 0.15s;
}
body[dir="rtl"] .user-chip { padding: 6px 6px 6px 10px; }
.user-chip:hover { background: var(--bg-hover); }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a5568, #2d3748);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar svg { width: 100%; height: 100%; display: block; }
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.user-job {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}
.user-chevron {
  color: var(--text-muted);
  margin-inline-start: 4px;
}

/* User dropdown */
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: 260px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15), 0 0 0 1px var(--border);
  z-index: 200;
  overflow: hidden;
  padding: 8px;
  animation: menuIn 0.15s ease;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.user-menu-head {
  background: var(--teal);
  color: white;
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.user-menu-head .avatar { background: rgba(255,255,255,0.2); border: 2px solid rgba(255,255,255,0.3); }
.user-menu-head .user-name { color: white; }
.user-menu-head .user-job { color: rgba(255,255,255,0.75); }
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  text-align: start;
  transition: background 0.12s;
}
.user-menu-item:hover { background: var(--bg-hover); }
.user-menu-item .label { flex: 1; }
.user-menu-item .sub { font-size: 11px; color: var(--text-muted); display: block; }
.user-menu-item.danger { color: var(--red); }
.user-menu-item.danger svg { color: var(--red); }
.user-menu-sep { height: 1px; background: var(--border); margin: 6px 2px; }
.mood-toggle {
  display: inline-flex;
  background: var(--teal);
  color: white;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.mood-toggle button {
  width: 28px; height: 24px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.6);
}
.mood-toggle button.active { background: white; color: var(--teal); }

/* ============ PAGE CONTAINER ============ */
.page {
  flex: 1;
  padding: 20px 16px;
  display: grid;
  grid-template-columns: var(--clients-w) 1fr;
  gap: 16px;
  min-height: 0;
}

/* ============ CLIENTS TREE PANEL ============ */
.clients-panel {
  background: #F3F8F5;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.clients-root {
  display: flex;
  align-items: center;
  position: relative;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-2);
  background: transparent;
  gap: 8px;
}
.clients-root.selected {
  background: #e8f0f1;
}
.clients-root-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  flex: 1;
}
.clients-root-inner > span:not(.clients-root-icon) {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
.clients-root-icon {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal);
}
.clients-section-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  padding: 10px 20px;
  letter-spacing: 0.01em;
}
.clients-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 0 8px 12px;
  /* expose container width so .client-name can clamp against it */
  container-type: inline-size;
}
.clients-tree-scroll {
  /* Allow rows to grow to natural full width so horizontal scroll can reveal
     long names. The ellipsis on .client-name uses container-query width so it
     only kicks in when the name extends past the visible panel viewport. */
  min-width: max-content;
}
.client-node {
  position: relative;
}
.client-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, box-shadow 0.12s;
  min-height: 36px;
  position: relative;
  user-select: none;
}
.client-row:hover { background: #ffffff; }
.client-row.selected {
  background: var(--teal-light);
}
body[dir="rtl"] .client-row.selected {
  background: var(--teal-light);
}
.client-row.on-path .tree-rail { background-image: linear-gradient(to right, transparent calc(50% - 0.5px), var(--teal) calc(50% - 0.5px), var(--teal) calc(50% + 0.5px), transparent calc(50% + 0.5px)); }
.client-row.on-path .tree-rail.elbow::before,
.client-row.on-path .tree-rail.elbow::after { background: var(--teal); }

/* === Tree rails === */
.tree-rails {
  display: flex;
  align-self: stretch;
  flex-shrink: 0;
}
.tree-rail {
  position: relative;
  width: 18px;
  align-self: stretch;
  flex-shrink: 0;
  background-image: linear-gradient(to right, transparent calc(50% - 0.5px), rgba(13, 63, 68, 0.18) calc(50% - 0.5px), rgba(13, 63, 68, 0.18) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  transition: background-image 0.15s;
}
.tree-rail.rail-empty {
  background-image: none;
}
/* Elbow rail: vertical half (top to mid) + horizontal (mid to right edge) */
.tree-rail.elbow {
  /* default: through-line, then elbow drawn by pseudo-elements */
}
.tree-rail.elbow::before {
  /* vertical line from top to row centre */
  content: '';
  position: absolute;
  left: calc(50% - 0.5px);
  top: 0;
  bottom: 50%;
  width: 1px;
  background: rgba(13, 63, 68, 0.18);
  transition: background 0.15s;
}
.tree-rail.elbow::after {
  /* horizontal line from centre out to the right edge of this 22px column */
  content: '';
  position: absolute;
  left: 50%;
  top: calc(50% - 0.5px);
  right: 0;
  height: 1px;
  background: rgba(13, 63, 68, 0.18);
  transition: background 0.15s;
}
/* If this row is the LAST child, kill the through-line in the elbow column (no continuation below) */
.tree-rail.elbow.rail-last {
  background-image: none;
}
body[dir="rtl"] .tree-rail.elbow::after {
  left: auto; right: 50%;
}

/* === Chevron === */
.client-chev {
  width: 18px; height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  margin-inline-start: 2px;
  transition: transform 0.15s, background 0.12s, color 0.15s;
  position: relative;
  z-index: 2;
  background: transparent;
}
.client-chev:hover { background: var(--bg-hover); color: var(--teal); }
.client-chev.open { transform: rotate(90deg); color: var(--teal); }
.client-chev.collapsed-has-kids {
  color: var(--teal);
}
.client-chev.collapsed-has-kids:hover {
  background: var(--bg-hover);
}
body[dir="rtl"] .client-chev { transform: rotate(180deg); }
body[dir="rtl"] .client-chev.open { transform: rotate(90deg); }
.client-chev.invisible { visibility: hidden; }
.client-logo {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #f3f4f6;
  overflow: hidden;
  border: 1px solid var(--border-2);
}
.client-logo.bank-rajhi { background: #ebf3fa; color: #1e4fa3; font-weight: 700; font-size: 10px; }
.client-logo.bank-snb { background: #f0f5ee; color: #1a6b2e; font-weight: 700; font-size: 9px; }
.client-logo.bank-bupa { background: #e6f2fb; color: #0b74a6; font-weight: 700; font-size: 9px; }
.client-logo.bank-aramco { background: transparent; border: none; font-size: 0; padding: 0; }
.client-logo.bank-aramco img { width: 100%; height: 100%; object-fit: contain; display: block; }
.client-logo.node-generic {
  background: transparent;
  border: 0;
  color: var(--text-muted);
}
.client-logo.node-mini {
  background: #D9E6DD;
  color: #0d3f44;
  border: 1px solid #b8cdc0;
}
.client-name {
  /* Cap to the visible panel viewport width (via container-query units on
     .clients-list which sets container-type: inline-size). Subtract space for
     row padding + chevron + logo + sticky menu button so the ellipsis lands
     just before the dots. When the name fits, no ellipsis; when it doesn't,
     '…' shows and the user can horizontally scroll to reveal the full text. */
  flex: 0 0 auto;
  min-width: 0;
  max-width: calc(100cqw - 100px);
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
/* When the user has horizontally scrolled, drop the cap so the full name
   reveals — the row is wide enough for it and the sticky button stays pinned
   to the right edge of the visible viewport. */
.clients-list.is-scrolled .client-name {
  max-width: none;
  overflow: visible;
}
/* Legacy sub-spans — no-ops, kept for back-compat. */
.client-name-clip,
.client-name-spacer { display: none; }
.client-row.selected .client-name { color: var(--teal); font-weight: 600; }

.client-menu-btn {
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 6px;
  /* Hidden by default — reveal on row hover or when this button's menu is open. */
  opacity: 0;
  flex-shrink: 0;
  margin-inline-start: auto;
  /* Pin to the visible right edge of the scrollable list — stays put when the
     user horizontally scrolls long client names. */
  position: sticky;
  inset-inline-end: 8px;
  z-index: 2;
  /* Match the panel surface so it cleanly masks any tree content scrolled
     underneath it. */
  background: #F3F8F5;
  box-shadow: -8px 0 8px -6px rgba(13, 63, 68, 0.08);
  transition: opacity 0.12s, background 0.12s;
  pointer-events: none;
}
.client-row:hover .client-menu-btn,
.client-menu-btn.open {
  opacity: 1;
  pointer-events: auto;
}
.client-row:hover .client-menu-btn { background: #ffffff; }
.client-row.selected:hover .client-menu-btn { background: var(--teal-light); }
.client-menu-btn:hover { background: var(--teal-light) !important; color: var(--teal); }
.client-menu-btn.open { color: white; background: var(--teal) !important; }

.client-children {
  /* No overflow:hidden \u2014 it would create a new sticky containing block and\n     break .client-menu-btn's position:sticky pinning to the .clients-list edge. */
}

/* === Polished horizontal scrollbar === */
.clients-list::-webkit-scrollbar { width: 6px; height: 6px; }
.clients-list::-webkit-scrollbar-track { background: transparent; }
.clients-list::-webkit-scrollbar-thumb {
  background: rgba(13, 63, 68, 0.15);
  border-radius: 3px;
}
.clients-list::-webkit-scrollbar-thumb:hover {
  background: rgba(13, 63, 68, 0.30);
}
.clients-list { scrollbar-width: thin; scrollbar-color: rgba(13, 63, 68, 0.15) transparent; }

/* === App-wide polished scrollbar — low-specificity default so any styled/hidden
   scrollbar (sidebar, wallet, clients-list) still overrides it, while every
   otherwise-unstyled container inherits this one consistent look. === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(13, 63, 68, 0.18); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(13, 63, 68, 0.32); }
* { scrollbar-width: thin; scrollbar-color: rgba(13, 63, 68, 0.2) transparent; }

/* Context menu (node actions) */
.ctx-menu {
  position: absolute;
  top: 32px;
  inset-inline-start: 50%;
  z-index: 9999;
  background: white;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12), 0 0 0 1px var(--border);
  padding: 4px;
  min-width: 150px;
  animation: menuIn 0.12s ease;
}
.ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  text-align: start;
  transition: background 0.1s;
}
.ctx-menu-item:hover { background: #104C54; color: #ffffff; }
.ctx-menu-item:hover svg { color: #ffffff; }

/* Floating variant: anchored via inline top/left/right; clear inset-inline-start
   so the LTR/RTL default (50%) doesn't fight the inline coords. Sits above
   everything (drawers, modals get higher). */
.ctx-menu.ctx-menu-floating {
  position: fixed !important;
  inset-inline-start: auto !important;
  z-index: 9999;
}
.ctx-menu-item.highlighted { background: var(--teal); color: white; }
.ctx-menu-item.highlighted svg { color: white; }
.ctx-menu-item svg { color: var(--text-muted); }

/* ============ CONTENT PANEL ============ */
.content-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.tabs-bar {
  display: flex;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-2);
  gap: 28px;
  flex-shrink: 0;
  background: white;
}
.tab {
  padding: 18px 4px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--teal);
}

.content-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 24px;
}
/* When chart is shown inside content-body, kill padding + scroll so chart fills cleanly */
.content-body:has(.org-chart-inpanel) {
  padding: 0;
  overflow: hidden;
}

/* Node header bar */
.node-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 16px;
  flex-wrap: wrap;
}
.node-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.node-title .node-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #0891b2, #059669, #065f46, #0891b2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.node-title.falcon .node-avatar {
  background: white;
  border: 1px solid var(--border);
  color: var(--teal);
}
.node-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.info-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 4px;
  transition: color 0.15s;
}
.info-link:hover { color: var(--teal); }
.info-link.active {
  color: var(--teal);
  background: rgba(13, 63, 68, 0.06);
  border-radius: 6px;
}

/* ============ INFORMATION PANEL ============ */
.info-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}
.info-panel-header {
  padding: 21px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.info-panel-body {
  padding: 26px 28px 32px;
  background: white;
}

/* Client Picture (Information panel header section) */
.info-client-pic {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0px 0px 24px 0px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.info-client-pic-circle {
  position: relative;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: rgba(13,63,68,0.06);
  border: 3px solid rgba(13,63,68,0.10);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(13,63,68,0.10);
}
.info-client-pic-circle img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.info-client-pic-initials {
  font-size: 28px; font-weight: 700; color: var(--teal); letter-spacing: 0.5px;
}
.info-client-pic-edit,
.info-client-pic-delete {
  position: absolute;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background: var(--teal); color: #fff;
}
.info-client-pic-edit { right: -2px; bottom: -2px; }
.info-client-pic-delete { right: -2px; top: -2px; background: #d14343; }
.info-client-pic-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.info-client-pic-name { font-size: 17px; font-weight: 700; color: var(--text); }
.info-client-pic-label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.info-client-pic-actions {
  display: flex; align-items: center; gap: 12px; margin-top: 4px;
}
.info-client-pic-hint { font-size: 12px; color: var(--text-2); }
.info-grid-top {
  background: #ffffff;
  padding: 24px 0px;
}
.info-grid-bottom {
  /* background: var(--bg-subtle, #fafafa); */
  padding: 24px 0px;
  border-top: 1px solid var(--border);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 28px;
}
.info-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.info-field-label {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.info-field-value {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  word-wrap: break-word;
}
.info-section-title {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding-top: 4px;
  margin-top: 4px;
  border-top: 1px dashed var(--border);
}
.info-section-title:first-child { border-top: none; padding-top: 0; margin-top: 0; }

.info-field-input {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  background: white;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.info-field-input:hover { border-color: #d1d5db; }
.info-field-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,63,68,0.08); }
.info-field-input::placeholder { color: var(--text-faint); font-weight: 400; }
.info-panel.is-editing .info-grid-bottom { background: #fff; }

@media (max-width: 1100px) {
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
}
/* Consistent disabled state for every button variant */
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--teal);
  color: white;
}
.btn-primary:hover { background: var(--teal-hover); }
.btn-secondary {
  background: white;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: #d1d5db; }
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-hover); }

/* ============ USERS TABLE ============ */
.table-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}
.table-scroll { overflow-x: auto; }
.table-head-bar {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-2);
  background: white;
}
.table-head-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

/* View mode toggle (List / Board) */
.view-toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-hover);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  gap: 2px;
}
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.view-toggle-btn:hover { color: var(--text); }
.view-toggle-btn.active {
  background: white;
  color: var(--teal);
  box-shadow: 0 1px 3px rgba(13,63,68,0.08);
}
.view-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

/* ============ KANBAN / BOARD VIEW ============ */
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: #fafafa;
  min-height: 420px;
}
.kanban-col {
  background: white;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.kanban-col-head {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border-2);
  background: #fcfcfd;
}
.kanban-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}
.kanban-col-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}
.kanban-empty {
  text-align: center;
  padding: 20px 0;
  color: var(--text-faint);
  font-size: 20px;
}

/* User card (kanban) */
.user-card {
  position: relative;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.user-card:hover {
  border-color: rgba(13,63,68,0.25);
  box-shadow: 0 2px 8px rgba(13,63,68,0.06);
}
.user-card.selected {
  border-color: var(--teal);
  background: rgba(13,63,68,0.02);
  box-shadow: 0 0 0 1px var(--teal);
}
.user-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.user-card-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D9E6DD, #b9d4c3);
  color: var(--teal);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}
.user-card-id {
  flex: 1;
  min-width: 0;
}
.user-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.user-card-username {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.user-card-contact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-2);
}
.user-card-line {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
}
.user-card-line svg { flex-shrink: 0; opacity: 0.7; }
.user-card-line span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.user-card-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.role-pill, .perm-pill {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}
.role-pill {
  background: rgba(13,63,68,0.06);
  color: var(--teal);
}
.perm-pill {
  background: var(--bg-hover);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}

/* Responsive: collapse to fewer columns on narrow screens */
@media (max-width: 1280px) {
  .kanban { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.table-head-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.filter-btn:hover { background: var(--bg-hover); }
.search-input {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input svg {
  position: absolute;
  inset-inline-start: 12px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-input input {
  width: 220px;
  height: 36px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: white;
}
body[dir="rtl"] .search-input input { padding: 0 38px 0 14px; }
.search-input input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,63,68,0.08); }

/* Table */
.users-table-wrap {
  overflow-x: auto;
}
.users-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  min-width: 100%;
}
.users-table thead th {
  background: #F5F5F5;
  padding: 14px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: start;
  border-bottom: 1px solid var(--border-2);
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
  height: 60px;
}
.users-table tbody tr {
  border-bottom: 1px solid var(--border-2);
}
.users-table tbody tr:last-child { border-bottom: none; }
.users-table tbody tr.selected { background: transparent; }
.users-table tbody tr.selected td { position: relative; }
.users-table tbody td {
  padding: 16px 14px;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1.5;
}
.users-table td.col-email { font-size: 12.5px; }
.users-table td.col-username { font-weight: 500; }
.users-table td.col-email { color: var(--text-2); }
.users-table td.col-phone { color: var(--text-2); font-variant-numeric: tabular-nums; }
.users-table td.col-actions, .users-table th.col-actions { width: 50px; text-align: center; padding-inline-end: 14px; }
.users-table th.col-perm-group { white-space: normal; line-height: 1.3; }

/* Checkbox */
.cb {
  width: 16px; height: 16px;
  border: 1.5px solid #c7ced4;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0;
  vertical-align: middle;
}
.cb:hover { border-color: var(--teal); }
.cb.checked {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  min-width: 74px;
  justify-content: center;
}
.status-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-badge.active { background: var(--green-bg); color: #0f7a3a; }
.status-badge.active .dot { background: var(--green); }
.status-badge.suspended { background: #F3F3F3; color: #5a6470; }
.status-badge.suspended .dot { background: #D9D9D9; }
.status-badge.deleted { background: var(--red-bg); color: #a1191d; }
.status-badge.deleted .dot { background: var(--red); }
.status-badge.locked { background: #C2C2C2; color: #444444; }
.status-badge.locked .dot { background: #444444; }
.status-badge.pending { background: var(--orange-bg); color: #a85a00; }
.status-badge.pending .dot { background: var(--orange); }
.status-badge.expired { background: #FFEDED; color: #a1191d; }
.status-badge.expired .dot { background: #d92d20; }
.status-badge.disabled { background: #F3F3F3; color: #595959; }
.status-badge.disabled .dot { background: #D9D9D9; }
.status-badge.inactive { background: #C2C2C2; color: #444444; }
.status-badge.inactive .dot { background: #444444; }
.status-badge.paid { background: #E8F1FE; color: #1d5fc4; }
.status-badge.paid .dot { background: #3b82f6; }

/* Row actions button */
.row-action-btn {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all 0.12s;
}
.row-action-btn:hover { background: var(--bg-hover); color: var(--text); }
.row-action-btn.open {
  background: var(--teal);
  color: white;
}

/* Row actions menu */
.row-menu {
  position: absolute;
  top: 30px;
  inset-inline-end: 40px;
  z-index: 100;
  background: white;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.14), 0 0 0 1px var(--border);
  padding: 4px;
  min-width: 160px;
  animation: menuIn 0.12s ease;
}
.row-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  text-align: start;
}
.row-menu-item:hover { background: #104C54; color: #ffffff; }
.row-menu-item svg { color: var(--text-muted); }
.row-menu-item:hover svg { color: #ffffff; }

/* Table footer */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 14px;
  border-top: 1px solid var(--border-2);
  background: #F5F5F5;
  font-size: 12.5px;
  color: var(--text-muted);
  height: 60px;
  min-height: 60px;
  box-sizing: border-box;
}
.table-footer-info { font-size: 11px; color: var(--text-muted); }
.table-pager {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.table-pager-pages {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 6px;
  font-size: 13px;
  color: var(--text);
}
.table-pager-num {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--teal, #0d3f44);
  color: white;
  font-weight: 600;
  font-size: 13px;
}
.table-pager-of { color: var(--text-muted); font-size: 12.5px; }
.table-pager-total { font-size: 13px; color: var(--text); font-weight: 500; }
.table-pager-icon {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  transition: background 0.12s;
  border: 0;
}
.table-pager-icon:hover:not(:disabled) { background: rgba(0,0,0,0.05); color: var(--text); }
.table-pager-icon:disabled { opacity: 0.35; cursor: not-allowed; }
.table-pager-rows {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.table-pager-rows-select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  background: white;
  font-size: 11px;
  color: var(--text);
  cursor: pointer;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  transition: background 0.12s;
}
.pager-btn:hover { background: var(--bg-hover); }
.pager-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* Empty state when no user selected */
.empty-state {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============ DRAWER ============ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 300;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed;
  top: 0; bottom: 0; inset-inline-end: 0;
  width: 440px;
  background: white;
  box-shadow: -16px 0 40px rgba(0,0,0,0.08);
  z-index: 301;
  display: flex;
  flex-direction: column;
  animation: drawerIn 0.22s ease;
}
body[dir="rtl"] .drawer {
  box-shadow: 16px 0 40px rgba(0,0,0,0.08);
  animation: drawerInRtl 0.22s ease;
}
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes drawerInRtl { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.drawer-head {
  padding: 20px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-2);
}
.drawer-title { font-size: 18px; font-weight: 600; color: var(--text); }
.drawer-close {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 50%;
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.drawer-close:hover { background: var(--bg-hover); color: var(--text); }
.drawer-body { flex: 1; padding: 24px; overflow-y: auto; }
.drawer-foot {
  padding: 18px 24px;
  border-top: 1px solid var(--border-2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.field { margin-bottom: 18px; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.field-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  background: white;
  transition: border-color 0.15s;
}
.field-input:focus { border-bottom-color: var(--teal); border-bottom-width: 2px; }

/* ============ TOAST ============ */
.toast-stack {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: #ebf9f1;
  border: 1px solid #c8e9d4;
  border-radius: 10px;
  padding: 12px 16px 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  pointer-events: auto;
  animation: toastIn 0.25s ease;
  font-size: 13px;
  color: #0f7a3a;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.toast .toast-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast .toast-msg { flex: 1; color: #0f7a3a; }
.toast .toast-close {
  color: var(--text-muted);
  padding: 2px;
  display: flex;
}
.toast .toast-close:hover { color: var(--text); }

/* ============ TWEAKS + LANG ============ */
.lang-toggle {
  display: inline-flex;
  background: var(--bg-hover);
  border-radius: 999px;
  padding: 3px;
}
.lang-toggle button {
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  color: var(--text-muted);
}
.lang-toggle button.active { background: white; color: var(--teal); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

.tweaks-panel {
  position: fixed;
  top: 80px;
  inset-inline-end: 20px;
  width: 280px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  overflow: hidden;
  z-index: 500;
  border: 1px solid var(--border);
}
.tweaks-head {
  background: var(--teal);
  color: white;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tweaks-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 70vh;
  overflow-y: auto;
}
.tweak-row { display: flex; flex-direction: column; gap: 6px; }
.tweak-row > label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.tweak-row select,
.tweak-row input[type=text] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.toggle-switch input { display: none; }
.toggle-switch .knob {
  width: 32px; height: 18px;
  background: #d1d5db;
  border-radius: 999px;
  position: relative;
  transition: background 0.15s;
}
.toggle-switch .knob::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: white;
  border-radius: 50%;
  transition: transform 0.15s;
}
.toggle-switch input:checked + .knob { background: var(--teal); }
.toggle-switch input:checked + .knob::after { transform: translateX(14px); }
body[dir="rtl"] .toggle-switch input:checked + .knob::after { transform: translateX(-14px); }

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }

/* RTL flip chevrons */
body[dir="rtl"] svg.flip-rtl { transform: scaleX(-1); }


/* ============ HIERARCHY VIEW TOGGLE (inline in tabs bar, top-right) ============ */
/* Tabs bar with right-aligned view toggle (Tree / Chart) */
.tabs-bar.tabs-bar-with-toggle {
  justify-content: space-between;
  align-items: center;
  padding-right: 14px;
}
.tabs-bar-with-toggle .tabs-bar-left {
  display: flex;
  gap: 28px;
}
.tabs-bar-toggle {
  padding: 2px;
  align-self: center;
}
.tabs-bar-toggle .view-toggle-btn {
  padding: 4px 9px;
  font-size: 11.5px;
}
.tabs-bar-toggle .view-toggle-btn svg {
  width: 11px;
  height: 11px;
}

/* Chart mode: tabs bar above chart */
.chart-tabs-bar {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 14px 0 24px;
  min-height: 50px;
}
.chart-tabs-bar .tabs-bar.tabs-bar-flush {
  border-bottom: none;
  padding: 0;
  background: transparent;
  flex: 1;
}
.chart-tabs-bar .view-toggle {
  padding: 2px;
  flex-shrink: 0;
}
.chart-tabs-bar .view-toggle-btn {
  padding: 4px 9px;
  font-size: 11.5px;
}
.chart-tabs-bar .view-toggle-btn svg {
  width: 11px;
  height: 11px;
}

/* ============ ORG CHART (full-width replacement view) ============ */
.org-chart-fullpanel {
  grid-column: 1 / -1;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 560px;
}
/* Inside content-panel variant — same width as tree view, no outer border (inherited from content-panel) */
.org-chart-inpanel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 560px;
  background: white;
  overflow: hidden;
}
.org-chart-wrap { display: flex; flex-direction: column; flex: 1; }
.org-chart-toolbar {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-2);
  background: #fcfcfd;
}
.chart-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 12px;
  color: var(--text-muted);
}
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-legend-item .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.chart-legend-item .dot.root   { background: #0d3f44; }
.chart-legend-item .dot.client { background: linear-gradient(135deg, #2ECC71, #0d3f44); }
.chart-legend-item .dot.sub    { background: #D9E6DD; border: 1px solid #7C82A9; }
.chart-hint {
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
}
.org-chart-canvas-scroll {
  flex: 1;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 1px 1px, rgba(13,63,68,0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  background-color: #fafbfc;
  cursor: grab;
  user-select: none;
}
.org-chart-canvas-scroll.panning { cursor: grabbing; }
.org-chart-canvas {
  position: absolute;
  top: 0; left: 0;
  will-change: transform;
}
.org-chart-lines {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
}

/* Zoom controls — floating bottom-right over canvas */
.chart-zoom-controls {
  position: absolute;
  bottom: 14px;
  inset-inline-end: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(13,63,68,0.08);
  z-index: 5;
}
.chart-zoom-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chart-zoom-btn:hover {
  background: var(--bg-hover);
  color: var(--teal);
}
.chart-zoom-level {
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 40px;
  text-align: center;
  border-left: 1px solid var(--border-2);
  border-right: 1px solid var(--border-2);
  height: 24px;
  display: flex;
  align-items: center;
}

/* Chart cards */
.chart-card {
  position: absolute;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(13,63,68,0.05);
}
.chart-card:hover {
  border-color: var(--teal);
  box-shadow: 0 4px 12px rgba(13,63,68,0.12);
  transform: translateY(-1px);
}
.chart-card.selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal);
}
.chart-card.is-root {
  background: #0d3f44;
  color: white;
  border-color: #0d3f44;
}
.chart-card.is-root .chart-card-name { color: white; }
.chart-card.is-root .chart-card-meta { color: rgba(255,255,255,0.7); }
.chart-card.is-client {
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
}
.chart-card-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.chart-card-ic.root {
  background: rgba(255,255,255,0.14);
  color: white;
  border-radius: 50%;
}
.chart-card-ic.sub {
  background: #D9E6DD;
  color: #0d3f44;
  border: 1px solid #7C82A9;
  border-radius: 50%;
}
.chart-card-text {
  flex: 1;
  min-width: 0;
}
.chart-card-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.chart-card-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* RTL: flip chart horizontally */
body[dir="rtl"] .org-chart-canvas { direction: ltr; }

/* ============ FOCUS MODE — user circles around the clicked node ============ */
.org-chart-canvas.animating {
  transition: transform 520ms cubic-bezier(.22,1,.36,1);
}
.org-chart-canvas-scroll.is-focused {
  background: #f4f6f5;
  cursor: zoom-out;
}
.org-chart-canvas-scroll.is-focused::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(13,63,68,0.08) 100%);
  pointer-events: none;
  z-index: 0;
  animation: focusFade 400ms ease-out;
}
@keyframes focusFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Dimmed cards (everything except the focused one) */
.chart-card.is-dimmed {
  opacity: 0.15;
  filter: blur(0.6px);
  transition: opacity 420ms ease, filter 420ms ease;
  pointer-events: none;
}
/* The focused card — subtle highlight */
.chart-card.is-focused {
  box-shadow: 0 8px 28px rgba(13,63,68,0.22), 0 0 0 2px var(--teal);
  transform: translateY(-1px);
  z-index: 5;
  animation: focusPulse 1.6s ease-in-out infinite;
}
@keyframes focusPulse {
  0%, 100% { box-shadow: 0 8px 28px rgba(13,63,68,0.22), 0 0 0 2px var(--teal); }
  50%      { box-shadow: 0 10px 32px rgba(13,63,68,0.30), 0 0 0 3px var(--teal); }
}

/* Status colors (reuse tokens) */
.chart-user-circle {
  --s-color: var(--gray-status);
  --s-bg: var(--gray-status-bg);
}
.chart-user-circle.status-active    { --s-color: var(--green);       --s-bg: var(--green-bg); }
.chart-user-circle.status-suspended { --s-color: var(--gray-status); --s-bg: var(--gray-status-bg); }
.chart-user-circle.status-deleted   { --s-color: var(--red);         --s-bg: var(--red-bg); }
.chart-user-circle.status-locked    { --s-color: #8691a4;            --s-bg: var(--gray-status-bg); }
.chart-user-circle.status-pending   { --s-color: var(--orange);      --s-bg: var(--orange-bg); }

.chart-user-circle {
  position: absolute;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--s-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13,63,68,0.15);
  z-index: 6;
  opacity: 0;
  transform: translateY(18px) scale(0.6);
  animation: userCirclePop 520ms cubic-bezier(.22,1.2,.36,1) forwards;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.chart-user-circle:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 10px 22px rgba(13,63,68,0.25);
}
@keyframes userCirclePop {
  0%   { opacity: 0; transform: translateY(18px) scale(0.6); }
  60%  { opacity: 1; transform: translateY(-4px) scale(1.08); }
  100% { opacity: 1; transform: translateY(0)   scale(1);    }
}
.chart-user-initials {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.3px;
}
.chart-user-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--s-color);
  border: 2px solid white;
  box-shadow: 0 0 0 1px var(--s-color);
}
.chart-user-label {
  position: absolute;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  animation: userLabelIn 400ms ease-out forwards;
  z-index: 6;
}
@keyframes userLabelIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chart-user-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.chart-user-role {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Connector line from card to users */
.chart-user-connector {
  animation: connectorIn 340ms ease-out 120ms backwards;
}
@keyframes connectorIn {
  from { opacity: 0; }
  to   { opacity: 0.4; }
}

/* Exit focus button */
.chart-focus-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(13,63,68,0.08);
  z-index: 10;
  animation: closeBtnIn 300ms ease-out 100ms backwards;
}
.chart-focus-close:hover {
  border-color: var(--teal);
  color: var(--teal);
}
@keyframes closeBtnIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ APPLICATIONS TABLE (Apps & Services / Comm Channels) ============ */
.apps-tab-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.node-header.simple {
  padding: 0px 0 0;
  border-bottom: 0;
  margin-bottom: 2px;
}
.node-header.node-header-with-actions {
  justify-content: space-between;
}
.node-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.apps-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}
.apps-panel-header {
  padding: 21px 18px;
  display: flex;
  align-items: center;
  min-height: 49px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.apps-panel .table-scroll { overflow-x: auto; overflow-y: visible; }
.apps-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}
.apps-table thead th {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 12px;
  text-align: start;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-2);
  white-space: normal;
  word-break: keep-all;
  line-height: 1.35;
  vertical-align: middle;
  background: #F5F5F5;
  height: 60px;
}
.apps-table thead th.col-vis { width: 72px; }
.apps-table thead th.col-action { width: 64px; text-align: center; }
.apps-panel .table-footer { background: #F5F5F5; }
.apps-table tbody td {
  padding: 16px 14px;
  vertical-align: middle;
  color: var(--text);
  border-bottom: 1px solid var(--border-2);
}
.apps-table tbody tr:last-child td { border-bottom: 0; }
.apps-table tbody tr.row-editing td {
  border-bottom-color: transparent;
}
.apps-table .name-cell { font-weight: 700; max-width: 140px; line-height: 1.3; }
.apps-table .muted-cell { color: var(--text-2); white-space: nowrap; }
.apps-table .col-action { text-align: center; }
.price-val { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--text); }

/* Visibility toggle */
.vis-toggle {
  width: 38px;
  height: 22px;
  background: #d1d5db;
  border-radius: 999px;
  position: relative;
  transition: background 0.15s;
  border: 0;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.vis-toggle.on { background: var(--teal); }
/* Locked: visibility can't be edited once a commchannel has been purchased. */
.vis-toggle.is-locked { cursor: not-allowed; opacity: 0.45; }
.vis-toggle-dot {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.vis-toggle.on .vis-toggle-dot { transform: translateX(16px); }
body[dir="rtl"] .vis-toggle-dot { left: auto; right: 3px; }
body[dir="rtl"] .vis-toggle.on .vis-toggle-dot { transform: translateX(-16px); }

/* Pill badges (active/inactive) */
.pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 18px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  min-width: 80px;
}
.pill-active {
  color: #104C54;
  border: 1px solid #104C54;
  background: #F3F8F5;
}
.pill-expired {
  color: #FF7A7A;
  border: 1px solid #FF7A7A;
  background: #FFEDED;
}
.pill-disable {
  color: #8A8A8A;
  border: 1px solid #BDBDBD;
  background: #F2F2F2;
}
.pill-inactive {
  color: #ffffff;
  border: 1px solid #8A8A8A;
  background: #8A8A8A;
}

/* ============ INSUFFICIENT BALANCE MODAL ============ */
/* Visibility "Show" warning (commchannel + active contract) */
.vis-warn-overlay {
  position: fixed; inset: 0; z-index: 260;
  background: rgba(15, 23, 42, 0.42);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
.vis-warn-modal {
  width: 440px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 16px; padding: 38px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  text-align: center;
}
.vis-warn-ic {
  width: 52px; height: 52px; border-radius: 50%;
  background: #FEF3E2; color: #d68a08;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.vis-warn-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.vis-warn-msg { font-size: 12px; line-height: 1.3; color: var(--text-muted); margin-bottom: 22px; }
.vis-warn-actions { display: flex; gap: 10px; justify-content: center; }
.vis-warn-actions .btn { min-width: 130px; }

.ib-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
.ib-modal {
  width: 680px;
  max-width: calc(100vw - 32px);
  background: white;
  border-radius: 16px;
  padding: 28px 100px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.ib-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}
.ib-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}
.ib-subtitle {
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 20px;
}
.ib-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 14px 16px;
  background: #fafafa;
  margin-bottom: 14px;
}
.ib-drag-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
}
.ib-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ib-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ib-rank {
  width: 18px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
  flex-shrink: 0;
}
.ib-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: grab;
  transition: box-shadow 0.12s, border-color 0.12s, transform 0.12s;
}
.ib-item:active { cursor: grabbing; }
.ib-item.dragging { opacity: 0.55; box-shadow: 0 8px 20px rgba(0,0,0,0.12); }
.ib-item.drop-target { border-color: var(--teal); box-shadow: 0 0 0 2px rgba(16, 76, 84, 0.15); }
.ib-grip {
  display: inline-flex;
  color: #9ca3af;
  flex-shrink: 0;
}
.ib-item-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.ib-arrow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f3f4f6;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.ib-arrow:hover:not(:disabled) { background: var(--teal); color: white; }
.ib-arrow:disabled { opacity: 0.4; cursor: not-allowed; }
.ib-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #eaf4f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--teal);
  margin-bottom: 18px;
}
.ib-info-dot { display: inline-flex; }
.ib-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.ib-btn {
  padding: 9px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.ib-btn-cancel {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}
.ib-btn-cancel:hover { background: var(--bg-hover); }
.ib-btn-proceed {
  background: var(--teal);
  color: white;
}
.ib-btn-proceed:hover { background: #0c3d44; }

/* Inline edit expansion rows */
.edit-expand-row td {
  background: #F3F8F5;
  border-bottom: 1px solid #E6EFE9 !important;
  padding: 14px 16px !important;
  vertical-align: middle;
}
.edit-expand-row.edit-row-top td { padding-top: 18px !important; padding-bottom: 14px !important; }
.edit-cell-pointer { position: relative; }
.edit-cell-pointer::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 16px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 8px solid #F3F8F5;
}
body[dir="rtl"] .edit-cell-pointer::before { left: auto; right: 16px; }
.edit-expand-row.edit-row-bot td { background: #E6EFE9; padding-top: 14px !important; padding-bottom: 18px !important; }
.edit-expand-row.edit-row-bot .edit-cell-pointer::before { border-bottom-color: #E6EFE9; }
.edit-expand-row.view-row td { background: #E6EFE9 !important; }
.edit-expand-row.view-row .edit-cell-pointer::before { display: none; }
.edit-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.edit-field-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}
.edit-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 2px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 18px;
}
body[dir="rtl"] .edit-select { background-position: left 0 center; padding-right: 0; padding-left: 18px; }
.edit-select:focus { outline: none; }
.edit-price-input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.edit-price-input svg { color: var(--text); }
.edit-input {
  background: transparent;
  border: 0;
  border-bottom: 1px dashed transparent;
  padding: 2px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-family: inherit;
  width: 70px;
}
.edit-input:focus { outline: none; border-bottom-color: var(--teal); }

.edit-actions-cell { width: 180px; }
.edit-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}
.edit-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid var(--border);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
}
.edit-btn:hover { background: var(--bg-hover); }
.edit-btn.set-btn { color: var(--teal); border-color: var(--teal); }
.edit-btn.set-btn:hover { background: var(--teal); color: white; }
.edit-btn.cancel-btn:hover { color: var(--red); border-color: var(--red); }

/* Edit pill (white rounded container around inputs) */
.edit-pill {
  background: white;
  border-radius: 10px;
  padding: 6px 10px;
  border: 1px solid #E0E7E2;
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  min-height: 36px;
}
.edit-pill .dp-trigger {
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 600;
  font-size: 13px;
}
.edit-select-pill {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  padding-right: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}
.edit-select-pill:focus { outline: none; }
body[dir="rtl"] .edit-select-pill { background-position: left 0 center; padding-right: 0; padding-left: 22px; }

/* View mode value text */
.view-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Save / Cancel text buttons */
.edit-btn.save-btn-text,
.edit-btn.cancel-btn-text {
  width: auto;
  height: 36px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  font-family: inherit;
}
.edit-btn.cancel-btn-text {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}
.edit-btn.cancel-btn-text:hover { background: var(--bg-hover); }
.edit-btn.save-btn-text {
  background: var(--teal);
  color: white;
  border: 1px solid var(--teal);
}
.edit-btn.save-btn-text:hover { background: #0c3d44; border-color: #0c3d44; }

/* View mode icon buttons (calendar-edit and remove) */
.edit-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background 0.12s;
}
.edit-icon-btn.view-edit-btn { color: var(--teal); }
.edit-icon-btn.view-edit-btn:hover { background: rgba(16, 76, 84, 0.1); }
.edit-icon-btn.view-remove-btn { color: #6b7280; }
.edit-icon-btn.view-remove-btn:hover { background: rgba(0,0,0,0.06); color: var(--red); }

/* Action stack: toggle arrow + ⋮ menu */
.row-action-stack {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.row-toggle-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: #F3F8F5;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.12s;
}
.row-toggle-btn:hover { background: #E6EFE9; }
.row-toggle-btn.open { transform: rotate(180deg); background: var(--teal); color: white; }

/* Row actions popover */
.row-menu-wrap { position: relative; display: inline-block; }
.row-actions-pop {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12), 0 0 0 1px var(--border);
  padding: 4px;
  z-index: 50;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: menuIn 0.12s ease;
}
body[dir="rtl"] .row-actions-pop { right: auto; left: 0; }
.row-actions-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  text-align: start;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  font-family: inherit;
  width: 100%;
}
.row-actions-item svg { color: var(--text-muted); transition: color 0.1s; }
.row-actions-item:hover { background: #104C54; color: #ffffff; }
.row-actions-item:hover svg { color: #ffffff; }

/* ============ ADD USER FLOW ============ */
.au-overlay {
  position: fixed;
  inset: 0;
  z-index: 202;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.au-creds-overlay { z-index: 202; }
.au-page {
  background: #ffffff;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

/* Top bar */
.au-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  flex-shrink: 0;
}
.au-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.au-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--teal);
}
.au-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.au-topbar-actions .btn,
.ac-topbar-actions .btn {
  height: 34px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
}

/* Body */
.au-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-page);
}
.au-content-card {
  background: white;
  width: 100%;
  max-width: none;
  margin: 0;
  flex: 1;
  overflow: visible;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.au-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 30px 22px;
}
.au-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: -0.01em;
}
.au-step-counter {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  background: var(--bg-hover);
  padding: 4px 10px;
  border-radius: 999px;
}
.au-step-counter strong { font-weight: 600; color: var(--text); }

/* Stepper */
.au-stepper {
  padding: 4px 40px 0;
  margin-bottom: 24px;
}
.au-stepper-track {
  position: relative;
  height: 4px;
  background: var(--border);
  border-radius: 3px;
  margin: 8px 0 0;
}
.au-stepper-fill {
  position: absolute;
  left: 0; top: 0; height: 100%;
  background: var(--teal);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.au-stepper-dot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, box-shadow 0.2s;
  z-index: 1;
}
.au-stepper-dot.done { background: var(--teal); }
.au-stepper-dot.active { background: var(--teal); box-shadow: 0 0 0 4px rgba(13,63,68,0.12); }
.au-stepper-labels {
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
}
.au-step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.3;
  transition: color 0.15s;
}
.au-step-label:first-child { text-align: start; }
.au-step-label:nth-child(2) { text-align: center; }
.au-step-label:last-child { text-align: end; }
.au-step-label.active { color: var(--teal); font-weight: 700; }

/* Step content */
.au-step-content {
  padding: 20px 30px 32px;
}
.au-divider {
  height: 1px;
  background: var(--border-2);
  margin: 24px 0;
}
.au-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
}

/* Avatar upload */
.au-avatar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-hover);
  border: 1px dashed var(--border);
  border-radius: 12px;
  transition: background 0.15s, border-color 0.15s;
}
.au-avatar-row:hover {
  border-color: var(--teal);
  background: rgba(13,63,68,0.03);
}
.au-avatar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.au-avatar-circle {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.au-avatar-edit,
.au-avatar-delete {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  cursor: pointer;
  color: #6b7280;
  box-shadow: 0 2px 6px rgba(13, 63, 68, 0.18);
  transition: background 0.12s, color 0.12s;
  z-index: 2;
}
.au-avatar-edit { background: #f5f1eb; right: 0; bottom: 0; transform: translate(28%, 28%); }
.au-avatar-delete { background: #ffffff; right: 0; top: 0; transform: translate(28%, -28%); }
body[dir="rtl"] .au-avatar-edit { right: auto; left: 0; transform: translate(-28%, 28%); }
body[dir="rtl"] .au-avatar-delete { right: auto; left: 0; transform: translate(-28%, -28%); }
.au-avatar-edit:hover { background: var(--teal); color: #fff; }
.au-avatar-delete:hover { background: #c0392b; color: #fff; }
.au-avatar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.au-avatar-label .sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}
.au-avatar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.au-drag-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Form grid */
.au-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px 20px;
}
.au-form-grid-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 560px;
}
.au-form-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1280px) {
  .au-form-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  .au-form-grid { grid-template-columns: repeat(2, 1fr); }
  .au-form-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .au-form-grid { grid-template-columns: 1fr; }
  .au-form-grid-2 { grid-template-columns: 1fr; }
  .au-form-grid-3 { grid-template-columns: 1fr; }
  .au-avatar-row { flex-direction: column; align-items: flex-start; }
}
.au-field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.au-field.wide { grid-column: span 2; }
.au-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
.au-label .req { color: #dc2626; margin-left: 2px; }
.au-input {
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 13px;
  color: var(--text);
  background: white;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.au-input:hover { border-color: #d1d5db; }
.au-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,63,68,0.08); }
.au-input::placeholder { color: var(--text-faint); }
.au-input.error { border-color: #dc2626; background: #fef5f5; }
.au-input.error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,0.08); }
.au-error-msg {
  font-size: 11px;
  color: #dc2626;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: -2px;
}
.au-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: -2px;
}

/* Selects (step 2 & 3) */
.au-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.au-select {
  appearance: none;
  -webkit-appearance: none;
  height: 40px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  padding: 0 36px 0 12px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.au-select:hover { border-color: #d1d5db; }
.au-select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,63,68,0.08); }
.au-select-disabled,
.au-select:disabled {
  background: #D8D8D8 !important;
  color: #6b7280 !important;
  cursor: not-allowed !important;
  border-color: #D8D8D8 !important;
}
.au-select-disabled:hover { border-color: #D8D8D8 !important; }
.au-select-chevron {
  position: absolute;
  right: 12px;
  color: var(--text-muted);
  pointer-events: none;
}
body[dir="rtl"] .au-select { padding: 0 12px 0 36px; }
body[dir="rtl"] .au-select-chevron { right: auto; left: 12px; }

/* Permissions step */
.au-perm-section { display: flex; flex-direction: column; gap: 10px; }
.au-perm-label { font-size: 13px; font-weight: 600; color: var(--text); }
.au-perm-select-wrap { max-width: 360px; }
.au-checker-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.au-checker-table {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.au-checker-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-2);
}
.au-checker-row:last-child { border-bottom: none; }
.au-checker-row:hover { background: var(--bg-hover); }
.au-checker-ch-label {
  width: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.au-checker-options {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.au-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.au-radio { display: none; }
.au-radio-mark {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid #cbd2d9;
  display: inline-block;
  position: relative;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.au-radio:checked + .au-radio-mark {
  border-color: var(--teal);
  border-width: 5px;
}

/* ===========================================================
   User Details page (More Details from user list row menu)
   =========================================================== */
.ud-wrap {
  background: #fff;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.ud-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  flex-shrink: 0;
}
.ud-top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ud-top-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--teal);
}
.ud-back-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.ud-back-btn:hover { background: var(--bg-hover); color: var(--text); }
.ud-top-actions { display: flex; gap: 10px; }
.ud-top-actions .btn { height: 34px; padding: 0 18px; font-size: 13px; font-weight: 500; border-radius: 8px; }
.ud-edit-btn { display: inline-flex; align-items: center; gap: 6px; }

.ud-card {
  margin: 28px;
  border: 1px solid var(--border-2);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.ud-card-head {
  padding: 18px 28px 6px;
}
.ud-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.1px;
}

.ud-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 22px 0;
  background: #f6f6f6;
  border-bottom: 1px solid var(--border-2);
  border-top: 1px solid var(--border-2);
  margin-top: 14px;
  height: 60px;
}
.ud-tab {
  background: transparent;
  border: none;
  padding: 6px 14px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}
.ud-tab:hover { color: var(--text); }
.ud-tab.active {
  color: var(--teal);
}
.ud-tab.active::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 3px;
  background: var(--teal);
  border-radius: 2px 2px 0 0;
}

.ud-tab-pane {
  padding: 26px 28px 32px;
}
.ud-divider {
  height: 1px;
  background: var(--border-2);
  margin: 22px 0;
}

.ud-avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.ud-avatar-circle {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(13,63,68,0.08);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.ud-avatar-circle-lg {
  width: 84px; height: 84px;
  background: var(--teal);
  color: white;
  border: 3px solid rgba(13,63,68,0.10);
  box-shadow: 0 2px 8px rgba(13,63,68,0.12);
}
.ud-avatar-initials {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: white;
}
.ud-avatar-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ud-avatar-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.ud-avatar-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}

.ud-grid-2,
.ud-grid-3,
.ud-grid-4 {
  display: grid;
  gap: 28px 28px;
}
.ud-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ud-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ud-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) {
  .ud-grid-3, .ud-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ud-grid-2, .ud-grid-3, .ud-grid-4 { grid-template-columns: 1fr; }
}

.ud-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ud-field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.ud-field-value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  min-height: 20px;
  word-break: break-word;
}
.ud-field-value.mono { letter-spacing: 4px; font-weight: 700; }
.ud-empty { color: var(--text-faint); font-weight: 400; }
.ud-copy-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-faint);
  display: inline-flex;
  transition: color 0.15s;
}
.ud-copy-btn:hover { color: var(--teal); }

/* Verification badge (View mode) */
.ud-verify-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: default;
}
.ud-verify-badge.is-verified { color: #2e9b5e; }
.ud-verify-badge.is-unverified { color: #f5a623; }
.ud-verify-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #2c2e30;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 7px 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}
.ud-verify-tooltip::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #2c2e30;
  transform: translateX(-50%) rotate(45deg);
}
.ud-verify-badge:hover .ud-verify-tooltip { opacity: 1; }

/* Permissions tab read-only */
.ud-perm-block { display: flex; flex-direction: column; gap: 8px; }
.ud-perm-value { font-size: 14px; font-weight: 700; color: var(--text); }
.ud-perm-spacer { height: 24px; }
.ud-checker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 4px;
}
.ud-checker-ch {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.ud-checker-val {
  font-size: 13px;
  color: var(--teal);
}

/* Credentials modal */
.au-creds-modal {
  background: white;
  border-radius: 16px;
  width: 540px;
  max-width: 95vw;
  padding: 32px 32px 24px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  z-index: 203;
}
.au-creds-close {
  position: absolute;
  top: 18px; right: 20px;
  width: 28px; height: 28px;
  border: 0; background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.au-creds-close:hover { background: var(--bg-hover); color: var(--text); }
.au-creds-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 8px;
}
.au-creds-sub {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 22px;
}
.au-creds-delivery-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.au-creds-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.au-creds-option {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  background: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  transition: border-color 0.15s;
  font-family: inherit;
}
.au-creds-option.selected { border-color: var(--teal); }
.au-creds-option-radio { display: flex; align-items: center; }
.au-creds-radio-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s;
}
.au-creds-radio-dot.on { border-color: var(--teal); border-width: 5px; }
.au-creds-option-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.au-creds-option-icon { margin: 0 auto; display: flex; align-items: center; justify-content: center; height: 110px; }
.au-creds-option-icon img { max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none; user-select: none; }

/* Success modal */
.au-success-modal {
  position: relative;
  background: white;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  padding: 48px 56px 56px;
  width: min(560px, 92vw);
  text-align: center;
  animation: auModalIn 220ms cubic-bezier(.2,.8,.3,1);
}
.au-success-illo {
  width: 240px;
  height: 220px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.au-success-illo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}
.au-success-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.au-success-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}
@keyframes auModalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.au-creds-info-bar {
  display: flex;
  gap: 0;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 22px;
}
.au-creds-info-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
}
.au-creds-info-item:last-child { border-right: 0; }
.au-creds-info-sub { font-size: 11px; color: var(--text-muted); }
.au-creds-info-val { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 2px; }
.au-creds-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.dp-wrap { position: relative; display: inline-block; }
.dp-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.dp-trigger svg { color: var(--text-muted); }
.dp-trigger:hover svg { color: var(--teal); }
.dp-pop {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(13, 63, 68, 0.12);
  padding: 12px;
  z-index: 60;
  width: 260px;
}
.dp-pop.up { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 6px; }
body[dir="rtl"] .dp-pop { left: auto; right: 0; }
.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}
.dp-title { font-size: 13px; font-weight: 700; color: var(--text); }
.dp-nav {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dp-nav:hover { background: var(--bg-hover); color: var(--teal); }
body[dir="rtl"] .dp-nav svg { transform: scaleX(-1); }
.dp-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}
.dp-dow span { padding: 4px 0; }
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-cell {
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.1s, color 0.1s;
}
.dp-cell.empty { cursor: default; }
.dp-cell:not(.disabled):not(.selected):hover {
  background: rgba(13, 63, 68, 0.08);
  color: var(--teal);
}
.dp-cell.disabled {
  background: #f3f4f6;
  color: #b8bec6;
  cursor: not-allowed;
  text-decoration: line-through;
}
.dp-cell.today:not(.selected) { box-shadow: inset 0 0 0 1px var(--teal); color: var(--teal); }
.dp-cell.selected {
  background: var(--teal);
  color: white;
  font-weight: 700;
}

/* === Uniform table typography ===
   Every text element inside any admin table renders at the same font-size and
   font-weight. Per-column / per-cell size & weight overrides are intentionally
   neutralized so every cell, header, badge label, secondary line and inline
   metadata reads at one consistent typographic level across every table
   (Templates, Users, Apps, Contacts, Contracts, Contact Groups, Add User
   checker, Add Client services, etc.). */
.tpl-table, .tpl-table th, .tpl-table td,
.tpl-table thead th, .tpl-table tbody td,
.tpl-table .col-id, .tpl-table .col-name, .tpl-table .col-name .name-text,
.tpl-date, .tpl-date *,
.tpl-checker, .tpl-checker *,
.tpl-meta-status, .tpl-meta-status *,
.tpl-shared-pill, .tpl-shared-pill *,
.users-table, .users-table th, .users-table td,
.users-table thead th, .users-table tbody td,
.users-table td.col-email, .users-table td.col-username, .users-table td.col-phone,
.apps-table, .apps-table th, .apps-table td,
.apps-table thead th, .apps-table tbody td,
.apps-table .name-cell,
.cm-table, .cm-table th, .cm-table td,
.cm-table thead th, .cm-table tbody td,
.cg-table, .cg-table th, .cg-table td,
.cg-table thead th, .cg-table tbody td,
.acg-preview-tbl, .acg-preview-tbl th, .acg-preview-tbl td,
.acg-preview-tbl thead th, .acg-preview-tbl tbody td,
.au-checker-table, .au-checker-table th, .au-checker-table td,
.ac-svc-table, .ac-svc-table th, .ac-svc-table td {
  font-size: 13px !important;
  font-weight: 400 !important;
}
