* {
    box-sizing: border-box;
}

body {
    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f4f6f8;
    color: #1f2937;
}


/* =========================
   PAGE LAYOUT
   ========================= */

.container {
    max-width: 700px;
    margin: auto;
    padding: 24px 16px 50px;
}

.narrow-container {
    max-width: 440px;
    margin: auto;
    padding: 40px 20px;
}


/* =========================
   HEADER
   ========================= */

.header {
    margin-bottom: 28px;
}

.header h1 {
    margin: 0;
    font-size: 30px;
}

.header p {
    margin-top: 6px;
    color: #6b7280;
}

.brand-header {
    margin-bottom: 18px;
}

.brand-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;
}

.logo-wrap {
    flex: 1;
    min-width: 0;
}

.site-logo {
    display: block;

    width: 280px;
    max-width: 85%;

    height: auto;

    object-fit: contain;
}

.site-logo-light {
    display: block;
}

.site-logo-dark {
    display: none;
}

.site-tagline {
    margin: 8px 0 0 0;

    color: #6b7280;

    font-size: 16px;
}


/* =========================
   THEME BUTTON
   ========================= */

.theme-toggle {
    width: 58px;
    height: 48px;

    min-width: 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    padding: 0;

    border: 1px solid #cbd5e1;
    border-radius: 24px;

    background: #ffffff;
    color: #111827;

    font-size: 24px;
    font-weight: 700;

    line-height: 1;

    cursor: pointer;

    -webkit-appearance: none;
    appearance: none;
}


/* =========================
   USER BAR
   ========================= */

.user-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 14px;
}

.user-bar form {
    margin: 0;
}


/* =========================
   GENERAL BUTTONS
   ========================= */

.login-button,
.account-button,
.logout-button,
.primary-button {
    border-radius: 10px;

    font-size: 15px;
    font-weight: 700;
}

.login-button {
    display: inline-block;

    margin-top: 14px;
    padding: 12px 18px;

    background: #111827;
    color: white;

    text-decoration: none;
}

.account-button {
    display: inline-block;

    padding: 10px 14px;

    background: white;
    color: #111827;

    text-decoration: none;

    border: 1px solid #d1d5db;
}

.logout-button {
    border: 0;

    background: #111827;
    color: white;

    padding: 10px 14px;
}


/* =========================
   SECTIONS
   ========================= */

.section {
    margin-bottom: 30px;
}

.section-title {
    margin-bottom: 12px;

    font-size: 18px;
    font-weight: 700;
}


/* =========================
   RESOURCE LINKS
   ========================= */

.links-grid {
    display: grid;
    grid-template-columns: 1fr;

    gap: 12px;
}

.button {
    display: flex;
    align-items: center;

    gap: 13px;

    min-height: 72px;

    padding: 14px 18px;

    text-decoration: none;

    background: white;
    color: #111827;

    border: 1px solid #d1d5db;
    border-radius: 14px;

    font-size: 17px;
    font-weight: 600;
}

.resource-logo {
    width: 44px;
    height: 44px;

    object-fit: contain;

    flex-shrink: 0;
}


/* =========================
   CARDS
   ========================= */

.stock-card,
.form-card {
    background: white;

    border: 1px solid #d1d5db;
    border-radius: 16px;

    padding: 20px;
}

.form-card {
    border-radius: 18px;
    padding: 24px;
}

.stock-card h2,
.form-card h1 {
    margin-top: 0;
}

.form-card h1 {
    margin-bottom: 8px;
    font-size: 27px;
}

.subtitle {
    margin-top: 0;
    margin-bottom: 24px;

    color: #6b7280;
}


/* =========================
   INPUTS
   ========================= */

.search,
.form-input {
    width: 100%;

    padding: 14px;

    font-size: 16px;

    border: 1px solid #cbd5e1;
    border-radius: 10px;

    background: white;
    color: #1f2937;
}

.search {
    margin-bottom: 12px;
}

.form-input {
    margin-bottom: 14px;
}

.form-label {
    display: block;

    margin-top: 18px;
    margin-bottom: 6px;

    font-weight: 600;
}

.primary-button {
    width: 100%;

    padding: 14px;

    border: 0;

    background: #111827;
    color: white;

    font-size: 16px;
}

.form-button {
    margin-top: 24px;
}


/* =========================
   PART LOOKUP
   ========================= */

.lookup-status {
    display: none;

    margin-bottom: 12px;
    padding: 12px;

    border-radius: 10px;

    font-size: 14px;
}

.lookup-loading {
    display: block;

    background: #f3f4f6;
    color: #4b5563;
}

.lookup-found {
    display: block;

    background: #ecfdf5;
    color: #065f46;
}

.lookup-new {
    display: block;

    background: #eff6ff;
    color: #1e40af;
}

.match-list {
    display: none;

    margin-bottom: 12px;

    border: 1px solid #d1d5db;
    border-radius: 12px;

    overflow: hidden;
}

