@import url("vazirmatn.css");

/* ============================================================
   CRM SHIMIKORD — Futuristic Dark SaaS Design System
   ============================================================ */

:root {
  /* Base palette */
  --bg-primary: #070e1f;
  --bg-primary-2: #0a1330;
  --bg-secondary: #0e1d3d;
  --bg-elev: #12264f;

  /* Glass surfaces */
  --glass-bg: rgba(32, 62, 122, 0.1);
  --glass-bg-strong: rgba(32, 62, 122, 0.14);
  --glass-bg-panel: rgba(9, 20, 46, 0.94);
  --glass-border: rgba(86, 128, 210, 0.16);
  --glass-border-strong: rgba(86, 128, 210, 0.32);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --glass-blur: 14px;

  /* Accents — ERP/CRM blue */
  --accent: #3d8bff;
  --accent-2: #2563eb;
  --accent-soft: rgba(61, 139, 255, 0.14);
  --accent-hover: #5ba0ff;
  --accent-glow: rgba(61, 139, 255, 0.3);
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.16);
  --blue: #5b8cff;
  --pink: #f472b6;
  --pink-soft: rgba(244, 114, 182, 0.16);
  --pink-glow: rgba(244, 114, 182, 0.25);
  --grad-primary: linear-gradient(135deg, #2f81f7 0%, #1d5fd4 100%);
  --grad-cyan: linear-gradient(135deg, #22d3ee 0%, #2f6ef7 100%);
  --grad-pink: linear-gradient(135deg, #f472b6 0%, #2f81f7 100%);
  --grad-hero: linear-gradient(135deg, rgba(61, 139, 255, 0.16), rgba(34, 211, 238, 0.1));

  /* Text */
  --text-primary: #eef1fb;
  --text-secondary: #a9b6d4;
  --text-muted: #7384ad;

  /* Semantic */
  --success: #34e3a1;
  --success-soft: rgba(52, 227, 161, 0.14);
  --warning: #ffc24b;
  --warning-soft: rgba(255, 194, 75, 0.14);
  --danger: #ff6d7d;
  --danger-soft: rgba(255, 109, 125, 0.14);
  --info: #4fc3ff;
  --teal: #2dd4bf;

  /* Effects */
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
  --glow-sm: 0 0 0 1px var(--glass-border), 0 4px 18px rgba(6, 12, 32, 0.5);
  --glow-md: 0 0 24px rgba(61, 139, 255, 0.18);

  /* Layout */
  --sb-width: 252px;
  --sidebar-width: 252px;
  --sb-gap: 0.9rem;
  --hb: 58px;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 8px;

  /* Motion */
  --t-fast: 0.15s ease;
  --t: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

  --hover-bg: rgba(41, 82, 168, 0.07);
  --hover-border: rgba(86, 128, 210, 0.32);
  --input-bg: rgba(41, 82, 168, 0.1);
  --input-bg-focus: rgba(41, 82, 168, 0.14);
  --border-subtle: rgba(86, 128, 210, 0.08);
  --msg-received-bg: rgba(41, 82, 168, 0.1);
  --scrollbar-thumb: rgba(96, 138, 218, 0.18);
  --scrollbar-thumb-hover: rgba(96, 138, 218, 0.32);
  --spinner-border: rgba(96, 138, 218, 0.14);
  --toggle-bg: rgba(41, 82, 168, 0.16);
  --chart-track-bg: rgba(41, 82, 168, 0.08);
  --tag-remove-bg: rgba(41, 82, 168, 0.16);
  --jcal-nav-bg: rgba(41, 82, 168, 0.1);
  --calendar-day-hover: rgba(41, 82, 168, 0.12);
  --modal-close-bg: rgba(86, 128, 210, 0.12);
  --modal-close-hover: rgba(86, 128, 210, 0.2);
  --table-row-hover: rgba(41, 82, 168, 0.05);
  --sidebar-bg: rgba(4, 9, 24, 0.92);
}

/* ---------- Light auxiliary themes (kept light, token-based) ---------- */
[data-theme="light"] {
  --bg-primary: #eef1fa;
  --bg-primary-2: #e6eaf6;
  --bg-secondary: #ffffff;
  --bg-elev: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.86);
  --glass-bg-panel: rgba(255, 255, 255, 0.96);
  --glass-border: rgba(20, 30, 80, 0.1);
  --glass-border-strong: rgba(20, 30, 80, 0.2);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --accent: #5b4df0;
  --accent-hover: #6f62f5;
  --accent-glow: rgba(91, 77, 240, 0.18);
  --accent-soft: rgba(91, 77, 240, 0.1);
  --cyan: #0891b2;
  --blue: #2563eb;
  --pink: #db2777;
  --pink-soft: rgba(219, 39, 119, 0.1);
  --text-primary: #101426;
  --text-secondary: #3d4a6b;
  --text-muted: #7484a8;
  --hover-bg: rgba(15, 23, 60, 0.045);
  --hover-border: rgba(15, 23, 60, 0.16);
  --input-bg: rgba(15, 23, 60, 0.04);
  --input-bg-focus: rgba(15, 23, 60, 0.07);
  --msg-received-bg: rgba(15, 23, 60, 0.045);
  --shadow-sm: 0 2px 10px rgba(15, 23, 60, 0.08);
  --shadow-md: 0 10px 30px rgba(15, 23, 60, 0.1);
  --shadow-lg: 0 18px 50px rgba(15, 23, 60, 0.14);
  --glow-sm: 0 0 0 1px rgba(15, 23, 60, 0.06), 0 6px 20px rgba(15, 23, 60, 0.06);
  --glow-md: 0 6px 22px rgba(91, 77, 240, 0.14);
  --grad-primary: linear-gradient(135deg, #6f5df5 0%, #4f43e0 100%);
  --sidebar-bg: rgba(250, 251, 255, 0.88);
--glass-blur: 18px;
  --grad-hero: linear-gradient(135deg, rgba(91, 77, 240, 0.08), rgba(15, 23, 60, 0.04));
}

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

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: "Vazirmatn", sans-serif;
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-primary-2) 100%);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Ambient aurora background */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(46rem 46rem at 82% 8%, rgba(111, 93, 255, 0.16) 0%, rgba(111, 93, 255, 0) 62%),
    radial-gradient(40rem 40rem at 12% 30%, rgba(34, 211, 238, 0.12) 0%, rgba(34, 211, 238, 0) 60%),
    radial-gradient(50rem 50rem at 70% 85%, rgba(255, 106, 213, 0.1) 0%, rgba(255, 106, 213, 0) 58%);
  animation: aurora 26s ease-in-out infinite alternate;
  will-change: transform;
}

/* Faint star/grid texture */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(160, 180, 255, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.4;
  pointer-events: none;
  mask-image: radial-gradient(60% 60% at 50% 20%, #000 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 20%, #000 0%, transparent 100%);
}

@keyframes aurora {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-1.5%, 1.5%) scale(1.04); }
}

[data-theme="light"] body::before {
  background:
    radial-gradient(46% 46% at 82% 8%, rgba(91, 77, 240, 0.06) 0%, transparent 62%),
    radial-gradient(40rem 40rem at 12% 30%, rgba(8, 145, 178, 0.05) 0%, transparent 60%);
  animation: none;
}

/* ============================================================
   GLASS COMPONENTS
   ============================================================ */
.glass {
  background: var(--glass-bg-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glow-sm);
}

.glass-card {
  background: var(--glass-bg-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 1.5rem;
  transition: var(--t);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--glass-border-strong);
  transform: translateY(-2px);
  box-shadow: var(--glow-sm), var(--glow-md), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.overdue-task-item:hover {
  background: var(--glass-bg) !important;
  border-right-color: var(--danger) !important;
}

[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.82);
}
[data-theme="light"] .modal {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.08);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 1.1rem;
  text-align: right;
}

.form-group label {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.form-input {
  width: 100%;
  padding: 0.72rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: "Vazirmatn", sans-serif;
  font-size: 0.93rem;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  direction: rtl;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 139, 255, 0.22), var(--glow-md);
  background: var(--input-bg-focus);
}

