:root {
    --bg: #0b1120;
    --bg-grad-a: #09111f;
    --bg-grad-b: #0b1120;
    --panel: #121a2b;
    --panel-2: #162036;
    --panel-glass: rgba(18, 26, 43, 0.85);
    --login-card-bg: rgba(18, 26, 43, 0.94);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.12);
    --text: #eef2ff;
    --muted: #94a3b8;
    --subhead: #9aa4b2;
    --accent: #60a5fa;
    --accent-deep: #2563eb;
    --accent-2: #22c55e;
    --brand-badge-end: #2563eb;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --on-accent: #ffffff;
    --input-bg: #0b1120;
    --input-fg: #ffffff;
    --select-bg: #12151c;
    --select-fg: #ffffff;
    --surface-02: rgba(255, 255, 255, 0.02);
    --surface-03: rgba(255, 255, 255, 0.03);
    --surface-04: rgba(255, 255, 255, 0.04);
    --surface-06: rgba(255, 255, 255, 0.06);
    --surface-08: rgba(255, 255, 255, 0.08);
    --surface-12: rgba(255, 255, 255, 0.12);
    --surface-18: rgba(255, 255, 255, 0.18);
    --border-input: rgba(255, 255, 255, 0.12);
    --topbar-bg: rgba(9, 17, 31, 0.97);
    --topbar-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    --nav-active-ring: rgba(96, 165, 250, 0.45);
    --caret-on-primary: rgba(255, 255, 255, 0.9);
    --account-hover: rgba(255, 255, 255, 0.06);
    --account-active-bg: rgba(96, 165, 250, 0.12);
    --account-active-border: rgba(96, 165, 250, 0.35);
    --chart-axis: rgba(255, 255, 255, 0.14);
    --chart-ylabel: rgba(148, 163, 184, 0.85);
    --chart-revenue: rgba(96, 165, 250, 0.95);
    --chart-revenue-bar: rgba(96, 165, 250, 0.85);
    --chart-revenue-legend: rgba(96, 165, 250, 0.9);
    --chart-profit: rgba(34, 197, 94, 0.95);
    --chart-cog: rgba(245, 158, 11, 0.95);
    --stat-accent-bg: linear-gradient(135deg, rgba(37, 99, 235, 0.24), rgba(34, 197, 94, 0.2));
    --dashboard-chart-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    --monthly-banner-bg: #374151;
    --monthly-banner-fg: #f9fafb;
    --monthly-line: rgba(255, 255, 255, 0.12);
    --table-footer-bg: #111827;
    --pill-input-bg: rgba(255, 255, 255, 0.06);
    --pill-focus: rgba(96, 165, 250, 0.45);
    --cell-focus-bg: rgba(96, 165, 250, 0.08);
    --cell-focus-ring: rgba(96, 165, 250, 0.45);
    --secondary-btn-bg: rgba(255, 255, 255, 0.04);
    --logo-empty: rgba(255, 255, 255, 0.7);
    color-scheme: dark;
}

body.ei-scheme-light {
    --bg: #f5f0e8;
    --bg-grad-a: #faf7f2;
    --bg-grad-b: #ebe4d8;
    --panel: #fffef9;
    --panel-2: #f3ece3;
    --panel-glass: rgba(255, 254, 249, 0.94);
    --login-card-bg: rgba(255, 254, 249, 0.96);
    --line: rgba(91, 33, 182, 0.12);
    --line-strong: rgba(91, 33, 182, 0.2);
    --text: #333333;
    --muted: #5c5668;
    --subhead: #4a4458;
    --accent: #6d28d9;
    --accent-deep: #5b21b6;
    --accent-2: #7c3aed;
    --brand-badge-end: #7c3aed;
    --shadow: 0 20px 45px rgba(91, 33, 182, 0.1);
    --on-accent: #faf5ff;
    --input-bg: #fffef9;
    --input-fg: #333333;
    --select-bg: #f3ece6;
    --select-fg: #333333;
    --surface-02: rgba(91, 33, 182, 0.035);
    --surface-03: rgba(91, 33, 182, 0.04);
    --surface-04: rgba(91, 33, 182, 0.055);
    --surface-06: rgba(91, 33, 182, 0.08);
    --surface-08: rgba(91, 33, 182, 0.1);
    --surface-12: rgba(91, 33, 182, 0.14);
    --surface-18: rgba(91, 33, 182, 0.2);
    --border-input: rgba(91, 33, 182, 0.22);
    --topbar-bg: rgba(255, 254, 249, 0.96);
    --topbar-shadow: 0 8px 24px rgba(91, 33, 182, 0.08);
    --nav-active-ring: rgba(109, 40, 217, 0.45);
    --caret-on-primary: rgba(250, 245, 255, 0.95);
    --account-hover: rgba(91, 33, 182, 0.08);
    --account-active-bg: rgba(109, 40, 217, 0.12);
    --account-active-border: rgba(109, 40, 217, 0.35);
    --chart-axis: rgba(91, 33, 182, 0.18);
    --chart-ylabel: rgba(74, 68, 88, 0.85);
    --chart-revenue: rgba(109, 40, 217, 0.9);
    --chart-revenue-bar: rgba(109, 40, 217, 0.75);
    --chart-revenue-legend: rgba(109, 40, 217, 0.82);
    --chart-profit: rgba(34, 197, 94, 0.85);
    --chart-cog: rgba(180, 130, 40, 0.9);
    --stat-accent-bg: linear-gradient(135deg, rgba(109, 40, 217, 0.18), rgba(34, 197, 94, 0.15));
    --dashboard-chart-surface: linear-gradient(180deg, rgba(91, 33, 182, 0.04), rgba(91, 33, 182, 0.02));
    --monthly-banner-bg: #5b21b6;
    --monthly-banner-fg: #faf5ff;
    --monthly-line: rgba(250, 245, 255, 0.25);
    --table-footer-bg: #ede6dd;
    --pill-input-bg: rgba(91, 33, 182, 0.07);
    --pill-focus: rgba(109, 40, 217, 0.45);
    --cell-focus-bg: rgba(109, 40, 217, 0.1);
    --cell-focus-ring: rgba(109, 40, 217, 0.45);
    --secondary-btn-bg: rgba(91, 33, 182, 0.06);
    --logo-empty: rgba(51, 51, 51, 0.55);
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-width: 0; }
body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 100%);
    color: var(--text);
}

a { color: inherit; text-decoration: none; }
small { color: var(--muted); }

.app-shell {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
}

.site-topbar {
    position: sticky;
    top: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px 24px;
    min-height: 120px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 16px 24px 16px 0;
    background: var(--topbar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--topbar-shadow);
}

.ei-media-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.ei-button.ei-button-secondary {
    padding: 10px 14px;
    border: 1px solid var(--border-input);
    border-radius: 10px;
    background: var(--secondary-btn-bg);
    color: var(--input-fg);
    cursor: pointer;
}

.ei-remove-logo.is-hidden {
    display: none;
}

.ei-logo-preview.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: var(--logo-empty);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-left: 40px;
    flex-shrink: 0;
}

.brand-logo img,
.topbar-brand .custom-logo {
    max-width: 160px;
    max-height: 72px;
    width: auto;
    height: auto;
    display: inline-block;
    object-fit: contain;
}

.brand-name-text {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
    word-break: break-word;
}

.ei-page-wrap {
    padding: 24px;
}

.ei-page-header h1 {
    margin: 0 0 6px;
}

