/* ============================================================
   JSIPM - Dark Theme (Notion-inspired)
   ============================================================ */

:root {
  --bg-primary: #191919;
  --bg-secondary: #1e1e1e;
  --bg-card: #252525;
  --bg-card-hover: #2a2a2a;
  --bg-input: #2d2d2d;
  --bg-sidebar: #1a1a1a;
  --text-primary: #e8e8e8;
  --text-secondary: #a0a0a0;
  --text-muted: #666;
  --accent: #4c9eff;
  --accent-hover: #3a8bef;
  --accent-subtle: rgba(76,158,255,0.1);
  --danger: #ff4d4d;
  --danger-subtle: rgba(255,77,77,0.1);
  --warning: #ffb84d;
  --warning-subtle: rgba(255,184,77,0.1);
  --success: #4dff88;
  --success-subtle: rgba(77,255,136,0.1);
  --border: #333;
  --border-light: #2a2a2a;
  --shadow: rgba(0,0,0,0.3);
  --sidebar-width: 260px;
  --sidebar-collapsed: 60px;
  --header-height: 56px;
  --radius: 8px;
  --radius-sm: 4px;
  --transition: 0.2s ease;
}

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

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif; }
body { background: var(--bg-primary); color: var(--text-primary); font-size: 14px; line-height: 1.5; overflow: hidden; }

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ===== LAYOUT ===== */
#app { display: flex; height: 100vh; width: 100vw; }

