/* ============================================
   PM Mini Desk — Stylesheet
   Sections: Variables/Themes, Layout, Sidebar,
   Header, Views, Cards, Tables, Kanban, Forms,
   Modals, Buttons, Toasts, Utilities, Responsive
   ============================================ */

/* ====== CSS Variables — Light Theme (default) ====== */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #f8f9fb;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #ede9fe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --info: #0891b2;
  --info-light: #cffafe;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #4f46e5;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-w: 240px;
  --header-h: 60px;
  --transition: 0.2s ease;
}

/* ====== Dark Theme ====== */
[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-alt: #243044;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #818cf8;
  --primary-hover: #6366f1;
  --primary-light: #312e81;
  --success: #22c55e;
  --success-light: #14532d;
  --warning: #f59e0b;
  --warning-light: #422006;
  --danger: #ef4444;
  --danger-light: #450a0a;
  --info: #06b6d4;
  --info-light: #083344;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #6366f1;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.4);
}

/* ====== Reset / Base ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}
a { text-decoration: none; color: inherit; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }

/* ====== App Layout ====== */
.app-layout { display: flex; min-height: 100vh; }

/* ====== Sidebar ====== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-icon { font-size: 22px; }
.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  margin-bottom: 2px;
  transition: all var(--transition);
  font-size: 14px;
  font-weight: 500;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item span:first-child { font-size: 18px; width: 22px; text-align: center; }
.sidebar-footer { padding: 14px 20px; font-size: 12px; color: rgba(255,255,255,0.4); }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 150;
}
.sidebar-backdrop.active { display: block; }

/* ====== Main Content ====== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ====== Header ====== */
.header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-search { flex: 1; max-width: 500px; }
.header-search input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text);
  outline: none;
  transition: border var(--transition);
}
.header-search input:focus { border-color: var(--primary); }
.header-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.header-date { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background var(--transition);
}
.icon-btn:hover { background: var(--surface-alt); }
.menu-toggle { display: none; }

/* ====== View Container ====== */
.view-container { flex: 1; padding: 24px; overflow-x: hidden; }

/* ====== Section / View Headers ====== */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.view-title { font-size: 22px; font-weight: 700; }
.view-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-icon { padding: 5px 8px; font-size: 16px; background: none; border: none; cursor: pointer; border-radius: var(--radius-sm); color: var(--text-muted); transition: all var(--transition); }
.btn-icon:hover { background: var(--surface-alt); color: var(--text); }

/* ====== Summary Cards (Dashboard) ====== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.summary-card:hover { transform: translateY(-2px); }
.summary-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.summary-info .summary-value { font-size: 28px; font-weight: 700; line-height: 1; }
.summary-info .summary-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.icon-blue { background: var(--info-light); }
.icon-green { background: var(--success-light); }
.icon-red { background: var(--danger-light); }
.icon-purple { background: var(--primary-light); }
.icon-orange { background: var(--warning-light); }

/* ====== Section Block ====== */
.section-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.section-block-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ====== Toolbar / Filters ====== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.toolbar input, .toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border var(--transition);
}
.toolbar input { flex: 1; min-width: 180px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); }
.toolbar select { min-width: 120px; }

