/* ── Scheduler App Styles ─────────────────────────────────────────── */

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

body {
  font-family: var(--ob-font);
  background: var(--ob-bg);
  color: var(--ob-text);
  height: 100vh;
  height: 100dvh; /* dynamic viewport height: respects mobile browser chrome + rotation */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ── Nav toolbar additions ───────────────────────────────────────── */
.sc-date-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sc-nav-btn {
  background: none;
  border: none;
  color: var(--ob-muted);
  font-size: 16px;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.sc-nav-btn:hover { background: var(--ob-bg); color: var(--ob-text); }

.sc-today-btn {
  background: var(--ob-accent-light);
  border: 1px solid var(--ob-accent);
  color: var(--ob-accent);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-left: 4px;
  transition: background 0.12s;
}
.sc-today-btn:hover { background: var(--ob-accent); color: #fff; }

.sc-date-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ob-text);
  min-width: 150px;
  text-align: center;
}

.sc-view-switcher { display: flex; gap: 2px; }
.sc-view-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--ob-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s;
}
.sc-view-btn:hover { background: var(--ob-bg); color: var(--ob-text); }
.sc-view-btn.active {
  background: var(--ob-accent-light);
  border-color: var(--ob-accent);
  color: var(--ob-accent);
}

.sc-icon-btn {
  background: none;
  border: 1px solid var(--ob-border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.12s;
}
.sc-icon-btn:hover { background: var(--ob-bg); }

/* ── Layout ──────────────────────────────────────────────────────── */
.sc-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sc-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--ob-surface);
  border-right: 1px solid var(--ob-border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 12px;
  overflow-y: auto;
}