.ei-page-header p {
    margin: 0 0 20px;
    opacity: .8;
}

.ei-profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.ei-card {
    background: var(--surface-03);
    border: 1px solid var(--surface-08);
    border-radius: 16px;
    padding: 20px;
}

.ei-card h2 {
    margin-top: 0;
    margin-bottom: 16px;
}

.ei-profile-form label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
}

.ei-profile-form input[type="text"],
.ei-profile-form input[type="email"],
.ei-profile-form input[type="password"],
.ei-profile-form input[type="url"],
.ei-profile-form input[type="date"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-input);
    background: var(--surface-04);
    color: var(--input-fg);
    box-sizing: border-box;
}

.ei-form-actions {
    margin-top: 20px;
}

.ei-button.ei-button-primary {
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: var(--on-accent);
    font-weight: 700;
}

.ei-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
}

.ei-alert-success {
    background: rgba(40, 167, 69, .15);
    border: 1px solid rgba(40, 167, 69, .4);
}

.ei-alert-error {
    background: rgba(220, 53, 69, .15);
    border: 1px solid rgba(220, 53, 69, .4);
}

.ei-logo-preview {
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    background: var(--surface-02);
    border: 1px solid var(--surface-08);
}

.ei-logo-preview img {
    max-width: 240px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}


.brand-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.brand-badge {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--brand-badge-end));
    font-weight: 700;
    font-size: 22px;
    color: var(--on-accent);
}

.brand-card h1,
.panel-header h2,
.chart-placeholder h3,
.tool-card h3 { margin: 0; }
.brand-card p,
.panel-header p,
.chart-placeholder p,
.stat-card span,
.tool-copy { color: var(--muted); margin: 4px 0 0; }

.topbar-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.topbar-nav a,
.account-dropdown__list a,
.btn-primary,
.btn-secondary,
.table-link {
    transition: 0.2s ease;
}

.topbar-nav a {
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.topbar-nav a:hover {
    background: var(--panel-2);
    transform: translateY(-1px);
}

.topbar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    justify-content: center;
    align-items: center;
}

.topbar-menu li {
    margin: 0;
    padding: 0;
}

.topbar-nav .menu-link,
.topbar-menu a,
.topbar-menu .current-menu-item > a,
.topbar-menu .current_page_item > a {
    display: inline-flex;
    align-items: center;
}

.topbar-menu .current-menu-item > a,
.topbar-menu .current_page_item > a,
.topbar-nav .menu-link.current-menu-item {
    background: var(--panel-2);
    border-color: var(--nav-active-ring);
}

.topbar-user {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    text-align: right;
}

.topbar-ticket-bell {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 4px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--secondary-btn-bg);
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.topbar-ticket-bell:hover,
.topbar-ticket-bell:focus-visible {
    background: var(--surface-08);
    border-color: var(--nav-active-ring);
    color: var(--accent);
    outline: none;
}

.topbar-ticket-bell.has-unread {
    border-color: var(--nav-active-ring);
}

.topbar-ticket-bell__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.topbar-ticket-bell__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.topbar-sync-form {
    margin: 0;
}

.topbar-sync-submit {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
}

.account-dropdown {
    position: relative;
}

.account-dropdown__toggle.btn-primary.topbar-sync-submit {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    max-width: min(240px, 46vw);
    margin: 0;
    text-align: left;
}

.account-dropdown__toggle.btn-primary .account-dropdown__caret {
    border-top-color: var(--caret-on-primary);
}

.account-dropdown__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-dropdown__caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.account-dropdown.is-open .account-dropdown__caret {
    transform: rotate(180deg);
}

.account-dropdown__popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 200;
    min-width: 240px;
    max-width: min(320px, 92vw);
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.account-dropdown__section {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.account-dropdown__section-title {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.account-dropdown__section-hint {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.35;
    color: var(--muted);
}

.account-range-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-range-form {
    margin: 0;
}

.account-range-btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 10px;
    justify-content: center;
}

.account-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-dropdown__list li {
    margin: 0;
    padding: 0;
}

.account-dropdown__list a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
}

.account-dropdown__list a:hover {
    background: var(--account-hover);
    transform: none;
}

.account-dropdown__list .menu-item--logout > a {
    color: #fca5a5;
}

.account-dropdown__list .menu-item--logout > a:hover {
    background: rgba(239, 68, 68, 0.12);
}

.account-dropdown__list .current-menu-item > a,
.account-dropdown__list .current_page_item > a {
    background: var(--account-active-bg);
    border-color: var(--account-active-border);
}

.main-content {
    padding: 28px;
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
}

/* Shipping shortcode lives in main; ensure panel can use full content width */
.gs-shipping-panel {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

.panel {
    background: var(--panel-glass);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.panel-header {
    margin-bottom: 22px;
}

.dashboard-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.dashboard-filter-bar,
.filter-form,
.quick-links-row,
.form-actions,
.row-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.dashboard-filter-bar select,
.dashboard-filter-bar input,
.inventory-form input,
.inventory-form select,
.inventory-form textarea,
.filter-form input,
.filter-form select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--input-bg);
    color: var(--text);
    box-sizing: border-box;
}

.dashboard-filter-bar select,
.dashboard-filter-bar input { width: auto; min-width: 140px; }

/* Native number/date controls can ignore inherited colors without explicit color-scheme + type rules */
.inventory-form input[type="number"],
.inventory-form input[type="date"],
.filter-form input[type="number"] {
    background: var(--input-bg);
    color: var(--text);
}

/* Shipping → Orders: lookback + download on one row (flex); bulk status row reuses same toolbar class */
.gs-orders-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.gs-orders-toolbar label {
    display: grid;
    gap: 8px;
    margin: 0;
    color: var(--text);
    font-weight: 600;
    flex: 0 1 auto;
    min-width: 0;
}

.gs-orders-toolbar .filter-actions {
    flex: 0 0 auto;
    align-self: flex-end;
}

.panel .gs-orders-toolbar .gs-pill-input {
    width: 100%;
    max-width: 280px;
    padding: 14px 22px;
    border-radius: 999px;
    border: 0;
    background: var(--pill-input-bg);
    color: var(--text);
    box-sizing: border-box;
}

.panel .gs-orders-toolbar .gs-pill-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--pill-focus);
}

/* Shipments bulk status: pill select + button on one row; dark native list where supported */
.panel .gs-orders-toolbar.gs-bulk-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    color-scheme: dark;
}

body.ei-scheme-light .panel .gs-orders-toolbar.gs-bulk-status-row {
    color-scheme: light;
}

.panel .gs-orders-toolbar.gs-bulk-status-row label {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
}

.panel .gs-orders-toolbar.gs-bulk-status-row .filter-actions {
    flex: 0 0 auto;
    align-self: flex-end;
}

.panel .gs-orders-toolbar.gs-bulk-status-row select.gs-pill-input {
    width: auto;
    min-width: min(280px, 100%);
    max-width: 280px;
    padding: 14px 40px 14px 22px;
    border-radius: 999px;
    border: 0;
    background-color: var(--pill-input-bg);
    color: var(--text);
    box-sizing: border-box;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' aria-hidden='true'%3E%3Cpath fill='%2394a3b8' d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px 14px;
    /* Hint OS / engine to render the popup with a dark palette (fixes white option list on many Chromium builds). */
    color-scheme: dark;
}

