@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    background: #f5f5f5;
    color: #55534F;
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.header-bar {
    background: #29414C;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(41, 65, 76, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.logo-image {
    height: 50px;
    width: auto;
}

.dashboard-title {
    color: white;
    font-size: 1.8em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

/* Header Right Section */
.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 1;
}

.header-help-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    color: white;
    font-size: 0.9em;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.header-help-btn:hover {
    border-color: white;
    background: rgba(255, 255, 255, 0.15);
}

/* Filter Badge */
.filter-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #4E767D;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.filter-badge:hover {
    background: #5a8891;
    border-color: #C6BFBA;
}

.badge-icon {
    font-size: 1.2em;
}

.badge-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.badge-label {
    color: white;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.badge-period {
    color: #C6BFBA;
    font-size: 0.75em;
    font-weight: 600;
}

/* Hamburger Button */
.hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s ease;
}

.hamburger-btn:hover .hamburger-icon {
    background: #C6BFBA;
}

.hamburger-icon {
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Filter Panel Overlay */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(41, 65, 76, 0.7);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Filter Panel */
.filter-panel {
    position: fixed;
    top: 0;
    right: -350px;
    bottom: 0;
    width: 350px;
    background: white;
    box-shadow: -4px 0 20px rgba(41, 65, 76, 0.3);
    z-index: 9999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.filter-panel.open {
    right: 0;
}

.filter-panel-header {
    background: #29414C;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-panel-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.close-btn {
    background: none;
    border: none;
    color: #C6BFBA;
    font-size: 2.5em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    line-height: 1;
}

.close-btn:hover {
    color: white;
}

.filter-panel-body {
    flex: 1;
    padding: 30px 20px;
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 25px;
}

.filter-panel-label {
    display: block;
    font-size: 0.9em;
    font-weight: 900;
    color: #29414C;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.filter-panel-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #C6BFBA;
    background: white;
    color: #29414C;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border-radius: 4px;
}

.filter-panel-select:hover,
.filter-panel-select:focus {
    border-color: #4E767D;
    outline: none;
}

.filter-panel-footer {
    padding: 20px;
    border-top: 1px solid #e9e9e9;
}

.btn-apply {
    width: 100%;
    background: #4E767D;
    color: white;
    border: none;
    padding: 12px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
}

.btn-apply:hover {
    background: #5a8891;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 118, 125, 0.3);
}

/* Remove old selectors */
.header-selectors,
.contract-selector,
.month-selector {
    display: none;
}

/* Month Selector */
.month-selector {
    background: #4E767D;
    border: 2px solid #C6BFBA;
    color: white;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month-selector:hover {
    background: #5a8891;
}

.month-selector:focus {
    outline: 3px solid #C6BFBA;
    outline-offset: 2px;
}

/* Main Container */
.dashboard-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 30px;
}

/* Loading Spinner */
.loading-spinner {
    text-align: center;
    padding: 50px;
    font-size: 1.2em;
    color: #4E767D;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 50px 20px;
    text-align: center;
}

.welcome-gif {
    height: auto;
    margin-bottom: 30px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.welcome-title {
    font-size: 2.5em;
    font-weight: 900;
    color: #29414C;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.welcome-message {
    font-size: 1.3em;
    color: #6B665F;
    margin-bottom: 40px;
    font-weight: 600;
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(78, 118, 125, 0.3);
}

.btn-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(78, 118, 125, 0.4);
}

.btn-icon {
    font-size: 1.3em;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 50px 20px;
}

.loading-gif {
    height: auto;
    margin-bottom: 25px;
    animation: float 3s ease-in-out infinite;
}

.loading-message {
    font-size: 1.3em;
    color: #4E767D;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-height: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.typing-cursor {
    font-weight: 400;
    animation: blink 1s step-start infinite;
    color: #4E767D;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    50.01%, 100% {
        opacity: 0;
    }
}

/* Section Headers */
.section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title {
    font-size: 1.6em;
    font-weight: 900;
    color: #29414C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subsection-title {
    font-size: 0.9em;
    font-weight: 900;
    color: #4E767D;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

/* KPI Boxes */
.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.kpi-box {
    background: white;
    border-left: 4px solid #4E767D;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(41, 65, 76, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 50%, rgba(78, 118, 125, 0.05) 50%);
}

.kpi-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(41, 65, 76, 0.12);
}

.kpi-box.clickable {
    cursor: pointer;
}

.kpi-title {
    font-size: 0.85em;
    font-weight: 900;
    color: #4E767D;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.kpi-value {
    font-size: 2.5em;
    font-weight: 900;
    color: #29414C;
    margin-bottom: 8px;
}

.kpi-change {
    font-size: 0.9em;
    color: #6B665F;
    font-weight: 600;
}

.kpi-change.positive {
    color: #258843;
}

.kpi-change.negative {
    color: #E52B2A;
}

.kpi-change.neutral {
    color: #6B665F;
}

/* Score Display */
.score-container {
    background: white;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(41, 65, 76, 0.08);
    border-left: 4px solid #4E767D;
}

.score-display {
    text-align: center;
    margin-bottom: 30px;
}

.score-value {
    font-size: 4em;
    font-weight: 900;
    color: #29414C;
}

.score-label {
    color: #6B665F;
    font-size: 1.1em;
    margin-top: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Utilization Score Bar */
.utilization-bar-wrapper {
    margin: 30px auto;
    max-width: 900px;
    position: relative;
    padding-top: 30px;
}

.utilization-bar {
    position: relative;
    height: 50px;
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.utilization-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8em;
    position: relative;
}

.utilization-indicator {
    position: absolute;
    top: 5px;
    transform: translateX(-50%);
    z-index: 100;
}

.utilization-triangle {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 22px solid #000000;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.utilization-legend {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.utilization-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    font-weight: 600;
}

.utilization-legend-color {
    width: 20px;
    height: 20px;
    border-radius: 3px;
}

/* Filters */
.filters-container {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 0.85em;
    color: #4E767D;
    margin-bottom: 5px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

select {
    padding: 8px 12px;
    border: 2px solid #C6BFBA;
    background: white;
    color: #29414C;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

select:hover, select:focus {
    border-color: #4E767D;
    outline: none;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.chart-container {
    background: white;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(41, 65, 76, 0.08);
    transition: all 0.3s ease;
    border-top: 3px solid #4E767D;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(41, 65, 76, 0.12);
}

.chart-title {
    font-size: 1em;
    font-weight: 900;
    color: #29414C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.chart-canvas {
    position: relative;
    height: 250px;
}

/* Tables */
.table-container {
    background: white;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(41, 65, 76, 0.08);
    overflow-x: auto;
    border-top: 3px solid #4E767D;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #29414C;
    color: white;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9e9e9;
}

th {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85em;
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: #f8f8f8;
}

tbody tr.excluded-row {
    opacity: 0.45;
}

tbody tr.excluded-row td {
    text-decoration: line-through;
    text-decoration-color: #999;
}

tbody tr.excluded-row td:first-child {
    text-decoration: none;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-open { background: #5A8E9C; color: white; }
.status-closed { background: #2D8A4E; color: white; }
.status-pending { background: #D4AE2F; color: #29414C; }
.status-new { background: #2E777E; color: white; }

/* Priority badges */
.priority-high { background: #E52B2A; color: white; }
.priority-medium { background: #D4AE2F; color: #29414C; }
.priority-low { background: #2D8A4E; color: white; }

/* Opportunities Section */
.opportunities-list {
    background: white;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(41, 65, 76, 0.08);
    border-top: 3px solid #4E767D;
    position: relative;
}

.opportunities-list ol {
    margin-left: 20px;
    line-height: 2;
    color: #55534F;
}

.opportunities-list li {
    margin-bottom: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.opportunities-list li:hover {
    color: #4E767D;
}

/* Buttons */
.btn-primary {
    background: #4E767D;
    color: white;
    border: none;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    background: #5a8891;
}

.btn-icon {
    padding: 8px 16px;
    font-size: 1.2em;
}

/* Print Button */
.print-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #4E767D;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(41, 65, 76, 0.3);
    transition: all 0.3s ease;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
}

.print-button:hover {
    background: #5a8891;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(41, 65, 76, 0.4);
}

.print-button svg {
    width: 24px;
    height: 24px;
    fill: white;
}

/* Checkbox styling */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4E767D;
}

/* Flyout Form */
.flyout-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(41, 65, 76, 0.8);
    z-index: 10000 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.flyout-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.flyout-panel {
    position: fixed !important;
    right: -450px;
    top: 0 !important;
    bottom: 0 !important;
    width: 450px;
    max-width: 100%;
    background: white;
    box-shadow: -4px 0 20px rgba(41, 65, 76, 0.3);
    transition: right 0.3s ease;
    z-index: 10001 !important;
    display: flex;
    flex-direction: column;
}

.flyout-overlay.active .flyout-panel {
    right: 0;
}

.flyout-header {
    background: #29414C;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.flyout-title {
    font-size: 1.2em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.flyout-close {
    background: none;
    border: none;
    color: #C6BFBA;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    line-height: 1;
}

.flyout-close:hover {
    color: white;
}

.flyout-body {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

.flyout-wide {
    width: 520px;
    right: -520px;
}

/* Metrics Help Flyout */
.help-section {
    margin-bottom: 24px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section-title {
    font-size: 0.85em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4E767D;
    margin: 0 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #E8E6E3;
}

.help-item {
    margin-bottom: 14px;
}

.help-item:last-child {
    margin-bottom: 0;
}

.help-item-name {
    font-weight: 700;
    font-size: 0.88em;
    color: #29414C;
    margin-bottom: 2px;
}

.help-item-desc {
    font-size: 0.82em;
    color: #55534F;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85em;
    font-weight: 900;
    color: #4E767D;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 2px solid #C6BFBA;
    font-family: inherit;
    font-size: 0.95em;
    color: #29414C;
    transition: border-color 0.2s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #4E767D;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.flyout-footer {
    padding: 20px;
    border-top: 1px solid #C6BFBA;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.btn-secondary {
    background: #938C85;
    color: white;
    border: none;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-secondary:hover {
    background: #a39c95;
}

.btn-danger {
    background: #E52B2A;
    color: white;
    border: none;
    padding: 10px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-right: auto;
}

.btn-danger:hover {
    background: #f03938;
}

/* Validation Messages */
.validation-message {
    color: #E52B2A;
    font-size: 0.85em;
    margin-top: 5px;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination-btn {
    background: #4E767D;
    color: white;
    border: none;
    padding: 8px 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

.pagination-btn:hover:not(:disabled) {
    background: #5a8891;
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    background: #938C85;
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-pages {
    display: flex;
    gap: 5px;
}

.pagination-page {
    background: white;
    color: #29414C;
    border: 2px solid #C6BFBA;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9em;
    min-width: 40px;
    border-radius: 4px;
}

.pagination-page:hover {
    border-color: #4E767D;
    background: #f8f8f8;
}

.pagination-page.active {
    background: #4E767D;
    color: white;
    border-color: #4E767D;
}

.pagination-info {
    color: #6B665F;
    font-size: 0.9em;
    font-weight: 600;
    margin-left: 10px;
}

@media (max-width: 768px) {
    .pagination {
        font-size: 0.85em;
    }

    .pagination-btn,
    .pagination-page {
        padding: 6px 10px;
        font-size: 0.85em;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        margin: 10px 0 0 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        padding: 0 20px;
    }

    .kpi-container {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-title {
        font-size: 1.2em;
    }

    table {
        font-size: 0.85em;
    }

    .score-value {
        font-size: 3em;
    }

    .flyout-panel,
    .flyout-wide {
        width: 100%;
        right: -100%;
    }

    .filter-panel {
        width: 100%;
        right: -100%;
    }

    .badge-label {
        max-width: 120px;
        font-size: 0.75em;
    }

    .badge-period {
        font-size: 0.7em;
    }

    .badge-icon {
        font-size: 1em;
    }

    .header-content {
        padding: 0 15px;
    }

    .logo-image {
        height: 35px;
    }
}

/* Section Error State */
.section-error {
    background: white;
    border-left: 4px solid #E52B2A;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(41, 65, 76, 0.08);
    margin-bottom: 20px;
}

.section-error-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #E52B2A;
    color: white;
    font-size: 1.5em;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.section-error-message {
    color: #55534F;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Confirm Dialog */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(41, 65, 76, 0.8);
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    background: white;
    width: 420px;
    max-width: 90%;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(41, 65, 76, 0.3);
    overflow: hidden;
}

.confirm-header {
    background: #29414C;
    color: white;
    padding: 16px 20px;
}

.confirm-title {
    margin: 0;
    font-size: 1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confirm-body {
    padding: 25px 20px;
}

.confirm-message {
    color: #55534F;
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0;
}

.confirm-footer {
    padding: 16px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-top: 1px solid #C6BFBA;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(41, 65, 76, 0.2);
    background: white;
    border-left: 4px solid;
    pointer-events: all;
    animation: toast-slide-in 0.3s ease;
}

.toast-success { border-left-color: #258843; }
.toast-success .toast-icon { color: #258843; }
.toast-error { border-left-color: #E52B2A; }
.toast-error .toast-icon { color: #E52B2A; }
.toast-warning { border-left-color: #D4AE2F; }
.toast-warning .toast-icon { color: #D4AE2F; }
.toast-info { border-left-color: #4E767D; }
.toast-info .toast-icon { color: #4E767D; }

.toast-icon {
    font-size: 1.2em;
    font-weight: 900;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 0.9em;
    color: #29414C;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.85em;
    color: #55534F;
    line-height: 1.4;
}

.toast-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 3px 10px;
    font-size: 0.78em;
    color: #4E767D;
    background: #F0F0EE;
    border: 1px solid #D0CEC9;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.toast-copy-btn:hover {
    background: #E0DFDC;
    color: #29414C;
}

.toast-dismiss {
    background: none;
    border: none;
    color: #938C85;
    font-size: 1.3em;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
}

.toast-dismiss:hover {
    color: #29414C;
}

@keyframes toast-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Toast Test Panel */
.toast-test-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10003;
    background: white;
    border: 1px solid #D0CEC9;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(41, 65, 76, 0.15);
    padding: 12px 16px;
    max-width: 320px;
}

.toast-test-header {
    font-size: 0.85em;
    color: #29414C;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #E8E6E3;
}

.toast-test-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-toast-test {
    padding: 5px 12px;
    font-size: 0.78em;
    border: 1px solid #D0CEC9;
    border-radius: 3px;
    cursor: pointer;
    color: white;
    font-weight: 600;
}

.btn-toast-test.success { background: #258843; }
.btn-toast-test.info { background: #4E767D; }
.btn-toast-test.warning { background: #D4AE2F; color: #29414C; }
.btn-toast-test.error { background: #E52B2A; }
.btn-toast-test:hover { opacity: 0.85; }

/* Section Navigation */
html {
    scroll-behavior: smooth;
}

.section-nav {
    position: sticky;
    top: 90px;
    z-index: 90;
    background: white;
    border-bottom: 1px solid #C6BFBA;
    padding: 12px 30px;
    display: flex;
    gap: 30px;
    justify-content: center;
}

.section-nav a {
    color: #4E767D;
    text-decoration: none;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.section-nav a:hover {
    color: #29414C;
    border-bottom-color: #29414C;
}

section {
    scroll-margin-top: 140px;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 0;
    margin-bottom: 10px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid #C6BFBA;
    padding: 5px 12px;
    font-size: 0.82em;
    font-weight: 600;
    color: #29414C;
    border-radius: 20px;
}

.chip-clear {
    background: none;
    border: none;
    color: #938C85;
    font-size: 1.1em;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.2s ease;
}

.chip-clear:hover {
    color: #E52B2A;
}

.chip-clear-all {
    background: #f5f5f5;
    border: 1px dashed #C6BFBA;
    color: #4E767D;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82em;
    padding: 5px 14px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.chip-clear-all:hover {
    background: #E52B2A;
    color: white;
    border-color: #E52B2A;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 50px 30px;
    background: white;
    border: 2px dashed #C6BFBA;
    margin-bottom: 20px;
}

.empty-state-icon {
    font-size: 2.5em;
    margin-bottom: 12px;
    opacity: 0.6;
}

.empty-state-message {
    color: #6B665F;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 16px;
}

.chart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #6B665F;
    font-weight: 600;
    font-size: 0.9em;
}

.chart-empty-icon {
    font-size: 2em;
    margin-bottom: 8px;
    opacity: 0.5;
}

/* AI Narrative Box */
.narrative-box {
    background: white;
    border-left: 4px solid #4E767D;
    padding: 20px 25px;
    box-shadow: 0 2px 8px rgba(41, 65, 76, 0.08);
    margin-bottom: 30px;
}

.narrative-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
    font-weight: 900;
    color: #4E767D;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.narrative-header i {
    font-size: 1.1em;
}

.narrative-text {
    color: #55534F;
    font-size: 0.95em;
    line-height: 1.7;
    margin: 0;
}

/* Skeleton Loading Animation */
.narrative-box.skeleton .skeleton-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, #e8e6e3 25%, #f0efed 50%, #e8e6e3 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Tablet Breakpoint */
@media (max-width: 1024px) and (min-width: 769px) {
    .kpi-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }

    .dashboard-title {
        font-size: 1.4em;
    }

    .filter-panel {
        width: 300px;
        right: -300px;
    }

    .filter-panel.open {
        right: 0;
    }

    .table-container {
        overflow-x: auto;
    }
}

/* Print Styles */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        animation-duration: 0s !important;
        animation-delay: 0s !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }

    body {
        background: white !important;
        font-size: 10pt;
        color: #000;
    }

    /* Hide dashboard header completely */
    .header-bar {
        display: none !important;
    }

    /* Hide interactive elements */
    .filter-badge,
    .filter-panel,
    .filter-overlay,
    .btn-primary,
    .btn-icon,
    .print-button,
    .filters-container,
    .pagination,
    .hamburger-btn {
        display: none !important;
    }

    /* Dashboard container */
    .dashboard-container {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }

    /* Page settings - Reduced margins to fit more charts */
    @page {
        margin: 0.2in 0.3in;
        size: letter landscape;
    }

    /* Ensure first section doesn't have page break */
    .section:first-of-type {
        page-break-before: avoid;
        margin-bottom: 10px;
    }

    /* Section styling */
    .section {
        page-break-inside: avoid;
        margin-bottom: 12px;
    }

    .section-title {
        font-size: 1em;
        margin-bottom: 8px;
        color: #29414C !important;
        page-break-after: avoid;
    }

    /* KPI Boxes - Smaller and fit on one row */
    .kpi-container {
        page-break-inside: avoid;
        margin-bottom: 10px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .kpi-box {
        page-break-inside: avoid;
        border: 1px solid #C6BFBA !important;
        box-shadow: none !important;
        padding: 8px;
        background: white !important;
        margin-bottom: 0;
    }

    .kpi-box::before {
        display: none;
    }

    .kpi-title {
        color: #4E767D !important;
        font-size: 0.6em;
        margin-bottom: 4px;
    }

    .kpi-value {
        color: #29414C !important;
        font-size: 1.4em;
        margin-bottom: 2px;
    }

    .kpi-change {
        font-size: 0.65em;
    }

    /* Performance Metrics subsection */
    .subsection-title {
        font-size: 0.75em;
        color: #4E767D !important;
        margin-bottom: 6px;
        margin-top: 0;
        page-break-after: avoid;
    }

    /* Charts - Smaller and optimized to fit 4 on first page */
    .charts-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 10px;
        page-break-inside: auto;
    }

    .chart-container {
        page-break-inside: avoid;
        border: 1px solid #C6BFBA !important;
        box-shadow: none !important;
        padding: 10px;
        background: white !important;
        overflow: hidden !important;
    }

    /* Keep first 4 charts together on first page */
    .chart-container:nth-child(1),
    .chart-container:nth-child(2),
    .chart-container:nth-child(3),
    .chart-container:nth-child(4) {
        page-break-after: avoid;
    }

    /* Force page break before 5th chart */
    .chart-container:nth-child(5) {
        page-break-before: always;
    }

    .chart-title {
        font-size: 0.8em;
        margin-bottom: 6px;
        color: #29414C !important;
    }

    .chart-canvas {
        height: 160px !important;
        max-height: 160px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .chart-canvas canvas {
        max-width: 100% !important;
        max-height: 160px !important;
        height: auto !important;
    }

    /* Tables */
    .table-container {
        page-break-inside: avoid;
        border: 1px solid #C6BFBA !important;
        box-shadow: none !important;
        padding: 15px;
        background: white !important;
        overflow: visible;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
    }

    thead {
        background: #29414C !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    th {
        padding: 10px 8px;
        font-size: 8pt;
        border: 1px solid #C6BFBA;
    }

    td {
        padding: 8px 6px;
        border: 1px solid #e9e9e9;
    }

    tbody tr:nth-child(even) {
        background: #f8f8f8 !important;
    }

    /* Status badges */
    .status-badge {
        padding: 3px 8px;
        font-size: 7pt;
        border-radius: 3px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .status-open { background: #5A8E9C !important; color: white !important; }
    .status-closed { background: #2D8A4E !important; color: white !important; }
    .status-pending { background: #D4AE2F !important; color: #29414C !important; }
    .status-new { background: #2E777E !important; color: white !important; }

    .priority-high { background: #E52B2A !important; color: white !important; }
    .priority-medium { background: #D4AE2F !important; color: #29414C !important; }
    .priority-low { background: #2D8A4E !important; color: white !important; }

    /* Score container */
    .score-container {
        page-break-inside: avoid;
        border: 1px solid #C6BFBA !important;
        box-shadow: none !important;
        padding: 20px;
        background: white !important;
    }

    .score-display {
        margin-bottom: 20px;
    }

    .score-value {
        font-size: 3em;
        color: #29414C !important;
    }

    .score-label {
        color: #6B665F !important;
    }

    /* Utilization bar */
    .utilization-bar-wrapper {
        page-break-inside: avoid;
        margin: 20px auto;
    }

    .utilization-bar {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .utilization-segment {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .utilization-legend {
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 15px;
    }

    .utilization-legend-item {
        font-size: 8pt;
    }

    .utilization-legend-color {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Opportunities */
    .opportunities-list {
        page-break-inside: avoid;
        border: 1px solid #C6BFBA !important;
        box-shadow: none !important;
        background: white !important;
    }

    .opportunities-list ol {
        font-size: 9pt;
    }

    .opportunities-list li {
        margin-bottom: 8px;
    }

    /* Print header */
    .print-header {
        page-break-inside: avoid;
        page-break-after: avoid;
        margin-bottom: 15px;
        padding-bottom: 12px;
        border-bottom: 2px solid #29414C;
        background: white;
        display: none; /* Hidden by default, shown in print mode */
    }

    /* Hide new UI elements in print */
    .section-nav,
    .filter-chips,
    .toast-container,
    .section-error,
    .narrative-box.skeleton {
        display: none !important;
    }

    .narrative-box {
        border: 1px solid #C6BFBA !important;
        box-shadow: none !important;
        padding: 12px 16px;
        margin-bottom: 10px;
        page-break-inside: avoid;
    }

    .narrative-header {
        font-size: 0.7em;
        margin-bottom: 6px;
    }

    .narrative-text {
        font-size: 0.85em;
    }

    /* Hide ticket data table in print */
    #tickets .table-container,
    #tickets .filters-container,
    #tickets .pagination {
        display: none !important;
    }

    /* Utilization charts: force 3 per row */
    #utilization .charts-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Remove pointer cursor on opportunities in print */
    .opportunities-list li {
        cursor: default !important;
    }

    /* Updated status badge contrast for print */
    .status-open { background: #5A8E9C !important; color: white !important; }
    .status-closed { background: #2D8A4E !important; color: white !important; }
    .status-pending { background: #D4AE2F !important; color: #29414C !important; }
    .priority-medium { background: #D4AE2F !important; color: #29414C !important; }
    .priority-low { background: #2D8A4E !important; color: white !important; }

    /* Show print header when in print mode */
    body:has(.dashboard-container.print-mode) .print-header {
        display: block !important;
    }
}

.dashboard-container.print-mode .print-button {
    display: none !important;
}

.dashboard-container.print-mode .filters-container {
    display: none !important;
}

.dashboard-container.print-mode .pagination {
    display: none !important;
}

.dashboard-container.print-mode .score-container table th:first-child,
.dashboard-container.print-mode .score-container table td:first-child {
    display: none !important;
}

/* =============================================
   Chart Drilldown Modal Styles
   ============================================= */

.drilldown-panel {
    max-width: 900px;
    width: 90vw;
}

.drilldown-summary {
    background: #f5f5f5;
    padding: 10px 16px;
    margin-bottom: 16px;
    border-left: 4px solid #4E767D;
    font-weight: 600;
    color: #29414C;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drilldown-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 0.85em;
    font-weight: 600;
    color: #29414C;
    background: white;
    border: 1px solid #D0CEC9;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.drilldown-export-btn:hover {
    background: #E8E6E3;
    border-color: #29414C;
}

.drilldown-table-container {
    overflow-x: auto;
}

.drilldown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.drilldown-table thead th {
    background: #29414C;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.drilldown-table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #e9e9e9;
}

.drilldown-table tbody tr:hover {
    background-color: #f0f7f8;
}

.drilldown-table tbody tr.expanded {
    background-color: #e8f0f2;
}

.drilldown-table td {
    padding: 8px 12px;
    color: #29414C;
    vertical-align: top;
}

.drilldown-table .description-cell {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.drilldown-table tbody tr:hover .description-cell {
    white-space: normal;
}

.detail-row {
    cursor: default !important;
    background: #f9fafb !important;
    border-top: 2px solid #4E767D;
}

.detail-row:hover {
    background: #f9fafb !important;
}

.detail-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    padding: 8px 0;
}

.detail-field {
    display: flex;
    flex-direction: column;
}

.detail-field-full {
    grid-column: 1 / -1;
}

.detail-field-full .detail-value {
    white-space: pre-line;
    font-weight: 400;
    line-height: 1.6;
}

.detail-label {
    font-size: 0.72em;
    font-weight: 900;
    color: #4E767D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.detail-value {
    color: #29414C;
    font-weight: 600;
    font-size: 0.9em;
}

.drilldown-empty {
    text-align: center;
    padding: 40px 20px;
    color: #938C85;
}

.drilldown-empty p {
    font-size: 1em;
    margin: 0;
}

@media (max-width: 768px) {
    .drilldown-panel {
        width: 100vw;
        max-width: 100vw;
    }

    .drilldown-table {
        font-size: 0.78em;
    }

    .detail-content {
        grid-template-columns: 1fr 1fr;
    }
}

/* =============================================
   Multi-Select Dropdown
   ============================================= */

.multi-select-dropdown {
    position: relative;
}

.multi-select-trigger {
    width: 100%;
    padding: 12px;
    border: 2px solid #C6BFBA;
    background: white;
    color: #29414C;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.multi-select-trigger:hover {
    border-color: #4E767D;
}

.multi-select-arrow {
    font-size: 0.8em;
    color: #938C85;
}

.multi-select-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border: 2px solid #4E767D;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(41, 65, 76, 0.15);
    max-height: 350px;
    display: flex;
    flex-direction: column;
    margin-top: -2px;
}

.multi-select-search {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #e9e9e9;
    font-family: inherit;
    font-size: 0.9em;
    color: #29414C;
    outline: none;
    box-sizing: border-box;
}

.multi-select-search::placeholder {
    color: #938C85;
}

.multi-select-actions {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #e9e9e9;
}

.multi-select-actions button {
    background: none;
    border: 1px solid #C6BFBA;
    color: #4E767D;
    font-size: 0.78em;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.multi-select-actions button:hover {
    background: #4E767D;
    color: white;
    border-color: #4E767D;
}

.multi-select-options {
    overflow-y: auto;
    max-height: 250px;
    padding: 4px 0;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.9em;
    color: #29414C;
    font-weight: 600;
}

.multi-select-option:hover {
    background: #f0f7f8;
}

.multi-select-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

@media print {
    .multi-select-dropdown,
    .multi-select-panel {
        display: none !important;
    }
}
