/* ==========================================
   CrafterWorld Taskboard - Stylesheet
   Design basierend auf crafterworld.de
   ========================================== */

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

:root {
  --primary: #1BFF00;
  --primary-dark: #15cc00;
  --primary-glow: rgba(27, 255, 0, 0.3);
  --secondary: #00E5FD;
  --secondary-dark: #00b8ca;
  --secondary-glow: rgba(0, 229, 253, 0.3);
  --bg-dark: #0a0e14;
  --bg-card: #111821;
  --bg-card-hover: #182030;
  --bg-nav: rgba(10, 14, 20, 0.92);
  --bg-input: #0d1219;
  --text: #e4e8f0;
  --text-muted: #8892a4;
  --text-bright: #ffffff;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  --shadow-glow-primary: 0 0 30px rgba(27, 255, 0, 0.15);
  --shadow-glow-secondary: 0 0 30px rgba(0, 229, 253, 0.15);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-heading: 'Rajdhani', sans-serif;
  --font-body: 'Inter', sans-serif;

  --color-critical: #ff4757;
  --color-high: #ff8c42;
  --color-medium: #ffd166;
  --color-low: #6bcb77;
  --color-todo: #8892a4;
  --color-progress: #00E5FD;
  --color-review: #a855f7;
  --color-done: #1BFF00;
  --color-danger: #ff4757;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* === Navbar === */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--bg-nav);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1600px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700;
  color: var(--text-bright); text-decoration: none;
}

.nav-logo img { width: 36px; height: 36px; border-radius: 8px; }

.nav-logo span:nth-child(2) {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.nav-badge {
  background: rgba(27, 255, 0, 0.1) !important;
  -webkit-text-fill-color: var(--primary) !important;
  border: 1px solid rgba(27, 255, 0, 0.2);
  padding: 2px 10px; border-radius: 50px; font-size: 0.75rem; font-weight: 600;
}

.nav-tabs {
  display: flex; gap: 4px;
  background: rgba(255, 255, 255, 0.03); border-radius: var(--radius); padding: 4px;
}

.nav-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: none; border: none; border-radius: var(--radius-sm);
  color: var(--text-muted); font-family: var(--font-heading);
  font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.nav-tab:hover { color: var(--text-bright); }
.nav-tab.active { background: rgba(27, 255, 0, 0.1); color: var(--primary); }

.nav-tab.admin-only { display: none; }
.nav-tab.admin-only.visible { display: flex; }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-name { font-family: var(--font-heading); font-weight: 600; color: var(--text-bright); font-size: 0.95rem; }

.user-role-badge {
  font-size: 0.75rem; font-weight: 600; padding: 2px 10px;
  border-radius: 50px; font-family: var(--font-heading);
}

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-radius: var(--radius-sm);
  font-family: var(--font-heading); font-size: 0.95rem; font-weight: 600;
  letter-spacing: 0.02em; border: none; cursor: pointer;
  transition: var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; border-radius: var(--radius); }
.btn-full { width: 100%; justify-content: center; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000; box-shadow: var(--shadow-glow-primary);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(27, 255, 0, 0.3); }

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark)); color: #000;
}
.btn-secondary:hover { transform: translateY(-2px); }

.btn-outline { background: transparent; color: var(--text-bright); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger {
  background: rgba(255, 71, 87, 0.15); color: var(--color-danger);
  border: 1px solid rgba(255, 71, 87, 0.3);
}
.btn-danger:hover { background: var(--color-danger); color: #fff; }

.btn-ghost {
  background: none; border: none; color: var(--text-muted); padding: 6px;
  cursor: pointer; border-radius: var(--radius-sm); transition: var(--transition);
}
.btn-ghost:hover { color: var(--text-bright); background: rgba(255,255,255,0.05); }
.btn-ghost:disabled { opacity: 0.25; cursor: default; pointer-events: none; }

/* === Login Screen === */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(27, 255, 0, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 50%, rgba(0, 229, 253, 0.05) 0%, transparent 50%),
    var(--bg-dark);
}

.login-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 48px; max-width: 420px; width: 100%;
  text-align: center; position: relative; overflow: hidden; animation: fadeInUp 0.6s ease-out;
}
.login-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.login-logo {
  width: 80px; height: 80px; margin-bottom: 20px;
  filter: drop-shadow(0 0 30px rgba(27, 255, 0, 0.3)); animation: float 6s ease-in-out infinite;
}

.login-card h1 {
  font-family: var(--font-heading); font-size: 1.8rem; font-weight: 700;
  color: var(--text-bright); margin-bottom: 8px;
}

.text-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.login-subtitle { color: var(--text-muted); margin-bottom: 32px; }
.login-form { text-align: left; }

.login-error {
  color: var(--color-danger); font-size: 0.85rem; margin-bottom: 12px;
  min-height: 20px; font-weight: 500;
}

