/* AI Analysis Module Styles */

.ai-analysis-module {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 15px;
    overflow: visible;  /* Allow dropdowns to overflow */
    position: relative;
}

/* CRITICAL: Override dashboard-section overflow:hidden to allow dropdown to show */
.dashboard-tab-pane:has(.ai-analysis-module),
.dashboard-section:has(.ai-analysis-module),
.dashboard-section-content:has(.ai-analysis-module) {
    overflow: visible !important;
}

/* CRITICAL: Hide any scrollbar in chat-only mode parent containers */
.dashboard-tab-pane:has(.ai-chat-only-mode),
.dashboard-section:has(.ai-chat-only-mode),
.dashboard-section-content:has(.ai-chat-only-mode),
.ai-chat-only-mode,
.ai-chat-only-mode .ai-chat-container,
.ai-chat-only-mode .ai-chat-messages {
    overflow: visible !important;
    max-height: none !important;
    scrollbar-width: none !important;  /* Firefox */
    -ms-overflow-style: none !important;  /* IE/Edge */
}

/* Hide scrollbar for Webkit browsers (Chrome, Safari) */
.ai-chat-only-mode .ai-chat-messages::-webkit-scrollbar,
.ai-chat-only-mode .ai-chat-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Controls */
.ai-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
    position: relative;
    overflow: visible;  /* Ensure dropdowns aren't clipped */
}

.ai-controls select,
.ai-controls button {
    padding: 6px 10px;
    font-size: 12px;
}

.ai-controls select {
    min-width: 120px;
    max-width: 220px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.ai-controls select:hover {
    border-color: #999;
}

.ai-btn {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    padding: 6px 12px;
    font-size: 12px;
    transition: background 0.15s;
}

.ai-btn-primary {
    background: #007bff;
    color: white;
}

.ai-btn-primary:hover {
    background: #0056b3;
}

.ai-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ai-btn-info {
    background: #17a2b8;
    color: white;
}

.ai-btn-info:hover {
    background: #138496;
}

.ai-btn-success {
    background: #28a745;
    color: white;
}

.ai-btn-group {
    display: flex;
    gap: 10px;
}

/* Version Select Dropdown */
.ai-version-select-container {
    position: relative;
    display: inline-block;
}

.ai-version-select-btn {
    padding: 6px 10px;
    font-size: 12px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    min-width: 160px;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ai-version-select-btn:hover {
    border-color: #999;
}

.ai-version-select-btn:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    color: #999;
}

.ai-version-select-btn::after {
    content: '▼';
    font-size: 8px;
    color: #666;
}

.ai-version-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 9999;
    min-width: 280px;
    max-width: 400px;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar for dropdown */
.ai-version-dropdown::-webkit-scrollbar {
    width: 8px;
}

.ai-version-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ai-version-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.ai-version-dropdown::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.ai-version-dropdown.hidden {
    display: none;
}

.ai-version-dropdown label {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 11px;
    line-height: 1.3;
    transition: background 0.1s;
}

.ai-version-dropdown label:last-child {
    border-bottom: none;
}

.ai-version-dropdown label:hover {
    background: #f5f5f5;
}

.ai-version-dropdown label.selected {
    background: #e3f2fd;
    font-weight: 500;
}

.ai-version-dropdown input[type="checkbox"] {
    margin-right: 8px;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* Version Toggle */
.ai-version-toggle {
    display: none;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
    padding: 5px 15px;
    background: #e9ecef;
    border-radius: 20px;
}

.ai-version-toggle:not(.hidden) {
    display: inline-flex;
}

.ai-version-toggle-label {
    font-size: 12px;
    color: #666;
}

.ai-version-toggle-btns {
    display: flex;
    gap: 5px;
}

.ai-version-toggle-btn {
    padding: 4px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
}

.ai-version-toggle-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Status */
.ai-status {
    padding: 10px;
    border: 1px solid #eee;
    margin-top: 10px;
    background: #f9f9f9;
}

.ai-status.loading {
    background-color: #fffbe6;
}

.ai-status.success {
    background-color: #e6ffed;
}

.ai-status.error {
    background-color: #ffebe6;
}

/* Tabs */
.ai-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
    gap: 0;
    flex-wrap: wrap;
}

.ai-tab-btn {
    padding: 8px 14px;
    border: none;
    background: none;
    font-size: 11px;
    font-weight: 500;
    color: #7f8c8d;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s;
    white-space: nowrap;
}

.ai-tab-btn:hover {
    color: #2c3e50;
    background: #f8f9fa;
}

.ai-tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: transparent;
}