.match-list.visible {
    display: block;
}

.match-title {
    padding: 10px 12px;

    background: #f8fafc;
    color: #6b7280;

    font-size: 13px;
    font-weight: 600;

    border-bottom: 1px solid #e5e7eb;
}

.match-option {
    width: 100%;

    display: block;

    padding: 13px 12px;

    background: white;
    color: #111827;

    border: 0;
    border-bottom: 1px solid #e5e7eb;

    text-align: left;
}

.match-option:last-child {
    border-bottom: 0;
}

.match-option:active {
    background: #f3f4f6;
}

.match-part-number {
    display: block;

    font-size: 16px;
    font-weight: 700;
}

.match-description {
    display: block;

    margin-top: 3px;

    color: #4b5563;

    font-size: 14px;
}

.match-brand {
    display: block;

    margin-top: 2px;

    color: #9ca3af;

    font-size: 13px;
}

.selected-match {
    margin-bottom: 12px;
    padding: 12px;

    background: #ecfdf5;
    color: #065f46;

    border-radius: 10px;

    font-size: 14px;
}


/* =========================
   MESSAGES
   ========================= */

.message {
    margin-top: 14px;
    padding: 12px;

    background: #ecfdf5;
    color: #065f46;

    border-radius: 10px;

    font-size: 14px;
}

.error-box {
    margin-top: 8px;
    padding: 10px;

    background: #fef2f2;
    color: #991b1b;

    border-radius: 10px;
}

.help {
    margin-top: 6px;

    color: #6b7280;

    font-size: 13px;
    line-height: 1.4;
}

.back-link {
    display: block;

    margin-top: 20px;

    text-align: center;

    color: #4b5563;

    text-decoration: none;
}


/* =========================
   STOCK SEARCH
   ========================= */

.stock-search-wrap {
    position: relative;

    margin-top: 28px;
    margin-bottom: 14px;
}

.stock-search {
    width: 100%;

    padding:
        13px
        46px
        13px
        14px;

    border: 1px solid #cbd5e1;
    border-radius: 10px;

    background: white;
    color: #111827;

    font-size: 16px;
}

.stock-search::placeholder {
    color: #94a3b8;
}

.stock-search-clear {
    position: absolute;

    top: 50%;
    right: 7px;

    transform: translateY(-50%);

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: #64748b;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;
}

.stock-search-clear:active {
    background: #f1f5f9;
}

.search-empty {
    padding-top: 12px;
}


/* =========================
   INVENTORY TABS
   ========================= */

.inventory-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;

    margin-top: 18px;
    margin-bottom: 18px;

    padding: 4px;

    background: #f1f5f9;

    border-radius: 12px;
}

.inventory-tab {
    position: relative;

    padding: 12px 8px;

    border: 0;
    border-radius: 9px;

    background: transparent;
    color: #64748b;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;
}

.inventory-tab.active {
    background: white;
    color: #111827;

    box-shadow:
        0 1px 3px
        rgba(0, 0, 0, 0.10);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 22px;
    height: 22px;

    margin-left: 4px;
    padding: 0 6px;

    border-radius: 20px;

    background: #dc2626;
    color: white;

    font-size: 12px;
    font-weight: 700;
}

.inventory-panel {
    display: none;
}

.inventory-panel.active {
    display: block;
}

.tab-empty {
    padding: 18px 0 8px;
}


/* =========================
   INVENTORY ITEMS
   ========================= */

.inventory-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    gap: 16px;

    padding: 16px 0;

    border-bottom: 1px solid #e5e7eb;
}

.inventory-item:last-child {
    border-bottom: 0;
}

.part-info {
    min-width: 0;
    flex: 1;
}

.part-heading-row {
    display: flex;
    align-items: center;

    gap: 9px;
}

.part-number {
    font-size: 17px;
}

.part-description {
    margin-top: 4px;

    color: #4b5563;
}

.part-brand {
    margin-top: 3px;

    color: #9ca3af;

    font-size: 14px;
}

.part-location {
    margin-top: 8px;

    color: #4b5563;

    font-size: 14px;
}

.part-location span {
    color: #9ca3af;
}

.quantity-controls {
    display: flex;
    align-items: center;

    gap: 8px;
}

.quantity-controls form {
    margin: 0;
}

.quantity {
    min-width: 32px;

    text-align: center;

    font-size: 20px;
    font-weight: 700;
}

.quantity-button {
    width: 42px;
    height: 42px;

    border: 1px solid #d1d5db;
    border-radius: 10px;

    background: white;
    color: #111827;

    font-size: 25px;
    font-weight: 600;
}


/* =========================
   EDIT PART
   ========================= */

.edit-part-button {
    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    padding: 0;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    background: #f8fafc;
    color: #4b5563;

    font-size: 16px;

    cursor: pointer;

    -webkit-appearance: none;
    appearance: none;
}

