:root {
    /* Orange Color Variables - SINGLE SOURCE OF TRUTH */
    --orange: #FF8605;
    --orange-rgb: 255, 134, 5;  /* RGB values for rgba() usage */
    --orange-dark: #e67700;
    --orange-fade: #FF8605aa;
    --orange-fade-light: #FF860566;
    --orange-fade-medium: #FF860599;
    --orange-fade-dark: #FF8605dd;
    --primary-gradient: linear-gradient(90deg, var(--orange), #FFD700);
    --orange-gradient-light: linear-gradient(135deg, var(--orange-fade-light) 0%, var(--orange-fade-dark) 100%);
    --orange-gradient-medium: linear-gradient(135deg, var(--orange-fade-medium) 0%, var(--orange) 100%);
    
    --dark-grey: #2A2A2A;
    --text-color: #2A2A2A;
    --light-grey: #F5F5F5;
    --side-bar-width: 260px;
    --transition-speed: 0.2s;
    --menu-item-height: 42px;
    --sidebar-padding: 1.5rem;
    --primary-color: #4a90e2;
    --secondary-color: #2c3e50;
    --danger-color1: #e74c3c;
    --danger-color2: #c0392b;
    --background-color: #f5f6fa;
    --card-background: #ffffff;

    --accent-color: var(--orange);
    --supporting-text: #9DA1A6;
    --primary-text: #404446;
    --light-blue-gray: #D8DEE9;
    --medium-blue-gray: #B8C2CC;

    --header-height: 70px;
    --content-max-width: 1200px;
    --card-radius: 8px;
    --spacing-unit: 16px;

    --negative-color: #ff4d4f;
    --positive-color: #52c41a;
    --neutral-color: #1890ff;
    --font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;

    --scale: calc(100vw / 1150);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background: url('/static/images/paper.jpg') no-repeat center center fixed;
    background-size: cover;
    height: 100vh;
    color: var(--secondary-color);
}

.header {
    position: fixed;
    top: 0;
    width: 100%;
    grid-area: header;
    border: none;
    background: var(--card-background);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

h2 {
    padding-bottom: 10px;
    font-size: 24px;
    font-weight: 600;
    color: #374151;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin: 0 0 5px 0;
}

h3 {
    padding-bottom: 10px;
    font-size: 20px;
    font-weight: 600;
    color: #374151;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin: 0 0 5px 0;
}

p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

.flex-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.gap-med {
    gap: 12px 16px;
}

.gap-large {
    gap: 16px 32px;
}

.bottom-marg-med {
   margin-bottom: 20px;
}

.bottom-line {
    border-bottom: 2px solid #e9ecef;
    margin: 0 0 20px 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: var(--header-height);
    max-width: 100%;
}

a {
    text-decoration: none;
}

hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1.5rem 0;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    padding: 1rem;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.site-title-container {
    display: flex;
    align-items: center;
}

.site-logo {
    height: 55px;
    margin-right: 30px;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-grey);
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 0.02em;
}

/* Navigation Right Section */
.nav-right-section {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Top Navigation Links Styles */
.metric-search-nav,
.pdf-report-nav {
    display: flex;
    align-items: center;
}

.metric-search-link,
.pdf-report-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 12px;
    color: var(--dark-grey);
    text-decoration: none;
    border-radius: 10px;
    transition: background-color var(--transition-speed);
    font-weight: 500;
    font-size: 0.9rem;
}

.metric-search-link:hover,
.pdf-report-link:hover {
    background-color: var(--light-grey);
    color: var(--dark-grey);
}

.metric-search-link.active,
.pdf-report-link.active {
    background-color: var(--orange);
    color: white;
}

.metric-search-link i,
.pdf-report-link i {
    font-size: 20px;
}

.user-menu {
    position: relative;
    z-index: 100;
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.simple-button {
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background-color: #fff;
}

.simple-button:hover {
    background-color: #e5e7eb;
    cursor: pointer;
}

.simple-button > i {
    color: var(--dark-grey);
}

@media (hover: hover) {
    .user-menu-button:hover {
        background-color: var(--light-grey);
    }
}

.user-avatar-img {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.menu-arrow {
    font-size: 0.875rem;
    transition: transform var(--transition-speed);
}

.user-menu-button[aria-expanded="true"] .menu-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: fixed;
    top: var(--header-height);
    border: solid 1px #ededed;
    border-right: none;
    right: 0;
    min-width: 14rem;
    padding: 0.5rem;
    background: var(--card-background);
    border-radius: 0 0 0 0.7rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
    z-index: 101;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    color: var(--dark-grey);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background-color var(--transition-speed);
}

@media (hover: hover) {
    .dropdown-item:hover {
        background-color: var(--light-grey);
    }
}

.dropdown-item i {
    width: 1rem;
    text-align: center;
    color: #6B7280;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid var(--light-grey);
}

.logo {
    padding: 0 2rem;
    margin-bottom: 3rem;
    font-size: 1.5rem;
    color: var(--orange);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metric-label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
    opacity: 1;
    color: #374151;
    flex: 1;
}

.positive {
    color: var(--positive-color);
}

.negative {
    color: var(--negative-color);
}

.neutral {
    color: var(--neutral-color);
}

.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.img-generic {
    max-width: 100%;
    height: auto;
}

.main-content {
    margin-top: var(--header-height);
    padding: 25px 20px 25px 20px;
    margin-left: auto;
    margin-right: auto;
}

.menu-space {
    padding: 25px 20px 25px 95px;
}

.max-width-large {
    max-width: 1800px;
}

.max-width-med {
    max-width: 1400px;
}

.max-width-small {
    max-width: 1000px;
}

.max-width-tiny {
    max-width: 700px;
}

#profile-picture {
    display: flex;
    justify-content: center;
    object-fit: cover;
    border-radius: 50%
}

.avatar {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.profile-container {
    padding-left: 45px;
    max-width: 1200px;
    margin: 0 auto;
}

.graph-container {
    max-width: 1800px;
    padding-left: 50px;
    margin-left: auto;
    margin-right: auto;
}

.ewd-side-nav {
    position: fixed;
    left: 20px;
    top: calc(var(--header-height) + 20px);
    transform: none;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.ewd-side-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-text);
    cursor: pointer;
    padding: 14px 14px 14px 12px;
    border-radius: 8px;
    background-color: white;
    white-space: nowrap;
    width: 55px;
    overflow: hidden;
    transition:
        width 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.15),
        color 0.3s ease,
        background-color 0.3s ease;
    border: 1.5px solid rgba(0, 0, 0, 0.15);
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.ewd-side-nav-icon {
    width: 30px;
    height: 30px;
    padding-top: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    font-size: 1.45rem;
}

.ewd-side-nav-label {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ewd-side-nav-item.active {
    opacity: 1;
    color: var(--accent-color);
}

@media (hover: hover) {
    .ewd-side-nav-item:hover {
        opacity: 1;
        color: var(--accent-color);
    }

    .ewd-side-nav:hover .ewd-side-nav-item {
        width: 175px;
        box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.3);
    }
    .ewd-side-nav:hover .ewd-side-nav-add-button {
        background-color: #fff !important;
    }

    .ewd-side-nav:hover .ewd-side-nav-label {
        opacity: 1;
    }
}

.ewd-side-nav-add-button {
    border: 2px dashed rgba(0, 0, 0, 0.3) !important;
    background-color: rgba(0, 0, 0, 0.02) !important;
}

.ewd-side-nav-add-button:hover {
    border-color: var(--accent-color) !important;
}

.ewd-side-nav-disabled {
    border: 2px dashed rgba(0, 0, 0, 0.15) !important;
    background-color: rgba(0, 0, 0, 0.02) !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
}

.ewd-side-nav-disabled:hover {
    border-color: rgba(0, 0, 0, 0.15) !important;
    background-color: rgba(0, 0, 0, 0.02) !important;
}

.entity-metrics-container {
    padding: 8px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-top: 1.5rem;
}

.alternative-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: 1px solid currentColor;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

@media (hover: hover) {
    .alternative-button:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-grey);
    font-weight: 500;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--orange);
    color: var(--card-background);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: var(--dark-grey);
}

