/* ═══════════════════════════════════════════════════════
   NEOMORPHIC SIDEBAR
   ═══════════════════════════════════════════════════════ */

/* Backdrop */
.settings-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.settings-overlay.open { opacity: 1; pointer-events: auto; }

/* Panel */
.sidebar-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100vh;
    background: var(--bg-primary);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    box-shadow: none;
    padding: 1.5rem 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-panel::-webkit-scrollbar { display: none; }

.sidebar-panel.open {
    right: 0;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.35), inset 1px 0 0 rgba(255, 255, 255, 0.04);
}

@media (max-width: 480px) {
    .sidebar-panel { width: 100%; right: -100%; }
}

/* Header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 0.1rem;
}

/* Close button — neomorphic circle */
.close-drawer-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-deep);
    border: none;
    color: color-mix(in srgb, var(--error), var(--text-muted) 55%);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--neo-btn);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.close-drawer-btn:hover {
    color: #ff5050;
    box-shadow: var(--neo-pressed), 0 0 10px rgba(255, 60, 60, 0.15);
}

/* Section labels */
.settings-col-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand-orange);
}

.settings-col-header svg { opacity: 0.8; flex-shrink: 0; }

.settings-col-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
}

/* Help text */
.settings-help {
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.45;
    margin-top: -0.35rem;
}

/* Section divider */
.settings-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0.2rem 0;
}

/* Template file selector */
.template-selector-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem !important;
}

.template-selector-group label {
    font-size: 0.68rem !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

/* Neomorphic inset select — sidebar only */
.sidebar-panel select {
    width: 100%;
    padding: 0.6rem 2.2rem 0.6rem 0.85rem;
    background: var(--bg-primary);
    border: none;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: var(--neo-inset);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='rgba(255%2C255%2C255%2C0.25)' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    transition: box-shadow 0.2s ease;
}

.sidebar-panel select:focus {
    box-shadow: var(--neo-inset), 0 0 0 2px rgba(255, 122, 42, 0.3);
}

.sidebar-panel select option { background: var(--bg-primary); color: var(--text-primary); }

/* Sidebar micro-label */
.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
    margin: 0;
}

/* Options list */
.template-options-list {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.template-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    cursor: pointer;
    font-size: 0.83rem;
    color: var(--text-muted);
    user-select: none;
    transition: color 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.template-option:last-child { border-bottom: none; }
.template-option:hover { color: var(--text-secondary); }
.template-option input[type="checkbox"] { display: none; }

.option-label { flex: 1; line-height: 1.35; }

/* Neomorphic toggle — inset track, raised glowing knob when on */
.checkbox-custom {
    width: 34px;
    height: 19px;
    border-radius: 20px;
    background: var(--bg-deep);
    position: relative;
    flex-shrink: 0;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.78),
                inset -1px -1px 3px rgba(255, 255, 255, 0.03);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.checkbox-custom::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7), -1px -1px 2px rgba(255, 255, 255, 0.04);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.25s ease, box-shadow 0.25s ease;
}

.template-option input[type="checkbox"]:checked + .checkbox-custom {
    background: rgba(255, 122, 42, 0.1);
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.6),
                inset -1px -1px 3px rgba(255, 255, 255, 0.025),
                0 0 10px rgba(255, 122, 42, 0.18);
}

.template-option input[type="checkbox"]:checked + .checkbox-custom::after {
    transform: translateX(15px);
    background: var(--brand-orange);
    box-shadow: 0 0 8px rgba(255, 122, 42, 0.65), 1px 1px 3px rgba(0, 0, 0, 0.4);
}

/* Markup charges table */
.settings-table-wrapper {
    overflow: visible;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
}

.settings-table th, .settings-table td {
    padding: 0.45rem 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.82rem;
    vertical-align: middle;
}

.settings-table th {
    background: var(--bg-deep);
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-align: left;
}

.settings-table tr:last-child td { border-bottom: none; }

/* Table inputs */
.settings-table .grid-cell-input {
    width: 100%;
    background: var(--bg-primary);
    border: none;
    color: var(--text-primary);
    padding: 0.38rem 0.55rem;
    border-radius: 7px;
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    box-shadow: var(--neo-inset);
    transition: box-shadow 0.2s ease;
}

.settings-table .grid-cell-input:focus {
    box-shadow: var(--neo-inset), 0 0 0 2px rgba(255, 122, 42, 0.25);
}

.settings-table .grid-cell-input::placeholder { color: var(--text-muted); }

/* Delete button */
.settings-table .grid-delete-btn {
    background: var(--bg-primary);
    border: none;
    color: rgba(255, 80, 80, 0.4);
    width: 26px; height: 26px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--neo-btn);
    transition: all 0.18s ease;
    padding: 0;
}

