/* Custom Styles for Management Dashboard */

:root {
    --primary-color: #0d6efd;
    --purple-color: #6f42c1;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --dark-bg: #1a1e29;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #495057;
}

/* Softer text colors */
.text-dark {
    color: #495057 !important;
}

h1, h2, h3, h4, h5, h6 {
    color: #495057;
}

/* Avatar Circle */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Metric Cards */
.metric-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: #ffffff;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Clickable Cards */
.clickable-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.clickable-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.metric-card .card-body {
    padding: 1.5rem;
}

.metric-card h2 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #212529;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.metric-card h6 {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    color: #6c757d;
}

/* Summary Metric Cards - Enhanced Design */
.metric-card-summary {
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff;
    overflow: hidden;
}

.metric-card-summary:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
}

/* Summary-like cards for subpages */
.summary-card-like {
    border: none !important;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff;
}

.summary-card-like:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
}

.metric-card-summary .card-body {
    padding: 1.5rem;
    min-height: 130px;
}

.metric-card-summary h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0;
    letter-spacing: -0.02em;
}

.metric-card-summary h6 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0;
    color: #6c757d;
    line-height: 1.3;
}

.metric-card-summary small {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Icon Circles for Summary Cards */
.metric-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
}

.metric-icon-circle i {
    font-size: 1.4rem;
    font-weight: 600;
}

.metric-icon-blue {
    background-color: #e3f2fd;
}

.metric-icon-red {
    background-color: #ffebee;
}

.metric-icon-orange {
    background-color: #fff3e0;
}

.metric-icon-green {
    background-color: #e8f5e9;
}

.metric-icon-gray {
    background-color: #f5f5f5;
}

/* Blocked Items Card - Light Red Background */
.metric-card-blocked {
    background-color: #fff5f5 !important;
}

.metric-card-blocked h6 {
    color: #c62828;
}

/* Handoff Efficiency Card - Light Blue Background */
.metric-card-handoff {
    background-color: #f0f7ff !important;
    border: 1px solid #d0e7ff;
}

/* Daily Activity Signal Card - Light Green Background */
.metric-card-activity {
    background-color: #f0fdf4 !important;
    border: 1px solid #c3f4d9;
}

/* Handoff Section Layout */
.handoff-left {
    flex: 1;
}

.handoff-title {
    font-size: 0.875rem !important;
    font-weight: 800 !important;
    color: #6c757d !important;
    letter-spacing: 0.5px;
}

h6.handoff-title,
.metric-card h6.handoff-title,
.metric-card-handoff h6.handoff-title {
    font-size: 0.875rem !important;
    font-weight: 800 !important;
    color: #6c757d !important;
}

.handoff-subtitle {
    font-size: 0.85rem;
    font-weight: 400;
    color: #6c757d;
    font-style: normal;
}

.handoff-right {
    display: flex;
    align-items: center;
    gap: 3rem;
    flex-shrink: 0;
}

.handoff-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.handoff-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Engineer Activity Matrix */
.activity-matrix-card {
    border-radius: 20px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.activity-matrix-scroll {
    border-radius: 20px;
}

.activity-matrix-table {
    font-size: 0.875rem;
    border-collapse: separate;
    border-spacing: 0;
}

.activity-matrix-table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    border-top: 1px solid #dee2e6;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

.activity-matrix-table thead th:first-child {
    border-top-left-radius: 20px;
}

.activity-matrix-table thead th:last-child {
    border-top-right-radius: 20px;
}

.activity-matrix-table tbody td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
    border-left: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
}

.activity-matrix-table tfoot td {
    border-bottom: 1px solid #dee2e6;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
}

.activity-matrix-table tfoot td[colspan] {
    border: none;
    padding: 0;
    background-color: transparent;
}

.activity-matrix-table tfoot td:first-child {
    border-bottom-left-radius: 20px;
}

.activity-matrix-table tfoot td:last-child {
    border-bottom-right-radius: 20px;
}

.sticky-col {
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 10;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
}

.activity-matrix-table thead .sticky-col {
    z-index: 11;
    background-color: #f8f9fa;
}

.sticky-col-right {
    position: sticky;
    background-color: white;
    z-index: 10;
    box-shadow: -2px 0 4px rgba(0,0,0,0.05);
    white-space: nowrap;
}

.activity-matrix-table thead .sticky-col-right {
    z-index: 11;
    background-color: #f8f9fa;
}

.activity-matrix-table tfoot .sticky-col-right {
    background-color: #f8f9fa;
    z-index: 11;
}

