/* ==========================================
   DBD Events - Clean Professional Theme
   ========================================== */

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

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fc;
  --bg-tertiary: #f1f3f8;
  --bg-card: #ffffff;
  --bg-input: #f8f9fc;
  --bg-hover: #f1f3f8;
  --bg-sidebar: #1a1d2e;
  --bg-sidebar-hover: #252940;
  --bg-sidebar-active: #2d3250;
  --text-primary: #1a1d2e;
  --text-secondary: #5a6078;
  --text-muted: #8e93ab;
  --text-sidebar: #c2c7db;
  --text-sidebar-active: #ffffff;
  --accent: #4f46e5;
  --accent-light: #eef2ff;
  --accent-hover: #4338ca;
  --green: #10b981;
  --green-light: #ecfdf5;
  --yellow: #f59e0b;
  --yellow-light: #fffbeb;
  --red: #ef4444;
  --red-light: #fef2f2;
  --orange: #f97316;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  --border: #e5e7ef;
  --border-light: #f1f3f8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 50px -12px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================
   Layout
   ========================================== */

#app {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 20px;
}

.logo-icon {
  font-size: 26px;
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo h1 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 2px;
  background: none;
  border: none;
  color: var(--text-sidebar);
  font-size: 14px;
  font-weight: 450;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.nav-btn:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
}

.nav-btn.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
  font-weight: 500;
}

.nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

/* ==========================================
   Main Area
   ========================================== */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-secondary);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.view {
  display: none;
  padding: 28px 32px;
  overflow-y: auto;
  flex: 1;
}

.view.active {
  display: block;
}

/* ==========================================
   Buttons
   ========================================== */

.btn {
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.25);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
  transform: translateY(-1px);
}

.btn-ghost {
  background: var(--bg-primary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: #d0d4e0;
}

.btn-danger {
  background: var(--red);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all 0.15s;
}

.btn-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ==========================================
   Stats Grid (Dashboard)
   ========================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-card:nth-child(1) .stat-icon { background: var(--accent-light); }
.stat-card:nth-child(2) .stat-icon { background: var(--yellow-light); }
.stat-card:nth-child(3) .stat-icon { background: var(--green-light); }
.stat-card:nth-child(4) .stat-icon { background: var(--red-light); }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 450;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ==========================================
   Cards
   ========================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--text-primary);
  font-weight: 600;
}

/* ==========================================
   Events Grid
   ========================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 4px solid var(--accent);
  position: relative;
  box-shadow: var(--shadow-sm);
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.project-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.project-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
}

.project-card-actions {
  display: flex;
  gap: 2px;
}

.project-card-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.15s;
  border-radius: 4px;
}

.project-card:hover .project-card-actions button {
  opacity: 0.5;
}

.project-card-actions button:hover {
  opacity: 1 !important;
  background: var(--bg-hover);
}

/* ==========================================
   Progress Bar
   ========================================== */

.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 4px;
  transition: width 0.4s ease;
  width: 0%;
}

.progress-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 40px;
}

.progress-bar-small {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar-small .progress-fill {
  height: 100%;
  border-radius: 2px;
}

/* ==========================================
   Badges
   ========================================== */

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-active { background: var(--green-light); color: var(--green); }
.badge-paused { background: var(--yellow-light); color: var(--yellow); }
.badge-completed { background: var(--purple-light); color: var(--purple); }
.badge-archived { background: var(--bg-tertiary); color: var(--text-muted); }

.badge-low { background: var(--accent-light); color: var(--accent); }
.badge-medium { background: var(--yellow-light); color: #b45309; }
.badge-high { background: #fff7ed; color: var(--orange); }
.badge-urgent { background: var(--red-light); color: var(--red); }

.type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: var(--accent-light);
  color: var(--accent);
}

/* ==========================================
   Task Board
   ========================================== */

.project-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.project-info {
  flex: 1;
}

.project-info h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.project-info p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 12px;
}

.task-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.task-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  min-height: 300px;
}