.settings-table .grid-delete-btn:hover {
    color: #ff5050;
    box-shadow: var(--neo-pressed), 0 0 8px rgba(255, 60, 60, 0.2);
}

/* Add markup row */
.small-btn {
    padding: 0.55rem 1rem !important;
    font-size: 0.82rem !important;
    border-radius: 9px !important;
    align-self: stretch;
}

#addLandingChargeBtn {
    background: var(--bg-deep) !important;
    border: none !important;
    color: var(--text-muted);
    box-shadow: var(--neo-btn) !important;
    transition: color 0.18s ease, box-shadow 0.18s ease;
    margin: 0.5rem;
    width: calc(100% - 1rem);
    justify-content: center;
    transform: none !important;
}

#addLandingChargeBtn:hover {
    color: var(--brand-orange);
    box-shadow: 0 0 10px var(--neo-dark), 0 0 14px rgba(255, 122, 42, 0.1) !important;
}

#addLandingChargeBtn:active {
    box-shadow: var(--neo-pressed) !important;
}

.settings-table .charge-pct-input { font-family: 'Space Mono', monospace; font-size: 0.82rem; }

/* Inline new-template form */
.new-template-form {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.new-template-form-btns {
    display: flex;
    gap: 0.4rem;
}

/* Custom template picker */
.tmpl-picker {
    position: relative;
}

.tmpl-picker-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.9rem 0.65rem 1.5rem;
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--neo-btn);
    transition: border-color 0.2s, box-shadow 0.15s;
    text-align: left;
    gap: 0.5rem;
}

.tmpl-picker-trigger:hover { border-color: rgba(255, 255, 255, 0.15); box-shadow: var(--neo-raised); }
.tmpl-picker-trigger.open { border-color: rgba(255, 122, 42, 0.45); box-shadow: var(--neo-pressed), 0 0 0 2px rgba(255, 122, 42, 0.15); }
.tmpl-picker-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmpl-picker-chevron { transition: transform 0.2s; opacity: 0.4; flex-shrink: 0; }
.tmpl-picker-trigger.open .tmpl-picker-chevron { transform: rotate(180deg); }

.tmpl-picker-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0; right: 0;
    background: var(--bg-deep);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.04);
    z-index: 300;
    overflow: hidden;
    padding: 0.3rem;
}

.tmpl-picker-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.12s;
}

.tmpl-picker-item:hover { background: rgba(255, 255, 255, 0.06); }
.tmpl-picker-item.selected { background: rgba(255, 122, 42, 0.1); }
.tmpl-picker-item.selected .tmpl-picker-item-name { color: var(--brand-orange); }

.tmpl-picker-item-name {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.tmpl-picker-item-edit,
.tmpl-picker-item-preview {
    background: none; border: none;
    color: var(--text-muted);
    cursor: pointer; padding: 0.2rem;
    border-radius: 4px;
    display: flex; align-items: center;
    transition: color 0.12s, opacity 0.12s;
    opacity: 0; flex-shrink: 0;
}
/* Preview (eye) stays visible so it's discoverable; rename appears on hover */
.tmpl-picker-item-preview { opacity: 0.55; }
.tmpl-picker-item:hover .tmpl-picker-item-preview { opacity: 1; }
.tmpl-picker-item-preview:hover { color: var(--brand-cyan) !important; }

.tmpl-picker-item:hover .tmpl-picker-item-edit { opacity: 1; }
.tmpl-picker-item.editing .tmpl-picker-item-edit { opacity: 1; color: var(--brand-cyan); }
.tmpl-picker-item-edit:hover { color: var(--text-secondary) !important; }

.tmpl-picker-item-input {
    flex: 1; min-width: 0;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 122, 42, 0.45);
    border-radius: 5px;
    color: var(--text-primary);
    font-size: 0.84rem; font-family: inherit;
    padding: 0.18rem 0.4rem; outline: none;
    box-shadow: 0 0 0 2px rgba(255, 122, 42, 0.12);
}

/* Template management controls */
.template-manage-btns {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* Save as template form (sidebar) */
.save-tmpl-form {
    padding: 0.6rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.save-tmpl-input {
    height: 38px !important;
}

.save-tmpl-form-btns {
    display: flex;
    gap: 0.4rem;
}

/* ═══════════════════════════════════════════════════════
   RESOURCE RATES PANEL
   ═══════════════════════════════════════════════════════ */

.rates-toggle-row {
    display: flex;
    gap: 0.5rem;
}

.rates-toggle-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-primary);
    border: none;
    border-radius: 10px;
    box-shadow: var(--neo-btn);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: box-shadow 0.15s ease, color 0.15s ease;
}

.rates-toggle-btn:hover {
    box-shadow: var(--neo-raised);
    color: var(--text-primary);
}