.sc-add-btn {
  width: 100%;
  padding: 9px;
  background: var(--ob-accent);
  color: #fff;
  border: none;
  border-radius: var(--ob-radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.sc-add-btn:hover { background: var(--ob-accent-dark); }

/* ── Mini Calendar ───────────────────────────────────────────────── */
.sc-mini-cal { }
.sc-mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sc-mini-cal-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ob-text);
}
.sc-mini-nav {
  background: none;
  border: none;
  color: var(--ob-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.sc-mini-nav:hover { background: var(--ob-bg); }

.sc-mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 11px;
}
.sc-mini-day-header {
  text-align: center;
  color: var(--ob-muted);
  font-weight: 600;
  padding: 2px 0;
}
.sc-mini-day {
  text-align: center;
  padding: 4px 2px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ob-text);
  transition: background 0.1s;
}
.sc-mini-day:hover { background: var(--ob-accent-light); }
.sc-mini-day.today { font-weight: 700; color: var(--ob-accent); }
.sc-mini-day.selected { background: var(--ob-accent); color: #fff; border-radius: 50%; }
.sc-mini-day.other-month { color: var(--ob-muted); opacity: 0.5; }

/* ── Task List Sidebar ───────────────────────────────────────────── */
.sc-task-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.sc-task-item {
  padding: 8px 10px;
  background: var(--ob-bg);
  border-radius: 6px;
  cursor: pointer;
  border-left: 3px solid var(--ob-accent);
  transition: background 0.1s;
}
.sc-task-item:hover { background: var(--ob-accent-light); }
.sc-task-item.done { opacity: 0.5; text-decoration: line-through; }
.sc-task-name { font-weight: 600; color: var(--ob-text); }
.sc-task-meta { color: var(--ob-muted); font-size: 11px; margin-top: 2px; }

/* ── Main Area ───────────────────────────────────────────────────── */
.sc-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
#view-calendar.sc-main { padding: 0; }
#view-calendar.sc-main > #schedule-container { padding: 16px; }
#schedule-container {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ── Calendar (pixel-based layout) ───────────────────────────────── */
.sc-cal-wrap {
  width: 100%;
  height: 100%; /* constrain so .sc-cal-body can scroll internally */
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  background: var(--ob-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Sticky day-name header */
.sc-cal-header {
  display: flex;
  flex-shrink: 0;
  border-bottom: 2px solid var(--ob-border);
  background: var(--ob-surface2);
  position: sticky;
  top: 0;
  z-index: 10;
}
.sc-cal-gutter-head {
  width: 52px;
  flex-shrink: 0;
  border-right: 1px solid var(--ob-border);
}
.sc-cal-day-head {
  flex: 1;
  padding: 10px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  border-left: 1px solid var(--ob-border);
  color: var(--ob-text);
}
.sc-cal-day-head.today-col {
  background: var(--ob-accent-light);
  color: var(--ob-accent);
}

/* Scrollable body */
.sc-cal-body {
  display: flex;
  flex: 1;
  width: 100%;
  overflow-y: auto;
  min-width: 0;
}

/* Time gutter: 52px wide, 1440px tall (60px × 24 hours) */
.sc-cal-gutter {
  width: 52px;
  flex-shrink: 0;
  position: relative;
  height: 1440px;
  border-right: 1px solid var(--ob-border);
}
.sc-hour-label {
  position: absolute;
  left: 0;
  right: 4px;
  font-size: 10px;
  color: var(--ob-muted);
  text-align: right;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Day columns container */
.sc-cal-days {
  flex: 1;
  width: 0; /* flex-basis override: let flex-grow fill the space */
  min-width: 0;
  display: flex;
}

/* Individual day column: 1440px tall, relative so tasks can be absolute */
.sc-day-col {
  flex: 1;
  min-width: 0;       /* prevent long content from expanding column */
  overflow: hidden;    /* clip any overflow from task blocks */
  position: relative;
  height: 1440px;
  border-left: 1px solid var(--ob-border);
}
.sc-day-col.today-col { background: #fafbff; }

/* Hour separator lines inside each day column */
.sc-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--ob-border);
  pointer-events: none;
}

/* Task blocks: positioned by top/height in px */
.sc-task-block {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 5px;
  padding: 3px 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  background: var(--ob-accent);
  color: var(--ob-text, #1e1e2e);
  transition: opacity 0.1s;
  z-index: 1;
  box-sizing: border-box;
}
.sc-task-block:hover { opacity: 0.85; cursor: grab; }
.sc-task-block.done { opacity: 0.45; text-decoration: line-through; }
.sc-task-block.is-block {
  color: #4b5563;
  font-style: italic;
  opacity: 0.75;
  font-weight: 500;
}
.sc-task-block.is-block:hover { opacity: 0.9; }
.sc-task-block-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-task-block-time { font-size: 10px; opacity: 0.85; font-weight: 400; }
.sc-task-block-pri {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}
.sc-task-dragging { opacity: 0.4 !important; cursor: grabbing; }

/* ── Current-time red line ──────────────────────────────────────── */
.sc-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #ef4444;
  z-index: 5;
  pointer-events: none;
}
.sc-now-line::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
}

/* ── Kanban ──────────────────────────────────────────────────────── */
.sc-kanban {
  display: flex;
  gap: 12px;
  padding: 4px;
  height: 100%;
}
.sc-kanban-col {
  flex: 1;
  min-width: 180px;
  background: var(--ob-surface);
  border-radius: var(--ob-radius);
  border: 1px solid var(--ob-border);
  display: flex;
  flex-direction: column;
}
.sc-kanban-col-header {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--ob-border);
  color: var(--ob-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sc-kanban-col-name { color: var(--ob-text); }
.sc-kanban-col-count {
  background: var(--ob-bg);
  border: 1px solid var(--ob-border);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 10px;
  color: var(--ob-muted);
}
.sc-kanban-cards {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}
.sc-kanban-card {
  background: var(--ob-bg);
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  cursor: pointer;
  border-left: 3px solid var(--ob-accent);
  transition: background 0.1s;
}
.sc-kanban-card { cursor: grab; }
.sc-kanban-card:hover { background: var(--ob-accent-light); }
.sc-kanban-card:active { cursor: grabbing; }
.sc-kanban-card-title { font-weight: 600; color: var(--ob-text); }
.sc-kanban-card-meta { color: var(--ob-muted); font-size: 11px; margin-top: 3px; }
.sc-kanban-card-pri {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}
.sc-kanban-dragging { opacity: 0.35; box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
.sc-kanban-drop-target {
  background: var(--ob-accent-light) !important;
  border: 2px dashed var(--ob-accent);
  border-radius: 6px;
}

/* ── Modal ───────────────────────────────────────────────────────── */
.sc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.sc-modal {
  background: var(--ob-surface);
  border-radius: 12px;
  box-shadow: var(--ob-shadow-lg);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.sc-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ob-border);
  font-weight: 700;
  font-size: 15px;
}
.sc-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--ob-muted);
  padding: 2px 6px;
  border-radius: 4px;
}
.sc-modal-close:hover { background: var(--ob-bg); color: var(--ob-text); }
.sc-modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sc-modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 20px;
  border-top: 1px solid var(--ob-border);
}

