/* ============================================================
   LABSMRO Work Management System
   Premium Dark Mode CSS with Glassmorphism
   ============================================================ */

/* ─────────────── RESET & VARIABLES ─────────────── */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-tertiary: #1e293b;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(20px);

  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.15);
  --primary-glow: rgba(59, 130, 246, 0.4);

  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.15);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.15);
  --info: #06b6d4;
  --info-soft: rgba(6, 182, 212, 0.15);
  --purple: #8b5cf6;
  --purple-soft: rgba(139, 92, 246, 0.15);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dark: #334155;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --sidebar-width: 260px;
  --header-height: 60px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px var(--primary-glow);

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

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

img { max-width: 100%; }

::selection {
  background: var(--primary-soft);
  color: var(--text-primary);
}

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


/* ─────────────── APP LAYOUT ─────────────── */
#app {
  width: 100%;
  height: 100vh;
}

.app-login {
  width: 100%;
  height: 100vh;
}

.app-layout {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  background: var(--bg-primary);
}


/* ─────────────── SIDEBAR ─────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100;
  transition: transform var(--transition-slow);
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2) drop-shadow(0 0 8px var(--primary-glow)); }
}

.sidebar-brand-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.sidebar-brand-subtitle {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

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

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-normal);
  position: relative;
  margin-bottom: 2px;
  text-decoration: none;
}

.sidebar-item:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.sidebar-item.active {
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 600;
}

.sidebar-item.active .sidebar-icon {
  color: var(--primary);
}

.sidebar-active-indicator {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary);
  border-radius: 3px 0 0 3px;
  animation: indicatorSlide 0.3s ease;
}

@keyframes indicatorSlide {
  from { height: 0; opacity: 0; }
  to { height: 20px; opacity: 1; }
}

.sidebar-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.sidebar-item:hover .sidebar-icon {
  color: var(--text-primary);
}

.sidebar-divider {
  height: 1px;
  background: var(--border-color);
  margin: 10px 14px;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
}

.sidebar-version {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}


/* ─────────────── HEADER ─────────────── */
.header {
  height: var(--header-height);
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 50;
}

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

.header-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.header-menu-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.header-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

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

.header-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.header-user-details {
  display: flex;
  flex-direction: column;
}

.header-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-user-dept {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.header-role-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.header-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.header-logout-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}


/* ─────────────── BUTTONS ─────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 18px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.15), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}

.btn:active::after {
  opacity: 1;
  transition: opacity 0s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #1d4ed8);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
  transform: translateY(-1px);
}

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

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: 6px;
  width: 32px;
  height: 32px;
}

.btn-back {
  gap: 4px;
}

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


/* ─────────────── GLASS CARD ─────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--border-hover);
}


/* ─────────────── FORM ELEMENTS ─────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group-lg {
  flex: 1;
}

.form-group-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 14px;
  font-family: var(--font-family);
  font-size: 0.85rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-normal);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

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

.form-select-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
  padding-right: 28px;
  background-position: right 8px center;
}

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

.form-input-sm {
  width: 90px;
  padding: 5px 8px;
  font-size: 0.78rem;
}

.form-color {
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

.input-icon-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.input-icon-wrapper .form-input {
  padding-left: 38px;
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row-2 > .form-group { flex: 1; min-width: 200px; }
.form-row-3 > .form-group { flex: 1; min-width: 160px; }

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

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

.color-preview {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}


/* ─────────────── TOGGLE SWITCH ─────────────── */
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-checkbox {
  display: none;
}

.toggle-slider {
  width: 38px;
  height: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  position: relative;
  transition: all var(--transition-normal);
}

.toggle-slider::after {
  content: '';
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all var(--transition-normal);
}

.toggle-checkbox:checked + .toggle-slider {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.toggle-checkbox:checked + .toggle-slider::after {
  background: var(--primary);
  transform: translateX(18px);
}

.toggle-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}


/* ─────────────── LOGIN PAGE ─────────────── */
.login-container {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.login-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
}

.login-orb-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  right: -100px;
  animation: orbFloat1 8s ease-in-out infinite;
}

.login-orb-2 {
  width: 350px;
  height: 350px;
  background: var(--purple);
  bottom: -80px;
  left: -80px;
  animation: orbFloat2 10s ease-in-out infinite;
}

.login-orb-3 {
  width: 250px;
  height: 250px;
  background: var(--info);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orbFloat3 12s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-30px, 40px) scale(1.1); }
  66% { transform: translate(20px, -20px) scale(0.95); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.15); }
}

@keyframes orbFloat3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.2; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.3; }
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: loginCardEnter 0.6s ease;
}

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

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  display: inline-flex;
  margin-bottom: 16px;
  animation: logoBounce 0.8s ease 0.3s both;
}

