/* ==========================================================================
   TUMY - Red & White Light Theme Design System
   ========================================================================== */

:root {
  /* Colors */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-hover: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-focus: #e50914;
  
  --primary: #e50914;
  --primary-hover: #b91c1c;
  --primary-light: rgba(229, 9, 20, 0.08);
  --primary-glow: rgba(229, 9, 20, 0.2);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #475569;
  --text-on-primary: #ffffff;
  
  /* Status & Priorities */
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);
  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  
  --priority-low: #10b981;
  --priority-medium: #f59e0b;
  --priority-high: #f97316;
  --priority-urgent: #dc2626;
  
  /* Shadows & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-red: 0 8px 20px rgba(229, 9, 20, 0.25);
  
  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Be Vietnam Pro', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(229, 9, 20, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(220, 38, 38, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* SVG Icon alignment */
.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

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

a:hover {
  color: var(--primary-hover);
}

/* Layout */
.sidebar {
  width: 260px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

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

/* Brand Logo HTML Text - Premium Typography */
.brand-logo {
  display: inline-flex;
  align-items: center;
  font-family: 'Be Vietnam Pro', 'Inter', sans-serif;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -0.5px;
  user-select: none;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(229, 9, 20, 0.18);
}

.brand-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.brand-logo .logo-tumy {
  color: var(--primary);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #e50914, #ff4e50);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-logo-lg {
  font-size: 2.2rem;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}

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

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-sub);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.nav-link.active {
  background-color: var(--primary);
  color: var(--text-on-primary);
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.nav-icon {
  font-size: 1.15rem;
}

.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.nav-link.active .nav-badge {
  background: white;
  color: var(--primary);
}

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

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #fafafa;
}

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

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.user-details {
  overflow: hidden;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-logout {
  font-size: 1.1rem;
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-logout:hover {
  color: var(--danger);
  background-color: var(--danger-bg);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 90;
  display: none;
}

/* Main Content */
.main-content {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  sticky: top;
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

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

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 12px 24px -4px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 20px 30px -5px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
  border-color: rgba(229, 9, 20, 0.1);
}

.card-header {
  padding: 22px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
}

.card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  background-color: #fafafa;
}

/* Stat Cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 12px 24px -4px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 20px 30px -5px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #e50914 0%, #b91c1c 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f91924 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(229, 9, 20, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #ffffff;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: #cbd5e1;
}

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

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
}

.btn-ghost:hover {
  background-color: var(--bg-hover);
  color: var(--text-main);
}

.btn-ghost.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

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

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.25s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.1);
}

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

.form-input-sm, .form-select-sm {
  padding: 8px 12px;
  font-size: 0.875rem;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.775rem;
  font-weight: 600;
}

.badge-sm {
  padding: 2px 8px;
  font-size: 0.725rem;
}

.priority-low { background: rgba(16, 185, 129, 0.12); color: #047857; }
.priority-medium { background: rgba(245, 158, 11, 0.12); color: #b45309; }
.priority-high { background: rgba(249, 115, 22, 0.12); color: #c2410c; }
.priority-urgent { background: rgba(220, 38, 38, 0.15); color: #b91c1c; font-weight: 700; animation: pulseRed 2s infinite; }

@keyframes pulseRed {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.status-todo { background: #f1f5f9; color: #475569; }
.status-doing { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.status-done { background: var(--success-bg); color: var(--success); }

.overdue { background: rgba(220, 38, 38, 0.1); color: var(--danger); font-weight: 700; }
.due-today { background: rgba(245, 158, 11, 0.15); color: #b45309; font-weight: 700; }
.due-soon { background: rgba(59, 130, 246, 0.1); color: var(--info); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  z-index: 10;
  transform: translateY(15px);
  transition: var(--transition);
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-sm { max-width: 420px; }
.modal-lg { max-width: 720px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background-color: #fafafa;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  background-color: #fafafa;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.9rem;
}

.table tbody tr:hover {
  background-color: var(--bg-hover);
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* Toast */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  padding: 14px 20px;
  background: #ffffff;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  animation: slideInRight 0.3s ease;
}

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

/* Page Today Hero */
.today-hero {
  background: #ffffff;
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(229, 9, 20, 0.1);
  position: relative;
}

.hero-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.hero-desc {
  color: var(--text-sub);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

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

/* Task List */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-icon {
  margin-right: 12px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.ai-icon {
  object-fit: contain;
  border-radius: 4px;
}

.task-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.task-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.task-priority-bar {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
}

.task-info {
  flex: 1;
}

.task-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

/* Kanban */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.kanban-column {
  background: #f1f5f9;
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 500px;
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.task-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

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

.task-card-title {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-main);
}

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

.task-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  border-top: 1px solid #f1f5f9;
  padding-top: 8px;
}

/* Pomodoro */
.pomodoro-container {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.timer-ring-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto 24px;
}

.timer-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.timer-bg-ring {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 8;
}

.timer-ring {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.timer-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-phase {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.timer-display {
  font-size: 3.25rem;
  font-weight: 900;
  color: var(--text-main);
  letter-spacing: -1px;
}

/* Habits Matrix */
.habit-table {
  width: 100%;
  border-collapse: collapse;
}

.habit-table th, .habit-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
}

.habit-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: inline-block;
  cursor: pointer;
  transition: var(--transition);
}

.habit-dot.done {
  background-color: var(--primary);
  border-color: var(--primary);
}

.habit-dot-label input {
  display: none;
}

.habit-quick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.habit-quick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.habit-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.habit-quick-item.checked .habit-check-inner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
}

