/* ============================================================
   TaskFlow — Premium UI Styles
   Design: Dark industrial with electric accents
   Font: Syne (headings) + DM Sans (body)
   ============================================================ */

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

:root {
  --bg-base:       #0d0f14;
  --bg-surface:    #13161e;
  --bg-card:       #181c26;
  --bg-input:      #1e2230;
  --border:        #2a2f3e;
  --border-light:  #343a4d;
  --text-primary:  #e8eaf0;
  --text-secondary:#8b91a8;
  --text-muted:    #555c72;
  --accent:        #5b7fff;
  --accent-hover:  #4a6cef;
  --accent-glow:   rgba(91,127,255,0.2);
  --green:         #22c55e;
  --amber:         #f59e0b;
  --red:           #ef4444;
  --pink:          #ec4899;
  --sidebar-w:     260px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:     0 8px 48px rgba(0,0,0,0.6);
  --transition:    0.18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5 { font-family: 'Syne', sans-serif; }

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

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ── AUTH PAGE ───────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91,127,255,0.08) 0%, transparent 70%);
  top: -200px; left: -200px;
  pointer-events: none;
}
.auth-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,197,94,0.06) 0%, transparent 70%);
  bottom: -100px; right: -100px;
  pointer-events: none;
}
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: fadeUp 0.4s ease;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.auth-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.auth-logo span { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 22px; }

/* ── LAYOUT ──────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.sidebar-logo span { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 18px; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: rgba(91,127,255,0.3);
}
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 15px; }
.nav-item .nav-label { font-size: 13.5px; font-weight: 500; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
  text-transform: uppercase;
}
.user-info { flex: 1; min-width: 0; }
.user-info .uname { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .urole { font-size: 11px; color: var(--text-muted); }
.btn-logout { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; transition: color var(--transition); }
.btn-logout:hover { color: var(--red); }

/* ── MAIN CONTENT ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.page-content { padding: 28px; flex: 1; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-sm { padding: 16px 20px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; }

/* ── STAT CARDS ──────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), border-color var(--transition);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-light); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.06;
  transform: translate(20px, -20px);
}
.stat-card.blue::before { background: var(--accent); }
.stat-card.green::before { background: var(--green); }
.stat-card.amber::before { background: var(--amber); }
.stat-card.red::before { background: var(--red); }
.stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}
.stat-icon.blue  { background: rgba(91,127,255,0.15); color: var(--accent); }
.stat-icon.green { background: rgba(34,197,94,0.15); color: var(--green); }
.stat-icon.amber { background: rgba(245,158,11,0.15); color: var(--amber); }
.stat-icon.red   { background: rgba(239,68,68,0.15); color: var(--red); }
.stat-value { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; margin-bottom: 2px; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: rgba(239,68,68,0.1); color: var(--red); border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-ghost { background: none; border: none; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-card); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ── FORMS ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.form-control, .form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-select option { background: var(--bg-card); }
.input-group { position: relative; }
.input-group .form-control { padding-left: 38px; }
.input-group .input-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.input-group.has-eye .form-control { padding-right: 40px; }
.input-group .eye-toggle {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
}

/* ── TABLES ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.tf-table { width: 100%; border-collapse: collapse; }
table.tf-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
table.tf-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-secondary);
}
table.tf-table tr:last-child td { border-bottom: none; }
table.tf-table tbody tr:hover td { background: rgba(255,255,255,0.02); color: var(--text-primary); }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-todo        { background: rgba(139,145,168,0.15); color: var(--text-secondary); }
.badge-in_progress { background: rgba(91,127,255,0.15); color: var(--accent); }
.badge-done        { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-low         { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-medium      { background: rgba(245,158,11,0.12); color: var(--amber); }
.badge-high        { background: rgba(239,68,68,0.12); color: var(--red); }
.badge-critical    { background: rgba(236,72,153,0.12); color: var(--pink); }
.badge-admin       { background: rgba(91,127,255,0.15); color: var(--accent); }
.badge-user        { background: rgba(139,145,168,0.1); color: var(--text-secondary); }
.badge-active      { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-inactive    { background: rgba(239,68,68,0.12); color: var(--red); }

/* ── KANBAN ──────────────────────────────────────────────── */
.kanban-board { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.kanban-col {
  flex: 0 0 300px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.kanban-col-title {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700;
}
.col-dot { width: 8px; height: 8px; border-radius: 50%; }
.col-dot.todo { background: var(--text-muted); }
.col-dot.in_progress { background: var(--accent); }
.col-dot.done { background: var(--green); }
.col-count {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}
.kanban-cards {
  padding: 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: grab;
  transition: all var(--transition);
  position: relative;
}
.kanban-card:hover { border-color: var(--border-light); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.kanban-card.dragging { opacity: 0.5; cursor: grabbing; }
.kanban-card.drag-over { border-color: var(--accent); background: var(--accent-glow); }
.kanban-card-title { font-size: 13.5px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.kanban-card-meta { display: flex; align-items: center; justify-content: space-between; }
.kanban-card-project { font-size: 11px; color: var(--text-muted); }
.kanban-card-due { font-size: 11px; color: var(--text-muted); }
.kanban-card-due.overdue { color: var(--red); }
.kanban-card-footer { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.priority-dot.low { background: var(--green); }
.priority-dot.medium { background: var(--amber); }
.priority-dot.high { background: var(--red); }
.priority-dot.critical { background: var(--pink); }
.assignee-chip {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
}
.assignee-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  text-transform: uppercase;
}
.drop-zone { border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 16px; text-align: center; color: var(--text-muted); font-size: 12px; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; padding: 4px 8px; border-radius: 6px; transition: color var(--transition); }
.modal-close:hover { color: var(--text-primary); background: var(--bg-card); }
.modal-body { padding: 24px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--border); }

/* ── TOAST ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px;
  max-width: 360px;
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: slideInRight 0.3s ease;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.info    { border-left: 3px solid var(--accent); }
.toast-icon { font-size: 16px; }
.toast.success .toast-icon { color: var(--green); }
.toast.error   .toast-icon { color: var(--red); }
.toast.warning .toast-icon { color: var(--amber); }
.toast.info    .toast-icon { color: var(--accent); }
.toast-msg { font-size: 13px; color: var(--text-primary); flex: 1; }
.toast.hiding { animation: fadeOut 0.3s ease forwards; }

/* ── LOADING ─────────────────────────────────────────────── */
.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.page-loader {
  display: flex; align-items: center; justify-content: center;
  height: 200px;
  flex-direction: column; gap: 12px;
  color: var(--text-muted);
}

/* ── FILTERS ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-bar .form-select, .filter-bar .form-control {
  width: auto;
  min-width: 140px;
}

/* ── PROGRESS BAR ────────────────────────────────────────── */
.progress { height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.progress-bar.blue { background: var(--accent); }
.progress-bar.green { background: var(--green); }

/* ── ATTENDANCE STATUS ───────────────────────────────────── */
.attendance-status {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; animation: pulse 2s infinite; }
.status-dot.online { background: var(--green); }
.status-dot.offline { background: var(--text-muted); animation: none; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

/* ── MOBILE TOGGLE ───────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
}

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeIn    { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp    { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeOut   { to { opacity: 0; transform: translateX(20px); } }
@keyframes scaleIn   { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes spin      { to { transform: rotate(360deg); } }
@keyframes pulse     { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .page-content { padding: 16px; }
  .kanban-col { flex: 0 0 260px; }
  .auth-card { padding: 32px 24px; }
  .topbar { padding: 0 16px; }
}