.rates-toggle-btn.active {
    box-shadow: var(--neo-pressed);
    color: var(--brand-cyan);
}

.rates-count {
    font-family: 'Space Mono', monospace;
    font-size: 0.68rem;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 0.1rem 0.45rem;
    color: var(--text-muted);
}

.rates-toggle-btn.active .rates-count { color: var(--brand-cyan); opacity: 0.8; }

/* Link-to-RA toggle (lives in modal toolbar) */
.rates-link-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    user-select: none;
}

.rates-link-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rates-link-track {
    width: 30px;
    height: 16px;
    border-radius: 8px;
    background: var(--bg-deep);
    box-shadow: var(--neo-inset);
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.rates-link-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, background 0.2s ease;
}

.rates-link-label input:checked + .rates-link-track { background: rgba(0, 212, 255, 0.18); }
.rates-link-label input:checked + .rates-link-track .rates-link-thumb {
    transform: translateX(14px);
    background: var(--brand-cyan);
}

.rates-link-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Search input */
.rates-search {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-deep);
    box-shadow: var(--neo-inset);
    border: none;
    border-radius: 8px;
    padding: 0.52rem 0.65rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
}

.rates-search::placeholder { color: var(--text-muted); }
.rates-search:focus { box-shadow: var(--neo-inset), 0 0 0 2px rgba(0, 212, 255, 0.15); }

