/* ═══════════════════════════════════════════════════════════════
   SouqGo Staff Portal — portal.css
   Dark forest green theme with gold accents
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ─── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg:            #0A1F14;
  --bg-2:          #0F2A1A;
  --bg-3:          #162F1F;
  --bg-4:          #1A3823;
  --border:        rgba(201,168,76,0.12);
  --border-bright: rgba(201,168,76,0.38);
  --primary:       #C9A84C;
  --primary-dim:   rgba(201,168,76,0.15);
  --primary-hover: rgba(201,168,76,0.25);
  --accent:        #E8C573;
  --green:         #34D399;
  --red:           #EF4444;
  --orange:        #F97316;
  --amber:         #F59E0B;
  --text:          #F5EDD8;
  --text-mid:      #9A8460;
  --text-light:    #5A4E38;
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius:        10px;
  --radius-lg:     14px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-gold:   0 0 20px rgba(201,168,76,0.15);
  --transition:    all 0.2s ease;
}

/* ─── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }

img { max-width: 100%; }

input, textarea, select, button { font-family: 'Inter', sans-serif; }

/* ─── Scrollbars ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201,168,76,0.5); }

/* ═══════════════════════════════════════════════════════════════
   AUTH / LOGIN PAGE
   ═══════════════════════════════════════════════════════════════ */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* Left panel */
.auth-left {
  background: var(--bg-2);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(201,168,76,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(52,211,153,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.auth-left-content { position: relative; z-index: 1; text-align: center; }

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
}

.auth-logo-img {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
}

.auth-logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 42px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.auth-calligraphy {
  font-size: 120px;
  color: var(--primary);
  opacity: 0.12;
  line-height: 1;
  margin-bottom: -20px;
  font-weight: 400;
  display: block;
}

.auth-headline {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.25;
}

.auth-headline span { color: var(--primary); }

.auth-tagline {
  font-size: 15px;
  color: var(--text-mid);
  max-width: 320px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* Floating decorative elements */
.auth-deco {
  position: absolute;
  border-radius: 50%;
  background: var(--primary-dim);
  border: 1px solid var(--border);
  animation: floatDeco 6s ease-in-out infinite;
}
.auth-deco-1 { width: 80px; height: 80px; top: 12%; left: 8%; animation-delay: 0s; }
.auth-deco-2 { width: 50px; height: 50px; top: 25%; right: 12%; animation-delay: -2s; }
.auth-deco-3 { width: 120px; height: 120px; bottom: 15%; left: 5%; animation-delay: -4s; }
.auth-deco-4 { width: 40px; height: 40px; bottom: 30%; right: 8%; animation-delay: -1s; }

.auth-deco-diamond {
  width: 60px;
  height: 60px;
  border: 1px solid var(--border-bright);
  transform: rotate(45deg);
  background: transparent;
  border-radius: 8px;
}

@keyframes floatDeco {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-12px); opacity: 0.8; }
}

.auth-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
}

.auth-stat { text-align: center; }
.auth-stat-num { font-family: 'Poppins', sans-serif; font-size: 24px; font-weight: 700; color: var(--primary); }
.auth-stat-label { font-size: 12px; color: var(--text-mid); margin-top: 2px; }

/* Right panel */
.auth-right {
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
}

.auth-form-title {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-form-subtitle {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 36px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.auth-tab.active {
  background: var(--primary-dim);
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.auth-tab:hover:not(.active) { background: rgba(255,255,255,0.04); color: var(--text); }

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  margin-bottom: 7px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-input::placeholder { color: var(--text-light); }
.form-input:focus { border-color: var(--border-bright); box-shadow: 0 0 0 3px rgba(201,168,76,0.08); }
.form-input.error { border-color: var(--red); }

.form-input-wrap { position: relative; }
.form-input-wrap .form-input { padding-right: 44px; }
.form-input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-mid);
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
}
.form-input-icon:hover { color: var(--primary); }
.form-input-icon svg { width: 18px; height: 18px; }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.form-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  accent-color: var(--primary);
}