.part-edit-form {
    display: none;

    margin-top: 13px;
    margin-bottom: 4px;

    padding: 13px;

    background: #f8fafc;

    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.part-edit-form.visible {
    display: block;
}

.part-edit-number {
    margin-bottom: 12px;

    color: #64748b;

    font-size: 13px;
}

.part-edit-label {
    display: block;

    margin-top: 9px;
    margin-bottom: 5px;

    color: #4b5563;

    font-size: 13px;
    font-weight: 600;
}

.part-edit-input {
    width: 100%;

    margin-bottom: 3px;
    padding: 10px 11px;

    border: 1px solid #cbd5e1;
    border-radius: 8px;

    background: white;
    color: #111827;

    font-size: 14px;
}

.part-edit-actions {
    display: flex;

    gap: 8px;

    margin-top: 12px;
}

.part-edit-save,
.part-edit-cancel {
    padding: 9px 14px;

    border-radius: 8px;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.part-edit-save {
    border: 0;

    background: #111827;
    color: white;
}

.part-edit-cancel {
    border: 1px solid #d1d5db;

    background: white;
    color: #4b5563;
}


/* =========================
   RESTOCK
   ========================= */

.restock-item {
    padding: 16px 0;

    border-bottom: 1px solid #e5e7eb;
}

.restock-item:last-child {
    border-bottom: 0;
}

.restock-info {
    margin-bottom: 12px;
}

.restock-actions {
    display: flex;

    gap: 8px;
}

.restock-actions form {
    margin: 0;
}

.received-button {
    padding: 9px 14px;

    border: 0;
    border-radius: 9px;

    background: #111827;
    color: white;

    font-size: 14px;
    font-weight: 700;
}

.delete-button {
    padding: 9px 14px;

    border: 1px solid #d1d5db;
    border-radius: 9px;

    background: white;
    color: #991b1b;

    font-size: 14px;
    font-weight: 700;
}


/* =========================
   MISC
   ========================= */

.empty-stock {
    color: #6b7280;
}

.footer {
    margin-top: 40px;

    text-align: center;

    color: #9ca3af;

    font-size: 13px;
}


/* =========================
   DARK THEME
   ========================= */

html[data-theme="dark"] body {
    background: #0f172a;
    color: #e5e7eb;
}

html[data-theme="dark"] .header p,
html[data-theme="dark"] .site-tagline,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .empty-stock,
html[data-theme="dark"] .part-brand,
html[data-theme="dark"] .help,
html[data-theme="dark"] .back-link,
html[data-theme="dark"] .part-location {
    color: #94a3b8;
}

html[data-theme="dark"] .part-location span {
    color: #64748b;
}

html[data-theme="dark"] .stock-card,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .button,
html[data-theme="dark"] .account-button,
html[data-theme="dark"] .quantity-button,
html[data-theme="dark"] .match-option {
    background: #111827;

    color: #f8fafc;

    border-color: #334155;
}

html[data-theme="dark"] .button {
    color: #f8fafc;
}

html[data-theme="dark"] .search,
html[data-theme="dark"] .form-input {
    background: #0f172a;

    color: #f8fafc;

    border-color: #334155;
}

html[data-theme="dark"] .search::placeholder,
html[data-theme="dark"] .form-input::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .primary-button,
html[data-theme="dark"] .logout-button,
html[data-theme="dark"] .received-button {
    background: #f8fafc;

    color: #111827;
}

html[data-theme="dark"] .account-button {
    background: #111827;

    color: #f8fafc;
}

html[data-theme="dark"] .inventory-tabs {
    background: #1e293b;
}

html[data-theme="dark"] .inventory-tab {
    color: #94a3b8;
}

html[data-theme="dark"] .inventory-tab.active {
    background: #334155;

    color: white;
}

html[data-theme="dark"] .inventory-item,
html[data-theme="dark"] .restock-item {
    border-color: #334155;
}

html[data-theme="dark"] .part-description {
    color: #cbd5e1;
}

html[data-theme="dark"] .lookup-loading {
    background: #1e293b;

    color: #cbd5e1;
}

html[data-theme="dark"] .lookup-found,
html[data-theme="dark"] .selected-match,
html[data-theme="dark"] .message {
    background: #052e2b;

    color: #6ee7b7;
}

html[data-theme="dark"] .lookup-new {
    background: #172554;

    color: #93c5fd;
}

html[data-theme="dark"] .match-list {
    border-color: #334155;
}

html[data-theme="dark"] .match-title {
    background: #1e293b;

    color: #94a3b8;

    border-color: #334155;
}

html[data-theme="dark"] .match-option {
    border-color: #334155;
}

html[data-theme="dark"] .match-option:active {
    background: #1e293b;
}

html[data-theme="dark"] .error-box {
    background: #450a0a;

    color: #fca5a5;
}

html[data-theme="dark"] .delete-button {
    background: #111827;

    color: #fca5a5;

    border-color: #475569;
}

html[data-theme="dark"] .footer {
    color: #64748b;
}

html[data-theme="dark"] .theme-toggle {
    background: #1e293b;

    color: #f8fafc;

    border-color: #475569;
}

html[data-theme="dark"] .stock-search {
    background: #0f172a;

    color: #f8fafc;

    border-color: #334155;
}

html[data-theme="dark"] .stock-search::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .stock-search-clear {
    color: #94a3b8;
}

html[data-theme="dark"] .stock-search-clear:active {
    background: #1e293b;
}

html[data-theme="dark"] .edit-part-button {
    background: #111827;

    color: #cbd5e1;

    border-color: #475569;
}

html[data-theme="dark"] .part-edit-form {
    background: #0f172a;

    border-color: #334155;
}

html[data-theme="dark"] .part-edit-number,
html[data-theme="dark"] .part-edit-label {
    color: #94a3b8;
}

html[data-theme="dark"] .part-edit-input {
    background: #111827;

    color: #f8fafc;

    border-color: #475569;
}

html[data-theme="dark"] .part-edit-input::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .part-edit-save {
    background: #f8fafc;

    color: #111827;
}

html[data-theme="dark"] .part-edit-cancel {
    background: #111827;

    color: #cbd5e1;

    border-color: #475569;
}


/* =========================
   LOGO THEME
   ========================= */

html[data-theme="dark"] .site-logo-light {
    display: none;
}

html[data-theme="dark"] .site-logo-dark {
    display: block;
}

html[data-theme="light"] .site-logo-light {
    display: block;
}

html[data-theme="light"] .site-logo-dark {
    display: none;
}


/* =========================
   RESPONSIVE
   ========================= */

@media (min-width: 600px) {

    .links-grid {
        grid-template-columns: 1fr 1fr;
    }

}

@media (max-width: 480px) {

    .site-logo {
        width: 250px;
        max-width: 90%;
    }

    .theme-toggle {
        width: 58px;
        height: 48px;

        min-width: 58px;
    }

}

/* =========================
   INVENTORY VISIBILITY
   ========================= */

.inventory-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    gap: 12px;

    flex-shrink: 0;
}

.visibility-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 9px;
}

