/* ========== Base ========== */
* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ========== Navigation ========== */
.nav-label { padding: 12px 16px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 16px; font-size: 13px; color: #64748b; text-decoration: none; border-radius: 6px; margin: 1px 8px; transition: all 0.15s; }
.nav-item:hover { background: #f1f5f9; color: #334155; }
.nav-item.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.nav-item i { width: 18px; text-align: center; font-size: 13px; }

/* ========== Cards ========== */
.card { background: white; border-radius: 12px; border: 1px solid #e2e8f0; padding: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 700; color: #1e293b; }
.card-sm { padding: 16px; }

/* ========== Metric Cards ========== */
.metric-card { background: white; border-radius: 12px; border: 1px solid #e2e8f0; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.metric-value { font-size: 28px; font-weight: 800; color: #1e293b; }
.metric-label { font-size: 12px; color: #94a3b8; font-weight: 500; }
.metric-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }

/* ========== Buttons ========== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; border: none; }
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: #dcfce7; color: #16a34a; }
.btn-success:hover { background: #bbf7d0; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid #e2e8f0; background: white; cursor: pointer; color: #64748b; font-size: 13px; }
.btn-icon:hover { background: #f1f5f9; color: #334155; }

/* ========== Badges ========== */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-blue { background: #dbeafe; color: #2563eb; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-yellow { background: #fef3c7; color: #d97706; }
.badge-purple { background: #ede9fe; color: #7c3aed; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-orange { background: #ffedd5; color: #ea580c; }

/* ========== Forms ========== */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 4px; }
.form-input { width: 100%; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 13px; transition: border-color 0.15s; outline: none; }
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
select.form-input { appearance: auto; }
textarea.form-input { resize: vertical; min-height: 80px; }

/* ========== Table ========== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 12px; font-weight: 600; color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 2px solid #e2e8f0; background: #f8fafc; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tr:hover td { background: #f8fafc; }

/* ========== Calendar ========== */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e2e8f0; border-radius: 12px; overflow: hidden; }
.cal-header { padding: 8px; text-align: center; font-size: 11px; font-weight: 700; color: #64748b; background: #f8fafc; text-transform: uppercase; }
.cal-day { min-height: 100px; background: white; padding: 6px; cursor: pointer; transition: background 0.1s; position: relative; }
.cal-day:hover { background: #f8fafc; }
.cal-day.today { background: #eff6ff; }
.cal-day.other-month { opacity: 0.4; }
.cal-day-num { font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 4px; }
.cal-event { font-size: 10px; padding: 2px 4px; border-radius: 3px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }

/* ========== Day Panel ========== */
.day-panel { position: fixed; right: 0; top: 0; width: 460px; height: 100vh; background: white; box-shadow: -4px 0 20px rgba(0,0,0,0.1); z-index: 40; overflow-y: auto; transform: translateX(100%); transition: transform 0.3s ease; }
.day-panel.open { transform: translateX(0); }
.timeline-hour { display: grid; grid-template-columns: 60px 1fr; min-height: 48px; border-bottom: 1px solid #f1f5f9; }
.timeline-label { font-size: 10px; color: #94a3b8; padding: 4px 8px; text-align: right; }
.timeline-slot { padding: 2px 8px; position: relative; }

/* ========== Kanban ========== */
.kanban-board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 16px; }
.kanban-column { min-width: 280px; max-width: 300px; background: #f8fafc; border-radius: 12px; padding: 12px; flex-shrink: 0; }
.kanban-column-title { font-size: 13px; font-weight: 700; color: #475569; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.kanban-card { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; margin-bottom: 8px; cursor: pointer; transition: box-shadow 0.15s; }
.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* ========== Gantt ========== */
.gantt-bar { height: 24px; border-radius: 4px; position: relative; min-width: 20px; }
.gantt-row { display: flex; align-items: center; padding: 4px 0; border-bottom: 1px solid #f1f5f9; }

/* ========== Timetable ========== */
.timetable-grid { display: grid; grid-template-columns: 80px repeat(5, 1fr); gap: 1px; background: #e2e8f0; border-radius: 12px; overflow: hidden; }
.timetable-header { padding: 10px; text-align: center; font-size: 12px; font-weight: 700; color: #64748b; background: #f8fafc; }
.timetable-cell { background: white; min-height: 56px; padding: 4px; position: relative; }
.timetable-time { font-size: 10px; color: #94a3b8; padding: 4px 8px; background: #f8fafc; display: flex; align-items: center; justify-content: flex-end; }
.timetable-course { font-size: 10px; padding: 6px 8px; border-radius: 6px; color: white; font-weight: 600; min-height: 42px; }

/* ========== Week Pills ========== */
.week-pill { width: 30px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 11px; font-weight: 600; cursor: pointer; border: 1.5px solid #e2e8f0; background: white; color: #94a3b8; transition: all 0.15s; }
.week-pill:hover { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; }
.week-pill.active { background: #3b82f6; color: white; border-color: #3b82f6; }
.week-pill.current { border-color: #f59e0b; }
.week-pill.current.active { border-color: #3b82f6; }

/* ========== Slot Editor ========== */
.slot-row { display: flex; gap: 6px; align-items: center; padding: 6px 8px; background: #f8fafc; border-radius: 8px; margin-bottom: 6px; }
.slot-row select, .slot-row input { font-size: 12px; padding: 5px 8px; border: 1px solid #e2e8f0; border-radius: 6px; }
.slot-row .slot-remove { color: #dc2626; cursor: pointer; font-size: 14px; padding: 4px; border-radius: 4px; }
.slot-row .slot-remove:hover { background: #fee2e2; }

/* ========== Pomodoro Timer ========== */
.pomo-circle { width: 200px; height: 200px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 6px solid #e2e8f0; position: relative; }
.pomo-circle.active { border-color: #3b82f6; animation: pulse 2s infinite; }
.pomo-time { font-size: 42px; font-weight: 800; color: #1e293b; font-variant-numeric: tabular-nums; }
.pomo-label { font-size: 12px; color: #94a3b8; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.2); } 50% { box-shadow: 0 0 0 12px rgba(59,130,246,0); } }

/* ========== Filter Bar ========== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filter-chip { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; cursor: pointer; border: 1px solid #e2e8f0; background: white; color: #64748b; transition: all 0.15s; }
.filter-chip:hover { border-color: #3b82f6; color: #3b82f6; }
.filter-chip.active { background: #3b82f6; color: white; border-color: #3b82f6; }

/* ========== Tab Bar ========== */
.tab-bar { display: flex; gap: 0; border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; }
.tab-item { padding: 10px 20px; font-size: 13px; font-weight: 600; color: #94a3b8; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.tab-item:hover { color: #475569; }
.tab-item.active { color: #3b82f6; border-bottom-color: #3b82f6; }

/* ========== Toast ========== */
.toast { padding: 12px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; animation: slideIn 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.toast-success { background: #dcfce7; color: #16a34a; }
.toast-error { background: #fee2e2; color: #dc2626; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ========== Responsive ========== */
@media (max-width: 767px) {
  .day-panel { width: 100% !important; }
  .kanban-board { flex-direction: column; }
  .kanban-column { min-width: 100%; max-width: 100%; }
  .timetable-grid { grid-template-columns: 50px repeat(5, 1fr); font-size: 10px; }
  .timetable-header, .timetable-time { font-size: 10px; padding: 4px; }
  .timetable-course { font-size: 9px; padding: 3px 4px; }
  .table-responsive { overflow-x: auto; }
  .data-table { min-width: 500px; }
}
@media (max-width: 480px) {
  .pomo-circle { width: 160px; height: 160px; }
  .pomo-time { font-size: 34px; }
  .metric-value { font-size: 22px !important; }
  .card { padding: 14px; }
}

/* ========== Countdown ========== */
.countdown-bar { height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; }
.countdown-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }

/* ========== Priority Dots ========== */
.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.priority-critical { background: #dc2626; }
.priority-high { background: #f59e0b; }
.priority-medium { background: #3b82f6; }
.priority-low { background: #94a3b8; }

/* ========== Empty State ========== */
.empty-state { text-align: center; padding: 48px 20px; color: #94a3b8; }
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; }
