/* ══════════════════════════════════════════════════════════════════
   SANAD PRODUCTION PORTAL — Enterprise Design System
   Version: 1.0  |  © AGenCan AI  |  Production
   ══════════════════════════════════════════════════════════════════ */

/* ─── 1. Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { height: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ─── 2. Design Tokens ────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:          #07111F;
  --navy:        #0B172A;
  --surface:     #10213A;
  --surface-2:   #152943;
  --surface-3:   #1A3150;
  --surface-4:   #1F3A5C;

  /* Borders */
  --border:      #1E3553;
  --border-2:    #29415F;
  --border-3:    #334F75;

  /* Brand */
  --blue:        #2F6BFF;
  --blue-bright: #438BFF;
  --blue-dim:    rgba(47,107,255,.14);
  --blue-glow:   rgba(47,107,255,.25);
  --cyan:        #38BDF8;
  --cyan-soft:   #67E8F9;
  --cyan-dim:    rgba(56,189,248,.12);

  /* Text */
  --text:        #F7F9FC;
  --text-2:      #B9C5D3;
  --text-3:      #8394A9;
  --text-4:      #5A6C80;

  /* Semantic */
  --success:     #22C55E;
  --success-dim: rgba(34,197,94,.14);
  --warning:     #F59E0B;
  --warning-dim: rgba(245,158,11,.14);
  --danger:      #EF4444;
  --danger-dim:  rgba(239,68,68,.14);
  --info:        #38BDF8;

  /* Typography */
  --font-en: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-ar: 'Noto Sans Arabic', 'Segoe UI', 'Geeza Pro', Tahoma, sans-serif;

  /* Spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* Radii */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.3);
  --shadow-lg:  0 12px 32px rgba(0,0,0,.5), 0 4px 8px rgba(0,0,0,.3);
  --shadow-glow: 0 0 24px rgba(47,107,255,.2);

  /* Layout */
  --sidebar-w:       240px;
  --sidebar-w-sm:    64px;
  --topbar-h:        60px;
  --content-max:     1400px;

  /* Transitions */
  --tr-fast:  150ms cubic-bezier(.4,0,.2,1);
  --tr-base:  200ms cubic-bezier(.4,0,.2,1);
  --tr-slow:  300ms cubic-bezier(.4,0,.2,1);
}

/* ─── 3. Typography ───────────────────────────────────────────── */
body {
  font-family: var(--font-en);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  color-scheme: dark;
}
[lang="ar"], [lang="ar"] * { font-family: var(--font-ar); }
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.25; }
h2 { font-size: 1.375rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: .925rem; font-weight: 600; }

/* ─── 4. Accessibility Utilities ──────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -5rem; z-index: 9999; padding: .5rem 1rem; background: var(--blue); color: #fff; border-radius: var(--r-sm); font-weight: 600; transition: top var(--tr-fast); }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: 2px; border-radius: 3px; }

/* ─── 5. Auth Shell ───────────────────────────────────────────── */
.auth-shell {
  position: fixed; inset: 0; z-index: 1000;
  overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; align-items: center;
  /* No justify-content: center — use margin:auto on child so content scrolls when too tall */
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(47,107,255,.18) 0%, transparent 60%),
                    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(56,189,248,.08) 0%, transparent 50%);
  padding: max(var(--sp-6), env(safe-area-inset-top)) var(--sp-6)
           max(var(--sp-6), env(safe-area-inset-bottom));
}
.auth-shell[hidden] { display: none; }
.auth-panel {
  width: 100%; max-width: 440px;
  margin: auto;          /* vertically centres within flex column; collapses gracefully when panel is taller than shell */
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: var(--sp-10) var(--sp-8);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  text-align: center;
}
.auth-logo-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 20px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  box-shadow: 0 8px 24px var(--blue-glow);
  margin-bottom: var(--sp-5);
}
.auth-logo-svg { width: 40px; height: 40px; color: #fff; }
.auth-product-name { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin-bottom: var(--sp-1); }
.auth-tagline { font-size: .925rem; color: var(--text-3); margin-bottom: var(--sp-8); }
.auth-divider { height: 1px; background: var(--border); margin: var(--sp-6) 0; }
.auth-pending-icon { width: 48px; height: 48px; margin: 0 auto var(--sp-4); color: var(--text-3); }
.auth-pending-title { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: var(--sp-2); }
.auth-pending-body { font-size: .875rem; color: var(--text-2); line-height: 1.7; margin-bottom: var(--sp-5); }
.auth-sso-btn {
  width: 100%; padding: .875rem var(--sp-5);
  background: var(--surface-3); border: 1px solid var(--border-2);
  border-radius: var(--r-md); color: var(--text-3);
  font-size: .9rem; font-weight: 500; cursor: not-allowed;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
}
.auth-footer-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); margin-top: var(--sp-8); color: var(--text-4); font-size: .8rem;
}
.auth-lang-btn {
  padding: .3rem .75rem; border: 1px solid var(--border-2); border-radius: var(--r-full);
  color: var(--text-3); font-size: .8rem; font-weight: 500;
  background: transparent; transition: all var(--tr-fast);
}
.auth-lang-btn:hover { border-color: var(--blue); color: var(--blue-bright); }

/* ─── 6. Portal Shell ─────────────────────────────────────────── */
.portal-shell {
  display: flex; height: 100dvh; overflow: hidden;
}
.portal-shell[hidden] { display: none; }   /* explicit rule prevents display:flex overriding the hidden attribute */
.portal-shell[hidden] { display: none; }

/* ─── 7. Sidebar ──────────────────────────────────────────────── */
.sidebar {
  flex-shrink: 0; width: var(--sidebar-w);
  background: var(--navy);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow: hidden; transition: width var(--tr-slow);
  z-index: 200;
}
.sidebar.collapsed { width: var(--sidebar-w-sm); }