/* === Form Elements === */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block; font-family: var(--font-heading); font-size: 0.85rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group textarea,
.form-group select {
  width: 100%; padding: 12px 16px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-bright); font-family: var(--font-body); font-size: 0.95rem;
  transition: var(--transition); outline: none;
}

.form-group input[type="date"] {
  color-scheme: dark;
}

.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); opacity: 0.6; }

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27, 255, 0, 0.1);
}

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

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238892a4' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}

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

.checkbox-label {
  display: flex !important; align-items: center; gap: 10px;
  cursor: pointer; text-transform: none !important; letter-spacing: 0 !important;
  font-size: 0.95rem !important; color: var(--text) !important;
}

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

.color-picker-row { display: flex; align-items: center; gap: 12px; }

.color-picker-row input[type="color"] {
  width: 48px; height: 40px; padding: 2px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-input); cursor: pointer;
}

.color-preview {
  font-family: var(--font-heading); font-weight: 700; font-size: 1rem;
}

/* === Main Content === */
.main-content { padding-top: 64px; min-height: 100vh; }

/* === Toolbar === */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 20, 0.5); backdrop-filter: blur(10px);
  position: sticky; top: 64px; z-index: 100; gap: 16px; flex-wrap: wrap;
}

.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; }
.toolbar-right { display: flex; align-items: center; gap: 12px; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 14px; transition: var(--transition); min-width: 250px;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27, 255, 0, 0.1); }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  width: 100%; padding: 10px 0; background: none; border: none;
  color: var(--text-bright); font-family: var(--font-body); font-size: 0.9rem; outline: none;
}
.search-box input::placeholder { color: var(--text-muted); opacity: 0.6; }

.filter-group { display: flex; gap: 8px; }
.filter-select {
  padding: 10px 36px 10px 14px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body); font-size: 0.85rem;
  outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238892a4' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; transition: var(--transition);
}
.filter-select:focus { border-color: var(--primary); }

/* === Dashboard === */
.dashboard-view { padding: 24px; }
.dashboard-container { max-width: 1200px; margin: 0 auto; }

.dash-greeting {
  margin-bottom: 24px;
}
.dash-greeting-row {
  display: flex; align-items: center; gap: 16px;
}
.dash-greeting-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--primary); image-rendering: pixelated;
  box-shadow: 0 0 16px rgba(27, 255, 0, 0.2);
}
.dash-greeting h1 {
  font-family: var(--font-heading); font-size: 1.8rem; font-weight: 700;
  color: var(--text-bright); margin-bottom: 4px;
}
.dash-greeting h1 span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.dash-greeting p {
  font-size: 0.9rem; color: var(--text-muted);
}

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

.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; align-items: center; gap: 16px; transition: var(--transition);
}
.stat-card:hover { border-color: rgba(255,255,255,0.12); transform: translateY(-2px); }

.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; }
.stat-value { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 700; color: var(--text-bright); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

.dash-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px;
}

.dash-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; overflow: hidden;
}
.dash-card h3 {
  font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700;
  color: var(--text-bright); margin-bottom: 20px;
}

/* Progress Ring */
.dash-progress-card {
  display: flex; flex-direction: column; align-items: center;
}
.dash-progress-ring-wrap {
  position: relative; width: 160px; height: 160px; display: flex; align-items: center; justify-content: center;
}
.progress-ring { width: 120px; height: 120px; }
.progress-ring-text {
  position: absolute; text-align: center;
}
.progress-ring-pct {
  display: block; font-family: var(--font-heading); font-size: 2rem; font-weight: 700;
  color: var(--text-bright); line-height: 1;
}
.progress-ring-label {
  display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px;
}

/* Priority bars */
.dash-bar-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.dash-bar-label {
  font-size: 0.82rem; color: var(--text-muted); width: 65px; flex-shrink: 0;
  font-family: var(--font-heading); font-weight: 600;
}
.dash-bar-track {
  flex: 1; height: 8px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden;
}
.dash-bar-fill {
  height: 100%; border-radius: 4px; transition: width 0.8s ease;
}
.dash-bar-value {
  font-family: var(--font-heading); font-weight: 700; font-size: 0.9rem;
  color: var(--text-bright); width: 24px; text-align: right;
}

/* Team workload */
.dash-member-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.dash-member-row:last-child { border-bottom: none; }
.dash-member-head {
  width: 24px; height: 24px; border-radius: 4px; image-rendering: pixelated;
}
.dash-member-name {
  font-family: var(--font-heading); font-weight: 600; color: var(--text-bright);
  font-size: 0.9rem; flex: 1;
}
.dash-member-count { font-size: 0.78rem; color: var(--text-muted); }

/* Overdue */
.dash-overdue-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer;
}
.dash-overdue-item:last-child { border-bottom: none; }
.dash-overdue-item:hover .dash-overdue-title { color: var(--primary); }
.dash-overdue-title {
  font-family: var(--font-heading); font-weight: 600; color: var(--text-bright);
  font-size: 0.9rem; transition: var(--transition);
}
.dash-overdue-date { font-size: 0.78rem; color: var(--color-danger); }