/* Utility Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; justify-content: center; }
.flex-gap { gap: 12px; }
.flex-wrap { flex-wrap: wrap; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.85rem; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.p-0 { padding: 0 !important; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h3 {
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 4px;
}

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

/* Icon picker */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.icon-option {
  cursor: pointer;
}

.icon-option input { display: none; }
.icon-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  transition: var(--transition);
}

.icon-option input:checked + span {
  background-color: var(--primary-light);
  border: 1px solid var(--primary);
}

/* Responsive */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .kanban-board { grid-template-columns: 1fr; }
}
/* ===== Dropdown ===== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  min-width: 150px;
  padding: 8px 0;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-item:hover {
  background-color: var(--background);
  color: var(--primary);
}

.dropdown-item.text-danger:hover {
  background-color: #fef2f2;
  color: var(--danger);
}

/* ===== Project Icon ===== */
.project-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close {
    display: block;
  }
  .sidebar-overlay.active {
    display: block;
  }
  .main-content {
    margin-left: 0;
  }
  .hamburger {
    display: flex;
  }
  .top-bar {
    padding: 14px 16px;
  }
  .page-content {
    padding: 16px;
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

.lucide-icon,
.lucide-icon svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  flex-shrink: 0;
}

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stat-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-success {
  background: var(--success, #10b981);
  color: #fff;
  border: 1px solid transparent;
}

.btn-success:hover {
  background: #059669;
  color: #fff;
}

.timer-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.timer-actions {
  display: flex;
  justify-content: center;
}

.pomodoro-global-widget { display: none !important; }

/* Focus Mode */
.focus-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.focus-card--compact {
  border-left: 4px solid #ef4444;
}

.focus-card--phase-break.focus-card--compact,
.focus-card--phase-long_break.focus-card--compact {
  border-left-color: #10b981;
}

.focus-card--large {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

.focus-compact {
  padding: 18px 20px 14px;
}

.focus-compact-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.focus-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.focus-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.focus-badge-live.is-paused,
.focus-card--phase-work .focus-badge-live:empty {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.focus-badge-phase {
  background: #f1f5f9;
  color: #64748b;
}

.focus-expand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: var(--transition);
}

.focus-expand:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff5f5;
}

.focus-compact-body {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.focus-compact-main {
  flex: 1;
  min-width: 0;
}

.focus-compact-task {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.35;
  color: var(--text-main);
}

.focus-progress-track {
  height: 6px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
}

.focus-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f97316);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.focus-card--phase-break .focus-progress-bar,
.focus-card--phase-long_break .focus-progress-bar {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.focus-progress-meta {
  margin-top: 6px;
}

.focus-compact-timer {
  text-align: center;
  flex-shrink: 0;
  min-width: 88px;
}

.focus-compact-timer .focus-time {
  font-size: 2.25rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text-main);
}

.focus-time-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.focus-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

.focus-toolbar .btn {
  min-height: 38px;
}

.focus-toolbar .btn-ghost {
  padding-left: 12px;
  padding-right: 12px;
}

.focus-idle {
  padding: 24px;
  text-align: center;
}

.focus-idle-header h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.focus-task-picker {
  margin: 16px 0;
}

.focus-ring-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto 20px;
}

.focus-ring-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.focus-ring-bg {
  fill: none;
  stroke: #e2e8f0;
  stroke-width: 8;
}

.focus-ring-progress {
  fill: none;
  stroke: #ef4444;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.focus-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.focus-phase {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.focus-time {
  font-size: 3.25rem;
  font-weight: 900;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}

.focus-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
}

.focus-toolbar .focus-controls,
.focus-active-content > .focus-toolbar {
  margin-top: 0;
}

.focus-complete-row {
  display: none;
}

.focus-card--large .focus-toolbar {
  justify-content: center;
  border-top: none;
  background: transparent;
  padding: 20px 0 0;
}

.focus-card--large .focus-active-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.focus-card--large .focus-task-name {
  max-width: 360px;
}

.focus-top-pill {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #ef4444;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}

.focus-top-pill:hover {
  border-color: #ef4444;
  color: #dc2626;
}

.focus-top-pill-label {
  color: var(--text-muted);
  font-weight: 500;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
}

@media (max-width: 768px) {
  .focus-top-pill-label {
    display: none;
  }

  .focus-compact-time {
    font-size: 1.5rem;
  }
}