/* Ensure footer sticky columns have same positioning as header/body */
.activity-matrix-table tfoot td.sticky-col-right:last-child {
    right: 0;
}

.activity-matrix-table tfoot td.sticky-col-right:nth-last-child(2) {
    right: 100px;
}

.activity-matrix-table tfoot td.sticky-col-right:nth-last-child(3) {
    right: 250px;
}

/* Ensure pagination doesn't overflow */
.activity-matrix-table tfoot .pagination {
    margin: 0;
    flex-wrap: nowrap;
}

.activity-matrix-table tfoot .page-link {
    font-size: 0.875rem;
    line-height: 1.2;
}

/* Ensure footer cells have proper padding */
.activity-matrix-table tfoot td.sticky-col-right {
    padding: 0.5rem;
}

/* Sticky positioning for Active Days, Utilization, and Status columns */
/* These columns should stick to the right and not scroll */
/* Order in HTML from left to right: ACTIVE DAYS, UTILIZATION, STATUS */
/* Order from right to left: STATUS (rightmost), UTILIZATION (middle), ACTIVE DAYS (leftmost) */

/* STATUS column (rightmost - last column) */
.activity-matrix-table thead th.sticky-col-right:last-child,
.activity-matrix-table tbody td.sticky-col-right:last-child,
.activity-matrix-table tfoot td.sticky-col-right:last-child {
    right: 0;
}

/* UTILIZATION column (second from right) */
.activity-matrix-table thead th.sticky-col-right:nth-last-child(2),
.activity-matrix-table tbody td.sticky-col-right:nth-last-child(2),
.activity-matrix-table tfoot td.sticky-col-right:nth-last-child(2) {
    right: 100px; /* Width of STATUS column (100px) */
}

/* ACTIVE DAYS column (third from right - leftmost of sticky group) */
.activity-matrix-table thead th.sticky-col-right:nth-last-child(3),
.activity-matrix-table tbody td.sticky-col-right:nth-last-child(3),
.activity-matrix-table tfoot td.sticky-col-right:nth-last-child(3) {
    right: 250px; /* Width of STATUS (100px) + UTILIZATION (150px) */
}

/* Ensure sticky right columns have fixed widths */
.activity-matrix-table th.sticky-col-right,
.activity-matrix-table td.sticky-col-right {
    width: auto;
}

.activity-matrix-table th.sticky-col-right:nth-last-child(3),
.activity-matrix-table td.sticky-col-right:nth-last-child(3) {
    width: 100px;
}

.activity-matrix-table th.sticky-col-right:nth-last-child(2),
.activity-matrix-table td.sticky-col-right:nth-last-child(2) {
    width: 150px;
}

.activity-matrix-table th.sticky-col-right:nth-last-child(1),
.activity-matrix-table td.sticky-col-right:nth-last-child(1) {
    width: 100px;
}

.activity-cell {
    width: 60px;
    height: 44px;
    padding: 6px !important;
    text-align: center;
    background: transparent !important;
    border: none !important;
}

