/* =========================================================
   投标项目管理系统 - 全局样式
   简洁中性配色，响应式布局
   ========================================================= */

:root {
    --primary-dark:   #1e293b;
    --primary:        #334155;
    --primary-light:  #64748b;
    --sidebar-bg:     #f1f5f9;
    --sidebar-hover:  #e2e8f0;
    --sidebar-text:   #334155;
    --sidebar-active: #0f172a;
    --border-subtle:  #e2e8f0;
    --card-bg:        #ffffff;
    --success:        #0d9488;
    --warning:        #d97706;
    --danger:         #dc2626;
    --gray-bg:        #f8fafc;
    --text-muted:     #64748b;
    --stat-accent:    #2563eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
        "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
    background: var(--gray-bg);
    color: #1e293b;
    padding-top: 56px;
    min-width: 0;
}

/* ---------- 顶部导航 ---------- */
.bg-primary-dark { background: var(--primary-dark) !important; }
.navbar          { min-height: 56px; z-index: 1030; }
.navbar-brand    { font-size: 1.05rem; }

/* ---------- 布局 ---------- */
.app-container {
    display: flex;
    min-height: calc(100vh - 56px);
    min-width: 0;
}

.sidebar {
    width: min(220px, 86vw);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-subtle);
    flex-shrink: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.sidebar-mobile-bar {
    display: none;
}
.sidebar-nav-inner {
    display: block;
}
/* 桌面（≥992px）：固定侧栏 + 主区留白；小于该宽度统一走抽屉式侧栏，避免主区被挤压 */
@media (min-width: 992px) {
    .sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        bottom: 0;
        z-index: 1020;
        transform: none;
        box-shadow: none;
    }
    .sidebar-backdrop {
        display: none !important;
    }
}

.sidebar .nav-section {
    list-style: none;
    padding: 14px 16px 4px 20px;
    margin: 4px 0 0;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #94a3b8;
    user-select: none;
}
.sidebar .nav-section:first-of-type {
    margin-top: 0;
}
.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 9px 16px 9px 20px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: background .15s, color .15s;
}
.sidebar .nav-link i { margin-right: 8px; width: 1.1rem; display: inline-block; opacity: .85; }
.sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-active);
}
.sidebar .nav-link.active {
    background: #e2e8f0;
    color: var(--sidebar-active);
    border-left-color: var(--stat-accent);
    font-weight: 600;
}

/* 详情页 Tab 内容区 */
.tab-content-wrap {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-top: 0;
    border-radius: 0 0 0.5rem 0.5rem;
    padding: clamp(12px, 2vw, 1.25rem);
}
.nav-tabs.detail-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom-color: var(--border-subtle);
}
.nav-tabs.detail-tabs .nav-link {
    white-space: nowrap;
    color: #64748b;
    font-size: 0.9rem;
}
.nav-tabs.detail-tabs .nav-link.active {
    color: #0f172a;
    font-weight: 600;
    border-bottom-color: #fff;
}

.main-content {
    flex-grow: 1;
    margin-left: 0;
    padding: clamp(12px, 2vw, 24px) clamp(12px, 3vw, 28px) 2rem;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.app-footer {
    margin-left: 0;
    border-top: 1px solid var(--border-subtle);
    background: var(--card-bg);
}

@media (min-width: 992px) {
    .main-content {
        margin-left: 220px;
        overflow-x: auto;
    }
    .app-footer {
        margin-left: 220px;
    }
}

/* ---------- 小屏/平板：抽屉侧栏（<992px 统一走抽屉，主区全宽，避免左右被切分） ---------- */
@media (max-width: 991.98px) {
    .sidebar-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        border-bottom: 1px solid var(--border-subtle);
        background: #fff;
        flex-shrink: 0;
    }
    .sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        bottom: 0;
        width: min(280px, 86vw);
        max-width: 100%;
        z-index: 1040;
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        display: flex;
        flex-direction: column;
        box-shadow: none;
    }
    .sidebar.sidebar--open {
        transform: translateX(0);
        box-shadow: 8px 0 28px rgba(15, 23, 42, 0.18);
    }
    .sidebar-nav-inner {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar-backdrop {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1035;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
        pointer-events: none;
    }
    .sidebar-backdrop.sidebar-backdrop--visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .app-container {
        min-width: 0;
        display: block;
    }
}