/* ── Form fields ─────────────────────────────────────────────────── */
.sc-field { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sc-field label { font-size: 12px; font-weight: 600; color: var(--ob-muted); }
.sc-field input, .sc-field select, .sc-field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  font-size: 13px;
  font-family: var(--ob-font);
  background: var(--ob-surface);
  color: var(--ob-text);
  outline: none;
  transition: border-color 0.15s;
}
.sc-field input:focus, .sc-field select:focus, .sc-field textarea:focus {
  border-color: var(--ob-accent);
}
/* Contenteditable notes field with inline URL auto-linking */
.sc-notes-editable {
  width: 100%;
  min-height: 52px;
  max-height: 140px;
  overflow-y: auto;
  padding: 8px 10px;
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  font-size: 13px;
  font-family: var(--ob-font);
  background: var(--ob-surface);
  color: var(--ob-text);
  outline: none;
  transition: border-color 0.15s;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}
.sc-notes-editable:focus { border-color: var(--ob-accent); }
.sc-notes-editable:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
}
.sc-notes-editable a {
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
}
.sc-field-row { display: flex; gap: 12px; }

/* ── Creation Type Picker ────────────────────────────────────────── */
.sc-create-picker { display: flex; flex-direction: column; gap: 8px; }
.sc-create-option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--ob-border); border-radius: 10px;
  background: var(--ob-surface); cursor: pointer; text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sc-create-option:hover {
  border-color: var(--ob-accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.12);
}
.sc-create-icon { font-size: 22px; flex-shrink: 0; width: 32px; text-align: center; }
.sc-create-label { font-weight: 600; font-size: 14px; color: var(--ob-text); display: block; }
.sc-create-desc { font-size: 12px; color: #64748b; display: block; margin-top: 1px; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.sc-btn-primary {
  padding: 8px 18px;
  background: var(--ob-accent);
  color: #fff;
  border: none;
  border-radius: var(--ob-radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.sc-btn-primary:hover { background: var(--ob-accent-dark); }
.sc-btn-secondary {
  padding: 8px 18px;
  background: none;
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  color: var(--ob-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.sc-btn-secondary:hover { background: var(--ob-bg); }
.sc-btn-danger {
  padding: 8px 18px;
  background: none;
  border: 1px solid var(--ob-danger);
  border-radius: var(--ob-radius);
  color: var(--ob-danger);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.sc-btn-danger:hover { background: #fef2f2; }
.sc-btn-complete {
  padding: 8px 18px;
  background: none;
  border: 1px solid var(--ob-success);
  border-radius: var(--ob-radius);
  color: var(--ob-success);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.sc-btn-complete:hover { background: #f0fdf4; }

/* ── Settings Slide-out Panel ───────────────────────────────────── */
.sc-panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 299;
  cursor: pointer;
}
.sc-panel-overlay.open { display: block; }

.sc-settings-panel {
  position: fixed;
  top: var(--ob-nav-height);
  right: 0;
  width: 420px;
  height: calc(100vh - var(--ob-nav-height));
  background: var(--ob-surface);
  border-left: 1px solid var(--ob-border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  z-index: 300;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow: hidden;
}
.sc-settings-panel.open { transform: translateX(0); }

.sc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  border-bottom: 1px solid var(--ob-border);
  flex-shrink: 0;
  font-weight: 700;
  font-size: 15px;
}

.sc-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.sc-panel-body::-webkit-scrollbar { width: 6px; }
.sc-panel-body::-webkit-scrollbar-track { background: transparent; }
.sc-panel-body::-webkit-scrollbar-thumb { background: #c5c9d6; border-radius: 3px; }

.sc-win-form-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--ob-muted);
  margin-bottom: 10px;
}

/* ── Settings ────────────────────────────────────────────────────── */
.sc-settings-section {
  font-size: 13px;
  font-weight: 700;
  color: var(--ob-text);
  margin-bottom: 4px;
  margin-top: 8px;
}
.sc-settings-hint {
  font-size: 12px;
  color: var(--ob-muted);
  margin-bottom: 10px;
}

/* ── Panel collapsible sections ────────────────────────────────── */
.sc-panel-body { padding: 0 20px; } /* remove top/bottom — sections handle it */

.sc-panel-section {
  border-bottom: 1px solid var(--ob-border);
}

.sc-panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: var(--ob-text);
  user-select: none;
  gap: 8px;
  min-height: 48px;
}
.sc-panel-section-header:hover { color: var(--ob-accent); }

.sc-panel-toggle {
  font-size: 14px;
  color: var(--ob-muted);
  transition: transform 0.18s;
  flex-shrink: 0;
}
.sc-panel-section.collapsed .sc-panel-toggle {
  transform: rotate(-90deg);
}

.sc-panel-section-content {
  padding-bottom: 16px;
}
.sc-panel-section.collapsed .sc-panel-section-content {
  display: none;
}

/* Projects mini-list inside panel */
.sc-panel-project-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--ob-text);
  border-bottom: 1px solid var(--ob-border);
  min-height: 40px;
}
.sc-panel-project-row:last-child { border-bottom: none; }
.sc-panel-project-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sc-panel-project-name { flex: 1; font-weight: 600; }
.sc-panel-project-pri {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--ob-bg);
  color: var(--ob-muted);
}
.sc-panel-manage-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ob-accent);
  text-decoration: none;
  padding: 6px 0;
}
.sc-panel-manage-link:hover { text-decoration: underline; }
.sc-win-form {
  border: 1px solid var(--ob-border);
  border-radius: var(--ob-radius);
  padding: 12px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sc-win-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--ob-bg);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 6px;
  min-height: 44px;
}
.sc-win-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sc-win-info { flex: 1; }
.sc-win-name { font-weight: 600; font-size: 14px; }
.sc-win-hours { color: var(--ob-muted); font-size: 12px; margin-top: 2px; }
.sc-win-edit, .sc-win-delete {
  background: none;
  border: none;
  color: var(--ob-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  min-width: 32px;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-win-edit:hover { color: var(--ob-accent); background: var(--ob-accent-light); }
.sc-win-delete:hover { color: var(--ob-danger); background: #fef2f2; }
.sc-day-picker { display: flex; gap: 4px; flex-wrap: wrap; }
.sc-day-picker label {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  cursor: pointer;
  padding: 3px 6px;
  border: 1px solid var(--ob-border);
  border-radius: 4px;
}
.sc-day-picker label:has(input:checked) {
  background: var(--ob-accent-light);
  border-color: var(--ob-accent);
  color: var(--ob-accent);
}
.sc-day-picker input { width: auto; }

/* ── Toast ───────────────────────────────────────────────────────── */
.sc-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  transition: transform 0.25s ease;
  pointer-events: none;
}
.sc-toast.show { transform: translateX(-50%) translateY(0); }
.sc-toast.success { background: var(--ob-success); }
.sc-toast.error { background: var(--ob-danger); }

/* ── Empty state ─────────────────────────────────────────────────── */
.sc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: var(--ob-muted);
  gap: 8px;
}
.sc-empty-icon { font-size: 40px; }

/* ═══════════════════════════════════════════════════════════
   GANTT CHART
   ═══════════════════════════════════════════════════════════ */

/* Gantt toolbar bar (below nav) */
.sc-gantt-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex: 0 0 auto;
}