/* Activity Log */
.dash-activity-card { margin-bottom: 24px; }
.activity-list { max-height: 400px; overflow-y: auto; }

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

.activity-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.04); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 2px;
}

.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 0.85rem; color: var(--text); display: block; }
.activity-text strong { color: var(--text-bright); }
.activity-time { font-size: 0.72rem; color: var(--text-muted); }

/* === Board View === */
.board-view { padding: 24px; overflow-x: auto; }

.board-columns {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; min-width: 900px;
}

.board-column {
  background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; flex-direction: column; min-height: 400px;
}

.column-header { padding: 16px 18px; border-bottom: 1px solid var(--border); }
.column-title { display: flex; align-items: center; gap: 10px; }
.column-title h3 { font-family: var(--font-heading); font-size: 1rem; font-weight: 700; color: var(--text-bright); }

.column-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-todo { background: var(--color-todo); }
.dot-progress { background: var(--color-progress); }
.dot-review { background: var(--color-review); }
.dot-done { background: var(--color-done); }

.column-count {
  background: rgba(255, 255, 255, 0.06); color: var(--text-muted);
  font-family: var(--font-heading); font-size: 0.8rem; font-weight: 600;
  padding: 2px 9px; border-radius: 50px;
}

.column-cards {
  padding: 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; overflow-y: auto;
  min-height: 100px; transition: background 0.2s;
}

.column-cards.drag-over {
  background: rgba(27, 255, 0, 0.03);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* === Task Card === */
.task-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; cursor: pointer; transition: var(--transition); position: relative;
}
.task-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.12); box-shadow: var(--shadow); }
.task-card.dragging { opacity: 0.4; }

.task-card.task-overdue { border-left: 3px solid var(--color-danger); }

.task-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

.task-category {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--secondary); background: rgba(0, 229, 253, 0.1); padding: 2px 8px; border-radius: 4px;
}

.task-priority { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.priority-critical { background: var(--color-critical); box-shadow: 0 0 8px rgba(255, 71, 87, 0.5); }
.priority-high { background: var(--color-high); }
.priority-medium { background: var(--color-medium); }
.priority-low { background: var(--color-low); }

.task-card-title {
  font-family: var(--font-heading); font-size: 1rem; font-weight: 600;
  color: var(--text-bright); margin-bottom: 6px; line-height: 1.3;
}

.task-card-desc {
  font-size: 0.82rem; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 12px;
}

/* Subtask progress on card */
.task-card-subtasks {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.subtask-progress-bar {
  flex: 1; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden;
}
.subtask-progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px; transition: width 0.4s ease;
}
.subtask-progress-text {
  font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-heading); font-weight: 600;
}

.task-card-footer { display: flex; align-items: center; justify-content: space-between; }

.task-assignee { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); }

.task-assignee-head {
  width: 22px; height: 22px; border-radius: 4px; image-rendering: pixelated;
}

.task-assignee-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: 0.65rem; font-weight: 700; color: #000;
}

.task-card-meta { display: flex; align-items: center; gap: 8px; }

.task-meta-icon {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 0.72rem; color: var(--text-muted);
}

.task-date { font-size: 0.75rem; color: var(--text-muted); opacity: 0.7; }
.overdue-text { color: var(--color-danger) !important; opacity: 1 !important; font-weight: 600; }

.task-card-actions {
  position: absolute; top: 8px; right: 8px; display: flex; gap: 2px;
  opacity: 0; transition: var(--transition);
}
.task-card:hover .task-card-actions { opacity: 1; }

.task-move-btn {
  background: rgba(255,255,255,0.05); border: none; border-radius: 4px;
  color: var(--text-muted); cursor: pointer; padding: 4px 6px; font-size: 0.7rem;
  transition: var(--transition);
}
.task-move-btn:hover { background: rgba(27, 255, 0, 0.15); color: var(--primary); }

/* === List View === */
.list-view { padding: 24px; }

.list-table {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}

.list-header {
  display: grid; grid-template-columns: 2fr 130px 120px 150px 120px 80px;
  padding: 14px 20px; background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border); gap: 12px;
}

.list-col {
  font-family: var(--font-heading); font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted);
}

.list-row {
  display: grid; grid-template-columns: 2fr 130px 120px 150px 120px 80px;
  padding: 14px 20px; border-bottom: 1px solid var(--border); gap: 12px;
  align-items: center; cursor: pointer; transition: var(--transition);
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg-card-hover); }
.list-row.task-overdue { border-left: 3px solid var(--color-danger); }