.task-column {
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.task-column h5 {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-column h5::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-column[data-status="todo"] h5::before { background: var(--text-muted); }
.task-column[data-status="in-progress"] h5::before { background: var(--yellow); }
.task-column[data-status="review"] h5::before { background: var(--orange); }
.task-column[data-status="done"] h5::before { background: var(--green); }

.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
  cursor: grab;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.task-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.task-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.task-card-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text-primary);
  line-height: 1.4;
}

.task-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.task-card-assignee {
  display: flex;
  align-items: center;
  gap: 6px;
}

.avatar-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
}

.task-card-actions {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.task-card-actions button {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.task-card-actions button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: #d0d4e0;
}

.task-list {
  min-height: 40px;
}

.task-list.drag-over {
  background: var(--accent-light);
  border-radius: var(--radius);
}

/* ==========================================
   Team / Staff
   ========================================== */

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.team-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.member-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.member-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.member-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
}

.member-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.member-role {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.member-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 450;
}

.member-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  opacity: 0;
  transition: all 0.15s;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.member-card:hover .member-delete {
  opacity: 1;
}

.member-delete:hover {
  color: var(--red);
  background: var(--red-light);
}

/* ==========================================
   Activity Log
   ========================================== */

.activity-list {
  max-height: 320px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  font-size: 16px;
  margin-top: 1px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: 8px;
  flex-shrink: 0;
}

.activity-text {
  flex: 1;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 450;
}

/* Recent list */
.recent-list {
  max-height: 320px;
  overflow-y: auto;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.recent-item:hover {
  background: var(--bg-secondary);
}

.recent-color {
  width: 4px;
  height: 36px;
  border-radius: 2px;
  flex-shrink: 0;
}

.recent-info {
  flex: 1;
}

.recent-info h5 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.recent-info span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================
   Forms & Inputs
   ========================================== */

.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

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

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

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.color-picker {
  display: flex;
  gap: 8px;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.color-swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.1);
  box-shadow: var(--shadow);
}

.color-swatch:hover {
  transform: scale(1.08);
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

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

/* Custom type input */
.custom-type-group {
  display: none;
  margin-top: 10px;
}

.custom-type-group.visible {
  display: block;
}

/* ==========================================
   Settings
   ========================================== */

.settings-card {
  max-width: 640px;
  margin-bottom: 16px;
}

.settings-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ==========================================
   Modal
   ========================================== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

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

.modal {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 500px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.modal-sm {
  width: 400px;
}

/* ==========================================
   Toast Notification
   ========================================== */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 380px;
  font-weight: 450;
}

.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
.toast-info { border-left: 3px solid var(--accent); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

/* ==========================================
   Empty States
   ========================================== */

.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 15px;
  margin-bottom: 20px;
  line-height: 1.5;
}

/* ==========================================
   Auth Screen
   ========================================== */

.auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-secondary);
  background-image:
    radial-gradient(ellipse at 20% 80%, rgba(79, 70, 229, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
  overflow: auto;
}

.auth-screen.hidden {
  display: none;
}

.auth-container {
  width: 440px;
  max-width: 90vw;
}

.auth-logo {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo .logo-icon {
  font-size: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--accent);
  border-radius: 14px;
  margin-bottom: 16px;
}

.auth-logo h1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 6px;
}