body.ei-scheme-light .panel .gs-orders-toolbar.gs-bulk-status-row select.gs-pill-input {
    color-scheme: light;
}

.panel .gs-orders-toolbar.gs-bulk-status-row select.gs-pill-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--pill-focus);
}

.panel .gs-orders-toolbar.gs-bulk-status-row select.gs-pill-input option {
    background-color: var(--select-bg);
    color: var(--select-fg);
}

.stats-grid,
.sales-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}
.tool-grid.two-up,
.table-grid.two-up,
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.chart-grid-single,
.table-grid-single {
    grid-template-columns: 1fr;
}

.tool-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
}

/* Compact KPI tiles (default) */
.stats-grid > .stat-card,
.sales-stats-grid > .stat-card {
    width: 150px;
    height: 40px;
    box-sizing: border-box;
    padding: 4px 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    border-radius: 12px;
    overflow: hidden;
}

/* Inventory, Listings, Sales: larger tiles */
.stats-grid.inventory-summary-grid > .stat-card,
.sales-stats-grid > .stat-card {
    width: 180px;
    height: 70px;
    padding: 8px 14px;
    border-radius: 14px;
}

.stats-grid > .stat-card > span,
.sales-stats-grid > .stat-card > span {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 !important;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-grid.inventory-summary-grid > .stat-card > span,
.sales-stats-grid > .stat-card > span {
    font-size: 11px;
}

.stats-grid > .stat-card > strong,
.sales-stats-grid > .stat-card > strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin: 1px 0 0;
    line-height: 1.1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-grid.inventory-summary-grid > .stat-card > strong,
.sales-stats-grid > .stat-card > strong {
    font-size: 18px;
    margin-top: 4px;
}

.stats-grid > .stat-card > small,
.sales-stats-grid > .stat-card > small {
    font-size: 8px;
    line-height: 1.05;
    margin: 1px 0 0;
    color: var(--muted);
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-grid > .stat-card.compact > strong,
.sales-stats-grid > .stat-card.compact > strong {
    font-size: 10px;
    white-space: normal;
    line-height: 1.05;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.stats-grid.inventory-summary-grid > .stat-card.compact > strong,
.sales-stats-grid > .stat-card.compact > strong {
    font-size: 15px;
}

/* Dashboard only: room for title, value, and subtitle */
.stats-grid.dashboard-kpis > .stat-card,
.stats-grid.tertiary-kpis > .stat-card {
    width: 220px;
    height: 70px;
    padding: 8px 14px;
    border-radius: 14px;
}

.stats-grid.dashboard-kpis > .stat-card > span,
.stats-grid.tertiary-kpis > .stat-card > span {
    font-size: 11px;
}

.stats-grid.dashboard-kpis > .stat-card > strong,
.stats-grid.tertiary-kpis > .stat-card > strong {
    font-size: 18px;
    margin-top: 4px;
}

.stats-grid.dashboard-kpis > .stat-card > small,
.stats-grid.tertiary-kpis > .stat-card > small {
    font-size: 10px;
    margin-top: 3px;
}

.stats-grid.dashboard-kpis > .stat-card.compact > strong,
.stats-grid.tertiary-kpis > .stat-card.compact > strong {
    font-size: 15px;
}

/* Dashboard: all primary KPI tiles on one horizontal row (scroll on narrow viewports) */
.stats-grid.dashboard-kpis.dashboard-totals-single-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-bottom: 18px;
    scrollbar-gutter: stable;
}

.stats-grid.dashboard-kpis.dashboard-totals-single-row > .stat-card {
    width: auto;
    flex: 1 1 0;
    min-width: 9.5rem;
}

.stat-card.accent {
    background: var(--stat-accent-bg);
}

.btn-primary,
.btn-secondary,
.inventory-form button,
.table-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 0;
}

.btn-primary,
.inventory-form button {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: var(--on-accent);
}

.btn-secondary {
    background: var(--secondary-btn-bg);
    color: var(--text);
    border: 1px solid var(--line);
}

.table-link {
    background: transparent;
    color: var(--accent);
    padding: 0;
    font-weight: 600;
}

.table-link:hover,
.btn-primary:hover,
.btn-secondary:hover,
.inventory-form button:hover { transform: translateY(-1px); }
.danger-link { color: #fca5a5; }

.chart-card { min-height: 100%; }
.card-head { margin-bottom: 16px; }

.dashboard-chart {
    min-height: 300px;
    padding: 16px 12px 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--dashboard-chart-surface);
}

.dashboard-chart--line {
    padding: 12px 8px 8px;
}

.dashboard-line-chart {
    width: 100%;
}

.dashboard-line-chart__svg {
    width: 100%;
    height: auto;
    display: block;
    max-height: 360px;
}

.dashboard-line-chart__axis-zero {
    stroke: var(--chart-axis);
    stroke-width: 1;
}

.dashboard-line-chart__line {
    stroke-width: 2.75;
    fill: none;
}

.dashboard-line-chart__line--revenue {
    stroke: var(--chart-revenue);
}

.dashboard-line-chart__line--profit {
    stroke: var(--chart-profit);
}

.dashboard-line-chart__line--cog {
    stroke: var(--chart-cog);
}

.dashboard-line-chart__xlabel {
    fill: var(--muted);
    font-size: 11px;
}

.dashboard-line-chart__ylabel {
    fill: var(--chart-ylabel);
    font-size: 10px;
    dominant-baseline: middle;
}

.chart-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    color: var(--muted);
    padding: 24px;
    text-align: center;
}

/* Dashboard: Monthly Breakdown table */
.monthly-breakdown-card {
    padding: 0;
    overflow: hidden;
    margin-bottom: 18px;
}

.monthly-breakdown-wrap {
    margin: 0;
    max-width: 100%;
}

.monthly-breakdown-table {
    min-width: max(100%, 720px);
    border-collapse: collapse;
}

.monthly-breakdown-table thead .monthly-breakdown-banner {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--monthly-banner-bg);
    color: var(--monthly-banner-fg);
    padding: 12px 14px;
    border-bottom: 1px solid var(--monthly-line);
}

.monthly-breakdown-table .monthly-breakdown-corner {
    width: 11rem;
    min-width: 11rem;
    background: var(--surface-06);
    position: sticky;
    left: 0;
    z-index: 3;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.2);
}

.monthly-breakdown-table thead .monthly-breakdown-month,
.monthly-breakdown-table thead .monthly-breakdown-total-head {
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    padding: 10px 12px;
}

.monthly-breakdown-table .monthly-breakdown-row-label {
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    background: var(--surface-06);
    border-right: 1px solid var(--line);
    padding: 10px 14px;
    position: sticky;
    left: 0;
    z-index: 2;
    white-space: nowrap;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
}

.monthly-breakdown-table tbody th.monthly-breakdown-row-label {
    vertical-align: middle;
}

.monthly-breakdown-table .monthly-breakdown-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    padding: 10px 12px;
    border-left: 1px solid var(--line);
}

.monthly-breakdown-table tbody tr:nth-child(even):not(.monthly-breakdown-net-row) td.monthly-breakdown-num,
.monthly-breakdown-table tbody tr:nth-child(even):not(.monthly-breakdown-net-row) th.monthly-breakdown-row-label {
    background: var(--surface-02);
}

.monthly-breakdown-table tbody tr.monthly-breakdown-net-row th.monthly-breakdown-row-label {
    background: rgba(34, 197, 94, 0.18);
}