.visibility-form {
    margin: 0;
}

.visibility-help-button {
    width: 30px;
    height: 30px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: #14b8a6;
    color: white;

    font-size: 18px;
    font-weight: 800;
    line-height: 1;

    cursor: pointer;

    -webkit-appearance: none;
    appearance: none;
}

.visibility-toggle {
    position: relative;

    width: 56px;
    height: 32px;

    flex-shrink: 0;

    padding: 0;

    border: 0;
    border-radius: 999px;

    cursor: pointer;

    transition:
        background 0.18s ease;

    -webkit-appearance: none;
    appearance: none;
}

.visibility-toggle-knob {
    position: absolute;

    top: 4px;
    left: 4px;

    width: 24px;
    height: 24px;

    border-radius: 50%;

    background: white;

    box-shadow:
        0 1px 4px
        rgba(0, 0, 0, 0.28);

    transition:
        transform 0.18s ease;
}

.visibility-toggle.is-on {
    background: #8b5cf6;
}

.visibility-toggle.is-on
.visibility-toggle-knob {
    transform: translateX(24px);
}

.visibility-toggle.is-off {
    background: #94a3b8;
}

.visibility-toggle.is-off
.visibility-toggle-knob {
    transform: translateX(0);
}

.visibility-toggle:disabled {
    opacity: 0.65;
    cursor: wait;
}

html[data-theme="dark"]
.visibility-help-button {
    background: #14b8a6;
    color: white;
}

html[data-theme="dark"]
.visibility-toggle.is-off {
    background: #475569;
}

/* =========================
   MY STOCK HEADER
   ========================= */

.stock-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 18px;
}

.stock-card-header h2 {
    margin: 0;
}

.team-stock-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    padding: 10px 14px;

    border-radius: 999px;

    background: #8b5cf6;
    color: #ffffff;

    text-decoration: none;

    font-size: 14px;
    font-weight: 700;
}

.team-stock-button:active {
    transform: scale(0.97);
}


/* =========================
   TEAM STOCK PAGE
   ========================= */

.team-stock-page {
    max-width: 700px;
}

.team-page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;

    margin-bottom: 28px;
}

.team-back-button {
    display: inline-flex;
    align-items: center;

    min-height: 44px;

    padding: 10px 14px;

    border: 1px solid #d1d5db;
    border-radius: 10px;

    background: #ffffff;
    color: #111827;

    text-decoration: none;

    font-size: 15px;
    font-weight: 700;
}

.team-stock-heading {
    margin-bottom: 18px;
}

.team-stock-heading h1 {
    margin: 0;

    font-size: 30px;
}