.list-row .task-title { font-family: var(--font-heading); font-weight: 600; color: var(--text-bright); font-size: 0.95rem; }
.list-row .task-subtitle { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.list-assignee { display: inline-flex; align-items: center; gap: 6px; }
.list-assignee-head { width: 20px; height: 20px; border-radius: 4px; image-rendering: pixelated; }

.status-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  border-radius: 50px; font-size: 0.78rem; font-weight: 600; font-family: var(--font-heading);
}
.status-todo { background: rgba(136, 146, 164, 0.12); color: var(--color-todo); }
.status-in_progress { background: rgba(0, 229, 253, 0.12); color: var(--color-progress); }
.status-review { background: rgba(168, 85, 247, 0.12); color: var(--color-review); }
.status-done { background: rgba(27, 255, 0, 0.12); color: var(--color-done); }

.priority-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--text); }
.priority-badge .dot { width: 8px; height: 8px; border-radius: 50%; }

.list-row .list-actions { display: flex; gap: 4px; }

/* === Calendar View === */
.calendar-view { padding: 24px; }
.calendar-container { max-width: 1100px; margin: 0 auto; }

.calendar-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.calendar-toolbar-left {
  display: flex; align-items: center; gap: 10px;
}
.calendar-toolbar-left h2 {
  font-family: var(--font-heading); font-size: 1.4rem; font-weight: 700;
  color: var(--text-bright); min-width: 200px; text-align: center;
}
.calendar-toolbar-right {
  display: flex; align-items: center; gap: 10px;
}

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

.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border);
}
.cal-weekdays span {
  padding: 12px; text-align: center; font-family: var(--font-heading);
  font-size: 0.85rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}

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

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

.cal-day-outside {
  opacity: 0.3; cursor: default;
}
.cal-day-outside:hover { background: none; }

.cal-day-today {
  background: rgba(27, 255, 0, 0.04);
}
.cal-day-today .cal-day-num {
  background: var(--primary); color: #000; border-radius: 50%;
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
}

.cal-day-num {
  font-family: var(--font-heading); font-weight: 600; font-size: 0.85rem;
  color: var(--text-bright); display: inline-block; margin-bottom: 4px;
}

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

.cal-event {
  padding: 2px 6px; border-radius: 4px; font-size: 0.72rem; font-weight: 500;
  font-family: var(--font-heading); cursor: pointer; transition: var(--transition);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-event:hover { filter: brightness(1.2); }

.cal-event-time {
  font-weight: 700; margin-right: 4px;
}

.cal-event-deadline {
  background: rgba(255, 71, 87, 0.15); color: var(--color-danger);
  border-left: 2px solid var(--color-danger); font-weight: 600;
}

.cal-event-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.15);
  padding: 1px 4px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}

.cal-event-team {
  border-left-width: 3px;
}

.cal-event-repeat {
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 3px;
  opacity: 0.7;
  vertical-align: middle;
}

