/* MUNJIZ v4 — Design System + Dark Mode + Auth + B2B SaaS */
:root {
  --b50: #eef4ff;
  --b100: #d9e6ff;
  --b200: #bcd4ff;
  --b300: #8eb8ff;
  --b400: #5991ff;
  --b500: #336dff;
  --b600: #1651f5;
  --b700: #0f3de0;
  --b800: #1233b6;
  --s50: #f8fafc;
  --s100: #f1f5f9;
  --s200: #e2e8f0;
  --s300: #cbd5e1;
  --s400: #94a3b8;
  --s500: #64748b;
  --s600: #475569;
  --s700: #334155;
  --s800: #1e293b;
  --s900: #0f172a;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
  --purple: #a855f7;
  --sidebar-w: 265px;
  --sidebar-bg1: #0f172a;
  --sidebar-bg2: #131c33;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --border: #e5e7eb;
  --border2: #f1f3f5;
  --text: #0f172a;
  --text-sub: #475569;
  --text-muted: #94a3b8;
  --r-sm: 10px;
  --r-md: 14px;
  --r-xl: 20px;
  --sh-xs: 0 1px 3px rgba(0, 0, 0, .04);
  --sh-md: 0 4px 12px -2px rgba(0, 0, 0, .07);
  --sh-lg: 0 12px 32px -6px rgba(0, 0, 0, .09);
  --sh-xl: 0 24px 56px -12px rgba(0, 0, 0, .14);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

[data-theme="dark"] {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #1c2330;
  --border: #30363d;
  --border2: #21262d;
  --text: #e6edf3;
  --text-sub: #8b949e;
  --text-muted: #484f58;
  --s50: #1c2330;
  --s100: #21262d;
  --s200: #30363d;
  --s300: #484f58;
  --s400: #6e7681;
  --s500: #8b949e;
  --s600: #b1bac4;
  --s700: #c9d1d9;
  --s800: #e6edf3;
  --s900: #f0f3f6;
  --b50: rgba(51, 109, 255, .08);
  --b100: rgba(51, 109, 255, .14);
  --b200: rgba(51, 109, 255, .2);
  --sh-xs: 0 1px 4px rgba(0, 0, 0, .25);
  --sh-md: 0 4px 16px -2px rgba(0, 0, 0, .35);
  --sh-lg: 0 12px 36px -8px rgba(0, 0, 0, .4);
  --sh-xl: 0 24px 60px -12px rgba(0, 0, 0, .5);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .35s, color .35s;
  min-height: 100vh;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

textarea,
input,
select {
  font-family: inherit;
  color: inherit;
}

::-webkit-scrollbar {
  width: 6px
}

::-webkit-scrollbar-track {
  background: transparent
}

::-webkit-scrollbar-thumb {
  background: var(--s300);
  border-radius: 10px
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

/* ===== AUTH OVERLAY ===== */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s, visibility .4s;
}

.auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #1651f5 100%);
}

.auth-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(51, 109, 255, .2) 0%, transparent 70%),
    radial-gradient(ellipse at 70% 80%, rgba(168, 85, 247, .12) 0%, transparent 60%);
}

.auth-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 40px 38px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .35);
  border: 1px solid var(--border);
  animation: popIn .4s var(--spring);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo .logo-shape {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--b600), var(--b500));
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(22, 81, 245, .3);
}

.auth-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.auth-logo p {
  font-size: .82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.auth-form {
  display: none;
  animation: fadeUp .3s var(--ease);
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.auth-sub {
  font-size: .84rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.auth-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .88rem;
  background: var(--s50);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--b400);
  box-shadow: 0 0 0 3px rgba(51, 109, 255, .12);
}

.role-selector {
  display: flex;
  gap: 8px;
}

.role-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--s50);
  transition: all .2s;
}

.role-btn:hover {
  border-color: var(--b300);
}

.role-btn.active {
  border-color: var(--b500);
  background: var(--b50);
  color: var(--b600);
}

[data-theme="dark"] .role-btn.active {
  background: rgba(51, 109, 255, .12);
  color: var(--b300);
}

/* WAVE GROUP ANIMATED INPUTS (Signup) */
.wave-group {
  position: relative;
  margin-bottom: 24px;
}

.wave-group .input {
  font-size: .88rem;
  padding: 10px 10px 10px 5px;
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: inherit;
}

.wave-group .input:focus {
  outline: none;
}

.wave-group label {
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 500;
  position: absolute;
  pointer-events: none;
  left: 5px;
  top: 10px;
  display: flex;
}

.wave-group .label-char {
  transition: 0.2s ease all;
  transition-delay: calc(var(--index) * .05s);
}

.wave-group .input:focus~label .label-char,
.wave-group .input:valid~label .label-char {
  transform: translateY(-20px);
  font-size: .75rem;
  color: var(--b500);
}

.wave-group .bar {
  position: relative;
  display: block;
  width: 100%;
}

.wave-group .bar:before,
.wave-group .bar:after {
  content: '';
  height: 2px;
  width: 0;
  bottom: 1px;
  position: absolute;
  background: var(--b500);
  transition: 0.2s ease all;
}

.wave-group .bar:before {
  left: 50%;
}

.wave-group .bar:after {
  right: 50%;
}

.wave-group .input:focus~.bar:before,
.wave-group .input:focus~.bar:after {
  width: 50%;
}

[data-theme="dark"] .wave-group .input {
  border-bottom-color: var(--s400);
}

[data-theme="dark"] .wave-group .input:focus~label .label-char,
[data-theme="dark"] .wave-group .input:valid~label .label-char {
  color: var(--b400);
}

[data-theme="dark"] .wave-group .bar:before,
[data-theme="dark"] .wave-group .bar:after {
  background: var(--b400);
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
  padding: 13px;
}

.auth-switch {
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 18px;
}