/* Rate rows list */
.rates-list {
    max-height: 260px;
    overflow-y: auto;
    border-radius: 8px;
    background: var(--bg-deep);
    box-shadow: var(--neo-inset);
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

.rate-row {
    display: grid;
    grid-template-columns: 58px 1fr 36px 58px 18px;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.77rem;
}

.rate-row:last-child { border-bottom: none; }
.rate-row:nth-child(even) { background: rgba(255, 255, 255, 0.025); }

.rate-code {
    font-family: 'Space Mono', monospace;
    font-size: 0.64rem;
    color: var(--brand-cyan);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rate-desc {
    color: var(--text-secondary);
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rate-unit {
    color: var(--text-muted);
    font-size: 0.67rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rate-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg-primary);
    border: none;
    border-radius: 4px;
    box-shadow: var(--neo-inset);
    color: var(--text-primary);
    font-size: 0.74rem;
    font-family: 'Space Mono', monospace;
    padding: 0.18rem 0.3rem;
    text-align: right;
    outline: none;
}

.rate-input::-webkit-outer-spin-button,
.rate-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rate-input[type=number] { -moz-appearance: textfield; }
.rate-input:focus { box-shadow: var(--neo-inset), 0 0 0 1px rgba(0, 212, 255, 0.35); }

/* Default (BSR) rate reads neutral; a custom override is highlighted orange. */
.rate-row.rate-overridden .rate-input {
    color: var(--brand-orange);
    box-shadow: var(--neo-inset), 0 0 0 1px rgba(255, 122, 42, 0.45);
}

/* Reset-to-BSR button (visibility toggled in JS) */
.rate-reset {
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--brand-orange);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.12s, background 0.12s;
}
.rate-reset:hover { background: rgba(255, 122, 42, 0.14); color: #ff9d5c; }

/* ── Custom resources (user-added) ───────────────────────── */
.rate-row.rate-custom .rate-code { color: var(--brand-orange); }

/* Delete control (custom rows only) — sits in the 5th column like .rate-reset */
.rate-del {
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; border-radius: 4px;
    color: var(--text-muted); font-size: 0.98rem; line-height: 1;
    cursor: pointer; padding: 0; transition: color 0.12s, background 0.12s;
}
.rate-del:hover { background: rgba(255, 80, 80, 0.16); color: #ff6b6b; }

/* "+ Add custom" toolbar button */
.eqp-add { background: var(--bg-primary); color: var(--brand-cyan); box-shadow: var(--neo-btn); }
.eqp-add:hover { box-shadow: 0 0 10px var(--neo-dark); transform: translateY(-1px); }
.eqp-add:active { transform: translateY(0); box-shadow: var(--neo-pressed); }

/* Inline add-resource form (between toolbar and list) */
.add-resource-form {
    display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap;
    margin: 0.7rem 1.5rem 0;
    padding: 0.55rem 0.65rem;
    background: var(--bg-deep); border-radius: 10px; box-shadow: var(--neo-inset);
}
.add-resource-form.hidden { display: none; }
.add-res-input {
    box-sizing: border-box; background: var(--bg-primary); border: none;
    border-radius: 6px; box-shadow: var(--neo-inset); color: var(--text-primary);
    font-size: 0.78rem; padding: 0.36rem 0.45rem; outline: none; min-width: 0;
}
.add-res-input:focus { box-shadow: var(--neo-inset), 0 0 0 1px rgba(0, 212, 255, 0.35); }
.add-res-code { width: 92px; font-family: 'Space Mono', monospace; }
.add-res-desc { flex: 1; min-width: 120px; }
.add-res-unit { width: 62px; }
.add-res-rate { width: 74px; text-align: right; font-family: 'Space Mono', monospace; }
.add-res-input::-webkit-outer-spin-button,
.add-res-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.add-res-input[type=number] { -moz-appearance: textfield; }
.eqp-add-save { background: var(--brand-cyan); color: #08121a; box-shadow: var(--neo-btn); padding: 0.4rem 0.95rem; }
.eqp-add-save:hover { transform: translateY(-1px); }
.eqp-add-cancel { background: var(--bg-primary); color: var(--text-muted); box-shadow: var(--neo-btn); padding: 0.4rem 0.95rem; }

.rates-empty {
    padding: 1.2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* ── Equipment / Rates Modal ─────────────────────────────── */
.eqp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.eqp-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.eqp-backdrop.hidden { display: none; }

.eqp-modal {
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: var(--neo-float);
    width: min(660px, 94vw);
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(16px);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.eqp-backdrop.open .eqp-modal {
    transform: translateY(0);
}

.eqp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.eqp-modal-header h3 {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.eqp-close-btn {
    background: var(--bg-deep);
    border: none;
    color: color-mix(in srgb, var(--error), var(--text-muted) 55%);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--neo-btn);
    transition: color 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eqp-close-btn:hover { color: var(--error); box-shadow: var(--neo-pressed); }

.eqp-modal-toolbar {
    display: flex;
    align-items: center;
    column-gap: 0.6rem;
    row-gap: 0.55rem;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.eqp-search {
    order: 10;
    flex: none;
    width: 100%;
}

.eqp-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.52rem 1rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: box-shadow 0.16s, transform 0.14s;
    white-space: nowrap;
    text-decoration: none;
}

.eqp-download {
    background: var(--bg-primary);
    color: var(--brand-cyan);
    box-shadow: var(--neo-btn);
}

.eqp-download:hover {
    box-shadow: 0 0 10px var(--neo-dark);
    transform: translateY(-1px);
}

.eqp-download:active { transform: translateY(0); box-shadow: var(--neo-pressed); }

.eqp-upload {
    background: var(--bg-primary);
    color: var(--brand-orange);
    box-shadow: var(--neo-btn);
}

.eqp-upload:hover {
    box-shadow: 0 0 10px var(--neo-dark);
    transform: translateY(-1px);
    cursor: pointer;
}

.eqp-upload:active { transform: translateY(0); box-shadow: var(--neo-pressed); }

.eqp-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.5rem 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) transparent;
}

.eqp-list {
    max-height: none;
    border-radius: 10px;
}

/* Toast for import feedback */
.eqp-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-raised, #2e2e2e);
    color: var(--text-primary);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 10px;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--neo-float);
    z-index: 3000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.eqp-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Format pickers (quickFormatSelect / canvasTemplateSelect replacements) ── */
.fmt-picker {
    position: relative;
    flex-shrink: 0;
}

.fmt-picker-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0 0.85rem 0 1.4rem;
    background: var(--bg-primary);
    border: 1px solid rgba(255, 122, 42, 0.4);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.84rem;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--neo-btn);
    transition: border-color 0.2s, box-shadow 0.15s;
    text-align: left;
    white-space: nowrap;
}

.fmt-picker-trigger:hover {
    border-color: rgba(255, 122, 42, 0.65);
    box-shadow: var(--neo-raised);
}

.fmt-picker-trigger.open {
    border-color: rgba(255, 122, 42, 0.65);
    box-shadow: var(--neo-pressed), 0 0 0 2px rgba(255, 122, 42, 0.15);
}

.fmt-picker-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmt-picker-chevron { transition: transform 0.2s; opacity: 0.45; flex-shrink: 0; }
.fmt-picker-trigger.open .fmt-picker-chevron { transform: rotate(180deg); }

.fmt-picker-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    min-width: 100%;
    background: var(--bg-deep);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.04);
    z-index: 500;
    overflow: hidden;
    padding: 0.3rem;
}

.fmt-picker-item {
    padding: 0.45rem 0.65rem;
    border-radius: 7px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.12s;
    white-space: nowrap;
}

.fmt-picker-item:hover { background: rgba(255, 255, 255, 0.06); }
.fmt-picker-item.selected { background: rgba(255, 122, 42, 0.1); color: var(--brand-orange); }

/* Card header — matches .item-code height */
.card-fmt-picker .fmt-picker-trigger { height: 2.6rem; }

/* Canvas header — matches .sheet-preset-btn height */
.canvas-fmt-picker .fmt-picker-trigger { height: 30px; font-size: 0.8rem; border-radius: 8px; }