.form-checkbox-label { font-size: 13px; color: var(--text-mid); cursor: pointer; }
.form-forgot { font-size: 13px; color: var(--primary); }
.form-forgot:hover { color: var(--accent); text-decoration: underline; }

.auth-error {
  display: none;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: #FCA5A5;
  margin-bottom: 16px;
  align-items: center;
  gap: 8px;
}
.auth-error.show { display: flex; }
.auth-error svg { width: 16px; height: 16px; flex-shrink: 0; }

.auth-success {
  display: none;
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.3);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: #6EE7B7;
  margin-bottom: 16px;
  align-items: center;
  gap: 8px;
}
.auth-success.show { display: flex; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-light);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENT LIBRARY
   ═══════════════════════════════════════════════════════════════ */

/* Buttons */
.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  text-decoration: none;
}

.portal-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.portal-btn-primary {
  background: var(--primary);
  color: #0A1F14;
}
.portal-btn-primary:hover { background: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-gold); }
.portal-btn-primary:active { transform: translateY(0); }

.portal-btn-secondary {
  background: var(--primary-dim);
  color: var(--primary);
  border: 1px solid var(--border);
}
.portal-btn-secondary:hover { background: var(--primary-hover); border-color: var(--border-bright); }

.portal-btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border);
}
.portal-btn-ghost:hover { background: rgba(255,255,255,0.05); color: var(--text); border-color: rgba(255,255,255,0.1); }

.portal-btn-danger {
  background: rgba(239,68,68,0.15);
  color: #FCA5A5;
  border: 1px solid rgba(239,68,68,0.2);
}
.portal-btn-danger:hover { background: rgba(239,68,68,0.25); }

.portal-btn-sm { padding: 6px 14px; font-size: 12px; }
.portal-btn-lg { padding: 13px 28px; font-size: 15px; }
.portal-btn-full { width: 100%; }

.portal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.portal-btn.loading { pointer-events: none; }
.portal-btn.loading .btn-text { opacity: 0; }
.portal-btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Cards */
.portal-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}
.portal-card:hover { border-color: var(--border-bright); }
.portal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.portal-card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.portal-card-subtitle { font-size: 12px; color: var(--text-mid); margin-top: 2px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-green  { background: rgba(52,211,153,0.15); color: #34D399; border: 1px solid rgba(52,211,153,0.25); }
.badge-gold   { background: rgba(201,168,76,0.15); color: var(--primary); border: 1px solid var(--border); }
.badge-orange { background: rgba(249,115,22,0.15); color: #F97316; border: 1px solid rgba(249,115,22,0.25); }
.badge-red    { background: rgba(239,68,68,0.15); color: #EF4444; border: 1px solid rgba(239,68,68,0.25); }
.badge-blue   { background: rgba(99,102,241,0.15); color: #818CF8; border: 1px solid rgba(99,102,241,0.25); }
.badge-gray   { background: rgba(255,255,255,0.06); color: var(--text-mid); border: 1px solid var(--border); }
.badge-admin  { background: rgba(201,168,76,0.2); color: var(--accent); border: 1px solid var(--border-bright); }

/* Avatars */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: #0A1F14;
  background: var(--primary);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 64px; height: 64px; font-size: 24px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Status dots */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.status-dot-lg { width: 10px; height: 10px; }
.status-dot.online  { background: var(--green); box-shadow: 0 0 6px rgba(52,211,153,0.5); }
.status-dot.away    { background: var(--amber); box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.status-dot.offline { background: rgba(255,255,255,0.25); }

.avatar-status {
  position: absolute;
  bottom: 0; right: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-2);
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   PORTAL LAYOUT
   ═══════════════════════════════════════════════════════════════ */

.portal-page {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── SIDEBAR ───────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.3s ease, min-width 0.3s ease;
  z-index: 100;
}
#sidebar.collapsed {
  width: 0;
  min-width: 0;
  border-right: none;
}

.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}
.sidebar-logo-sub { font-size: 10px; color: var(--text-mid); margin-top: -2px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  padding: 12px 8px 6px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-mid);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  border-left: 3px solid transparent;
  margin-bottom: 2px;
  position: relative;
}

.sidebar-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.7; }

.sidebar-nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.sidebar-nav-item:hover svg { opacity: 1; }

.sidebar-nav-item.active {
  background: rgba(201,168,76,0.12);
  color: var(--primary);
  border-left-color: var(--primary);
}
.sidebar-nav-item.active svg { opacity: 1; fill: var(--primary); }

.sidebar-nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #0A1F14;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

/* Team online list in sidebar */
.sidebar-team {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}

.sidebar-team-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
}

.sidebar-team-count {
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
}

.sidebar-team-member {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-team-member:hover { background: rgba(255,255,255,0.04); }

.sidebar-team-member-info { flex: 1; min-width: 0; }
.sidebar-team-member-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-team-member-role { font-size: 11px; color: var(--text-mid); }

/* Current user footer */
.sidebar-user {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: var(--bg-3);
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role { font-size: 11px; color: var(--text-mid); }

.sidebar-signout {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  color: #FCA5A5;
}
.sidebar-signout:hover { background: rgba(239,68,68,0.2); }
.sidebar-signout svg { width: 15px; height: 15px; }

/* ─── MAIN AREA ─────────────────────────────────────────────── */
#portal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Top bar */
#top-bar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 50;
}

.topbar-hamburger {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
}
.topbar-hamburger svg { width: 18px; height: 18px; }

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.topbar-breadcrumb-item {
  font-size: 14px;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-breadcrumb-item.current {
  font-weight: 600;
  color: var(--text);
}

.topbar-breadcrumb-sep { color: var(--text-light); font-size: 12px; }

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  height: 36px;
  transition: var(--transition);
}
.topbar-search:focus-within { border-color: var(--border-bright); }
.topbar-search svg { width: 15px; height: 15px; color: var(--text-mid); flex-shrink: 0; }
.topbar-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  width: 200px;
}
.topbar-search input::placeholder { color: var(--text-light); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-mid);
  position: relative;
}
.topbar-icon-btn:hover { background: var(--primary-dim); border-color: var(--border-bright); color: var(--primary); }
.topbar-icon-btn svg { width: 17px; height: 17px; }