.ai-tab-content {
    display: none;
}

.ai-tab-content.active {
    display: block;
}

/* Analysis Results */
.ai-critical-path-result {
    margin-bottom: 25px;
    padding: 15px;
    border-left: 3px solid #dc3545;
    background-color: #f8f9fa;
}

.ai-analysis-table {
    border-collapse: collapse;
    width: auto;
    margin-top: 15px;
}

.ai-analysis-table th,
.ai-analysis-table td {
    border: 1px solid #ccc;
    padding: 5px 8px;
    text-align: left;
}

.ai-path-list {
    list-style-type: decimal;
    padding-left: 20px;
}

.ai-path-list li {
    margin-bottom: 3px;
}

.ai-progress-pct {
    color: #6c757d;
    font-size: 11px;
    margin-left: 4px;
}

/* Gantt Chart */
.ai-gantt-chart {
    margin-top: 25px;
}

.ai-gantt-timeline {
    position: relative;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 20px;
}

.ai-gantt-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 2px solid #34495e;
    padding-bottom: 5px;
}

.ai-gantt-label-header {
    width: 300px;
    padding-right: 15px;
    font-weight: bold;
    font-size: 12px;
}

.ai-gantt-timeline-header {
    flex: 1;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #7f8c8d;
}

.ai-gantt-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    min-height: 30px;
}

.ai-gantt-label {
    width: 300px;
    padding-right: 15px;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-gantt-bar-container {
    flex: 1;
    position: relative;
    height: 24px;
}

.ai-gantt-bar {
    position: absolute;
    height: 20px;
    background: #e74c3c;
    border-radius: 3px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    color: white;
    font-size: 10px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Branch Analysis */
.ai-branch-point {
    margin-bottom: 20px;
    padding: 15px;
    border-left: 3px solid #f39c12;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.ai-delta-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-left: 8px;
}

.ai-delta-red {
    background: #dc3545;
}

.ai-delta-orange {
    background: #f39c12;
}

/* Top-N Paths */
.ai-path-card {
    margin-bottom: 25px;
    padding: 15px;
    border-left: 3px solid #6c757d;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.ai-path-card.ai-rank-1 {
    border-left-color: #dc3545;
}

.ai-path-card.ai-rank-2 {
    border-left-color: #f39c12;
}

.ai-path-card.ai-rank-3 {
    border-left-color: #ffc107;
}

.ai-rank-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    margin-right: 8px;
}

.ai-rank-1-badge {
    background: #dc3545;
}

.ai-rank-2-badge {
    background: #f39c12;
}

.ai-rank-3-badge {
    background: #ffc107;
    color: #333;
}

.ai-rank-other-badge {
    background: #6c757d;
}

.ai-duration-bar-bg {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 3px;
    margin: 8px 0;
}

.ai-duration-bar-fill {
    height: 100%;
    border-radius: 3px;
    display: flex;
    align-items: center;
    padding-left: 8px;
    color: white;
    font-size: 11px;
    font-weight: bold;
}

/* AI Tab */
.ai-simple-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.ai-progress {
    padding: 15px;
    background: #fffbe6;
    border-radius: 4px;
    margin: 10px 0;
}

.ai-summary {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 20px;
}

.ai-summary h2 {
    font-size: 18px;
    margin-top: 20px;
    color: #2c3e50;
}

.ai-summary h3 {
    font-size: 15px;
    margin-top: 15px;
    color: #34495e;
}

.ai-summary ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ai-prompt-display {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.ai-prompt-stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #e3f2fd;
    border-radius: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.ai-prompt-stats-bar span {
    font-size: 13px;
}

.ai-prompt-stats-bar strong {
    color: #007bff;
}

.hidden {
    display: none !important;
}

/* ========== CHAT INTERFACE (Phase 1) ========== */

.ai-chat-container {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.ai-chat-messages {
    padding: 15px;
    background: #fafafa;
    /* No overflow here - let parent/page handle scrolling */
}

.ai-chat-message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 85%;
}

.ai-chat-user {
    background: #e3f2fd;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.ai-chat-model {
    background: #f5f5f5;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    max-width: 98%;  /* Override 85% - AI responses need more width for Gantt charts */
}

.ai-chat-message-header {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.ai-chat-message-content {
    font-size: 14px;
    line-height: 1.6;
}

/* Markdown headers in chat */
.ai-chat-message-content .ai-md-header {
    margin: 14px 0 6px 0;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 4px;
}

/* Markdown bullet lists in chat */
.ai-chat-message-content .ai-md-list {
    margin: 6px 0;
    padding-left: 20px;
}
.ai-chat-message-content .ai-md-list li {
    margin-bottom: 4px;
    line-height: 1.5;
}

/* Markdown tables in chat */
.ai-chat-message-content .ai-md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 13px;
}
.ai-chat-message-content .ai-md-table th,
.ai-chat-message-content .ai-md-table td {
    border: 1px solid #d0d0d0;
    padding: 6px 10px;
    text-align: left;
}
.ai-chat-message-content .ai-md-table th {
    background: #f0f0f0;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: #444;
}
.ai-chat-message-content .ai-md-table tr:nth-child(even) {
    background: #fafafa;
}
.ai-chat-message-content .ai-md-table tr:hover {
    background: #f0f5ff;
}

.ai-chat-input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #ddd;
}

.ai-chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
}