@keyframes logoBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.login-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-form {
  margin-bottom: 16px;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-footer {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 24px;
}

.spinner {
  animation: spin 1s linear infinite;
}

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

.btn-loader {
  display: inline-flex;
  align-items: center;
}


/* ─────────────── PAGE CONTENT ─────────────── */
.page-content {
  max-width: 1400px;
  margin: 0 auto;
  animation: pageEnter 0.35s ease;
}

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

.page-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-action-left,
.page-action-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-action-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.page-back-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.page-sub-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}


/* ─────────────── STAT CARDS ─────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card-total::before  { background: linear-gradient(90deg, var(--primary), var(--purple)); }
.stat-card-progress::before { background: linear-gradient(90deg, var(--info), var(--primary)); }
.stat-card-waiting::before  { background: linear-gradient(90deg, var(--warning), #fb923c); }
.stat-card-complete::before { background: linear-gradient(90deg, var(--success), #4ade80); }

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

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

.stat-card-total .stat-card-icon  { background: var(--primary-soft); color: var(--primary); }
.stat-card-progress .stat-card-icon { background: var(--info-soft); color: var(--info); }
.stat-card-waiting .stat-card-icon  { background: var(--warning-soft); color: var(--warning); }
.stat-card-complete .stat-card-icon { background: var(--success-soft); color: var(--success); }

.stat-card-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}


/* ─────────────── DASHBOARD CHARTS ─────────────── */
.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-normal);
}

.chart-card:hover {
  border-color: var(--border-hover);
}

.chart-card-header {
  margin-bottom: 16px;
}

.chart-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-card-body {
  height: 280px;
  position: relative;
}


/* ─────────────── DASHBOARD BOTTOM ─────────────── */
.dashboard-bottom-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dashboard-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 12px 16px;
  max-height: 300px;
  overflow-y: auto;
}

/* Delayed tasks */
.delayed-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-decoration: none;
  color: inherit;
}
.delayed-task-item:hover {
  background: var(--bg-card-hover);
}

.delayed-task-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  display: block;
}

.delayed-task-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.delayed-task-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  flex-shrink: 0;
}
.delayed-task-badge.warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.delayed-task-badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* Activity Timeline */
.activity-timeline {
  position: relative;
  padding-left: 20px;
}

.activity-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.activity-item {
  position: relative;
  padding: 8px 0 8px 16px;
}

.activity-dot {
  position: absolute;
  left: -20px;
  top: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-primary);
}
.activity-dot.create { background: var(--success); }
.activity-dot.update { background: var(--primary); }
.activity-dot.comment { background: var(--info); }

.activity-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: block;
}

.activity-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}


/* ─────────────── EMPTY & LOADING STATES ─────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.empty-state-mini {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.empty-state-mini svg { margin-bottom: 8px; }

.loading-state {
  text-align: center;
  padding: 60px 20px;
}

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

.loading-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
}


/* ─────────────── FILTER BAR ─────────────── */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-group {
  min-width: 120px;
}

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

.filter-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select {
  min-width: 100px;
}


/* ─────────────── TASK TABLE ─────────────── */
.task-list-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-group {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.task-group:hover {
  border-color: var(--border-hover);
}

.task-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.task-group-header:hover {
  background: var(--bg-card-hover);
}

.task-group-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.task-group-color {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  flex-shrink: 0;
}

.task-group-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.task-group-count {
  padding: 1px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
}

.task-group-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.task-group-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}
.task-group-toggle svg {
  transition: transform var(--transition-normal);
}

.task-group.collapsed .task-group-toggle svg {
  transform: rotate(-90deg);
}

.task-group-body {
  overflow: hidden;
  transition: all var(--transition-normal);
  max-height: 2000px;
}

.task-group-body.collapsed {
  max-height: 0;
}

.task-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.task-table thead {
  background: rgba(255,255,255,0.02);
  border-top: 1px solid var(--border-color);
}

.task-table th {
  padding: 8px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.task-table td {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255,255,255,0.03);
}

.task-row {
  cursor: pointer;
  transition: background var(--transition-fast);
}

.task-row:hover {
  background: var(--bg-card-hover);
}

.task-completed {
  opacity: 0.55;
}

.th-num, .td-num {
  width: 40px;
  text-align: center;
  color: var(--text-muted);
}

.th-title { min-width: 200px; }

.td-title {
  font-weight: 500;
  color: var(--text-primary);
}

