.plans-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.plans-container.gantt-mode {
    max-width: none;
}

.objectives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.objective-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.objective-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.objective-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
}

.objective-card .obj-desc {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 0.75rem 0;
    line-height: 1.4;
}

.objective-card .obj-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

.progress-bar-wrap {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.progress-bar-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.plan-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.btn-add {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-add:hover {
    background: #2563eb;
}

.view-toggle {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 2px;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    border: none;
    background: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
}

.view-btn.active {
    background: #fff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.view-btn:hover:not(.active) {
    color: #1e293b;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #3b82f6;
    font-size: 0.8rem;
    cursor: pointer;
    margin-bottom: 1rem;
    border: none;
    background: none;
    padding: 0;
}

.back-link:hover {
    text-decoration: underline;
}

.plan-tree {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.plan-item {
    border-bottom: 1px solid #f1f5f9;
}

.plan-item:last-child {
    border-bottom: none;
}

.plan-item-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    transition: background 0.1s;
}

.plan-item-row:hover {
    background: #f8fafc;
}

.plan-item-indent {
    display: flex;
    align-items: center;
}

.indent-guide {
    width: 24px;
    display: flex;
    justify-content: center;
    color: #cbd5e1;
    font-size: 0.6rem;
}

.toggle-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 4px;
    font-size: 0.7rem;
    transition: all 0.15s;
    flex-shrink: 0;
}

.toggle-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

.type-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.type-icon.task { background: #eff6ff; color: #3b82f6; }
.type-icon.plan { background: #f0fdf4; color: #22c55e; }

.item-title {
    flex: 1;
    font-size: 0.85rem;
    color: #1e293b;
    min-width: 0;
}

.item-title.completed {
    text-decoration: line-through;
    color: #94a3b8;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-badge.not_started { background: #f1f5f9; color: #64748b; }
.status-badge.in_progress { background: #dbeafe; color: #2563eb; }
.status-badge.completed { background: #dcfce7; color: #16a34a; }
.status-badge.blocked { background: #fee2e2; color: #dc2626; }

.priority-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-dot.low { background: #94a3b8; }
.priority-dot.medium { background: #f59e0b; }
.priority-dot.high { background: #ef4444; }
.priority-dot.critical { background: #dc2626; }

.item-assignee {
    font-size: 0.7rem;
    color: #64748b;
    white-space: nowrap;
    flex-shrink: 0;
}

.item-due {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.item-due.overdue {
    color: #ef4444;
    font-weight: 500;
}

.item-progress {
    width: 48px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    color: #64748b;
    flex-shrink: 0;
}

.item-progress .mini-bar {
    flex: 1;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.item-progress .mini-bar-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 2px;
}

.item-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.plan-item-row:hover .item-actions {
    opacity: 1;
}

.item-actions button {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.item-actions button:hover { background: #f1f5f9; color: #475569; }
.item-actions button.delete:hover { background: #fee2e2; color: #dc2626; }

.empty-plan {
    text-align: center;
    padding: 3rem 2rem;
    color: #94a3b8;
}

.empty-plan i { font-size: 2.5rem; margin-bottom: 1rem; display: block; }
.empty-plan p { margin: 0 0 1rem 0; font-size: 0.9rem; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-card {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 520px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #3b82f6;
}

.form-group textarea { resize: vertical; min-height: 60px; }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.modal-actions button {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
}

.modal-actions .btn-primary { background: #3b82f6; color: #fff; }
.modal-actions .btn-primary:hover { background: #2563eb; }
.modal-actions .btn-secondary { background: #f1f5f9; color: #64748b; }
.modal-actions .btn-danger { background: #fee2e2; color: #dc2626; }
.modal-actions .btn-danger:hover { background: #fecaca; }

.section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.create-objective-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px dashed #cbd5e1;
    background: none;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 1.5rem;
}

.create-objective-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.gantt-wrapper {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.gantt-scroll-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 240px);
}

.gantt-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.gantt-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.gantt-table th {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.4rem 0.5rem;
    font-weight: 600;
    color: #475569;
    text-align: left;
    white-space: nowrap;
}

.gantt-month-header {
    text-align: center !important;
    background: #eef2ff !important;
    color: #3730a3 !important;
    font-size: 0.72rem;
}

.gantt-week-header {
    text-align: center !important;
    font-size: 0.68rem;
    font-weight: 500 !important;
    min-width: 90px;
}

.gantt-table td {
    border: 1px solid #f1f5f9;
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
    vertical-align: middle;
}

.gantt-col-wbs {
    width: 80px;
    min-width: 80px;
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 5;
}

.gantt-col-task {
    width: 220px;
    min-width: 220px;
    max-width: 300px;
    position: sticky;
    left: 80px;
    background: #fff;
    z-index: 5;
}

thead .gantt-col-wbs,
thead .gantt-col-task {
    background: #f8fafc;
    z-index: 15;
}

.gantt-col-assigned { width: 80px; min-width: 80px; }
.gantt-col-pred { width: 50px; min-width: 50px; }
.gantt-col-start { width: 60px; min-width: 60px; }
.gantt-col-end { width: 60px; min-width: 60px; }
.gantt-col-days { width: 40px; min-width: 40px; text-align: center; }
.gantt-col-pct { width: 90px; min-width: 90px; }

.gantt-chart-cell {
    min-width: 90px;
    height: 28px;
    position: relative;
    padding: 0 !important;
}

.gantt-row {
    transition: background 0.1s;
}

.gantt-row:hover td {
    background: #f8fafc;
}

.gantt-row:hover .gantt-col-wbs,
.gantt-row:hover .gantt-col-task {
    background: #f8fafc;
}

.gantt-plan-row td {
    background: #f0fdf4;
    font-weight: 500;
}

.gantt-plan-row .gantt-col-wbs,
.gantt-plan-row .gantt-col-task {
    background: #f0fdf4;
}

.gantt-completed td {
    opacity: 0.6;
}

.gantt-phase-row td {
    background: #eef2ff;
}

.gantt-phase-cell {
    font-weight: 600;
    color: #3730a3;
    font-size: 0.78rem;
    padding: 0.5rem 0.75rem !important;
}

.gantt-phase-cell i {
    margin-right: 0.4rem;
    font-size: 0.7rem;
}

.gantt-toggle {
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 2px;
}

.gantt-toggle:hover {
    background: #e2e8f0;
    color: #475569;
}

.wbs-number {
    font-weight: 500;
    color: #6366f1;
    font-size: 0.72rem;
}

.gantt-task-indent {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.gantt-type-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 0.6rem;
    flex-shrink: 0;
}

.gantt-type-icon.task { background: #eff6ff; color: #3b82f6; }
.gantt-type-icon.plan { background: #f0fdf4; color: #22c55e; }

.gantt-task-title {
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gantt-task-title:hover {
    color: #3b82f6;
    text-decoration: underline;
}

.gantt-task-title.completed {
    text-decoration: line-through;
    color: #94a3b8;
}

.gantt-pct-cell {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.gantt-pct-bar {
    flex: 1;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    min-width: 40px;
}

.gantt-pct-fill {
    height: 100%;
    background: #3b82f6;
    border-radius: 3px;
    transition: width 0.3s;
}

.gantt-pct-cell span {
    font-size: 0.68rem;
    color: #64748b;
    min-width: 28px;
    text-align: right;
}

.plans-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.sc-hierarchy-group {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.sc-hierarchy-group:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.sc-hierarchy-group.unlinked {
    border-style: dashed;
    border-color: #cbd5e1;
}

.sc-hierarchy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.15s;
    gap: 1rem;
}

.sc-hierarchy-header:hover {
    background: #f8fafc;
}

.sc-hierarchy-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.sc-hierarchy-toggle {
    width: 28px;
    height: 28px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 0.7rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.sc-hierarchy-header:hover .sc-hierarchy-toggle {
    background: #e2e8f0;
    color: #475569;
}

.sc-hierarchy-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #eef2ff, #dbeafe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.sc-hierarchy-icon.unlinked {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #94a3b8;
}

.sc-hierarchy-info {
    min-width: 0;
}

.sc-hierarchy-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.sc-hierarchy-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sc-hierarchy-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.sc-hierarchy-badge.strategic {
    background: #eef2ff;
    color: #4f46e5;
}

.sc-hierarchy-badge.unlinked {
    background: #f1f5f9;
    color: #94a3b8;
}

.sc-hierarchy-metric {
    font-size: 0.72rem;
    color: #64748b;
}

.sc-hierarchy-count {
    font-size: 0.72rem;
    color: #94a3b8;
}

.sc-hierarchy-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.sc-hierarchy-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.sc-hierarchy-progress-track {
    width: 80px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
}

.sc-hierarchy-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s;
}

.sc-hierarchy-add-btn {
    width: 32px;
    height: 32px;
    border: 1px dashed #cbd5e1;
    background: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.sc-hierarchy-add-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.sc-hierarchy-children {
    padding: 0.25rem 1.25rem 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.75rem;
}

.sc-hierarchy-empty {
    font-size: 0.8rem;
    color: #94a3b8;
    padding: 0.75rem 0;
    grid-column: 1 / -1;
}

.sc-hierarchy-empty a {
    color: #3b82f6;
    text-decoration: none;
}

.sc-hierarchy-empty a:hover {
    text-decoration: underline;
}

.objective-card .obj-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.objective-card .obj-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.objective-card .obj-card-info {
    flex: 1;
    min-width: 0;
}

.plan-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    padding: 0.6rem 0.85rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.breadcrumb-item {
    cursor: default;
}

.breadcrumb-item:first-child {
    color: #3b82f6;
    cursor: pointer;
}

.breadcrumb-item:first-child:hover {
    text-decoration: underline;
}

.breadcrumb-item.strategic {
    color: #4f46e5;
    font-weight: 500;
}

.breadcrumb-item.current {
    color: #1e293b;
    font-weight: 600;
}

.breadcrumb-sep {
    font-size: 0.55rem;
    color: #cbd5e1;
}

.add-item-breadcrumb {
    font-size: 0.72rem;
    color: #64748b;
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
}

.add-item-breadcrumb i:first-child {
    color: #4f46e5;
    margin-right: 0.3rem;
}

.plan-item.depth-root > .plan-item-row {
    border-left: 3px solid #3b82f6;
}

.plan-item.depth-1 > .plan-item-row {
    border-left: 3px solid #60a5fa;
}

.plan-item.depth-deep > .plan-item-row {
    border-left: 3px solid #93c5fd;
}

.type-icon.depth-0 { background: #dbeafe; color: #1d4ed8; }
.type-icon.depth-1 { background: #e0f2fe; color: #0284c7; }
.type-icon.depth-2 { background: #eff6ff; color: #3b82f6; }
.type-icon.depth-3 { background: #f0fdf4; color: #22c55e; }

.gantt-inline-add {
    width: 18px;
    height: 18px;
    border: none;
    background: #eff6ff;
    border-radius: 4px;
    color: #3b82f6;
    font-size: 0.55rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    opacity: 0;
    transition: all 0.15s;
    flex-shrink: 0;
}

.gantt-row:hover .gantt-inline-add {
    opacity: 1;
}

.gantt-inline-add:hover {
    background: #3b82f6;
    color: #fff;
}

.gantt-cell {
    position: relative;
    min-width: 90px;
    height: 28px;
    padding: 0 !important;
}

.gantt-bar-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.gantt-bar {
    position: absolute;
    top: 4px;
    height: 20px;
    border-radius: 4px;
    opacity: 0.85;
    z-index: 1;
    overflow: hidden;
}

.gantt-bar.plan-bar {
    border-radius: 2px;
    height: 10px;
    top: 9px;
}

.gantt-bar-progress {
    height: 100%;
    background: rgba(0,0,0,0.15);
    border-radius: 4px 0 0 4px;
}

@media (max-width: 768px) {
    .objectives-grid,
    .sc-hierarchy-children {
        grid-template-columns: 1fr;
    }

    .plans-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .sc-hierarchy-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .sc-hierarchy-right {
        width: 100%;
        justify-content: space-between;
    }

    .sc-hierarchy-progress-track {
        width: 60px;
    }

    .sc-hierarchy-children {
        padding: 0.25rem 0.75rem 0.75rem;
    }

    .plan-breadcrumb {
        font-size: 0.7rem;
        padding: 0.5rem 0.65rem;
    }

    .plan-item-row {
        flex-wrap: wrap;
        gap: 0.35rem;
    }

    .item-assignee, .item-due, .item-progress {
        font-size: 0.65rem;
    }

    .item-actions {
        opacity: 1;
    }

    .gantt-scroll-container {
        max-height: calc(100vh - 200px);
    }

    .gantt-col-task {
        min-width: 160px;
        width: 160px;
    }

    .gantt-col-assigned,
    .gantt-col-pred {
        display: none;
    }

    .view-toggle {
        order: -1;
    }

    .plan-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