.ai-chat-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.ai-chat-progress {
    padding: 10px 15px;
    text-align: center;
    color: #666;
    font-style: italic;
    background: #fff8e1;
    border-radius: 8px;
    margin: 10px 0;
}

/* AI Thinking Indicator (Gemini 3 Chain-of-Thought) */
.ai-chat-thinking {
    padding: 12px 16px;
    background: linear-gradient(135deg, #e8f4fd 0%, #f0e6fa 100%);
    border-radius: 12px;
    margin: 10px 0;
    border-left: 4px solid #7c4dff;
    animation: thinking-pulse 2s ease-in-out infinite;
}

@keyframes thinking-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.ai-thinking-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ai-thinking-icon {
    font-size: 18px;
}

.ai-thinking-label {
    font-weight: 600;
    color: #5e35b1;
    font-size: 13px;
}

.ai-thinking-content {
    font-size: 13px;
    color: #444;
    line-height: 1.5;
    padding: 8px 12px;
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    margin-bottom: 8px;
    font-style: italic;
}

.ai-thinking-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
}

.ai-thinking-tool {
    color: #5e35b1;
}

.ai-thinking-tool strong {
    font-family: 'Consolas', 'Monaco', monospace;
    background: rgba(94, 53, 177, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.ai-thinking-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #7c4dff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-chat-error {
    padding: 10px 15px;
    background: #ffebe6;
    color: #dc3545;
    border-radius: 8px;
    margin: 10px 0;
}

.ai-rate-limit-countdown {
    padding: 10px 15px;
    background: #fffbeb;
    color: #92400e;
    border-radius: 8px;
    margin: 6px 0 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ai-rate-limit-countdown strong {
    font-weight: 600;
}
.ai-countdown-icon {
    font-size: 15px;
}

/* ========== STALE DATA WARNING (Phase 4) ========== */

.ai-stale-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.ai-stale-warning strong {
    color: #856404;
}

.ai-stale-warning p {
    margin: 10px 0;
    color: #856404;
}

.ai-stale-warning button {
    margin-right: 10px;
    margin-top: 10px;
}

.ai-btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    padding: 6px 12px;
    font-size: 12px;
    transition: background 0.15s;
}

.ai-btn-secondary:hover {
    background: #5a6268;
}

/* ========== CHAT-ONLY MODE (2026-01-29) ========== */

/* Remove parent padding when in chat-only mode */
.ai-analysis-module.ai-chat-only-mode {
    padding: 0;
    margin: 0;
    overflow: visible !important;
}

/* Override dashboard-section padding and overflow for chat-only mode */
.dashboard-section:has(.ai-chat-only-mode) {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    max-height: none !important;
}

.dashboard-section-content:has(.ai-chat-only-mode) {
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    max-height: none !important;
}

.ai-chat-only-mode {
    display: flex;
    flex-direction: column;
    min-height: auto;
    height: auto;
    overflow: visible !important;
}

.ai-chat-only-mode .ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.ai-chat-only-mode .ai-chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
}

.ai-chat-only-mode .ai-chat-icon {
    font-size: 20px;
}

.ai-chat-only-mode .ai-chat-context {
    display: flex;
    gap: 8px;
}

.ai-chat-only-mode .ai-context-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.ai-chat-only-mode .ai-version-selector {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    min-width: 140px;
}

.ai-chat-only-mode .ai-version-selector:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ai-chat-only-mode .ai-version-selector option {
    background: #333;
    color: white;
}