.team-stock-heading p {
    margin: 7px 0 0;

    color: #6b7280;

    font-size: 16px;
}

.team-search-card {
    padding: 18px;

    border: 1px solid #d1d5db;
    border-radius: 16px;

    background: #ffffff;
}

.team-search-form {
    display: flex;

    gap: 10px;
}

.team-search-input {
    min-width: 0;
    width: 100%;

    padding: 13px 14px;

    border: 1px solid #cbd5e1;
    border-radius: 10px;

    background: #ffffff;
    color: #111827;

    font-size: 16px;
}

.team-search-submit {
    flex-shrink: 0;

    padding: 12px 17px;

    border: 0;
    border-radius: 10px;

    background: #8b5cf6;
    color: #ffffff;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;
}

.team-privacy-note {
    margin-top: 11px;

    color: #6b7280;

    font-size: 13px;
}

.team-search-message {
    margin-top: 18px;
    padding: 18px;

    border: 1px solid #d1d5db;
    border-radius: 14px;

    background: #ffffff;
    color: #4b5563;
}

.team-results-heading {
    margin-top: 26px;
    margin-bottom: 12px;

    font-size: 18px;
    font-weight: 700;
}

.team-results {
    display: grid;

    gap: 14px;
}

.team-part-card {
    padding: 18px;

    border: 1px solid #d1d5db;
    border-radius: 16px;

    background: #ffffff;
}

.team-part-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 14px;
}

.team-part-number {
    font-size: 19px;
    font-weight: 800;
}

.team-part-description {
    margin-top: 5px;

    color: #4b5563;

    font-size: 16px;
}

.team-part-brand {
    margin-top: 4px;

    color: #9ca3af;

    font-size: 14px;
}

.team-total-quantity {
    flex-shrink: 0;

    padding: 6px 10px;

    border-radius: 999px;

    background: #ede9fe;
    color: #6d28d9;

    font-size: 13px;
}

.team-total-quantity strong {
    margin-left: 3px;
}

.team-holders {
    margin-top: 16px;

    border-top: 1px solid #e5e7eb;
}

.team-holder {
    padding: 13px 0;

    border-bottom: 1px solid #e5e7eb;
}

.team-holder:last-child {
    padding-bottom: 0;

    border-bottom: 0;
}

.team-holder-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.team-tech-name {
    font-size: 15px;
}

.team-tech-quantity {
    padding: 5px 9px;

    border-radius: 999px;

    background: #f1f5f9;
    color: #475569;

    font-size: 12px;
    font-weight: 700;
}

.team-tech-location {
    margin-top: 5px;

    color: #64748b;

    font-size: 13px;
}


/* Team stock dark theme */

html[data-theme="dark"]
.team-back-button,
html[data-theme="dark"]
.team-search-card,
html[data-theme="dark"]
.team-search-message,
html[data-theme="dark"]
.team-part-card {
    background: #111827;
    color: #f8fafc;
    border-color: #334155;
}

html[data-theme="dark"]
.team-stock-heading p,
html[data-theme="dark"]
.team-privacy-note,
html[data-theme="dark"]
.team-tech-location {
    color: #94a3b8;
}

html[data-theme="dark"]
.team-search-input {
    background: #0f172a;
    color: #f8fafc;
    border-color: #334155;
}

html[data-theme="dark"]
.team-search-input::placeholder {
    color: #64748b;
}

html[data-theme="dark"]
.team-part-description {
    color: #cbd5e1;
}

html[data-theme="dark"]
.team-part-brand {
    color: #94a3b8;
}

html[data-theme="dark"]
.team-holders,
html[data-theme="dark"]
.team-holder {
    border-color: #334155;
}

html[data-theme="dark"]
.team-tech-quantity {
    background: #1e293b;
    color: #cbd5e1;
}

html[data-theme="dark"]
.team-total-quantity {
    background: #2e1065;
    color: #c4b5fd;
}


/* Team stock mobile */

@media (max-width: 480px) {

    .team-stock-button {
        padding: 9px 12px;

        font-size: 13px;
    }

    .team-search-form {
        flex-direction: column;
    }

    .team-search-submit {
        width: 100%;

        min-height: 46px;
    }

}

/* =========================
   BARCODE / QR SCANNER
   ========================= */

.part-number-scan-row {
    display: flex;
    align-items: stretch;

    gap: 8px;

    margin-bottom: 12px;
}

.part-number-scan-row .search {
    min-width: 0;

    margin-bottom: 0;
}

.barcode-scan-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    min-height: 46px;

    padding: 10px 13px;

    border: 0;
    border-radius: 10px;

    background: #8b5cf6;
    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    white-space: nowrap;

    cursor: pointer;

    -webkit-appearance: none;
    appearance: none;
}

.barcode-scan-button:active {
    transform: scale(0.97);
}


/* Team stock scan row */