.form-input::placeholder {
  color: var(--text-muted);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a7b2d6' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 1rem center;
padding-left: 2.5rem;
  cursor: pointer;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

input[type="file"].form-input {
  padding: 0.45rem;
  color: var(--text-secondary);
}
input[type="file"].form-input::file-selector-button {
  background: var(--accent-soft);
  border: 1px solid rgba(61, 139, 255, 0.32);
  border-radius: var(--radius-xs);
  color: var(--accent-hover);
  padding: 0.35rem 0.85rem;
  font-family: "Vazirmatn", sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  margin-left: 0.6rem;
  transition: var(--t);
}
input[type="file"].form-input::file-selector-button:hover {
  background: rgba(61, 139, 255, 0.25);
}

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

select.form-input option,
select.form-input optgroup {
  background: var(--bg-elev, var(--bg-secondary));
  color: var(--text-primary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.68rem 1.35rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: "Vazirmatn", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
  position: relative;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 5px 18px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 26px var(--accent-glow), var(--glow-md);
}

.btn-secondary {
  background: var(--glass-bg-strong);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
  background: var(--hover-bg);
  border-color: var(--glass-border-strong);
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #26d79c 0%, #0eab7f 100%);
  color: #fff;
  box-shadow: 0 5px 18px rgba(52, 227, 161, 0.3);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(52, 227, 161, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ff7a8b, #f43f5e);
  color: #fff;
  box-shadow: 0 5px 18px rgba(255, 109, 125, 0.3);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 109, 125, 0.4);
}

.btn-orange {
  background: linear-gradient(135deg, #ffb347 0%, #ff7a1a 100%);
  color: #fff;
  box-shadow: 0 5px 18px rgba(255, 145, 60, 0.32);
}
.btn-orange:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 145, 60, 0.44);
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.82rem;
  border-radius: var(--radius-xs);
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: var(--glass-bg-strong);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--t);
  flex-shrink: 0;
  vertical-align: middle;
}
.btn-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--hover-bg);
}
.btn-copy:active {
  transform: scale(0.92);
}
.btn-copy svg {
  width: 12px;
  height: 12px;
  display: block;
}

.btn-block {
  width: 100%;
}

/* Filter pills */
.filter-btn {
  transition: var(--t);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.48rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--glass-border-strong);
  background: var(--hover-bg);
}
.filter-btn.active {
  color: #fff;
  font-weight: 700;
  border-color: transparent;
}
.filter-btn[data-filter="all"].active {
  background: var(--grad-primary);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.filter-btn[data-filter="planned"].active {
  background: linear-gradient(135deg, #c084fc, #7c3aed);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}
.filter-btn[data-filter="in_progress"].active {
  background: var(--grad-cyan);
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.35);
}
.filter-btn[data-filter="pending"].active {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}
.filter-btn[data-filter="completed"].active {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 4px 16px rgba(52, 227, 161, 0.4);
}

/* ============================================================
   SIDEBAR — floating glass panel
   ============================================================ */
.sidebar {
  position: fixed;
  right: var(--sb-gap);
  top: var(--sb-gap);
  bottom: var(--sb-gap);
  width: var(--sb-width);
  z-index: 130;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg), var(--glass-highlight);
  transition: transform var(--t-slow);
  overflow: hidden;
}

.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--grad-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 18px var(--pink-glow);
}

.sidebar-brand {
  min-width: 0;
  overflow: hidden;
}
.sidebar-brand h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-brand span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 0.9rem 0.75rem;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.68rem 0.9rem;
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--t);
  margin-bottom: 0.2rem;
  font-weight: 500;
  font-size: 0.92rem;
  position: relative;
  margin-inline: 0;
}

.nav-item:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  transform: translateX(2px);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(61, 139, 255, 0.3), rgba(61, 139, 255, 0.14));
  border: 1px solid rgba(61, 139, 255, 0.4);
  box-shadow: 0 6px 18px rgba(61, 139, 255, 0.18);
  font-weight: 700;
}

[data-theme="light"] .nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, #6f5df5 0%, #4f43e0 100%);
  border: 1px solid rgba(91, 77, 240, 0.4);
  box-shadow: 0 6px 18px rgba(91, 77, 240, 0.18);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  right: 0.3rem;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent-hover), var(--cyan));
  box-shadow: 0 0 10px var(--accent-glow);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: linear-gradient(135deg, #ff6d7d, #f43f5e);
  color: #fff;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: auto;
  line-height: 1;
  box-shadow: 0 0 10px rgba(255, 109, 125, 0.4);
}

.nav-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
  margin: 0.55rem 0.75rem;
}

.sidebar-footer {
  padding: 0.9rem 1.1rem;
  border-top: 1px solid var(--border-subtle);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.55rem;
  margin-bottom: 0.7rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--t);
}
.theme-toggle:hover {
  background: var(--hover-bg);
  color: var(--accent-hover);
  border-color: var(--accent);
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="light"] .theme-icon-sun { display: none; }
[data-theme="light"] .theme-icon-moon { display: block; }

.user-info {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--glass-border);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.user-details h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}
.user-details span {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ============================================================
   GLOBAL TOPBAR
   ============================================================ */
.app-topbar {
  position: fixed;
  top: var(--sb-gap);
  right: calc(var(--sidebar-width) + var(--sb-gap) * 2);
  left: var(--sb-gap);
  height: var(--hb);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 1.1rem;
  border-radius: 18px;
  background: var(--glass-bg-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), var(--glass-highlight);
  transition: right var(--t);
}

.topbar-menu {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  border-radius: 11px;
  color: var(--text-primary);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--t);
}
.topbar-menu:hover {
  background: var(--hover-bg);
  color: var(--accent-hover);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.topbar-brand > span:not(.topbar-logo) {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-brand img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.topbar-logo {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--grad-pink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--pink-glow);
}

.topbar-spacer { flex: 1; }

.topbar-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  white-space: nowrap;
}

.topbar-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.notif-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  border-radius: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t);
  margin-right: 0;
}
.notif-bell:hover {
  background: var(--hover-bg);
  color: var(--accent-hover);
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

.notif-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: linear-gradient(135deg, #ff6d7d, #f43f5e);
  color: #fff;
  border-radius: 999px;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-primary);
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.55rem 0.3rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  text-decoration: none;
  transition: var(--t);
  margin-inline-start: 0.4rem;
}
.topbar-user:hover {
  border-color: var(--glass-border-strong);
  background: var(--hover-bg);
  box-shadow: 0 0 14px var(--accent-glow);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 0 0 2px var(--glass-border);
  flex-shrink: 0;
}
.topbar-user-meta { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.topbar-user-meta strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
.topbar-user-meta small {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ===== MENU bar (universal search + quick actions) ===== */
.topbar-links {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.tl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 34px;
  padding: 0 0.7rem;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  transition: var(--t);
}
.tl-btn:hover {
  background: var(--hover-bg);
  color: var(--accent-hover);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.tl-bellWrap { position: relative; }
.tl-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: clamp(150px, 20vw, 250px);
  height: 34px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-muted);
  transition: var(--t);
}
.tl-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}
.tl-search > svg { flex-shrink: 0; color: var(--text-muted); }
.tl-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.76rem;
}
.tl-search input::placeholder { color: var(--text-muted); opacity: 0.8; }
.tl-search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 50%;
  font-size: 0.6rem;
  padding: 0;
  flex-shrink: 0;
}
.tl-search-clear:hover { background: var(--hover-bg); color: var(--text-primary); }
.tl-search-dd {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 320px;
  max-width: min(420px, 90vw);
  max-height: 330px;
  overflow-y: auto;
  background: var(--glass-bg-panel);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg), var(--glass-highlight);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  z-index: 300;
  padding: 0.4rem;
}
.tl-search-dd.active { display: block; animation: notifSlideIn 0.18s ease; }
.tl-dd-group { margin-bottom: 0.2rem; }
.tl-dd-h { font-size: 0.66rem; font-weight: 800; color: var(--text-muted); padding: 0.35rem 0.6rem 0.15rem; }
.tl-dd-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--t);
}
.tl-dd-item:hover { background: var(--hover-bg); color: var(--accent-hover); }
.tl-dd-ic {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.72rem;
}
.tl-dd-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tl-dd-t strong { font-size: 0.76rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-dd-t small { font-size: 0.64rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-dd-msg { font-size: 0.74rem; color: var(--text-muted); padding: 0.6rem; text-align: center; }

/* Notification dropdown panel */
.notif-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(380px, calc(100vw - 32px));
  max-height: min(60vh, 520px);
  background: var(--glass-bg-panel);
  backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  overflow: hidden;
  z-index: 150;
}
.notif-panel.active {
  display: flex;
  animation: notifSlideIn 0.22s ease;
}
@keyframes notifSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem 0.8rem;
  border-bottom: 1px solid var(--border-subtle);
}
.notif-panel-header h3 {
  font-size: 0.98rem;
  font-weight: 800;
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.notif-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.8rem;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--t);
  align-items: flex-start;
}
.notif-item:hover {
  background: var(--hover-bg);
}
.notif-unread {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-right: 3px solid var(--accent);
}

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-icon.assignment {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.notif-icon.status_change {
  background: var(--warning-soft);
  color: var(--warning);
}
.notif-icon.new_comment {
  background: var(--success-soft);
  color: var(--success);
}

.notif-content { flex: 1; min-width: 0; }
.notif-text {
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}
.notif-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.notif-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Notifications page */
.notif-page-list {
  display: flex;
  flex-direction: column;
}
.notif-page-list .notif-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
}
.notif-page-list .notif-item:last-child { border-bottom: none; }
.notif-page-list .notif-unread {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
}

