/* Main layout styles */
body {
    margin: 0;
    padding: 0;
    padding-top: 60px; /* Push content below fixed header */
    display: block;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background-color: #26384D; /* Dark blue background */
}

/* Header for selected vehicle */
.selected-vehicle-header {
    position: fixed;
    top: 0;
    left: 10%; /* 10% margin on left (80% width + 10% margin = 90%) */
    width: 80%; /* 80% of page width - matches main-layout */
    height: auto;
    min-height: 40px;
    background: linear-gradient(180deg, #ffffff, #f7f9fc);
    border-bottom: 1px solid #e6e9ef;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    z-index: 50;
    display: flex;
    flex-direction: column;
}

/* Header accordion container */
.header-accordion {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Header accordion buttons */
.header-accordion-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(180deg, #ffffff, #f8f9fa);
    border: none;
    border-bottom: 1px solid #e6e9ef;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    text-align: left;
    transition: background 0.2s;
}

.header-accordion-btn:hover {
    background: linear-gradient(180deg, #f8f9fa, #e9ecef);
}

.header-accordion-btn:active,
.header-accordion-btn.active {
    background: linear-gradient(180deg, #e9ecef, #dee2e6);
}

.accordion-btn-label {
    font-weight: 600;
    color: #26384D; /* Dark blue for labels */
    margin-right: 0.5rem;
}

.accordion-btn-value {
    font-weight: 400;
    color: #26384D; /* Dark blue for values */
    font-style: italic;
}

/* Header accordion content panels */
.header-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #ffffff;
    border-bottom: 1px solid #e6e9ef;
}

.header-accordion-content.open {
    max-height: 500px; /* Adjust as needed for content */
    overflow-y: auto;
    padding: 1rem 1.5rem;
}


.header-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    box-sizing: border-box;
}

/* Allow header rows to wrap so message row can sit on its own line */
.header-inner {
    flex-wrap: wrap;
    align-items: flex-start;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-right: 1rem;
}

.header-title-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.selected-base-vehicle {
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.2rem;
}

/* Inline header status (replaces alert()) */
.sv-status {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #0b5ed7; /* informational blue */
    background: rgba(11,94,215,0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    max-width: 60vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Compact selected vehicle summary shown next to status */
.sv-summary {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #333;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: rgba(0,0,0,0.03);
    max-width: 60vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Container for status + summary - inside accordion panel */
.sv-message-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.vehicle-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

.vv-label {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    color: #26384D; /* Dark blue for labels */
}

.vv-select {
    min-width: 120px;
    padding: 0.25rem 0.4rem;
    margin-top: 0.2rem;
    border: 1px solid #ccd0d7;
    border-radius: 4px;
    background: white;
    color: #000; /* Black text for input fields */
}

/* Dynamic vehicle configuration container */
.dynamic-configs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    width: 100%;
    margin-top: 0.5rem;
}

/* Use Vehicle button styling (small, inline with selects) */
.use-vehicle-btn {
    margin-left: 0.6rem;
    margin-top: 0.6rem;
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    border: 1px solid #007bff;
    background: #007bff;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}
.use-vehicle-btn:hover {
    background: #005ecb;
}

/* VIN input row styling - inside accordion panel */
.vin-row {
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
}

.vv-input {
    min-width: 240px;
    padding: 0.35rem 0.5rem;
    margin-top: 0.2rem;
    border: 1px solid #ccd0d7;
    border-radius: 4px;
    background: white;
    font-family: inherit;
    color: #000; /* Black text for input fields */
}

.decode-btn {
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
    border: 1px solid #6c757d;
    background: #6c757d;
    color: #fff;
    cursor: pointer;
    font-size: 0.9rem;
}
.decode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

/* Button bar styles */
.button-bar {
    width: 33.33%;
    background-color: #f5f5f5;
    border-right: 1px solid #ddd;
    display: none; /* Hidden by default until vehicle is selected */
    flex-direction: column;
    padding: 0.5rem;
    overflow-y: auto;
}

.system-container {
    margin-bottom: .5rem;
}

.system-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: .5rem;
}

/* Button styles */
.system-button {
    color: #26384D;
    font-weight: bold;
    padding: 1rem;
    margin: 0.5rem 0;
    border: none;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: background-color 0.2s ease;
    width: 95%;
    display: block;
}

.system-button:hover {
    background-color: #e9e9e9;
}

.system-button.active {
    background-color: #007bff;
    color: white;
}

/* Content area styles */
.content {
    flex-grow: 1;
    padding: .5rem;
    overflow-y: auto;
}

/* SubGroup panel styles */
.main-layout {
        /* responsive two-column grid under the fixed header
             - default: two columns (button bar left, subgroup panel right)
             - collapse to single column on narrow viewports */
        position: relative;
        display: grid;
        grid-template-columns: 33.333% 66.666%;
        gap: 0;
        width: 80%; /* Match header width */
        margin: 0 auto; /* Center horizontally */
        padding: 5rem 0 2rem 0; /* Extra top padding for search box */
}

/* Search Container */
.search-container {
    position: absolute;
    top: -1rem;
    left: 0;
    right: 0;
    z-index: 10;
    background-color: #ffffff;
    padding: 0.75rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Breadcrumb navigation */
.breadcrumb-navigation {
    background-color: #e3f2fd;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #1565c0;
    font-weight: 500;
    border-left: 4px solid #1976d2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.operation-search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid #26384D;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

.operation-search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.clear-search-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.clear-search-btn:hover {
    color: #dc3545;
}

.search-results-count {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f5;
    transition: background-color 0.2s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: #f8f9fa;
}

.autocomplete-item.no-results {
    color: #6c757d;
    font-style: italic;
    cursor: default;
}

.autocomplete-item.view-all {
    background-color: #e9ecef;
    font-weight: 600;
    color: #007bff;
    text-align: center;
    border-top: 2px solid #dee2e6;
}

.autocomplete-item.view-all:hover {
    background-color: #dee2e6;
}

.autocomplete-item mark {
    background-color: #fff3cd;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
    font-weight: 600;
}

/* Search Results View */
.search-results-header {
    background: linear-gradient(180deg, #007bff, #0056b3);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
    margin-bottom: 1rem;
}

.search-results-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.search-results-header p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.search-group-header {
    background-color: #26384D;
    color: white;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.search-results-list {
    margin-bottom: 1.5rem;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.search-result-item:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateX(4px);
}

.search-result-breadcrumb {
    flex: 1;
    font-size: 0.95rem;
    color: #495057;
}

.search-result-breadcrumb mark {
    background-color: #fff3cd;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-weight: 600;
}

.search-result-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s;
    white-space: nowrap;
    margin-left: 1rem;
}

.search-result-btn:hover {
    background-color: #0056b3;
}

.search-result-btn:active {
    background-color: #004085;
}

.main-layout > .button-bar {
        /* left column */
        width: 100%;
        padding: 1rem;
}

.main-layout > .subgroup-panel {
        /* right column */
        position: relative;
        width: 100%;
        background-color: white;
        border-left: 1px solid #ddd;
        padding: 1rem;
        padding-bottom: 70px; /* Make room for Transfer button */
        overflow-y: auto;
        display: none; /* Hidden by default until group is selected */
}

/* Collapse to single column on smaller viewports */
@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .main-layout > .subgroup-panel {
        border-left: none;
        border-top: 1px solid #ddd;
    }
}

.subgroup-panel.visible {
    display: block;
}

/* Group accordion styles */
.group-container {
    margin-bottom: 0.5rem;
}

.group-button {
    color: #26384D;
    font-weight: 600;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border: none;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    text-align: left;
    transition: background-color 0.2s ease;
    width: 100%;
    display: block;
}

.group-button:hover {
    background-color: #e2e6ea;
}

.group-button.active {
    background-color: #0056b3;
    color: white;
}

.group-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.group-content.open {
    max-height: 2000px;
}

/* SubGroup accordion styles */
.subgroup-container {
    margin-bottom: 0.5rem;
}

.subgroup-button {
    color: #26384D;
    font-weight: 600;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    border: none;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    text-align: left;
    transition: background-color 0.2s ease;
    width: 100%;
    display: block;
}

.subgroup-button:hover {
    background-color: #f0f0f0;
}

.subgroup-button.active {
    background-color: #007bff;
    color: white;
}

.subgroup-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding-left: 1rem;
}

.subgroup-content.open {
    max-height: 2000px;
}

/* Fluids Accordion Styles */
.fluids-accordion-container {
    margin-bottom: 1rem;
    border: 2px solid #7c4dff;
    border-radius: 4px;
    background-color: #f3e5f5;
}

.fluids-accordion-button {
    color: #4a148c;
    font-weight: 700;
    padding: 0.875rem 1rem;
    margin: 0;
    border: none;
    background: linear-gradient(180deg, #e1bee7, #ce93d8);
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: background 0.2s ease;
    width: 100%;
    display: block;
    position: relative;
}

.fluids-accordion-button::after {
    content: '▼';
    position: absolute;
    right: 1rem;
    transition: transform 0.3s ease;
}

.fluids-accordion-button:hover {
    background: linear-gradient(180deg, #ce93d8, #ba68c8);
}

.fluids-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: white;
    border-radius: 0 0 4px 4px;
}

.fluids-accordion-content.open {
    max-height: 2000px;
    padding: 1rem;
}

/* Rotate arrow when accordion is open */
.fluids-accordion-content.open ~ .fluids-accordion-button::after {
    transform: rotate(180deg);
}

/* Fluids Table Styles */
.fluids-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.fluids-table thead {
    background-color: #7c4dff;
    color: white;
}

.fluids-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border: 1px solid #d1c4e9;
}

.fluids-table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    color: #333;
}

.fluids-table tbody tr:hover {
    background-color: #f3e5f5;
}

/* Attribute group header styling for fluids table */
.fluids-table tbody tr.attribute-group-header {
    background-color: #e3f2fd;
    font-weight: 600;
    color: #1565c0;
    cursor: default;
}

.fluids-table tbody tr.attribute-group-header:hover {
    background-color: #e3f2fd;
}

.fluids-table tbody tr.attribute-group-header td {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.95rem;
    border-top: 2px solid #1976d2;
    border-bottom: 1px solid #90caf9;
}

.add-fluid-btn {
    background-color: #7c4dff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
    width: 100%;
}

.add-fluid-btn:hover {
    background-color: #651fff;
}

.add-fluid-btn:active {
    background-color: #6200ea;
}

.add-fluid-btn.remove-state {
    background-color: #dc3545;
}

.add-fluid-btn.remove-state:hover {
    background-color: #c82333;
}

.add-fluid-btn.remove-state:active {
    background-color: #bd2130;
}

/* Parts Accordion Styles */
.parts-accordion-container {
    margin-bottom: 1rem;
    border: 2px solid #17a2b8;
    border-radius: 4px;
    background-color: #e7f7f9;
}

.parts-accordion-button {
    color: #0c5460;
    font-weight: 700;
    padding: 0.875rem 1rem;
    margin: 0;
    border: none;
    background: linear-gradient(180deg, #d1ecf1, #bee5eb);
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: background 0.2s ease;
    width: 100%;
    display: block;
    position: relative;
}

.parts-accordion-button::after {
    content: '▼';
    position: absolute;
    right: 1rem;
    transition: transform 0.3s ease;
}

.parts-accordion-button:hover {
    background: linear-gradient(180deg, #bee5eb, #a7dbe4);
}

.parts-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: white;
    border-radius: 0 0 4px 4px;
}

.parts-accordion-content.open {
    max-height: 2000px;
    padding: 1rem;
}

/* Rotate arrow when accordion is open */
.parts-accordion-content.open ~ .parts-accordion-button::after {
    transform: rotate(180deg);
}

/* Parts Table Styles */
.parts-table-container {
    margin: 0;
    padding: 0;
}

.parts-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.parts-table thead {
    background-color: #17a2b8;
    color: white;
}

.parts-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border: 1px solid #b8daff;
}

.parts-table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    color: #333;
}

.parts-table tbody tr:hover {
    background-color: #e7f7f9;
}

/* Attribute group header styling for parts table */
.parts-table tbody tr.attribute-group-header {
    background-color: #e3f2fd;
    font-weight: 600;
    color: #1565c0;
    cursor: default;
}

.parts-table tbody tr.attribute-group-header:hover {
    background-color: #e3f2fd;
}

.parts-table tbody tr.attribute-group-header td {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.95rem;
    border-top: 2px solid #1976d2;
    border-bottom: 1px solid #90caf9;
}

.parts-table .part-number-cell {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    width: 150px;
}

.parts-table .price-cell {
    text-align: right;
    font-weight: 600;
    width: 100px;
    color: #0c5460;
}

.add-part-btn {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
    width: 100%;
}

.add-part-btn:hover {
    background-color: #138496;
}

.add-part-btn:active {
    background-color: #117a8b;
}

.add-part-btn.remove-state {
    background-color: #dc3545;
}

.add-part-btn.remove-state:hover {
    background-color: #c82333;
}

.add-part-btn.remove-state:active {
    background-color: #bd2130;
}

/* Taxonomy item (Literal name) styles */
.taxonomy-item {
    color: #26384D;
    padding: 0.5rem 1rem;
    margin: 0.25rem 0;
    border: none;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: left;
    transition: background-color 0.2s ease;
    width: 100%;
    display: block;
}

.taxonomy-item:hover {
    background-color: #e9ecef;
}

.taxonomy-item.active {
    background-color: #28a745;
    color: white;
}

/* Literal names container */
.literal-names-container {
    padding-left: 1rem;
}

/* Work Times Table */
.work-times-table-container {
    margin: 1rem 0 1rem 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.work-times-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.work-times-table thead {
    background-color: #26384D;
    color: white;
}

.work-times-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    border: 1px solid #dee2e6;
}

.work-times-table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    color: #333;
}

.work-times-table tbody tr:hover {
    background-color: #f1f3f5;
}

.work-times-table tbody tr.work-time-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.work-times-table tbody tr.work-time-row.active {
    background-color: #d4edda;
    border-left: 3px solid #28a745;
}

/* Attribute group header styling */
.work-times-table tbody tr.attribute-group-header {
    background-color: #e3f2fd;
    font-weight: 600;
    color: #1565c0;
    cursor: default;
}

.work-times-table tbody tr.attribute-group-header:hover {
    background-color: #e3f2fd;
}

.work-times-table tbody tr.attribute-group-header td {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.95rem;
    border-top: 2px solid #1976d2;
    border-bottom: 1px solid #90caf9;
}

.work-times-table .hours-cell {
    text-align: center;
    font-weight: 600;
    width: 100px;
}

.add-labor-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
    width: 100%;
}

.add-labor-btn:hover {
    background-color: #218838;
}

.add-labor-btn:active {
    background-color: #1e7e34;
}

.add-labor-btn.remove-state {
    background-color: #dc3545;
}

.add-labor-btn.remove-state:hover {
    background-color: #c82333;
}

.add-labor-btn.remove-state:active {
    background-color: #bd2130;
}

/* Optional Work Times Styles */
.optional-work-times-container {
    background-color: #f8f9fa;
}

.optional-work-times-container td {
    padding: 1rem;
}

.optional-work-times-title {
    margin: 0 0 0.75rem 0;
    padding: 0.5rem;
    background-color: #26384D;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    text-align: center;
}

.optional-work-times-table {
    margin-top: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.optional-work-times-table thead {
    background-color: #495057;
}

.optional-work-times-table tbody tr:hover {
    background-color: #e9ecef;
}

/* Operation Notes Styles */
.operation-notes {
    display: block;
    margin-top: 0.5rem;
    padding-left: 1.5rem;
}

.note-text {
    display: block;
    background-color: #fffacd !important; /* Pale yellow */
    border: 1px solid #daa520 !important;
    border-radius: 4px;
    padding: 0.5rem !important;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #333 !important;
}

.note-text:last-child {
    margin-bottom: 0;
}


.literal-name-button {
    display: block;
    width: 100%;
    padding: 0.75rem;
    margin: 0.25rem 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.literal-name-button:hover {
    background-color: #f8f9fa;
}

.literal-name-button.active {
    background-color: #e7f1ff;
    border-color: #b8daff;
}

/* Accordion styles */
.accordion {
    width: 85%;
    margin-top: .5rem;
}

.accordion-item {
    border: 1px solid #ddd;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    overflow: hidden;
}

.accordion-header {
    background-color: #f8f9fa;
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.accordion-header:hover {
    background-color: #e9ecef;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: white;
}

.accordion-content.active {
    max-height: 500px;
    padding: 1rem;
}

.group-count {
    background-color: #007bff;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Operations table (borderless) */
.operations-table {
    width: 100%;
    border-collapse: collapse;
}
.operations-table thead th {
    text-align: center;
    padding: 0.5rem 0;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}
.operations-table tbody td {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f6f6f6;
}
.operations-table .hours-cell {
    width: 120px;
    text-align: center;
    padding-right: 1rem;
}

.add-button {
    padding: 0.35rem 0.75rem;
    border: 1px solid #007bff;
    background: #ffffff;
    color: #007bff;
    border-radius: 4px;
    cursor: pointer;
}
.add-button:hover {
    background: #e9f2ff;
}

.operations-container {
    margin-top: 0.75rem;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.optional-times-container {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #ddd;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Transfer Button Container */
.transfer-btn-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
}

.review-btn {
    padding: 0.75rem 1.75rem;
    background: linear-gradient(180deg, #007bff, #0056b3);
    color: white;
    border: 1px solid #004085;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    min-width: 120px;
}

.review-btn:hover {
    background: linear-gradient(180deg, #0056b3, #004085);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.review-btn:active {
    background: linear-gradient(180deg, #004085, #003766);
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.review-btn:disabled {
    background: linear-gradient(180deg, #6c757d, #5a6268);
    border-color: #545b62;
    cursor: not-allowed;
    opacity: 0.6;
}

.transfer-btn {
    padding: 0.75rem 1.75rem;
    background: linear-gradient(180deg, #28a745, #218838);
    color: white;
    border: 1px solid #1e7e34;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    min-width: 120px;
}

.transfer-btn:hover {
    background: linear-gradient(180deg, #218838, #1e7e34);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.transfer-btn:active {
    background: linear-gradient(180deg, #1e7e34, #1c7430);
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.transfer-btn:disabled {
    background: linear-gradient(180deg, #6c757d, #5a6268);
    border-color: #545b62;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Line Items Review Modal */
.line-items-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow-y: auto;
}

.line-items-modal.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid #ddd;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-instructions {
    margin: 0 0 1rem 0;
    color: #666;
    font-style: italic;
}

.line-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

.line-items-table th,
.line-items-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.line-items-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

.line-items-table tbody tr {
    cursor: move;
    transition: background 0.2s;
}

.line-items-table tbody tr:hover {
    background: #f8f9fa;
}

.line-items-table tbody tr.dragging {
    opacity: 0.5;
    background: #e9ecef;
}

.drag-handle {
    cursor: move;
    color: #999;
    font-size: 1.2rem;
    user-select: none;
}

.remove-item-btn {
    padding: 0.25rem 0.75rem;
    background: #dc3545;
    color: white;
    border: 1px solid #bd2130;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.remove-item-btn:hover {
    background: #c82333;
}

.modal-summary {
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.summary-item span:first-child {
    font-size: 0.875rem;
    color: #666;
}

.summary-item span:last-child {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}