.monthly-breakdown-table tbody tr.monthly-breakdown-net-row td.monthly-breakdown-num {
    background: rgba(34, 197, 94, 0.12);
}

.monthly-breakdown-table tbody tr.monthly-breakdown-net-row td.monthly-breakdown-negative {
    color: #fca5a5;
}

.monthly-breakdown-table tbody tr.monthly-breakdown-net-row td.monthly-breakdown-net-total-negative {
    background: #7f1d1d;
    color: #fef2f2;
    font-weight: 700;
}

.monthly-breakdown-table .monthly-breakdown-total-col {
    font-weight: 600;
    border-left: 1px solid var(--line-strong);
}

.chart-col {
    display: grid;
    gap: 10px;
    align-items: end;
    justify-items: center;
    min-height: 240px;
}

.chart-bars {
    display: flex;
    align-items: end;
    gap: 8px;
    min-height: 200px;
}

.chart-bar {
    width: 22px;
    border-radius: 10px 10px 4px 4px;
    background: var(--chart-revenue-bar);
    min-height: 6px;
}

.chart-bar.profit {
    background: rgba(34, 197, 94, 0.9);
}

.chart-bar.negative {
    background: rgba(239, 68, 68, 0.9);
}

.chart-label {
    color: var(--muted);
    font-size: 12px;
}

.chart-value {
    font-size: 12px;
    color: var(--text);
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 12px;
    color: var(--muted);
}

.legend {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: middle;
}
.legend.revenue { background: var(--chart-revenue-legend); }
.legend.profit { background: rgba(34, 197, 94, 0.9); }
.legend.cog { background: rgba(245, 158, 11, 0.95); }

.formula-box {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--surface-02);
}
.formula-box.compact { margin-top: 16px; }
.formula-subtract { color: #fca5a5; }

.profit-breakdown,
.mini-help.list-help {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}
.profit-breakdown div,
.mini-help.list-help div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-02);
}
.profit-breakdown span,
.mini-help.list-help span { color: var(--muted); }

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
}
.compact-table-wrap { max-height: 410px; }

.dashboard-table {
    width: 100%;
    min-width: 950px;
    border-collapse: collapse;
    background: var(--panel);
}
.compact-table { min-width: 100%; }

.dashboard-table th,
.dashboard-table td {
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.dashboard-table th {
    background: var(--surface-04);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

.inventory-table td[contenteditable="true"],
.inventory-table .status-pill[contenteditable="true"] {
    outline: none;
    cursor: text;
}

.inventory-table td[contenteditable="true"]:focus,
.inventory-table .status-pill[contenteditable="true"]:focus {
    background: var(--cell-focus-bg);
    box-shadow: inset 0 0 0 1px var(--cell-focus-ring);
}

.inventory-notice,
.notice-success,
.notice-error,
.notice-info {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
}
.notice-info {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: #bae6fd;
}
.notice-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.28);
    color: #bbf7d0;
}
.notice-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #fecaca;
}

.inventory-form,
.login-form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.form-grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four-col { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid label,
.login-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
}
.form-grid .full-width { grid-column: 1 / -1; }
.filter-actions { align-self: end; }

.status-pill {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    min-width: 70px;
}
.status-active { background: rgba(34,197,94,0.12); color: #bbf7d0; border-color: rgba(34,197,94,0.25); }
.status-ended { background: rgba(245,158,11,0.12); color: #fde68a; border-color: rgba(245,158,11,0.25); }
.status-sold { background: rgba(96,165,250,0.12); color: #bfdbfe; border-color: rgba(96,165,250,0.25); }
.status-draft { background: rgba(148,163,184,0.12); color: #cbd5e1; border-color: rgba(148,163,184,0.25); }

.sticky-scroll-wrap { position: relative; }
.mini-help { margin-top: 12px; color: var(--muted); }
.metric-help-card { align-self: start; }

.save-success { box-shadow: inset 0 0 0 1px rgba(34,197,94,0.45); }
.save-error { box-shadow: inset 0 0 0 1px rgba(239,68,68,0.45); }

.login-page-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 30px;
}
.login-page-wrap { width: 100%; max-width: 460px; }
.login-card {
    background: var(--login-card-bg);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow);
}

/* Landing + login: full viewport, no topbar, content vertically centered */
.ei-guest-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ei-guest-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    box-sizing: border-box;
    width: 100%;
}

.ei-guest-main > .panel {
    width: 100%;
    max-width: 920px;
}

.ei-guest-main > .ei-login-page-inner {
    width: 100%;
    max-width: 460px;
    display: flex;
    justify-content: center;
}

.login-card-title {
    margin: 0 0 8px;
    font-size: 1.5rem;
}

.login-card-lede {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.login-alert {
    margin-bottom: 16px;
}

.login-card .login-form input[type="text"],
.login-card .login-form input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-input);
    background: var(--surface-04);
    color: var(--input-fg);
    box-sizing: border-box;
}

.login-form-actions {
    margin-top: 4px;
}

.login-submit {
    width: 100%;
}

.login-card-meta {
    margin: 18px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.login-card-meta a {
    text-decoration: underline;
}

.login-meta-sep {
    opacity: 0.6;
}

.checkbox-row { display: flex !important; align-items: center; gap: 10px; }

@media (max-width: 1180px) {
    .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chart-grid,
    .tool-grid.two-up,
    .table-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .chart-grid.chart-grid-single,
    .table-grid.two-up.table-grid-single {
        grid-template-columns: 1fr;
    }
    .dashboard-head { flex-direction: column; }
}

/* Stacked topbar only on small screens — at 1180px it made laptops look “squashed” / vertically stacked */
@media (max-width: 720px) {
    .site-topbar {
        flex-direction: column;
        align-items: stretch;
        min-height: 0;
        padding: 16px;
    }
    .topbar-brand { padding-left: 0; justify-content: center; text-align: center; }
    .topbar-nav { flex: none; justify-content: center; }
    .topbar-user {
        justify-content: center;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 760px) {
    .main-content,
    .site-topbar,
    .panel { padding: 18px; }
    .summary-grid,
    .chart-grid,
    .tool-grid.two-up,
    .table-grid.two-up,
    .form-grid,
    .form-grid.three-col,
    .form-grid.four-col { grid-template-columns: 1fr; }
    .dashboard-filter-bar select,
    .dashboard-filter-bar input { width: 100%; }
}


.section-subhead {
    margin: 28px 0 18px;
}

.section-subhead h3 {
    margin: 0 0 6px;
    font-size: 1.15rem;
}

.section-subhead p {
    margin: 0;
    color: var(--subhead);
}


.header-actions { display: flex; gap: 10px; align-items: center; }
.tool-grid.one-col { display: grid; grid-template-columns: 1fr; gap: 18px; margin-bottom: 18px; }
.sortable-header { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable-header .sort-indicator { margin-left: 8px; font-size: 11px; color: var(--muted); }
.sortable-header.sort-asc .sort-indicator::before { content: "↑"; }
.sortable-header.sort-desc .sort-indicator::before { content: "↓"; }
.sortable-header.sort-asc .sort-indicator,
.sortable-header.sort-desc .sort-indicator { font-size: 0; }
.modal-active { overflow: hidden; }
.modal-shell { position: fixed; inset: 0; display: none; z-index: 9999; }
.modal-shell.is-open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 7, 18, 0.78); }
.modal-card { position: relative; max-width: 860px; margin: 6vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 24px; max-height: 88vh; overflow: auto; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.modal-close { background: transparent; border: 1px solid var(--line); color: var(--text); width: 42px; height: 42px; border-radius: 999px; font-size: 24px; cursor: pointer; }
.modal-form { margin: 0; }
@media (max-width: 900px) { .modal-card { margin: 3vh 16px; } }


.listing-thumb {
    width: 70px;
    height: 50px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
    background: var(--surface-04);
    border: 1px solid var(--line);
}

.listing-thumb.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    padding: 8px;
}

.picture-cell {
    width: 136px;
    min-width: 136px;
}

.item-name-col {
    min-width: 260px;
    width: 260px;
}

.date-col {
    min-width: 110px;
}

#inventory-add-modal .modal-card {
    max-width: 780px;
}