.btn-danger {
    background-color: var(--danger-color1);
    color: white;
}

@media (hover: hover) {
    .btn-primary:hover {
        background: var(--orange-dark);
    }
    .btn-secondary:hover {
        background-color: #cbd5e1;
        outline: none;
    }
    .btn-danger:hover {
        background-color: var(--danger-color2);
    }
}

.btn-secondary:focus {
    background-color: #cbd5e1;
    outline: none;
}

.basic-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background-color: #fff;
    /*overflow-x: hidden;*/
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.app-card {
    background: var(--card-background);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}


.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.95rem;
    color: var(--dark-grey);
    background-color: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
    outline: none;
}

.pg-button-secondary,
.pg-button-primary {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: white;
    background: var(--orange-gradient-light);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) {
    .pg-button-secondary:hover,
    .pg-button-primary:hover {
        background: var(--orange-gradient-medium);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    }
}

.pg-columns {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.pg-column {
    width: 100%;
}

.pg-column-one-quarter {
    text-align: center;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.my-2 {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.pg-button-danger {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: white;
    background-color: var(--danger-color1);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    width: auto;
}

@media (hover: hover) {
    .pg-button-danger:hover {
        background-color: var(--danger-color2);
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    width: 95%;
    max-width: 500px;
    margin: 1.75rem auto;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-grey);
    margin: 0;
}

.btn-close {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    opacity: 0.5;
    font-size: 1.5rem;
    line-height: 1;
}

@media (hover: hover) {
    .btn-close:hover {
        opacity: 1;
    }
}

.modal-body {
    padding: 1.5rem;
    color: var(--dark-grey);
    line-height: 1.5;
}

.modal-body em {
    font-style: normal;
    color: var(--dark-grey);
}

.modal-body strong {
    font-weight: 600;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.back-link {
    color: var(--orange);
}

@media (hover: hover) {
    .back-link:hover {
        color: var(--primary-color);
    }
}

@media (hover: hover) {
    .pg-button-light:hover {
        color: var(--orange);
        cursor: pointer;
    }
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (hover: hover) {
    .action-btn:hover {
        background-color: #f0f0f0;
    }
}

.action-btn i {
    font-size: 14px;
    color: #555;
}


.tooltip-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.tooltip-body {
    font-size: 16px;
    margin-bottom: 5px;
}

.tooltip-footer {
    font-size: 15px;
    font-weight: bold;
}

.control-group label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}





input[type="range"] {
    width: 120px;
    height: 4px;
    background: linear-gradient(to right, #64748b 0%, #64748b 50%, #e2e8f0 50%, #e2e8f0 100%);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #64748b, #475569);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(100, 116, 139, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
    transition: all 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.4), 0 2px 6px rgba(0, 0, 0, 0.15);
}


.legend-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.legend-group label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
}

.compact-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid #d1d5db;
}

.legend-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
}

.metric-viewer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


.metric-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.section-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.increasing .section-header {
    background: #f0f9ff;
    color: #0369a1;
    border-left: 4px solid #0284c7;
}

.stable .section-header {
    background: #f8fafc;
    color: #475569;
    border-left: 4px solid #64748b;
}

.decreasing .section-header {
    background: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #ef4444;
}



.metrics-list-orig {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.metrics-list {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2px 4px 2px 4px;
}

.empty-metrics-message {
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    font-style: italic;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    margin: 20px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.list-and-chart {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    min-height: 0;
    height: 100%;
}


.subject-area-item {
    margin: 0 0 10px 0;
}

.subject-area-header {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-item {
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    font-size: 14px;
    color: #4a5568;
}

.metric-heart {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.heart-icon {
    font-size: 14px;
    color: #9ca3af88;
    cursor: pointer;
}

.heart-icon:hover {
    color: var(--orange-fade);
}

.heart-icon.favorited {
    color: var(--orange-fade);
}

.heart-icon.favorited::before {
    content: "\f004"; /* fa-heart (filled) */
}

.heart-icon:not(.favorited)::before {
    content: "\f08a"; /* fa-heart-o (outline) */
}

/* Hide heart icon in edit mode */
.edit-mode .metric-heart {
    display: none;
}

.metric-tab {
    background-color: #fff;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s ease;
    padding: 16px 20px;
    border: 1px solid #e7e7e7;
    border-left: 3px solid transparent;
    box-shadow: -1px 2px 6px rgba(0, 0, 0, 0.1);
}

.metric-tab-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

  .metric-tab2 {
    padding: 16px 20px;
    background: #f8f8f8;
    text-align: left;
    font-size: 14px;
    color: #374151cc;
    min-height: 56px;
    display: flex;
    align-items: center;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    border: 1px solid #dedede;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-weight: 500;
    position: relative;
}

.metric-tab2:hover {
    background: #f0f0f0;
    border-color: #cdcdcd;
}

.metric-tab2.active {
    background: #ffffff;
    color: #374151;
    border: 1px solid rgba(var(--orange-rgb), 0.53);
    border-left: 3px solid rgba(var(--orange-rgb), 0.67);
}

.metric-financial-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    border: none;
    background-color: #fff;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #4a5568;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.subject-area-item:hover,
.metric-item:hover {
    background: #fff;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
}

.metric-item:hover span {
    color: #000;
}

.metric-change-arrow {
    font-size: 0.8rem;
    color: var(--orange);
    opacity: 0.75;
    pointer-events: none;
    transition: none;
}

.metric-item:hover .metric-change-arrow {
    color: var(--orange);
}

.subject-area-item.active,
.metric-item.active {
    background: #ffffff;
    border: 1px solid var(--orange-fade);
    border-left: 3px solid var(--orange-fade);
}

.metric-financial-item:hover {
    background-color: #f8f8f8;
}

.increasing .metric-financial-item.active {
    background: rgba(2, 132, 199, 0.1);
    color: #0369a1;
    border-left: 3px solid #0284c7;
}

.stable .metric-financial-item.active {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
    border-left: 3px solid #64748b;
}

.decreasing .metric-financial-item.active {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    border-left: 3px solid #ef4444;
}

.metric-financial-item:last-child {
    border-bottom: none;
}

.sparkline-container {
    width: 80px;
    height: 24px;
    margin-left: 12px;
}

.sparkline {
    width: 100%;
    height: 100%;
}

.persistent-tooltip-canvas-wrap {
    height: 140px;
}

.simple-line-container {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.pad-large {
    padding: 30px;
}

.pad-med {
    padding: 20px;
}

.pad-small {
    padding: 15px;
}

.pad-med-large {
    padding: 20px 30px;
}


.marg-top-large {
    margin-top: 60px;
}


/* Hover values display (moved from dashboard.html) */
.hover-values-display {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    min-height: auto;
    box-shadow: none;
    transition: none;
    position: relative;
}

.hover-values-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 6px;
    margin-bottom: 15px;
}

.hover-value-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    position: relative;
    min-height: 50px;
    justify-content: center;
    /*box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);*/
}

.hover-value-label {
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hover-value-number {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    /*letter-spacing: -0.025em;*/
    letter-spacing: -0.2px;
    text-align: center;
    line-height: 1.1;
}

.hover-value-subtitle {
    font-size: 8px;
    color: #676767;
    text-align: center;
    margin-top: 2px;
    font-weight: 500;
}

.primary-color {
    color: var(--orange);
}

/*.chart-section {*/
/*    flex: 1;*/
/*    !*min-width: 400px;*!*/
/*    !*height: 100%;*!*/
/*    !*overflow: hidden;*!*/
/*    !*background-color: #fff;*!*/
/*    !*border: 1px solid #e7e7e7;*!*/
/*    !*border-radius: 12px;*!*/
/*    margin-left: 4px;*/
/*}*/

.tweak-left {
    margin-left: 4px;
}

.category-chart-section {
    padding: 20px;
    background: white;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}

.category-chart-section {
    border-top: none;
}


.category-chart-wrapper {
    overflow: visible;
    flex: none;
    margin-bottom: 20px;
    position: relative;
    flex: 1;
    max-height: 290px;
}

.category-chart {
    width: 100% !important;
    height: 100% !important;
}

.category-chart-placeholder {
    text-align: center;
    color: #718096;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Chart legend (shared by line-chart-component) */
.category-legend {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 8px;
    z-index: 2;
    margin-bottom: 6px;
}

.category-legend .legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.chart-placeholder-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.chart-placeholder-subtitle {
    font-size: 14px;
    opacity: 0.7;
}

.chart-action-buttons {
    position: absolute;
    left: -10px;
    bottom: -10px;
    display: flex;
    flex-direction: row;
    gap: 6px;
    z-index: 3;
    align-items: flex-end;
}

.chart-action-buttons .ai-analysis-btn,
.chart-action-buttons .pdf-export-btn {
    position: static;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    padding: 2px 14px;
    background: #fff;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: background 0.1s, color 0.1s, border 0.1s;
    cursor: pointer;
    font-size: 1.08em;
    opacity: 0.98;
    font-weight: 500;
    gap: 4px;
}

.chart-action-buttons .ai-analysis-btn {
    border-color: rgba(2, 132, 199, 0.45);
    color: rgba(2, 132, 199, 0.65);
}

.chart-action-buttons .pdf-export-btn {
    border-color: rgba(var(--orange-rgb), 0.45);
    color: rgba(var(--orange-rgb), 0.65);
}

.chart-action-buttons .ai-analysis-btn:hover,
.chart-action-buttons .ai-analysis-btn:focus {
    background: #fff;
    border-color: #0284c7;
    color: #0284c7;
    opacity: 1;
}

.chart-action-buttons .pdf-export-btn:hover,
.chart-action-buttons .pdf-export-btn:focus {
    background: #fff;
    border-color: var(--orange);
    color: var(--orange);
    opacity: 1;
}

.chart-action-buttons .ai-analysis-btn[disabled],
.chart-action-buttons .pdf-export-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.chart-action-buttons .ai-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    animation: chart-action-ai-spin 0.8s linear infinite;
    vertical-align: middle;
    margin: 0 auto;
    box-shadow: none;
    border-width: 3px;
    border-style: solid;
}



@keyframes chart-action-ai-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.metric-rank-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #f8fafc;
    color: #878787;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid #f1f5f9;
    margin-right: 6px;
    vertical-align: middle;
    transition: background 0.2s, color 0.2s;
}

.increasing .metric-item.active .metric-rank-pill {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.stable .metric-item.active .metric-rank-pill {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.decreasing .metric-item.active .metric-rank-pill {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

.controls-section {
    margin-bottom: 24px;
}

.controls-grid {
    display: flex;
    gap: 32px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 20px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
}

.range-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.period-value {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    min-width: 90px;
}

input.period-slider[type="range"] {
    width: 160px;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(to right, #6b7280 0%, #6b7280 50%, #e5e7eb 50%, #e5e7eb 100%);
    outline: none;
    appearance: none;
    border: none;
    cursor: pointer;
}

input.period-slider[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6b7280;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}

input.period-slider[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6b7280;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
}

.peer-select {
    padding: 8px 16px;
    min-width: 200px;
    font-size: 14px;
    color: #1a1a1a;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    max-width: none;
    padding: 12px 16px 12px 36px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    background: #ffffff;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 12px;
}

.controls-grid .search-box {
    flex: 1 1 360px;
    min-width: 300px;
}

.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.pill-group .pill {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 9999px;
    padding: 6px 12px;
    font-size: 0.9rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill-group .pill:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.pill-group .pill.active {
    background: #6b7280;
    color: #fff;
    border-color: #6b7280;
}


.metric-viewer-columns {
    display: flex;
    gap: 0;
}

.metric-viewer-columns > .basic-card {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 0;
    min-width: 0;
}

.metric-viewer-columns > .metric-collection {
    flex-shrink: 0;
    width: auto;
}

.subject-areas-column {
    width: 250px;
    height: 100%;
    padding: 2px 4px 2px 4px;
    overflow-y: auto;
}

.metric-collection {
    display: flex;
    max-height: 700px;
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.subject-areas-column::-webkit-scrollbar,
.metrics-list-column::-webkit-scrollbar {
    width: 6px;
}

.subject-areas-column::-webkit-scrollbar-track,
.metrics-list-column::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.subject-areas-column::-webkit-scrollbar-thumb,
.metrics-list-column::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.subject-areas-column::-webkit-scrollbar-thumb:hover,
.metrics-list-column::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.metrics-list-column {
    /*flex: 0 0 300px;*/
    width: 300px;
    height: 100%;
    overflow-y: auto;
    border-bottom: 1px solid #e0e0e0;
}

.top-strip-list-and-chart-container {
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 32px;
    margin-top: 24px;
    width: 100%;
    box-sizing: border-box;
  }

.top-controls-collapse {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1250px) {
    .dashboard {
        max-width: none;
        transform: scale(0.9);
        transform-origin: top center;
        width: 110%;
        margin-left: -3%;
    }
}

@media (max-width: 1200px) {
    .tweak-left {
        margin: 0;
    }
    .metric-viewer-columns {
        flex-direction: column;
    }

    .metric-tab {
        background-color: #F8F8F8;
        padding: 16px 20px;
        border-left: 1px solid #e7e7e7;
        box-shadow: none;
    }

    .metric-tab:hover {
        background: #f0f0f0;
        border-color: #cdcdcd;
        box-shadow: none;
      }

    .metric-tab.active {
        background: #ffffff;
        color: #374151;
        border: 1px solid rgba(var(--orange-rgb), 0.53);
        border-left: 3px solid rgba(var(--orange-rgb), 0.67);
      }

    .metric-collection {
        background-color: #fff;
        border: 1px solid #e9ecef;
        border-radius: 12px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        padding: 16px 14px;
        display: flex;
        width: 100%;
        max-height: 400px;
        margin-bottom: 20px;
    }

    .subject-areas-column {
        flex: 1;
        min-width: 0;
    }

    .metrics-list-column {
        flex: 1;
        min-width: 0;
        border-bottom: none;
        padding-right: 3px;
    }

    /*there's more of these'*/
    .category-chart-wrapper {
        width: 100%;
    }

    .persistent-tooltip-section {
        width: 100%;
    }

    /*there's more of these'*/
    .category-chart-section {
        width: 100%;
        max-width: none;
    }

    .category-legend {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 1100px) {
    .dashboard {
        max-width: none;
        transform: scale(0.85);
        transform-origin: top center;
        width: 118%;
        margin-left: -7%;
    }

}

@media (max-width: 1024px) {
    .controls-grid .search-box {
        flex: 1 1 100%;
    }
}

@media (max-width: 950px) {
}

@media (max-width: 900px) {
    .entity-metrics-container {
        padding: 0;
    }

    .ewd-side-nav {
        left: 10px;
    }

}

@media (max-width: 768px) {

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 21px;
    }

    .list-and-chart {
      grid-template-columns: 1fr;
      gap: 24px;
    }

    .flex-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .pad-large {
        padding: 30px 25px;
    }

    .metric-viewer-container {
        grid-template-columns: 1fr;
    }

    .legend-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .compact-legend {
        gap: 12px;
    }

    .controls-grid {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .main-content {
        padding-right: 15px;
    }

    .header-content {
        padding: 0 1rem;
    }

    .chart-section {
        margin-top: 0;
    }

    .hover-values-content {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 4px;
    }

    .hover-value-item {
        padding: 6px 4px;
        min-height: 45px;
    }

    .hover-value-number {
        font-size: 14px;
    }

    .hover-value-label {
        font-size: 8px;
        margin-bottom: 2px;
    }

    .hover-value-subtitle {
        font-size: 7px;
        margin-top: 1px;
    }
    .category-chart {
        height: 350px !important;
    }
}

@media (max-width: 700px) {

    .header {
        position: absolute;
    }

    .dropdown-menu {
        position: absolute;
    }

    .ewd-side-nav {
        border-top: solid 1px #ededed;
        position: absolute;
        left: 0;
        top: var(--header-height);
        width: 100%;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        padding: 10px;
        background-color: white;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .ewd-side-nav-item {
        width: 46px;
        padding: 6px 8px;
    }

    .ewd-side-nav-label {
        display: none;
    }

    @media (hover: hover) {

        .ewd-side-nav:hover .ewd-side-nav-item {
            width: 46px;
        }

        .ewd-side-nav:hover .ewd-side-nav-label {
            opacity: 0;
        }
    }

    .main-content {
        padding: 12px;
    }

    .menu-space {
        margin-top: 150px;
    }

    .graph-container {
        padding-left: 0px;
    }

    .dashboard {
        padding: 0px 10px 40px 10px;
        transform: scale(0.85);
        width: 119%;
        margin-left: -9%;
    }

    .site-logo {
        margin-right: 20px;
    }

    .site-title {
        font-size: 1.3rem;
        letter-spacing: -0.05em;
    }

    .nav-right-section {
        gap: 0.5rem;
    }

    .metric-search-link,
    .pdf-report-link {
        border-radius: 8px;
    }

    .metric-search-link i,
    .pdf-report-link i {
        font-size: 22px;
    }

    .metric-search-link span,
    .pdf-report-link span {
        display: none;
    }

    #charts-container {
        display: flex;
        flex-wrap: wrap;
        gap: 50px;
        width: 100%;
        justify-content: center;
    }

}

@media (max-width: 600px) {

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 20px;
    }

    p {
        font-size: 12px;
    }

    #metrics-buttons {
        padding: 10px;
    }

    .main-content {
        padding: 0px;
    }

    .pad-large {
        padding: 25px 20px;
    }

    .dashboard {
        padding: 0px;
    }

    /*.metric-viewer-container {*/
    /*    background-color: #00000000;*/
    /*    border: none;*/
    /*    border-radius: 0;*/
    /*}*/

    .pdf-report-container, .forecast-dashboard-container {
        padding: 0 !important;
    }

    .forecast-page-title {
        padding: 5px 15px 0 15px;
    }

    .controls-grid, .chart-section, .metric-section, .forecast-growth-controls, .forecast-metrics-panel, .forecast-chart-panel, .basic-card, .metric-viewer-container {
        width: 100% !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
}

@media (max-width: 500px) {

    h2 {
        font-size: 18px;
    }

    .pad-large {
        padding: 20px 15px;
    }

    .list-and-chart {
      gap: 20px;
    }


    .site-logo {
        margin-right: 10px;
    }

    .site-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 400px) {
    .pad-large {
        padding: 15px 10px;
    }

    .simple-line-container {
        border: none;
    }

    .dashboard {
        transform: scale(0.75);
        width: 140%;
        margin-left: -17%;
    }


    .site-title {
        font-size: 1rem;
    }
}

/* Dashboard Edit Mode Styles */
.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id] {
    position: relative;
    animation: dashboard-jiggle 0.5s ease-in-out infinite;
    animation-direction: alternate;
    cursor: grab;
    user-select: none;
    overflow: visible;
}

/* Random animation delays for staggered jiggle effect */
.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:nth-child(1) { animation-delay: 0s; }
.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:nth-child(2) { animation-delay: 0.1s; }
.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:nth-child(3) { animation-delay: 0.2s; }
.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:nth-child(4) { animation-delay: 0.3s; }
.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:nth-child(5) { animation-delay: 0.4s; }
.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:nth-child(6) { animation-delay: 0.05s; }
.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:nth-child(7) { animation-delay: 0.15s; }
.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:nth-child(8) { animation-delay: 0.25s; }
.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:nth-child(9) { animation-delay: 0.35s; }
.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:nth-child(10) { animation-delay: 0.45s; }

.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:hover {
    animation-play-state: paused;
}

.dashboard-edit-mode .ewd-side-nav-item[data-dashboard-id]:active {
    cursor: grabbing;
}

.dashboard-edit-mode .ewd-side-nav-item.dragging {
    opacity: 0.3;
    transform: rotate(5deg);
    z-index: 1000;
    animation: none;
}

.dashboard-edit-mode .ewd-side-nav-item.drop-zone-above::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 8px;
    right: 8px;
    height: 4px;
    background: var(--orange);
    border-radius: 2px;
    z-index: 1001;
}

.dashboard-edit-mode .ewd-side-nav-item.drop-zone-below::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 8px;
    right: 8px;
    height: 4px;
    background: var(--orange);
    border-radius: 2px;
    z-index: 1001;
}

.dashboard-edit-mode .ewd-side-nav-item .dashboard-delete-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #ff4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.dashboard-edit-mode .ewd-side-nav-item .dashboard-delete-btn:hover {
    background: #cc0000;
    transform: scale(1.1);
}

.dashboard-edit-mode .ewd-side-nav-item .dashboard-delete-btn:active {
    transform: scale(0.95);
}

/* Hide delete buttons when not in edit mode */
.ewd-side-nav-item .dashboard-delete-btn {
    display: none;
}

/* Jiggle animation keyframes */
@keyframes dashboard-jiggle {
    0% {
        transform: rotate(-1deg);
    }
    25% {
        transform: rotate(1deg);
    }
    50% {
        transform: rotate(-1deg);
    }
    75% {
        transform: rotate(1deg);
    }
    100% {
        transform: rotate(-1deg);
    }
}