.auth-form {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  font-size: 20px;
  margin-bottom: 24px;
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.auth-error {
  color: var(--red);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
  text-align: center;
}

.btn-full {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-pending-msg {
  text-align: center;
}

.pending-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.auth-pending-msg p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ==========================================
   Sidebar User
   ========================================== */

.sidebar-user {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius);
  transition: background 0.15s;
  flex: 1;
  min-width: 0;
  color: var(--text-sidebar);
}

.sidebar-user-info:hover {
  background: var(--bg-sidebar-hover);
}

#sidebar-username {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-edit-icon {
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.sidebar-user-info:hover .sidebar-edit-icon {
  opacity: 0.7;
}

.btn-logout {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 6px;
  opacity: 0.5;
  transition: opacity 0.15s;
  border-radius: 6px;
  color: var(--text-sidebar);
}

.btn-logout:hover {
  opacity: 1;
  background: var(--bg-sidebar-hover);
}

/* ==========================================
   Admin Panel
   ========================================== */

.admin-section {
  max-width: 800px;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.1s;
}

.user-row:last-child {
  border-bottom: none;
}

.user-row:hover {
  background: var(--bg-secondary);
}

.user-row-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: white;
  background: var(--accent);
  flex-shrink: 0;
}

.user-row-info {
  flex: 1;
}

.user-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-row-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.user-row-actions {
  display: flex;
  gap: 6px;
}

.btn-approve {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-approve:hover {
  background: #059669;
}

.btn-reject {
  background: var(--red-light);
  color: var(--red);
  border: none;
  border-radius: var(--radius);
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-reject:hover {
  background: #fecaca;
}

.btn-rename {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn-rename:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: #d0d4e0;
}

.badge-role-admin {
  background: var(--accent-light);
  color: var(--accent);
}

.badge-role-user {
  background: var(--purple-light);
  color: var(--purple);
}

/* ==========================================
   Calendar
   ========================================== */

.calendar-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.calendar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.calendar-header h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  min-width: 220px;
  text-align: center;
}

.calendar-header #cal-today {
  margin-left: auto;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 4px;
}

.calendar-weekdays div {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  padding: 8px 0;
}

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

.cal-day {
  min-height: 90px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 6px 8px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  background: var(--bg-primary);
}

.cal-day:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.15);
}

.cal-day.other-month {
  background: var(--bg-secondary);
  opacity: 0.45;
}

.cal-day.today {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.cal-day-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.cal-day.today .cal-day-number {
  background: var(--accent);
  color: #fff;
}

.cal-day.other-month .cal-day-number {
  color: var(--text-muted);
}

.cal-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-event-pill {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  line-height: 1.5;
  cursor: pointer;
  transition: opacity 0.1s;
}

.cal-event-pill:hover {
  opacity: 0.85;
}

.cal-task-dot {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  line-height: 1.5;
}

.cal-more {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 1px 0;
  font-weight: 500;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.cal-legend-item:hover {
  background: var(--bg-hover);
}

.cal-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ==========================================
   Comments
   ========================================== */

.detail-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

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

.comments-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.comments-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.comments-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.comments-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.comment-time {
  font-size: 11px;
  color: var(--text-muted);
}

.comment-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: all 0.15s;
  margin-left: auto;
}

.comment-item:hover .comment-delete {
  opacity: 1;
}

.comment-delete:hover {
  color: var(--red);
  background: var(--red-light);
}

.comment-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  word-break: break-word;
}

.mention {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-light);
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 12px;
}

.comment-input-container {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.comment-input-wrapper {
  flex: 1;
  position: relative;
}

.comment-textarea {
  min-height: 40px;
  resize: vertical;
  font-size: 13px;
}

.mention-suggestions {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 160px;
  overflow-y: auto;
  z-index: 50;
  min-width: 180px;
  margin-bottom: 4px;
}

.mention-suggestions.visible {
  display: block;
}

.mention-item {
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.1s;
}

.mention-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* ==========================================
   Events Filters
   ========================================== */

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

.filter-search {
  flex: 1;
  min-width: 200px;
}

.filter-select {
  width: auto;
  min-width: 160px;
}

/* ==========================================
   Rich Text Editor
   ========================================== */

.rich-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.15s;
}