/* ====== View Toggle ====== */
.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-toggle button {
  padding: 7px 14px;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: all var(--transition);
}
.view-toggle button.active { background: var(--primary); color: #fff; }

/* ====== Project Cards ====== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.project-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.project-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.project-card-title { font-size: 16px; font-weight: 600; }
.project-card-desc { font-size: 13px; color: var(--text-muted); }
.project-card-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.project-card-meta span { display: flex; align-items: center; gap: 4px; color: var(--text-muted); }
.progress-bar-container { width: 100%; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.4s ease; }
.progress-bar-fill.over-budget { background: var(--danger); }

/* ====== Task Time Tracking ====== */
.task-time-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.task-time-bar { margin-top: 4px; height: 5px; }
.time-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.time-summary-item { text-align: center; }
.time-summary-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.time-summary-value { font-size: 15px; font-weight: 700; }
.section-divider {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.time-log-table td { font-size: 13px; }

/* ====== Daily Pace (red/green) ====== */
.pace-on-track { color: var(--success); font-weight: 600; }
.pace-delayed { color: var(--danger); font-weight: 600; }
.pace-bar-green { background: var(--success) !important; }
.pace-bar-red { background: var(--danger) !important; }
.task-pace-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-top: 4px;
}
.task-pace-bars {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pace-row-label {
  font-size: 11px;
  margin-bottom: 2px;
}
.pace-daily-target { color: var(--text-muted); font-size: 10px; }
.pace-panel {
  margin-top: 16px;
  padding: 12px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.pace-panel-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.pace-cumulative { line-height: 1.5; }
.pace-cumulative-compact {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-muted);
}
.project-card-actions { display: flex; gap: 4px; justify-content: flex-end; border-top: 1px solid var(--border); padding-top: 10px; }

/* ====== Generic Table ====== */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table tbody tr:hover { background: var(--surface-alt); }
.data-table .actions-cell { white-space: nowrap; text-align: right; }

/* ====== Badges ====== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-planning, .badge-todo { background: var(--info-light); color: var(--info); }
.badge-active, .badge-progress { background: var(--primary-light); color: var(--primary); }
.badge-hold, .badge-review, .badge-leave { background: var(--warning-light); color: var(--warning); }
.badge-completed, .badge-done, .badge-available { background: var(--success-light); color: var(--success); }
.badge-archived, .badge-blocked, .badge-busy { background: var(--danger-light); color: var(--danger); }
.badge-low { background: var(--success-light); color: var(--success); }
.badge-medium { background: var(--info-light); color: var(--info); }
.badge-high { background: var(--warning-light); color: var(--warning); }
.badge-critical { background: var(--danger-light); color: var(--danger); }

/* ====== Tag Chips ====== */
.tag-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin: 2px;
}

/* ====== Kanban Board ====== */
.kanban-board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
  min-height: 400px;
}
.kanban-column {
  flex: 0 0 280px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.kanban-column.drag-over { border-color: var(--primary); border-style: dashed; }
.kanban-column-header {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.kanban-column-count {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.kanban-column-body {
  padding: 10px;
  flex: 1;
  overflow-y: auto;
  min-height: 80px;
}
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: box-shadow var(--transition), border var(--transition);
}
.kanban-card:hover { box-shadow: var(--shadow); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.4; }
.kanban-card.overdue { border-color: var(--danger); border-left: 3px solid var(--danger); }
.kanban-card-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.kanban-card-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.kanban-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* ====== Task List ====== */
.task-row { display: flex; align-items: center; gap: 10px; }
.task-row.done .task-title { text-decoration: line-through; opacity: 0.6; }

/* ====== Team Cards ====== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform var(--transition);
}
.team-card:hover { transform: translateY(-2px); }
.team-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  background: var(--primary-light); color: var(--primary);
  flex-shrink: 0;
}
.team-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.team-card-name { font-size: 16px; font-weight: 600; }
.team-card-role { font-size: 13px; color: var(--text-muted); }
.team-card-info { font-size: 13px; color: var(--text-muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.team-stats { display: flex; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.team-stat { text-align: center; flex: 1; }
.team-stat-value { font-size: 20px; font-weight: 700; }
.team-stat-label { font-size: 11px; color: var(--text-muted); }

/* ====== Workload Bar ====== */
.workload-bar { width: 100%; height: 24px; background: var(--border); border-radius: 4px; overflow: hidden; position: relative; }
.workload-bar-fill { height: 100%; transition: width 0.4s ease; display: flex; align-items: center; padding-left: 8px; font-size: 11px; color: #fff; font-weight: 600; }
.workload-bar-fill.low { background: var(--success); }
.workload-bar-fill.medium { background: var(--warning); }
.workload-bar-fill.high { background: var(--danger); }

/* ====== Notes ====== */
.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.note-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.note-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.note-content { font-size: 14px; color: var(--text); margin-bottom: 10px; white-space: pre-wrap; }
.note-actions-list { margin-top: 8px; }
.action-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.action-item .checkbox { width: 16px; height: 16px; cursor: pointer; }

/* ====== Charts / Reports ====== */
.chart-bar-container { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding: 10px 0; }
.chart-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 60px; border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.5s ease; position: relative; }
.chart-bar-value { font-size: 12px; font-weight: 600; }
.chart-bar-label { font-size: 12px; color: var(--text-muted); text-align: center; word-break: break-word; }
.report-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.report-bar-label { width: 120px; font-size: 13px; text-align: right; flex-shrink: 0; }
.report-bar-track { flex: 1; height: 24px; background: var(--border); border-radius: 4px; overflow: hidden; }
.report-bar-fill-val { height: 100%; border-radius: 4px; display: flex; align-items: center; padding-left: 8px; font-size: 11px; color: #fff; font-weight: 600; transition: width 0.5s ease; }

/* ====== Modal ====== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-wide { max-width: 640px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

/* ====== Forms ====== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 70px; }
.form-group .error-text { color: var(--danger); font-size: 12px; margin-top: 4px; display: none; }
.form-group.has-error input, .form-group.has-error select, .form-group.has-error textarea { border-color: var(--danger); }
.form-group.has-error .error-text { display: block; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

/* ====== Confirm Dialog ====== */
.confirm-dialog {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.confirm-dialog-icon { font-size: 40px; margin-bottom: 12px; }
.confirm-dialog-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.confirm-dialog-message { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.confirm-dialog-actions { display: flex; gap: 10px; justify-content: center; }

/* ====== Toast ====== */
.toast-root {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: toastIn 0.3s ease;
  max-width: 320px;
}
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-info { border-left-color: var(--info); }
.toast.toast-warning { border-left-color: var(--warning); }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ====== Empty State ====== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.empty-state-text { font-size: 14px; }

/* ====== Utilities ====== */
.hidden { display: none !important; }
.flex-gap { display: flex; gap: 10px; align-items: center; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 20px; }
.danger-text { color: var(--danger); font-size: 13px; }
.two-col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.settings-group-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.settings-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.settings-item:last-child { border-bottom: none; }
.settings-item-desc { font-size: 13px; color: var(--text-muted); }

/* ====== Priority list items ====== */
.priority-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  margin-bottom: 8px;
}
.priority-list-item.overdue { border-left: 3px solid var(--danger); }

/* ====== Upcoming deadline item ====== */
.deadline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.deadline-item:last-child { border-bottom: none; }

/* ====== Responsive ====== */
@media (max-width: 1024px) {
  .two-col-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .header-date { display: none; }
  .view-container { padding: 16px; }
  .kanban-column { flex: 0 0 240px; }
  .form-row { flex-direction: column; }
}
@media (max-width: 480px) {
  .header-search { max-width: none; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .summary-card { padding: 14px; }
  .summary-icon { width: 40px; height: 40px; font-size: 20px; }
  .summary-info .summary-value { font-size: 22px; }
  .project-grid, .team-grid { grid-template-columns: 1fr; }
  .chart-bar-container { height: 150px; gap: 8px; }
  .report-bar-label { width: 80px; font-size: 12px; }
}

/* ====== Login Page ====== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .brand-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.login-brand h1 { font-size: 22px; margin-bottom: 4px; }
.login-brand p { color: var(--text-muted); font-size: 14px; }
.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 20px;
  cursor: pointer;
}
.login-submit { width: 100%; padding: 10px; }
.login-error {
  color: var(--danger);
  background: var(--danger-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 16px;
}
.login-error:empty { display: none; }
.header-user { font-size: 13px; color: var(--text-muted); margin-right: 8px; }

/* ====== Work Time helpers ====== */
.wt-time-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.wt-chip {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
}
.wt-chip:hover { background: var(--surface); border-color: var(--primary, #3b82f6); }
.wt-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.wt-preview {
  font-size: 13px;
  font-weight: 600;
  margin-left: 8px;
  color: var(--text-muted);
}
.wt-quick-create {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.wt-quick-create input[type="text"] {
  min-width: 160px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.wt-today-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--primary, #3b82f6);
  color: #fff;
  margin-left: 6px;
  vertical-align: middle;
}

/* ====== Study ====== */
.study-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  min-height: calc(100vh - 180px);
}
.study-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
}
.study-list-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  padding: 4px 8px 10px;
}
.study-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.study-item:hover { background: var(--surface-alt); }
.study-item.active {
  background: var(--surface-alt);
  border-color: var(--primary);
}
.study-item-icon { font-size: 16px; line-height: 1.4; }
.study-item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.study-item-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.study-item-file {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.study-viewer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 180px);
  overflow: hidden;
}
.study-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.study-viewer-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.study-frame {
  flex: 1;
  width: 100%;
  border: 0;
  min-height: 520px;
  background: #fff;
}

@media (max-width: 900px) {
  .study-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .study-list {
    max-height: 240px;
  }
  .study-viewer {
    min-height: 70vh;
  }
}