/* Admin: Download toggle */
.ai-chat-only-mode .ai-download-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    margin-left: 8px;
}

.ai-chat-only-mode .ai-download-toggle input {
    display: none;
}

.ai-chat-only-mode .ai-toggle-slider {
    width: 32px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 9px;
    position: relative;
    transition: background 0.2s;
}

.ai-chat-only-mode .ai-toggle-slider::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.ai-chat-only-mode .ai-download-toggle input:checked + .ai-toggle-slider {
    background: #4CAF50;
}

.ai-chat-only-mode .ai-download-toggle input:checked + .ai-toggle-slider::after {
    transform: translateX(14px);
}

.ai-chat-only-mode .ai-toggle-label {
    font-size: 14px;
}

.ai-chat-only-mode .ai-chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: auto;
    max-height: none;
    overflow: visible !important;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    background: #fafafa;
}

.ai-chat-only-mode .ai-chat-messages {
    flex: 1;
    padding: 16px;
    min-height: auto;
    max-height: none;
    overflow: visible !important;
    /* No internal scroll - let page scroll naturally */
}

.ai-chat-only-mode .ai-chat-welcome {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    /* Center vertically when no messages */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.ai-chat-only-mode .ai-chat-welcome p {
    margin-bottom: 16px;
    font-size: 14px;
}

.ai-chat-only-mode .ai-chat-suggestions {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.ai-chat-only-mode .ai-chat-suggestions li {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    transition: all 0.15s;
}

.ai-chat-only-mode .ai-chat-suggestions li:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.ai-chat-only-mode .ai-chat-input-container {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.ai-chat-only-mode .ai-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    outline: none;
}

.ai-chat-only-mode .ai-chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.ai-chat-only-mode .ai-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 10px 20px;
}

.ai-chat-only-mode .ai-btn-primary:hover {
    opacity: 0.9;
}

.ai-chat-only-mode .ai-status {
    padding: 8px 16px;
    font-size: 12px;
    color: #666;
}

/* ========== Mini Gantt Chart in Chat ========== */

.mini-gantt {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, monospace;
    font-size: 11px;
    overflow-x: auto;
    margin: 12px 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
}

/* Scrollable body for task rows - scrollbar only (no mousewheel) */
.mini-gantt-body {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom scrollbar styling for mini-gantt-body */
.mini-gantt-body::-webkit-scrollbar {
    width: 10px;
}

.mini-gantt-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.mini-gantt-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
}

.mini-gantt-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.mini-gantt-header {
    display: flex;
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    color: #333;
    min-height: 40px;
}

.mini-gantt-header .mini-gantt-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-gantt-header .mini-gantt-task-name {
    justify-content: flex-start;
}

.mini-gantt-header .mini-gantt-timeline {
    padding: 0;
    background: #f0f0f0;
    display: flex;
    flex-direction: column;
}

.mini-gantt-row {
    display: flex;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
    height: 28px;
    max-height: 28px;
    overflow: hidden;
}

.mini-gantt-row:last-child {
    border-bottom: none;
}

.mini-gantt-row:hover {
    background: #f0f7ff;
}

.mini-gantt-cell {
    padding: 6px 8px;
    display: flex;
    align-items: center;
    border-right: 1px solid #eee;
    box-sizing: border-box;
}

.mini-gantt-cell:last-child {
    border-right: none;
}

.mini-gantt-task-name {
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-height: 28px;
}

.mini-gantt-task-code {
    color: #666;
    font-size: 10px;
    margin-left: 4px;
}

.mini-gantt-duration {
    width: 45px;
    min-width: 45px;
    max-width: 45px;
    text-align: right;
    color: #666;
}

.mini-gantt-start,
.mini-gantt-finish,
.mini-gantt-bl-finish {
    width: 55px;
    min-width: 55px;
    max-width: 55px;
    font-size: 11px;
    color: #555;
    text-align: center;
}

.mini-gantt-bl-finish {
    color: #888;
    font-style: italic;
}

.mini-gantt-action {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    font-size: 10px;
    text-align: center;
    color: #555;
    font-family: 'Consolas', 'Monaco', monospace;
}

.mini-gantt-action.has-action {
    color: #1565c0;
    font-weight: 600;
}

.mini-gantt-action.fixed-action {
    color: #999;
    font-style: italic;
}

.mini-gantt-new-start {
    width: 55px;
    min-width: 55px;
    max-width: 55px;
    color: #1565c0;
    font-style: italic;
}

.mini-gantt-individual-saved {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    font-size: 11px;
    text-align: center;
    color: #555;
}

.mini-gantt-individual-saved.has-saved {
    color: #2e7d32;
    font-weight: 600;
}

.mini-gantt-float {
    width: 45px;
    min-width: 45px;
    max-width: 45px;
    font-size: 11px;
    color: #e65100;
    font-weight: 500;
    text-align: center;
}

.mini-gantt-progress {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

.mini-gantt-progress.complete {
    color: #2e7d32;
}

.mini-gantt-progress.in-progress {
    color: #1565c0;
}

.mini-gantt-progress.not-started {
    color: #9e9e9e;
}

/* Procurement columns: vs Need, Constr Float, MS Impact */
.mini-gantt-proc-var {
    width: 55px;
    min-width: 55px;
    max-width: 55px;
    font-size: 11px;
    text-align: center;
    font-weight: 500;
}
.mini-gantt-proc-var.proc-late {
    color: #d32f2f;
}
.mini-gantt-proc-var.proc-buffer {
    color: #2e7d32;
}

.mini-gantt-succ-float {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    font-size: 11px;
    text-align: center;
    color: #555;
}

.mini-gantt-ms-impact {
    width: 78px;
    min-width: 78px;
    max-width: 78px;
    font-size: 10px;
    text-align: center;
    font-weight: 500;
}
.mini-gantt-ms-impact.ms-pushes {
    color: #d32f2f;
    font-weight: 600;
}
.mini-gantt-ms-impact.ms-absorbed {
    color: #2e7d32;
}
.mini-gantt-ms-impact.ms-unknown {
    color: #9e9e9e;
    font-style: italic;
}

.mini-gantt-timeline {
    flex: 1;
    min-width: 350px;
    position: relative;
    background: #fafafa;
    box-sizing: border-box;
    padding: 0;
}

.mini-gantt-row .mini-gantt-timeline {
    padding: 4px 0;
}

.mini-gantt-bar-container {
    height: 20px;
    position: relative;
    width: 100%;
}

.mini-gantt-bar {
    height: 14px;
    border-radius: 2px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    min-width: 3px;
}

.mini-gantt-bar.critical {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    box-shadow: 0 1px 3px rgba(229, 57, 53, 0.3);
}

.mini-gantt-bar.normal {
    background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
    box-shadow: 0 1px 3px rgba(30, 136, 229, 0.3);
}

.mini-gantt-bar.near-critical {
    background: linear-gradient(135deg, #fb8c00 0%, #ef6c00 100%);
    box-shadow: 0 1px 3px rgba(251, 140, 0, 0.3);
}

/* Delay Severity Colors (for getDelayedTasks) */
.mini-gantt-bar.delay-severe {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    box-shadow: 0 1px 3px rgba(211, 47, 47, 0.4);
}

.mini-gantt-bar.delay-high {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    box-shadow: 0 1px 3px rgba(245, 124, 0, 0.4);
}

.mini-gantt-bar.delay-moderate {
    background: linear-gradient(135deg, #ffa726 0%, #fb8c00 100%);
    box-shadow: 0 1px 3px rgba(255, 167, 38, 0.4);
}

.mini-gantt-bar.delay-low {
    background: linear-gradient(135deg, #ffcc80 0%, #ffb74d 100%);
    box-shadow: 0 1px 3px rgba(255, 204, 128, 0.3);
}

/* ===== UNFILLED BAR STYLES (for progress visualization) ===== */
/* These are lighter/striped versions showing remaining work */

.mini-gantt-bar.critical.unfilled {
    background: repeating-linear-gradient(
        135deg,
        rgba(229, 57, 53, 0.25) 0px,
        rgba(229, 57, 53, 0.25) 3px,
        rgba(229, 57, 53, 0.15) 3px,
        rgba(229, 57, 53, 0.15) 6px
    );
    box-shadow: none;
}

.mini-gantt-bar.normal.unfilled {
    background: repeating-linear-gradient(
        135deg,
        rgba(30, 136, 229, 0.25) 0px,
        rgba(30, 136, 229, 0.25) 3px,
        rgba(30, 136, 229, 0.15) 3px,
        rgba(30, 136, 229, 0.15) 6px
    );
    box-shadow: none;
}

.mini-gantt-bar.near-critical.unfilled {
    background: repeating-linear-gradient(
        135deg,
        rgba(251, 140, 0, 0.25) 0px,
        rgba(251, 140, 0, 0.25) 3px,
        rgba(251, 140, 0, 0.15) 3px,
        rgba(251, 140, 0, 0.15) 6px
    );
    box-shadow: none;
}

.mini-gantt-bar.delay-severe.unfilled {
    background: repeating-linear-gradient(
        135deg,
        rgba(211, 47, 47, 0.25) 0px,
        rgba(211, 47, 47, 0.25) 3px,
        rgba(211, 47, 47, 0.15) 3px,
        rgba(211, 47, 47, 0.15) 6px
    );
    box-shadow: none;
}

.mini-gantt-bar.delay-high.unfilled {
    background: repeating-linear-gradient(
        135deg,
        rgba(245, 124, 0, 0.25) 0px,
        rgba(245, 124, 0, 0.25) 3px,
        rgba(245, 124, 0, 0.15) 3px,
        rgba(245, 124, 0, 0.15) 6px
    );
    box-shadow: none;
}

.mini-gantt-bar.delay-moderate.unfilled {
    background: repeating-linear-gradient(
        135deg,
        rgba(255, 167, 38, 0.25) 0px,
        rgba(255, 167, 38, 0.25) 3px,
        rgba(255, 167, 38, 0.15) 3px,
        rgba(255, 167, 38, 0.15) 6px
    );
    box-shadow: none;
}

.mini-gantt-bar.delay-low.unfilled {
    background: repeating-linear-gradient(
        135deg,
        rgba(255, 204, 128, 0.25) 0px,
        rgba(255, 204, 128, 0.25) 3px,
        rgba(255, 204, 128, 0.15) 3px,
        rgba(255, 204, 128, 0.15) 6px
    );
    box-shadow: none;
}

/* 2-Layer Timeline Header: Year + Month */
.mini-gantt-years {
    display: flex;
    width: 100%;
    height: 18px;
    border-bottom: 1px solid #ccc;
    background: #e0e0e0;
}

.mini-gantt-year {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    border-right: 2px solid #bbb;
    box-sizing: border-box;
}

.mini-gantt-year:last-child {
    border-right: none;
}

.mini-gantt-months {
    display: flex;
    width: 100%;
    height: 18px;
    background: #f5f5f5;
}

.mini-gantt-month {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 500;
    color: #666;
    border-right: 1px solid #e0e0e0;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}

.mini-gantt-month:last-child {
    border-right: none;
}

/* Group Headers (for groupBy: trade/floor) */
.mini-gantt-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    height: 28px;
    max-height: 28px;
    background: #e8f4fc;
    border-bottom: 1px solid #bbdefb;
    border-top: 1px solid #ddd;
}

.mini-gantt-group-header:first-of-type {
    border-top: none;
}

.mini-gantt-group-name {
    font-weight: 600;
    font-size: 11px;
    color: #1565c0;
}

.mini-gantt-group-count {
    font-size: 9px;
    font-weight: 500;
    color: white;
    background: #1976d2;
    padding: 1px 6px;
    border-radius: 8px;
}

/* Nested hierarchy level styles */
.mini-gantt-level-0 {
    background: #e3f2fd;
    border-left: 3px solid #1976d2;
}

.mini-gantt-level-1 {
    background: #e8f5e9;
    border-left: 3px solid #43a047;
}

.mini-gantt-level-1 .mini-gantt-group-name {
    color: #2e7d32;
}

.mini-gantt-level-1 .mini-gantt-group-count {
    background: #43a047;
}

.mini-gantt-level-2 {
    background: #fff3e0;
    border-left: 3px solid #fb8c00;
}

.mini-gantt-level-2 .mini-gantt-group-name {
    color: #e65100;
}

.mini-gantt-level-2 .mini-gantt-group-count {
    background: #fb8c00;
}

.mini-gantt-level-3 {
    background: #fce4ec;
    border-left: 3px solid #e91e63;
}

.mini-gantt-level-3 .mini-gantt-group-name {
    color: #c2185b;
}

.mini-gantt-level-3 .mini-gantt-group-count {
    background: #e91e63;
}

/* Level 4+ uses subtle gray */
.mini-gantt-level-4,
.mini-gantt-level-5,
.mini-gantt-level-6 {
    background: #f5f5f5;
    border-left: 3px solid #9e9e9e;
}

.mini-gantt-level-4 .mini-gantt-group-name,
.mini-gantt-level-5 .mini-gantt-group-name,
.mini-gantt-level-6 .mini-gantt-group-name {
    color: #616161;
}

.mini-gantt-level-4 .mini-gantt-group-count,
.mini-gantt-level-5 .mini-gantt-group-count,
.mini-gantt-level-6 .mini-gantt-group-count {
    background: #9e9e9e;
}

.mini-gantt-row-grouped .mini-gantt-task-name {
    padding-left: 12px;
}

.mini-gantt-today-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #4caf50;
    z-index: 10;
}

.mini-gantt-summary {
    padding: 8px 12px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    font-size: 11px;
    color: #666;
    display: flex;
    gap: 16px;
}

.mini-gantt-summary span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-gantt-legend {
    display: flex;
    gap: 12px;
    padding: 6px 12px;
    background: #fafafa;
    border-top: 1px solid #eee;
    font-size: 10px;
}

.mini-gantt-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mini-gantt-legend-bar {
    width: 16px;
    height: 8px;
    border-radius: 2px;
}

.mini-gantt-legend-bar.critical {
    background: #e53935;
}

.mini-gantt-legend-bar.near-critical {
    background: #fb8c00;
}

.mini-gantt-legend-bar.normal {
    background: #1e88e5;
}

/* Delay severity colors for legend */
.mini-gantt-legend-bar.delay-severe {
    background: #d32f2f;
}

.mini-gantt-legend-bar.delay-high {
    background: #f57c00;
}

.mini-gantt-legend-bar.delay-moderate {
    background: #ffa726;
}

.mini-gantt-legend-bar.delay-low {
    background: #ffcc80;
}

/* Progress legend separator */
.mini-gantt-legend-separator {
    width: 1px;
    height: 12px;
    background: #ccc;
    margin: 0 4px;
}

/* Unfilled legend bars (striped pattern) */
.mini-gantt-legend-bar.unfilled {
    background: repeating-linear-gradient(
        135deg,
        rgba(30, 136, 229, 0.3) 0px,
        rgba(30, 136, 229, 0.3) 2px,
        rgba(30, 136, 229, 0.15) 2px,
        rgba(30, 136, 229, 0.15) 4px
    );
}

/* ========================================
   Clickable Task Code Styles
   ======================================== */

.ai-clickable-task-code {
    color: #0066cc;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.15s, background-color 0.15s;
    padding: 0 2px;
    border-radius: 2px;
}

.ai-clickable-task-code:hover {
    color: #004499;
    background-color: #e8f4ff;
}

/* ========================================
   Modern Task Modal (tm-) Styles
   ======================================== */

/* Overlay */
.tm-overlay {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px;
    background: rgba(17, 24, 39, 0.4);
    backdrop-filter: blur(4px);
    animation: tmFadeIn 0.15s ease-out;
}

@keyframes tmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Container */
.tm-modal {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: tmSlideIn 0.2s ease-out;
}

@keyframes tmSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Header */
.tm-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: white;
}

.tm-header-content { flex: 1; }

.tm-header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.tm-code-badge {
    font-size: 11px;
    font-family: monospace;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.tm-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    border: 1px solid;
}

.tm-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0;
}

.tm-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.tm-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tm-meta-item svg { color: #9ca3af; }

.tm-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s;
}

.tm-close:hover {
    background: #f3f4f6;
    color: #4b5563;
}

/* Body */
.tm-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f9fafb;
}

/* Stats Row */
.tm-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.tm-stat-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tm-stat-info { display: flex; flex-direction: column; }
.tm-stat-right { text-align: right; }

.tm-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tm-stat-value {
    font-size: 16px;  /* Base size, can be larger for specific cards */
    font-weight: 600;  /* font-semibold */
    color: #111827;  /* gray-900 */
    margin-top: 2px;  /* mt-0.5 */
}

.tm-stat-value.tm-large {
    font-size: 18px;  /* text-lg for duration */
}

.tm-stat-sub {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
}

.tm-stat-hint {
    font-size: 10px;
    color: #6b7280;
    margin-top: 4px;
}

.tm-blue { color: #2563eb; }

/* Progress Ring */
.tm-progress-ring {
    position: relative;
    width: 48px;
    height: 48px;
}

.tm-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.tm-ring-bg {
    stroke: #f3f4f6;
}

.tm-ring-progress {
    stroke: #2563eb;
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s;
}

.tm-progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #374151;
}

/* Float Card */
.tm-float-card {
    border: 1px solid;
}

.tm-float-value {
    font-size: 20px !important;  /* text-xl */
    font-weight: 700 !important;  /* font-bold */
    line-height: 1.2;
}

.tm-float-icon {
    opacity: 0.2;
}

/* Cards Row */
.tm-cards-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

/* Data Card */
.tm-data-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow: hidden;
}