.topbar-notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-2);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  transition: var(--transition);
  border: 1px solid transparent;
}
.topbar-user:hover { background: var(--primary-dim); border-color: var(--border); }

.topbar-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.topbar-user-status {
  font-size: 11px;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Status selector */
.status-select {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-mid);
  font-size: 11px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.status-select option { background: var(--bg-2); }

/* Content area */
#content-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   OVERVIEW SECTION
   ═══════════════════════════════════════════════════════════════ */

.overview-grid { display: grid; gap: 20px; }

.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
  cursor: default;
}
.stat-card:hover { border-color: var(--border-bright); transform: translateY(-2px); box-shadow: var(--shadow-gold); }

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon svg { width: 22px; height: 22px; }
.stat-icon-gold  { background: rgba(201,168,76,0.15); color: var(--primary); }
.stat-icon-green { background: rgba(52,211,153,0.12); color: var(--green); }
.stat-icon-blue  { background: rgba(99,102,241,0.12); color: #818CF8; }
.stat-icon-red   { background: rgba(239,68,68,0.12); color: #F87171; }

.stat-card-body { flex: 1; min-width: 0; }
.stat-card-value { font-family: 'Poppins', sans-serif; font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-card-label { font-size: 12px; color: var(--text-mid); margin-top: 4px; }
.stat-card-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}
.stat-card-change.up { color: var(--green); }
.stat-card-change.down { color: var(--red); }

.overview-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.overview-three-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

/* Activity feed */
.activity-feed { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.activity-item:last-child { border-bottom: none; }

.activity-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-icon-wrap svg { width: 15px; height: 15px; }

.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; color: var(--text); line-height: 1.5; }
.activity-text strong { color: var(--primary); font-weight: 600; }
.activity-meta { font-size: 11px; color: var(--text-mid); margin-top: 2px; }

/* Quick links */
.quick-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 500;
}
.quick-link:hover { background: var(--primary-dim); border-color: var(--border-bright); color: var(--primary); }
.quick-link svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   CHAT SECTION
   ═══════════════════════════════════════════════════════════════ */

.chat-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: calc(100vh - var(--topbar-h) - 48px);
  gap: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Channels sidebar */
.chat-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-3);
  overflow: hidden;
}