#inventory-bulk-add-modal .modal-card.ei-bulk-inventory-modal {
    max-width: min(1200px, 96vw);
}

.ei-bulk-inventory-head {
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
}

.ei-bulk-inventory-head h3 {
    margin: 0;
    flex: 1 1 200px;
}

.ei-bulk-price-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
    margin: 0;
}

.ei-bulk-price-field span {
    font-size: 12px;
    opacity: 0.85;
}

.ei-bulk-price-field input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-02, rgba(255, 255, 255, 0.04));
    color: var(--text);
}

.ei-bulk-unit-cog-hint {
    margin: 0 0 12px;
    font-size: 13px;
    opacity: 0.9;
}

.ei-bulk-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}

.ei-bulk-inventory-table {
    min-width: 960px;
    table-layout: fixed;
}

.ei-bulk-inventory-table th,
.ei-bulk-inventory-table td {
    vertical-align: middle;
    padding: 8px 6px;
}

.ei-bulk-inventory-table input,
.ei-bulk-inventory-table select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 6px 8px;
    font-size: 13px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--surface-02, rgba(255, 255, 255, 0.04));
    color: var(--text);
}

/* Match the theme's select control styling specifically for Category. */
#inventory-bulk-add-modal .ei-bulk-inventory-table select.ei-bulk-category-select {
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--input-bg);
    color: var(--text);
}

.ei-bulk-col-qty {
    width: 64px;
}

.ei-bulk-col-actions {
    width: 48px;
    text-align: center;
}

.ei-bulk-row-remove {
    min-width: 36px;
    padding: 4px 10px;
    line-height: 1.2;
}

.ei-bulk-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.inventory-header.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.inventory-header .header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.inventory-header .ei-btn-bulk-add {
    background: var(--secondary-btn-bg);
    color: var(--text);
    border: 1px solid var(--line);
}

#expenses-add-modal .modal-card {
    max-width: 640px;
}

.expenses-dashboard-table {
    table-layout: fixed;
    min-width: 1799px;
}

.expenses-dashboard-table col.expenses-col-date {
    width: 100px;
}

.expenses-dashboard-table col.expenses-col-name {
    width: 450px;
}

.expenses-dashboard-table col.expenses-col-category {
    width: 140px;
}

.expenses-dashboard-table col.expenses-col-amount {
    width: 110px;
}

.expenses-dashboard-table col.expenses-col-notes {
    width: 879px;
}

.expenses-dashboard-table col.expenses-col-actions {
    width: 120px;
}

/* Wrap long text inside fixed-width columns (base .dashboard-table uses nowrap). */
.expenses-dashboard-table th:nth-child(2),
.expenses-dashboard-table td:nth-child(2),
.expenses-dashboard-table th:nth-child(3),
.expenses-dashboard-table td:nth-child(3),
.expenses-dashboard-table th:nth-child(5),
.expenses-dashboard-table td:nth-child(5) {
    white-space: normal;
    word-break: break-word;
}

.expenses-dashboard-table th.expenses-actions-cell,
.expenses-dashboard-table td.expenses-actions-cell {
    width: 120px;
    max-width: 120px;
    box-sizing: border-box;
    vertical-align: middle;
    white-space: normal;
}

.expenses-dashboard-table td.expenses-actions-cell .row-actions {
    justify-content: flex-end;
    gap: 6px;
}

/* Settings → SKU Rules: 1799px total; Status & Actions 120px; Category, Prefix, Start Number share remainder */
table.sku-rules-table {
    table-layout: fixed;
    width: 1799px;
    min-width: 1799px;
    max-width: none;
}

table.sku-rules-table col.sku-rules-col-fluid {
    width: calc((1799px - 240px) / 3);
}

table.sku-rules-table col.sku-rules-col-status,
table.sku-rules-table col.sku-rules-col-actions {
    width: 120px;
}

.year-summary-card{margin-top:24px}.year-summary-head{gap:16px;align-items:flex-start}.year-summary-filter{justify-content:flex-end}.year-summary-kpis{margin-top:18px}.dashboard-table tfoot th{position:sticky;bottom:0;background:var(--table-footer-bg);z-index:1}

.ei-settings-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
}

.ei-settings-form label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
}

.ei-settings-form input[type="text"],
.ei-settings-form input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-input);
    background: var(--surface-04);
    color: var(--input-fg);
    box-sizing: border-box;
}

.ei-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.ei-inline-form {
    display: inline;
}

.ei-link-button {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.ei-actions-cell {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .ei-settings-grid {
        grid-template-columns: 1fr;
    }
}

.sku-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.sku-input-row input {
    flex: 1;
}

.btn-small {
    padding: 10px 12px;
    white-space: nowrap;
}

.field-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    opacity: .8;
}

.field-help.is-error {
    color: #ff8f8f;
    opacity: 1;
}

.field-help.is-success {
    color: #87d7a3;
    opacity: 1;
}

.inline-category-cell {
    min-width: 170px;
}

.inline-category-select {
    width: 100%;
    min-width: 150px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-input);
    background: var(--surface-04);
    color: inherit;
}

.ei-settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ei-settings-tab {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid var(--border-input);
    background: var(--surface-04);
    color: inherit;
}

.ei-settings-tab.is-active {
    background: var(--surface-12);
    border-color: var(--surface-18);
}

.ei-profile-grid,
.ei-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.ei-card {
    background: var(--surface-03);
    border: 1px solid var(--surface-08);
    border-radius: 16px;
    padding: 20px;
}

.ei-card h2 {
    margin-top: 0;
    margin-bottom: 16px;
}

.ei-profile-form label,
.ei-settings-form label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
}

.ei-profile-form input[type="text"],
.ei-profile-form input[type="email"],
.ei-profile-form input[type="password"],
.ei-profile-form input[type="number"],
.ei-profile-form input[type="date"],
.ei-profile-form textarea,
.ei-settings-form input[type="text"],
.ei-settings-form input[type="number"],
.ei-settings-form input[type="date"],
.ei-profile-form select,
.ei-settings-form select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-input);
    background: var(--surface-04);
    color: var(--input-fg);
    box-sizing: border-box;
}

.ei-profile-form select,
.ei-settings-form select {
    background: var(--select-bg);
    color: var(--select-fg);
}

.ei-profile-form select option,
.ei-settings-form select option {
    background: var(--select-bg);
    color: var(--select-fg);
}

.ei-media-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.ei-button.ei-button-secondary {
    padding: 10px 14px;
    border: 1px solid var(--border-input);
    border-radius: 10px;
    background: var(--secondary-btn-bg);
    color: var(--input-fg);
    cursor: pointer;
}

.ei-remove-logo.is-hidden {
    display: none;
}

