.excel-content .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--loader-overlay-bg);
    backdrop-filter: blur(4px);
    display: flex;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 999;
}

.excel-content .loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid transparent;
    border-top: 4px solid var(--loader);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.excel-content.loading .overlay,
.excel-content.loading .loader {
    opacity: 1;
    pointer-events: all;
}

@keyframes spin {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.excel-content {
    flex: 1 1 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sheet-title-bar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--sheet-title-bar-height);
    padding: 6px 10px;
    border-bottom: 1px solid var(--sheet-header-border);
    background: var(--sheet-title-bg);
    left: 0;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
}

.sheet-title {
    margin: 0;
    position: sticky;
    left: 10px;
    z-index: 5;
    background: var(--sheet-title-bg);
    padding-right: 8px;
}

.sheet-title .sheet-title-sticky {
    color: var(--sheet-title-color);
    font-family: "Russo One", sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    -webkit-text-stroke-width: 0.3px;
    -webkit-text-stroke-color: black;
    text-shadow: 0.5px 0.5px 1.5px black;
    display: inline-block;
}

.sheet-title-back-link {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 14px;
    border-radius: 6px;
    background: var(--nav-button-bg);
    color: var(--nav-color);
    font-family: "Roboto", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.18s ease;
}

.sheet-title-back-link:hover,
.sheet-title-back-link:focus-visible {
    background: var(--nav-button-hover-bg);
}

body.inventory-search-results-view .sheet-title-back-link:not([hidden]) {
    display: inline-flex;
}

.sheet-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sheet-actions .print-btn {
    margin-left: 0;
}

.sheet-search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    height: 28px;
    width: 28px;
    border-radius: 4px;
    border: 1px solid var(--border-300);
    background: var(--surface-200);
    color: var(--text-900);
    cursor: pointer;
}

.sheet-search-toggle:hover,
.sheet-search-toggle:focus-visible {
    background: var(--surface-500);
}

.sheet-search-panel {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sheet-search-input {
    height: 28px;
    padding: 4px 8px;
    font-size: 0.9rem;
    border: 1px solid var(--border-300);
    border-radius: 4px;
    background: var(--surface-100);
    color: var(--text-900);
    min-width: 140px;
    max-width: 38vw;
}

.sheet-search-input::placeholder {
    color: var(--text-700);
}

.sheet-search-close {
    display: none;
    height: 28px;
    padding: 0 8px;
    border-radius: 4px;
    border: 1px solid var(--border-300);
    background: var(--surface-200);
    color: var(--text-900);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    align-items: center;
    justify-content: center;
}

.sheet-search-close:hover,
.sheet-search-close:focus-visible {
    background: var(--surface-500);
}

.sheet-search-backdrop {
    display: none;
}

.print-header {
    display: none;
    font-family: "Russo One", sans-serif;
    font-size: 1.5rem;
    margin: 0 0 12px 0;
    color: #000;
}

.excel-content #excel-output {
    flex: 0 1 auto;
    min-height: auto;
    height: auto;
}

.excel-content .excel-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
}

.excel-content .excel-table thead {
    position: static;
    top: auto;
    z-index: auto;
}

.excel-content .excel-table,
.excel-content .excel-table th,
.excel-content .excel-table td {
    font-family: "Roboto", sans-serif;
}

.excel-content .excel-table col {
    vertical-align: top;
}

.excel-content .excel-table th,
.excel-content .excel-table td {
    border: 1px solid var(--cell-border);
    padding: 6px 8px;
    text-align: left;
    white-space: nowrap;
    background-clip: padding-box;
    vertical-align: top;
}

.excel-cell-wrap {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.excel-content .excel-table td[data-type="price"] {
    text-align: right;
}

.excel-content .excel-table td[data-align="left"] {
    text-align: left;
}

.excel-content .excel-table td[data-align="right"] {
    text-align: right;
}

.excel-content .excel-table td[data-align="center"] {
    text-align: center;
}

.excel-content .excel-table tbody tr.separator td {
    border: none;
    border-top: 1px solid var(--separator-color);
    height: 0;
    padding: 0;
    background: transparent;
}

.excel-content .excel-table thead tr:nth-child(1) {
    font-weight: bold;
    background: var(--sheet-header-bg);
    color: var(--sheet-header-color);
}

.excel-content .excel-table tbody tr.sub-header td {
    position: relative;
    background-color: var(--sub-header-bg);
    text-shadow: 1px 1px 2px black;
    font-weight: bold;
    padding: 8px;
    color: var(--sub-header-color);
    font-family: "Russo One", sans-serif;
    font-size: 1.1rem;
}

.excel-content .excel-table tbody tr.sub-header .sub-header-sticky {
    position: sticky;
    left: 9px;
    z-index: 2;
    padding-right: 8px;
    display: inline-block;
    -webkit-text-stroke-color: black;
    -webkit-text-stroke-width: 0.15px;
}

[data-condition="Used C"] { color: #f00; font-weight: 500; }
[data-condition="Used"] { color: #f00; }
[data-condition="Very Good"] { color: #2c9631; }
[data-condition="Like New"] { color: #00bd09; }
[data-condition="Brand New"] { color: #00ff11; font-weight: 600; }

.excel-content .excel-table td[data-date="short"] {
    color: #8f8f8f;
    font-size: 0.9em;
}

[data-color="black"] { color: #000; font-weight: bold; }
[data-color="blue"] { color: #1565c0; font-weight: bold; }
[data-color="red"] { color: #df1a1a; font-weight: bold; }
[data-color="green"] { color: #2d9632; font-weight: bold; }
[data-color="gray"] { color: #616161; font-weight: bold; }
[data-color="dark gray"] { color: #333333; font-weight: bold; }
[data-color="light gray"] { color: #8f8f8f; font-weight: bold; }
[data-color="orange"] { color: #ef6c00; font-weight: bold; }
[data-color="yellow"] { color: #f9d925; font-weight: bold; }
[data-color="purple"] { color: #6a1b9a; font-weight: bold; }
[data-color="teal"] { color: #00bda7; font-weight: bold; }
[data-color="camo"] { color: #667441; font-weight: bold; }
[data-color="kit"] { color: #ff8c00; font-family: "Russo One", sans-serif; font-style: italic; font-weight: bold; text-decoration: underline; }
[data-color="default"] { color: #333; font-style: italic; font-size: 0.95em; }