.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-sidebar-section {
  padding: 12px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-channel-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  cursor: pointer;
  transition: var(--transition);
  border-radius: 0;
  color: var(--text-mid);
  font-size: 13px;
}
.chat-channel-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.chat-channel-item.active { background: var(--primary-dim); color: var(--primary); }
.chat-channel-prefix { font-size: 14px; color: inherit; flex-shrink: 0; }
.chat-channel-name { flex: 1; font-weight: 500; }
.chat-channel-unread {
  background: var(--primary);
  color: #0A1F14;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.chat-dm-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-mid);
  font-size: 13px;
}
.chat-dm-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.chat-dm-item.active { background: var(--primary-dim); color: var(--primary); }
.chat-dm-avatar-wrap { position: relative; }
.chat-dm-avatar-wrap .status-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 8px; height: 8px;
  border: 2px solid var(--bg-3);
}
.chat-dm-name { flex: 1; font-weight: 500; }

/* Chat main */
.chat-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.chat-header-info { display: flex; align-items: center; gap: 12px; }
.chat-header-name { font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600; color: var(--text); }
.chat-header-desc { font-size: 12px; color: var(--text-mid); }
.chat-header-actions { display: flex; gap: 8px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-msg-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.chat-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.chat-msg-row.sent { flex-direction: row-reverse; }

.chat-msg-avatar { flex-shrink: 0; align-self: flex-start; margin-top: 2px; }
.chat-msg-row.sent .chat-msg-avatar { display: none; }

.chat-msg-body { max-width: 65%; display: flex; flex-direction: column; }
.chat-msg-row.sent .chat-msg-body { align-items: flex-end; }

.chat-msg-sender {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 3px;
  padding-left: 2px;
}
.chat-msg-row.sent .chat-msg-sender { display: none; }

.chat-bubble {
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  word-break: break-word;
  position: relative;
}
.chat-bubble.received {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-bubble.sent {
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.2);
  color: var(--text);
  border-bottom-right-radius: 4px;
}

.chat-msg-time {
  font-size: 10px;
  color: var(--text-light);
  padding: 2px 4px;
  margin-top: 2px;
}

.chat-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.chat-reaction-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.chat-reaction-chip:hover, .chat-reaction-chip.active {
  background: var(--primary-dim);
  border-color: var(--border-bright);
}
.chat-reaction-count { font-size: 11px; color: var(--text-mid); }

.chat-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-light);
  font-size: 11px;
}
.chat-date-divider::before, .chat-date-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* Chat input */
.chat-input-area {
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  transition: var(--transition);
}
.chat-input-wrap:focus-within { border-color: var(--border-bright); }

.chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  resize: none;
  max-height: 120px;
  line-height: 1.5;
  font-family: 'Inter', sans-serif;
}
.chat-input::placeholder { color: var(--text-light); }

.chat-input-actions { display: flex; gap: 4px; align-items: center; }
.chat-input-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.chat-input-btn:hover { background: var(--primary-dim); color: var(--primary); }
.chat-input-btn svg { width: 17px; height: 17px; }

.chat-send-btn {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--primary);
  border: none;
  color: #0A1F14;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.chat-send-btn:hover { background: var(--accent); transform: scale(1.05); }
.chat-send-btn svg { width: 17px; height: 17px; }

/* ═══════════════════════════════════════════════════════════════
   EMAIL SECTION
   ═══════════════════════════════════════════════════════════════ */

