:root {
    --bg: #0f172a;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --blue: #3b82f6;
    --amber: #f59e0b;
    --green: #10b981;
    --red: #ef4444;
    --purple: #8b5cf6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(180deg, #e0e7ff 0%, #f8fafc 45%, #eef2ff 100%);
    color: var(--text);
}

.hero {
    padding: 18px 32px 12px;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: #fff;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #bfdbfe;
}

.hero h1 {
    margin: 0;
    font-size: 24px;
}

.subtitle {
    margin: 0;
    max-width: 860px;
    color: #dbeafe;
    line-height: 1.5;
}

.hero-actions {
    margin-top: 16px;
}

.auth-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.auth-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.auth-chip.light {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.hidden-by-auth {
    display: none !important;
}

.page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 18px 24px 48px;
}

.filter-panel {
    margin-bottom: 16px;
}

.filter-panel-actions {
    justify-content: flex-end;
    align-items: center;
}

.tab-shell {
    padding: 10px 12px;
}

.tab-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-button {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-button:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.tab-button.active {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.dashboard-tab-panel {
    display: none;
}

.dashboard-tab-panel.active {
    display: block;
}

.filter-toolbar {
    display: flex;
    gap: 14px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-field {
    display: grid;
    gap: 8px;
    min-width: min(360px, 100%);
}

.filter-field span {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.filter-field select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
}

.filter-field select:focus {
    outline: 2px solid rgba(59, 130, 246, 0.18);
    border-color: #60a5fa;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stats-panel {
    margin-bottom: 16px;
}

.stat-card,
.panel,
.project-card {
    background: var(--panel);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

.stat-card {
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
}

.stat-note {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.stat-subnote {
    margin-top: 6px;
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
}

.stat-breakdown {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.stat-breakdown-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(226, 232, 240, 0.9);
    width: 100%;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.stat-breakdown-row:hover,
.stat-main-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.stat-breakdown-row.selected,
.stat-card.selected .stat-main-trigger {
    outline: 2px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 10px 22px rgba(59, 130, 246, 0.12);
}

.stat-breakdown-row.danger {
    background: linear-gradient(180deg, rgba(254, 226, 226, 0.92) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(239, 68, 68, 0.24);
}

.stat-breakdown-row.warning {
    background: linear-gradient(180deg, rgba(255, 237, 213, 0.92) 0%, rgba(255, 255, 255, 0.96) 100%);
    border-color: rgba(245, 158, 11, 0.24);
}

.stat-breakdown-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #334155;
}

.stat-breakdown-label::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #94a3b8;
}

.stat-breakdown-label.danger::before { background: var(--red); }
.stat-breakdown-label.warning::before { background: var(--amber); }
.stat-breakdown-label.info::before { background: var(--blue); }
.stat-breakdown-label.neutral::before { background: #94a3b8; }

.stat-breakdown-value {
    font-size: 18px;
    color: #0f172a;
}

.stat-breakdown-value.danger {
    color: #b91c1c;
    font-size: 22px;
}

.stat-breakdown-value.warning {
    color: #b45309;
    font-size: 22px;
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 999px;
}

.stat-main-trigger {
    width: 100%;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(248, 250, 252, 0.92);
    border-radius: 14px;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.stat-card.danger::before { background: var(--red); }
.stat-card.warning::before { background: var(--purple); }
.stat-card.info::before { background: var(--blue); }
.stat-card.success::before { background: var(--green); }

.panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.panel {
    padding: 20px;
    margin-bottom: 16px;
}

.panel-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-title h2 {
    margin: 0;
    font-size: 20px;
}

.panel-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.status-guide-panel {
    margin-bottom: 16px;
    padding: 12px 14px;
}

.status-guide-panel .panel-title {
    margin-bottom: 8px;
}

.status-guide-panel .panel-title h2 {
    font-size: 16px;
}

.status-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.status-guide-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px 10px;
    background: #f8fafc;
}

.status-guide-item.delayed {
    background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%);
}

.status-guide-item.blocked {
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
}

.status-guide-item.completed {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 100%);
}

.status-guide-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 3px;
}

.status-guide-item p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.status-guide-item strong {
    font-size: 12px;
}

.status-guide-item .badge {
    padding: 2px 8px;
    font-size: 11px;
}

.hint {
    color: var(--muted);
    font-size: 13px;
}

.pill,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

.nav-link.light {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.pill.danger,
.badge.delayed {
    background: #fee2e2;
    color: #b91c1c;
}

.pill.info,
.badge.in_progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.completed {
    background: #dcfce7;
    color: #047857;
}

.badge.blocked {
    background: #f3e8ff;
    color: #7c3aed;
}

.badge.not_started {
    background: #e2e8f0;
    color: #475569;
}

.stack-list {
    display: grid;
    gap: 12px;
}

.stack-list.empty {
    color: var(--muted);
}

.meta {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.action-grid {
    align-items: start;
}

.detail-list {
    gap: 10px;
}

.action-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    background: #f8fafc;
}

.detail-item {
    border-width: 1px;
}

.detail-meta-line {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.action-item.blocked {
    border-color: rgba(124, 58, 237, 0.22);
    background: linear-gradient(180deg, #faf5ff 0%, #ffffff 100%);
}

.action-item.delayed {
    border-color: rgba(239, 68, 68, 0.18);
    background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%);
}

.action-main,
.action-row {
    min-width: 0;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.action-title {
    font-size: 15px;
    line-height: 1.4;
}

.action-date {
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.action-path {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.action-reason {
    margin-top: 6px;
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
}

.action-owner {
    color: var(--muted);
    font-size: 13px;
    text-align: right;
    white-space: nowrap;
}

.gantt-wrapper {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fcfdff;
}

.gantt-mobile-summary {
    gap: 12px;
    margin-bottom: 14px;
}

.gantt-mobile-card {
    border: 1px solid #dbe5f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    padding: 14px;
    display: grid;
    gap: 12px;
}

.gantt-mobile-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.gantt-mobile-head strong {
    display: block;
    font-size: 16px;
    color: #0f172a;
}

.gantt-mobile-head span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.gantt-mobile-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.gantt-mobile-overview article {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    padding: 10px;
    display: grid;
    gap: 4px;
}

.gantt-mobile-overview span {
    color: #64748b;
    font-size: 12px;
}

.gantt-mobile-overview strong {
    color: #0f172a;
    font-size: 18px;
}

.gantt-mobile-note {
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
}

.gantt-mobile-stage-list {
    display: grid;
    gap: 8px;
}

.gantt-mobile-stage {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    padding: 12px;
    display: grid;
    gap: 6px;
}

.gantt-mobile-stage.blocked {
    border-color: rgba(239, 68, 68, 0.18);
    background: linear-gradient(180deg, #fff1f2 0%, #ffffff 100%);
}

.gantt-mobile-stage.delayed {
    border-color: rgba(245, 158, 11, 0.2);
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
}

.gantt-mobile-stage-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.gantt-mobile-stage-head strong {
    font-size: 14px;
    color: #0f172a;
}

.gantt-mobile-stage-meta {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.gantt-body {
    display: grid;
    gap: 18px;
    padding: 10px 0 0;
}

.gantt-group {
    border-top: 1px solid #eef2ff;
}

.gantt-header,
.gantt-row {
    display: grid;
    grid-template-columns: 320px minmax(680px, 1fr);
    min-width: 1000px;
}

.gantt-header {
    position: sticky;
    top: 0;
    background: #f8fbff;
    border-bottom: 1px solid var(--line);
    z-index: 1;
}

.gantt-label-head,
.gantt-scale {
    padding: 12px 10px;
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.gantt-scale {
    position: relative;
    overflow: hidden;
}

.gantt-today-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    transform: translateX(-50%);
    border-left: 2px dashed rgba(239, 68, 68, 0.7);
    pointer-events: none;
}

.gantt-today-label {
    position: absolute;
    top: 4px;
    left: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.gantt-row {
    border-bottom: 1px solid #f1f5f9;
}

.gantt-row.product-tone {
    background: var(--product-surface);
}

.gantt-row.product-tone .gantt-label {
    box-shadow: inset 4px 0 0 var(--product-accent);
}

.gantt-row.product-tone .gantt-bar-area {
    background-color: var(--product-area);
}

.gantt-row:hover {
    background: #f8fbff;
}

.gantt-label {
    padding: 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid #f1f5f9;
}

.gantt-project-row {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.gantt-project-row .gantt-label {
    padding: 16px 14px;
}

.gantt-project-row .gantt-name {
    font-size: 15px;
}

.gantt-product-row .gantt-label {
    padding-left: 30px;
}

.gantt-stage-row .gantt-label {
    padding-left: 52px;
}

.gantt-stage-row.expandable {
    cursor: pointer;
}

.gantt-stage-row.expanded {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.02) 0%, rgba(255, 255, 255, 0) 100%);
}

.gantt-stage-row .gantt-name {
    font-weight: 600;
    font-size: 14px;
}

.gantt-stage-row .gantt-node-type {
    background: #f1f5f9;
    color: #64748b;
}

.gantt-task-row .gantt-label {
    padding-left: 74px;
}

.gantt-task-row .gantt-name {
    font-size: 13px;
    font-weight: 600;
}

.gantt-task-row .gantt-node-type {
    background: #eef2ff;
    color: #4f46e5;
}

.gantt-name {
    font-weight: 700;
}

.gantt-chip-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gantt-node-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
}

.gantt-meta-line {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.gantt-expand-indicator {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    pointer-events: none;
}

.level-0 .gantt-name { padding-left: 0; }
.level-1 .gantt-name { padding-left: 16px; }
.level-2 .gantt-name { padding-left: 32px; }
.level-3 .gantt-name { padding-left: 48px; }

.gantt-bar-area {
    position: relative;
    height: 64px;
    background-image: linear-gradient(to right, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
    background-size: calc(100% / 12) 100%;
    overflow: hidden;
}

.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 2px dashed rgba(239, 68, 68, 0.58);
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 1;
}

.gantt-bar {
    position: absolute;
    top: 20px;
    height: 24px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    line-height: 24px;
    padding: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 8px 20px rgba(148, 163, 184, 0.18);
}

.gantt-project-row .gantt-bar {
    top: 18px;
    height: 28px;
    line-height: 28px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.2);
}

.gantt-product-row .gantt-bar {
    top: 21px;
    height: 20px;
    line-height: 20px;
}

.gantt-stage-row .gantt-bar {
    top: 24px;
    height: 14px;
    line-height: 14px;
    opacity: 0.88;
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.14);
}

.gantt-bar-label {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: top;
}

.gantt-bar.completed {
    background: var(--green);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

.gantt-bar.in_progress {
    background: var(--blue);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.22);
}

.gantt-bar.delayed {
    background: var(--amber);
    color: #1f2937;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.22);
}

.gantt-bar.blocked {
    background: var(--red);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.22);
}

.gantt-bar.not_started {
    background: var(--green);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.16);
}

.project-cards,
.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.staffing-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.staffing-chip {
    border: 1px solid #dbeafe;
    background: #f8fbff;
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #475569;
    font-size: 13px;
}

.staffing-chip strong {
    color: #0f172a;
    font-size: 20px;
}

.staffing-chip.danger {
    border-color: rgba(239, 68, 68, 0.2);
    background: #fff5f5;
}

.staffing-chip.danger strong,
.staffing-chip.danger span {
    color: #dc2626;
}

.staffing-list {
    gap: 14px;
}

.mobile-only {
    display: none;
}

.staffing-department {
    border: 1px solid #dbe5f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    padding: 16px;
}

.staffing-department-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.staffing-department-head h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.staffing-department-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.staffing-table-wrap {
    overflow-x: auto;
}

.staffing-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.staffing-table th,
.staffing-table td {
    border-top: 1px solid #e2e8f0;
    padding: 12px 10px;
    text-align: center;
    font-size: 13px;
}

.staffing-table th {
    color: #475569;
    font-weight: 700;
    background: #f8fafc;
}

.staffing-table th:first-child,
.staffing-table td:first-child,
.staffing-table th:nth-child(2),
.staffing-table td:nth-child(2) {
    text-align: left;
}

.staffing-table th span,
.staffing-table td span {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
}

.staffing-table td strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
}

.staffing-table td.has-load {
    color: #1d4ed8;
    font-weight: 700;
    background: #eff6ff;
}

.staffing-table td.over-capacity {
    color: #dc2626;
    font-weight: 800;
    font-size: 16px;
    background: #fff1f2;
}

.staffing-table td.total-cell {
    color: #0f172a;
    font-weight: 800;
    background: #f8fafc;
}

.staffing-mobile-list {
    display: none;
    gap: 12px;
}

.staffing-person-card {
    border: 1px solid #dbe5f0;
    border-radius: 16px;
    background: #ffffff;
    padding: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.staffing-person-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.staffing-person-head strong {
    display: block;
    font-size: 15px;
    color: #0f172a;
}

.staffing-person-head span {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.staffing-week-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.staffing-week-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    padding: 10px;
    display: grid;
    gap: 4px;
}

.staffing-week-card strong {
    font-size: 13px;
    color: #334155;
}

.staffing-week-card span {
    color: #94a3b8;
    font-size: 11px;
    line-height: 1.35;
}

.staffing-week-card em {
    font-style: normal;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.staffing-week-card.has-load {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.staffing-week-card.has-load em {
    color: #1d4ed8;
}

.staffing-week-card.over-capacity {
    border-color: rgba(239, 68, 68, 0.22);
    background: #fff1f2;
}

.staffing-week-card.over-capacity em,
.staffing-week-card.over-capacity strong {
    color: #dc2626;
}

.admin-page .panel-grid.admin-layout {
    grid-template-columns: 360px minmax(0, 1fr);
}

.admin-page .panel-grid.master-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
}

.auth-page {
    max-width: 720px;
}

.auth-panel {
    margin-top: 12px;
}

.split-top {
    margin-top: 18px;
}

.toolbar.compact {
    margin-bottom: 12px;
}

.master-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0;
}

.admin-project-item {
    width: 100%;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: #f8fafc;
    cursor: pointer;
}

.admin-project-item.selected,
.admin-project-item:hover {
    background: #f1f5ff;
    border-color: rgba(59, 130, 246, 0.28);
}

.admin-page .admin-left,
.admin-page .admin-right {
    margin-bottom: 0;
}

.admin-page .admin-left {
    display: flex;
    flex-direction: column;
}

.admin-page .admin-right {
    display: flex;
    flex-direction: column;
    min-height: 720px;
}

.admin-node-summary {
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
    line-height: 1.55;
}

.tree-nav {
    display: grid;
    gap: 10px;
}

.tree-nav.empty {
    color: var(--muted);
}

.tree-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.tree-item.level-0 { padding-left: 0; }
.tree-item.level-1 { padding-left: 14px; }
.tree-item.level-2 { padding-left: 28px; }
.tree-item.level-3 { padding-left: 42px; }

.tree-toggle,
.tree-spacer {
    width: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    height: 34px;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    font-weight: 700;
}

.tree-spacer {
    cursor: default;
}

.tree-toggle:hover {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(248, 250, 252, 0.9);
    color: var(--text);
}

.tree-label {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    background: #f8fafc;
    text-align: left;
    cursor: pointer;
}

.tree-label:hover {
    background: #f1f5ff;
}

.tree-item.selected .tree-label {
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 10px 26px rgba(59, 130, 246, 0.12);
}

.tree-title {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}

.tree-title strong {
    font-weight: 700;
}

.tree-subtitle {
    margin: 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px dashed #cbd5e1;
    color: var(--muted);
    background: rgba(248, 250, 252, 0.9);
    margin-bottom: 14px;
    line-height: 1.5;
}

.node-editor {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
}

.toolbar,
.editor-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-secondary {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.status-message {
    margin-top: 14px;
    min-height: 20px;
    color: var(--muted);
}

.status-message.success {
    color: #047857;
}

.status-message.error {
    color: #b91c1c;
}

.json-editor {
    width: 100%;
    min-height: 620px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    resize: vertical;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    background: #0f172a;
    color: #e2e8f0;
    margin-bottom: 12px;
}

.form-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.form-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 600;
}

.project-form {
    display: grid;
    gap: 14px;
}

.form-node {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f8fbff;
    overflow: hidden;
}

.form-node.level-product {
    background: #f8fafc;
}

.form-node.level-stage {
    background: #fcfdff;
}

.form-node.level-task {
    background: #ffffff;
}

.form-node summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    cursor: pointer;
}

.form-node summary::-webkit-details-marker {
    display: none;
}

.form-node summary strong {
    display: block;
    margin-bottom: 4px;
}

.form-node[open] > summary {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
}

.node-content {
    padding: 18px;
}

.node-stack {
    display: grid;
    gap: 12px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.field-grid.project-fields {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 8px;
}

.field span {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.field input,
.field select {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
}

.field input:focus,
.field select:focus {
    outline: 2px solid rgba(59, 130, 246, 0.18);
    border-color: #60a5fa;
}

.field input[readonly] {
    background: #f1f5f9;
    color: #64748b;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #334155;
    font-size: 14px;
}

.checkbox-item input {
    width: auto;
    margin: 0;
}

.child-actions,
.summary-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.subtle-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    padding: 16px;
    color: var(--muted);
    background: #fff;
}

.project-card {
    padding: 18px;
}

.project-card-button {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.2);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.project-card-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.1);
}

.project-card-button.selected {
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.16), 0 18px 38px rgba(15, 23, 42, 0.1);
}

.project-card h3 {
    margin: 0 0 8px;
}

.project-summary-card {
    display: grid;
    gap: 14px;
}

.project-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.project-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.project-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 600;
}

.project-chip.completed {
    background: #dcfce7;
    color: #166534;
}

.project-chip.blocked {
    background: #ede9fe;
    color: #6d28d9;
}

.project-chip.delayed {
    background: #fee2e2;
    color: #b91c1c;
}

.project-foot {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}

.empty-state {
    padding: 20px;
    color: var(--muted);
}

.admin-page .panel-title.split-top {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.admin-page .tree-nav {
    display: grid;
    gap: 8px;
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    flex: 1;
    min-height: 640px;
    max-height: none;
    overflow: auto;
}

.admin-page .tree-nav.empty {
    padding: 16px;
    color: var(--muted);
    border-style: dashed;
    background: #ffffff;
}

.admin-page .tree-item {
    position: relative;
}

.admin-page .tree-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.admin-page .tree-item.level-0 { padding-left: 0; }
.admin-page .tree-item.level-1 { padding-left: 30px; }
.admin-page .tree-item.level-2 { padding-left: 60px; }
.admin-page .tree-item.level-3 { padding-left: 90px; }

.admin-page .tree-item.level-1 .tree-rail::before,
.admin-page .tree-item.level-2 .tree-rail::before {
    content: "";
    position: absolute;
    left: -30px;
    top: -8px;
    bottom: -8px;
    width: 3px;
    border-radius: 999px;
    background: #cbd5e1;
}

.admin-page .tree-item.level-2 .tree-rail::before {
    background: #ddd6fe;
}

.admin-page .tree-item.level-3 .tree-rail::before {
    content: "";
    position: absolute;
    left: -30px;
    top: -6px;
    bottom: -6px;
    width: 3px;
    border-radius: 999px;
    background: #e2e8f0;
}

.admin-page .tree-item.tree-task .tree-rail::before {
    content: "";
    position: absolute;
    left: -28px;
    top: 16px;
    width: 18px;
    height: 2px;
    background: #cbd5e1;
}

.admin-page .tree-rail {
    position: relative;
}

.admin-page .tree-toggle,
.admin-page .tree-spacer {
    width: 28px;
    height: 34px;
    border-radius: 10px;
}

.admin-page .tree-label {
    width: 100%;
    text-align: left;
    cursor: pointer;
    color: var(--text);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-page .tree-group-label {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.status-badge.completed {
    background: #dcfce7;
    color: #166534;
}

.status-badge.in_progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge.blocked {
    background: #ede9fe;
    color: #6d28d9;
}

.status-badge.delayed {
    background: #fee2e2;
    color: #b91c1c;
}

.status-badge.not_started {
    background: #e2e8f0;
    color: #475569;
}

.admin-page .tree-group.project-group .tree-group-label {
    position: relative;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    padding: 16px 18px;
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.12);
}

.admin-page .tree-group.project-group .tree-title strong {
    font-size: 15px;
}

.admin-page .tree-group.project-group .tree-label::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    top: 0;
    height: 3px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.35);
}

.admin-page .tree-group.product-group .tree-group-label {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-color: #93c5fd;
    padding: 15px 17px;
    border-left: 7px solid #3b82f6;
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.1);
}

.admin-page .tree-group.stage-group .tree-group-label {
    background: linear-gradient(180deg, #fcfdff 0%, #faf5ff 100%);
    border-color: #d8b4fe;
    padding: 10px 12px;
    border-style: dashed;
    border-left: 7px solid #8b5cf6;
    box-shadow: none;
}

.admin-page .tree-group.stage-group .tree-title {
    margin-bottom: 2px;
}

.admin-page .tree-group.stage-group .tree-subtitle {
    font-size: 12px;
    color: #7c3aed;
}

.admin-page .tree-group.product-group .tree-title strong {
    font-size: 15px;
    color: #1e3a8a;
}

.admin-page .tree-group.product-group .tree-subtitle {
    color: #475569;
}

.admin-page .tree-group.stage-group .tree-title strong {
    font-size: 13px;
    color: #6d28d9;
    letter-spacing: 0.01em;
}

.admin-page .tree-item.level-0 .tree-group-label {
    background: #eff6ff;
    border-color: #93c5fd;
}

.admin-page .tree-item.level-1 .tree-group-label {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-color: #93c5fd;
}

.admin-page .tree-item.level-2 .tree-group-label {
    background: linear-gradient(180deg, #fcfdff 0%, #faf5ff 100%);
    border-color: #d8b4fe;
}

.admin-page .tree-task-label {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-left: 5px solid #cbd5e1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.task-inline-date {
    font-size: 12px;
    color: #475569;
    white-space: nowrap;
}

.task-meta-secondary {
    margin-top: 2px;
    font-size: 12px;
    color: #94a3b8;
}

.admin-page .tree-task-main,
.admin-page .tree-title,
.admin-page .tree-task-title-row {
    min-width: 0;
}

.admin-page .tree-title {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}

.admin-page .tree-task-title-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 4px;
}

.admin-page .tree-title strong,
.admin-page .tree-task-title-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-page .tree-subtitle {
    margin: 0;
    line-height: 1.45;
    color: var(--muted);
}

.admin-page .task-inline-status {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
}

.admin-page .task-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 2px;
}

.admin-page .task-status-dot.completed { background: #22c55e; }
.admin-page .task-status-dot.in_progress { background: #3b82f6; }
.admin-page .task-status-dot.delayed { background: #ef4444; }
.admin-page .task-status-dot.blocked { background: #8b5cf6; }
.admin-page .task-status-dot.not_started { background: #94a3b8; }

.admin-page .tree-item:hover .tree-label {
    background: rgba(59, 130, 246, 0.04);
    border-color: rgba(148, 163, 184, 0.36);
}

.admin-page .tree-item.selected .tree-label {
    position: relative;
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.10);
}

.admin-page .tree-item.selected .tree-label::before {
    content: "";
    position: absolute;
    left: -1px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: #2563eb;
}

.admin-page .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 14px;
}

.admin-page .breadcrumb a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
}

.admin-page .node-editor {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.8);
    margin-bottom: 14px;
}

.admin-page .node-editor .field-grid {
    margin-bottom: 0;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.modal-shell.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: min(1100px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
    padding: 22px;
}

.modal-title {
    align-items: flex-start;
}

.modal-close {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.modal-close:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.admin-editor-modal .breadcrumb {
    margin-bottom: 16px;
}

.admin-editor-modal .editor-actions {
    position: sticky;
    bottom: 0;
    padding-top: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 28%);
}

body.modal-open {
    overflow: hidden;
}

.progress {
    margin-top: 8px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
}

@media (max-width: 900px) {
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .filter-toolbar {
        align-items: stretch;
    }

    .action-item {
        grid-template-columns: 1fr;
    }

    .action-owner {
        text-align: left;
        white-space: normal;
    }

    .gantt-header,
    .gantt-row {
        grid-template-columns: 260px minmax(560px, 1fr);
        min-width: 820px;
    }

    .admin-page .panel-grid.admin-layout {
        grid-template-columns: 1fr;
    }

    .field-grid,
    .field-grid.project-fields {
        grid-template-columns: 1fr;
    }

    .admin-page .tree-nav {
        min-height: 420px;
    }

    .modal-shell {
        padding: 14px;
    }

    .modal-panel {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 20px);
        padding: 18px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 14px 16px 10px;
    }

    .hero h1 {
        font-size: 22px;
        line-height: 1.25;
    }

    .subtitle {
        font-size: 14px;
    }

    .hero-actions .nav-link {
        width: 100%;
    }

    .page {
        padding: 14px 12px 28px;
    }

    .panel,
    .stat-card,
    .project-card {
        border-radius: 16px;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    }

    .panel {
        padding: 16px;
    }

    .panel-title {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 14px;
    }

    .panel-title h2 {
        font-size: 18px;
    }

    .panel-subtitle,
    .hint,
    .meta,
    .action-path,
    .action-owner {
        font-size: 12px;
    }

    .toolbar,
    .editor-actions,
    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar > *,
    .editor-actions > *,
    .filter-toolbar > *,
    .panel-title > .toolbar > * {
        width: 100%;
    }

    .filter-panel-actions {
        justify-content: stretch;
    }

    .filter-field {
        min-width: 0;
    }

    .tab-bar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .tab-button {
        width: 100%;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .status-guide,
    .stats,
    .project-list,
    .project-cards,
    .staffing-overview {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-breakdown-row,
    .stat-main-trigger {
        padding: 10px 12px;
    }

    .action-item,
    .project-card-head,
    .staffing-department-head {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .action-row,
    .project-summary,
    .project-foot,
    .gantt-chip-row {
        gap: 6px;
    }

    .project-card {
        padding: 16px;
    }

    .project-card h3,
    .action-title {
        font-size: 14px;
    }

    .gantt-wrapper,
    .staffing-table-wrap {
        border-radius: 14px;
        -webkit-overflow-scrolling: touch;
    }

    .gantt-mobile-head {
        flex-direction: column;
        align-items: stretch;
    }

    .gantt-header,
    .gantt-row {
        grid-template-columns: 220px minmax(520px, 1fr);
        min-width: 740px;
    }

    .gantt-label {
        padding: 12px 10px;
    }

    .gantt-project-row .gantt-label {
        padding: 14px 10px;
    }

    .gantt-product-row .gantt-label {
        padding-left: 22px;
    }

    .gantt-stage-row .gantt-label {
        padding-left: 34px;
    }

    .gantt-task-row .gantt-label {
        padding-left: 46px;
    }

    .gantt-mobile-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .staffing-chip {
        padding: 10px;
    }

    .staffing-chip strong {
        font-size: 18px;
    }

    .staffing-department {
        padding: 14px;
    }

    .staffing-table {
        min-width: 640px;
    }

    .mobile-only {
        display: grid;
    }

    .staffing-table-wrap {
        display: none;
    }

    .admin-page .panel-grid.admin-layout,
    .admin-page .panel-grid.master-layout,
    .master-columns {
        grid-template-columns: 1fr;
    }

    .admin-page .admin-right,
    .admin-page .tree-nav {
        min-height: auto;
    }

    .admin-node-summary {
        padding: 10px 12px;
        font-size: 12px;
    }

    .admin-page .tree-nav {
        max-height: 60vh;
        padding: 12px 10px;
    }

    .admin-page .tree-item.level-1 { padding-left: 18px; }
    .admin-page .tree-item.level-2 { padding-left: 36px; }
    .admin-page .tree-item.level-3 { padding-left: 54px; }

    .admin-page .tree-item.level-1 .tree-rail::before,
    .admin-page .tree-item.level-2 .tree-rail::before,
    .admin-page .tree-item.level-3 .tree-rail::before {
        left: -18px;
    }

    .admin-page .tree-item.tree-task .tree-rail::before {
        left: -16px;
        width: 10px;
    }

    .admin-page .tree-title,
    .admin-page .tree-task-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-page .tree-title strong,
    .admin-page .tree-task-title-row strong {
        white-space: normal;
    }

    .status-badge,
    .badge,
    .pill {
        min-width: 0;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .modal-shell {
        padding: 0;
    }

    .modal-backdrop {
        backdrop-filter: none;
    }

    .modal-panel {
        width: 100vw;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        padding: 16px 14px 24px;
    }

    .modal-title {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #ffffff;
        padding-bottom: 10px;
    }

    .modal-close {
        width: 100%;
    }

    .admin-editor-modal .editor-actions {
        position: sticky;
        bottom: 0;
        display: grid;
        grid-template-columns: 1fr;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, #ffffff 24%);
    }
}

@media (max-width: 560px) {
    .eyebrow {
        font-size: 11px;
        letter-spacing: 0.12em;
    }

    .hero h1 {
        font-size: 20px;
    }

    .page {
        padding: 12px 10px 24px;
    }

    .panel,
    .stat-card,
    .project-card {
        border-radius: 14px;
    }

    .panel {
        padding: 14px;
    }

    .tab-bar {
        grid-template-columns: 1fr;
    }

    .status-guide-item,
    .action-item,
    .project-card,
    .staffing-department,
    .admin-project-item {
        padding-left: 12px;
        padding-right: 12px;
    }

    .project-summary {
        display: grid;
        grid-template-columns: 1fr;
    }

    .staffing-person-head {
        flex-direction: column;
        align-items: stretch;
    }

    .gantt-header,
    .gantt-row {
        grid-template-columns: 180px minmax(460px, 1fr);
        min-width: 640px;
    }

    .gantt-mobile-overview {
        grid-template-columns: 1fr 1fr;
    }

    .gantt-mobile-card,
    .gantt-mobile-stage {
        padding-left: 12px;
        padding-right: 12px;
    }

    .staffing-table {
        min-width: 580px;
    }

    .field input,
    .field select,
    .btn-primary,
    .btn-secondary,
    .btn-danger,
    .nav-link {
        min-height: 44px;
    }
}