/* ---------- 手机竖屏优化：收紧内边距、字号、间距 ---------- */
@media (max-width: 767.98px) {
    body {
        -webkit-text-size-adjust: 100%;
        font-size: 0.88rem;
    }
    .main-content {
        padding: 8px 8px 1rem;
    }
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-left: -8px;
        margin-right: -8px;
        padding-left: 8px;
        padding-right: 8px;
    }
    .table { font-size: 0.78rem; }
    .table th, .table td { padding: 0.3rem 0.4rem; }
    .table .btn-sm { padding: 0.15rem 0.35rem; font-size: 0.72rem; }
    .reminder-dropdown {
        min-width: min(360px, 92vw) !important;
        max-width: 92vw !important;
    }
    .stat-card { padding: 10px 12px; }
    .stat-card .value { font-size: clamp(1rem, 5vw, 1.3rem); }
    .stat-card .label { font-size: 0.7rem; }
    .page-header { gap: 4px; padding: 6px 0 8px; margin-bottom: 8px; }
    .page-header h4 { font-size: 1.05rem; }
    .customer-card-body .num { font-size: 0.95rem; }
    .customer-card-header { padding: 10px 12px; }
    .customer-card-body { padding: 10px 12px; }
    .card-header { padding: 0.45rem 0.75rem; font-size: 0.85rem; }
    .card-body { padding: 0.6rem 0.75rem; }
    .badge { font-size: 0.68rem; }
    .form-label { font-size: 0.8rem; margin-bottom: 0.2rem; }
    .form-control, .form-select { font-size: 0.82rem; padding: 0.3rem 0.5rem; }
    .form-control-sm, .form-select-sm { font-size: 0.78rem; padding: 0.2rem 0.4rem; }
    .btn-sm { font-size: 0.78rem; padding: 0.2rem 0.5rem; }
    .breadcrumb { font-size: 0.75rem; }
    .row.g-3 { --bs-gutter-y: 0.5rem; --bs-gutter-x: 0.5rem; }
    .row.g-2 { --bs-gutter-y: 0.35rem; --bs-gutter-x: 0.35rem; }
    .mt-3 { margin-top: 0.6rem !important; }
    .mt-2 { margin-top: 0.4rem !important; }
    h5, .h5 { font-size: 0.95rem; }
    h6, .h6 { font-size: 0.85rem; }
    .nav-tabs .nav-link { font-size: 0.78rem; padding: 0.4rem 0.55rem; }
    .tab-content-wrap { padding: 0.75rem !important; }
    .timeline { padding-left: 22px; }
    .timeline-content { padding: 10px 12px; font-size: 0.82rem; }
    .notif-panel { padding: 12px; }
    .notif-panel h5 { font-size: 0.95rem; }
    p.text-muted.small { font-size: 0.75rem; }
}

/* ---------- 手机端项目卡片 ---------- */
.proj-m-card .card-body { font-size: 0.88rem; }
.proj-m-card .gap-x-3 { column-gap: 0.75rem; }

/* ---------- 模态框滚动修复（form 包裹时 flex 链断裂） ---------- */
.modal-dialog-scrollable .modal-content > form {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1 1 auto;
    max-height: 100%;
}
.modal-dialog-scrollable .modal-content > form > .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 991.98px) {
    .modal-dialog-scrollable {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
        margin: 0.5rem;
    }
    .modal-dialog-scrollable .modal-content {
        max-height: calc(100vh - 1rem);
        max-height: calc(100dvh - 1rem);
    }
    .modal-dialog.modal-lg {
        max-width: 100%;
    }
}

