/*
 * Standalone /reports/ app styles.
 *
 * Everything here is nested under #app (native CSS nesting) so it can only style
 * the Vue app root and its descendants - never the shared header (#hp-ext-header),
 * the page frame, or the auth gate (#hp-gate), which all sit outside #app.
 *
 * Colours reference the shared palette tokens in lib/theme.css (greys, the
 * muted blues plus the saturated blue-accent set, greens, reds, purple, white,
 * black) so a change at :root cascades everywhere. rgba() shadows/overlays and
 * the alpha
 * icon colour (#000000c7) are intentionally left literal. Note: the per-cell
 * "weight" colours in the table are generated in JS, not here.
 *
 * Shared layers loaded before this file:
 *   - lib/theme.css     :root tokens
 *   - lib/page-frame.css  body backdrop + centred .hp-page column
 *   - lib/ui.css        base #app typography + .error-message/.settings-message
 * Page frame variables (--hp-frame-*) are tuned in standalone.css.
 */

#app {
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    /* margin: 20px; */
    padding: 20px 20px 10px 20px;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: var(--white);

    .report-controls {
        display: flex;
        /* margin-bottom: 10px; */
        justify-content: flex-end;
        border: 1px solid var(--gray-lighter);
        border-radius: var(--radius);
    }

    .entity-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        background-color: var(--gray-brighter);
        padding: 8px;
        border-radius: var(--radius);
        /* align-items: center; */
        width: 100%;
    }

    .entity-controls-left {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .entity-controls-left-content {
        display: flex;
        flex-direction: row;
        gap: 10px;
    }

    .controls-right {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .entity-controls-right {
        display: flex;
        flex-direction: row;
        gap: 5px;
        justify-content: flex-end;
    }

    .loading-indicator {
        text-align: right;
        color: var(--blue-accent);
    }

    .entity-controls label {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 600;
        margin: 0;
    }

    .stats-controls {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 10px;
    }

    .column-picker {
        position: relative;
    }

    .column-picker-btn {
        padding: 3px 8px;
        min-width: auto;
    }

    .column-picker-panel {
        position: absolute;
        top: 100%;
        right: 0;
        z-index: 20;
        margin-top: 4px;
        padding: 8px 10px;
        background: var(--white);
        border: 1px solid var(--gray-lighter);
        border-radius: var(--radius);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 120px;
    }

    .column-picker-option {
        display: flex;
        align-items: center;
        gap: 6px;
        font-weight: 500;
        margin: 0;
        cursor: pointer;
        white-space: nowrap;
    }

    .column-picker-option input[type="checkbox"] {
        width: 16px;
        height: 16px;
        margin: 0;
        cursor: pointer;
    }

    .stats-controls label {
    /* font-variant-numeric: tabular-nums; */
    }

    .entity-controls select,
    .entity-controls input[type="number"] {
        padding: 3px 3px;
        border: 1px solid var(--gray-mid);
        border-radius: var(--radius);
        min-width: 80px;
    }

    .entity-controls input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .fetch-btn {
        background-color: var(--blue-accent);
        color: var(--white);
        border: none;
        padding: 4px 12px;
        border-radius: var(--radius);
        cursor: pointer;
        transition: background-color 0.2s;
        min-width: 80px;
        font-weight: 600;
        text-transform: uppercase;
    }

    .fetch-btn:hover {
        background-color: var(--blue-accent-dark);
    }

    .tbl_container {
        /* max-width: 100%; */
        /* height: 100%; */
        overflow: auto;
        position: relative;
        border: 1px solid var(--gray-lighter);
        border-radius: var(--radius);
        margin-bottom: 10px;
        flex: 1;
    }

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

    .tbl_container .report-table thead {
        position: sticky;
        top: 0;
        z-index: 11;
    }

    .tbl_container .report-table th {
        position: sticky;
        top: 0;
        z-index: 10;
        background-color: var(--gray-brightest);
        /* box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1); */
        padding: 3px 1px 3px 1px;
        white-space: nowrap;
        font-weight: 600;
        text-align: left;
        /* border: 1px solid var(--gray-lighter); */
        vertical-align: bottom;
    }

    .sortable {
        cursor: pointer;
    }

    .sortable-header {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        cursor: pointer;
    }

    th:first-child .sortable-header {
        justify-content: flex-start;
    }

    .sort-icon {
        margin-left: 2px;
        display: inline-block;
    }

    .sort-asc::after,
    .sort-desc::after {
        content: "";
        display: inline-block;
        width: 0;
        height: 0;
        margin-left: 5px;
    }

    .sort-asc::after {
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-bottom: 5px solid var(--gray-darker);
    }

    .sort-desc::after {
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid var(--gray-darker);
    }

    .right {
        text-align: right !important;
    }

    .stat-cell {
        padding: 0 4px;
        vertical-align: middle;
    }

    .stat-cell .stats_top {
        font-size: 0.9em;
        font-weight: 600;
        line-height: 1.3;
        text-align: center;
    }

    .stat-cell .stats_bottom {
        font-size: 0.8em;
        line-height: 1.3;
        text-align: center;
    }

    .center {
        text-align: center !important;
    }

    /* Style for table rows and cells */
    .tbl_container .report-table td {
        padding: 1px 4px;
        border: 1px solid var(--gray-lighter);
        white-space: nowrap;
        /* text-align: center; */
        /* height: 33px; */
        font-variant-numeric: tabular-nums;
        letter-spacing: -0.5px;
    }

    .tbl_container .report-table tbody tr:nth-child(even) {
        background-color: var(--gray-brighter);
    }

    /* Hover effect for rows */
    .tbl_container .report-table tbody tr:hover {
        background-color: var(--green-lighter);
    }

    /* Table filter styles */
    .table-filter {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        margin: 0 0 5px 0;
        font-weight: normal;
    }

    .table-filter .filter-row {
        display: flex;
        flex-direction: column;
        gap: 2px;
        align-items: center;
        line-height: 22px;
    }

    .table-filter-labels .filter-row {
        align-items: flex-end;
        width: 100%;
        padding: 0 10px 0 0;
    }

    .table-filter input {
        width: calc(100% - 4px);
        padding: 3px 0px 3px 2px;
        border: 1px solid var(--gray-mid);
        border-radius: var(--radius);
        font-weight: 500;
        font-size: 0.8em;
        margin-bottom: 1px;
        font-family: var(--font);
    }

    .entity_check, .report-table .fa {
        /* font-size: 15px; */
        /* color: #000000c7; */
    }

    .row-icon {
        cursor: pointer;
        transition: color 0.2s ease;
    }

    .row-icon:hover {
        color: var(--black);
    }

    .row-icon-active {
        color: var(--blue-accent) !important;
        font-weight: bold;
    }

    .entity_check {
        width: 18px;
        height: 18px;
    }

    .entity_check:disabled {
        cursor: not-allowed;
        opacity: 0.6;
    }

    .report-table .fa:hover {
        color: var(--black);
    }

    .no-results {
        padding: 20px;
        text-align: center;
        background-color: var(--gray-brightest);
        border-radius: var(--radius);
        color: var(--gray-dark);
    }

    /* Child row styles */
    .child-row {
        display: none;
        background-color: var(--gray-brightest);
    }

    .child-row.show {
        display: table-row;
    }

    .child-row-content {
        padding: 8px;
        margin: 6px;
        border-left: 3px solid var(--blue-accent);
        background-color: var(--white);
        position: relative;
    }

    .close-btn {
        position: absolute;
        top: 6px;
        left: 8px;
        font-size: 2em;
        font-weight: bold;
        color: var(--gray-mid);
        cursor: pointer;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background-color: var(--gray-brighter);
        transition: all 0.2s ease;
    }

    .close-btn:hover {
        background-color: var(--gray-lightest);
        color: var(--gray-darker);
    }

    .history-content, .schedule-content {
        padding: 10px;
    }

    .history-table-container th:first-child .sortable-header {
        justify-content: flex-start;
    }

    .history-table-container .sortable-header {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        user-select: none;
    }

    .history-table-container .child-table-filter-row th {
        padding: 4px 2px;
        vertical-align: middle;
        font-weight: normal;
    }

    .history-table-container .child-table-filter-row select {
        width: 100%;
        max-width: 100%;
        padding: 2px;
        border: 1px solid var(--gray-mid);
        border-radius: var(--radius);
        font-size: 0.75em;
        font-family: var(--font);
        font-weight: 500;
        background: #fff;
    }

    .history-row .child-row-content {
        border-left-color: var(--blue-accent);
    }

    .schedule-row .child-row-content {
        border-left-color: var(--green-mid);
    }

    .charts-row .child-row-content {
        border-left-color: var(--purple-light);
    }

    .charts-content {
        padding: 10px;
    }

    .chart-stat-toggles {
        display: flex;
        /* flex-wrap: wrap; */
        gap: 4px;
        margin: 10px 0 10px 6px;
        padding-left: 0px;
    }

    .chart-stat-toggle {
        display: flex;
        align-items: center;
        gap: 4px;
        font-weight: 500;
        margin: 0;
        cursor: pointer;
        padding: 3px 5px;
        background: var(--gray-brighter);
        border-radius: 2px;
    }

    .chart-stat-toggle input[type="checkbox"] {
        width: 16px;
        height: 16px;
        cursor: pointer;
        margin: 0;
    }

    .charts-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 12px;
        /* padding-left: 30px; */
    }

    .chart-stat-wrapper {
        display: flex;
        flex-direction: column;
        gap: 1px;
        border: 1px solid var(--gray-lighter);
        border-radius: 3px;
        padding: 1px 0px 0px 9px;
    }

    .chart-stat-title {
        font-weight: 600;
        font-size: 13px;
        color: var(--blue-accent);
    }

    .chart-stat-container {
        min-width: 0;
        position: relative;
        height: 220px;
    }

    .chart-stat-container canvas {
        display: block;
    }

    .child-row-content h4 {
        margin-top: 0;
        color: var(--blue-accent);
        padding-left: 30px;
    }

    .child-row-content p {
        margin-bottom: 0;
        padding-left: 25px;
    }

    /* Child row table styles */
    .child-row-content table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 0px;
    }

    .child-row-content table thead {
        background-color: var(--gray-brighter);
    }

    .child-row-content table td {
        padding: 6px 10px;
        border: 1px solid var(--gray-lightest);
    }

    .child-row-content .loading-row,
    .child-row-content .no-data-row {
        text-align: center;
        padding: 12px;
        color: var(--gray-dark);
    }

    .child-row-content .loading-row {
        font-style: italic;
        background-color: var(--gray-brightest);
    }

    .child-row-content .no-data-row {
        background-color: var(--gray-brighter);
    }

    .silk {
        height: 28px;
        background: var(--white);
        border: 1px solid var(--gray-lighter);
        border-radius: var(--radius);
        padding: 1px;
        margin: 3px;
        vertical-align: middle;
    }

    .history-table-container {
        max-height: 247px;
        overflow-y: auto;
    }

    .tbl_container .report-table .history-table-container table td {
        padding: 3px 1px;
    }

    .name-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 80px;
        margin: 0 0 0 3px;
    }

    .name-header-left {
        display: flex;
        flex-direction: column;
        gap: 2px;
        justify-content: space-between;
        height: 100%;
    }

    .check-all-header {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .check-all-header input[type="checkbox"] {
        cursor: pointer;
    }

    .check-all-label {
        user-select: none;
    }

    .profile-entity-count {
        font-size: 0.85em;
        color: var(--gray-dark);
    }

    .profile-entity-count.at-limit {
        color: var(--red-dark);
    }

    .maxed-out-label {
        margin-left: 4px;
        font-weight: 600;
    }

    .name-header-right {
        display: flex;
        flex-direction: column;
        /* justify-content: end; */
        height: 100%;
        margin: 32px 5px 0px 0;
        gap: 5px;
    }

    .fixed {
        width: 50px;
    }

    .date-cell {
        width: 72px;
        min-width: 72px;
        max-width: 72px;
    }

    #profile-actions,
    #profile-transfer-actions {
        display: flex;
        flex-direction: row;
        gap: 3px;
        align-items: center;
        justify-content: center;
    }

    #profile-transfer-actions {
        margin-left: 8px;
        padding-left: 8px;
        border-left: 1px solid var(--gray-lightest);
    }

    #profile-actions button,
    #profile-transfer-actions button {
        background-color: var(--blue-accent);
        color: var(--white);
        border: none;
        padding: 2px 1px;
        width: 24px;
        flex: 1;
        border-radius: var(--radius);
        font-weight: 600;
        text-transform: uppercase;
    }

    #profile-transfer-actions .profile-transfer-btn {
        width: 28px;
        font-size: 14px;
        line-height: 1;
        padding: 3px 2px;
    }

    #profile-transfer-actions .profile-transfer-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

    .import-profile-file-row {
        margin-bottom: 10px;
    }

    .import-profile-file-input {
        display: none;
    }

    .btn-file {
        background-color: var(--gray-lightest);
        color: var(--blue-accent);
        border: 1px solid var(--gray-light);
        border-radius: var(--radius);
        padding: 6px 10px;
        cursor: pointer;
        font-size: 0.9em;
    }

    .btn-file:hover:not(:disabled) {
        background-color: var(--white);
    }

    .btn-file:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    .import-profile-loading {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 10px;
        color: var(--blue-accent);
        font-weight: 600;
    }

    .import-profile-dialog {
        width: 420px;
    }

    /* Profile Dialog Styles */
    .profile-dialog-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .profile-dialog {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-color: var(--white);
        border-radius: var(--radius);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        width: 350px;
        z-index: 1000;
    }

    .profile-dialog-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        border-bottom: 1px solid var(--gray-lightest);
    }

    .profile-dialog-header h3 {
        margin: 0;
        font-size: 1.2em;
        color: var(--blue-accent);
    }

    .profile-dialog-close {
        font-size: 2.4em;
        font-weight: bold;
        cursor: pointer;
        color: var(--gray-mid);
    }

    .profile-dialog-close:hover {
        color: var(--gray-darker);
    }

    .profile-dialog-body {
        padding: 15px;
    }

    .profile-dialog-body label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
    }

    .profile-dialog-body input {
        width: calc(100% - 20px);
        padding: 8px 10px;
        border: 1px solid var(--gray-lightest);
        border-radius: var(--radius);
    }

    .profile-dialog-footer {
        display: flex;
        justify-content: flex-end;
        padding: 10px 15px;
        border-top: 1px solid var(--gray-lightest);
        gap: 10px;
    }

    .profile-dialog-footer button {
        padding: 8px 15px;
        border-radius: var(--radius);
        cursor: pointer;
        font-weight: 600;
    }

    .btn-cancel {
        background-color: var(--gray-brighter);
        border: 1px solid var(--gray-lightest);
        color: var(--gray-darker);
    }

    .btn-submit {
        background-color: var(--blue-accent);
        border: none;
        color: var(--white);
    }

    .btn-cancel:hover {
        background-color: var(--gray-lightest);
    }

    .btn-submit:hover {
        background-color: var(--blue-accent-dark);
    }

    .btn-remove-all {
        background-color: var(--red-mid);
        border: none;
        color: var(--white);
    }

    .btn-remove-all:hover {
        background-color: var(--red-dark);
    }

    .btn-remove-non-matched {
        background-color: var(--red-mid);
        border: none;
        color: var(--white);
    }

    .btn-remove-non-matched:hover {
        background-color: var(--red-dark);
    }

    /* Manage Profile Dialog specific styles */
    .manage-profile-dialog {
        width: 1200px;
        max-width: 90%;
        max-height: 90vh;
    }

    .manage-entities-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 10px;
    }

    .manage-entities-table th,
    .manage-entities-table td {
        padding: 2px 2px;
        border: 1px solid var(--gray-lightest);
        text-align: left;
        position: relative;
    }

    .manage-entities-table th {
        background-color: var(--gray-brighter);
        font-weight: 600;
    }

    .manage-entities-table .sortable-header {
        cursor: pointer;
    }

    .manage-entities-table tr {
        background-color: var(--green-lightest);
    }

    .manage-entities-table tr.row-no-match {
        background-color: var(--red-lightest);
    }

    .manage-entities-table .stat-cell {
        text-align: center;
    }

    .manage-entities-table td .profile-stats-container {
        border: 2px solid var(--green-mid);
        box-sizing: border-box;
        margin: 0px;
    }

    .manage-entities-table .row-no-match td.cell-no-match .profile-stats-container {
        border: 3px solid var(--red-mid);
        margin: 0px;
    }

    .profile-status-container {
        position: absolute;
        top: 2px;
        right: 2px;
        bottom: 2px;
        left: 2px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .manage-entities-table .rating-input {
        width: 60px;
        padding: 5px;
        border: 1px solid var(--gray-lightest);
        border-radius: var(--radius);
    }

    .btn-remove-entity {
        background-color: var(--red-mid);
        color: var(--white);
        border: none;
        padding: 5px 10px;
        border-radius: var(--radius);
        cursor: pointer;
        font-weight: 600;
    }

    .btn-remove-entity:hover {
        background-color: var(--red-dark);
    }

    .entity-list {
        max-height: 60vh;
        overflow-y: auto;
    }

    .no-entities {
        text-align: center;
        padding: 20px;
        color: var(--gray-dark);
        font-style: italic;
    }

    /* Selected Profile Footer Styles */
    .selected-profile-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background-color: var(--gray-brightest);
        border-top: 2px solid var(--gray-lightest);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        max-height: 200px;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .footer-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
        background-color: var(--gray-bright);
        border-bottom: 1px solid var(--gray-lightest);
        cursor: pointer;
    }

    .footer-header h4 {
        margin: 0;
        font-size: 16px;
        color: var(--gray-dark);
    }

    .footer-toggle {
        font-size: 18px;
        color: var(--gray-mid);
        user-select: none;
        padding: 5px;
    }

    .footer-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .footer-content.expanded {
        max-height: 150px;
    }

    .selected-entities-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 15px 20px;
        max-height: 120px;
        overflow-y: auto;
    }

    .selected-entity-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: var(--white);
        border: 1px solid var(--gray-lightest);
        border-radius: var(--radius);
        padding: 8px 12px;
        min-width: 200px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .entity-info {
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .entity-name {
        font-weight: 600;
        color: var(--gray-dark);
        font-size: 14px;
    }

    .entity-rating {
        font-size: 12px;
        color: var(--gray-mid);
        margin-top: 2px;
    }

    .entity-actions {
        margin-left: 10px;
    }

    .btn-remove-small {
        background-color: var(--red-mid);
        color: var(--white);
        border: none;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        cursor: pointer;
        font-size: 16px;
        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .btn-remove-small:hover {
        background-color: var(--red-dark);
    }

    .paging-controls {
        margin: 10px 0px;
        /* text-align: right; */
        display: flex;
        flex-direction: row;
        gap: 10px;
        align-items: center;
        /* justify-content: flex-end; */
        width: 100%;
    }

    .paging-controls button {
        border: 1px solid var(--gray-lighter);
        border-radius: 2px;
        width: 30px;
    }

    .bulk-saving-overlay {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.55);
        cursor: progress;
    }

    .bulk-saving-box {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 14px 22px;
        background: var(--white);
        border: 1px solid var(--gray-mid);
        border-radius: var(--radius);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
        font-weight: 500;
        color: #000000c7;
    }

    .bulk-saving-box .fa-spinner {
        font-size: 18px;
        color: var(--blue-accent);
    }

    .profile-sync-actions {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: 6px;
    }

    .profile-check-btn,
    .profile-update-btn {
        padding: 4px 8px;
        font-size: 12px;
        font-weight: 600;
    }

    .profile-update-btn:not(:disabled) {
        background: var(--blue-accent);
        color: var(--white);
        border-color: var(--blue-accent);
    }

    .profile-unsaved-indicator {
        font-size: 11px;
        font-weight: 600;
        color: #b45309;
        white-space: nowrap;
    }

    .profile-usage-dialog {
        width: min(720px, 92vw);
        max-height: 85vh;
        display: flex;
        flex-direction: column;
    }

    .profile-usage-body {
        overflow: auto;
        max-height: 60vh;
    }

    .profile-usage-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 12px 20px;
        align-items: flex-end;
        margin-bottom: 12px;
    }

    .profile-usage-filter {
        display: flex;
        flex-direction: column;
        gap: 3px;
        font-size: 12px;
        font-weight: 600;
    }

    .profile-usage-filter select {
        min-width: 160px;
        padding: 4px 6px;
        font-size: 12px;
        font-weight: 400;
    }

    .profile-usage-update-meta {
        margin-left: auto;
        font-size: 12px;
    }

    .profile-usage-mark-cell {
        text-align: center;
    }

    .profile-usage-sync-ok {
        color: #15803d;
        font-weight: 600;
    }

    .profile-usage-sync-fail {
        color: #b91c1c;
        font-weight: 600;
    }

    .profile-usage-system {
        margin-bottom: 16px;
        border-top: 1px solid var(--gray-mid);
        padding-top: 10px;
    }

    .profile-usage-system-header {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: baseline;
        margin-bottom: 6px;
    }

    .profile-usage-system-status.sync-in_sync {
        color: #15803d;
        font-weight: 600;
    }

    .profile-usage-system-status.sync-stale,
    .profile-usage-system-status.sync-empty {
        color: #b45309;
        font-weight: 600;
    }

    .profile-usage-system-status.sync-quals_mismatch {
        color: #b91c1c;
        font-weight: 600;
    }

    .profile-usage-today-cell {
        text-align: center;
        font-weight: 700;
    }

    .profile-usage-today-ok {
        color: #15803d;
    }

    .profile-usage-x-mismatch {
        color: #dc2626;
        font-size: 16px;
        font-weight: 800;
    }

    .profile-usage-entities-table tr.row-quals-mismatch {
        background: #fee2e2;
    }

    .profile-usage-entities-table tr.row-quals-mismatch td:first-child {
        font-weight: 600;
    }

    .profile-usage-entities-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
    }

    .profile-usage-entities-table th,
    .profile-usage-entities-table td {
        border: 1px solid var(--gray-mid);
        padding: 4px 8px;
        text-align: left;
    }

    .profile-usage-entities-table tr.row-stale {
        background: #fef3c7;
    }

    .profile-usage-empty,
    .profile-usage-message {
        font-size: 13px;
        margin: 0 0 10px;
    }

    .profile-usage-loading {
        padding: 12px 0;
        color: var(--blue-accent);
        font-weight: 600;
    }

    @media (max-width: 1200px) {
        .manage-profile-dialog {
            width: 500px;
        }
        .lrg {
            display: none;
        }
        .med {
            display: none;
        }
    }
}