.activity-chip {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.activity-chip.activity-active {
    background-color: var(--legend-active);
    color: #fff;
}

.activity-chip.activity-idle {
    background-color: var(--legend-idle);
    color: #ffffff;
    border: none;
}

.activity-chip.activity-weekend {
    background-color: #ffffff;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.activity-chip.activity-holiday {
    background-color: var(--legend-holiday) !important;
    color: #fff;
    border: none;
}

.activity-chip.activity-leave {
    background-color: var(--legend-leave);
    color: #6b7280;
}

.activity-matrix-table thead th {
    font-size: 0.7rem;
    color: #6b7280;
    border-bottom: 1px solid #edf2f7;
    background: #fafbfc;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-left: none !important;
    border-right: none !important;
}

.activity-matrix-table thead th .date-label {
    color: #c0c6d4;
    font-weight: 500;
}

.activity-matrix-table thead th .date-number {
    color: #6b7280;
    font-weight: 600;
}

.activity-matrix-table tbody tr {
    border-bottom: 1px solid #eef2f7;
}

.activity-matrix-table tbody tr:last-child {
    border-bottom: none;
}

.activity-matrix-table tbody td {
    border-bottom: 1px solid #eef2f7 !important;
}

.activity-matrix-table tbody tr:last-child td {
    border-bottom: none !important;
}

.activity-matrix-table td {
    border-color: transparent;
    border-left: none !important;
    border-right: none !important;
}

.legend-group {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 8px 14px;
    background: #ffffff;
    border: 1px solid #e9edf3;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-right: 0;
}

:root {
    --legend-active: #27ae60;
    --legend-idle: #f4b000;
    --legend-holiday: #e74c3c;
    --legend-leave: #e5e7eb;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
}

.legend-dot {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    display: inline-block;
}

.legend-dot.legend-active {
    background: var(--legend-active);
}

.legend-dot.legend-idle {
    background: var(--legend-idle);
}

.legend-dot.legend-holiday {
    background: var(--legend-holiday);
}

.legend-dot.legend-leave {
    background: var(--legend-leave);
}

.filter-select {
    min-width: 0;
    border-radius: 10px;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 6px 18px 6px 12px;
    color: #6b7280;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-size: 0.85rem;
    width: auto;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.filter-select:focus {
    box-shadow: none;
    border-color: #d7dde5;
}

.filter-select:hover,
.filter-select:focus-visible,
.filter-select.dropdown-toggle:hover,
.filter-select.dropdown-toggle:focus,
.filter-select.dropdown-toggle:active {
    background-color: #ffffff !important;
    color: #6b7280;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.dropdown-toggle.filter-select::after {
    border-top-color: #6b7280;
    margin-left: 8px;
}

.filter-select option {
    background-color: #ffffff;
    color: #111827;
}

.filter-menu {
    min-width: 140px;
    padding: 8px 0;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    background: #ffffff;
}

.filter-menu .dropdown-item {
    padding: 8px 16px;
    color: #111827;
    font-weight: 400;
    font-size: 0.85rem;
}

.filter-menu .dropdown-item:hover,
.filter-menu .dropdown-item:focus {
    background: #ffffff;
    color: #111827;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

@media (min-width: 992px) {
    .filter-row {
        flex-wrap: nowrap;
    }
}

.date-col {
    text-align: center;
    font-size: 0.7rem;
    line-height: 1.2;
}

/* Horizontal scroll for activity matrix */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ensure date columns are the only scrollable ones */
.activity-matrix-table .date-col {
    position: relative;
}

/* Make sure sticky columns don't scroll */
.activity-matrix-table .sticky-col,
.activity-matrix-table .sticky-col-right {
    position: sticky;
}

/* Stack Badge - More rectangular but still curved */
.stack-badge {
    border-radius: 6px;
    font-weight: 500;
}

/* Engineer Avatar Placeholder */
.engineer-avatar-placeholder {
    background-color: #e9ecef !important;
    color: #6c757d !important;
}

/* Engineer Avatar Image - Gray background when image fails to load */
.engineer-avatar-img {
    background-color: #e9ecef;
}

.engineer-avatar-img[src=""],
.engineer-avatar-img:not([src]) {
    display: none;
}

/* Design-driven page shells */
.app-shell {
    display: flex;
    min-height: 100vh;
    background-color: #f6f8fb;
}

.side-panel {
    width: 240px;
    background: #ffffff;
    border-right: 1px solid #e9edf3;
    padding: 1.5rem 1.25rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    color: #20262e;
    margin-bottom: 2rem;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.side-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    color: #677188;
    text-decoration: none;
}

.side-nav .nav-link.active {
    background: #eef3ff;
    color: #2f5bff;
    font-weight: 600;
}

.side-nav-section {
    margin-top: 2rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: #9aa5b1;
    text-transform: uppercase;
}

.side-footer {
    margin-top: auto;
    padding-top: 2rem;
    font-size: 0.85rem;
    color: #6b7785;
}

.main-panel {
    flex: 1;
    padding: 1.5rem 2rem 3rem;
}

.top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.top-search {
    max-width: 280px;
}

.month-filter-group {
    background: #ffffff;
    border: 1px solid #e9edf3;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.month-filter-group .input-group-text {
    background: #ffffff;
    border: none;
    color: #6c757d;
}

.month-filter-group .form-select {
    border: none;
    min-width: 120px;
    font-size: 0.9rem;
    color: #495057;
}

.month-filter-group .form-select:focus {
    box-shadow: none;
}

.page-title {
    font-weight: 700;
    font-size: 1.5rem;
}

.page-subtitle {
    color: #7b8794;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.metric-grid-tight {
    gap: 12px;
    grid-template-columns: repeat(auto-fit, 300px);
    justify-content: start;
    margin-left: 0;
    margin-right: 0;
}

.metric-tile {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e9edf3;
    padding: 1.2rem 1.4rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.metric-tile-wide {
    height: 120px;
    aspect-ratio: 3 / 1;
    max-width: 100%;
    align-items: center;
}

.metric-tile .metric-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.metric-inline-info {
    margin-left: 6px;
}

.pill-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pill {
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    color: #5b6776;
    background: #ffffff;
    text-decoration: none;
}

.pill.active {
    background: #1f2937;
    color: #ffffff;
    border-color: #1f2937;
}

.table-card {
    background: #ffffff;
    border: 1px solid #e9edf3;
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
}

.table-card-header {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid #e9edf3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.table-card table {
    margin: 0;
}

.table-card thead th {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: #7b8794;
    text-transform: uppercase;
    padding: 0.85rem 1.2rem;
    background: #f9fafc;
    border-bottom: 1px solid #e9edf3;
}

.table-card tbody td {
    padding: 0.85rem 1.2rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f4f8;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.tag-soft {
    background: #eef2ff;
    color: #4654d3;
}

.project-col {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-pill {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.status-pill.blocked {
    background: #ffe5ea;
    color: #d43149;
}

.priority-chip {
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #d43149;
}

.risk-score {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.risk-bar {
    height: 6px;
    border-radius: 999px;
    background: #edf2f7;
    width: 90px;
    overflow: hidden;
}

.risk-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
}

/* WIP Status Items */
.wip-status-item {
    margin-bottom: 1.5rem;
}

.wip-status-item:last-child {
    margin-bottom: 0;
}

.wip-status-item .progress {
    border-radius: 6px;
    background-color: #f1f3f5;
    height: 10px;
    overflow: visible;
}

.wip-status-item .progress-bar {
    border-radius: 4px;
}

/* New WIP Status Design */
.wip-status-item-new {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.wip-status-item-new:last-child {
    margin-bottom: 0;
}

.wip-label {
    font-size: 0.95rem;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 100px;
    text-align: left;
}

.wip-bar-container {
    flex: 1;
    height: 1.9rem;
    background-color: #f1f3f5;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-width: 0;
}

.wip-progress-bar {
    height: 100%;
    border-radius: 20px;
    transition: width 0.3s ease;
}

.wip-bar-secondary {
    width: 22%;
    background-color: #adb5bd;
}

.wip-bar-primary {
    background-color: #0d6efd;
}

.wip-bar-purple {
    background-color: #6f42c1;
}

.wip-bar-warning {
    background-color: #ffc107;
}

.wip-bar-success {
    background-color: #20c997;
}

.wip-count {
    font-size: 0.95rem;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 40px;
    text-align: center;
}

.text-purple {
    color: var(--purple-color) !important;
}

.bg-purple {
    background-color: var(--purple-color) !important;
}

.bg-warning.bg-opacity-25 {
    background-color: rgba(255, 193, 7, 0.25) !important;
}

/* Scrollable Epic Table */
/* Active Epics Card - Enhanced like Summary Cards */
.active-epics-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff;
    overflow: hidden;
}

.active-epics-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
}

.active-epics-card .card-header {
    border-bottom: none;
    padding-bottom: 0.75rem;
}

.epic-table-scrollable {
    max-height: 400px;
    overflow-y: auto;
    position: relative;
}

.epic-table-scrollable thead.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8f9fa;
}

.epic-table-header {
    padding: 1rem 1.5rem !important;
    background-color: #f8f9fa;
    border-bottom: none;
}

.epic-table-row {
    border-bottom: 1px solid #e9ecef;
}

.epic-table-row:last-child {
    border-bottom: none;
}

.epic-table-cell {
    padding: 1rem 1.5rem !important;
    border-top: none;
}

.epic-progress-bar {
    border-radius: 12px;
}

.epic-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.epic-risk-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

/* Smooth scrolling */
.epic-table-scrollable {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f1f1f1;
}

.epic-table-scrollable::-webkit-scrollbar {
    width: 8px;
}

.epic-table-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.epic-table-scrollable::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.epic-table-scrollable::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 16px;
    background-color: #ffffff;
}

/* WIP Status Card - Enhanced like Summary Cards */
.wip-status-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff;
    overflow: hidden;
}

.wip-status-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
}

/* Task Aging Card - Enhanced like Summary Cards */
.task-aging-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff;
    overflow: hidden;
}

.task-aging-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
}