.task-title-text {
  display: inline-block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.th-status, .td-status { width: 90px; }
.th-priority, .td-priority { width: 80px; }
.th-assignee, .td-assignee { width: 120px; }
.th-progress, .td-progress { width: 150px; }
.th-due, .td-due { width: 110px; white-space: nowrap; }


/* ─────────────── STATUS BADGES ─────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.status-not-started, .status-not_started {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
}

.status-in-progress, .status-in_progress {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-complete {
  background: var(--success-soft);
  color: var(--success);
}

.status-deferred {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-suspended {
  background: var(--danger-soft);
  color: var(--danger);
}


/* ─────────────── PRIORITY DOTS ─────────────── */
.priority-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.priority-high {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.priority-normal {
  background: var(--warning);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.priority-low {
  background: var(--success);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.priority-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}


/* ─────────────── PROGRESS BARS ─────────────── */
.progress-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-track-lg {
  height: 10px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.progress-bar-fill-animated::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-value {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

.progress-bar-sm .progress-bar-track {
  height: 4px;
}


/* ─────────────── TASK FORM ─────────────── */
.task-form {
  max-width: 900px;
}

.form-card {
  margin-bottom: 20px;
  overflow: hidden;
}

.form-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
}

.form-card-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.form-card-body {
  padding: 20px 22px;
}

/* Assignee rows */
.assignee-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assignee-row {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeSlideIn 0.25s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.assignee-input-group {
  flex: 1;
}

.btn-remove-assignee {
  color: var(--text-muted);
}
.btn-remove-assignee:hover {
  color: var(--danger);
  background: var(--danger-soft);
}


/* ─────────────── TASK DETAIL ─────────────── */
.task-detail-content {
  max-width: 900px;
}

.detail-header {
  padding: 24px;
  margin-bottom: 20px;
}

.detail-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.4;
}

.detail-header-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-meta-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-meta-value {
  font-size: 0.88rem;
  color: var(--text-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-tag {
  padding: 2px 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Detail sections */
.detail-section {
  padding: 20px 24px;
  margin-bottom: 16px;
}

.detail-section-warning {
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.03);
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.detail-section-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.detail-notes-content {
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--border-color);
}

.warning-text {
  border-left-color: var(--warning);
  color: #fbbf24;
}

.detail-progress-bar {
  margin-bottom: 16px;
}

.detail-progress-value {
  font-size: 1.5rem;
  font-weight: 800;
}

.detail-chart-container {
  height: 200px;
  margin-top: 12px;
}


/* ─────────────── COMMENTS ─────────────── */
.comment-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.comments-timeline {
  margin-bottom: 16px;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  animation: fadeSlideIn 0.3s ease;
}

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

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

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

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

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

.comment-content {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.comment-form {
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

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

.comment-textarea {
  flex: 1;
  min-height: 44px;
}


/* ─────────────── WEEKLY UPDATE ─────────────── */
.weekly-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
}

.weekly-info-icon { flex-shrink: 0; padding-top: 2px; }

.weekly-info-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.weekly-info-text strong {
  color: var(--text-primary);
}

.weekly-table-container {
  overflow-x: auto;
}

.weekly-table {
  width: 100%;
  border-collapse: collapse;
}

.weekly-table th {
  padding: 10px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.weekly-table td {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.weekly-row:hover {
  background: var(--bg-card-hover);
}

.weekly-task-link {
  color: var(--text-primary);
  font-weight: 500;
  transition: color var(--transition-fast);
}
.weekly-task-link:hover {
  color: var(--primary);
}

.weekly-progress-input {
  width: 80px;
  text-align: center;
  padding: 6px 8px;
  font-weight: 600;
}

.delta-value {
  font-size: 0.82rem;
  font-weight: 700;
}
.delta-positive { color: var(--success); }
.delta-negative { color: var(--danger); }
.delta-zero { color: var(--text-muted); }


/* ─────────────── CATEGORY MANAGEMENT ─────────────── */
.category-list-container {
  overflow: hidden;
}

.category-list {
  padding: 8px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  border: 1px solid transparent;
  cursor: default;
}

.category-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color);
}

.category-item.dragging {
  opacity: 0.4;
}

.category-item.drag-over {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.category-drag-handle {
  color: var(--text-muted);
  cursor: grab;
  padding: 4px;
  opacity: 0.4;
  transition: opacity var(--transition-fast);
}
.category-item:hover .category-drag-handle { opacity: 1; }

.category-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
}

.category-info {
  flex: 1;
  min-width: 0;
}

.category-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.category-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.category-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.category-item:hover .category-actions { opacity: 1; }

/* Category Form Overlay */
.category-form-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.category-form-overlay.active {
  opacity: 1;
}

.category-form-card {
  width: 100%;
  max-width: 440px;
  padding: 28px;
  margin: 20px;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-normal);
}

.category-form-overlay.active .category-form-card {
  transform: scale(1) translateY(0);
}

.category-form-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.user-form-card {
  max-width: 560px;
}


/* ─────────────── USER MANAGEMENT ─────────────── */
.user-table-container {
  overflow-x: auto;
}

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

.data-table th {
  padding: 10px 14px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.data-table tr:hover {
  background: var(--bg-card-hover);
}

.data-table .row-inactive {
  opacity: 0.45;
}

.th-actions, .td-actions {
  text-align: right;
  white-space: nowrap;
}

.td-actions {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
}

.user-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.code-text {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 1px 6px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.role-admin {
  background: var(--purple-soft);
  color: var(--purple);
}

.role-user {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
}

.active-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}

.active-yes {
  background: var(--success-soft);
  color: var(--success);
}

.active-no {
  background: var(--danger-soft);
  color: var(--danger);
}


/* ─────────────── TOAST ─────────────── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  min-width: 280px;
  max-width: 440px;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(30px);
  transition: all var(--transition-normal);
}

.toast.toast-enter {
  opacity: 1;
  transform: translateX(0);
}

.toast.toast-exit {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
  to { opacity: 0; transform: translateX(30px); }
}

.toast-icon { flex-shrink: 0; }

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }

.toast-message {
  flex: 1;
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.toast-close:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}


/* ─────────────── MODAL ─────────────── */
#modal-container { position: relative; z-index: 9000; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal-overlay.modal-enter { opacity: 1; }

.modal-overlay.modal-exit {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-dialog {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  margin: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
  transform: scale(0.9) translateY(10px);
  transition: transform var(--transition-normal);
}

.modal-overlay.modal-enter .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-icon { margin-bottom: 16px; }

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.modal-body {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-actions .btn {
  min-width: 100px;
}


/* ─────────────── UTILITY CLASSES ─────────────── */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }

.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mt-6 { margin-top: 24px; }
.mb-6 { margin-bottom: 24px; }


/* ─────────────── RESPONSIVE ─────────────── */
@media (max-width: 1024px) {
  .dashboard-charts {
    grid-template-columns: 1fr;
  }
  .dashboard-bottom-row {
    grid-template-columns: 1fr;
  }
  .detail-meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .header-menu-toggle {
    display: flex;
  }

  .main-content {
    padding: 16px;
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-bar {
    padding: 12px 14px;
    gap: 8px;
  }

  .filter-group {
    min-width: 100%;
  }

  .filter-search-group {
    min-width: 100%;
  }

  .page-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .page-action-left,
  .page-action-right {
    justify-content: space-between;
  }

  .form-row-2 > .form-group,
  .form-row-3 > .form-group {
    min-width: 100%;
  }

  .detail-header-top {
    flex-direction: column;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .task-title-text {
    max-width: 180px;
  }

  .comment-input-row {
    flex-direction: column;
  }

  .header-user-details { display: none; }

  .weekly-table-container {
    overflow-x: auto;
  }

  .toast {
    min-width: auto;
    max-width: calc(100vw - 40px);
  }
}

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

  .stat-card {
    padding: 14px 16px;
  }

  .stat-card-value {
    font-size: 1.4rem;
  }

  .login-card {
    margin: 16px;
    padding: 28px 24px;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr;
  }

  .task-table .th-priority,
  .task-table .td-priority,
  .task-table .th-assignee,
  .task-table .td-assignee {
    display: none;
  }
}


/* ─────────────── MICRO-ANIMATIONS ─────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.stat-card { animation: slideUp 0.4s ease both; }
.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.chart-card { animation: scaleIn 0.4s ease both; }
.chart-card:nth-child(1) { animation-delay: 0.15s; }
.chart-card:nth-child(2) { animation-delay: 0.25s; }

.dashboard-panel { animation: slideUp 0.4s ease both; }
.dashboard-panel:nth-child(1) { animation-delay: 0.2s; }
.dashboard-panel:nth-child(2) { animation-delay: 0.3s; }

.task-group { animation: slideUp 0.3s ease both; }
.task-group:nth-child(1) { animation-delay: 0.05s; }
.task-group:nth-child(2) { animation-delay: 0.1s; }
.task-group:nth-child(3) { animation-delay: 0.15s; }
.task-group:nth-child(4) { animation-delay: 0.2s; }

.category-item { animation: slideUp 0.3s ease both; }
.category-item:nth-child(n) { animation-delay: calc(0.05s * var(--i, 0)); }

/* Subtle hover transitions for all interactive elements */
.sidebar-item,
.btn,
.task-row,
.delayed-task-item,
.category-item {
  will-change: transform, background;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Custom date input styling for dark mode */
input[type="date"] {
  color-scheme: dark;
}

input[type="number"] {
  color-scheme: dark;
}

/* Print styles */
@media print {
  .sidebar, .header, .filter-bar, .page-action-bar,
  .btn, .comment-form { display: none !important; }

  .main-wrapper { margin-left: 0; }
  .main-content { padding: 0; }

  body, .main-content { background: white; color: black; }
}