.email-layout {
  display: flex;
  flex-wrap: nowrap;
  height: calc(100vh - var(--topbar-h) - 48px);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ── Resize handle ── */
.email-resize-handle {
  width: 4px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  position: relative;
  transition: background 0.15s;
  user-select: none;
}
.email-resize-handle::after {
  content: '';
  position: absolute;
  inset: 0 -2px;
}
.email-resize-handle:hover,
.email-resize-handle.dragging {
  background: var(--primary);
}

/* ── Sidebar ── */
.email-sidebar {
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-3);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.email-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 500;
}
.email-folder:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.email-folder.active { background: var(--primary-dim); color: var(--primary); font-weight: 600; }
.email-folder svg { width: 15px; height: 15px; flex-shrink: 0; }
.email-folder-count {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  background: var(--primary);
  color: #0A1F14;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* ── Email list ── */
.email-list { flex-shrink: 0; border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.email-list-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  position: sticky;
  top: 0;
  background: var(--bg-2);
  z-index: 1;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--text-mid);
}

.email-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.email-item:hover { background: rgba(255,255,255,0.04); }
.email-item.active { background: var(--primary-dim); }
.email-item.unread { background: rgba(201,168,76,0.04); }
.email-item.unread::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.email-item-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
  margin-top: 1px;
}
.email-item-body { flex: 1; min-width: 0; }
.email-item-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.email-item-from {
  font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 160px;
}
.email-item.unread .email-item-from { font-weight: 700; }
.email-item-time { font-size: 11px; color: var(--text-mid); flex-shrink: 0; margin-left: 8px; }
.email-item-subject {
  font-size: 13px; color: var(--text-mid); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.email-item.unread .email-item-subject { color: var(--text); font-weight: 600; }
.email-item-preview { font-size: 12px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Reading pane ── */
.email-thread { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; display: block; background: #fff; }
.email-thread-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky; top: 0;
  background: #fff;
  z-index: 1;
}
.email-thread-subject {
  font-family: 'Poppins', sans-serif;
  font-size: 17px; font-weight: 700;
  color: #111827;
  margin-bottom: 10px;
  line-height: 1.3;
}
.email-thread-actions { display: flex; gap: 8px; }
.email-thread-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.email-message {
  margin: 16px 24px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.email-message-header {
  padding: 14px 18px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafafa;
}
.email-message-from { display: flex; align-items: center; gap: 12px; }
.email-message-name { font-size: 14px; font-weight: 600; color: #111827; }
.email-message-addr { font-size: 11px; color: #6b7280; margin-top: 1px; }
.email-message-email { font-size: 11px; color: #6b7280; margin-top: 1px; }
.email-message-time { font-size: 12px; color: #9ca3af; white-space: nowrap; }
.email-message-body { background: #fff; }

.email-reply-bar {
  padding: 14px 24px;
  display: flex;
  gap: 10px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  position: sticky;
  bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════
   CALENDAR SECTION
   ═══════════════════════════════════════════════════════════════ */

.calendar-layout { display: flex; flex-direction: column; gap: 20px; }

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.calendar-nav-month {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.calendar-nav-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.calendar-nav-btn:hover { border-color: var(--border-bright); color: var(--primary); }
.calendar-nav-btn svg { width: 16px; height: 16px; }

.calendar-grid-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.calendar-weekday {
  padding: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-mid);
}

.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
  min-height: 100px;
  padding: 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: var(--transition);
  cursor: pointer;
}
.calendar-day:hover { background: rgba(255,255,255,0.02); }
.calendar-day:nth-child(7n) { border-right: none; }

.calendar-day-num {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  margin-bottom: 4px;
  transition: var(--transition);
}
.calendar-day.today .calendar-day-num {
  background: var(--primary);
  color: #0A1F14;
  font-weight: 700;
}
.calendar-day.other-month { background: rgba(0,0,0,0.15); }
.calendar-day.other-month .calendar-day-num { opacity: 0.3; }

.event-pill {
  display: block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  cursor: pointer;
  transition: var(--transition);
}
.event-pill:hover { opacity: 0.85; }
.event-meeting  { background: rgba(99,102,241,0.25); color: #A5B4FC; }
.event-deadline { background: rgba(239,68,68,0.2); color: #FCA5A5; }
.event-leave    { background: rgba(245,158,11,0.2); color: #FCD34D; }
.event-holiday  { background: rgba(52,211,153,0.2); color: #6EE7B7; }
.event-unavail  { background: rgba(156,163,175,0.2); color: #9CA3AF; }

.calendar-more-events {
  font-size: 10px;
  color: var(--text-mid);
  padding: 1px 4px;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   TASKS / KANBAN SECTION
   ═══════════════════════════════════════════════════════════════ */

.tasks-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tasks-filter-select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-mid);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.tasks-filter-select:focus { border-color: var(--border-bright); color: var(--text); }
.tasks-filter-select option { background: var(--bg-2); }

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}

.kanban-col {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 200px;
}

.kanban-col-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
}
.kanban-col-title {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.kanban-col-count {
  background: rgba(255,255,255,0.08);
  color: var(--text-mid);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.kanban-col-bar {
  width: 100%;
  height: 3px;
}
.kanban-bar-todo     { background: rgba(156,163,175,0.4); }
.kanban-bar-inprog   { background: rgba(99,102,241,0.6); }
.kanban-bar-review   { background: rgba(245,158,11,0.6); }
.kanban-bar-done     { background: rgba(52,211,153,0.6); }

.kanban-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.kanban-cards.drag-over {
  background: rgba(201,168,76,0.05);
  border: 1px dashed rgba(201,168,76,0.3);
  border-radius: 8px;
}

.task-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: grab;
  transition: var(--transition);
  user-select: none;
}
.task-card:hover { border-color: var(--border-bright); box-shadow: var(--shadow); transform: translateY(-1px); }
.task-card.dragging { opacity: 0.5; cursor: grabbing; }

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.task-card-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; flex: 1; }

.task-priority {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
.priority-low    { background: rgba(52,211,153,0.15); color: #34D399; }
.priority-medium { background: rgba(201,168,76,0.15); color: var(--primary); }
.priority-high   { background: rgba(249,115,22,0.15); color: #F97316; }
.priority-urgent { background: rgba(239,68,68,0.15); color: #EF4444; }

.task-card-project {
  font-size: 11px;
  color: var(--text-mid);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.task-card-project svg { width: 11px; height: 11px; }

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.task-card-due {
  font-size: 11px;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  gap: 5px;
}
.task-card-due svg { width: 12px; height: 12px; }
.task-card-due.overdue { color: var(--red); }

.task-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.task-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  color: var(--text-mid);
  border: 1px solid var(--border);
}

.kanban-add-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  width: 100%;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  color: var(--text-mid);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.kanban-add-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.kanban-add-btn svg { width: 15px; height: 15px; }

/* ═══════════════════════════════════════════════════════════════
   POLLS SECTION
   ═══════════════════════════════════════════════════════════════ */

.polls-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.poll-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
}
.poll-card:hover { border-color: var(--border-bright); }

.poll-card-header { margin-bottom: 16px; }
.poll-question { font-family: 'Poppins', sans-serif; font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.poll-meta { font-size: 12px; color: var(--text-mid); display: flex; align-items: center; gap: 12px; }
.poll-meta span { display: flex; align-items: center; gap: 5px; }
.poll-meta svg { width: 13px; height: 13px; }

.poll-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.poll-option {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.poll-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  position: relative;
  overflow: hidden;
}
.poll-option-btn:hover { border-color: var(--border-bright); background: var(--primary-dim); }
.poll-option-btn.voted { border-color: var(--border-bright); }

.poll-option-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--primary-dim);
  border-radius: 8px;
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  z-index: 0;
}
.poll-option-text { position: relative; z-index: 1; font-size: 13px; color: var(--text); font-weight: 500; }
.poll-option-pct { position: relative; z-index: 1; font-size: 12px; color: var(--primary); font-weight: 700; }
.poll-option-check {
  position: relative; z-index: 1;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.poll-option-check svg { width: 10px; height: 10px; color: #0A1F14; }

.poll-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.poll-votes-count { font-size: 12px; color: var(--text-mid); }
.poll-end-date { font-size: 12px; color: var(--text-mid); }
.poll-closed-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  background: rgba(255,255,255,0.06);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN SECTION
   ═══════════════════════════════════════════════════════════════ */

.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-search {
  flex: 1;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  height: 38px;
}
.admin-search svg { width: 15px; height: 15px; color: var(--text-mid); }
.admin-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  flex: 1;
  font-family: 'Inter', sans-serif;
}

.admin-table-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-mid);
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

.admin-user-cell { display: flex; align-items: center; gap: 12px; }
.admin-user-name { font-weight: 600; color: var(--text); }
.admin-user-email { font-size: 12px; color: var(--text-mid); }

.role-select {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  font-family: 'Inter', sans-serif;
}
.role-select:focus { border-color: var(--border-bright); }
.role-select option { background: var(--bg-2); }

.admin-actions { display: flex; gap: 6px; align-items: center; }
.admin-action-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.admin-action-btn:hover { border-color: var(--border-bright); color: var(--primary); background: var(--primary-dim); }
.admin-action-btn.danger:hover { border-color: rgba(239,68,68,0.4); color: var(--red); background: rgba(239,68,68,0.1); }
.admin-action-btn svg { width: 14px; height: 14px; }

.invite-code-box {
  background: var(--bg-3);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}
.invite-code-val {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 4px;
  flex: 1;
}
.invite-code-info { font-size: 12px; color: var(--text-mid); }

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.modal-lg { max-width: 680px; }
.modal-sm { max-width: 380px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-family: 'Poppins', sans-serif; font-size: 17px; font-weight: 700; color: var(--text); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(239,68,68,0.1); color: var(--red); border-color: rgba(239,68,68,0.3); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.modal-form-full { grid-column: 1 / -1; }

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  pointer-events: auto;
  animation: toastIn 0.25s ease;
  min-width: 260px;
  max-width: 380px;
}
.toast.out { animation: toastOut 0.25s ease forwards; }
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success { border-color: rgba(52,211,153,0.4); }
.toast.success svg { color: var(--green); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.error svg { color: var(--red); }
.toast.info svg { color: var(--primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

/* ─── Utility ───────────────────────────────────────────────── */

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title { font-family: 'Poppins', sans-serif; font-size: 20px; font-weight: 700; color: var(--text); }
.section-subtitle { font-size: 13px; color: var(--text-mid); margin-top: 2px; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

.text-primary { color: var(--primary); }
.text-mid { color: var(--text-mid); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-mid);
  text-align: center;
  gap: 12px;
}
.empty-state svg { width: 48px; height: 48px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 32px auto;
}

/* ═══════════════════════════════════════════════════════════════
   TASK DETAIL MODAL
   ═══════════════════════════════════════════════════════════════ */

.task-detail-header { margin-bottom: 16px; }
.task-detail-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.task-detail-desc { font-size: 14px; color: var(--text-mid); line-height: 1.7; background: var(--bg-3); border-radius: 8px; padding: 12px; margin-bottom: 16px; }

.task-comments { display: flex; flex-direction: column; gap: 12px; }
.task-comment {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-3);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.task-comment-body { flex: 1; }
.task-comment-author { font-size: 12px; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.task-comment-text { font-size: 13px; color: var(--text); }
.task-comment-time { font-size: 11px; color: var(--text-mid); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 1100px) {
  .stat-cards-row { grid-template-columns: repeat(2, 1fr); }
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
  .overview-two-col,
  .overview-three-col { grid-template-columns: 1fr; }
  .polls-layout { grid-template-columns: 1fr; }
  .email-layout { grid-template-columns: 180px 260px 1fr; }
}

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { padding: 40px 24px; }
  .topbar-search { display: none; }
}

@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 200;
    transition: left 0.3s ease;
    box-shadow: 4px 0 20px rgba(0,0,0,0.4);
  }
  #sidebar.open { left: 0; }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
  }
  .sidebar-overlay.show { display: block; }
  .topbar-hamburger { display: flex; }
  .stat-cards-row { grid-template-columns: 1fr 1fr; }
  .email-layout { grid-template-columns: 1fr; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .kanban-board { grid-template-columns: 1fr; }
  #content-area { padding: 16px; }
}

@media (max-width: 480px) {
  .stat-cards-row { grid-template-columns: 1fr; }
  .modal-form-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
