/* =============================================
   PLANNING (Gantt) — Minya app
   Dark mode premium UI
   ============================================= */

#kanban-planning-wrapper.planning-wrapper {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(20, 12, 7, 0.6) 0%, rgba(20, 12, 7, 0.85) 100%);
}

.planning-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  font-feature-settings: "tnum" 1, "calt" 0;
}

/* === LOADING / EMPTY === */
.planning-loading,
.planning-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 24px;
  flex: 1;
  color: var(--text-muted, #b49a82);
  text-align: center;
}

.planning-empty-state i {
  font-size: 3.5rem;
  color: rgba(122, 74, 42, 0.45);
}

.planning-empty-state h5 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main, #e9ecef);
}

.planning-empty-state p {
  margin: 0;
  max-width: 420px;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* === TOOLBAR === */
.planning-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(20, 12, 7, 0.6);
  border-bottom: 1px solid rgba(58, 42, 30, 0.3);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.planning-toolbar-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.planning-toolbar-filters {
  flex: 1;
  min-width: 240px;
  flex-wrap: wrap;
}

.planning-zoom-group {
  display: inline-flex;
  background: rgba(20, 12, 7, 0.7);
  border: 1px solid rgba(58, 42, 30, 0.4);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.planning-zoom-btn {
  padding: 6px 14px;
  border: 0;
  background: transparent;
  color: var(--text-muted, #b49a82);
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: 0.01em;
}

.planning-zoom-btn:hover {
  color: #e9ecef;
  background: rgba(255, 255, 255, 0.04);
}

.planning-zoom-btn.active {
  background: linear-gradient(135deg, #c87743, #a94c60);
  color: #fff;
  box-shadow: 0 2px 8px rgba(200, 119, 67, 0.35);
}

.planning-zoom-btn:focus-visible {
  outline: 2px solid #c87743;
  outline-offset: 2px;
}

.planning-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main, #e9ecef);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.planning-btn:focus-visible {
  outline: 2px solid #c87743;
  outline-offset: 2px;
}

.planning-btn.primary {
  background: linear-gradient(135deg, #c87743, #a94c60);
  color: #fff;
  border-color: rgba(122, 74, 42, 0.5);
  box-shadow: 0 2px 10px rgba(200, 119, 67, 0.25);
}

.planning-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(200, 119, 67, 0.4);
}

.planning-btn.ghost {
  background: rgba(20, 12, 7, 0.6);
  border-color: rgba(58, 42, 30, 0.4);
  color: var(--text-muted, #b49a82);
}

.planning-btn.ghost:hover {
  color: #e9ecef;
  border-color: rgba(122, 74, 42, 0.4);
  background: rgba(122, 74, 42, 0.08);
}

.planning-btn.danger {
  background: rgba(184, 70, 92, 0.1);
  border-color: rgba(184, 70, 92, 0.4);
  color: #d4707f;
}

.planning-btn.danger:hover {
  background: rgba(184, 70, 92, 0.2);
  border-color: rgba(184, 70, 92, 0.7);
}

.planning-search,
.planning-select {
  padding: 7px 12px;
  background: rgba(20, 12, 7, 0.7);
  border: 1px solid rgba(58, 42, 30, 0.4);
  border-radius: 7px;
  color: var(--text-main, #e9ecef);
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.planning-search {
  min-width: 200px;
  flex: 1;
  max-width: 320px;
}

.planning-select {
  min-width: 140px;
}

.planning-search:focus,
.planning-select:focus {
  border-color: rgba(122, 74, 42, 0.6);
  box-shadow: 0 0 0 3px rgba(122, 74, 42, 0.15);
}

.planning-readonly-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(154, 138, 78, 0.1);
  border: 1px solid rgba(154, 138, 78, 0.3);
  border-radius: 7px;
  color: #e0a851;
  font-size: 0.75rem;
  font-weight: 600;
}

/* === GANTT SHELL === */
.planning-gantt-shell {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.45);
}

/* === SIDEBAR === */
.planning-sidebar {
  display: flex;
  flex-direction: column;
  width: 320px;
  min-width: 240px;
  max-width: 380px;
  flex-shrink: 0;
  background: rgba(20, 12, 7, 0.85);
  border-right: 1px solid rgba(58, 42, 30, 0.3);
  position: relative;
  z-index: 5;
}

.planning-sidebar-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(58, 42, 30, 0.4);
  background: rgba(20, 12, 7, 0.95);
  position: sticky;
  top: 0;
  z-index: 2;
  flex-shrink: 0;
}

.planning-sidebar-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #b49a82);
}

.planning-sidebar-meta {
  font-size: 0.7rem;
  color: rgba(162, 143, 127, 0.7);
  margin-top: 2px;
}

.planning-sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.planning-sidebar-body::-webkit-scrollbar {
  width: 8px;
}

.planning-sidebar-body::-webkit-scrollbar-thumb {
  background: rgba(58, 42, 30, 0.4);
  border-radius: 4px;
}

.planning-sidebar-body::-webkit-scrollbar-thumb:hover {
  background: rgba(122, 74, 42, 0.5);
}

/* === ROWS (sidebar) === */
.planning-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(58, 42, 30, 0.18);
  position: relative;
  transition: background-color 0.15s ease;
}

.planning-row-group {
  background: rgba(122, 74, 42, 0.07);
  font-weight: 600;
  cursor: default;
}

.planning-row-group .planning-group-name {
  flex: 1;
  font-size: 0.83rem;
  color: var(--text-main, #e9ecef);
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-row-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--text-muted, #b49a82);
  cursor: pointer;
  border-radius: 5px;
  transition: all 0.15s ease;
}

.planning-row-collapse:hover {
  background: rgba(122, 74, 42, 0.15);
  color: #e9ecef;
}

.planning-group-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.planning-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  background: rgba(20, 12, 7, 0.7);
  border: 1px solid rgba(58, 42, 30, 0.4);
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted, #b49a82);
}

.planning-group-actions {
  display: none;
  align-items: center;
  gap: 2px;
  margin-left: 4px;
}

.planning-row-group:hover .planning-group-actions {
  display: inline-flex;
}

.planning-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--text-muted, #b49a82);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.85rem;
}