/* ============================================================
   MAIN CONTENT / PAGE HEADER
   ============================================================ */
.main-content {
  margin-right: calc(var(--sidebar-width) + var(--sb-gap) * 2);
  min-height: 100vh;
  padding: calc(var(--hb) + var(--sb-gap) * 2 + 1rem) 1.5rem 2.5rem;
  transition: margin-right var(--t);
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 0.35rem 0 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

.page-header h1 {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.page-header .subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.3rem;
  font-weight: 400;
}

/* ============================================================
   STAT / KPI CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  position: relative;
  padding: 1.35rem 1.4rem;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
}

.stat-card::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 60%;
  height: 140%;
  background: radial-gradient(60% 60% at 50% 30%, var(--accent-soft), transparent 70%);
  opacity: 0;
  transition: opacity var(--t);
}
.stat-card:hover::after { opacity: 1; }

.stat-card:nth-child(1) { --stat-accent: var(--accent); --stat-soft: var(--accent-soft); }
.stat-card:nth-child(2) { --stat-accent: var(--warning); --stat-soft: var(--warning-soft); }
.stat-card:nth-child(3) { --stat-accent: var(--success); --stat-soft: var(--success-soft); }
.stat-card:nth-child(4) { --stat-accent: var(--pink); --stat-soft: var(--pink-soft); }

.stat-card:nth-child(1)::before { background: var(--grad-primary); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--warning), rgba(255,194,75,0.2)); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--success), rgba(52,227,161,0.2)); }
.stat-card:nth-child(4)::before { background: var(--grad-pink); }

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  font-size: 1.3rem;
  background: var(--stat-soft);
  color: var(--stat-accent);
  border: 1px solid color-mix(in srgb, var(--stat-accent) 30%, transparent);
}

.stat-value {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-container {
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  padding: 0.85rem 1.1rem;
  text-align: right;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.data-table td {
  padding: 0.95rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  font-size: 0.9rem;
}

.data-table tbody tr {
  transition: var(--t);
}
.data-table tbody tr:hover {
  background: var(--table-row-hover);
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-planned,
.badge-high {
  background: rgba(192, 132, 252, 0.14);
  color: #e5b3ff;
  border-color: rgba(192, 132, 252, 0.28);
}
.badge-pending,
.badge-medium {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(255, 194, 75, 0.28);
}
.badge-in_progress,
.badge-info {
  background: rgba(34, 211, 238, 0.13);
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.28);
}
.badge-completed,
.badge-low {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(52, 227, 161, 0.28);
}
.badge-admin {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-color: rgba(61, 139, 255, 0.3);
}
.badge-user {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  border-color: rgba(148, 163, 184, 0.22);
}

[data-theme="light"] .badge-planned,
[data-theme="light"] .badge-high {
  color: #7c3aed; background: rgba(168, 85, 247, 0.12);
}
[data-theme="light"] .badge-pending, [data-theme="light"] .badge-medium {
  color: #b45309;
}
[data-theme="light"] .badge-in_progress, [data-theme="light"] .badge-info {
  color: #0369a1;
}
[data-theme="light"] .badge-completed, [data-theme="light"] .badge-low {
  color: #15803d;
}
[data-theme="light"] .badge-danger, [data-theme="light"] .badge-high {
  color: #be123c;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 16, 0.62);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeInFast 0.18s ease;
}

.modal-overlay.active { display: flex; }

#eventModal.active { z-index: 310; }

/* Page loading overlay */
#pageLoading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #040610;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  visibility: hidden;
}
#pageLoading.active {
  visibility: visible;
}
#pageLoading .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Light theme: when body has loaded class, hide loading */
body.loaded #pageLoading {
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Override for light theme background during active state */
[data-theme="light"] #pageLoading.active {
  background: #eef1fa;
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.8rem;
  border-radius: var(--radius-lg);
  background: var(--glass-bg-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: modalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}
.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--glass-border);
  background: var(--modal-close-bg);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--t);
}
.modal-close:hover {
  background: var(--modal-close-hover);
  color: var(--text-primary);
  border-color: var(--glass-border-strong);
  transform: rotate(90deg);
}

.modal-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.4rem;
  justify-content: flex-end;
}

/* ============================================================
   CHAT
   ============================================================ */
.chat-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1rem;
  height: calc(100vh - 190px);
}

.chat-sidebar {
  overflow-y: auto;
  padding: 0;
  border-radius: var(--radius-lg);
}

.chat-contact {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--t);
  text-decoration: none;
  color: var(--text-primary);
}
.chat-contact:hover {
  background: var(--hover-bg);
}
.chat-contact.active {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  border-right: 3px solid var(--accent);
}

.chat-contact-info { flex: 1; min-width: 0; }
.chat-contact-name {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.12rem;
}
.chat-contact-preview {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-contact-meta { text-align: left; }
.chat-contact-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.online-dot {
  width: 9px;
  height: 9px;
  background: var(--success);
  border-radius: 50%;
  position: absolute;
  bottom: 1px;
  left: 1px;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 8px rgba(52, 227, 161, 0.8);
}

.unread-badge {
  background: var(--grad-primary);
  color: #fff;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  box-shadow: 0 0 10px var(--accent-glow);
}

.chat-main {
  display: flex;
  flex-direction: column;
  background: var(--glass-bg-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--glow-sm);
}

.chat-header {
  padding: 0.9rem 1.3rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-header-info h3 { font-size: 0.98rem; font-weight: 700; }
.chat-header-info span { font-size: 0.78rem; color: var(--text-muted); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.message {
  max-width: 76%;
  padding: 0.7rem 1rem;
  border-radius: 18px;
  font-size: 0.92rem;
  line-height: 1.65;
}

.message-sent {
  align-self: flex-start;
  background: var(--grad-primary);
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 5px 18px var(--accent-glow);
}

.message-received {
  align-self: flex-end;
  background: var(--msg-received-bg);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 6px;
}

.message-time {
  font-size: 0.68rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

.chat-input-area {
  padding: 0.9rem 1.2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 0.7rem;
  align-items: flex-end;
}
.chat-input-area .form-input { flex: 1; border-radius: 999px; padding: 0.7rem 1.1rem; }

/* ============================================================
   CALENDAR / EVENTS
   ============================================================ */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.45rem;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.calendar-header h3 {
  font-size: 1.05rem;
  font-weight: 800;
}

.calendar-nav { display: flex; gap: 0.45rem; }

.calendar-day-header {
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 0.5rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--t);
  font-size: 0.9rem;
  position: relative;
  background: var(--glass-bg);
  border: 1px solid transparent;
}
.calendar-day:hover {
  background: var(--calendar-day-hover);
  transform: translateY(-2px);
}
.calendar-day.today {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--accent);
  font-weight: 800;
  color: #fff;
}
[data-theme="light"] .calendar-day.today {
  background: rgba(91, 77, 240, 0.15) !important;
  color: #4338ca !important;
  border-color: #4338ca;
}
.calendar-day.has-event::after {
  content: "";
  width: 5px;
  height: 5px;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  border-radius: 50%;
  position: absolute;
  bottom: 5px;
  box-shadow: 0 0 8px var(--cyan);
}
.calendar-day.empty { cursor: default; background: transparent; }
.calendar-day.empty:hover { background: transparent; transform: none; }
.calendar-day.selected {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  border: 1px solid var(--accent);
  font-weight: 800;
  color: #fff;
}
[data-theme="light"] .calendar-day.selected {
  background: rgba(91, 77, 240, 0.18) !important;
  color: #4338ca !important;
  border-color: #4338ca;
}
[data-theme="light"] .calendar-day.today.selected {
  background: #4338ca !important;
  color: #fff !important;
  border-color: #4338ca;
}
.task-pick-item {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: var(--glass-bg);
  transition: var(--t);
  cursor: pointer;
}
.task-pick-item:hover { background: var(--calendar-day-hover); }
.task-pick-item.picked {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), transparent);
}
.task-pick-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 0.15rem;
}