.rich-editor:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.rich-toolbar {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.rich-btn {
  width: 30px;
  height: 28px;
  border: none;
  background: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.1s;
  font-family: inherit;
}

.rich-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.rich-btn.active {
  background: var(--accent-light);
  color: var(--accent);
}

.rich-separator {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 4px 4px;
  align-self: center;
}

.rich-editable {
  min-height: 100px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  outline: none;
  font-family: inherit;
}

.rich-editable:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.rich-editable h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 8px 0 4px;
}

.rich-editable blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--text-secondary);
}

.rich-editable ul, .rich-editable ol {
  padding-left: 20px;
  margin: 4px 0;
}

/* Event description display with rich text */
.event-description-rich {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.event-description-rich h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 8px 0 4px;
}

.event-description-rich blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--text-secondary);
}

.event-description-rich ul, .event-description-rich ol {
  padding-left: 20px;
  margin: 4px 0;
}

/* ==========================================
   Calendar Drag & Drop
   ========================================== */

.cal-event-pill[draggable="true"] {
  cursor: grab;
}

.cal-event-pill[draggable="true"]:active {
  cursor: grabbing;
}

.cal-event-pill.dragging {
  opacity: 0.4;
}

.cal-day.drag-over {
  background: var(--accent-light);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* ==========================================
   Tags
   ========================================== */

.tags-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tags-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}

.tag-chip:hover {
  opacity: 0.85;
}

.tag-chip.tag-removable::after {
  content: '\00d7';
  margin-left: 4px;
  font-size: 14px;
  opacity: 0.7;
}

.tag-chip.tag-removable:hover::after {
  opacity: 1;
}

.tag-chip.tag-selectable {
  opacity: 0.4;
  cursor: pointer;
}

.tag-chip.tag-selectable.selected {
  opacity: 1;
}

.tags-add-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.color-picker-mini {
  gap: 4px;
}

.color-swatch-sm {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

/* ==========================================
   Attachments
   ========================================== */

.attachments-section {
  margin-top: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.attachments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.attachments-header h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

#btn-upload-label {
  cursor: pointer;
}

.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.attachment-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: all 0.15s;
}

.attachment-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.attachment-preview {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview .file-icon {
  font-size: 32px;
  color: var(--text-muted);
}

.attachment-info {
  padding: 8px 10px;
}

.attachment-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.attachment-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.attachment-card:hover .attachment-delete {
  opacity: 1;
}

.attachment-delete:hover {
  background: var(--red);
}

.attachments-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
  grid-column: 1 / -1;
}

.attachment-upload-progress {
  padding: 12px;
  text-align: center;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

/* ==========================================
   Chat
   ========================================== */

.chat-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.chat-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.chat-messages {
  flex: 1;
  max-height: 350px;
  min-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.chat-msg {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background 0.1s;
}

.chat-msg:hover {
  background: var(--bg-hover);
}

.chat-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-msg-body {
  flex: 1;
  min-width: 0;
}

.chat-msg-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  display: inline;
}

.chat-msg-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 6px;
}

.chat-msg-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}

.chat-input-container {
  display: flex;
  gap: 8px;
}

.chat-input-container .input {
  font-size: 13px;
}

.chat-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ==========================================
   Scrollbar
   ========================================== */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .task-columns {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .cal-day {
    min-height: 70px;
  }
  .cal-event-pill, .cal-task-dot {
    font-size: 9px;
    padding: 1px 4px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 64px;
    padding: 16px 8px;
  }
  .logo h1,
  .nav-btn span:not(.nav-icon),
  #sidebar-username,
  .sidebar-edit-icon {
    display: none;
  }
  .nav-btn {
    justify-content: center;
    padding: 12px;
  }
  .logo {
    justify-content: center;
    padding: 0 0 16px;
  }
  .logo-icon {
    margin: 0;
  }
  .sidebar-user-info {
    justify-content: center;
  }
  .header {
    padding: 16px 20px;
  }
  .view {
    padding: 20px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .task-columns {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}