.ei-logo-preview {
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    background: var(--surface-02);
    border: 1px solid var(--surface-08);
}

.ei-logo-preview.is-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    color: var(--logo-empty);
}

.ei-logo-preview img {
    max-width: 240px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.ei-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.ei-inline-form {
    display: inline;
}

.ei-link-button {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.ei-actions-cell {
    white-space: nowrap;
}

.ei-settings-form-inline .form-grid.five-col {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.ei-settings-form-inline label {
    margin: 0;
}

.ei-checkbox-wrap {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.inline-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin-top: 0;
}

.inline-actions .ei-button {
    width: 100%;
}

@media (max-width: 1100px) {
    .ei-settings-form-inline .form-grid.five-col {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .ei-settings-form-inline .form-grid.five-col {
        grid-template-columns: 1fr;
    }
}

.ei-settings-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ei-periph-card {
    position: relative;
}

.ei-periph-subhead {
    margin: 22px 0 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.ei-periph-card > h3.ei-periph-subhead:first-of-type {
    margin-top: 14px;
}

.ei-periph-grid .ei-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    grid-column: 1 / -1;
    color: var(--text);
    font-weight: 500;
}

.ei-periph-grid .ei-checkbox-row input {
    margin-top: 4px;
    flex-shrink: 0;
}

.ei-periph-api-line {
    font-size: 13px;
    line-height: 1.5;
}

.ei-periph-detect-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.ei-periph-table-wrap {
    overflow-x: auto;
    margin-bottom: 8px;
}

.ei-periph-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.ei-settings-form .ei-periph-table input[type='text'],
.ei-settings-form .ei-periph-table input[type='number'],
.ei-settings-form .ei-periph-table select {
    width: auto;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin: 2px 0;
}

.ei-settings-form table.ei-periph-printers-table > thead > tr > th:nth-child(1) {
    width: 14%;
}
.ei-settings-form table.ei-periph-printers-table > thead > tr > th:nth-child(2) {
    width: 12%;
}
.ei-settings-form table.ei-periph-printers-table > thead > tr > th:nth-child(3) {
    width: 22%;
}
.ei-settings-form table.ei-periph-printers-table > thead > tr > th:nth-child(4) {
    width: 26%;
}
.ei-settings-form table.ei-periph-printers-table > thead > tr > th:nth-child(5) {
    width: 14%;
}
.ei-settings-form table.ei-periph-printers-table > thead > tr > th:nth-child(6) {
    width: 7.5rem;
}
.ei-settings-form table.ei-periph-printers-table > thead > tr > th:nth-child(7) {
    width: 6.5rem;
}

.ei-settings-form table.ei-periph-printers-table .ei-pr-name {
    width: 100%;
}

.ei-settings-form table.ei-periph-printers-table .ei-pr-conn {
    width: 100%;
}

.ei-pr-netstack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ei-settings-form table.ei-periph-printers-table .ei-pr-netstack .ei-pr-host {
    width: 100%;
}

.ei-settings-form table.ei-periph-printers-table .ei-pr-netstack .ei-pr-port {
    width: 6.5rem;
}

/* Keep preset <select> from sizing the column to the longest option label */
.ei-settings-form table.ei-periph-printers-table td.ei-pr-metrics-cell {
    overflow: hidden;
    vertical-align: top;
}

.ei-pr-metrics-cell .ei-pr-metric-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px 12px;
    margin-bottom: 0;
}

.ei-pr-size-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.ei-pr-preset-wrap {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.ei-pr-preset-clip {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.ei-settings-form table.ei-periph-printers-table .ei-pr-preset {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ei-pr-os-settings-row {
    margin-top: 2px;
}

.ei-settings-form table.ei-periph-printers-table .ei-pr-os-settings-row .ei-button {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
}

.ei-pr-inline-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    min-width: 0;
}

.ei-settings-form table.ei-periph-printers-table .ei-pr-inline-label input.ei-pr-lw,
.ei-settings-form table.ei-periph-printers-table .ei-pr-inline-label input.ei-pr-lh {
    width: 4.75rem;
}

.ei-settings-form table.ei-periph-printers-table .ei-pr-inline-label input.ei-pr-dpi {
    width: 5.25rem;
}

.ei-pr-field-hint {
    white-space: nowrap;
}

.ei-pr-times {
    align-self: center;
    opacity: 0.75;
    font-size: 14px;
    padding-bottom: 6px;
}

.ei-pr-copies-cell .ei-pr-copies-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.ei-settings-form table.ei-periph-printers-table .ei-pr-copies {
    width: 3.75rem;
}

.ei-pr-autol {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    white-space: nowrap;
}

.ei-pr-actions-cell {
    vertical-align: top;
    text-align: center;
    width: 6.5rem;
}

.ei-settings-form table.ei-periph-printers-table .ei-pr-actions-cell .ei-button {
    width: 100%;
    max-width: 6.5rem;
    box-sizing: border-box;
}

.ei-settings-form table.ei-periph-printers-table .ei-pr-test-cell .ei-button {
    width: 100%;
    max-width: 7.5rem;
    box-sizing: border-box;
    white-space: normal;
    line-height: 1.25;
    padding: 8px 10px;
}

.ei-settings-form .ei-periph-table:not(.ei-periph-printers-table) > thead > tr > th:nth-child(4) {
    width: 6rem;
}

.ei-settings-form .ei-periph-table:not(.ei-periph-printers-table) > thead > tr > th:nth-child(5) {
    width: 6.5rem;
}

.ei-dv-usb-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: flex-end;
}

.ei-dv-inline {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
}

.ei-settings-form .ei-periph-table .ei-dv-inline input {
    width: 5.5rem;
}

.ei-settings-form .ei-periph-table .ei-dv-name {
    width: 100%;
}

.ei-periph-table th,
.ei-periph-table td {
    border: 1px solid var(--line);
    padding: 8px 10px;
    vertical-align: top;
    text-align: left;
}

.ei-periph-table th {
    background: var(--surface-04);
    font-weight: 600;
}

.ei-periph-table input[type='text'],
.ei-periph-table input[type='number'],
.ei-periph-table select {
    margin: 2px 0;
}

.ei-periph-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.ei-periph-json-field {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ei-periph-test-block {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-03);
}

.ei-scan-test-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

.ei-scan-test-input {
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 100%;
    box-sizing: border-box;
}

.ei-settings-form .ei-scan-test-input {
    width: auto;
}

.ei-periph-test-readout {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-04);
    border: 1px solid var(--line);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.ei-scale-test-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ei-periph-scale-pair-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ei-periph-test-output {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-04);
    border: 1px solid var(--line);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 2.5em;
}

.ei-periph-serial-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Settings → eBay: Connect (left) + right column (sync history + auto interval) */
.ei-ebay-connect-sync-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 20px;
    align-items: stretch;
}

.ei-ebay-right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.ei-ebay-sync-history-card .ei-ebay-sync-history-hint {
    margin-top: 0;
    margin-bottom: 14px;
    line-height: 1.45;
}

.ei-ebay-sync-range-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ei-ebay-sync-range-form {
    margin: 0;
}

.ei-ebay-sync-range-btn {
    width: 100%;
    justify-content: center;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-title-row h2 {
    margin: 0;
}

.ei-settings-form-inline .form-grid.five-col {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

.ei-settings-form-inline label {
    margin: 0;
}

.ei-checkbox-wrap {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.inline-actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin-top: 0;
}

.inline-actions .ei-button {
    width: 100%;
}

@media (max-width: 1100px) {
    .ei-settings-form-inline .form-grid.five-col {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .ei-settings-form-inline .form-grid.five-col {
        grid-template-columns: 1fr;
    }
}

.address-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 12px;
}

.ei-card h3 {
    margin-top: 22px;
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .address-grid {
        grid-template-columns: 1fr;
    }
}

.ebay-listings-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.ebay-listings-header .header-actions {
    flex-shrink: 0;
}

.ebay-listings-header .header-actions form {
    margin: 0;
}

/* Bought Inventory page: table fits viewport; Actions column uses table-link like Expenses */
.inventory-page-section .table-wrap {
    max-width: 100%;
    box-sizing: border-box;
}

.inventory-page-section .inventory-page-grid-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
}

.inventory-page-section .inventory-page-grid-table col.inv-col-sku { width: 6.5rem; }
.inventory-page-section .inventory-page-grid-table col.inv-col-name {
    width: 540px;
    min-width: 540px;
    max-width: 540px;
}
.inventory-page-section .inventory-page-grid-table col.inv-col-category { width: 9rem; }
.inventory-page-section .inventory-page-grid-table col.inv-col-qty { width: 3.25rem; }
.inventory-page-section .inventory-page-grid-table col.inv-col-cog { width: 4.5rem; }
.inventory-page-section .inventory-page-grid-table col.inv-col-date { width: 6.75rem; }
.inventory-page-section .inventory-page-grid-table col.inv-col-place { width: 8rem; }
.inventory-page-section .inventory-page-grid-table col.inv-col-note { width: 12rem; }
.inventory-page-section .inventory-page-grid-table col.inv-col-edit { width: 120px; }

.inventory-page-section .inventory-page-grid-table th,
.inventory-page-section .inventory-page-grid-table td {
    vertical-align: top;
}

.inventory-page-section .inventory-page-grid-table td:not(:nth-child(2)):not(.inventory-actions-cell) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inventory-page-section .inventory-page-grid-table td:nth-child(2),
.inventory-page-section .inventory-page-grid-table th:nth-child(2) {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0 !important;
}

.inventory-page-section .inventory-page-grid-table td:nth-child(8) {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Actions column: match Expenses table-link + row-actions pattern */
.inventory-page-section .inventory-page-grid-table th.inventory-actions-cell,
.inventory-page-section .inventory-page-grid-table td.inventory-actions-cell {
    width: 120px;
    max-width: 120px;
    box-sizing: border-box;
    vertical-align: middle;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.inventory-page-section .inventory-page-grid-table td.inventory-actions-cell .row-actions {
    justify-content: flex-end;
    gap: 6px;
}

/* eBay Listings: compact filter controls */
.ebay-listings-section .filters-card .filter-form input[type="text"],
.ebay-listings-section .filters-card .filter-form select {
    width: 180px;
    max-width: 100%;
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 12px;
}

.ebay-listings-section .filters-card .filter-actions .btn-primary,
.ebay-listings-section .filters-card .filter-actions .btn-secondary {
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
}

/* eBay Listings: fit table to viewport; compact cols sized to headers/content, name column takes remainder */
.ebay-listings-section .table-wrap {
    max-width: 100%;
    box-sizing: border-box;
}

.ebay-listings-section .ebay-listings-grid-table {
    width: 100%;
    min-width: 0 !important;
    table-layout: fixed;
}

/* Fixed widths for non-name columns; ebay-col-name has no width — expands */
.ebay-listings-section .ebay-listings-grid-table col.ebay-col-picture { width: 88px; }
.ebay-listings-section .ebay-listings-grid-table col.ebay-col-sku { width: 7rem; }
.ebay-listings-section .ebay-listings-grid-table col.ebay-col-category { width: 10rem; }
.ebay-listings-section .ebay-listings-grid-table col.ebay-col-price { width: 5.25rem; }
.ebay-listings-section .ebay-listings-grid-table col.ebay-col-qty { width: 3.25rem; }
.ebay-listings-section .ebay-listings-grid-table col.ebay-col-days { width: 4.75rem; }
.ebay-listings-section .ebay-listings-grid-table col.ebay-col-start { width: 10.5rem; }
.ebay-listings-section .ebay-listings-grid-table col.ebay-col-end { width: 10.5rem; }
.ebay-listings-section .ebay-listings-grid-table col.ebay-col-type { width: 7.5rem; }
.ebay-listings-section .ebay-listings-grid-table col.ebay-col-status { width: 6.25rem; }

.ebay-listings-section .ebay-listings-grid-table th,
.ebay-listings-section .ebay-listings-grid-table td {
    vertical-align: top;
}

.ebay-listings-section .ebay-listings-grid-table th:not(.item-name-col),
.ebay-listings-section .ebay-listings-grid-table td:not(.item-name-col) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ebay-listings-section .ebay-listings-grid-table td.item-name-col,
.ebay-listings-section .ebay-listings-grid-table th.item-name-col {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0 !important;
}

.ebay-listings-section .ebay-listings-grid-table .picture-cell {
    width: 88px;
    min-width: 88px;
    max-width: 88px;
    text-align: center;
}

.ebay-listings-section .ebay-listings-grid-table .listing-thumb {
    max-width: 70px;
    height: auto;
    margin: 0 auto;
}

.ebay-listings-section .ebay-listings-grid-table td:nth-child(10) .listing-type-pill,
.ebay-listings-section .ebay-listings-grid-table td:nth-child(11) .status-pill {
    display: inline-flex;
    max-width: 100%;
    justify-content: center;
    white-space: nowrap;
}

.inventory-page-section .inventory-page-grid-table col.inv-col-minprice { width: 8.5rem; }

.inventory-page-section .inventory-page-grid-table td.ei-pricing-cell,
.ebay-listings-section .ebay-listings-grid-table td.ei-pricing-cell {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.inventory-page-section .ei-pricing-cell,
.ebay-listings-section .ei-pricing-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.inventory-page-section .ei-min-price-pill,
.ebay-listings-section .ei-min-price-pill {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--accent, #93c5fd);
}

.inventory-page-section .ei-pricing-toggle,
.ebay-listings-section .ei-pricing-toggle {
    font-size: 0.72rem;
    padding: 4px 8px;
    line-height: 1.2;
}

.inventory-page-section tr.ei-pricing-detail-row > td,
.ebay-listings-section tr.ei-pricing-detail-row > td {
    padding: 0;
    background: var(--surface-02, rgba(0, 0, 0, 0.15));
    border-bottom: 1px solid var(--line);
    white-space: normal;
    overflow: visible;
}

.inventory-page-section tr.ei-pricing-detail-row[hidden],
.ebay-listings-section tr.ei-pricing-detail-row[hidden] {
    display: none;
}

.ei-listing-pricing-panel {
    padding: 14px 16px 16px;
}

.ei-listing-pricing-panel.is-calculating {
    opacity: 0.72;
}

.ei-listing-pricing-panel__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px 16px;
    margin-bottom: 14px;
}

.ei-listing-pricing-panel__grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--muted);
}

.ei-listing-pricing-panel__grid input[type='number'],
.ei-listing-pricing-panel__grid select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border-input);
    background: var(--input-bg);
    color: var(--input-fg);
    font-size: 0.88rem;
}

.ei-listing-pricing-results {
    display: grid;
    grid-template-columns: minmax(180px, 220px) 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 12px;
}

.ei-listing-pricing-results__hero {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ei-listing-pricing-results__label {
    font-size: 0.78rem;
    color: var(--muted);
}

.ei-listing-pricing-results__hero strong {
    font-size: 1.35rem;
    color: var(--text);
}

.ei-listing-pricing-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px 14px;
    margin: 0;
}

.ei-listing-pricing-breakdown > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ei-listing-pricing-breakdown dt {
    margin: 0;
    font-size: 0.72rem;
    color: var(--muted);
}

.ei-listing-pricing-breakdown dd {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
}

.ei-listing-pricing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 720px) {
    .ei-listing-pricing-results {
        grid-template-columns: 1fr;
    }
}