/* ============================================================
   EISENHOWER QUADRANTS (events page)
   ============================================================ */
.unassigned-strip {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px dashed var(--text-muted);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, 0.06);
}
.unassigned-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-top: 0.3rem;
  white-space: nowrap;
}
.unassigned-items {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex: 1;
}

.quadrant-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.quadrant {
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  min-height: 150px;
  border: 1px solid transparent;
  transition: var(--t);
  background: var(--glass-bg);
}
.quadrant.q1 { border-color: rgba(239, 68, 68, 0.4); border-top: 3px solid #ef4444; }
.quadrant.q2 { border-color: rgba(245, 158, 11, 0.4); border-top: 3px solid #f59e0b; }
.quadrant.q3 { border-color: rgba(20, 184, 166, 0.4); border-top: 3px solid #14b8a6; }
.quadrant.q4 { border-color: rgba(100, 116, 139, 0.4); border-top: 3px solid #64748b; }
.quadrant.drag-over {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border-color: var(--accent);
}
.quadrant-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.quadrant-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--qc);
  box-shadow: 0 0 8px var(--qc);
}
.quadrant-count {
  margin-inline-start: auto;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.1rem 0.5rem;
  border-radius: 12px;
}
.quadrant-body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 80px;
}
.quadrant-empty {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem 0;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.quad-card {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--border);
  cursor: grab;
  transition: var(--t);
  user-select: none;
}
.quad-card:hover { background: var(--calendar-day-hover); transform: translateY(-1px); }
.quad-card:active { cursor: grabbing; }
.quad-card.dragging { opacity: 0.4; }
.quad-card-color {
  width: 4px;
  align-self: stretch;
  min-height: 40px;
  border-radius: 2px;
  flex-shrink: 0;
}
.quad-card-head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.2rem;
}
.quad-card-title { font-size: 0.88rem; font-weight: 600; line-height: 1.4; }
.quad-card-meta { font-size: 0.74rem; color: var(--text-muted); margin-top: 0.2rem; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.detail-item {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.detail-item span { font-size: 0.72rem; color: var(--text-muted); }
.detail-item strong { font-size: 0.85rem; font-weight: 600; }

@media (max-width: 768px) {
  .quadrant-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.event-card {
  display: flex;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  align-items: flex-start;
  border-radius: var(--radius);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}
.event-card:hover {
  border-color: var(--glass-border-strong);
}

.event-color-bar {
  width: 4px;
  height: auto;
  min-height: 50px;
  border-radius: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 10px currentColor;
}

.event-info { flex: 1; }
.event-info h4 {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.event-info p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.event-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.3rem;
}

.settings-section {
  padding: 1.5rem;
}
.settings-section h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.toggle-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.toggle-switch label { font-size: 0.92rem; }

.toggle {
  width: 48px;
  height: 26px;
  background: var(--toggle-bg);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: var(--t);
  border: 1px solid var(--glass-border);
}
.toggle.active {
  background: var(--grad-primary);
  border-color: transparent;
  box-shadow: 0 0 14px var(--accent-glow);
}
.toggle::after {
  content: "";
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  right: 2px;
  transition: var(--t);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.toggle.active::after {
  right: 24px;
}

/* Theme selector */
.theme-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.theme-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: var(--t);
  background: var(--bg-secondary);
}
.theme-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 8px 22px var(--accent-glow);
}
.theme-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 139, 255, 0.25), 0 0 20px var(--accent-glow);
}
.theme-card-preview { height: 64px; display: flex; overflow: hidden; }
.theme-card-preview span { flex: 1; }
.theme-card-info {
  padding: 0.55rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.theme-card-name {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.theme-card-check {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  flex-shrink: 0;
}
.theme-card.active .theme-card-check { display: flex; }

/* Color picker */
.color-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.color-option {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--t);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.color-option:hover,
.color-option.active {
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
}

/* ============================================================
   REPORTS / CHARTS
   ============================================================ */
.chart-container {
  padding: 1.4rem;
  margin-bottom: 0;
}

.chart-bar-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 1rem;
}

.chart-bar-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chart-bar-label {
  width: 96px;
  font-size: 0.86rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  font-weight: 500;
}

.chart-bar-track {
  flex: 1;
  height: 26px;
  background: var(--chart-track-bg);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.chart-bar-fill {
  height: 100%;
  border-radius: 999px;
  display: flex;
  align-items: center;
  padding: 0 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.05)), linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-primary);
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent-glow);
}

.activity-text { flex: 1; font-size: 0.9rem; color: var(--text-secondary); }
.activity-time { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.35;
  color: var(--accent);
}

/* ============================================================
   LOGIN
   ============================================================ */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.login-box {
  width: 100%;
  max-width: 420px;
  padding: 2.6rem 2.4rem;
  text-align: center;
  border-radius: 26px;
  animation: modalIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-lg), var(--glow-md);
}

.login-logo {
  width: 82px;
  height: 82px;
  border-radius: 24px;
  background: var(--grad-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.4rem;
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 12px 34px var(--pink-glow);
  position: relative;
}
.login-logo::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 28px;
  border: 1px solid rgba(255, 106, 213, 0.35);
  opacity: 0.5;
}