/* Nav Gantt controls */
.sc-gantt-nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sc-link-btn { background: var(--ob-surface-2) !important; }
.sc-link-btn-active {
  background: #fef3c7 !important;
  border-color: #f59e0b !important;
  color: #92400e !important;
}
.sc-link-hint {
  font-size: 12px;
  color: #f59e0b;
  font-weight: 500;
  white-space: nowrap;
}

/* Outer wrapper */
.sc-gantt-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 52px - 40px);
  overflow: hidden;
  background: var(--ob-bg);
}

/* Main grid: left + right */
.sc-gantt-grid {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Left column (fixed) ── */
.sc-gantt-left {
  width: 240px;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ob-border);
  background: var(--ob-surface);
  z-index: 10;
  overflow: hidden;
}
.sc-gantt-left-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--ob-border);
  font-weight: 600;
  font-size: 13px;
  background: var(--ob-surface);
  flex-shrink: 0;
}
.sc-gantt-add-btn {
  font-size: 12px !important;
  padding: 4px 10px !important;
  height: 28px !important;
}
.sc-gantt-left-rows {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Task name rows */
.sc-gantt-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--ob-border);
  transition: background 0.1s;
  background: var(--ob-surface);
}
.sc-gantt-name-row:hover { background: var(--ob-surface-2); }
.sc-gantt-name-row-alt { background: color-mix(in srgb, var(--ob-surface) 97%, #6366f1 3%); }
.sc-gantt-name-row-alt:hover { background: var(--ob-surface-2); }
.sc-gantt-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sc-gantt-task-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* ── Right column (scrollable timeline) ── */
.sc-gantt-right {
  flex: 1;
  overflow: auto;
  position: relative;
}

/* Timeline header */
.sc-gantt-timeline-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--ob-surface);
  border-bottom: 1px solid var(--ob-border);
  overflow: hidden;
  flex-shrink: 0;
}
.sc-gantt-hdr-month {
  position: absolute;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ob-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--ob-border);
  border-bottom: 1px solid var(--ob-border);
  background: var(--ob-surface);
  white-space: nowrap;
  overflow: hidden;
}
.sc-gantt-hdr-day,
.sc-gantt-hdr-week {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--ob-text-secondary, #64748b);
  border-right: 1px solid color-mix(in srgb, var(--ob-border) 50%, transparent);
  white-space: nowrap;
  overflow: hidden;
}
.sc-gantt-hdr-week { justify-content: flex-start; padding-left: 4px; }
.sc-gantt-hdr-today {
  background: #eef2ff;
  color: #6366f1;
  font-weight: 700;
}
.sc-gantt-hdr-weekend { color: #94a3b8; }

/* Timeline body */
.sc-gantt-timeline-body {
  position: relative;
}

/* Row stripes */
.sc-gantt-row-stripe {
  position: absolute;
  border-bottom: 1px solid color-mix(in srgb, var(--ob-border) 50%, transparent);
}
.sc-gantt-row-stripe-alt {
  background: color-mix(in srgb, var(--ob-surface) 97%, #6366f1 3%);
}

/* Task bars */
.sc-gantt-bars {
  position: relative;
}
.sc-gantt-bar {
  position: absolute;
  border-radius: 5px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s, transform 0.1s;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  user-select: none;
}
.sc-gantt-bar:hover {
  opacity: 0.92;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}
.sc-gantt-bar.dragging {
  opacity: 0.75;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transform: none;
  z-index: 20;
  transition: none;
}
.sc-gantt-bar-resize {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 8px;
  cursor: ew-resize;
  border-radius: 0 5px 5px 0;
}
.sc-gantt-bar-resize:hover,
.sc-gantt-bar-resize.active {
  background: rgba(0,0,0,0.12);
}
.sc-gantt-bar-unscheduled {
  border-style: dashed !important;
  opacity: 0.65;
}
.sc-gantt-bar-selected {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}
.sc-gantt-bar-label {
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.sc-gantt-bar-avatar {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Today line */
.sc-gantt-today-line {
  position: absolute;
  width: 2px;
  background: #ef4444;
  opacity: 0.6;
  pointer-events: none;
  z-index: 3;
}
.sc-gantt-today-line::before {
  content: '';
  position: absolute;
  top: 0; left: -4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #ef4444;
}

/* Deadline marker */
.sc-gantt-deadline {
  position: absolute;
  width: 2px;
  background: #f97316;
  opacity: 0.7;
  pointer-events: none;
  z-index: 2;
}
.sc-gantt-deadline::after {
  content: '▼';
  position: absolute;
  top: -2px;
  left: -5px;
  font-size: 10px;
  color: #f97316;
}

/* SVG overlay for arrows */
.sc-gantt-svg {
  position: absolute;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 4;
  overflow: visible;
}
.sc-gantt-svg path { pointer-events: stroke; cursor: pointer; }

/* ── Gantt: project headers, priority badges, spans ──────────────────────── */
.sc-gantt-proj-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.sc-gantt-proj-header:hover { background: #e2e8f0; }
.sc-gantt-proj-chevron { font-size: 9px; color: #64748b; flex-shrink: 0; }
.sc-gantt-proj-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.sc-gantt-proj-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-gantt-proj-count { font-size: 10px; font-weight: 600; color: #94a3b8; flex-shrink: 0; }

.sc-gantt-proj-stripe {
  position: absolute;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.sc-gantt-proj-span {
  position: absolute;
  height: 6px;
  border-radius: 3px;
  opacity: 0.35;
  pointer-events: none;
}

.sc-gantt-name-row-indented { padding-left: 20px !important; }

/* Priority badge in left column */
.sc-gantt-pri-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  margin-left: auto;
}

/* Priority accent stripe on left edge of bar */
.sc-gantt-bar-pri-stripe {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 4px 0 0 4px;
  opacity: 0.7;
}

/* ── Calendar: multi-day banner row ──────────────────────────────────────── */
.sc-cal-banners {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  min-height: 0;
}
.sc-cal-banner-gutter { width: 48px; flex-shrink: 0; border-right: 1px solid #e2e8f0; }
.sc-cal-banner-days { display: flex; flex: 1; overflow: hidden; position: relative; }
.sc-cal-banner-col { flex: 1; min-height: 4px; position: relative; }

.sc-cal-multi-banner {
  position: absolute;
  left: 2px; right: 2px;
  height: 20px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  padding: 0 6px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  z-index: 2;
}
.sc-cal-multi-banner:hover { opacity: 0.85; }

/* ── Task block resize handle ─────────────────────────────────────────────── */
.sc-task-resize-handle {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 8px;
  cursor: ns-resize;
  background: transparent;
}
.sc-task-block { user-select: none; } /* position: absolute is set in main block above */
.sc-task-block:hover .sc-task-resize-handle { background: rgba(0,0,0,0.12); border-radius: 0 0 4px 4px; }

/* ── Kanban: project filter bar ──────────────────────────────────────────── */
.sc-kanban-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 13px;
}
.sc-kanban-filter-bar label { font-weight: 600; color: #475569; }
.sc-kanban-filter-bar select { border: 1px solid #e2e8f0; border-radius: 6px; padding: 4px 8px; font-size: 13px; }

/* Kanban card project label */
.sc-kanban-card-project {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
  opacity: 0.85;
}

/* ── Drag snap indicator line ─────────────────────────────────────────────── */
.sc-drag-indicator {
  position: absolute;
  left: 2px; right: 2px;
  background: rgba(59, 130, 246, 0.18);
  border: 2px dashed #3b82f6;
  border-radius: 5px;
  z-index: 10;
  pointer-events: none;
  min-height: 4px;
}
.sc-drag-indicator::before {
  content: attr(data-label);
  position: absolute;
  left: 4px;
  top: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #3b82f6;
  white-space: nowrap;
}
/* Floating ghost block — all positioning done via inline JS */
.sc-drag-ghost {
  pointer-events: none;
  z-index: 9999;
}

/* ── Calendar top filter bar ───────────────────────────────────── */
.sc-cal-filter-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  flex: 0 0 auto;
}
.sc-people-filter { position: relative; }
.sc-people-filter--nav { margin: 0 4px; }
.sc-people-filter--nav .sc-people-filter-btn {
  min-width: 90px;
  padding: 6px 10px;
  height: 30px;
  font-weight: 500;
}
.sc-people-filter-btn {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
  color: #334155;
  min-width: 120px;
  text-align: left;
}
.sc-people-filter-btn:hover { border-color: #94a3b8; }
.sc-people-filter-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 6px 0;
  min-width: 220px;
  max-height: 360px;
  overflow-y: auto;
  z-index: 1000;
}
.sc-people-filter-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
}
.sc-people-filter-menu label:hover { background: #f1f5f9; }
.sc-people-filter-menu input[type="checkbox"] { cursor: pointer; }
.sc-people-filter-menu .sc-people-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 6px 0;
}

/* ── Kanban DONE filter dialog ─────────────────────────────────── */
.sc-kanban-col-header { position: relative; }
.sc-kanban-col-header .sc-done-filter-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  margin-right: 6px;
  color: #64748b;
  border-radius: 4px;
}
.sc-kanban-col-header .sc-done-filter-btn:hover { background: #e2e8f0; color: #0f172a; }
.sc-kanban-col-header .sc-done-filter-btn.active { color: #0ea5e9; }
.sc-done-filter-popover {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  padding: 10px;
  width: 240px;
  z-index: 1000;
}
.sc-done-filter-popover label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
}
.sc-done-filter-popover label:hover { background: #f1f5f9; border-radius: 4px; }
.sc-done-filter-popover input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 6px;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root { --ob-nav-height: 48px; }

  /* ── Nav toolbar ─────────────────────────────── */
  .sc-date-nav { gap: 2px; flex-wrap: wrap; justify-content: center; }
  .sc-date-label { font-size: 11px; min-width: 80px; }
  .sc-nav-btn { padding: 2px 5px; font-size: 14px; }
  .sc-today-btn { font-size: 11px; padding: 3px 7px; }
  .sc-view-switcher { gap: 1px; }
  .sc-view-btn { font-size: 11px; padding: 4px 6px; }

  /* ── Sidebar: hidden on mobile ───────────────── */
  .sc-sidebar {
    display: none;
  }

  /* ── Main area: full width ───────────────────── */
  .sc-layout {
    flex-direction: column;
  }
  .sc-main {
    padding: 8px;
  }
  #view-calendar.sc-main > #schedule-container { padding: 8px; }

  /* ── Calendar: narrower gutter ───────────────── */
  .sc-cal-gutter-head { width: 36px; }
  .sc-cal-gutter { width: 36px; }
  .sc-hour-label { font-size: 9px; }
  .sc-cal-day-head { padding: 6px 2px; font-size: 10px; }
  .sc-cal-banner-gutter { width: 36px; }

  /* ── Kanban: horizontal scroll ───────────────── */
  .sc-kanban {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  .sc-kanban-col {
    min-width: 260px;
    flex: 0 0 260px;
  }
  .sc-kanban-filter-bar {
    flex-wrap: wrap;
    padding: 6px 10px;
    font-size: 12px;
    gap: 6px;
  }

  /* ── Modal: nearly full screen ───────────────── */
  .sc-modal-overlay {
    align-items: flex-end;
  }
  .sc-modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
    margin: 0;
  }
  .sc-modal-header { padding: 12px 16px; font-size: 14px; }
  .sc-modal-body { padding: 14px 16px; gap: 10px; }
  .sc-modal-footer { padding: 10px 16px; }
  .sc-field-row { flex-direction: column; gap: 10px; }

  /* ── Settings panel: full width ──────────────── */
  .sc-settings-panel {
    width: 100%;
    top: 48px;
    height: calc(100vh - 48px);
  }

  /* ── Gantt ───────────────────────────────────── */
  .sc-gantt-toolbar { padding: 4px 8px; gap: 6px; }
  .sc-gantt-wrap {
    height: calc(100vh - 48px - 36px);
  }
  .sc-gantt-left {
    width: 140px;
    min-width: 140px;
  }
  .sc-gantt-left-header {
    height: 44px;
    padding: 0 8px;
    font-size: 12px;
  }
  .sc-gantt-name-row {
    padding: 0 6px;
    gap: 4px;
  }
  .sc-gantt-task-name { font-size: 11px; }
  .sc-gantt-pri-badge { font-size: 8px; padding: 1px 4px; }
  .sc-gantt-nav-controls {
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
  }
  .sc-gantt-nav-controls .sc-view-switcher {
    flex-wrap: wrap;
    gap: 2px;
  }
  .sc-gantt-nav-controls .sc-view-btn {
    font-size: 10px;
    padding: 3px 5px;
  }
  .sc-gantt-proj-header { padding: 0 6px; font-size: 11px; }

  /* ── People filter ───────────────────────────── */
  .sc-cal-filter-bar {
    padding: 4px 8px;
    gap: 6px;
    font-size: 12px;
    flex-wrap: wrap;
  }
  .sc-people-filter-btn { font-size: 12px; min-width: 90px; padding: 4px 8px; }
  .sc-people-filter-menu { min-width: 180px; }
}