.team-search-input-row {
    display: flex;

    flex: 1;

    min-width: 0;

    gap: 8px;
}

.team-search-input-row
.team-search-input {
    min-width: 0;
}


/* Scanner overlay */

body.scanner-open {
    overflow: hidden;
}

.scanner-modal {
    position: fixed;

    inset: 0;

    z-index: 9999;

    display: none;

    align-items: flex-end;
    justify-content: center;
}

.scanner-modal.visible {
    display: flex;
}

.scanner-backdrop {
    position: absolute;

    inset: 0;

    background:
        rgba(0, 0, 0, 0.68);

    backdrop-filter:
        blur(3px);

    -webkit-backdrop-filter:
        blur(3px);
}

.scanner-sheet {
    position: relative;

    z-index: 1;

    width: 100%;
    max-width: 620px;

    max-height: 92vh;

    padding: 18px;

    border-radius:
        22px
        22px
        0
        0;

    background: #ffffff;
    color: #111827;

    overflow-y: auto;

    box-shadow:
        0 -8px 40px
        rgba(0, 0, 0, 0.30);
}

.scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 14px;

    font-size: 20px;
}

.scanner-close {
    width: 40px;
    height: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: #f1f5f9;
    color: #475569;

    font-size: 28px;
    line-height: 1;

    cursor: pointer;

    -webkit-appearance: none;
    appearance: none;
}

.barcode-reader {
    width: 100%;

    min-height: 260px;

    overflow: hidden;

    border-radius: 14px;

    background: #000000;
}

.barcode-reader video {
    border-radius: 14px;
}

.scanner-status {
    margin-top: 14px;

    text-align: center;

    font-size: 15px;
    font-weight: 600;
}

.scanner-hint {
    margin-top: 7px;

    text-align: center;

    color: #64748b;

    font-size: 13px;
}


/* Scanner dark mode */

html[data-theme="dark"]
.scanner-sheet {
    background: #111827;
    color: #f8fafc;
}

html[data-theme="dark"]
.scanner-close {
    background: #1e293b;
    color: #cbd5e1;
}

html[data-theme="dark"]
.scanner-hint {
    color: #94a3b8;
}


/* Scanner mobile */

@media (max-width: 480px) {

    .barcode-scan-button {
        padding: 9px 11px;

        font-size: 13px;
    }

    .scanner-sheet {
        padding:
            16px
            14px
            24px;
    }

    .barcode-reader {
        min-height: 240px;
    }

}

/* =========================
   QUAGGA2 CAMERA
   ========================= */

.barcode-reader {
    position: relative;
}

.barcode-reader video {
    width: 100% !important;
    height: 100% !important;

    min-height: 260px;

    object-fit: cover;

    display: block;

    border-radius: 14px;
}

.barcode-reader canvas {
    position: absolute;

    inset: 0;

    width: 100% !important;
    height: 100% !important;

    pointer-events: none;
}

/* Visible aiming box */

.barcode-reader::after {
    content: "";

    position: absolute;

    left: 6%;
    right: 6%;

    top: 32%;
    bottom: 32%;

    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 10px;

    box-shadow:
        0 0 0 999px
        rgba(0, 0, 0, 0.12);

    pointer-events: none;
}

/* =========================
   PART QUOTE
   ========================= */

.part-quote-page {
    width: min(680px, calc(100% - 24px));
    margin: 22px auto 60px;
    padding-bottom: 120px;
}


/* =========================
   QUOTE FORM
   ========================= */

.quote-editor-card {
    background: #ffffff;
    color: #181818;

    border: 1px solid #e1e1e5;
    border-radius: 18px;

    padding: 22px;

    box-shadow:
        0 8px 30px
        rgba(0, 0, 0, 0.07);
}

.quote-editor-top h1 {
    margin: 16px 0 4px;

    color: #181818;

    font-size: 28px;
}

.quote-editor-top p {
    margin: 0 0 24px;

    color: #555555;

    opacity: 1;
}

.quote-back-link {
    color: #6f2da8;

    text-decoration: none;

    font-weight: 700;
}

.quote-label {
    display: block;

    margin: 18px 0 7px;

    color: #303030;

    font-size: 14px;
    font-weight: 700;
}

.quote-input,
.quote-textarea {
    width: 100%;

    padding: 13px 14px;

    border: 1px solid #bfc0c5;
    border-radius: 12px;

    background: #ffffff;
    color: #202020;

    font: inherit;

    box-sizing: border-box;
}

.quote-input {
    font-weight: 500;
}

.quote-input::placeholder,
.quote-textarea::placeholder {
    color: #96969c;

    opacity: 1;
}

.quote-textarea {
    min-height: 190px;

    resize: vertical;
}

.quote-button-row {
    display: flex;

    gap: 10px;

    margin-top: 20px;
    margin-bottom: 35px;
}