.login-box h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.login-box p {
  color: var(--text-secondary);
  margin-bottom: 1.8rem;
  font-size: 0.92rem;
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 0.8rem 1.5rem;
  border-radius: 14px;
  color: #fff;
  font-family: "Vazirmatn", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-success { background: linear-gradient(135deg, #24d59a, #0e9a72); }
.toast-error { background: linear-gradient(135deg, #ff6d7d, #e11d48); }
.toast-warning { background: linear-gradient(135deg, #fbbf24, #d97706); }
.toast-info { background: linear-gradient(135deg, #22d0ff, #3b82f6); }

/* ============================================================
   LOADING & ANIMATIONS
   ============================================================ */
.loading-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid var(--spinner-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
  box-shadow: 0 0 24px var(--accent-glow);
}

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease; }

/* ============================================================
   TAG INPUT / DROPDOWN
   ============================================================ */
.tag-input-wrapper {
  position: relative;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  cursor: text;
  transition: var(--t);
}
.tag-input-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 139, 255, 0.2), var(--glow-md);
  background: var(--input-bg-focus);
}

.tag-input-wrapper .tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent-soft);
  border: 1px solid rgba(61, 139, 255, 0.32);
  border-radius: 8px;
  padding: 0.24rem 0.6rem;
  font-size: 0.8rem;
  color: var(--accent-hover);
  white-space: nowrap;
  animation: fadeIn 0.2s ease;
}
.tag-input-wrapper .tag .tag-remove {
  width: 16px;
  height: 16px;
  border: none;
  background: var(--tag-remove-bg);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  line-height: 1;
  transition: var(--t);
  padding: 0;
}
.tag-input-wrapper .tag .tag-remove:hover {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 10px var(--danger);
}
.tag-input-wrapper .tag-search-input {
  flex: 1;
  min-width: 100px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: "Vazirmatn", sans-serif;
  font-size: 0.9rem;
  padding: 0.25rem 0.3rem;
  direction: rtl;
  outline: none;
}
.tag-input-wrapper .tag-search-input::placeholder { color: var(--text-muted); }

.tag-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 9999;
  background: var(--glass-bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.tag-dropdown.active { display: block; animation: modalIn 0.18s ease; }

.tag-dropdown-item {
  padding: 0.58rem 1rem;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: var(--t);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tag-dropdown-item:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.tag-dropdown-item.selected {
  background: rgba(61, 139, 255, 0.2);
  color: var(--accent-hover);
  font-weight: 700;
}
.tag-dropdown-empty {
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.tag-dropdown-group {
  padding: 0.5rem 1rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.tag-dropdown-group:not(:first-child) {
  margin-top: 0.2rem;
  border-top: 1px solid var(--glass-border);
  padding-top: 0.6rem;
}
.tag-dropdown-item.team-dropdown-item {
  color: var(--accent-hover);
}
.tag-dropdown-item.team-dropdown-item:hover {
  background: var(--accent-soft);
}
/* Select replaced by searchable combobox (wh/acc) */
select.ssel-hidden { display: none !important; }
.ssel-wrap { min-height: 44px; }
/* Sales dashboard: compact follow-up status select */
.sales-fup-row .ssel-wrap {
  min-height: 26px !important;
  height: 26px;
  width: 108px;
  flex: 0 0 auto;
  padding: 0.05rem 0.3rem;
  flex-wrap: nowrap;
  overflow: hidden;
}
.sales-fup-row .tag-search-input {
  min-width: 0 !important;
  width: 100%;
  font-size: 0.68rem;
  padding: 0 0.1rem;
}
.team-avatar-icon {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Task form: no-deadline toggle */
.no-due-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.jcal-trigger.jcal-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Admin internal submenu (تنظیمات مدیریت) */
.admin-layout {
  display: flex;
  flex-direction: row-reverse;
  gap: 1.5rem;
  align-items: flex-start;
}
.admin-content {
  flex: 1;
  min-width: 0;
}
.admin-submenu {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 200px;
  max-width: 200px;
  margin: 0;
  padding: 0.4rem;
  background: var(--hover-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}
.admin-submenu-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: "Vazirmatn", sans-serif;
  text-align: right;
  cursor: pointer;
  transition: var(--t);
  width: 100%;
}
.admin-submenu-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}
.admin-submenu-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.admin-submenu-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 0.4rem 0;
}

.team-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: var(--hover-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.teams-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: 0.9rem;
}

#eventModal .form-group:has(.tag-dropdown.active) {
  margin-bottom: 235px;
  transition: margin-bottom 0.15s ease;
}

/* ============================================================
   EVENTS TIMELINE
   ============================================================ */
.timeline-card { margin-top: 1.5rem; }
.timeline-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0.25rem 0 1rem; font-size: 0.8rem; color: var(--text-secondary); }
.timeline-legend .lg-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.timeline-legend .lg-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px dashed rgba(148, 163, 184, 0.7); display: inline-block; }
.lg-bar { display: inline-flex; gap: 2px; }
.lg-bar::before, .lg-bar::after { content: ''; width: 11px; height: 12px; border-radius: 3px; background: #6366f1; }
.lg-bar::after { background: #a5b4fc; }
.mc-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.85rem; }
.mc-header h3 { margin: 0; font-size: 1.05rem; }
.mc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.mc-head { text-align: center; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); padding: 4px 0; }
.mc-day { background: var(--hover-bg); border-radius: 10px; min-height: 104px; padding: 4px 6px; display: flex; flex-direction: column; gap: 3px; border: 1px solid transparent; position: relative; }
.mc-day.empty { background: transparent; }
.mc-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.mc-day-top { display: flex; justify-content: space-between; align-items: center; }
.mc-day-num { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); line-height: 1.2; }
.mc-day.today .mc-day-num { color: var(--accent); }
.mc-span-layer { position: relative; width: 100%; }
.mc-span { position: absolute; height: 19px; display: flex; align-items: center; gap: 4px; padding: 0 5px; overflow: hidden; cursor: pointer; white-space: nowrap; box-sizing: border-box; opacity: 0.95; }
.mc-span:hover { opacity: 1; filter: brightness(1.12); z-index: 2; }
.mc-span em { font-style: normal; font-weight: 700; font-size: 0.56rem; color: #fff; background: rgba(255, 255, 255, 0.24); border-radius: 3px; padding: 0 3px; flex-shrink: 0; }
.mc-span b { font-size: 0.6rem; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; }
.mc-span .mc-cont { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-style: normal; color: #fff; font-size: 0.6rem; background: rgba(0, 0, 0, 0.25); border-radius: 50%; width: 12px; height: 12px; display: flex; align-items: center; justify-content: center; line-height: 1; }
.mc-span .mc-cont.right { right: auto; left: 2px; }
.mc-singles { display: flex; flex-direction: column; gap: 2px; margin-top: 1px; overflow: hidden; }
.mc-single { display: flex; align-items: center; gap: 4px; font-size: 0.66rem; line-height: 1.4; cursor: pointer; color: var(--text-primary); padding: 1px 4px; border: 1px dashed rgba(148, 163, 184, 0.55); border-radius: 5px; background: rgba(148, 163, 184, 0.06); overflow: hidden; white-space: nowrap; }
.mc-single:hover { border-color: var(--accent); color: var(--accent); }
.mc-single i { width: 7px; height: 7px; border-radius: 50%; background: #6366f1; flex-shrink: 0; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.7) inset; }
.mc-single b { color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.mc-single span { overflow: hidden; text-overflow: ellipsis; }
.mc-more { font-size: 0.62rem; color: var(--text-muted); }

#allEventsList { display: flex; flex-direction: column; gap: 0.4rem; }
.ae-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.75rem; border-radius: 10px; cursor: pointer; border: 1px solid transparent; transition: background 0.15s ease, border-color 0.15s ease; }
.ae-item:hover { background: var(--hover-bg); border-color: rgba(148, 163, 184, 0.25); }
.ae-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5) inset; }
.ae-body { flex: 1; min-width: 0; }
.ae-title { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ae-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.4rem; margin-top: 0.15rem; }
.ae-badge { font-size: 0.62rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: rgba(148, 163, 184, 0.15); color: var(--text-muted); flex-shrink: 0; }
.ae-badge.multi { background: rgba(99, 102, 241, 0.15); color: var(--accent); }
.ae-chev { color: var(--text-muted); flex-shrink: 0; }
.ae-item:hover .ae-chev { color: var(--accent); }

.user-avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  color: #fff;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   TASK CHECKLIST
   ============================================================ */
.checklist-section {
  margin-top: 0.25rem;
}
.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}
.checklist-progress {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-hover);
  background: var(--accent-soft);
  border: 1px solid rgba(61, 139, 255, 0.22);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  white-space: nowrap;
}
.checklist-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--hover-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  transition: var(--t);
}
.checklist-item:hover {
  border-color: var(--glass-border-strong);
}
.checklist-item.done {
  opacity: 0.72;
}
.checklist-item.done .checklist-text {
  text-decoration: line-through;
  color: var(--text-muted);
}
.checklist-check {
  width: 17px;
  height: 17px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--success);
}
.checklist-text {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
  word-break: break-word;
}
.checklist-author {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.checklist-delete {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: var(--danger-soft);
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t);
  flex-shrink: 0;
}
.checklist-delete:hover {
  background: var(--danger);
  color: #fff;
}
.checklist-add-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.checklist-add-row .form-input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.9rem;
}

@media (max-width: 520px) {
  .checklist-author { display: none; }
}

/* ============================================================
   VOICE RECORDER
   ============================================================ */
.voice-recorder {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
  flex-wrap: wrap;
}