/* Calendar color picker */
.cal-color-options {
  display: flex; gap: 8px; padding: 4px 0;
}
.cal-color-opt {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: var(--transition);
  position: relative;
}
.cal-color-opt::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: attr(data-color); /* fallback below */
}
.cal-color-opt[data-color="#1BFF00"] { background: #1BFF00; }
.cal-color-opt[data-color="#00E5FD"] { background: #00E5FD; }
.cal-color-opt[data-color="#a855f7"] { background: #a855f7; }
.cal-color-opt[data-color="#ff4757"] { background: #ff4757; }
.cal-color-opt[data-color="#ff8c42"] { background: #ff8c42; }
.cal-color-opt[data-color="#ffd166"] { background: #ffd166; }
.cal-color-opt.selected { border-color: var(--text-bright); transform: scale(1.15); }
.cal-color-opt:hover { transform: scale(1.1); }

/* Time input dark mode */
.form-group input[type="time"] {
  width: 100%; padding: 12px 16px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-bright); font-family: var(--font-body); font-size: 0.95rem;
  transition: var(--transition); outline: none; color-scheme: dark;
}
.form-group input[type="time"]:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27, 255, 0, 0.1);
}

/* === My Tasks View === */
.mytasks-view { padding: 24px; }
.mytasks-container { max-width: 900px; margin: 0 auto; }

.mytasks-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.mytasks-header h2 {
  font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; color: var(--text-bright);
}

.mytasks-stats { display: flex; gap: 16px; }
.mytask-stat {
  font-size: 0.85rem; color: var(--text-muted);
  font-family: var(--font-heading); font-weight: 500;
}
.mytask-stat strong {
  font-size: 1.1rem; color: var(--text-bright);
}

.mytask-section { margin-bottom: 24px; }
.mytask-section-title {
  font-family: var(--font-heading); font-size: 1rem; font-weight: 700;
  color: var(--text-bright); margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.mytask-section-title span { color: var(--text-muted); font-weight: 500; }
.mytask-section-title.mytask-overdue { border-color: var(--color-danger); color: var(--color-danger); }
.mytask-section-title.mytask-progress { border-color: var(--color-progress); }
.mytask-section-title.mytask-todo { border-color: var(--color-todo); }
.mytask-section-title.mytask-review { border-color: var(--color-review); }
.mytask-section-title.mytask-done { border-color: var(--color-done); }

.mytask-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; cursor: pointer; transition: var(--transition);
}
.mytask-item:hover { border-color: rgba(255,255,255,0.12); transform: translateX(4px); }
.mytask-item.task-overdue { border-left: 3px solid var(--color-danger); }

.mytask-item-info { flex: 1; min-width: 0; }
.mytask-item-title {
  font-family: var(--font-heading); font-weight: 600; color: var(--text-bright);
  font-size: 0.95rem; display: block;
}
.mytask-item-cat { font-size: 0.75rem; color: var(--text-muted); }
.mytask-item-sub {
  font-size: 0.75rem; color: var(--secondary); font-family: var(--font-heading); font-weight: 600;
  background: rgba(0,229,253,0.1); padding: 2px 8px; border-radius: 4px;
}
.mytask-item-date { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }

/* === Mail View === */
.mail-view { padding: 24px; height: calc(100vh - 64px); }

.mail-layout {
  display: grid; grid-template-columns: 240px 1fr;
  max-width: 1300px; margin: 0 auto; height: 100%;
  gap: 16px;
}

/* Sidebar */
.mail-sidebar {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
}
.mail-sidebar-header {
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.mail-sidebar-header h3 {
  font-family: var(--font-heading); font-size: 1rem; font-weight: 700;
  color: var(--text-bright);
}

.mail-accounts-list { flex: 1; overflow-y: auto; padding: 8px; }

.mail-account-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition); margin-bottom: 4px;
}
.mail-account-item:hover { background: rgba(255,255,255,0.04); }
.mail-account-item.active {
  background: rgba(27, 255, 0, 0.08); border: 1px solid rgba(27, 255, 0, 0.2);
}

.mail-account-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mail-account-icon svg { color: #000; }

.mail-account-info { flex: 1; min-width: 0; }
.mail-account-email {
  font-family: var(--font-heading); font-size: 0.82rem; font-weight: 600;
  color: var(--text-bright); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mail-account-count {
  font-size: 0.7rem; color: var(--text-muted);
}

.mail-add-account-btn { margin: 8px; flex-shrink: 0; }

/* Main area */
.mail-main-area { display: flex; flex-direction: column; min-height: 0; }

.mail-setup {
  display: flex; align-items: center; justify-content: center;
  flex: 1;
}
.mail-setup-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 48px; text-align: center; max-width: 420px;
}
.mail-setup-card h2 {
  font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700;
  color: var(--text-bright); margin: 16px 0 8px;
}
.mail-setup-card p { color: var(--text-muted); margin-bottom: 24px; font-size: 0.9rem; }

.mail-main { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.mail-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; flex-wrap: wrap; gap: 10px;
}
.mail-toolbar-left { display: flex; gap: 8px; }
.mail-toolbar-right { display: flex; gap: 8px; }

.mail-content {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; flex: 1; min-height: 400px;
}

.mail-loading {
  padding: 40px; text-align: center; color: var(--text-muted); font-size: 0.9rem;
}

.mail-list-item {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 12px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
}
.mail-list-item:last-child { border-bottom: none; }
.mail-list-item:hover { background: var(--bg-card-hover); }
.mail-list-item.mail-unread { background: rgba(27, 255, 0, 0.02); }
.mail-list-item.mail-unread .mail-item-subject {
  color: var(--text-bright); font-weight: 700;
}

.mail-item-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.mail-item-dot.unread { background: var(--primary); box-shadow: 0 0 6px rgba(27, 255, 0, 0.4); }
.mail-item-dot.read { background: transparent; }

.mail-item-content { min-width: 0; }
.mail-item-from {
  font-family: var(--font-heading); font-size: 0.85rem; font-weight: 600;
  color: var(--text-bright); margin-bottom: 2px;
}
.mail-item-subject {
  font-size: 0.9rem; color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.mail-item-preview {
  font-size: 0.8rem; color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
}

.mail-item-date {
  font-size: 0.75rem; color: var(--text-muted); white-space: nowrap;
  font-family: var(--font-heading); font-weight: 500;
}

.mail-empty {
  padding: 60px 24px; text-align: center; color: var(--text-muted);
}
.mail-empty svg { margin-bottom: 12px; opacity: 0.3; }

/* Mail Detail */
.mail-detail { padding: 24px; }
.mail-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.mail-detail-actions { display: flex; gap: 8px; }

.mail-detail-subject {
  font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700;
  color: var(--text-bright); margin-bottom: 12px;
}

.mail-detail-meta {
  display: flex; flex-direction: column; gap: 4px;
  padding-bottom: 16px; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-muted);
}
.mail-detail-meta strong { color: var(--text-bright); }

.mail-detail-body {
  font-size: 0.9rem; color: var(--text); line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}

/* Compose textarea larger */
#composeBody { min-height: 200px; }

/* === Members View === */
.members-view { padding: 24px; max-width: 1200px; margin: 0 auto; }

.members-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px;
}
.members-header h2 { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; color: var(--text-bright); }

.members-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px;
}

.member-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; text-align: center; transition: var(--transition);
  position: relative; overflow: hidden;
}
.member-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0; transition: var(--transition);
}
.member-card:hover { transform: translateY(-4px); border-color: rgba(27, 255, 0, 0.2); box-shadow: var(--shadow-glow-primary); }
.member-card:hover::before { opacity: 1; }