.quote-parse-button,
.quote-generate-button,
.quote-new-button {
    border: 0;
    border-radius: 12px;

    padding: 14px 16px;

    font: inherit;
    font-weight: 800;

    cursor: pointer;

    text-align: center;
    text-decoration: none;
}

.quote-parse-button {
    background: #eeeeF2;
    color: #1c1c1c;
}

.quote-generate-button {
    flex: 1;

    background: #6f42c1;
    color: #ffffff;
}

.quote-error {
    margin: 16px 0;
    padding: 12px 14px;

    border: 1px solid #f0bcbc;
    border-radius: 12px;

    background: #fff0f0;
    color: #8c1f1f;

    font-weight: 700;
}


/* =========================
   CUSTOMER RESULT
   ========================= */

.customer-part-card {
    background: #ffffff;
    color: #181818;

    border: 1px solid #e1e1e5;
    border-radius: 4px;

    padding: 24px 20px 34px;
}

.customer-part-number {
    color: #171717;

    font-size: 28px;
    line-height: 1.1;
    font-weight: 900;

    letter-spacing: 0.2px;
}

.customer-part-description {
    margin-top: 8px;

    color: #242424;

    font-size: 19px;
    line-height: 1.22;
    font-weight: 500;
}

.customer-part-manufacturer {
    display: flex;
    align-items: center;

    gap: 10px;

    margin-top: 14px;
    padding: 11px 12px;

    border: 1px solid #9c9ca2;

    color: #222222;

    font-size: 15px;
}

.customer-part-manufacturer span {
    color: #555555;
}

.customer-part-manufacturer strong {
    color: #222222;

    font-weight: 600;
}


/* =========================
   PRODUCT IMAGE PLACEHOLDER
   ========================= */

.quote-image-placeholder {
    width: min(390px, 88%);

    aspect-ratio: 1 / 1;

    margin: 28px auto 20px;
    padding: 28px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    border: 1px solid #c5c5ca;

    background: #fafafa;

    text-align: center;
}

.quote-placeholder-icon {
    width: 82px;
    height: 82px;

    margin-bottom: 18px;

    color: #aeb5bf;
}

.quote-placeholder-title {
    color: #4c4c52;

    font-size: 18px;
    font-weight: 800;
}

.quote-placeholder-text {
    max-width: 240px;

    margin-top: 7px;

    color: #77777f;

    font-size: 14px;
    line-height: 1.4;
}


/* =========================
   PRICE
   ========================= */

.customer-price-area {
    width: 100%;

    margin: 28px 0 44px;
    padding: 22px;

    border: 2px solid #d5c4f7;
    border-left: 7px solid #6f42c1;
    border-radius: 12px;

    background: #f2ecff;

    text-align: left;
}

.customer-price-label {
    color: #57515f;

    font-size: 17px;
    font-weight: 700;
}

.customer-price {
    margin-top: 5px;

    color: #111111;

    font-size: 58px;
    line-height: 1;
    font-weight: 900;

    letter-spacing: -1px;
}


/* =========================
   PRODUCT DESCRIPTION
   ========================= */

.quote-product-section {
    margin-top: 32px;
    padding-top: 24px;

    border-top: 1px solid #dedee2;

    color: #222222;
}

.quote-product-section h2 {
    margin: 0 0 16px;

    color: #171717;

    font-size: 21px;
}

.quote-product-section p {
    margin: 0 0 14px;

    color: #333333;

    font-size: 17px;
    line-height: 1.6;
}

.quote-product-specs {
    margin-top: 28px;

    color: #222222;
}

.quote-spec-row {
    display: flex;
    justify-content: space-between;

    gap: 20px;

    padding: 14px 0;

    border-top: 1px solid #ddddE2;

    color: #333333;
}

.quote-spec-row strong {
    color: #171717;

    text-align: right;
}


/* =========================
   AVAILABILITY
   ========================= */

.quote-availability-section {
    margin-top: 75px;
    padding-top: 28px;

    border-top: 2px solid #ddddE2;

    color: #222222;
}

.quote-availability-section h2 {
    margin: 0 0 20px;

    color: #171717;

    font-size: 23px;
}

.quote-location-label {
    margin-top: 12px;

    color: #555555;

    font-size: 13px;
    font-weight: 800;

    text-transform: uppercase;
}

.quote-location {
    margin-top: 5px;

    color: #171717;

    font-size: 20px;
    font-weight: 800;
}

.quote-stock-card {
    position: static;

    margin-top: 18px;
    margin-bottom: 0;
    padding: 20px;

    border: 1px solid #d7d7dc;
    border-radius: 10px;

    background: #f5f5f7;
    color: #181818;
}

.quote-stock-status {
    color: #188038;

    font-size: 21px;
    font-weight: 900;
}

.quote-stock-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;

    margin-right: 7px;

    border-radius: 50%;

    background: #188038;
    color: #ffffff;

    font-size: 17px;
}