.auth-link {
  color: var(--b500);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: .82rem;
}

.auth-error {
  font-size: .78rem;
  color: var(--red);
  font-weight: 600;
  margin-top: -8px;
  margin-bottom: 10px;
  display: none;
}

.auth-error.show {
  display: block;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(195deg, var(--sidebar-bg1), var(--sidebar-bg2));
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform .35s var(--ease);
}

.sidebar-brand {
  padding: 24px 22px 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-shape {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--b600), var(--b400));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 16px rgba(22, 81, 245, .3);
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.brand-tag {
  font-size: .66rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .4);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.nav-section-label {
  padding: 20px 22px 8px;
  font-size: .63rem;
  font-weight: 700;
  color: rgba(255, 255, 255, .22);
  text-transform: uppercase;
  letter-spacing: .1em;
}

.sidebar-nav {
  flex: 1;
  padding: 0 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: .87rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .5);
  transition: all .18s;
  position: relative;
  width: 100%;
  text-align: left;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: var(--b400);
  transition: height .2s;
}

.nav-item:hover {
  color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .06);
}

.nav-item.active {
  color: #fff;
  background: rgba(59, 130, 246, .15);
}

.nav-item.active::before {
  height: 20px;
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 100px;
  background: var(--b500);
  color: #fff;
  font-size: .66rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, .07);
  margin: 8px 14px;
}

.sidebar-logout-row {
  padding: 0 10px 4px;
}

.logout-btn {
  color: rgba(255, 255, 255, .4) !important;
}

.logout-btn:hover {
  color: #ef4444 !important;
  background: rgba(239, 68, 68, .1) !important;
}

.sidebar-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
}

.sidebar-theme-label {
  font-size: .8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .45);
}

.theme-toggle-pill {
  width: 44px;
  height: 24px;
  border-radius: 100px;
  background: rgba(255, 255, 255, .1);
  position: relative;
  transition: background .25s;
  border: 1px solid rgba(255, 255, 255, .08);
}

.theme-toggle-pill.active {
  background: var(--b500);
  border-color: var(--b500);
}

.pill-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .25s var(--spring);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

.theme-toggle-pill.active .pill-thumb {
  transform: translateX(20px);
}

.sidebar-footer {
  padding: 14px 16px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .06);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--b500), var(--purple));
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-name {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.user-role {
  display: block;
  font-size: .68rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .4);
}

.online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  margin-left: auto;
  box-shadow: 0 0 8px rgba(34, 197, 94, .5);
  animation: glowPulse 2s ease infinite;
}

@keyframes glowPulse {

  0%,
  100% {
    box-shadow: 0 0 8px rgba(34, 197, 94, .5)
  }

  50% {
    box-shadow: 0 0 16px rgba(34, 197, 94, .2)
  }
}

/* MOBILE */
.mobile-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--sidebar-bg1);
  align-items: center;
  padding: 0 16px;
  z-index: 99;
  gap: 14px;
}

.hamburger {
  width: 36px;
  height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: var(--r-sm);
}

.hamburger span {
  width: 20px;
  height: 2px;
  background: rgba(255, 255, 255, .7);
  border-radius: 2px;
  transition: all .25s;
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-title {
  flex: 1;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}

.mobile-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .6);
}

.mobile-theme-btn:hover {
  background: rgba(255, 255, 255, .1)
}

.mobile-theme-btn .icon-moon {
  display: none
}

[data-theme="dark"] .mobile-theme-btn .icon-sun {
  display: none
}

[data-theme="dark"] .mobile-theme-btn .icon-moon {
  display: block
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 95;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* MAIN AREA */
.main {
  margin-left: var(--sidebar-w);
  padding: 32px 36px 48px;
  min-height: 100vh;
  transition: margin-left .35s;
}

.page {
  display: none;
  animation: fadeUp .35s var(--ease);
}

.page.active {
  display: block;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-heading {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.greeting-name {
  background: linear-gradient(135deg, var(--b500), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-sub {
  font-size: .88rem;
  color: var(--text-sub);
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 100px;
  font-size: .76rem;
  font-weight: 600;
  background: var(--s100);
  color: var(--s500);
}

.status-chip.online {
  background: rgba(34, 197, 94, .08);
  color: var(--green);
}

.chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: glowPulse 2s ease infinite;
}

/* STATS */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .02);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 12px -2px rgba(0, 0, 0, .05);
  border-color: var(--b300);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue {
  background: var(--b50);
  color: var(--b600);
}

.stat-icon.purple {
  background: #faf5ff;
  color: var(--purple);
}

.stat-icon.green {
  background: #f0fdf4;
  color: var(--green);
}

.stat-icon.amber {
  background: #fffbeb;
  color: var(--amber);
}

[data-theme="dark"] .stat-icon.blue {
  background: rgba(51, 109, 255, .12);
  color: var(--b400);
}

[data-theme="dark"] .stat-icon.purple {
  background: rgba(168, 85, 247, .12);
  color: #c084fc;
}

[data-theme="dark"] .stat-icon.green {
  background: rgba(34, 197, 94, .12);
  color: #4ade80;
}

[data-theme="dark"] .stat-icon.amber {
  background: rgba(245, 158, 11, .12);
  color: #fbbf24;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}

.stat-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
}

/* QUICK TEMPLATES (Employee) */
.template-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.template-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.template-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-sub);
  box-shadow: var(--sh-xs);
  transition: all .2s;
}

.template-chip:hover {
  border-color: var(--b300);
  color: var(--b600);
  background: var(--b50);
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
}

[data-theme="dark"] .template-chip:hover {
  background: rgba(51, 109, 255, .1);
  color: var(--b300);
}

/* GLASS CARD */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--sh-xs);
}

.glass-card:hover {
  box-shadow: var(--sh-md);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border2);
}