.member-avatar-wrap {
  position: relative; width: 64px; height: 64px; margin: 0 auto 14px;
}
.member-avatar-img {
  width: 64px; height: 64px; border-radius: 50%;
  border: 3px solid var(--border); transition: var(--transition);
  image-rendering: pixelated; object-fit: cover;
}
.member-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.4rem; font-weight: 700; color: #000;
  border: 3px solid var(--border); transition: var(--transition);
}
.member-card:hover .member-avatar-img,
.member-card:hover .member-avatar { border-color: var(--primary); box-shadow: 0 0 20px rgba(27, 255, 0, 0.2); }

.online-indicator {
  position: absolute; bottom: 2px; right: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  border: 3px solid var(--bg-card);
  transition: var(--transition);
}
.online-indicator.online {
  background: var(--primary);
  box-shadow: 0 0 8px rgba(27, 255, 0, 0.6);
}
.online-indicator.offline {
  background: var(--text-muted);
}

.online-label {
  font-size: 0.75rem; font-weight: 600; margin-bottom: 6px; display: inline-block;
}
.online-label.online { color: var(--primary); }
.online-label.offline { color: var(--text-muted); }

.member-name { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; color: var(--text-bright); margin-bottom: 4px; }

.member-role {
  font-size: 0.85rem; font-weight: 500; padding: 4px 14px; border-radius: 50px;
  display: inline-block; margin-bottom: 14px;
}

.member-stats {
  display: flex; justify-content: center; gap: 20px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.member-stat { text-align: center; }
.member-stat-value { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; color: var(--text-bright); }
.member-stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* === Tickets View === */
.tickets-view { padding: 24px; }
.tickets-container { max-width: 1100px; margin: 0 auto; }

.tickets-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.tickets-header h2 {
  font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; color: var(--text-bright);
}

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

.tickets-list-container {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}

.ticket-list-item {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: var(--transition);
}
.ticket-list-item:last-child { border-bottom: none; }
.ticket-list-item:hover { background: var(--bg-card-hover); }

.ticket-status-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.ticket-status-dot.ticket-active {
  background: var(--primary); box-shadow: 0 0 6px rgba(27, 255, 0, 0.5);
}
.ticket-status-dot.ticket-inactive {
  background: var(--text-muted);
}

.ticket-info { min-width: 0; }
.ticket-user {
  font-family: var(--font-heading); font-weight: 600; font-size: 0.95rem;
  color: var(--text-bright);
}
.ticket-meta {
  font-size: 0.78rem; color: var(--text-muted); margin-top: 2px;
  display: flex; gap: 12px;
}

.ticket-msg-count {
  font-family: var(--font-heading); font-weight: 600; font-size: 0.82rem;
  color: var(--secondary); background: rgba(0, 229, 253, 0.1);
  padding: 2px 10px; border-radius: 50px; white-space: nowrap;
}

.ticket-date {
  font-size: 0.78rem; color: var(--text-muted); white-space: nowrap;
  font-family: var(--font-heading); font-weight: 500;
}

/* Ticket detail messages */
.ticket-messages { display: flex; flex-direction: column; gap: 10px; }
.ticket-msg {
  padding: 10px 14px; background: rgba(255,255,255,0.02);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.ticket-msg-header {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px;
}
.ticket-msg-author {
  font-family: var(--font-heading); font-weight: 600; font-size: 0.85rem;
  color: var(--text-bright);
}
.ticket-msg-time { font-size: 0.7rem; color: var(--text-muted); }
.ticket-msg-text {
  font-size: 0.85rem; color: var(--text); white-space: pre-wrap; word-break: break-word;
}

/* Ticket claimed badge */
/* Ticket filter bar */
.tickets-filter-bar {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.tickets-filter-btn.active {
  background: var(--primary); color: var(--bg); border-color: var(--primary);
}

/* Ticket open/closed indicator */
.ticket-open-badge {
  font-size: 0.7rem; font-weight: 700; padding: 2px 8px;
  border-radius: 50px; text-transform: uppercase; letter-spacing: 0.5px;
}
.ticket-open-badge.open {
  background: rgba(27,255,0,0.12); color: var(--primary);
}
.ticket-open-badge.closed {
  background: rgba(136,146,164,0.12); color: var(--text-muted);
}

.ticket-claimed-badge {
  font-size: 0.78rem; font-weight: 600;
  padding: 3px 10px; border-radius: 50px;
  background: rgba(27,255,0,0.12); color: var(--primary);
  font-family: var(--font-heading);
}
.ticket-claimed-badge.unclaimed {
  background: rgba(255,209,102,0.12); color: var(--color-medium);
}

/* Ticket list - claimed/user avatars */
.ticket-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  vertical-align: middle; margin-right: 6px;
}
.ticket-claimed-tag {
  font-size: 0.72rem; font-weight: 600;
  padding: 1px 6px; border-radius: 50px;
  background: rgba(27,255,0,0.1); color: var(--primary);
  margin-left: 8px;
}
.ticket-claimed-tag.unclaimed {
  background: rgba(255,209,102,0.1); color: var(--color-medium);
}

/* Ticket detail layout */
.ticket-detail-layout {
  display: flex; gap: 0; padding: 0 !important; min-height: 450px;
}
.ticket-info-sidebar {
  width: 220px; flex-shrink: 0; padding: 16px;
  border-right: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
  display: flex; flex-direction: column; gap: 12px;
  font-size: 0.82rem;
}
.ticket-info-sidebar .info-label {
  color: var(--text-muted); font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.ticket-info-sidebar .info-value {
  color: var(--text-bright); font-family: var(--font-heading);
  font-weight: 600; font-size: 0.88rem;
  display: flex; align-items: center; gap: 6px;
}
.ticket-info-sidebar .info-avatar {
  width: 24px; height: 24px; border-radius: 50%;
}
.ticket-chat-area {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
}
.ticket-messages-scroll {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
  max-height: 400px;
}
.ticket-msg.web-msg {
  background: rgba(27,255,0,0.05);
  border-color: rgba(27,255,0,0.15);
}
.ticket-msg.web-msg .ticket-msg-author {
  color: var(--primary);
}
.ticket-actions-list {
  display: flex; flex-direction: column; gap: 6px;
}
.ticket-actions-list .btn {
  justify-content: flex-start; gap: 6px; font-size: 0.78rem;
  padding: 6px 10px;
}
.ticket-reply-box {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.1);
  align-items: flex-end;
}
.ticket-reply-box textarea {
  flex: 1; resize: none; min-height: 36px;
}
.ticket-reply-box .btn {
  flex-shrink: 0; height: 36px;
}

@media (max-width: 768px) {
  .tickets-stats { grid-template-columns: 1fr; }
  .ticket-list-item { grid-template-columns: auto 1fr; }
  .ticket-msg-count, .ticket-date { display: none; }
  .ticket-detail-layout { flex-direction: column; }
  .ticket-info-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
}

/* === Server View === */
.server-view { padding: 24px; }
.server-container { max-width: 1200px; margin: 0 auto; }

.server-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.server-header h2 {
  font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; color: var(--text-bright);
}
.server-refresh-info {
  font-size: 0.8rem; color: var(--text-muted); font-family: var(--font-heading);
}

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

.server-stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; position: relative; overflow: hidden;
}
.server-stat-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
}

