.customer-login .welcome-panel { min-height: 400px; }
.customer-login .form-title-row { margin-bottom: 20px; }
.customer-login .form-title-error:empty { display: none; }
.customer-login .signin-content { padding-block: 32px; }

.customer-dashboard {
    --bg: #eef3f6;
    --soft: #f5f8fa;
    --line: #dce6eb;
    --muted: #526780;
    --customer-primary: #256764;
    --customer-shadow: 0 4px 16px #1f364609;
}
.customer-dashboard.dark-mode {
    --bg: #131d2b;
    --soft: #243449;
    --line: #35475c;
    --muted: #afc0d2;
    --customer-primary: #a1dcd2;
    --customer-shadow: 0 4px 16px #080d1740;
}
.customer-dashboard .customer-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px clamp(14px, 3vw, 42px);
    border-bottom: 1px solid var(--line);
    background: var(--card);
}
.customer-brand, .customer-account { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.customer-brand strong { display: block; font-size: 14px; line-height: 1.2; color: var(--text); }
.customer-brand div > span { display: block; color: var(--muted); font-size: 12px; }
.customer-brand-mark, .customer-heading-icon, .customer-section-icon {
    flex: none; display: inline-grid; place-items: center;
    background: var(--tint); color: var(--customer-primary);
}
.customer-brand-mark { inline-size: 38px; block-size: 38px; border-radius: 11px; }
.customer-dashboard .erp-action-icon { display: block; inline-size: 17px; block-size: 17px; }
.customer-brand-mark .erp-action-icon { inline-size: 21px; block-size: 21px; }
.customer-theme-control { display: inline-flex; align-items: center; gap: 6px; }
.customer-theme-control .erp-action-icon { color: var(--customer-primary); }
.customer-theme-control .customer-sun,
.customer-dashboard.dark-mode .customer-theme-control .customer-moon { display: none; }
.customer-dashboard.dark-mode .customer-theme-control .customer-sun { display: inline; }
.customer-account form { margin: 0; }
.customer-user { position: relative; max-width: 100%; }
.customer-user summary {
    display: flex; align-items: center; gap: 8px; padding: 4px 7px;
    border: 1px solid transparent; border-radius: 9px; cursor: pointer; list-style: none;
}
.customer-user summary::-webkit-details-marker { display: none; }
.customer-user :is(summary:hover, summary:focus-visible),
.customer-user[open] summary { background: var(--soft); border-color: var(--line); }
.customer-user-icon {
    flex: none; display: grid; place-items: center; width: 30px; height: 30px;
    border-radius: 9px; background: var(--tint); color: var(--accent);
}
.customer-user-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.customer-user-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.customer-user-menu {
    position: absolute; z-index: 5; inset-block-start: calc(100% + 6px); inset-inline-end: 0;
    min-width: 10rem; padding: 6px; border: 1px solid var(--line); border-radius: 10px;
    background: var(--card); box-shadow: 0 12px 32px #203c6c1c;
}
.customer-user-menu button { width: 100%; border: 0; text-align: left; }
.customer-dashboard .invoice-page {
    height: auto;
    min-height: 0;
    width: min(100%, 1600px);
    margin-inline: auto;
    padding: 18px clamp(12px, 3vw, 36px) 24px;
    overflow: visible;
}
.customer-heading {
    display: flex; align-items: flex-start; gap: 14px; padding: clamp(13px, 1.6vw, 22px);
    border: 1px solid #2d6e6f; border-radius: 15px; color: #f4fffe;
    background: linear-gradient(110deg, #173747, #205c60 75%, #266a6c);
    box-shadow: var(--customer-shadow);
}
.customer-dashboard.dark-mode .customer-heading { background: linear-gradient(110deg, #1d3042, #234a52); }
.customer-heading-icon { inline-size: 47px; block-size: 47px; border-radius: 12px; color: #bdece4; background: #c5faf026; }
.customer-heading-icon .erp-action-icon { inline-size: 25px; block-size: 25px; }
.customer-title { min-width: 0; }
.customer-title h1 { color: inherit; font-size: clamp(23px, 2.3vw, 32px); }
.customer-intro > p { margin: 3px 0 0; color: #c4e5e8; }
.customer-title .report-visibility input { --report-view-accent: #a4e4d7; }
.customer-heading .form-title-error { color: #ffd2d6; }
.customer-heading .form-title-error:empty { display: none; }
.customer-dashboard .card { border-radius: 13px; box-shadow: var(--customer-shadow); }
.customer-filter-row {
    min-inline-size: 0;
    padding: 0;
    margin: 0;
    border: 0;
}
.customer-section-icon { inline-size: 28px; block-size: 28px; border-radius: 8px; }
.customer-filter-row legend { padding: 0; margin-bottom: 10px; color: var(--text); font-weight: 600; }
.customer-filter-row legend .customer-section-icon { margin-inline-end: 4px; vertical-align: middle; }
.customer-filter-controls {
    display: grid; grid-template-columns: repeat(2, minmax(0, 10rem)) minmax(11rem, 18rem) minmax(11rem, 1fr);
    align-items: end; gap: 10px 12px;
}
.customer-dashboard .customer-filter-controls :is(input, select) { width: 100%; min-width: 0; }
.customer-filter-footer { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 9px 14px; margin-top: 10px; }
.customer-view-options { display: flex; flex-wrap: wrap; gap: 4px; border: 0; margin: 0; padding: 0; }
.customer-view-options legend { padding: 0; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
.customer-dashboard .filters .customer-view-options label {
    display: inline-flex; flex-direction: row; align-items: center; gap: 5px; padding: 4px 8px;
    border-radius: 7px; border: 1px solid var(--line); cursor: pointer; text-transform: none; letter-spacing: normal;
}
.customer-view-options label:has(:checked) { background: var(--tint); border-color: var(--accent); }
.customer-dashboard .customer-view-options input { width: 13px; height: 13px; margin: 0; accent-color: var(--customer-primary); }
.customer-dashboard:has([name="view"][value="itemwise"]:checked) [data-report-panel="products"] { display: none; }
.customer-dashboard :is(.report-filter-actions .primary, .report-filter-actions .primary:hover) {
    background: #276a66;
    border-color: #276a66;
    color: white;
}
.customer-dashboard.dark-mode :is(.report-filter-actions .primary, .report-filter-actions .primary:hover) {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--card);
}
.customer-dashboard .report-metrics { --report-metric-columns: 6; }
.customer-dashboard button.metric {
    min-inline-size: 0; padding: 12px 14px; text-align: left;
    background: var(--card); border-color: var(--line); box-shadow: var(--customer-shadow);
}
.customer-dashboard button.metric:hover,
.customer-dashboard button.metric[aria-pressed="true"] { background: var(--tint); border-color: var(--accent); }
.customer-dashboard .metric::before { display: none; }
.customer-metric-label { display: flex; align-items: center; gap: 8px; white-space: normal; }
.customer-dashboard .metric small { font-weight: 600; }
.customer-dashboard .metric[aria-pressed="true"] .customer-section-icon { background: var(--customer-primary); color: var(--card); }
.customer-dashboard .metric strong { color: var(--text); font-size: clamp(19px, 2vw, 26px); margin-top: 6px; }
.customer-dashboard .metric[aria-pressed="true"] strong { color: var(--customer-primary); }
.customer-charts, #invoiceDetails { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.customer-chart-card { display: flex; flex-direction: column; min-width: 0; }
.customer-chart-body { box-sizing: border-box; block-size: 12rem; overflow: auto; padding: 12px 15px; }
.customer-chart-empty { display: grid; place-items: center; height: 100%; margin: 0; color: var(--muted); text-align: center; }
.customer-chart-bars { list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: 12px; }
.customer-chart-bars li { min-width: 0; }
.customer-chart-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-chart-value { color: var(--text); font-variant-numeric: tabular-nums; }
.customer-chart-bar { background: var(--customer-primary); border-radius: 5px; }
.customer-chart-bars--date {
    display: flex; gap: clamp(2px, .5vw, 7px); height: 100%;
    background: linear-gradient(var(--line), var(--line)) 0 calc(100% - 21px) / 100% 1px no-repeat;
}
.customer-chart-bars--date li { flex: 1 1 0; }
.customer-dashboard .customer-chart-point {
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 24px minmax(0, 1fr) 21px;
    align-items: center; justify-items: center; inline-size: 100%; block-size: 100%;
    border: 0; padding: 0; background: transparent; color: inherit; font: inherit;
}
.customer-chart-point:focus-visible { outline-offset: -2px; }
.customer-chart-track { grid-row: 2; position: relative; inline-size: 100%; block-size: 100%; }
.customer-chart-bars--date .customer-chart-value {
    position: absolute; inset-block-end: calc(var(--bar-size) + 3px); inset-inline-start: 50%;
    transform: translateX(-50%); pointer-events: none;
}
.customer-chart-bars--date li:first-child:not(:only-child) .customer-chart-value { inset-inline-start: 0; transform: none; }
.customer-chart-bars--date li:last-child:not(:only-child) .customer-chart-value {
    inset-inline: auto 0; transform: none;
}
.customer-chart-point[aria-pressed="true"] .customer-chart-value {
    z-index: 1; opacity: 1; padding: 1px 4px; border-radius: 4px;
    background: var(--customer-primary); color: var(--card);
}
.customer-chart-bars--date:has(.customer-chart-point[aria-pressed="true"]) .customer-chart-point[aria-pressed="false"] .customer-chart-value {
    opacity: 0;
}
.customer-chart-bars--date .customer-chart-label { grid-row: 3; overflow: visible; }
.customer-chart-bars--date li:first-child .customer-chart-label { justify-self: start; }
.customer-chart-bars--date li:last-child:not(:first-child) .customer-chart-label { justify-self: end; }
.customer-chart-bars--date .customer-chart-bar {
    position: absolute; inset-block-end: 0; inset-inline-start: 50%; transform: translateX(-50%);
    inline-size: min(74%, 2.8rem); block-size: var(--bar-size);
}
.customer-chart-quiet { opacity: 0; }
.customer-chart-bars--customer { display: grid; gap: 7px; }
.customer-chart-bars--customer li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 9px; }
.customer-chart-bars--customer .customer-chart-value { grid-row: 1; grid-column: 2; }
.customer-chart-bars--customer .customer-chart-bar {
    grid-column: 1 / -1; block-size: 5px; background: linear-gradient(to right, var(--customer-primary) var(--bar-size), var(--tint) var(--bar-size));
}
.customer-dashboard .invoice-list { height: auto; flex: none; }
.customer-dashboard .table-scroll { max-height: 35vh; }
.customer-dashboard .list-heading { padding: 10px 13px; flex-wrap: wrap; }
.customer-dashboard .list-heading h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
#invoiceDetails section { min-width: 0; }
#invoiceRange, #invoiceSelection, .customer-report-meta {
    margin: 0; padding: 4px 8px; border-radius: 6px; background: var(--soft);
    color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
}
#invoiceRange:empty, #invoiceSelection:empty, .customer-report-meta:empty { display: none; }
:is(#invoiceDetails, #itemwiseDetails) :is(th, td) { padding: 9px 10px; }
:is(#invoiceDetails, #itemwiseDetails) td { font-size: 13px; }
:is(#invoiceDetails, #itemwiseDetails) th { height: 38px; }
#customerInvoiceTable td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; }
#customerInvoiceTable tr.selected td[data-report-identifier] {
    --report-identifier-ink: var(--text);
}
:is(#customerInvoiceTable, #customerItemsTable) tr.selected td:first-child {
    box-shadow: inset 3px 0 var(--accent), inset 0 1px var(--accent), inset 0 -1px var(--accent);
}
:is(#customerInvoiceTable, #customerItemsTable) tr.selected td:last-child {
    box-shadow: inset -1px 0 var(--accent), inset 0 1px var(--accent), inset 0 -1px var(--accent);
}
#customerInvoiceTable tfoot td { border-top-color: var(--line); }
.customer-dashboard #invoiceProducts { block-size: clamp(12rem, 30dvh, 20rem); min-block-size: 0; }
.customer-dashboard #invoiceProducts .table-scroll {
    max-height: none;
    overflow: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    scrollbar-color: var(--muted) transparent;
}
:is(#customerItemsTable, #customerItemwiseTable) tbody tr:not(:has([data-product-select])) { cursor: default; }
#customerItemsTable [data-product-select] { color: var(--text); text-align: left; white-space: normal; }
#customerItemsTable [data-product-select][aria-pressed="true"] { font-weight: 650; }
:is(#customerItemsTable, #customerItemwiseTable) td { white-space: normal; overflow-wrap: anywhere; }
#customerItemwiseTable tfoot td { border-top-color: var(--line); }
@media (min-width: 850px) {
    .customer-charts { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
}
@media (min-width: 1100px) {
    .customer-dashboard #invoiceFilters {
        display: grid; grid-template-columns: minmax(0, max-content) 1fr;
        align-items: end; gap: 12px 16px;
    }
    .customer-filter-controls {
        grid-template-columns: repeat(2, 8.25rem) clamp(11rem, calc(58vw - 28.875rem), 25rem) clamp(11.5rem, 17vw, 19rem);
    }
    .customer-filter-footer { flex-wrap: nowrap; margin-top: 0; }
    .customer-view-options { flex-wrap: nowrap; }
    .customer-dashboard .filters .customer-view-options label { min-height: 37px; white-space: nowrap; }
}
@media (min-width: 1250px) {
    #invoiceDetails:has(> #invoiceProducts:not([data-report-section-hidden])) { grid-template-columns: minmax(0, 1.24fr) minmax(0, 1fr); }
    .customer-dashboard #invoiceDetails .invoice-list { block-size: clamp(17rem, 40dvh, 27rem); }
    .customer-dashboard #invoiceDetails .table-scroll { max-height: none; }
}
@media (max-width: 960px) {
    .customer-dashboard .report-metrics { --report-metric-columns: 3; }
    .customer-filter-controls { grid-template-columns: repeat(2, minmax(0, 10rem)) repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .customer-filter-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .customer-filter-controls label:has(#invoiceCustomer),
    .customer-filter-controls label:has(#invoiceSearch) { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
    .customer-login .welcome-panel { min-height: auto; }
    .customer-dashboard .report-metrics { --report-metric-columns: 2; }
    .customer-dashboard .customer-theme-control [data-theme-label] { font-size: 0; }
    .customer-dashboard .customer-user-name { max-width: 7rem; }
    .customer-heading-icon { inline-size: 35px; block-size: 35px; }
    .customer-heading-icon .erp-action-icon { inline-size: 20px; block-size: 20px; }
    .customer-heading { gap: 9px; }
    .customer-chart-mobile-quiet { opacity: 0; }
    :is(#invoiceDetails, #itemwiseDetails) :is(th, td) { padding-inline: 7px; }
}