.card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-sub);
}

.card-label svg {
  color: var(--b500);
}

.green-label svg {
  color: var(--green);
}

.amber-label svg {
  color: var(--amber);
}

.card-top-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shortcut-hint {
  font-size: .7rem;
  color: var(--text-muted);
  background: var(--s100);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-weight: 500;
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--s50);
  font-size: .68rem;
  font-weight: 600;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--border2);
}

.bottom-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.char-counter {
  font-size: .76rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* TASK INPUT */
.task-section {
  margin-bottom: 0;
}

.input-area {
  position: relative;
  border-bottom: 1px solid var(--border2);
}

.task-input {
  width: 100%;
  min-height: 120px;
  padding: 16px 20px;
  border: none;
  font-size: .9rem;
  color: var(--text);
  background: transparent;
  resize: vertical;
  line-height: 1.8;
}

.task-input::placeholder {
  color: var(--text-muted);
}

.task-input:focus {
  outline: none;
}

.file-drop-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 12px;
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.file-drop-hint svg {
  flex-shrink: 0;
}

.file-browse-btn {
  color: var(--b500);
  font-weight: 700;
  font-size: .78rem;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.input-area.drag-over {
  background: rgba(51, 109, 255, .04);
}

.input-area.drag-over::after {
  content: 'Drop files here';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--b500);
  background: rgba(51, 109, 255, .06);
  border: 2px dashed var(--b400);
  border-radius: var(--r-md);
  pointer-events: none;
}

.attachments-bar {
  padding: 10px 20px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--b50);
  border: 1px solid var(--b200);
  border-radius: 100px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--b700);
  max-width: 220px;
}

[data-theme="dark"] .file-chip {
  background: rgba(51, 109, 255, .12);
  border-color: rgba(51, 109, 255, .25);
  color: var(--b300);
}

.file-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.file-chip-type {
  font-size: .64rem;
  font-weight: 700;
  padding: 1px 5px;
  background: var(--b100);
  border-radius: 4px;
  color: var(--b600);
  text-transform: uppercase;
  flex-shrink: 0;
}

[data-theme="dark"] .file-chip-type {
  background: rgba(51, 109, 255, .2);
  color: var(--b300);
}

.file-chip-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--b500);
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

.file-chip-remove:hover {
  background: var(--b200);
}

.clear-all-btn {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
}

.clear-all-btn:hover {
  background: var(--s100);
  color: var(--red);
}

.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--s100);
  border: 1px solid var(--border);
  transition: all .15s;
}

.attach-btn:hover {
  background: var(--b50);
  border-color: var(--b200);
  color: var(--b600);
}

/* EXECUTE BUTTON (Animated) */
.execute-btn {
  font-family: inherit;
  font-size: .86rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--b600), var(--b500));
  color: white;
  padding: 0.7em 1em;
  padding-left: 0.9em;
  display: flex;
  align-items: center;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(22, 81, 245, .28);
  min-width: 125px;
  /* Bug 10 fix */
}

.execute-btn span {
  display: block;
  margin-left: 0.3em;
  transition: all 0.3s ease-in-out;
}

.execute-btn svg {
  display: block;
  transform-origin: center center;
  transition: transform 0.3s ease-in-out;
}

.execute-btn:hover .svg-wrapper {
  animation: fly-1 0.6s ease-in-out infinite alternate;
}

.execute-btn:hover svg {
  transform: translateX(1.2em) rotate(45deg) scale(1.1);
}

.execute-btn:hover span {
  transform: translateX(5em);
}

.execute-btn:active {
  transform: scale(0.95);
}

.execute-btn:disabled {
  opacity: .5;
  pointer-events: none;
}

@keyframes fly-1 {
  from {
    transform: translateY(0.1em);
  }

  to {
    transform: translateY(-0.1em);
  }
}

/* Stop Button */
.stop-btn {
  font-family: inherit;
  font-size: .86rem;
  font-weight: 700;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
  padding: 0.7em 1.2em;
  display: flex;
  align-items: center;
  gap: 0.4em;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(220, 38, 38, .28);
  transition: all 0.2s;
}

.stop-btn:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  transform: scale(1.03);
}

.stop-btn:active {
  transform: scale(0.95);
}

/* Forgot Password */
.auth-forgot {
  text-align: center;
  margin: 0.3rem 0 0.6rem;
}

.auth-forgot .auth-link {
  font-size: 0.82rem;
  opacity: 0.7;
}

.auth-forgot .auth-link:hover {
  opacity: 1;
}

/* Admin Drawer Actions */
.drawer-admin-actions {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-action-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-action-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--s500);
}

.drawer-role-select {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}

.drawer-role-select:focus {
  outline: none;
  border-color: var(--b500);
  box-shadow: 0 0 0 3px rgba(51, 109, 255, 0.12);
}

.admin-action-btns {
  flex-direction: row !important;
  gap: 0.5rem;
}

.btn-sm {
  font-size: 0.78rem;
  padding: 0.4rem 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: white;
  border: none;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
}

.btn-secondary.btn-sm {
  background: var(--surface);
  color: var(--text);
}

.btn-secondary.btn-sm:hover {
  background: var(--b50);
  border-color: var(--b300);
}

/* QUICK ACTION CHIPS */
.quick-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 10px;
  flex-wrap: wrap;
}

.qa-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--s50);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all .25s;
  font-family: inherit;
  white-space: nowrap;
}

.qa-chip:hover {
  background: var(--b50);
  border-color: var(--b300);
  color: var(--b600);
  box-shadow: 0 0 12px rgba(59, 130, 246, .2);
  transform: translateY(-1px);
}

.qa-chip:active {
  transform: translateY(0) scale(.97);
}

[data-theme="dark"] .qa-chip {
  background: var(--s100);
  border-color: var(--border2);
}