/* Brand */
.sidebar-brand {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-4); height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand-icon {
  flex-shrink: 0; width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 800; color: #fff; letter-spacing: -.02em;
  box-shadow: 0 4px 12px var(--blue-glow);
}
.brand-text { overflow: hidden; flex: 1; min-width: 0; }
.brand-name { font-size: .95rem; font-weight: 700; color: var(--text); letter-spacing: .05em; line-height: 1.2; white-space: nowrap; }
.brand-sub  { font-size: .7rem; color: var(--text-4); white-space: nowrap; }
.sidebar-collapse-btn {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-4); transition: all var(--tr-fast); opacity: 0;
}
.sidebar:hover .sidebar-collapse-btn { opacity: 1; }
.sidebar-collapse-btn:hover { background: var(--surface); color: var(--text); }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-collapse-btn { display: none; }
.sidebar.collapsed .brand-icon { margin: auto; }

/* Nav */
.sidebar-nav { flex: 1; padding: var(--sp-3) var(--sp-3); overflow-y: auto; overflow-x: hidden; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.nav-group-label {
  font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-4); padding: var(--sp-2) var(--sp-2) var(--sp-1);
  white-space: nowrap; overflow: hidden;
}
.sidebar.collapsed .nav-group-label { opacity: 0; }
.nav-item {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; padding: .6rem var(--sp-2); border-radius: var(--r-md);
  color: var(--text-3); font-size: .875rem; font-weight: 500;
  transition: all var(--tr-fast); position: relative; white-space: nowrap;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface); color: var(--text-2); }
.nav-item.active {
  background: var(--blue-dim); color: var(--blue-bright);
  font-weight: 600;
}
.nav-item.active::before {
  content: ''; position: absolute;
  inset-inline-start: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--blue); border-radius: 0 3px 3px 0;
}
.nav-item-icon { flex-shrink: 0; width: 20px; height: 20px; }
.nav-item-icon svg { width: 100%; height: 100%; }
.nav-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item-badge {
  flex-shrink: 0; min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--danger); color: #fff; font-size: .7rem; font-weight: 700;
  border-radius: 99px; display: flex; align-items: center; justify-content: center;
}
.nav-item-badge[hidden] { display: none; }
.sidebar.collapsed .nav-item-label,
.sidebar.collapsed .nav-item-badge { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: .6rem; }
.sidebar.collapsed .nav-item.active::before { display: none; }

/* Sidebar tooltip on collapsed */
.sidebar.collapsed .nav-item { position: relative; }

/* Footer */
.sidebar-footer { padding: var(--sp-3); border-top: 1px solid var(--border); flex-shrink: 0; }
.sidebar-user-card {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2); border-radius: var(--r-md);
  overflow: hidden;
}
.user-avatar {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
}
.user-info { flex: 1; min-width: 0; overflow: hidden; }
.user-name { font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .7rem; color: var(--text-4); white-space: nowrap; }
.signout-btn {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: var(--r-sm);
  color: var(--text-4); display: flex; align-items: center; justify-content: center;
  transition: all var(--tr-fast);
}
.signout-btn:hover { background: var(--danger-dim); color: var(--danger); }
.signout-btn[hidden] { display: none; }
.sidebar.collapsed .user-info,
.sidebar.collapsed .signout-btn { display: none; }

/* ─── 8. Main Wrapper ─────────────────────────────────────────── */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ─── 9. Topbar ───────────────────────────────────────────────── */
.topbar {
  flex-shrink: 0; height: var(--topbar-h);
  background: var(--navy); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: var(--sp-4);
  padding: 0 var(--sp-6);
  position: relative; z-index: 100;
}
.topbar-mobile-btn {
  display: none; width: 36px; height: 36px; border-radius: var(--r-md);
  color: var(--text-3); align-items: center; justify-content: center;
  transition: all var(--tr-fast);
}
.topbar-mobile-btn:hover { background: var(--surface); color: var(--text); }
.topbar-page-title { font-size: .925rem; font-weight: 600; color: var(--text); flex-shrink: 0; white-space: nowrap; }
.topbar-search {
  flex: 1; max-width: 400px; display: flex; align-items: center;
  gap: var(--sp-2); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-full); padding: 0 var(--sp-4);
  transition: border-color var(--tr-fast);
}
.topbar-search:focus-within { border-color: var(--blue); }
.topbar-search-icon { flex-shrink: 0; width: 16px; height: 16px; color: var(--text-4); }
.topbar-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: .875rem; padding: .5rem 0;
}
.topbar-search input::placeholder { color: var(--text-4); }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-2); }
.topbar-icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: var(--r-md);
  color: var(--text-3); display: flex; align-items: center; justify-content: center;
  transition: all var(--tr-fast);
}
.topbar-icon-btn:hover { background: var(--surface); color: var(--text); }
.topbar-icon-btn svg { width: 18px; height: 18px; }
.topbar-badge {
  position: absolute; top: 4px; right: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: .65rem; font-weight: 700;
  border-radius: 99px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--navy);
}
.topbar-badge[hidden] { display: none; }
.lang-toggle-btn {
  padding: .3rem .7rem; border: 1px solid var(--border-2); border-radius: var(--r-full);
  color: var(--text-3); font-size: .78rem; font-weight: 600; letter-spacing: .03em;
  transition: all var(--tr-fast);
}
.lang-toggle-btn:hover { border-color: var(--blue); color: var(--blue-bright); }
.topbar-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 700; color: #fff; cursor: pointer;
  transition: box-shadow var(--tr-fast);
}
.topbar-avatar:hover { box-shadow: 0 0 0 2px var(--blue); }