/* ===== LOGIN ===== */
.login-page {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; width: 100vw; background: var(--bg-primary);
}
.login-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px; width: 100%; max-width: 400px;
  box-shadow: 0 8px 32px var(--shadow);
}
.login-box h1 { font-size: 24px; margin-bottom: 8px; text-align: center; }
.login-box p { color: var(--text-secondary); text-align: center; margin-bottom: 24px; }
.login-box .error { color: var(--danger); font-size: 13px; margin-bottom: 12px; text-align: center; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width); background: var(--bg-sidebar);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  height: 100vh; transition: width var(--transition); flex-shrink: 0; overflow: hidden;
}
.sidebar-header {
  padding: 16px 20px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border); min-height: var(--header-height);
}
.sidebar-logo { font-size: 18px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.sidebar-toggle { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; margin-left: auto; padding: 4px; }
.sidebar-toggle:hover { color: var(--text-primary); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 8px; }
.sidebar-nav a, .sidebar-nav button {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm); color: var(--text-secondary);
  border: none; background: none; cursor: pointer; font-size: 14px;
  width: 100%; text-align: left; transition: all var(--transition); white-space: nowrap;
}
.sidebar-nav a:hover, .sidebar-nav button:hover { background: var(--bg-card); color: var(--text-primary); text-decoration: none; }
.sidebar-nav a.active, .sidebar-nav button.active { background: var(--accent-subtle); color: var(--accent); }
.sidebar-nav .nav-icon { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-nav .nav-label { overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav .nav-divider { height: 1px; background: var(--border); margin: 8px 12px; }
.sidebar-nav .nav-section { font-size: 11px; text-transform: uppercase; color: var(--text-muted); padding: 12px 12px 4px; letter-spacing: 0.5px; white-space: nowrap; }

.sidebar-project-item { padding-left: 24px !important; font-size: 13px !important; }
.sidebar-project-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.sidebar-footer {
  padding: 12px 8px; border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition);
}
.sidebar-user:hover { background: var(--bg-card); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 600; color: #fff; flex-shrink: 0;
}
.sidebar-user-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { font-size: 11px; color: var(--text-muted); }

/* Mobile sidebar */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.mobile-header {
  display: none; height: var(--header-height); background: var(--bg-secondary);
  border-bottom: 1px solid var(--border); align-items: center; padding: 0 16px; gap: 12px;
}
.mobile-header .hamburger { background: none; border: none; color: var(--text-primary); font-size: 22px; cursor: pointer; }
.mobile-header .logo { font-size: 18px; font-weight: 700; color: var(--accent); }

/* ===== MAIN CONTENT ===== */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.content-header {
  height: var(--header-height); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  background: var(--bg-secondary); flex-shrink: 0;
}
.breadcrumb { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.breadcrumb span { color: var(--text-muted); }
.breadcrumb a { color: var(--text-secondary); font-size: 13px; }
.breadcrumb .current { color: var(--text-primary); font-weight: 500; }

.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.notification-btn {
  position: relative; background: none; border: none; color: var(--text-secondary);
  cursor: pointer; font-size: 18px; padding: 4px;
}
.notification-btn:hover { color: var(--text-primary); }
.notification-badge {
  position: absolute; top: -2px; right: -4px; background: var(--danger);
  color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 10px;
  min-width: 16px; text-align: center; line-height: 14px;
}

.content-body { flex: 1; overflow-y: auto; padding: 24px; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 8px 12px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 14px;
  font-family: inherit; transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-textarea { resize: vertical; min-height: 100px; }
.form-select { cursor: pointer; }
.form-select option { background: var(--bg-input); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; transition: all var(--transition);
  font-family: inherit; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-danger { background: var(--danger-subtle); color: var(--danger); border-color: rgba(255,77,77,0.2); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon { padding: 6px; min-width: 32px; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; transition: all var(--transition);
}
.card:hover { border-color: #444; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.card-meta { font-size: 12px; color: var(--text-muted); }

/* ===== GRID ===== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== PROJECT CARDS ===== */
.project-card { cursor: pointer; }
.project-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.project-card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.project-card-status {
  font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500;
}
.status-planning { background: var(--warning-subtle); color: var(--warning); }
.status-active { background: var(--success-subtle); color: var(--success); }
.status-on_hold { background: var(--danger-subtle); color: var(--danger); }
.status-completed { background: var(--accent-subtle); color: var(--accent); }
.project-card-desc { color: var(--text-secondary); font-size: 13px; margin-bottom: 12px; max-height: 40px; overflow: hidden; }
.project-card-progress { margin-bottom: 12px; }
.progress-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }
.progress-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.project-card-footer { display: flex; align-items: center; justify-content: space-between; }
.project-card-members { display: flex; }
.project-card-members .user-avatar { width: 24px; height: 24px; font-size: 10px; margin-left: -4px; border: 2px solid var(--bg-card); }
.project-card-members .user-avatar:first-child { margin-left: 0; }

/* ===== KANBAN ===== */
.kanban-board { display: flex; gap: 16px; height: calc(100vh - var(--header-height) - var(--header-height) - 80px); overflow-x: auto; padding-bottom: 16px; }
.kanban-column {
  min-width: 280px; max-width: 320px; flex-shrink: 0; background: var(--bg-secondary);
  border-radius: var(--radius); display: flex; flex-direction: column; max-height: 100%;
}
.kanban-column-header {
  padding: 12px 16px; font-weight: 600; font-size: 13px; display: flex; align-items: center;
  justify-content: space-between; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.kanban-column-count {
  background: var(--bg-card); padding: 2px 8px; border-radius: 10px;
  font-size: 11px; color: var(--text-muted); font-weight: 400;
}
.kanban-column-body { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.kanban-add-btn {
  margin: 8px; padding: 8px; background: none; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer;
  font-size: 13px; text-align: center; transition: all var(--transition);
}
.kanban-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }

.task-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px; cursor: grab; transition: all var(--transition);
}
.task-card:hover { border-color: #444; }
.task-card.sortable-ghost { opacity: 0.4; }
.task-card.sortable-chosen { box-shadow: 0 4px 12px var(--shadow); }
.task-card-title { font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.task-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-priority {
  font-size: 10px; padding: 1px 6px; border-radius: 3px; font-weight: 600;
}
.priority-critical { background: rgba(255,50,50,0.15); color: #ff5050; }
.priority-high { background: rgba(255,150,50,0.15); color: #ff9632; }
.priority-medium { background: rgba(255,200,50,0.15); color: #ffc832; }
.priority-low { background: rgba(100,200,100,0.15); color: #64c864; }
.task-card-assignee { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.task-card-assignee .user-avatar { width: 20px; height: 20px; font-size: 9px; }
.task-card-badges { display: flex; gap: 6px; font-size: 11px; color: var(--text-muted); }
.task-card-due { font-size: 11px; color: var(--text-muted); }
.task-card-due.overdue { color: var(--danger); }
.task-card-tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.task-tag { font-size: 10px; padding: 1px 6px; background: var(--bg-input); border-radius: 3px; color: var(--text-secondary); }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 16px; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-secondary); cursor: pointer; font-size: 13px; font-weight: 500;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; font-size: 12px; color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: 0.3px; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border-light); font-size: 13px; }
tr:hover td { background: var(--bg-card); }

/* ===== MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  z-index: 200; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius);
  width: 100%; max-width: 600px; max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
.modal-lg { max-width: 800px; }
.modal-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 20px; padding: 4px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ===== TOAST ===== */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 13px; min-width: 280px; box-shadow: 0 8px 24px var(--shadow);
  animation: toastIn 0.3s ease; display: flex; align-items: center; gap: 8px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 16px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state-desc { font-size: 13px; margin-bottom: 20px; text-align: center; }

/* ===== MARKDOWN CONTENT ===== */
.md-content h1 { font-size: 24px; margin-bottom: 16px; }
.md-content h2 { font-size: 20px; margin: 20px 0 12px; }
.md-content h3 { font-size: 16px; margin: 16px 0 8px; }
.md-content p { margin-bottom: 12px; color: var(--text-secondary); }
.md-content ul, .md-content ol { margin-bottom: 12px; padding-left: 20px; }
.md-content li { margin-bottom: 4px; }
.md-content code { background: var(--bg-input); padding: 2px 6px; border-radius: 3px; font-size: 13px; }
.md-content pre { background: var(--bg-input); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; margin-bottom: 12px; }
.md-content pre code { background: none; padding: 0; }
.md-content blockquote { border-left: 3px solid var(--accent); padding-left: 16px; color: var(--text-secondary); margin-bottom: 12px; }
.md-content table { margin-bottom: 12px; }

/* ===== DOCUMENT EDITOR ===== */
.doc-editor { display: flex; gap: 0; height: calc(100vh - var(--header-height) - var(--header-height) - 60px); }
.doc-editor-pane { flex: 1; display: flex; flex-direction: column; }
.doc-editor-pane + .doc-editor-pane { border-left: 1px solid var(--border); }
.doc-editor textarea { flex: 1; resize: none; background: var(--bg-primary); border: none; color: var(--text-primary); padding: 20px; font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 14px; line-height: 1.6; }
.doc-editor textarea:focus { outline: none; }
.doc-editor-preview { flex: 1; padding: 20px; overflow-y: auto; }
.doc-editor-toolbar { padding: 8px 16px; background: var(--bg-secondary); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }

/* ===== CALENDAR ===== */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.calendar-day-header { padding: 8px; text-align: center; font-size: 12px; color: var(--text-muted); font-weight: 500; background: var(--bg-secondary); }
.calendar-day {
  min-height: 100px; background: var(--bg-primary); padding: 6px;
  transition: background var(--transition); cursor: pointer;
}
.calendar-day:hover { background: var(--bg-card); }
.calendar-day.today { background: var(--accent-subtle); }
.calendar-day.other-month { opacity: 0.4; }
.calendar-day-num { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.calendar-day.today .calendar-day-num { color: var(--accent); font-weight: 700; }
.calendar-event {
  font-size: 10px; padding: 2px 4px; border-radius: 2px; margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.calendar-event.task { background: var(--accent-subtle); color: var(--accent); }
.calendar-event.milestone { background: var(--warning-subtle); color: var(--warning); }

/* ===== NOTIFICATION PANEL ===== */
.notification-panel {
  position: absolute; top: var(--header-height); right: 12px; width: 360px;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 32px var(--shadow); z-index: 100; max-height: 400px; overflow-y: auto;
  display: none;
}
.notification-panel.active { display: block; }
.notification-panel-header { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.notification-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border-light); cursor: pointer;
  transition: background var(--transition);
}
.notification-item:hover { background: var(--bg-card); }
.notification-item.unread { background: var(--accent-subtle); }
.notification-item .noti-title { font-size: 13px; font-weight: 500; }
.notification-item .noti-msg { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.notification-item .noti-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== COMMENT THREAD ===== */
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item { display: flex; gap: 10px; }
.comment-body { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-author { font-size: 13px; font-weight: 500; }
.comment-time { font-size: 11px; color: var(--text-muted); }
.comment-text { font-size: 13px; color: var(--text-secondary); }
.comment-input { display: flex; gap: 10px; margin-top: 16px; }
.comment-input textarea { flex: 1; min-height: 60px; }

/* ===== BADGES & TAGS ===== */
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.badge-info { background: var(--accent-subtle); color: var(--accent); }
.badge-success { background: var(--success-subtle); color: var(--success); }
.badge-warning { background: var(--warning-subtle); color: var(--warning); }
.badge-danger { background: var(--danger-subtle); color: var(--danger); }

/* ===== LOADING ===== */
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== REQUIREMENT LIST ===== */
.req-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; transition: all var(--transition); }
.req-item:hover { background: var(--bg-card); }
.req-item-status { flex-shrink: 0; }
.req-item-content { flex: 1; min-width: 0; }
.req-item-title { font-weight: 500; margin-bottom: 4px; }
.req-item-desc { font-size: 12px; color: var(--text-secondary); overflow: hidden; max-height: 40px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { position: fixed; left: -100%; z-index: 100; transition: left 0.3s; }
  .sidebar.open { left: 0; }
  .sidebar-overlay.active { display: block; }
  .mobile-header { display: flex; }
  .main-content { width: 100vw; }
  .content-body { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kanban-board { flex-direction: column; height: auto; }
  .kanban-column { min-width: 100%; max-width: 100%; max-height: 400px; }
  .doc-editor { flex-direction: column; height: auto; }
  .doc-editor-pane { min-height: 300px; }
  .doc-editor-pane + .doc-editor-pane { border-left: none; border-top: 1px solid var(--border); }
  .form-row { flex-direction: column; }
  .modal { max-height: 90vh; margin: 10px; }
  .notification-panel { left: 12px; right: 12px; width: auto; }
  .calendar-day { min-height: 60px; }
}

@media (max-width: 480px) {
  .content-header { padding: 0 12px; }
  .breadcrumb a { display: none; }
}

/* ===== PROJECT PLAN ===== */
.plan-overview { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.plan-stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; flex: 1; min-width: 140px; }
.plan-stat-value { font-size: 22px; font-weight: 700; }
.plan-stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.plan-stat-sub { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* Gantt Chart */
.gantt-container { margin-bottom: 24px; overflow-x: auto; }
.gantt-chart { position: relative; min-height: 40px; }
.gantt-header { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 8px; position: relative; }
.gantt-month { font-size: 11px; color: var(--text-muted); text-align: center; border-left: 1px solid var(--border-light); padding: 4px 0; }
.gantt-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 5; opacity: 0.7; }
.gantt-today-label { position: absolute; top: -16px; font-size: 10px; color: var(--danger); transform: translateX(-50%); white-space: nowrap; }
.gantt-row { display: flex; align-items: center; margin-bottom: 6px; height: 32px; }
.gantt-label { width: 200px; flex-shrink: 0; font-size: 12px; padding-right: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-bar-area { flex: 1; position: relative; height: 24px; }
.gantt-bar {
  position: absolute; height: 20px; border-radius: 4px; top: 2px;
  display: flex; align-items: center; padding: 0 8px; font-size: 10px; color: #fff;
  cursor: pointer; transition: opacity 0.2s; min-width: 4px; overflow: hidden; white-space: nowrap;
}
.gantt-bar:hover { opacity: 0.85; }
.gantt-bar .gantt-bar-progress { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; opacity: 0.4; background: #fff; }

/* Phase Accordion */
.phase-list { display: flex; flex-direction: column; gap: 8px; }
.phase-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: all var(--transition); }
.phase-card.expanded { border-color: #444; }
.phase-header {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  cursor: pointer; transition: background var(--transition); user-select: none;
}
.phase-header:hover { background: var(--bg-card-hover); }
.phase-toggle { font-size: 12px; color: var(--text-muted); transition: transform 0.2s; width: 16px; text-align: center; }
.phase-card.expanded .phase-toggle { transform: rotate(90deg); }
.phase-color-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.phase-name { font-weight: 600; font-size: 14px; flex: 1; }
.phase-progress { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.phase-progress-bar { width: 80px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.phase-progress-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.phase-progress-text { font-size: 11px; color: var(--text-muted); min-width: 32px; }
.phase-status-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.phase-status-pending { background: rgba(134,142,150,0.15); color: #868e96; }
.phase-status-in_progress { background: var(--accent-subtle); color: var(--accent); }
.phase-status-completed { background: var(--success-subtle); color: var(--success); }
.phase-status-skipped { background: rgba(134,142,150,0.1); color: #666; }
.phase-dates { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.phase-body { display: none; padding: 0 16px 16px; border-top: 1px solid var(--border-light); }
.phase-card.expanded .phase-body { display: block; padding-top: 16px; }
.phase-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.phase-section-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 8px; margin-top: 16px; }

/* Phase Checklist */
.phase-checklist { list-style: none; }
.phase-check-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px;
  border-bottom: 1px solid var(--border-light); font-size: 13px; transition: background var(--transition);
}
.phase-check-item:last-child { border-bottom: none; }
.phase-check-item:hover { background: var(--bg-card-hover); }
.phase-check-item input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; width: 16px; height: 16px; flex-shrink: 0; }
.phase-check-item.done .phase-check-label { text-decoration: line-through; color: var(--text-muted); }
.phase-check-label { flex: 1; cursor: pointer; }
.phase-check-link { font-size: 11px; color: var(--accent); cursor: pointer; padding: 2px 6px; border-radius: 3px; background: var(--accent-subtle); }
.phase-check-assignee { font-size: 11px; color: var(--text-muted); }
.phase-check-actions { display: flex; gap: 4px; opacity: 0; transition: opacity 0.2s; }
.phase-check-item:hover .phase-check-actions { opacity: 1; }
.phase-check-row { display: flex; align-items: center; gap: 8px; width: 100%; }
.phase-check-has-content { font-size: 11px; flex-shrink: 0; opacity: 0.6; }
.phase-check-detail {
  margin: 6px 0 4px 24px; padding: 10px 14px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  animation: slideDown 0.15s ease;
}
@keyframes slideDown { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 500px; } }
.phase-check-detail-view { cursor: pointer; min-height: 28px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.phase-check-detail-view:hover { color: var(--text-primary); }
.phase-check-detail-view p { margin-bottom: 6px; }
.phase-check-detail-view p:last-child { margin-bottom: 0; }
.phase-check-detail-view ul, .phase-check-detail-view ol { padding-left: 18px; margin-bottom: 6px; }
.phase-check-detail-view code { background: rgba(255,255,255,0.08); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.phase-check-detail-edit textarea { font-size: 13px; min-height: 80px; }

/* Phase Content Area */
.phase-content-area { margin-bottom: 16px; }
.phase-content-view {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; min-height: 48px; cursor: pointer; transition: all var(--transition);
}
.phase-content-view:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.phase-content-view.empty { border-style: dashed; }
.phase-content-view p { margin-bottom: 8px; }
.phase-content-view p:last-child { margin-bottom: 0; }
.phase-content-view h1, .phase-content-view h2, .phase-content-view h3 { margin-top: 12px; margin-bottom: 8px; }
.phase-content-view ul, .phase-content-view ol { padding-left: 20px; margin-bottom: 8px; }
.phase-content-view code { background: rgba(255,255,255,0.1); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.phase-content-textarea { font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace; font-size: 13px; line-height: 1.6; }

/* Phase Deliverables */
.phase-deliverable { display: flex; align-items: center; gap: 8px; padding: 8px; background: var(--bg-input); border-radius: var(--radius-sm); margin-bottom: 6px; font-size: 13px; }
.phase-deliverable-icon { font-size: 16px; }
.phase-deliverable-title { flex: 1; }
.phase-deliverable-status { font-size: 11px; padding: 2px 6px; border-radius: 3px; }

/* Responsive */
@media (max-width: 768px) {
  .gantt-label { width: 120px; }
  .phase-dates { display: none; }
  .plan-overview { flex-direction: column; }
}