[data-theme="dark"] .qa-chip:hover {
  background: rgba(59, 130, 246, .12);
  border-color: var(--b400);
  color: var(--b300);
}

[dir="rtl"] .quick-actions {
  direction: rtl;
}

/* CHART CONTAINERS */
.visual-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

.chart-section {
  margin-top: 0;
}

.chart-section h5 {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}

.chart-wrap {
  position: relative;
  height: 180px;
  width: 100%;
}

.chart-wrap-sm {
  position: relative;
  height: 200px;
  width: 100%;
}

/* EXECUTE BUTTON GLOW */
.execute-btn {
  animation: exec-glow 2.5s ease-in-out infinite;
}

@keyframes exec-glow {

  0%,
  100% {
    box-shadow: 0 4px 16px rgba(22, 81, 245, .28);
  }

  50% {
    box-shadow: 0 4px 24px rgba(59, 130, 246, .55), 0 0 40px rgba(59, 130, 246, .15);
  }
}

/* PDF EXPORT WRAPPER */
.pdf-export-wrapper {
  padding: 24px;
  font-family: 'Inter', sans-serif;
  color: #1e293b;
  line-height: 1.7;
}

.pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pdf-logo {
  font-size: 18px;
  font-weight: 800;
  color: #1651f5;
}

.pdf-date {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.pdf-divider {
  border: none;
  border-top: 2px solid #e2e8f0;
  margin: 0 0 16px;
}

/* PRINT STYLES */
@media print {
  body * {
    visibility: hidden;
  }

  .report-body,
  .report-body * {
    visibility: visible;
  }

  .report-body {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-height: none !important;
    overflow: visible !important;
    padding: 20mm;
    font-size: 12pt;
    line-height: 1.8;
    color: #000;
  }

  .sidebar,
  .mobile-bar,
  .toast-rack,
  .auth-overlay,
  .page-header,
  .card-top,
  .card-bottom,
  .visual-panel,
  .quick-actions,
  .execute-btn,
  .drawer-overlay,
  .employee-drawer {
    display: none !important;
  }

  @page {
    margin: 15mm;

    @bottom-center {
      content: "Munjiz Report — Page " counter(page);
      font-size: 9pt;
      color: #94a3b8;
    }
  }
}

/* BUTTONS */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  background: linear-gradient(135deg, var(--b600), var(--b500));
  color: #fff;
  font-size: .86rem;
  font-weight: 700;
  border-radius: var(--r-sm);
  box-shadow: 0 4px 16px rgba(22, 81, 245, .28);
  transition: all .2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22, 81, 245, .35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: .5;
  pointer-events: none;
}

.btn-primary.small {
  padding: 9px 18px;
  font-size: .8rem;
}

.btn-secondary {
  padding: 9px 18px;
  background: var(--s100);
  color: var(--s600);
  font-size: .8rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  transition: all .15s;
}

.btn-secondary:hover {
  background: var(--s200);
  color: var(--s800);
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: all .15s;
}

.icon-btn:hover {
  background: var(--s100);
  color: var(--text-sub);
}

/* RESULTS */
.results-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.result-panel {
  display: flex;
  flex-direction: column;
}

.report-body {
  padding: 20px;
  min-height: 280px;
  max-height: 520px;
  overflow-y: auto;
  flex: 1;
}

.visual-body {
  padding: 20px;
  min-height: 280px;
  max-height: 520px;
  overflow-y: auto;
  flex: 1;
}

.empty-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  text-align: center;
  gap: 10px;
}

.full-page-empty {
  min-height: 380px;
}

.empty-icon {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--s100);
  color: var(--s300);
  margin-bottom: 4px;
}

.empty-icon.blue {
  background: var(--b50);
  color: var(--b200);
}

.empty-icon.purple {
  background: #faf5ff;
  color: #c084fc;
}

.empty-icon.green {
  background: #f0fdf4;
  color: #86efac;
}

.empty-icon.amber {
  background: #fffbeb;
  color: #fcd34d;
}

[data-theme="dark"] .empty-icon {
  background: var(--s100);
  color: var(--s400);
}

.empty-placeholder h4 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-sub);
}

.empty-placeholder p {
  font-size: .82rem;
  color: var(--text-muted);
  max-width: 240px;
}

/* MARKDOWN */
.report-body.has-content h1,
.report-body.has-content h2,
.report-body.has-content h3 {
  color: var(--text);
  margin-top: 1.3em;
  margin-bottom: .4em;
  font-weight: 700;
}

.report-body.has-content h1 {
  font-size: 1.3rem;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--b100);
}

[data-theme="dark"] .report-body.has-content h1 {
  border-bottom-color: rgba(51, 109, 255, .2);
}

.report-body.has-content p {
  margin-bottom: .7em;
  line-height: 1.82;
  color: var(--text-sub);
  font-size: .89rem;
}

.report-body.has-content ul,
.report-body.has-content ol {
  padding-left: 1.4em;
  margin-bottom: .7em;
}

.report-body.has-content li {
  margin-bottom: .25em;
  color: var(--text-sub);
  font-size: .89rem;
}

.report-body.has-content code {
  background: var(--b50);
  color: var(--b700);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: .83rem;
}

[data-theme="dark"] .report-body.has-content code {
  background: rgba(51, 109, 255, .12);
  color: var(--b300);
}

.report-body.has-content pre {
  background: var(--s900);
  color: #e2e8f0;
  padding: 16px;
  border-radius: var(--r-sm);
  overflow-x: auto;
  margin-bottom: 1em;
  font-size: .83rem;
}

[data-theme="dark"] .report-body.has-content pre {
  background: #0d1117;
  border: 1px solid var(--border);
}