/* Demo banner */
.env-banner {
  background: var(--warning-dim); border-bottom: 1px solid rgba(245,158,11,.3);
  color: var(--warning); font-size: .8rem; font-weight: 600;
  padding: .4rem var(--sp-6); text-align: center;
}
.env-banner[hidden] { display: none; }

/* ─── 10. Content Area ────────────────────────────────────────── */
.content-area {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  background: var(--bg);
}
.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }
.view { display: none; height: 100%; }
.view.active { display: flex; flex-direction: column; }

/* ─── 11. Page Header Component ───────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-4);
  padding: var(--sp-8) var(--sp-8) var(--sp-6);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.page-header-info { display: flex; flex-direction: column; gap: 4px; }
.page-header-title { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.page-header-sub { font-size: .875rem; color: var(--text-3); }
.page-header-actions { display: flex; align-items: center; gap: var(--sp-2); }
.page-body { flex: 1; padding: var(--sp-6) var(--sp-8); overflow-y: auto; }
.page-body::-webkit-scrollbar { width: 4px; }
.page-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ─── 12. Dashboard / Welcome State ──────────────────────────── */
.assistant-view { display: flex; flex-direction: column; height: 100%; }
.assistant-welcome {
  flex: 1; display: flex; flex-direction: column; overflow-y: auto;
  padding: var(--sp-8) var(--sp-8) var(--sp-6);
}
.welcome-hero {
  margin-bottom: var(--sp-8);
}
.welcome-ai-badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: .35rem var(--sp-3); background: var(--blue-dim); border: 1px solid rgba(47,107,255,.3);
  border-radius: var(--r-full); font-size: .78rem; color: var(--blue-bright);
  font-weight: 600; letter-spacing: .03em; margin-bottom: var(--sp-4);
}
.welcome-ai-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(.85)} }
.welcome-title { font-size: 1.9rem; font-weight: 700; color: var(--text); line-height: 1.25; margin-bottom: var(--sp-2); }
.welcome-subtitle { font-size: 1rem; color: var(--text-3); }
.welcome-search {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-lg); padding: .875rem var(--sp-5);
  margin: var(--sp-6) 0; transition: all var(--tr-fast); max-width: 600px;
}
.welcome-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
.welcome-search-icon { flex-shrink: 0; width: 20px; height: 20px; color: var(--text-4); }
.welcome-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: .95rem;
}
.welcome-search input::placeholder { color: var(--text-4); }

/* Stats cards */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-4); margin-bottom: var(--sp-8);
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-3);
  transition: all var(--tr-fast);
}
.stat-card:hover { border-color: var(--border-2); background: var(--surface-2); transform: translateY(-1px); }
.stat-card-icon {
  width: 36px; height: 36px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon svg { width: 18px; height: 18px; }
.stat-card-icon.blue   { background: var(--blue-dim); color: var(--blue-bright); }
.stat-card-icon.cyan   { background: var(--cyan-dim); color: var(--cyan); }
.stat-card-icon.success { background: var(--success-dim); color: var(--success); }
.stat-card-icon.warning { background: var(--warning-dim); color: var(--warning); }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-3); font-weight: 500; }

/* Quick actions / prompt chips */
.section-label { font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-4); margin-bottom: var(--sp-3); }
.prompts-grid { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-8); }
.prompt-chip {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: .5rem var(--sp-3); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-full); font-size: .825rem; color: var(--text-2);
  transition: all var(--tr-fast); white-space: nowrap;
}
.prompt-chip:hover { border-color: var(--blue); color: var(--blue-bright); background: var(--blue-dim); }
.prompt-chip-icon { width: 14px; height: 14px; flex-shrink: 0; }

/* Quick services */
.quick-services-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-3); margin-bottom: var(--sp-4);
}
.quick-service-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-4); display: flex;
  align-items: center; gap: var(--sp-3); cursor: pointer;
  transition: all var(--tr-fast); text-align: start;
}
.quick-service-card:hover { border-color: var(--blue); background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.quick-service-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--blue-dim); display: flex; align-items: center; justify-content: center;
  color: var(--blue-bright);
}
.quick-service-icon svg { width: 20px; height: 20px; }
.quick-service-name { font-size: .85rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.quick-service-cat { font-size: .72rem; color: var(--text-4); margin-top: 2px; }

/* ─── 13. Chat Interface ──────────────────────────────────────── */
.chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-log {
  flex: 1; overflow-y: auto; padding: var(--sp-5) var(--sp-8);
  display: flex; flex-direction: column; gap: var(--sp-4);
}
.chat-log::-webkit-scrollbar { width: 4px; }
.chat-log::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.chat-empty { color: var(--text-4); font-size: .875rem; text-align: center; padding: var(--sp-8) 0; }
.msg-row { display: flex; flex-direction: column; gap: 4px; }
.msg-row-you { align-items: flex-end; }
.msg-row-bot { align-items: flex-start; }
.msg-header { display: flex; align-items: center; gap: var(--sp-2); font-size: .72rem; color: var(--text-4); margin-bottom: 2px; }
.bot-avatar {
  width: 24px; height: 24px; border-radius: 8px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  display: flex; align-items: center; justify-content: center; font-size: .65rem; font-weight: 800; color: #fff; flex-shrink: 0;
}
.bubble {
  max-width: min(560px, 80%); padding: .75rem var(--sp-4);
  border-radius: var(--r-lg); font-size: .9rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}
.msg-row-you .bubble { background: var(--blue); color: #fff; border-bottom-right-radius: var(--r-sm); }
.msg-row-bot .bubble { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: var(--r-sm); }
[dir="rtl"] .msg-row-you .bubble { border-bottom-right-radius: var(--r-lg); border-bottom-left-radius: var(--r-sm); }
[dir="rtl"] .msg-row-bot .bubble  { border-bottom-left-radius: var(--r-lg);  border-bottom-right-radius: var(--r-sm); }
.msg-error .bubble { background: var(--danger-dim); border-color: rgba(239,68,68,.3); color: var(--danger); }
.typing-indicator { display: flex; align-items: center; gap: 5px; padding: .875rem var(--sp-4); }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); animation: typing 1.4s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: .2s; }
.typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,80%,100%{transform:scale(1);opacity:.5} 40%{transform:scale(1.3);opacity:1} }