.server-stat-label {
  font-family: var(--font-heading); font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.server-stat-value {
  font-family: var(--font-heading); font-size: 2rem; font-weight: 700;
  color: var(--text-bright); line-height: 1;
}
.server-stat-sub {
  font-size: 0.78rem; color: var(--text-muted); margin-top: 6px;
}

.server-gauge {
  width: 100%; height: 6px; background: rgba(255,255,255,0.06);
  border-radius: 3px; overflow: hidden; margin-top: 10px;
}
.server-gauge-fill {
  height: 100%; border-radius: 3px; transition: width 0.8s ease;
}

@media (max-width: 1024px) {
  .server-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .server-stats-grid { grid-template-columns: 1fr 1fr; }
}

/* === Admin View === */
.admin-view { padding: 24px; }

.admin-container { max-width: 1200px; margin: 0 auto; }

.admin-section {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 24px; overflow: hidden;
}

.admin-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.admin-section-header h2 {
  font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; color: var(--text-bright);
}

.admin-table { padding: 0; }

.admin-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border); transition: var(--transition);
}
.admin-row:last-child { border-bottom: none; }
.admin-row:hover { background: var(--bg-card-hover); }

.admin-row-info { display: flex; align-items: center; gap: 14px; flex: 1; }

.admin-row-avatar-img {
  width: 40px; height: 40px; border-radius: 50%;
  image-rendering: pixelated; flex-shrink: 0;
}

.admin-row-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: 0.9rem; font-weight: 700; color: #000; flex-shrink: 0;
}

.admin-row-details { display: flex; flex-direction: column; }
.admin-row-name { font-family: var(--font-heading); font-weight: 600; color: var(--text-bright); font-size: 1rem; }
.admin-row-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }

.admin-row-badge {
  font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 50px;
  font-family: var(--font-heading);
}

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

.role-color-dot {
  width: 14px; height: 14px; border-radius: 50%; display: inline-block;
  border: 2px solid rgba(255,255,255,0.1); flex-shrink: 0;
}

.admin-empty {
  padding: 40px 24px; text-align: center; color: var(--text-muted); font-size: 0.9rem;
}