.report-body.has-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.report-body.has-content blockquote {
  border-left: 3px solid var(--b400);
  padding: 10px 16px;
  margin: 1em 0;
  background: var(--b50);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

[data-theme="dark"] .report-body.has-content blockquote {
  background: rgba(51, 109, 255, .06);
}

.report-body.has-content strong {
  color: var(--text);
}

.report-body.has-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
  font-size: .84rem;
}

.report-body.has-content th,
.report-body.has-content td {
  border: 1px solid var(--border);
  padding: 9px 13px;
  text-align: left;
}

.report-body.has-content th {
  background: var(--b50);
  font-weight: 700;
  color: var(--b800);
}

[data-theme="dark"] .report-body.has-content th {
  background: rgba(51, 109, 255, .1);
  color: var(--b300);
}

/* VISUAL PANEL */
.visual-summary {
  padding: 4px 0;
}

.summary-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--b500);
  margin-bottom: 18px;
}

.summary-header h4 {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.mini-stat {
  text-align: center;
  padding: 16px 8px;
  background: linear-gradient(135deg, var(--b50), rgba(51, 109, 255, .03));
  border-radius: var(--r-md);
  border: 1px solid rgba(51, 109, 255, .1);
  transition: transform .2s;
}

.mini-stat:hover {
  transform: scale(1.03);
}

[data-theme="dark"] .mini-stat {
  background: rgba(51, 109, 255, .06);
  border-color: rgba(51, 109, 255, .15);
}

.mini-stat .val {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--b500);
  line-height: 1.2;
}

.mini-stat .lbl {
  display: block;
  font-size: .66rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 4px;
}

.bar-section h5 {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 12px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.bar-name {
  font-size: .76rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 44px;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: var(--s100);
  border-radius: 100px;
  overflow: hidden;
}

[data-theme="dark"] .bar-track {
  background: var(--s200);
}

.bar-progress {
  height: 100%;
  border-radius: 100px;
  transition: width .8s;
}

.bar-progress.text-bar {
  background: linear-gradient(90deg, var(--b500), var(--b400));
}

.bar-progress.list-bar {
  background: linear-gradient(90deg, var(--green), #4ade80);
}

.bar-progress.code-bar {
  background: linear-gradient(90deg, var(--purple), #c084fc);
}

.bar-val {
  font-size: .73rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 32px;
  text-align: right;
}

/* TASKS PAGE */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  box-shadow: var(--sh-xs);
  transition: all .2s;
}

.task-entry:hover {
  box-shadow: var(--sh-md);
  border-color: var(--b200);
  transform: translateY(-1px);
}

.task-entry-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--b50);
  color: var(--b600);
  font-size: .8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .task-entry-num {
  background: rgba(51, 109, 255, .12);
  color: var(--b300);
}

.task-entry-body {
  flex: 1;
  min-width: 0;
}

.task-entry-text {
  font-size: .86rem;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-entry-time {
  font-size: .7rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

.task-has-doc {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  color: var(--amber);
  font-weight: 600;
  background: rgba(245, 158, 11, .08);
  padding: 2px 8px;
  border-radius: 100px;
}

/* REPORTS */
.reports-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-xs);
  transition: all .2s;
}

.report-entry:hover {
  box-shadow: var(--sh-md);
  border-color: var(--b200);
}

.report-entry-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}

.report-entry-header.expanded {
  border-bottom-color: var(--border2);
}

.report-entry-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f0fdf4;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .report-entry-icon {
  background: rgba(34, 197, 94, .1);
  color: #4ade80;
}

.report-entry-title {
  flex: 1;
  font-size: .86rem;
  font-weight: 700;
  color: var(--text);
}

.report-entry-date {
  font-size: .7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.report-entry-toggle {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform .2s;
}

.report-entry-toggle.open {
  transform: rotate(180deg);
}

.report-entry-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s, padding .3s;
}

.report-entry-body.open {
  max-height: 1000px;
  padding: 16px 18px;
}

.report-md {
  font-size: .87rem;
  line-height: 1.8;
  color: var(--text-sub);
}

.report-md h1,
.report-md h2,
.report-md h3 {
  color: var(--text);
  font-weight: 700;
  margin-top: 1em;
  margin-bottom: .35em;
}

.report-md p {
  margin-bottom: .6em;
}

.report-md ul,
.report-md ol {
  padding-left: 1.4em;
  margin-bottom: .6em;
}

.report-md code {
  background: var(--b50);
  color: var(--b700);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .82rem;
}

[data-theme="dark"] .report-md code {
  background: rgba(51, 109, 255, .12);
  color: var(--b300);
}

.report-md pre {
  background: var(--s900);
  color: #e2e8f0;
  padding: 14px;
  border-radius: var(--r-sm);
  overflow-x: auto;
  font-size: .82rem;
}

.report-md pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.report-md strong {
  color: var(--text);
}

/* HISTORY */
.history-timeline {
  display: flex;
  flex-direction: column;
  position: relative;
}

.history-timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  position: relative;
  z-index: 1;
  animation: fadeUp .3s;
}

.timeline-dot {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface);
  border: 2px solid var(--border);
}

.timeline-dot.success {
  border-color: var(--green);
  color: var(--green);
}

.timeline-body {
  flex: 1;
  min-width: 0;
  padding-top: 6px;
}

.timeline-title {
  font-size: .84rem;
  font-weight: 700;
  color: var(--text);
}

.timeline-desc {
  font-size: .78rem;
  color: var(--text-sub);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-time {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ADMIN ANALYTICS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.kpi-card {
  position: relative;
  overflow: visible;
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}

.activity-table th {
  text-align: start;
  padding: 12px 16px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--s50);
  border-bottom: 2px solid var(--border);
}

.activity-table td {
  text-align: start;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border2);
  color: var(--text-sub);
  font-weight: 500;
}

.activity-table tr:hover td {
  background: var(--s50);
}