/* UI widgets */
.ui-row { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3) 0; align-items: flex-start; max-width: 560px; }
.ui-hint { font-size: .825rem; color: var(--text-3); }
.ui-btns { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ui-btn { padding: .5rem var(--sp-4); border-radius: var(--r-md); font-size: .85rem; font-weight: 500; transition: all var(--tr-fast); }
.ui-btn-primary  { background: var(--blue); color: #fff; }
.ui-btn-primary:hover  { background: var(--blue-bright); }
.ui-btn-secondary { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-2); }
.ui-btn-secondary:hover { background: var(--surface-4); color: var(--text); }
.ui-btn-option   { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.ui-btn-option:hover { border-color: var(--blue); color: var(--blue-bright); }
.otp-input {
  width: 160px; padding: .5rem var(--sp-3); background: var(--surface-2);
  border: 1px solid var(--border-2); border-radius: var(--r-md);
  color: var(--text); font-size: 1.2rem; letter-spacing: .2em; text-align: center;
}
.otp-input:focus { outline: none; border-color: var(--blue); }

/* Composer */
.chat-composer-wrap {
  flex-shrink: 0;
  padding: var(--sp-4) var(--sp-8) max(var(--sp-6), env(safe-area-inset-bottom, var(--sp-6)));
  background: linear-gradient(to top, var(--bg) 80%, transparent);
}
.chat-composer {
  display: flex; align-items: flex-end; gap: var(--sp-2);
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--r-xl); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4);
  box-shadow: var(--shadow-md);
  transition: border-color var(--tr-fast);
}
.chat-composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
.composer-input {
  flex: 1; background: none; border: none; outline: none; resize: none;
  color: var(--text); font-size: .9rem; line-height: 1.55;
  min-height: 24px; max-height: 140px; padding: .45rem 0;
}
.composer-input::placeholder { color: var(--text-4); }
.composer-input:disabled { cursor: not-allowed; opacity: .5; }
.send-btn {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--tr-fast);
}
.send-btn:hover:not(:disabled) { background: var(--blue-bright); transform: scale(1.05); }
.send-btn:disabled { background: var(--surface-3); color: var(--text-4); cursor: not-allowed; transform: none; }
.send-btn svg { width: 16px; height: 16px; }