.ebay-listings-section .ebay-listings-grid-table td[contenteditable="true"]:focus {
    overflow: visible !important;
    white-space: normal !important;
    text-overflow: clip !important;
}

/* ===============================
   UNIFY ALL TABLE STYLING
   =============================== */

/* Force all tables to use Sales styling */
.inventory-table,
.ebay-listings-table,
.data-table,
table {
    width: 100%;
    min-width: 950px;
    border-collapse: collapse;
    background: var(--panel);
}

/* Headers + cells match sales page */
.inventory-table th,
.inventory-table td,
.ebay-listings-table th,
.ebay-listings-table td,
.data-table th,
.data-table td,
table th,
table td {
    padding: 8px 10px;
    font-size: 12px;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

/* Header styling */
.inventory-table th,
.ebay-listings-table th,
.data-table th,
table th {
    background: var(--surface-04);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
}

/* Scroll wrapper consistency */
.inventory-table-wrap,
.ebay-table-wrap,
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
}

/* Column tightening (same as Sales page) */
.item-name-col {
    min-width: 260px;
    width: 260px;
}

.date-col {
    min-width: 110px;
}

/* Improve inline editable cells */
[contenteditable="true"] {
    cursor: text;
}

[contenteditable="true"]:focus {
    background: var(--cell-focus-bg);
    box-shadow: inset 0 0 0 1px var(--cell-focus-ring);
}