.tm-card-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;  /* text-sm = 14px */
    font-weight: 600;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.05em;  /* tracking-wide */
}

.tm-card-header svg { color: #9ca3af; }

.tm-card-body { padding: 16px; }

/* Date Range */
.tm-date-range {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.tm-date-item { flex: 1; }
.tm-date-right { text-align: right; }

.tm-date-label {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.tm-date-value {
    font-family: monospace;
    font-size: 14px;  /* Matched to mockup */
    font-weight: 600;  /* font-semibold */
    color: #111827;  /* gray-900 */
    background: #f9fafb;  /* gray-50 */
    padding: 4px 8px;  /* py-1 px-2 */
    border-radius: 4px;  /* rounded */
    display: inline-block;
}

.tm-date-line {
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* Info Box */
.tm-info-box {
    background: #eff6ff;  /* blue-50 */
    color: #1d4ed8;  /* blue-700 */
    font-size: 12px;  /* text-xs */
    padding: 12px;  /* p-3 */
    border-radius: 8px;  /* rounded-lg */
    display: flex;
    align-items: flex-start;
    gap: 8px;  /* gap-2 */
    line-height: 1.5;
}

.tm-info-box svg { flex-shrink: 0; margin-top: 2px; }
.tm-info-box strong { font-weight: 600; }

/* Constraint Box */
.tm-constraint-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fffbeb;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    margin-top: 12px;
}
.tm-constraint-box svg {
    flex-shrink: 0;
    color: #d97706;
}

/* CPM Grid */
.tm-cpm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 32px;  /* gap-y-4 gap-x-8 = 16px vertical, 32px horizontal */
}

.tm-cpm-col { display: flex; flex-direction: column; gap: 12px; }

.tm-cpm-item {
    padding-left: 12px;
    border-left: 2px solid;
}

.tm-cpm-early { border-color: #34d399; }
.tm-cpm-late { border-color: #f87171; }

.tm-cpm-label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 2px;
}

.tm-cpm-value {
    font-family: monospace;
    font-size: 14px;  /* text-sm = 14px */
    font-weight: 500;  /* font-medium */
    color: #111827;
}

.tm-cpm-hint {
    font-size: 10px;
    font-style: italic;
    margin-top: 2px;
}

.tm-green { color: #059669; }
.tm-red { color: #dc2626; }

.tm-cpm-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #6b7280;
}

.tm-cpm-footer-hint {
    font-style: italic;
    color: #9ca3af;
}

/* Dependencies Row */
.tm-deps-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.tm-deps-col { }

.tm-deps-title {
    font-size: 12px;  /* text-xs */
    font-weight: 700;  /* font-bold */
    color: #6b7280;  /* gray-500 */
    text-transform: uppercase;
    letter-spacing: 0.05em;  /* tracking-wider */
    margin-bottom: 12px;  /* mb-3 */
    display: flex;
    align-items: center;
    gap: 8px;  /* gap-2 */
}

.tm-deps-title-right { justify-content: flex-end; }

.tm-deps-list { display: flex; flex-direction: column; gap: 8px; }  /* space-y-2 */

.tm-dep-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.tm-dep-item:hover {
    border-color: #93c5fd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tm-dep-info { display: flex; flex-direction: column; }

.tm-dep-code {
    font-size: 11px;
    font-family: monospace;
    color: #9ca3af;
    margin-bottom: 2px;
}

.tm-dep-name {
    font-size: 14px;  /* text-sm = 14px */
    font-weight: 500;  /* font-medium */
    color: #1f2937;  /* gray-800 */
}

.tm-dep-item:hover .tm-dep-name { color: #2563eb; }

.tm-dep-type {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.tm-dep-empty {
    padding: 16px;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    font-style: italic;
}

/* Footer */
.tm-footer {
    padding: 16px 24px;  /* py-4 px-6 = 16px 24px */
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;  /* text-xs */
    color: #9ca3af;  /* gray-400 */
}

/* Responsive */
@media (max-width: 768px) {
    .tm-stats-row,
    .tm-cards-row,
    .tm-deps-row {
        grid-template-columns: 1fr;
    }

    .tm-cpm-grid {
        grid-template-columns: 1fr;
    }
}