/* ─── 14. Self Service ────────────────────────────────────────── */
.ss-view { }
.ss-search-wrap {
  padding: 0 var(--sp-8) var(--sp-6);
  flex-shrink: 0;
}
.ss-search {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: .75rem var(--sp-4);
  max-width: 500px; transition: all var(--tr-fast);
}
.ss-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }
.ss-search-icon { flex-shrink: 0; width: 18px; height: 18px; color: var(--text-4); }
.ss-search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: .9rem; }
.ss-search input::placeholder { color: var(--text-4); }
.ss-body { flex: 1; overflow-y: auto; padding: 0 var(--sp-8) var(--sp-8); }
.ss-body::-webkit-scrollbar { width: 4px; }
.ss-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* Category */
.ss-cat { margin-bottom: var(--sp-8); }
.ss-cat-header {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-4); cursor: pointer; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--border); transition: all var(--tr-fast);
  user-select: none;
}
.ss-cat-header:hover { border-color: var(--border-2); background: var(--surface-2); }
.cat-icon {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
}
.cat-icon svg { width: 22px; height: 22px; }
.cat-icon.hr   { background: rgba(99,102,241,.15); color: #818CF8; }
.cat-icon.fin  { background: rgba(34,197,94,.12);  color: #4ADE80; }
.cat-icon.pro  { background: rgba(245,158,11,.12); color: #FBB347; }
.cat-icon.leg  { background: rgba(168,85,247,.12); color: #C084FC; }
.cat-icon.con  { background: rgba(14,165,233,.12); color: #38BDF8; }
.cat-icon.com  { background: rgba(239,68,68,.12);  color: #F87171; }
.cat-icon.gen  { background: rgba(107,114,128,.15);color: #9CA3AF; }
.cat-info { flex: 1; min-width: 0; }
.cat-name  { font-size: .95rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.cat-desc  { font-size: .78rem; color: var(--text-3); margin-top: 2px; }
.cat-count { flex-shrink: 0; min-width: 24px; height: 24px; padding: 0 var(--sp-2); background: var(--blue-dim); color: var(--blue-bright); font-size: .75rem; font-weight: 700; border-radius: 99px; display: flex; align-items: center; justify-content: center; }
.cat-chevron { flex-shrink: 0; width: 18px; height: 18px; color: var(--text-4); transition: transform var(--tr-base); }
.ss-cat.open .cat-chevron { transform: rotate(180deg); }
.ss-cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-3); padding: var(--sp-3) 0; display: none;
}
.ss-cat.open .ss-cat-grid { display: grid; }
.service-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-4); cursor: pointer;
  transition: all var(--tr-fast); display: flex; flex-direction: column; gap: var(--sp-3);
  text-align: start;
}
.service-card:hover { border-color: var(--blue); background: var(--surface-2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.service-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }
.service-card-icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--r-md); background: var(--blue-dim); color: var(--blue-bright); display: flex; align-items: center; justify-content: center; }
.service-card-icon svg { width: 18px; height: 18px; }
.service-type-badge { padding: .2rem .5rem; border-radius: var(--r-sm); font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.badge-inquiry    { background: var(--cyan-dim); color: var(--cyan); }
.badge-transaction { background: var(--blue-dim); color: var(--blue-bright); }
.badge-request_case { background: var(--warning-dim); color: var(--warning); }
.badge-approval_task { background: rgba(168,85,247,.12); color: #C084FC; }
.service-card-name { font-size: .875rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.service-card-desc { font-size: .775rem; color: var(--text-3); line-height: 1.55; flex: 1; }
.service-card-action {
  display: flex; align-items: center; gap: var(--sp-1);
  color: var(--blue-bright); font-size: .78rem; font-weight: 600;
  padding: .4rem 0; border-top: 1px solid var(--border); margin-top: var(--sp-1);
  transition: gap var(--tr-fast);
}
.service-card:hover .service-card-action { gap: var(--sp-2); }
.service-card-action svg { width: 12px; height: 12px; }
.ss-no-results { text-align: center; padding: var(--sp-10); color: var(--text-3); }
.ss-no-results svg { width: 48px; height: 48px; margin: 0 auto var(--sp-4); color: var(--text-4); }

/* ─── 15. My Requests ─────────────────────────────────────────── */
.req-filters {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-8); border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.filter-btn { padding: .35rem var(--sp-3); border-radius: var(--r-full); font-size: .8rem; font-weight: 500; border: 1px solid var(--border); color: var(--text-3); transition: all var(--tr-fast); }
.filter-btn:hover, .filter-btn.active { border-color: var(--blue); color: var(--blue-bright); background: var(--blue-dim); }
.req-list { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-8); }
.req-list::-webkit-scrollbar { width: 4px; }
.req-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
.req-item {
  display: grid; grid-template-columns: auto 1fr auto auto;
  align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); margin-bottom: var(--sp-3);
  transition: all var(--tr-fast); cursor: pointer;
}
.req-item:hover { border-color: var(--border-2); background: var(--surface-2); }
.req-item-icon { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--blue-dim); color: var(--blue-bright); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.req-item-icon svg { width: 20px; height: 20px; }
.req-item-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.req-item-meta { font-size: .75rem; color: var(--text-3); margin-top: 2px; }
.req-item-date { font-size: .75rem; color: var(--text-4); text-align: end; }

/* Status badges */
.status-badge { padding: .25rem .65rem; border-radius: var(--r-full); font-size: .72rem; font-weight: 600; }
.status-submitted   { background: var(--blue-dim); color: var(--blue-bright); }
.status-review      { background: var(--warning-dim); color: var(--warning); }
.status-approved    { background: var(--success-dim); color: var(--success); }
.status-completed   { background: var(--success-dim); color: var(--success); }
.status-rejected    { background: var(--danger-dim); color: var(--danger); }
.status-draft       { background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border-2); }
.status-pending     { background: var(--cyan-dim); color: var(--cyan); }

/* ─── 16. Empty States ────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--sp-10); text-align: center; gap: var(--sp-3);
}
.empty-icon { width: 64px; height: 64px; color: var(--text-4); margin-bottom: var(--sp-2); }
.empty-icon svg { width: 100%; height: 100%; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text-2); }
.empty-sub { font-size: .85rem; color: var(--text-3); max-width: 320px; line-height: 1.6; }

/* ─── 17. Approvals ───────────────────────────────────────────── */
.appr-queue { display: flex; flex-direction: column; gap: var(--sp-3); }
.appr-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-5);
  display: flex; align-items: center; gap: var(--sp-4);
  transition: all var(--tr-fast);
}
.appr-card:hover { border-color: var(--border-2); }
.appr-requester-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%); display: flex; align-items: center; justify-content: center; font-size: .85rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.appr-info { flex: 1; }
.appr-service { font-size: .875rem; font-weight: 600; color: var(--text); }
.appr-meta { font-size: .77rem; color: var(--text-3); margin-top: 2px; }
.appr-actions { display: flex; gap: var(--sp-2); }
.btn-approve { padding: .4rem .875rem; background: var(--success); color: #fff; border-radius: var(--r-md); font-size: .8rem; font-weight: 600; transition: opacity var(--tr-fast); }
.btn-reject  { padding: .4rem .875rem; background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(239,68,68,.3); border-radius: var(--r-md); font-size: .8rem; font-weight: 600; transition: all var(--tr-fast); }
.btn-approve:hover { opacity: .85; }
.btn-reject:hover  { background: var(--danger); color: #fff; }

/* ─── 18. Notifications ───────────────────────────────────────── */
.notify-list { display: flex; flex-direction: column; }
.notify-item {
  display: flex; align-items: flex-start; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border); transition: background var(--tr-fast); cursor: pointer;
}
.notify-item:hover { background: var(--surface); }
.notify-item.unread { background: rgba(47,107,255,.04); }
.notify-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex-shrink: 0; margin-top: 6px; }
.notify-dot.read { background: transparent; border: 1px solid var(--border-2); }
.notify-icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--r-md); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.notify-icon svg { width: 18px; height: 18px; }
.notify-content { flex: 1; }
.notify-title { font-size: .875rem; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.notify-body { font-size: .8rem; color: var(--text-3); line-height: 1.55; }
.notify-time { font-size: .72rem; color: var(--text-4); flex-shrink: 0; }

/* ─── 19. Profile ─────────────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 280px 1fr; gap: var(--sp-6); }
.profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--sp-6); text-align: center; }
.profile-avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: #fff; margin: 0 auto var(--sp-4); box-shadow: 0 8px 24px var(--blue-glow); }
.profile-name { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.profile-title { font-size: .825rem; color: var(--text-3); margin-top: 4px; }
.profile-dept { display: inline-block; margin-top: var(--sp-3); padding: .3rem .875rem; background: var(--blue-dim); color: var(--blue-bright); border-radius: var(--r-full); font-size: .78rem; font-weight: 600; }
.profile-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; margin-bottom: var(--sp-4); }
.profile-section-header { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); font-size: .875rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: var(--sp-2); }
.profile-section-header svg { width: 16px; height: 16px; color: var(--text-3); }
.profile-row { display: flex; padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--border); }
.profile-row:last-child { border-bottom: none; }
.profile-row-label { flex: 0 0 160px; font-size: .8rem; color: var(--text-4); font-weight: 500; }
.profile-row-value { flex: 1; font-size: .85rem; color: var(--text); }
.profile-pref-row { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--border); }
.profile-pref-row:last-child { border-bottom: none; }
.profile-pref-label { font-size: .85rem; color: var(--text-2); }
.profile-note { font-size: .875rem; color: var(--text-3); line-height: 1.7; }

/* ─── 20. Buttons & Components ────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: var(--sp-2); padding: .55rem var(--sp-4); border-radius: var(--r-md); font-size: .875rem; font-weight: 600; transition: all var(--tr-fast); white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-bright); box-shadow: 0 4px 12px var(--blue-glow); }
.btn-secondary { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border-2); }
.btn-secondary:hover { background: var(--surface-3); color: var(--text); }
.btn-ghost { color: var(--text-3); }
.btn-ghost:hover { background: var(--surface); color: var(--text); }
.btn-danger { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(239,68,68,.2); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: .35rem var(--sp-3); font-size: .8rem; }
.btn-lg { padding: .75rem var(--sp-6); font-size: 1rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── 21. Mobile Nav Overlay ──────────────────────────────────── */
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 199; }
.mobile-overlay.show { display: block; }