.activity-table .employee-name {
  font-weight: 700;
  color: var(--text);
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.role-badge.admin {
  background: rgba(168, 85, 247, .1);
  color: var(--purple);
}

.role-badge.employee {
  background: rgba(51, 109, 255, .08);
  color: var(--b500);
}

[data-theme="dark"] .role-badge.admin {
  background: rgba(168, 85, 247, .15);
  color: #c084fc;
}

[data-theme="dark"] .role-badge.employee {
  background: rgba(51, 109, 255, .15);
  color: var(--b300);
}

/* ADMIN PANEL — 6-card KPI grid */
.kpi-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

/* Search bar */
.admin-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--s50);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  flex: 1;
  max-width: 300px;
  transition: border-color .2s, box-shadow .2s;
}

.admin-search-wrap:focus-within {
  border-color: var(--b400);
  box-shadow: 0 0 0 3px rgba(51, 109, 255, .12);
}

.admin-search-wrap svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.admin-search {
  border: none;
  outline: none;
  background: transparent;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text);
  width: 100%;
  font-family: inherit;
}

.admin-search::placeholder {
  color: var(--text-muted);
}

/* Employee cell with avatar */
.employee-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.emp-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--b500), var(--b400));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.employee-email {
  color: var(--text-muted);
  font-size: .8rem;
}

/* Status dots */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-inline-end: 4px;
}

.status-dot.online {
  background: var(--green);
  box-shadow: 0 0 6px rgba(34, 197, 94, .5);
}

.status-dot.idle {
  background: var(--amber);
  box-shadow: 0 0 6px rgba(245, 158, 11, .4);
}

.status-dot.offline {
  background: var(--s300);
}

/* Today count badge */
.today-count {
  font-weight: 600;
  color: var(--text-muted);
}

.today-count.has-tasks {
  color: var(--green);
  font-weight: 800;
}

/* ======== EMPLOYEE DETAIL DRAWER ======== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.employee-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 520px;
  max-width: 92vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, .15);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.employee-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--b600), var(--b400));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
}

.drawer-header-left h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.drawer-header-left p {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.drawer-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Drawer stats bar */
.drawer-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-stat {
  text-align: center;
  padding: 14px 8px;
  border-right: 1px solid var(--border2);
}

.drawer-stat:last-child {
  border-right: none;
}

.drawer-stat-num {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--b500);
  line-height: 1.2;
}

.drawer-stat-label {
  display: block;
  font-size: .66rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 3px;
}

/* Feedback Section */
.drawer-feedback {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.feedback-view h4,
.feedback-edit h4 {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.feedback-rating {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  color: var(--amber);
  font-size: 1.2rem;
}

.feedback-notes {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.6;
  font-style: italic;
  background: var(--surface);
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

.rating-input {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.star {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--s300);
  transition: transform 0.2s, color 0.15s;
}

.star:hover {
  transform: scale(1.2);
}

.star.active {
  color: var(--amber);
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.feedback-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  margin-bottom: 12px;
  resize: vertical;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--b400);
  box-shadow: 0 0 0 3px rgba(51, 109, 255, 0.1);
}

[data-theme="dark"] .drawer-feedback {
  background: #1c2330;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.drawer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 500;
}

.drawer-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--b500);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.drawer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.drawer-empty h4 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-sub);
  margin: 12px 0 4px;
}

.drawer-empty p {
  font-size: .82rem;
}

/* Task cards */
.drawer-task {
  background: var(--s50);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow .2s;
}

.drawer-task:hover {
  box-shadow: var(--sh-md);
}

.drawer-task-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background .15s;
}

.drawer-task-header:hover {
  background: var(--s100);
}

.drawer-task-header.expanded {
  border-bottom: 1px solid var(--border2);
}

.drawer-task-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--b50);
  color: var(--b600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

[data-theme="dark"] .drawer-task-num {
  background: rgba(51, 109, 255, .12);
  color: var(--b300);
}

.drawer-task-info {
  flex: 1;
  min-width: 0;
}

.drawer-task-prompt {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drawer-task-meta {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.drawer-task-toggle {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform .2s;
  margin-top: 4px;
}

.drawer-task-toggle.open {
  transform: rotate(180deg);
}

/* Collapsible response */
.drawer-task-response {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
}

.drawer-task-response.open {
  max-height: 2000px;
}

.drawer-response-content {
  padding: 16px;
  font-size: .84rem;
  line-height: 1.75;
  color: var(--text-sub);
  border-top: 1px solid var(--border2);
}

.drawer-response-content h1,
.drawer-response-content h2,
.drawer-response-content h3 {
  color: var(--text);
  margin-top: 1em;
  margin-bottom: .3em;
  font-weight: 700;
}

.drawer-response-content h1 {
  font-size: 1.1rem;
}

.drawer-response-content h2 {
  font-size: 1rem;
}

.drawer-response-content h3 {
  font-size: .92rem;
}

.drawer-response-content p {
  margin-bottom: .6em;
}

.drawer-response-content ul,
.drawer-response-content ol {
  padding-left: 1.3em;
  margin-bottom: .6em;
}

.drawer-response-content li {
  margin-bottom: .2em;
}

.drawer-response-content code {
  background: var(--b50);
  color: var(--b700);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .8rem;
}

.drawer-response-content pre {
  background: var(--s900);
  color: #e2e8f0;
  padding: 14px;
  border-radius: var(--r-sm);
  overflow-x: auto;
  margin-bottom: .8em;
  font-size: .8rem;
}

.drawer-response-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* File chips in drawer */
.drawer-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.drawer-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--b50);
  border: 1px solid var(--b200);
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--b700);
}

[data-theme="dark"] .drawer-file-chip {
  background: rgba(51, 109, 255, .1);
  border-color: rgba(51, 109, 255, .25);
  color: var(--b300);
}