.record-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--danger);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t);
  flex-shrink: 0;
}
.record-btn:hover {
  background: var(--danger-soft);
  box-shadow: 0 0 14px rgba(255, 109, 125, 0.3);
}
.record-btn .record-icon {
  width: 0;
  height: 0;
  border-left: 8px solid var(--danger);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  margin-right: 2px;
}
.record-btn.recording {
  background: var(--danger);
  animation: pulse-record 1.2s ease-in-out infinite;
}
.record-btn.recording .record-icon {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 2px;
  background: #fff;
  margin-right: 0;
}
@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 109, 125, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(255, 109, 125, 0); }
}

.recording-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--danger);
  font-size: 0.85rem;
}
.recording-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: blink 1s step-end infinite;
  box-shadow: 0 0 8px var(--danger);
}
@keyframes blink { 50% { opacity: 0; } }

.recording-timer {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--danger);
  direction: ltr;
  font-variant-numeric: tabular-nums;
  min-width: 50px;
}

.voice-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.voice-preview audio { flex: 1; min-width: 120px; height: 36px; }
.voice-preview .remove-voice {
  width: 24px;
  height: 24px;
  border: none;
  background: var(--danger-soft);
  border-radius: 50%;
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: var(--t);
  flex-shrink: 0;
}
.voice-preview .remove-voice:hover {
  background: var(--danger);
  color: #fff;
}

/* ============================================================
   JALALI CALENDAR PICKER
   ============================================================ */
.jcal-wrapper { position: relative; direction: rtl; }
.jcal-wrapper .jcal-trigger { cursor: pointer; caret-color: transparent; }

.jcal-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--glass-bg-panel);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 0.8rem;
  box-shadow: var(--shadow-lg);
  direction: rtl;
  min-width: 260px;
}
.jcal-popup.active { display: block; animation: fadeInFast 0.15s ease; }

/* Solid floating date picker used inside job-description (petty cash) */
.jd-cal-popup {
  position: fixed;
  z-index: 100000;
  background: #09142e;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 0.8rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  direction: rtl;
  min-width: 260px;
}
[data-theme="light"] .jd-cal-popup { background: #ffffff; }

/* Searchable dropdown rendered at body level (escapes glass-card clipping) */
.jd-search-dd {
  position: fixed;
  z-index: 100001;
  min-width: 200px;
  max-height: 220px;
  overflow-y: auto;
  background: #09142e;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  padding: 0.25rem;
  direction: rtl;
}
[data-theme="light"] .jd-search-dd { background: #ffffff; }
.jd-search-dd-item {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.jd-search-dd-item:hover { background: var(--hover-bg); color: var(--accent); }
.jd-search-dd-empty { padding: 0.5rem 0.6rem; color: var(--text-muted); font-size: 0.8rem; }

.jcal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.jcal-nav {
  background: var(--jcal-nav-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t);
}
.jcal-nav:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-color: var(--accent);
}

.jcal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.jcal-dow { font-size: 0.72rem; color: var(--text-muted); padding: 0.3rem 0; font-weight: 600; }
.jcal-day {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.35rem 0;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--t);
}
.jcal-day:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.jcal-today {
  background: rgba(34, 224, 255, 0.14);
  color: var(--cyan);
  font-weight: 700;
}
.jcal-selected {
  background: var(--grad-primary) !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 3px 12px var(--accent-glow);
}
[data-theme="light"] .jcal-selected {
  background: rgba(91, 77, 240, 0.18) !important;
  color: #4338ca !important;
  font-weight: 800;
}
[data-theme="light"] .jcal-today.jcal-selected {
  background: #4338ca !important;
  color: #fff !important;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(67, 56, 202, 0.35);
}
.jcal-empty { padding: 0.35rem 0; }

.jcal-title-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  justify-content: center;
}
.jcal-clickable {
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: var(--t);
}
.jcal-clickable:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.jcal-title-month { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }
.jcal-title-year { font-size: 0.85rem; font-weight: 700; color: var(--text-primary); }

.jcal-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 0.5rem 0;
}
.jcal-picker-item {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 0.45rem 0.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--t);
  text-align: center;
}
.jcal-picker-item:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.jcal-picker-active {
  background: var(--grad-primary) !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 3px 12px var(--accent-glow);
}
.jcal-picker-disabled {
  visibility: hidden;
  cursor: default;
}
.jcal-picker-nav {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.2rem;
  margin-bottom: 0.2rem;
}
.jcal-picker-nav .jcal-nav {
  width: 24px;
  height: 24px;
  font-size: 0.85rem;
}

/* ============================================================
   TIME PICKER
   ============================================================ */
.time-picker-wrapper { position: relative; direction: rtl; }
.time-picker-wrapper .form-input { cursor: pointer; caret-color: transparent; }
.time-picker-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  background: var(--glass-bg-panel);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  text-align: center;
}
.time-picker-popup.active { display: block; animation: fadeInFast 0.15s ease; }
.time-picker-body {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: stretch;
}
.time-col { flex: 1; text-align: center; }
.time-col-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.time-col-list {
  max-height: 170px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0.3rem;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  scrollbar-width: thin;
}
.time-col-sep {
  align-self: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-muted);
}
.time-num-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.28rem 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--t);
  font-variant-numeric: tabular-nums;
}
.time-num-btn:hover { background: var(--accent-soft); color: var(--accent-hover); }
.time-num-btn.selected {
  background: var(--grad-primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 10px var(--accent-glow);
}
[data-theme="light"] .time-num-btn.selected {
  background: rgba(91, 77, 240, 0.18);
  color: #4338ca;
  font-weight: 800;
  box-shadow: none;
}
.time-picker-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

/* ============================================================
   MOBILE MENU
   ============================================================ */
.mobile-menu-btn {
  display: none !important;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 5, 14, 0.55);
  backdrop-filter: blur(3px);
  z-index: 120;
}
.sidebar-overlay.active { display: block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .chat-layout { grid-template-columns: 240px 1fr; }
}