/* ─── 22. Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .topbar-search { display: none; }
  .welcome-search { display: none; }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 200; transform: translateX(-100%); transition: transform var(--tr-slow); width: var(--sidebar-w) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  [dir="rtl"] .sidebar.mobile-open { transform: translateX(0); }
  .topbar-mobile-btn { display: flex; }
  .main-wrapper { width: 100%; }
  .page-header { padding: var(--sp-5); }
  .page-body { padding: var(--sp-4) var(--sp-5); }
  .chat-log { padding: var(--sp-4); }
  .chat-composer-wrap { padding: var(--sp-3) var(--sp-4) max(var(--sp-5), env(safe-area-inset-bottom)); }
  .ss-body { padding: 0 var(--sp-4) var(--sp-6); }
  .ss-search-wrap { padding: 0 var(--sp-4) var(--sp-4); }
  .req-list { padding: var(--sp-3) var(--sp-4); }
  .req-item { grid-template-columns: auto 1fr auto; }
  .req-item-date { display: none; }
  .assistant-welcome { padding: var(--sp-5); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-services-grid { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 var(--sp-4); }
  .ss-cat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .ss-cat-grid { grid-template-columns: 1fr; }
  /* Prompt chips scroll horizontally rather than wrapping to multiple cramped rows */
  .prompts-grid {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: var(--sp-2); scrollbar-width: none;
  }
  .prompts-grid::-webkit-scrollbar { display: none; }
  .prompt-chip { flex-shrink: 0; }
  .topbar-actions { gap: var(--sp-1); }
  .welcome-title { font-size: 1.5rem; }
}

/* ─── 23. RTL / Arabic ────────────────────────────────────────── */
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .nav-item.active::before { inset-inline-start: unset; inset-inline-end: 0; border-radius: 3px 0 0 3px; }
[dir="rtl"] .topbar { }
[dir="rtl"] .welcome-search { }
[dir="rtl"] .ss-cat-header { }
[dir="rtl"] .service-card { }
[dir="rtl"] .req-item { }
[dir="rtl"] .msg-row-you { align-items: flex-start; }
[dir="rtl"] .msg-row-bot { align-items: flex-end; }
[dir="rtl"] .profile-row-label { }
[dir="rtl"] .chat-log { }
[dir="rtl"] [lang="ar"] { line-height: 1.75; }

/* ─── 24. Animations / Transitions ───────────────────────────── */
.fade-in { animation: fadeIn .25s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.slide-in { animation: slideIn .3s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
[dir="rtl"] .slide-in { animation-name: slideInRTL; }
@keyframes slideInRTL { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

/* ─── 25. Skeleton loading ────────────────────────────────────── */
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--r-md); }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ─── 26. Scrollbar global ────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }

/* ═══════════════════════════════════════════════════════════════════
   TEMPORARY PRODUCTION TEST ACCESS — auth form styles
   Remove this section when enterprise SSO is connected.
   ═══════════════════════════════════════════════════════════════════ */

.auth-section-divider {
  display: flex; align-items: center; gap: var(--sp-3);
  margin: var(--sp-5) 0;
}
.auth-section-divider::before,
.auth-section-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.auth-section-divider-label {
  font-size: .72rem; font-weight: 600; color: var(--text-4);
  text-transform: uppercase; letter-spacing: .07em; white-space: nowrap;
}

/* Test-access form block */
.auth-test-block { text-align: start; }
.auth-test-header {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.auth-test-header-icon {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: var(--r-md);
  background: var(--warning-dim); color: var(--warning);
  display: flex; align-items: center; justify-content: center;
}
.auth-test-header-icon svg { width: 16px; height: 16px; }
.auth-test-header-text { flex: 1; }
.auth-test-title { font-size: .875rem; font-weight: 600; color: var(--text); line-height: 1.2; }
.auth-test-sub   { font-size: .72rem; color: var(--text-4); margin-top: 2px; }

/* Form fields */
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-3); }
.auth-field-label { font-size: .78rem; font-weight: 600; color: var(--text-2); }
.auth-field-input {
  width: 100%; padding: .65rem var(--sp-3);
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--r-md); color: var(--text); font-size: .9rem;
  outline: none; transition: border-color var(--tr-fast);
}
.auth-field-input::placeholder { color: var(--text-4); }
.auth-field-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-dim); }