.quote-stock-unknown {
    color: #686868;
}

.quote-stock-quantity {
    display: flex;
    justify-content: space-between;

    margin-top: 18px;
    padding-top: 14px;

    border-top: 1px solid #d7d7dc;

    color: #333333;
}

.quote-stock-quantity span {
    color: #555555;

    font-size: 13px;
    font-weight: 800;
}

.quote-stock-quantity strong {
    color: #171717;

    font-size: 20px;
}


/* =========================
   NEW QUOTE BUTTON
   ========================= */

.quote-new-button {
    position: static;

    display: block;

    width: 100%;

    margin: 55px 0 20px;
    padding: 17px 20px;

    background: #6f42c1;
    color: #ffffff;

    box-sizing: border-box;

    font-size: 17px;
}


/* =========================
   DARK THEME OVERRIDES

   The PartStock page can be dark,
   but the quote card stays white.
   ========================= */

html[data-theme="dark"] .quote-editor-card,
html[data-theme="dark"] .customer-part-card {
    background: #ffffff;
    color: #181818;

    border-color: #e1e1e5;
}

html[data-theme="dark"] .quote-editor-top h1 {
    color: #181818;
}

html[data-theme="dark"] .quote-editor-top p {
    color: #555555;
}

html[data-theme="dark"] .quote-label {
    color: #303030;
}

html[data-theme="dark"] .quote-input,
html[data-theme="dark"] .quote-textarea {
    background: #ffffff;
    color: #202020;

    border-color: #bfc0c5;
}

html[data-theme="dark"] .quote-input::placeholder,
html[data-theme="dark"] .quote-textarea::placeholder {
    color: #96969c;
}

html[data-theme="dark"] .customer-part-number {
    color: #171717;
}

html[data-theme="dark"] .customer-part-description {
    color: #242424;
}

html[data-theme="dark"] .customer-part-manufacturer {
    color: #222222;

    border-color: #9c9ca2;
}

html[data-theme="dark"] .customer-part-manufacturer span {
    color: #555555;
}

html[data-theme="dark"] .customer-part-manufacturer strong {
    color: #222222;
}

html[data-theme="dark"] .quote-image-placeholder {
    background: #fafafa;

    border-color: #c5c5ca;
}

html[data-theme="dark"] .quote-placeholder-title {
    color: #4c4c52;
}

html[data-theme="dark"] .quote-placeholder-text {
    color: #77777f;
}

html[data-theme="dark"] .customer-price-label {
    color: #57515f;
}

html[data-theme="dark"] .customer-price {
    color: #111111;
}

html[data-theme="dark"] .quote-product-section,
html[data-theme="dark"] .quote-product-section h2,
html[data-theme="dark"] .quote-product-section p,
html[data-theme="dark"] .quote-product-specs,
html[data-theme="dark"] .quote-spec-row,
html[data-theme="dark"] .quote-spec-row strong,
html[data-theme="dark"] .quote-availability-section,
html[data-theme="dark"] .quote-availability-section h2,
html[data-theme="dark"] .quote-location,
html[data-theme="dark"] .quote-stock-quantity,
html[data-theme="dark"] .quote-stock-quantity strong {
    color: #181818;
}

html[data-theme="dark"] .quote-stock-card {
    background: #f5f5f7;
    color: #181818;

    border-color: #d7d7dc;
}

html[data-theme="dark"] .quote-stock-status {
    color: #188038;
}


/* =========================
   PART QUOTE MOBILE
   ========================= */

@media (max-width: 520px) {

    .part-quote-page {
        width: 100%;

        margin-top: 0;
        padding-bottom: 130px;
    }

    .quote-editor-card {
        margin: 12px;

        padding-bottom: 32px;
    }

    .customer-part-card {
        border-left: 0;
        border-right: 0;
    }

    .quote-button-row {
        flex-direction: column;
    }

    .quote-image-placeholder {
        width: 82%;
    }

    .customer-price {
        font-size: 56px;
    }

    .customer-price-area {
        padding: 20px;
    }

}

/* ===== Part Quote Size Tuning ===== */

.quote-image-placeholder {
    width: min(330px, 76%);
    margin-top: 26px;
    margin-bottom: 24px;
}

.quote-placeholder-icon {
    width: 66px;
    height: 66px;
}

.customer-price-area {
    margin: 24px 0 38px;
    padding: 17px 20px;
}

.customer-price-label {
    font-size: 16px;
}

.customer-price {
    font-size: 44px;
    letter-spacing: -0.5px;
}

@media (max-width: 520px) {

    .quote-image-placeholder {
        width: 76%;
    }

    .customer-price {
        font-size: 44px;
    }

}
/* ===== Part Quote Price Final Tuning ===== */

.customer-price {
    font-size: 38px !important;
}

@media (max-width: 520px) {

    .customer-price {
        font-size: 34px !important;
    }

}