.planning-icon-btn:hover {
  background: rgba(122, 74, 42, 0.18);
  color: #e9ecef;
}

.planning-icon-btn.danger:hover {
  background: rgba(184, 70, 92, 0.18);
  color: #e3a8b1;
}

.planning-row-task {
  cursor: pointer;
  background: transparent;
}

.planning-row-task:hover {
  background: rgba(122, 74, 42, 0.06);
}

.planning-row-task.selected {
  background: rgba(200, 119, 67, 0.14);
  box-shadow: inset 3px 0 0 #c87743;
}

.planning-row-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(20, 12, 7, 0.8);
}

.planning-row-task-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 2px;
}

.planning-row-task-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-main, #e9ecef);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planning-row-task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: rgba(162, 143, 127, 0.85);
  font-variant-numeric: tabular-nums;
}

.planning-row-progress {
  font-weight: 600;
  color: #a3d4b5;
}

.planning-row-avatars {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.planning-row-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a94c60, #a94c60);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  border: 2px solid rgba(20, 12, 7, 0.95);
  margin-left: -6px;
}

.planning-row-avatar:first-child {
  margin-left: 0;
}

.planning-row-avatar.more {
  background: rgba(58, 42, 30, 0.7);
  font-size: 0.6rem;
}

/* === GRID AREA === */
.planning-grid-area {
  flex: 1;
  min-width: 0;
  overflow: auto;
  position: relative;
  scrollbar-gutter: stable;
  scroll-behavior: auto;
  cursor: grab;
}

.planning-grid-area.panning {
  cursor: grabbing;
  user-select: none;
  scroll-behavior: auto;
}

.planning-grid-area.panning * {
  cursor: grabbing !important;
  user-select: none;
}

.planning-grid-area::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.planning-grid-area::-webkit-scrollbar-track {
  background: rgba(20, 12, 7, 0.4);
}

.planning-grid-area::-webkit-scrollbar-thumb {
  background: rgba(58, 42, 30, 0.5);
  border-radius: 5px;
  border: 2px solid rgba(20, 12, 7, 0.4);
}

.planning-grid-area::-webkit-scrollbar-thumb:hover {
  background: rgba(122, 74, 42, 0.6);
}

.planning-grid-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(20, 12, 7, 0.98);
  border-bottom: 1px solid rgba(58, 42, 30, 0.5);
  display: flex;
  flex-direction: column;
}

.planning-header-row {
  display: flex;
  flex-shrink: 0;
}

.planning-header-row-top {
  height: 30px;
  background: rgba(20, 12, 7, 0.85);
  border-bottom: 1px solid rgba(58, 42, 30, 0.35);
}

.planning-header-row-bottom {
  flex: 1;
  background: rgba(20, 12, 7, 0.5);
}