/* ===============================
   CENTER ALL COLUMNS EXCEPT ITEM NAME
   =============================== */

/* Center everything by default */
.dashboard-table th,
.dashboard-table td,
.inventory-table th,
.inventory-table td,
.ebay-listings-table th,
.ebay-listings-table td {
    text-align: center;
}

/* Keep Item Name left aligned */
.item-name-col,
.item-name-col th,
.item-name-col td {
    text-align: left !important;
}

/* If Item Name is second column (fallback safety) */
.dashboard-table td:nth-child(2),
.dashboard-table th:nth-child(2),
.inventory-table td:nth-child(2),
.inventory-table th:nth-child(2),
.ebay-listings-table td:nth-child(2),
.ebay-listings-table th:nth-child(2) {
    text-align: left;
}

/* Right align currency only */
.currency {
    text-align: right !important;
}

/* Settings → General: colour scheme */
.ei-appearance-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
}

.ei-radio-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 12px;
    font-weight: 500;
    cursor: pointer;
}

.ei-radio-row input {
    margin-top: 3px;
    flex-shrink: 0;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Geminian Shipping plugin: align with theme colour tokens */
body.ei-scheme-light .gs-shipping-panel .gs-ss-card,
body.ei-scheme-light .gs-shipping-panel .gs-ss-items {
    background: var(--surface-02);
}

body.ei-scheme-light .gs-modal-card {
    background: var(--panel);
    color: var(--text);
    border-color: var(--line);
}

body.ei-scheme-light .gs-modal-head h3 {
    color: var(--text);
}

body.ei-scheme-light .gs-modal-close {
    border-color: var(--border-input);
    color: var(--text);
}

body.ei-scheme-light .gs-modal-body .tool-card {
    background: var(--surface-04);
    border-color: var(--line);
}

body.ei-scheme-light .gs-modal-body .dashboard-table {
    background: var(--panel);
}

body.ei-scheme-light .gs-modal-body .dashboard-table td {
    color: var(--text);
}

body.ei-scheme-light .gs-modal-body .table-wrap {
    border-color: var(--line);
}

/* Light scheme: listing “sold” pill uses purple instead of blue */
body.ei-scheme-light .status-sold {
    background: rgba(109, 40, 217, 0.12);
    color: #5b21b6;
    border-color: rgba(109, 40, 217, 0.28);
}

/* Site footer (scoped — avoids clashing with global .container / .row / ul) */
.site-footer {
    padding: 30px 0 20px;
    background: #1a1a2e;
}

.site-footer .container {
    max-width: 1170px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.site-footer .row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 24px 20px;
    align-items: start;
}

.site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-footer .footer-col {
    min-width: 0;
    padding: 0;
    box-sizing: border-box;
}

.site-footer .footer-col .sub-menu {
    list-style: none;
    margin: 8px 0 0 14px;
    padding: 0;
}

.site-footer .footer-col .sub-menu li:not(:last-child) {
    margin-bottom: 6px;
}

.site-footer .footer-col h4 {
    font-size: 18px;
    color: #ffffff;
    text-transform: capitalize;
    margin: 0 0 35px;
    font-weight: 500;
    position: relative;
}

.site-footer .footer-col h4::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    background-color: #e91e63;
    height: 2px;
    box-sizing: border-box;
    width: 50px;
}

.site-footer .footer-col ul li:not(:last-child) {
    margin-bottom: 10px;
}

.site-footer .footer-col ul li a {
    font-size: 16px;
    text-transform: capitalize;
    text-decoration: none;
    font-weight: 300;
    color: #bbbbbb;
    display: block;
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.site-footer .footer-col ul li a:hover {
    color: #ffffff;
    padding-left: 8px;
}

.site-footer .footer-col .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 0 10px 10px 0;
    text-align: center;
    line-height: 1;
    border-radius: 50%;
    color: #ffffff;
    transition: background-color 0.5s ease, color 0.5s ease, transform 0.2s ease;
    text-decoration: none;
    vertical-align: middle;
}

.site-footer .footer-col .social-links a:hover {
    background-color: rgba(233, 30, 99, 0.45);
    color: #ffffff;
}

.site-footer .box__copyright {
    max-width: 1170px;
    margin: 24px auto 0;
    text-align: center;
    padding: 0 16px;
    box-sizing: border-box;
}

.site-footer .box__copyright p {
    margin: 12px 0 0;
    color: #7a7a7a;
    font-size: 14px;
}

.site-footer .box__copyright hr {
    border: none;
    height: 1px;
    background-color: #7a7a7a;
    margin: 0;
}

/* Legal / policy pages */
.ei-legal-prose {
    max-width: 52rem;
    line-height: 1.6;
}

.ei-legal-prose .ei-legal-note {
    margin-top: 0;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-04);
    font-size: 0.95rem;
    color: var(--muted);
}

.ei-legal-prose h2 {
    margin-top: 1.75rem;
    font-size: 1.25rem;
}

.ei-legal-prose h2:first-of-type {
    margin-top: 0;
}

.ei-legal-prose p,
.ei-legal-prose ul {
    margin: 0 0 14px;
    color: var(--text);
}

.ei-legal-prose ul {
    padding-left: 1.25rem;
}

.ei-legal-prose li {
    margin-bottom: 8px;
}

.ei-legal-prose li:last-child {
    margin-bottom: 0;
}