.task-aging-card .card-header {
    border-bottom: none;
    padding-bottom: 0.75rem;
}

.card-header {
    padding: 1rem 1.5rem;
    font-weight: 600;
    background-color: #ffffff;
    border-bottom: none;
}

.wip-status-card .card-header {
    border-bottom: none;
    padding-bottom: 0.75rem;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6c757d;
    border-bottom: none;
    padding: 0.75rem 1rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    border-top: none;
}

.task-aging-table tbody tr {
    border-bottom: none;
}

.task-aging-table tbody td {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.task-aging-table thead th {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.75rem;
}

/* Badges */
.badge {
    padding: 0.4em 0.75em;
    font-weight: 500;
    border-radius: 20px;
    font-size: 0.75rem;
}

/* Pastel Badges for Task Aging */
.badge-pastel {
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.35em 0.85em;
}

.badge-pastel.badge-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.badge-pastel.badge-info {
    background-color: #cff4fc;
    color: #055160;
}

.badge-pastel.badge-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.badge-pastel.badge-danger {
    background-color: #f8d7da;
    color: #842029;
}

/* Progress Bars */
.progress {
    border-radius: 6px;
    background-color: #f1f3f5;
    overflow: hidden;
}

.progress-bar {
    border-radius: 6px;
}

/* Navigation */
.navbar {
    padding: 1rem 0;
}

.navbar-transparent {
    background-color: transparent !important;
    border: none !important;
}

.navbar-brand {
    font-size: 1.25rem;
}

.navbar-title {
    font-weight: 700;
    color: #2D3732;
    line-height: 1.2;
}

.navbar-subtitle {
    color: #728E82;
    font-weight: 400;
    margin-left: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .metric-card h3 {
        font-size: 1.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Dark theme for Risk Radar */
.dark-theme {
    background-color: var(--dark-bg);
    color: #ffffff;
}

.dark-theme .card {
    background-color: #252a36;
    color: #ffffff;
    border-color: #3a3f4b;
}

.dark-theme .table {
    color: #ffffff;
}

.dark-theme .table thead th {
    color: #adb5bd;
    border-color: #3a3f4b;
}

.dark-theme .table tbody td {
    border-color: #3a3f4b;
}

.dark-theme .text-muted {
    color: #adb5bd !important;
}

.dark-theme .form-control,
.dark-theme .form-select {
    background-color: #252a36;
    border-color: #3a3f4b;
    color: #ffffff;
}

.dark-theme .form-control:focus,
.dark-theme .form-select:focus {
    background-color: #252a36;
    border-color: #0d6efd;
    color: #ffffff;
}

.dark-theme .input-group-text {
    background-color: #252a36;
    border-color: #3a3f4b;
    color: #adb5bd;
}

/* Kanban Board Styles */
.kanban-column {
    min-height: 500px;
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.kanban-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: move;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.kanban-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.kanban-card-id {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
}

.kanban-card-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.kanban-card-body {
    margin-bottom: 0.75rem;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Work Items Table */
.work-item-table .status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.priority-icon {
    font-size: 1rem;
}

/* Engineer Workload */
.engineer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.capacity-bar {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
    overflow: hidden;
}

.capacity-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

/* Risk Score Bar */
.risk-score-bar {
    height: 20px;
    border-radius: 4px;
    background-color: #e9ecef;
    overflow: hidden;
    position: relative;
}

.risk-score-fill {
    height: 100%;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Filter Pills */
.filter-pill {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.filter-pill:hover {
    background-color: #f8f9fa;
    color: #212529;
}

.filter-pill.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Sidebar */
.sidebar {
    height: 100vh;
    background-color: white;
    border-right: 1px solid #e9ecef;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    position: sticky;
    top: 0;
    overflow: hidden;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex-shrink: 0;
}

.sidebar > .mb-4:first-child {
    flex-shrink: 0;
}

.logo-circle-new {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.logo-text {
    font-size: 0.5rem;
    color: #6c757d;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1;
}

.logo-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    padding-right: 0.5rem;
    margin-right: -0.5rem;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.sidebar-nav .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-nav .nav-link:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.sidebar-nav .nav-link.active {
    background-color: #e7f1ff;
    color: var(--primary-color);
    font-weight: 600;
    border-radius: 8px;
}

.sidebar-nav .nav-link.active i {
    color: var(--primary-color);
}

.sidebar-nav .nav-link.active::before {
    display: none;
}

.sidebar-user {
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
    margin-top: auto;
    flex-shrink: 0;
}

.user-avatar img {
    border: none;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile optimizations */
@media (max-width: 991px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        z-index: 1050;
        transition: left 0.3s ease;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 1040;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .kanban-column {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        border: none;
    }
    
    .work-item-table {
        font-size: 0.8rem;
    }
    
    .work-item-table th,
    .work-item-table td {
        padding: 0.5rem;
    }
    
    .sidebar {
        width: 280px;
    }
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    .pagination {
        display: none !important;
    }
}