[data-theme="dark"] .drawer-task {
  background: var(--s100);
}

[data-theme="dark"] .drawer-response-content code {
  background: rgba(51, 109, 255, .12);
  color: var(--b300);
}

[data-theme="dark"] .drawer-response-content pre {
  background: #0d1117;
  border: 1px solid var(--border);
}

/* Responsive: 2-col on tablets, 1-col on mobile */
@media (max-width: 900px) {
  .kpi-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .kpi-grid-6 {
    grid-template-columns: 1fr;
  }

  .admin-search-wrap {
    max-width: 100%;
  }
}

.setting-hint {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.context-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}

/* SETTINGS */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.settings-card {
  padding: 24px;
}

.settings-card h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border2);
}

.setting-row {
  margin-bottom: 16px;
}

.setting-row label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.setting-input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .86rem;
  color: var(--text);
  background: var(--s50);
  transition: border-color .2s, box-shadow .2s, background .3s;
}

.setting-input:focus {
  outline: none;
  border-color: var(--b400);
  box-shadow: 0 0 0 3px rgba(51, 109, 255, .1);
}

.input-with-toggle {
  position: relative;
}

.input-with-toggle .setting-input {
  padding-right: 42px;
}

.reveal-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
}

.reveal-btn:hover {
  background: var(--s100);
  color: var(--text-sub);
}

select.setting-input {
  cursor: pointer;
}

.slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--s200);
  border-radius: 100px;
  outline: none;
  margin-top: 4px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--b500);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(22, 81, 245, .3);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: .68rem;
  color: var(--text-muted);
}

.theme-toggle-group {
  display: flex;
  gap: 6px;
}

.theme-btn {
  flex: 1;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--s50);
  transition: all .15s;
  text-align: center;
}

.theme-btn:hover {
  border-color: var(--b300);
  color: var(--b600);
}

.theme-btn.active {
  background: var(--b50);
  border-color: var(--b400);
  color: var(--b600);
}

[data-theme="dark"] .theme-btn.active {
  background: rgba(51, 109, 255, .12);
  color: var(--b300);
}

.color-swatches {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  cursor: pointer;
  opacity: .7;
  transition: all .2s;
}

.swatch:hover {
  transform: scale(1.15);
}

.swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--b500);
}

/* LOADING */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-overlay.active {
  display: flex;
}

.loader-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 48px 52px;
  text-align: center;
  box-shadow: var(--sh-xl);
  animation: popIn .3s var(--spring);
  border: 1px solid var(--border);
}

@keyframes popIn {
  from {
    transform: scale(.88);
    opacity: 0
  }

  to {
    transform: scale(1);
    opacity: 1
  }
}

.loader-card h3 {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 26px;
}

.loader-card p {
  font-size: .82rem;
  color: var(--text-sub);
  margin-top: 4px;
}

.orbit-spinner {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto;
}

.orbit {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: 50%;
}

.orbit:nth-child(1) {
  border-top-color: var(--b500);
  animation: spin 1s linear infinite;
}

.orbit:nth-child(2) {
  inset: 8px;
  border-right-color: var(--b400);
  animation: spin 1.7s linear infinite reverse;
}

.orbit:nth-child(3) {
  inset: 16px;
  border-bottom-color: var(--b300);
  animation: spin 2.4s linear infinite;
}

.center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--b500);
  animation: dotPulse 1.5s ease infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

@keyframes dotPulse {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1)
  }

  50% {
    transform: translate(-50%, -50%) scale(1.6)
  }
}

.load-bar {
  width: 200px;
  height: 4px;
  background: var(--s200);
  border-radius: 100px;
  margin: 20px auto 0;
  overflow: hidden;
}

.load-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--b500), var(--b400));
  border-radius: 100px;
  transition: width .3s ease;
}

/* MODAL */
.report-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(8px);
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.report-modal.active {
  display: flex;
}

.report-modal-inner {
  background: var(--surface);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-xl);
  border: 1px solid var(--border);
  animation: popIn .3s var(--spring);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border2);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* TOAST */
.toast-rack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--s300);
  animation: toastIn .3s var(--spring);
  max-width: 360px;
}

.toast.success {
  border-left-color: var(--green);
}

.toast.error {
  border-left-color: var(--red);
}

.toast.info {
  border-left-color: var(--b500);
}

.toast-msg {
  font-size: .82rem;
  color: var(--text);
  font-weight: 600;
}

@keyframes toastIn {
  from {
    transform: translateX(110%);
    opacity: 0
  }

  to {
    transform: translateX(0);
    opacity: 1
  }
}

/* RESPONSIVE */
@media (max-width: 1200px) {

  .stats-row,
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .results-area {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 28px 24px 48px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-bar {
    display: flex;
  }

  .main {
    margin-left: 0;
    padding: 68px 14px 32px;
  }

  .page-heading {
    font-size: 1.3rem;
  }

  .stats-row,
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .card-bottom {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .bottom-left {
    justify-content: space-between;
  }

  .btn-primary {
    justify-content: center;
  }

  .loader-card {
    padding: 32px 20px;
    margin: 0 16px;
  }

  .auth-card {
    margin: 16px;
    padding: 28px 22px;
  }
}

@media (max-width: 480px) {

  .stats-row,
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* PRINT */
@media print {
  body * {
    visibility: hidden !important;
  }

  .report-body,
  .report-body * {
    visibility: visible !important;
  }

  .report-body {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-height: none;
    overflow: visible;
    padding: 20px;
    background: #fff;
    color: #000;
  }

  .report-body.has-content h1,
  .report-body.has-content h2,
  .report-body.has-content h3 {
    color: #000;
  }

  .report-body.has-content p,
  .report-body.has-content li {
    color: #333;
  }

  .report-body.has-content code {
    background: #f0f0f0;
    color: #333;
  }

  .report-body.has-content pre {
    background: #f8f8f8;
    color: #222;
    border: 1px solid #ddd;
  }

  .report-body.has-content th {
    background: #f0f0f0;
    color: #000;
  }

  .report-body.has-content td,
  .report-body.has-content th {
    border-color: #ccc;
  }

  .empty-placeholder {
    display: none !important;
  }
}

/* ===== VOICE DICTATION MIC ===== */
.mic-btn {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--s100);
  border: 1px solid var(--border);
  z-index: 2;
  transition: all .2s;
}

.mic-btn:hover {
  color: var(--b500);
  border-color: var(--b300);
  background: var(--b50);
}

.mic-btn.recording {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  animation: micPulse 1.2s ease infinite;
}

@keyframes micPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .4);
  }

  50% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
}