/* Submit button */
.auth-test-btn {
  width: 100%; padding: .75rem var(--sp-4); border-radius: var(--r-md);
  background: var(--blue); color: #fff; font-size: .9rem; font-weight: 600;
  transition: all var(--tr-fast); margin-top: var(--sp-1);
}
.auth-test-btn:hover:not(:disabled) { background: var(--blue-bright); box-shadow: 0 4px 12px var(--blue-glow); }
.auth-test-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Error message */
.auth-error {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--danger-dim); border: 1px solid rgba(239,68,68,.25);
  border-radius: var(--r-md); padding: .6rem var(--sp-3); margin-top: var(--sp-3);
  font-size: .82rem; color: var(--danger);
}
.auth-error svg { flex-shrink: 0; width: 15px; height: 15px; }
.auth-error[hidden] { display: none; }

/* Production test banner (inside portal) */
.env-banner.env-banner-test {
  background: rgba(245,158,11,.12); border-bottom: 1px solid rgba(245,158,11,.25);
  color: var(--warning); font-size: .8rem; font-weight: 600;
  padding: .45rem var(--sp-6); text-align: center;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-2);
}
.env-banner.env-banner-test svg { width: 14px; height: 14px; }

/* ─── Mobile auth layout (≤ 600px) ───────────────────────────────────────────
   Compact layout so Sign In is always reachable without excessive scroll.
   Desktop auth card is unchanged above this breakpoint.                       */
@media (max-width: 600px) {
  .auth-shell { padding: var(--sp-4) var(--sp-3); }
  .auth-panel {
    border-radius: var(--r-lg);
    padding: var(--sp-5) var(--sp-4);
    margin: var(--sp-3) 0;
  }
  .auth-logo-wrap {
    width: 56px; height: 56px; border-radius: 16px;
    margin-bottom: var(--sp-3); box-shadow: 0 6px 18px var(--blue-glow);
  }
  .auth-logo-svg { width: 32px; height: 32px; }
  .auth-product-name { font-size: 1.6rem; }
  .auth-tagline { font-size: .85rem; margin-bottom: var(--sp-4); }
  .auth-divider { margin: var(--sp-4) 0; }
  .auth-pending-icon { width: 36px; height: 36px; margin-bottom: var(--sp-2); }
  .auth-pending-title { font-size: 1rem; }
  .auth-pending-body { font-size: .82rem; line-height: 1.6; margin-bottom: var(--sp-3); }
  .auth-sso-btn { padding: .7rem var(--sp-4); font-size: .85rem; }
  .auth-section-divider { margin: var(--sp-3) 0; }
  .auth-test-header { margin-bottom: var(--sp-3); }
  .auth-test-title { font-size: .825rem; }
  .auth-field { margin-bottom: var(--sp-2); }
  .auth-field-input { padding: .6rem var(--sp-3); font-size: .875rem; }
  .auth-test-btn {
    padding: .7rem var(--sp-4); min-height: 44px; /* ensure touch target ≥ 44px */
  }
  .auth-footer-bar { margin-top: var(--sp-4); font-size: .75rem; }
}