@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-sidebar { display: none; }
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-submenu {
    min-width: 0;
    max-width: none;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .admin-submenu-btn {
    flex: 1;
    min-width: 130px;
  }
  .sidebar {
    right: var(--sb-gap);
    width: min(300px, calc(100vw - 2 * var(--sb-gap)));
    transform: translateX(calc(100% + var(--sb-gap)));
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.active { display: block; }

  .app-topbar {
    right: var(--sb-gap);
    left: var(--sb-gap);
  }
.topbar-menu { display: flex; }
  .topbar-date { display: none; }
  .topbar-links { gap: 0.3rem; }
  .tl-today span { display: none; }
  .tl-today, .tl-report { padding: 0 0.55rem; }
  .tl-search { width: 118px; }
  .tl-search-dd { min-width: 280px; }
  .main-content {
    margin-right: 0;
    padding: calc(var(--hb) + var(--sb-gap) * 2 + 0.75rem) 1rem 2rem;
  }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .page-header h1 { font-size: 1.3rem; }

.modal { margin: 0.5rem; padding: 1.4rem; }
  .settings-grid { grid-template-columns: 1fr; }

  .auth-box { padding: 1.8rem 1.4rem; }

  .report-actions { width: 100%; }
  .report-actions .btn { flex: 1 1 100%; white-space: normal; }

  .report-filter-grid,
  #userPeriodicReportsModal .report-filter-grid,
  #teamWorkReportModal .report-filter-grid,
  #overdueTasksModal .report-filter-grid { grid-template-columns: 1fr !important; }

  #overdueTaskDetailModal .report-meta-grid { grid-template-columns: 1fr !important; }

  .twr-actions-row > .btn { flex: 1 1 100%; }
  .twr-actions-row > div { flex: 1 1 100%; }
  .twr-actions-row .btn-sm { flex: 1; }

  #teamWorkReportModal .twr-item-row { flex-wrap: wrap; align-items: flex-start; }
  #teamWorkReportModal .twr-item-row > div:first-child {
    flex: 1 1 100%;
    min-width: 0 !important;
    text-align: right !important;
    font-size: 0.72rem !important;
    color: var(--text-muted) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #teamWorkReportModal .twr-item-row > div:first-child:empty { display: none; }
  #teamWorkReportModal .twr-item-row > div:nth-child(2) { flex: 1 1 auto; }
  #teamWorkReportModal .twr-item-row > span { order: 2; }
  #teamWorkReportModal .twr-item-row > button { order: 3; flex-shrink: 0; }
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.dashboard-bottom-grid .dashboard-section-content { display: flex; }
.dashboard-bottom-grid .dashboard-tabs { display: none; }

.dash-click-item { cursor: pointer; transition: background 0.15s ease, box-shadow 0.15s ease; }
.dash-click-item:hover { box-shadow: 0 0 0 1px var(--accent) inset; background: var(--glass-bg); }

@media (max-width: 768px) {
  .dashboard-bottom-grid { grid-template-columns: 1fr !important; gap: 0.75rem !important; }
  .dashboard-bottom-grid .dashboard-tabs { display: flex; gap: 0.5rem; }
  .dashboard-bottom-grid .dashboard-tab {
    flex: 1;
    padding: 0.65rem 0.5rem;
    border-radius: 10px;
    background: var(--hover-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--t);
    text-align: center;
    font-family: inherit;
  }
  .dashboard-bottom-grid .dashboard-tab.active {
    background: var(--grad-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 14px var(--accent-glow);
  }
  .dashboard-bottom-grid .glass-card { display: none; }
  .dashboard-bottom-grid .glass-card.active { display: block; }
  .dashboard-bottom-grid .glass-card > h3 { display: none; }
}

@media (max-width: 768px) {
  .events-top-grid { grid-template-columns: 1fr !important; }
  .events-top-grid > .glass-card { width: 100%; }
  .mc-header { flex-wrap: wrap; row-gap: 0.45rem; }
  .mc-header h3 { flex: 1 1 100%; order: -1; text-align: center; }
  .mc-header .btn { flex: 1 1 auto; }
  .mc-grid { gap: 4px; }
  .mc-day { min-height: 84px; padding: 3px 4px; }
  .mc-single { font-size: 0.6rem; }
  .filter-row-sm { flex-wrap: nowrap; gap: 0.35rem; }
  .filter-row-sm .filter-label { font-size: 0.72rem; margin-inline-end: 0; white-space: nowrap; }
  .filter-row-sm .filter-label[style*="margin-inline-start"] { margin-inline-start: 0.35rem !important; }
  .filter-row-sm .tag-input-wrapper { flex: 1; min-width: 0 !important; max-width: none !important; min-height: 36px !important; padding: 0.25rem 0.4rem !important; }
  .filter-row-sm .tag-search-input { min-width: 60px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 1.1rem 1.2rem; }
  .stat-value { font-size: 1.6rem; }
  .calendar-grid { gap: 0.25rem; }
  .calendar-day { font-size: 0.8rem; }
  .topbar-user-meta { display: none; }
  .topbar-user { padding: 0.3rem; }
  .login-box { padding: 2rem 1.4rem; }
}

/* ============================================================
   PROJECTS
   ============================================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.project-card {
  position: relative;
  background: var(--glass-bg-panel);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.3rem;
  cursor: pointer;
  transition: var(--t);
  box-shadow: var(--glow-sm);
  overflow: hidden;
}
.project-card:hover {
  border-color: var(--glass-border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--glass-highlight);
}
.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--project-accent, var(--accent)), transparent);
}
.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.project-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}
.project-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}
.tag-chip {
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border: 1px solid rgba(61, 139, 255, 0.25);
}
.avatar-stack {
  display: flex;
  align-items: center;
}
.avatar-stack .user-avatar-sm {
  border: 2px solid var(--glass-bg-panel);
  margin-inline-start: -0.45rem;
}
.avatar-stack .user-avatar-sm:first-child { margin-inline-start: 0; }
.avatar-stack .avatar-more {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--hover-bg);
  border: 2px solid var(--glass-bg-panel);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-inline-start: -0.45rem;
}
.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.15rem;
}
.project-progress { font-size: 0.78rem; color: var(--text-muted); }
.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--hover-bg);
  overflow: hidden;
  margin-top: 0.4rem;
}
.progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success), var(--cyan));
  transition: width 0.4s ease;
}

/* Tabs */
.tab-nav {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.15rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: "Vazirmatn", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
}
.tab-btn:hover { background: var(--hover-bg); color: var(--text-primary); }
.tab-btn.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* Project detail header */
.project-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}
.project-hero-main { flex: 1; min-width: 0; }
.project-hero-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.project-desc { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.7; margin-top: 0.4rem; }

/* Mentions */
.mention {
  display: inline-block;
  background: linear-gradient(135deg, #fef9c3, #fde68a);
  color: #92400e;
  border: 1px solid #facc15;
  border-radius: 6px;
  padding: 0 0.35rem;
  font-weight: 700;
  font-size: 0.88em;
  box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.message-sent .mention {
  background: #fff;
  color: #1d4ed8;
  border-color: rgba(255,255,255,0.9);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.message-received .mention {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.mention-suggest {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 1.2rem;
  right: 1.2rem;
  z-index: 9999;
  background: var(--glass-bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 190px;
  overflow-y: auto;
  display: none;
}
.mention-suggest.active { display: block; animation: modalIn 0.18s ease; }
.mention-suggest-item {
  padding: 0.5rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-primary);
  transition: var(--t);
}
.mention-suggest-item:hover { background: var(--accent-soft); color: var(--accent-hover); }
.mention-empty { padding: 0.7rem 0.9rem; color: var(--text-muted); font-size: 0.85rem; text-align: center; }
.project-chat-input { position: relative; }

/* Kanban board */
.kanban-board {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 0.75rem;
}
.kanban-column {
  flex: 0 0 282px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 330px);
  transition: var(--t);
}
.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}
.kanban-column-title { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.kanban-column-title h4 { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kanban-column-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--hover-bg);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  white-space: nowrap;
}
.kanban-column-actions { display: flex; gap: 0.25rem; }
.kanban-column-btn {
  width: 27px;
  height: 27px;
  border: none;
  background: transparent;
  border-radius: 7px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t);
}
.kanban-column-btn:hover { background: var(--accent-soft); color: var(--accent-hover); }
.kanban-column-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.7rem;
  overflow-y: auto;
  min-height: 60px;
  flex: 1;
}
.kanban-column.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 139, 255, 0.18);
}
.kanban-card {
  background: var(--glass-bg-panel);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  cursor: grab;
  transition: var(--t);
}
.kanban-card:hover { border-color: var(--glass-border-strong); transform: translateY(-1px); }
.kanban-card.dragging { opacity: 0.55; }
.kanban-card-title { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); line-height: 1.6; margin-bottom: 0.55rem; word-break: break-word; }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.kanban-card-foot { display: flex; align-items: center; gap: 0.35rem; }
.board-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem;
  border: 1px dashed var(--glass-border-strong);
  border-radius: 10px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  background: transparent;
  transition: var(--t);
  font-family: "Vazirmatn", sans-serif;
}
.board-add:hover { border-color: var(--accent); color: var(--accent-hover); background: var(--accent-soft); }

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--hover-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  margin-bottom: 0.4rem;
}
.member-row-info { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.member-row-role { font-size: 0.72rem; color: var(--text-muted); }

/* ============================================================
   PROJECT CATEGORIES / STATUS FILTERS
   ============================================================ */
.project-filters {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.3rem;
}
.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.filter-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-inline-end: 0.15rem;
}
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.36rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-panel);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: "Vazirmatn", sans-serif;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
}
.cat-chip span { color: var(--text-muted); font-size: 0.72rem; }
.cat-chip:hover { border-color: var(--glass-border-strong); color: var(--text-primary); }
.cat-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.cat-chip.active span { color: var(--accent-hover); }
.cat-folder {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.cat-folder-actions {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  display: none;
  align-items: center;
  gap: 0.2rem;
  background: var(--glass-bg-raised, var(--glass-bg-panel));
  border: 1px solid var(--glass-border-strong);
  border-radius: 999px;
  padding: 0.14rem;
  box-shadow: var(--shadow-md, var(--glow-sm));
  z-index: 5;
}
.cat-folder:hover .cat-folder-actions { display: inline-flex; }
.cat-folder-actions button {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: var(--t);
}
.cat-folder-actions button:hover { background: var(--hover-bg); color: var(--text-primary); }
.cat-folder-actions button:last-child:hover { background: var(--danger-soft, rgba(239, 68, 68, 0.15)); color: var(--danger, #f87171); }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.36rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-panel);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: "Vazirmatn", sans-serif;
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
}
.status-chip:hover { border-color: var(--glass-border-strong); color: var(--text-primary); }
.status-chip.active { border-color: var(--accent); color: var(--accent-hover); background: var(--accent-soft); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.26rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-badge.st-planning { background: rgba(192, 132, 252, 0.14); color: #e5b3ff; border-color: rgba(192, 132, 252, 0.28); }
.status-badge.st-active { background: rgba(34, 211, 238, 0.13); color: var(--cyan); border-color: rgba(34, 211, 238, 0.28); }
.status-badge.st-archived { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary); border-color: rgba(148, 163, 184, 0.22); }
[data-theme="light"] .status-badge.st-planning { color: #7c3aed; background: rgba(168, 85, 247, 0.12); }
[data-theme="light"] .status-badge.st-active { color: #0e7490; }
[data-theme="light"] .status-badge.st-archived { color: #64748b; }

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.status-dot.st-planning { background: #c084fc; }
.status-dot.st-active { background: var(--cyan); }
.status-dot.st-archived { background: var(--text-muted); }

.project-card-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--cat-color, #6366f1);
  background: color-mix(in srgb, var(--cat-color, #6366f1) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--cat-color, #6366f1) 30%, transparent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}
.project-card.is-archived {
  opacity: 0.62;
  filter: saturate(0.6);
}
.project-card.is-archived:hover { opacity: 0.85; }
.archived-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px dashed rgba(148, 163, 184, 0.3);
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 1rem;
}
/* === Dashboard Shortcuts === */
.shortcut-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:1rem; margin-bottom:1.5rem; }
.shortcut-card { position:relative; padding:1.2rem 1rem 1rem; border-radius:16px; background:var(--glass-bg-panel); border:1px solid var(--glass-border); backdrop-filter:blur(var(--glass-blur)) saturate(1.4); box-shadow:var(--glow-sm); cursor:pointer; transition:var(--t); overflow:hidden; text-align:center; min-height:132px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0.6rem; }
.shortcut-card[draggable="true"]{ cursor:grab; }
.shortcut-card[draggable="true"]:active{ cursor:grabbing; }
.shortcut-card::before { content:""; position:absolute; top:0; right:0; left:0; height:3px; background:var(--sc-color,#3d8bff); opacity:0.9; }
.shortcut-card:hover { transform:translateY(-3px); border-color:var(--glass-border-strong); box-shadow:var(--glow-md),var(--glow-sm); }
.shortcut-card.folder-card { background:linear-gradient(145deg, color-mix(in srgb, var(--sc-color) 10%, var(--glass-bg-panel)), var(--glass-bg-panel)); }
.shortcut-icon { width:52px; height:52px; border-radius:14px; display:flex; align-items:center; justify-content:center; font-size:1.6rem; background:color-mix(in srgb, var(--sc-color) 16%, transparent); border:1px solid color-mix(in srgb, var(--sc-color) 30%, transparent); box-shadow:0 4px 14px color-mix(in srgb, var(--sc-color) 22%, transparent); flex-shrink:0; }
.shortcut-title { font-weight:700; font-size:0.92rem; line-height:1.3; color:var(--text-primary); word-break:break-word; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.shortcut-url { font-size:0.7rem; color:var(--text-muted); direction:ltr; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.team-badge { display:inline-flex; align-items:center; gap:0.25rem; padding:0.18rem 0.5rem; border-radius:999px; font-size:0.68rem; font-weight:700; background:color-mix(in srgb, var(--tb-color) 16%, transparent); border:1px solid color-mix(in srgb, var(--tb-color) 32%, transparent); color:var(--tb-color); }
.shortcut-actions { position:absolute; top:0.45rem; left:0.45rem; display:flex; gap:0.25rem; opacity:0; transition:var(--t); }
.shortcut-card:hover .shortcut-actions { opacity:1; }
.sc-action-btn { width:26px; height:26px; border-radius:8px; border:1px solid var(--glass-border); background:var(--glass-bg); color:var(--text-secondary); cursor:pointer; display:flex; align-items:center; justify-content:center; font-size:0.8rem; transition:var(--t); }
.sc-action-btn:hover { background:var(--hover-bg); color:var(--text-primary); border-color:var(--glass-border-strong); }
.sc-action-btn.danger:hover { background:var(--danger-soft); color:var(--danger); border-color:rgba(255,109,125,0.3); }
.shortcut-empty { grid-column:1/-1; text-align:center; padding:2rem; color:var(--text-muted); font-size:0.9rem; border:1px dashed var(--glass-border); border-radius:16px; background:var(--glass-bg); }
.folder-modal-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:0.8rem; }
.icon-picker { display:grid; grid-template-columns:repeat(8,1fr); gap:0.35rem; max-height:120px; overflow-y:auto; padding:0.4rem; border:1px solid var(--glass-border); border-radius:10px; background:var(--glass-bg); }
.icon-option { width:100%; aspect-ratio:1; border-radius:8px; border:1px solid transparent; background:transparent; font-size:1.2rem; cursor:pointer; transition:var(--t); display:flex; align-items:center; justify-content:center; }
.icon-option:hover { background:var(--hover-bg); border-color:var(--glass-border); }
.icon-option.selected { background:var(--accent-soft); border-color:var(--accent); box-shadow:0 0 10px var(--accent-glow); }
.scope-box { border:1px solid var(--glass-border); border-radius:10px; padding:0.8rem; background:var(--glass-bg); margin-top:0.6rem; }
.scope-radio { display:flex; align-items:center; gap:0.5rem; padding:0.4rem 0; cursor:pointer; font-size:0.88rem; }

/* ===== پاپ‌آپ سراسری پیام زنده ===== */
.live-notif-wrap{ position:fixed; inset:0; z-index:13000; display:flex; align-items:center; justify-content:center; pointer-events:none; }
.live-notif{ pointer-events:auto; width:min(430px, 92vw); background:var(--glass-bg-panel); border:1px solid var(--glass-border); border-radius:16px; box-shadow:0 20px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06); backdrop-filter:blur(24px); overflow:hidden; animation:livePop .25s ease; }
@keyframes livePop{ from{ opacity:0; transform:translateY(10px) scale(.97); } to{ opacity:1; transform:none; } }
.live-notif-head{ display:flex; align-items:center; gap:0.5rem; padding:0.7rem 0.9rem; background:var(--accent-soft); border-bottom:1px solid var(--glass-border); }
.live-notif-tag{ background:linear-gradient(135deg,#f59e0b,#ef4444); color:#fff; font-size:0.65rem; font-weight:700; padding:0.15rem 0.5rem; border-radius:999px; flex-shrink:0; }
.live-notif-k{ font-size:0.8rem; font-weight:700; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.live-notif-x{ background:none; border:none; cursor:pointer; color:var(--text-muted); font-size:0.85rem; line-height:1; padding:0.15rem 0.3rem; border-radius:6px; }
.live-notif-x:hover{ background:var(--hover-bg); color:var(--danger); }
.live-notif-body{ padding:0.9rem; display:flex; flex-direction:column; gap:0.35rem; }
.live-notif-sender{ font-size:0.75rem; color:var(--text-muted); font-weight:600; }
.live-notif-text{ font-size:0.9rem; line-height:1.7; word-break:break-word; max-height:64px; overflow:hidden; }
.live-notif-actions{ padding:0.7rem 0.9rem; border-top:1px solid var(--glass-border); display:flex; justify-content:center; }

/* ===== واحد ریال کنار قیمت‌ها ===== */
.pr-unit{ font-size:0.62em; opacity:0.72; font-weight:400; margin-inline-start:0.2em; white-space:nowrap; }