/* ---------- 页面通用 ---------- */
.page-header {
    padding: 8px 0 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.card {
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--card-bg);
}
.card-header {
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    background: #fafbfc !important;
    font-size: 0.95rem;
    padding: 0.65rem 1rem;
}

/* 表格 */
.table > :not(caption) > * > * { vertical-align: middle; }
.table-row-remark td { background: #fafbfd; }

/* ---------- 统计卡片（简洁平面，无装饰图标） ---------- */
.stat-card {
    position: relative;
    padding: 14px 16px;
    border-radius: 8px;
    color: #1e293b;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    height: 100%;
}
.stat-card .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}
.stat-card .value { font-size: clamp(1.25rem, 3vw, 1.65rem); font-weight: 700; margin-top: 6px; line-height: 1.2; }
.stat-card.stat-emphasis { border-left: 3px solid var(--stat-accent); }
.stat-card .stat-icon { display: none; }
/* 轻量色条区分（无渐变大图标） */
.stat-blue    { border-left: 3px solid #3b82f6; }
.stat-green   { border-left: 3px solid #0d9488; }
.stat-purple  { border-left: 3px solid #7c3aed; }
.stat-orange  { border-left: 3px solid #ea580c; }
.stat-gray    { border-left: 3px solid #64748b; }
.stat-success { border-left: 3px solid #059669; }
.stat-warning { border-left: 3px solid #d97706; }
.stat-danger  { border-left: 3px solid #dc2626; }

/* ---------- 数据仪表盘 · 单行 KPI 工具条（横向滚动，省竖直空间） ---------- */
.dashboard-overview-toolbar {
    display: flex;
    align-items: stretch;
    gap: 8px;
    flex-wrap: nowrap;
    margin-bottom: 0.35rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-subtle);
    min-height: 0;
}
.dashboard-toolbar-title {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    max-width: 32%;
    min-width: 4.75rem;
    padding-right: 4px;
}
.dashboard-toolbar-heading {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.dashboard-toolbar-meta {
    font-size: 0.62rem;
    line-height: 1.1;
    white-space: nowrap;
}
.dashboard-kpi-scroll {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
}
.dashboard-kpi-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 5px;
    align-items: stretch;
    width: max-content;
    min-height: 100%;
}
.dashboard-kpi-cell {
    flex: 0 0 auto;
    width: 4.35rem;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0.22rem 0.32rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.03);
}
@media (min-width: 480px) {
    .dashboard-kpi-cell { width: 4.65rem; }
}
.dashboard-kpi-cell .dashboard-kpi-label {
    font-size: 0.58rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dashboard-kpi-cell .dashboard-kpi-value {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    margin-top: 1px;
}
.dashboard-kpi-cell.stat-blue    { border-left: 2px solid #3b82f6; }
.dashboard-kpi-cell.stat-purple  { border-left: 2px solid #7c3aed; }
.dashboard-kpi-cell.stat-green   { border-left: 2px solid #0d9488; }
.dashboard-kpi-cell.stat-orange  { border-left: 2px solid #ea580c; }
.dashboard-kpi-cell.stat-gray    { border-left: 2px solid #64748b; }
.dashboard-kpi-cell.stat-success { border-left: 2px solid #059669; }
.dashboard-kpi-cell.stat-warning { border-left: 2px solid #d97706; }
.dashboard-kpi-cell.stat-danger  { border-left: 2px solid #dc2626; }

/* ---------- 数据仪表盘 · 月历视图 ---------- */
.cal-card .card-header { background: #fafbfc; }
.cal-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
}
.cal-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    table-layout: fixed;
}
.cal-th {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #475569;
    padding: 6px 2px;
    border-bottom: 2px solid #e2e8f0;
    background: #f8fafc;
}
.cal-th--wknd { color: #94a3b8; }

.cal-td {
    vertical-align: top;
    border: 1px solid #e2e8f0;
    padding: 0;
    height: 5.6rem;
    background: #fff;
}
@media (min-width: 768px) {
    .cal-td { height: 7rem; }
}
@media (min-width: 1200px) {
    .cal-td { height: 8rem; }
}
.cal-td--out {
    background: #f8fafc;
}
.cal-td--out .cal-day-num {
    color: #c1c9d4;
}
.cal-td--wknd {
    background: #fafbfc;
}
.cal-td--today {
    background: #eff6ff;
}
.cal-td--today .cal-day-num {
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.7rem;
}

/* 日期头：日号 + 事项数角标 */
.cal-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 4px 1px;
}
.cal-day-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}
.cal-day-badge {
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    background: #64748b;
    border-radius: 6px;
    padding: 0 4px;
    line-height: 1.35;
    min-width: 1rem;
    text-align: center;
}
.cal-td--today .cal-day-badge { background: #2563eb; }

/* 事项列表 */
.cal-events {
    padding: 1px 3px 3px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* 单条事项：左色条 + 负责人 + 描述 */
.cal-ev {
    display: flex;
    align-items: baseline;
    gap: 3px;
    padding: 1px 3px;
    border-left: 3px solid #94a3b8;
    border-radius: 2px;
    background: #f8fafc;
    text-decoration: none;
    color: inherit;
    min-width: 0;
    line-height: 1.25;
    transition: background 0.12s;
}
.cal-ev:hover {
    background: #dbeafe;
}
.cal-ev-who {
    flex-shrink: 0;
    font-size: 0.6rem;
    font-weight: 700;
    color: #0f766e;
    max-width: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-ev-pill {
    flex-shrink: 0;
    font-size: 0.5rem;
    font-weight: 700;
    color: #64748b;
    background: #e8ecf1;
    border-radius: 2px;
    padding: 0 2px;
    line-height: 1.3;
    white-space: nowrap;
}
.cal-ev-txt {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.6rem;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cal-ev-more {
    display: block;
    font-size: 0.55rem;
    color: #64748b;
    padding-left: 4px;
    cursor: default;
}

/* 窄屏：日历可横滚、格子更紧凑 */
@media (max-width: 767.98px) {
    .cal-td { height: 4.8rem; }
    .cal-day-num { font-size: 0.68rem; }
    .cal-ev { padding: 1px 2px; gap: 2px; }
    .cal-ev-who { font-size: 0.55rem; }
    .cal-ev-txt { font-size: 0.55rem; }
    .cal-ev-pill { font-size: 0.48rem; }
}

/* 颜色点 (客户关系/信息搜集) */
.dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.1);
}
.dot-green  { background: #1cc88a; }
.dot-yellow { background: #f6c23e; }
.dot-red    { background: #e74a3b; }

/* 状态快捷下拉 */
.status-select { min-width: 76px; }

/* ---------- 登录页 ---------- */
.login-body {
    background: linear-gradient(160deg, #1e293b 0%, #334155 100%);
    min-height: 100vh;
    padding-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrapper { width: 100%; max-width: 420px; padding: 15px; }
.login-card {
    background: #fff;
    padding: 36px 32px;
    border-radius: 12px;
}
.login-header { text-align: center; }
.login-header i { font-size: 3rem; color: var(--primary); }

/* ---------- 提醒铃铛 ---------- */
.reminder-dropdown {
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}
.reminder-section-title {
    padding: 8px 14px;
    font-size: .8rem;
    font-weight: 600;
    color: #5a5c69;
    background: #f8f9fc;
}
.reminder-item { transition: background .15s; }
.reminder-item:hover { background: #f5f7fb; }

/* ---------- 通知中心 ---------- */
.notif-panel { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 2px 6px rgba(0,0,0,.05); }
.notif-panel + .notif-panel { margin-top: 16px; }

.code-tag {
    font-family: "Consolas", monospace;
    font-size: .75rem;
    color: #666;
    background: #f8f9fc;
    padding: 2px 6px;
    border-radius: 3px;
}

/* ---------- 客户卡片 ---------- */
.customer-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
    height: 100%;
}
.customer-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08) !important; }
.customer-card-header {
    background: #334155;
    color: #fff;
    padding: 14px 16px;
}
.customer-card-body { padding: 14px 16px; }
.customer-card-body .num { font-size: 1.1rem; font-weight: 700; color: #2c5282; }

/* ---------- Tab 内容容器 ---------- */
.tab-content-wrap { min-height: 260px; box-shadow: 0 2px 6px rgba(0,0,0,.04); }
.nav-tabs .nav-link { color: #555; }
.nav-tabs .nav-link.active { color: #2c5282; font-weight: 600; }

/* ---------- 沟通记录时间线 ---------- */
.timeline {
    position: relative;
    padding-left: 28px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 10px; top: 6px; bottom: 6px;
    width: 2px;
    background: #e3e8f2;
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
    position: absolute;
    left: -23px;
    top: 14px;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #3b82f6;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #3b82f6;
}
.timeline-content {
    background: #fff;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid #eef0f6;
}
.next-action { background: #fff8e1; border-left: 3px solid #f6c23e; }

/* ---------- 进行中项目甘特图（简洁：一条时间条 + 节点） ---------- */
.gantt-card .card-body { padding: 0; }
.gantt-card-featured {
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}
.gantt-card-header-main {
    background: #fafbfc;
    border-bottom: 1px solid var(--border-subtle);
}
.gantt-scroll {
    overflow: visible;
    padding: 8px 12px 4px;
    min-width: 100%;
    width: max-content;
    box-sizing: border-box;
}

/* 甘特局部等比缩放（不影响页面其他区域） */
.gantt-zoom {
    position: relative;
    background: #fff;
}
.gantt-zoom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-subtle);
    background: #f8fafc;
}
.gantt-zoom-hint {
    font-size: 0.72rem;
    color: #94a3b8;
}
.gantt-zoom-controls {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.gantt-zoom-btn {
    min-width: 1.75rem;
    padding: 0.1rem 0.4rem;
    line-height: 1.3;
    font-weight: 600;
}
.gantt-zoom-pct {
    min-width: 3rem;
    text-align: center;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: #475569;
    font-weight: 600;
}
.gantt-zoom-viewport {
    overflow: auto;
    max-height: min(70vh, 560px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
    cursor: grab;
    background: #fff;
}
.gantt-zoom-viewport:active,
.gantt-zoom-viewport.is-panning {
    cursor: grabbing;
}
.gantt-zoom-viewport.is-zooming {
    touch-action: none;
}
.gantt-zoom-sizer {
    position: relative;
    min-width: 100%;
}
.gantt-zoom-stage {
    transform-origin: 0 0;
    will-change: transform;
    width: max-content;
    min-width: 100%;
}
.gantt-scale-row {
    display: flex;
    align-items: stretch;
    min-width: 640px;
    margin-bottom: 4px;
}
.gantt-scale-spacer {
    flex: 0 0 148px;
    border-right: 1px solid var(--border-subtle);
    background: #fafbfc;
    display: flex;
    align-items: flex-end;
    padding: 0 10px 6px;
}
.gantt-spacer-hint {
    font-size: 0.68rem;
    color: #94a3b8;
    font-weight: 600;
}
.gantt-scale-track {
    flex: 1;
    position: relative;
    margin: 0 8px;
    min-height: 28px;
}
.gantt-ruler {
    position: relative;
    height: 28px;
}
.gantt-ruler-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    text-align: center;
}
.gantt-ruler-line {
    display: block;
    width: 1px;
    height: 8px;
    margin: 0 auto;
    background: #cbd5e1;
}
.gantt-ruler-label {
    display: block;
    font-size: 0.68rem;
    color: #64748b;
    margin-top: 2px;
    white-space: nowrap;
    font-weight: 500;
}
.gantt-today-mark {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    z-index: 3;
}
.gantt-today-label {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 3px;
    padding: 0 4px;
    line-height: 1.4;
    white-space: nowrap;
}
.gantt-row {
    display: flex;
    align-items: stretch;
    min-height: 64px;
    border-top: 1px solid #f1f5f9;
    min-width: 640px;
}
.gantt-row:hover {
    background: #f8fafc;
}
.gantt-label {
    flex: 0 0 148px;
    padding: 8px 10px;
    border-right: 1px solid var(--border-subtle);
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}
.gantt-label-title {
    color: #0f172a;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gantt-label-title:hover { color: var(--stat-accent); text-decoration: underline; }
.gantt-label-sub {
    font-size: 0.68rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gantt-label-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 2px;
    align-items: center;
}
.gantt-label-range {
    font-size: 0.62rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.gantt-label-next {
    font-size: 0.62rem;
    font-weight: 600;
    color: #b45309;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 3px;
    padding: 0 5px;
    line-height: 1.5;
    white-space: nowrap;
}
.gantt-track {
    flex: 1 1 0%;
    min-width: 0;
    position: relative;
    margin: 10px 8px;
    display: flex;
}
.gantt-track-lane {
    position: relative;
    width: 100%;
    height: 44px;
    background:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent calc(25% - 1px),
            #f1f5f9 calc(25% - 1px),
            #f1f5f9 25%
        );
    border-radius: 6px;
    box-sizing: border-box;
}
.gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1.5px dashed #f87171;
    z-index: 2;
    pointer-events: none;
}
.gantt-bar {
    position: absolute;
    top: 10px;
    height: 12px;
    border-radius: 6px;
    background: #3b82f6;
    opacity: 0.85;
    min-width: 8px;
    z-index: 3;
}
.gantt-dot-wrap {
    position: absolute;
    top: 8px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    width: 36px;
}
.gantt-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1d4ed8;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #93c5fd;
    flex-shrink: 0;
}
.gantt-dot--past {
    background: #94a3b8;
    box-shadow: 0 0 0 1px #cbd5e1;
}
.gantt-dot--today {
    background: #dc2626;
    box-shadow: 0 0 0 1px #fecaca;
}
.gantt-dot-label {
    margin-top: 4px;
    font-size: 0.58rem;
    line-height: 1.15;
    color: #475569;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}
.gantt-dot-date {
    font-weight: 500;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.gantt-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 8px 12px 10px;
    border-top: 1px solid var(--border-subtle);
    background: #fafbfc;
}
.gantt-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #475569;
}
.gantt-legend-bar {
    display: inline-block;
    width: 18px;
    height: 6px;
    border-radius: 3px;
    background: #3b82f6;
    opacity: 0.85;
}
.gantt-legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1d4ed8;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px #93c5fd;
}
.gantt-legend-today {
    display: inline-block;
    width: 10px;
    height: 0;
    border-top: 1.5px dashed #f87171;
}
.dashboard-charts-compact .card-header { font-size: 0.8rem; }

@media (max-width: 991.98px) {
    .gantt-scroll {
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 8px;
        padding-right: 8px;
    }
    .gantt-label,
    .gantt-scale-spacer {
        flex: 0 0 120px;
    }
    .gantt-row,
    .gantt-scale-row {
        min-width: 520px;
    }
}
@media (max-width: 575.98px) {
    .gantt-label,
    .gantt-scale-spacer {
        flex: 0 0 96px;
        padding-left: 6px;
        padding-right: 6px;
    }
    .gantt-label-title { font-size: 0.72rem; }
    .gantt-label-sub,
    .gantt-label-range { display: none; }
    .gantt-row,
    .gantt-scale-row {
        min-width: 400px;
    }
    .gantt-dot-label { font-size: 0.52rem; }
    .gantt-track-lane { height: 40px; }
}