/* Approval request detail modal */
.appr-card-clickable{cursor:pointer;transition:border-color .15s ease,transform .15s ease,background .15s ease}.appr-card-clickable:hover{border-color:#315486;background:#142b49;transform:translateY(-1px)}
.approval-modal-backdrop{position:fixed;inset:0;background:rgba(2,8,18,.76);z-index:5000;display:flex;align-items:center;justify-content:center;padding:28px;backdrop-filter:blur(3px)}
.approval-modal{width:min(920px,96vw);max-height:90vh;overflow:auto;background:#0e1b2d;border:1px solid #29415f;border-radius:18px;box-shadow:0 24px 80px rgba(0,0,0,.45)}
.approval-modal-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;padding:22px 24px;background:#12243d;border-bottom:1px solid #29415f}.approval-modal-title{font-size:21px;font-weight:750;color:#f7f9fd}.approval-modal-close{border:0;background:transparent;color:#9bb0cb;font-size:30px;line-height:1;cursor:pointer;padding:0 4px}.approval-modal-close:hover{color:#fff}
.approval-modal-body{padding:22px 24px;display:grid;gap:18px}.approval-detail-section{background:#101f34;border:1px solid #243a59;border-radius:14px;padding:18px}.approval-detail-heading{margin:0 0 14px;font-size:16px;color:#fff}.approval-detail-row{display:grid;grid-template-columns:minmax(180px,34%) 1fr;gap:18px;padding:10px 0;border-top:1px solid rgba(95,124,160,.22)}.approval-detail-row:nth-child(2){border-top:0}.approval-detail-label{color:#8fa8c8;font-size:14px}.approval-detail-value{color:#f5f7fb;font-weight:600;word-break:break-word}.approval-modal-foot{position:sticky;bottom:0;display:flex;justify-content:flex-end;gap:10px;padding:16px 24px;background:#12243d;border-top:1px solid #29415f}
@media(max-width:700px){.approval-modal-backdrop{padding:10px}.approval-detail-row{grid-template-columns:1fr;gap:4px}.approval-modal-foot{flex-wrap:wrap}.approval-modal-foot button{flex:1 1 30%}}

.approval-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:18px}.approval-tabs{display:flex;gap:8px}.approval-tab{padding:9px 14px;border:1px solid #29415f;border-radius:999px;background:transparent;color:#9bb0cb;font-weight:650;cursor:pointer}.approval-tab.active{color:#5da2ff;border-color:#3478f6;background:rgba(52,120,246,.10)}.approval-history-filters{display:flex;gap:10px;flex-wrap:wrap}.approval-filter-select,.approval-filter-input{background:#101f34;border:1px solid #29415f;color:#f5f7fb;border-radius:10px;padding:9px 12px;outline:none}.approval-filter-input{min-width:240px}.coverage-advisory{border-color:rgba(245,158,11,.34);background:rgba(245,158,11,.055)}.coverage-advisory-note{margin-top:14px;padding:12px 14px;border-radius:10px;background:rgba(245,158,11,.10);color:#f4c56a;line-height:1.5}.coverage-overlap-list{margin-top:12px;display:grid;gap:8px}.coverage-overlap-item{padding:10px 12px;border:1px solid rgba(95,124,160,.22);border-radius:9px;color:#cbd8e8;background:#0d1a2b;font-size:13px}


/* Request follow-up summary */
.request-followup { margin-top: var(--sp-5); border: 1px solid var(--border); background: var(--surface-1); border-radius: 16px; overflow: hidden; }
.request-followup-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 20px; border-bottom:1px solid var(--border); }
.request-followup-title { margin:0 0 4px; }
.request-followup-sub { margin:0; color:var(--text-3); font-size:.85rem; }
.request-followup-viewall { border:1px solid var(--border-strong); background:transparent; color:var(--blue-2); font-weight:600; padding:9px 13px; border-radius:10px; cursor:pointer; white-space:nowrap; }
.request-followup-viewall:hover { background:var(--blue-dim); border-color:var(--blue); }
.request-followup-list { display:flex; flex-direction:column; max-height:420px; overflow:auto; }
.request-followup-card { width:100%; border:0; border-bottom:1px solid var(--border); background:transparent; color:inherit; text-align:left; padding:18px 20px; cursor:pointer; font:inherit; }
.request-followup-card:last-child { border-bottom:0; }
.request-followup-card:hover { background:var(--surface-2); }
.request-followup-card-top { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:13px; }
.request-followup-type { color:var(--text); font-size:.96rem; font-weight:700; }
.request-followup-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px 24px; }
.request-followup-row,.request-followup-status { display:grid; grid-template-columns:120px 1fr; gap:12px; align-items:start; }
.request-followup-status { margin-top:11px; padding-top:11px; border-top:1px dashed var(--border); }
.request-followup-key { color:var(--text-3); font-size:.78rem; font-weight:600; }
.request-followup-value { color:var(--text); font-size:.84rem; font-weight:600; }
.request-followup-status-text { color:var(--text-2); font-size:.86rem; line-height:1.45; font-weight:600; }
.request-followup-foot { color:var(--text-4); font-size:.74rem; margin-top:10px; }
.request-followup-empty { padding:20px; color:var(--text-3); font-size:.86rem; }
[dir="rtl"] .request-followup-card { text-align:right; }
@media (max-width: 720px) {
  .request-followup-head { align-items:flex-start; flex-direction:column; }
  .request-followup-grid { grid-template-columns:1fr; }
  .request-followup-row,.request-followup-status { grid-template-columns:100px 1fr; }
  .request-followup-viewall { width:100%; }
}

/* v12: Request Follow-up dashboard must remain visible even when empty */
#view-assistant .request-followup { display:block !important; width:100%; margin:28px 0 30px; }
#view-assistant .request-followup-empty { min-height:62px; display:flex; align-items:center; }

#view-assistant .request-followup,
#view-assistant .prompts-grid {
    flex-shrink: 0;
}

/* Approvals history + team leave advisory */
.appr-info { min-width: 0; overflow-wrap: anywhere; }
.appr-actions { align-items: center; flex-shrink: 0; }
.approval-history-filters[hidden] { display: none; }
.coverage-advisory-note.is-clear { background: rgba(52,120,246,.08); color: #9bb0cb; }
.coverage-advisory-foot { margin-top: 10px; font-size: 13px; color: #8fa8c8; line-height: 1.5; }
/* Request Information lifecycle */
.info-request { border-color: rgba(52,120,246,.35); }
.info-request > .approval-detail-label { margin-top: 10px; }
.info-question { margin-top: 6px; padding: 10px 12px; border-radius: 10px; background: rgba(52,120,246,.08); border: 1px solid rgba(52,120,246,.25); color: #f5f7fb; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.info-form { margin-top: 12px; display: grid; gap: 8px; }
.info-form .btn-approve:disabled { opacity: .5; cursor: not-allowed; }
.info-form-label { color: #8fa8c8; font-size: 14px; }
.info-form textarea { width: 100%; box-sizing: border-box; min-height: 96px; resize: vertical; background: #0d1a2b; border: 1px solid #29415f; border-radius: 10px; color: #f5f7fb; padding: 10px 12px; font: inherit; line-height: 1.5; }
.info-form textarea:focus { outline: none; border-color: #3478f6; }
.info-form-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.info-error { color: #f87171; font-size: 13px; min-height: 1em; }
.info-success { padding: 12px 14px; border-radius: 10px; background: rgba(34,197,94,.10); color: #86efac; line-height: 1.5; }
.info-banner { padding: 12px 14px; border-radius: 10px; background: rgba(245,158,11,.10); color: #f4c56a; line-height: 1.5; border: 1px solid rgba(245,158,11,.30); }
.appr-card-waiting { opacity: .85; }
@media (max-width: 600px) {
  .appr-card { flex-wrap: wrap; align-items: flex-start; }
  .appr-info { flex-basis: calc(100% - 56px); }
  .appr-actions { width: 100%; justify-content: flex-end; }
}