.planning-header-band {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-right: 1px solid rgba(58, 42, 30, 0.3);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.planning-header-band-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: capitalize;
  letter-spacing: 0.01em;
  color: var(--text-main, #e9ecef);
  text-overflow: ellipsis;
  overflow: hidden;
}

.planning-header-band-sub {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(162, 143, 127, 0.65);
  font-variant-numeric: tabular-nums;
}

.planning-header-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-right: 1px solid rgba(58, 42, 30, 0.16);
  color: var(--text-muted, #b49a82);
  position: relative;
  font-variant-numeric: tabular-nums;
  padding: 4px 6px;
  text-align: center;
  overflow: hidden;
  min-width: 0;
}

.planning-header-cell-main {
  font-weight: 700;
  color: var(--text-main, #e9ecef);
  letter-spacing: 0.01em;
  line-height: 1.1;
  white-space: nowrap;
}

.planning-header-cell-sub {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(162, 143, 127, 0.7);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-weight: 500;
}

.planning-header-cell.day .planning-header-cell-main {
  font-size: 0.95rem;
  margin-top: 1px;
}

.planning-header-cell.day .planning-header-cell-sub {
  order: -1;
  font-size: 0.58rem;
  color: rgba(162, 143, 127, 0.55);
}

.planning-header-cell.week .planning-header-cell-main {
  font-size: 0.82rem;
  background: rgba(122, 74, 42, 0.14);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(122, 74, 42, 0.28);
  color: #e0a3ae;
  letter-spacing: 0.02em;
}

.planning-header-cell.week .planning-header-cell-sub {
  font-size: 0.62rem;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(162, 143, 127, 0.85);
  margin-top: 1px;
  font-weight: 500;
}

.planning-header-cell.month .planning-header-cell-main {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.planning-header-cell.weekend {
  background: rgba(122, 74, 42, 0.04);
}

.planning-header-cell.weekend .planning-header-cell-main {
  color: rgba(162, 143, 127, 0.85);
}

.planning-header-cell.today {
  background: linear-gradient(180deg, rgba(200, 119, 67, 0.22) 0%, rgba(200, 119, 67, 0.05) 100%);
  border-bottom: 2px solid #c87743;
}

.planning-header-cell.today .planning-header-cell-main {
  color: #fff;
}

.planning-header-cell.today.week .planning-header-cell-main {
  background: rgba(200, 119, 67, 0.6);
  border-color: rgba(200, 119, 67, 0.9);
  color: #fff;
}

/* === GRID BODY === */
.planning-grid-body {
  position: relative;
}

.planning-grid-cols {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}

.planning-grid-col {
  height: 100%;
  border-right: 1px solid rgba(58, 42, 30, 0.12);
  flex-shrink: 0;
}

.planning-grid-col.weekend {
  background: rgba(122, 74, 42, 0.025);
}

.planning-grid-rows {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.planning-grid-row {
  position: absolute;
  left: 0;
  border-bottom: 1px solid rgba(58, 42, 30, 0.12);
}

.planning-grid-row.group {
  background: rgba(122, 74, 42, 0.04);
  border-bottom: 1px solid rgba(122, 74, 42, 0.18);
}

/* === TODAY LINE === */
.planning-today-line {
  position: absolute;
  top: 0;
  width: 2px;
  background: linear-gradient(180deg, #c87743 0%, rgba(200, 119, 67, 0.4) 100%);
  z-index: 3;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(200, 119, 67, 0.5);
}

.planning-today-flag {
  position: absolute;
  top: -28px;
  left: -34px;
  padding: 3px 8px;
  background: #c87743;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(200, 119, 67, 0.5);
  pointer-events: none;
}

.planning-today-flag::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #c87743;
}

/* === BARS === */
.planning-bar {
  position: absolute;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--bar-color, #c87743) 0%, color-mix(in srgb, var(--bar-color, #c87743) 80%, black) 100%);
  border: 1px solid color-mix(in srgb, var(--bar-color, #c87743) 70%, white 10%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: default;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  touch-action: none;
}

.planning-bar-fill {
  border-radius: 7px 0 0 7px;
}

.planning-bar.editable {
  cursor: grab;
}

.planning-bar.editable:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--priority-color, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.planning-bar.dragging {
  cursor: grabbing;
  transform: scale(1.02);
  z-index: 10;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  opacity: 0.95;
}

.planning-bar.selected {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.planning-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.18);
  border-right: 1px solid rgba(255, 255, 255, 0.35);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.planning-bar-label {
  position: relative;
  z-index: 1;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.planning-bar-progress {
  position: relative;
  z-index: 1;
  margin-left: 8px;
  font-size: 0.68rem;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.planning-bar-date {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.66rem;
  font-weight: 600;
  color: rgba(232, 221, 210, 0.95);
  background: rgba(20, 12, 7, 0.92);
  border: 1px solid rgba(122, 74, 42, 0.35);
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  z-index: 4;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  text-transform: capitalize;
}

.planning-bar-date-start {
  right: calc(100% + 8px);
}

.planning-bar-date-end {
  left: calc(100% + 8px);
}

.planning-bar:hover .planning-bar-date {
  background: rgba(38, 26, 18, 0.95);
  border-color: rgba(122, 74, 42, 0.6);
  color: #fff;
}

.planning-bar.dragging .planning-bar-date {
  background: var(--bar-color, #c87743);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

.planning-bar-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 3;
}

.planning-bar-resize.left { left: 0; }
.planning-bar-resize.right { right: 0; }

.planning-bar-resize::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 60%;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.planning-bar:hover .planning-bar-resize::after {
  opacity: 1;
}

/* === MILESTONES === */
.planning-milestone-wrap {
  position: absolute;
  width: 20px;
  height: 20px;
  z-index: 2;
}

.planning-milestone-label {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(232, 221, 210, 0.92);
  background: rgba(20, 12, 7, 0.85);
  border: 1px solid rgba(58, 42, 30, 0.4);
  padding: 2px 7px;
  border-radius: 5px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.planning-milestone {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: default;
  transition: transform 0.15s ease;
}

.planning-milestone i {
  transform: rotate(-45deg);
  color: #fff;
  font-size: 0.7rem;
}

.planning-milestone.editable {
  cursor: grab;
}

.planning-milestone.editable:hover {
  transform: rotate(45deg) scale(1.18);
}

.planning-milestone.dragging {
  transform: rotate(45deg) scale(1.1);
  z-index: 10;
}

/* === DEPENDENCIES SVG === */
.planning-deps-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.planning-dep-path {
  fill: none;
  stroke: rgba(162, 143, 127, 0.55);
  stroke-width: 1.5;
  stroke-dasharray: 0;
  transition: stroke 0.2s ease;
}

.planning-dep-path:hover {
  stroke: rgba(122, 74, 42, 0.9);
  stroke-width: 2;
}

/* === MODAL === */
.planning-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: planningOverlayIn 0.18s ease;
}

@keyframes planningOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.planning-modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  background: linear-gradient(180deg, rgba(38, 26, 18, 0.95) 0%, rgba(20, 12, 7, 0.95) 100%);
  border: 1px solid rgba(58, 42, 30, 0.5);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(122, 74, 42, 0.1);
  animation: planningModalIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.planning-modal.wide {
  max-width: 640px;
}

@keyframes planningModalIn {
  from { transform: translateY(12px) scale(0.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.planning-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(58, 42, 30, 0.4);
  background: rgba(20, 12, 7, 0.6);
  flex-shrink: 0;
}

.planning-modal-header h6 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main, #e9ecef);
  letter-spacing: 0.01em;
}

.planning-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--text-muted, #b49a82);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.planning-modal-close:hover {
  background: rgba(184, 70, 92, 0.12);
  color: #e3a8b1;
}

.planning-modal-close:focus-visible {
  outline: 2px solid #c87743;
  outline-offset: 2px;
}

.planning-modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.planning-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid rgba(58, 42, 30, 0.3);
  background: rgba(20, 12, 7, 0.4);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* === FORM === */
.planning-form-row {
  margin-bottom: 16px;
}

.planning-form-row:last-child {
  margin-bottom: 0;
}

.planning-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.planning-form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.planning-form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #b49a82);
  margin-bottom: 6px;
}

.planning-form-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
  color: var(--text-main, #e9ecef);
  font-weight: 500;
  margin-top: 22px;
  cursor: pointer;
}

.planning-form-checkbox-label input {
  width: 16px;
  height: 16px;
  accent-color: #c87743;
  cursor: pointer;
}

.planning-form-input {
  width: 100%;
  padding: 9px 12px;
  background: rgba(20, 12, 7, 0.7);
  border: 1px solid rgba(58, 42, 30, 0.45);
  border-radius: 7px;
  color: var(--text-main, #e9ecef);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  font-family: inherit;
}

.planning-form-input:focus {
  border-color: rgba(122, 74, 42, 0.7);
  box-shadow: 0 0 0 3px rgba(122, 74, 42, 0.18);
}

.planning-form-input:disabled,
fieldset[disabled] .planning-form-input {
  opacity: 0.6;
  cursor: not-allowed;
}

.planning-form-color {
  width: 100%;
  height: 38px;
  padding: 4px;
  cursor: pointer;
}

textarea.planning-form-input {
  resize: vertical;
  min-height: 60px;
  font-family: inherit;
}

/* === MENTION PICKER === */
.planning-mention-hint {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 8px;
  color: rgba(162, 143, 127, 0.7);
}

.planning-mention-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  background: rgba(122, 74, 42, 0.18);
  border: 1px solid rgba(122, 74, 42, 0.35);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.65rem;
  color: #e0a3ae;
  margin: 0 2px;
}

.planning-mention-field {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  background: rgba(20, 12, 7, 0.7);
  border: 1px solid rgba(58, 42, 30, 0.45);
  border-radius: 7px;
  min-height: 38px;
  cursor: text;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.planning-mention-field:focus-within {
  border-color: rgba(122, 74, 42, 0.7);
  box-shadow: 0 0 0 3px rgba(122, 74, 42, 0.18);
}

.planning-mention-field.readonly {
  opacity: 0.7;
  cursor: not-allowed;
}

.planning-mention-pills {
  display: contents;
}

.planning-mention-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 6px;
  background: rgba(122, 74, 42, 0.18);
  border: 1px solid rgba(122, 74, 42, 0.4);
  border-radius: 999px;
  color: var(--text-main, #e9ecef);
  font-size: 0.78rem;
  font-weight: 500;
  user-select: none;
  animation: pillIn 0.18s ease;
}

@keyframes pillIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.planning-mention-pill-name {
  letter-spacing: 0.01em;
}

.planning-mention-pill-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  background: transparent;
  color: rgba(162, 143, 127, 0.85);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.7rem;
  margin-left: 2px;
}

.planning-mention-pill-x:hover {
  background: rgba(184, 70, 92, 0.25);
  color: #e3a8b1;
}

.planning-mention-input {
  flex: 1;
  min-width: 120px;
  border: 0;
  background: transparent;
  color: var(--text-main, #e9ecef);
  font-size: 0.85rem;
  outline: none;
  padding: 4px 0;
  font-family: inherit;
}

.planning-mention-input:disabled {
  cursor: not-allowed;
}

.planning-mention-input::placeholder {
  color: rgba(162, 143, 127, 0.55);
}

.planning-mention-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 10;
  background: linear-gradient(180deg, rgba(38, 26, 18, 0.98) 0%, rgba(20, 12, 7, 0.98) 100%);
  border: 1px solid rgba(122, 74, 42, 0.3);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(122, 74, 42, 0.1);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
  animation: suggestIn 0.15s ease;
}

@keyframes suggestIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.planning-mention-suggestions::-webkit-scrollbar {
  width: 6px;
}

.planning-mention-suggestions::-webkit-scrollbar-thumb {
  background: rgba(122, 74, 42, 0.4);
  border-radius: 3px;
}

.planning-mention-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.12s ease;
  border-bottom: 1px solid rgba(58, 42, 30, 0.15);
}

.planning-mention-item:last-child {
  border-bottom: 0;
}

.planning-mention-item:hover,
.planning-mention-item.active {
  background: linear-gradient(90deg, rgba(122, 74, 42, 0.18) 0%, rgba(122, 74, 42, 0.06) 100%);
  box-shadow: inset 3px 0 0 #a94c60;
}

.planning-mention-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main, #e9ecef);
}

.planning-mention-empty {
  padding: 14px 16px;
  font-size: 0.8rem;
  color: var(--text-muted, #b49a82);
  text-align: center;
  font-style: italic;
}

/* avatar img variant */
.planning-row-avatar.has-img {
  padding: 0;
  overflow: hidden;
}

.planning-row-avatar.has-img img {
  display: block;
}

/* === RESPONSIVE === */
@media (max-width: 1100px) {
  .planning-sidebar {
    width: 260px;
  }
  .planning-form-grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .planning-toolbar {
    padding: 10px 14px;
    gap: 8px;
  }
  .planning-toolbar-filters {
    order: 99;
    width: 100%;
  }
  .planning-search {
    min-width: 0;
    max-width: none;
    flex: 1;
  }
  .planning-sidebar {
    width: 220px;
    min-width: 200px;
  }
  .planning-row-task-meta {
    display: none;
  }
}

@media (max-width: 640px) {
  .planning-sidebar {
    width: 180px;
    min-width: 160px;
  }
  .planning-row-avatars {
    display: none;
  }
  .planning-form-grid-2,
  .planning-form-grid-3 {
    grid-template-columns: 1fr;
  }
  .planning-zoom-btn {
    padding: 6px 10px;
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .planning-bar,
  .planning-bar-fill,
  .planning-modal,
  .planning-modal-overlay,
  .planning-zoom-btn,
  .planning-btn,
  .planning-row {
    transition: none !important;
    animation: none !important;
  }
}