/* === Modal === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px); z-index: 2000; display: none;
  align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease-out; }

.modal {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  position: relative; animation: slideUp 0.3s ease-out;
}
.modal::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}
.modal-sm { max-width: 400px; }
.modal-lg { max-width: 640px; }
.modal-xl { max-width: 900px; }

.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 24px 28px 16px; }
.modal-header h2 { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; color: var(--text-bright); }

.modal-close {
  background: none; border: none; color: var(--text-muted); font-size: 1.5rem;
  cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm);
  transition: var(--transition); line-height: 1;
}
.modal-close:hover { color: var(--text-bright); background: rgba(255,255,255,0.05); }

.modal-body { padding: 0 28px 16px; }
.modal-footer { padding: 16px 28px 24px; display: flex; justify-content: flex-end; gap: 10px; }

/* === Subtasks in Modal === */
.subtasks-section { margin-top: 8px; }

.subtask-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: rgba(255,255,255,0.02); border-radius: var(--radius-sm);
  margin-bottom: 6px; border: 1px solid var(--border);
}

.subtask-check {
  width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0;
}

.subtask-text {
  flex: 1; font-size: 0.9rem; color: var(--text);
}
.subtask-done { text-decoration: line-through; opacity: 0.5; }

.subtask-del {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 1.1rem; padding: 0 4px; transition: var(--transition);
}
.subtask-del:hover { color: var(--color-danger); }

.subtask-add {
  display: flex; gap: 8px; margin-top: 8px;
}
.subtask-add input {
  flex: 1; padding: 8px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-bright); font-size: 0.85rem; outline: none;
  font-family: var(--font-body);
}
.subtask-add input:focus { border-color: var(--primary); }

/* === Comments in Modal === */
.comments-section { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 16px; }

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

.comment-item {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.comment-item:last-child { border-bottom: none; }

.comment-avatar {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  image-rendering: pixelated;
}
.comment-avatar-fallback {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: 0.6rem; font-weight: 700; color: #000;
}

.comment-body { flex: 1; min-width: 0; }
.comment-header {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px;
}
.comment-header strong { font-size: 0.85rem; color: var(--text-bright); font-family: var(--font-heading); }
.comment-time { font-size: 0.7rem; color: var(--text-muted); }
.comment-text { font-size: 0.85rem; color: var(--text); margin: 0; white-space: pre-wrap; word-break: break-word; }

.comment-add {
  display: flex; gap: 8px; align-items: flex-end;
}
.comment-add textarea {
  flex: 1; padding: 8px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-bright); font-size: 0.85rem; outline: none;
  font-family: var(--font-body); resize: none; min-height: 40px;
}
.comment-add textarea:focus { border-color: var(--primary); }

/* === Toast === */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary); color: #000; padding: 12px 28px;
  border-radius: var(--radius); font-family: var(--font-heading);
  font-weight: 600; font-size: 0.95rem; z-index: 10000; opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: var(--color-danger); color: #fff; }

/* === Empty State === */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; color: var(--text-muted); text-align: center;
}
.empty-state svg { margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 0.9rem; }

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* === Responsive === */
@media (max-width: 1200px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .board-columns { grid-template-columns: repeat(2, 1fr); min-width: 0; }
  .dash-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-tabs { display: none; }
  .nav-container { height: 56px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left { flex-direction: column; }
  .search-box { min-width: 0; width: 100%; }
  .filter-group { width: 100%; }
  .filter-select { flex: 1; }
  .board-columns { grid-template-columns: 1fr; min-width: 0; }
  .list-header, .list-row { grid-template-columns: 1fr; gap: 8px; }
  .list-header .col-status, .list-header .col-priority, .list-header .col-assignee,
  .list-header .col-date, .list-header .col-actions { display: none; }
  .list-row .col-status, .list-row .col-priority { display: inline-flex; }
  .list-row .col-assignee, .list-row .col-date, .list-row .col-actions { display: none; }
  .modal { max-height: 100vh; border-radius: var(--radius); }
  .form-row { grid-template-columns: 1fr; }
  .members-grid { grid-template-columns: 1fr; }
  .admin-section-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .admin-row { flex-direction: column; gap: 12px; align-items: flex-start; }
  .admin-row-actions { width: 100%; justify-content: flex-end; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .mytasks-header { flex-direction: column; align-items: flex-start; }
  .calendar-toolbar { flex-direction: column; align-items: flex-start; }
  .cal-day { min-height: 60px; padding: 4px; }
  .cal-day-num { font-size: 0.75rem; }
  .cal-event { font-size: 0.6rem; }
  .mail-layout { grid-template-columns: 1fr; }
  .mail-sidebar { max-height: 150px; }
}

@media (max-width: 768px) {
  .nav-tabs {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    background: var(--bg-nav); backdrop-filter: blur(20px);
    border-top: 1px solid var(--border); border-radius: 0;
    justify-content: center; padding: 6px 0;
  }
  .nav-tab span { display: none; }
  .nav-tab { padding: 8px 10px; }
  .main-content { padding-bottom: 60px; }
}