[dir="rtl"] .mic-btn {
  right: auto;
  left: 14px;
}

/* ===== DEPARTMENT DROPDOWN ===== */
.dept-selector-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.dept-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.dept-dropdown {
  position: relative;
}

.dept-selected {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-sub);
  box-shadow: var(--sh-xs);
  transition: all .2s;
  cursor: pointer;
}

.dept-selected:hover {
  border-color: var(--b300);
  color: var(--b600);
}

.dept-selected .chevron {
  transition: transform .2s;
}

.dept-dropdown.open .dept-selected .chevron {
  transform: rotate(180deg);
}

.dept-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  padding: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .2s var(--ease);
}

.dept-dropdown.open .dept-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dept-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-sub);
  transition: all .15s;
}

.dept-option:hover {
  background: var(--b50);
  color: var(--b600);
}

.dept-option.active {
  background: var(--b50);
  color: var(--b600);
  font-weight: 700;
}

[data-theme="dark"] .dept-option:hover,
[data-theme="dark"] .dept-option.active {
  background: rgba(51, 109, 255, .12);
  color: var(--b300);
}

[dir="rtl"] .dept-menu {
  left: auto;
  right: 0;
}

[dir="rtl"] .dept-option {
  text-align: right;
}

/* ===== LANGUAGE TOGGLE ===== */
.lang-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .6);
  font-size: .78rem;
  font-weight: 800;
  margin-left: auto;
  transition: all .2s;
  flex-shrink: 0;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

/* ===== CONFIRM MODAL ===== */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
}

.confirm-modal.active {
  opacity: 1;
  visibility: visible;
}

.confirm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: var(--sh-xl);
  animation: popIn .3s var(--spring);
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(239, 68, 68, .1);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirm-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.confirm-msg {
  font-size: .86rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 24px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-actions .btn-secondary {
  flex: 1;
  justify-content: center;
}

.confirm-actions .btn-danger {
  flex: 1;
  padding: 11px 20px;
  font-size: .86rem;
  font-weight: 700;
  border-radius: var(--r-sm);
  cursor: pointer;
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  border: none;
  transition: all .2s;
}

.confirm-actions .btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(220, 38, 38, .4);
}

/* Support RTL for modals */
[dir="rtl"] .confirm-card {
  direction: inherit;
}

.lang-toggle:hover {
  background: rgba(255, 255, 255, .15);
  color: #fff;
}

[dir="rtl"] .lang-toggle {
  margin-left: 0;
  margin-right: auto;
}

/* ===== RTL LAYOUT ===== */
[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
}

[dir="rtl"] .employee-drawer {
  right: auto;
  left: 0;
  border-left: none;
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
}

[dir="rtl"] .employee-drawer.open {
  transform: translateX(0);
}

[dir="rtl"] .main {
  margin-left: 0;
  margin-right: var(--sidebar-w);
}

[dir="rtl"] .brand-logo {
  flex-direction: row;
}

[dir="rtl"] .nav-item {
  text-align: right;
  flex-direction: row;
}

[dir="rtl"] .nav-item::before {
  left: auto;
  right: 0;
  border-radius: 4px 0 0 4px;
}

[dir="rtl"] .nav-badge {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .online-dot {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .page-header {
  flex-direction: row;
}

[dir="rtl"] .card-bottom {
  flex-direction: row;
}

[dir="rtl"] .template-row {
  flex-direction: row;
}

[dir="rtl"] .dept-selector-row {
  flex-direction: row;
}

[dir="rtl"] .stat-card {
  flex-direction: row;
}

[dir="rtl"] .timeline-item {
  flex-direction: row;
}

[dir="rtl"] .history-timeline::before {
  left: auto;
  right: 19px;
}

[dir="rtl"] .task-input {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .setting-row label {
  text-align: right;
}

[dir="rtl"] .auth-field label {
  text-align: right;
}

[dir="rtl"] .slider-labels {
  flex-direction: row-reverse;
}

[dir="rtl"] .report-body.has-content blockquote {
  border-left: none;
  border-right: 3px solid var(--b400);
  border-radius: var(--r-sm) 0 0 var(--r-sm);
}

[dir="rtl"] .report-body.has-content ul,
[dir="rtl"] .report-body.has-content ol {
  padding-left: 0;
  padding-right: 1.4em;
}

@media (max-width: 768px) {
  [dir="rtl"] .sidebar {
    transform: translateX(100%);
  }

  [dir="rtl"] .sidebar.open {
    transform: translateX(0);
  }

  [dir="rtl"] .main {
    margin-right: 0;
  }
}

/* == Google Integration Updates == */
.btn-gmail-action,
.input-gmail-action {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-main);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-main);
  text-align: left;
  transition: all 0.2s;
  box-sizing: border-box;
}

.btn-gmail-action {
  cursor: pointer;
}

.btn-gmail-action:hover {
  background: var(--border);
}

.input-gmail-action:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.chart-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.btn-copy-chart {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-copy-chart:hover {
  background: var(--border);
  color: var(--text-main);
}
