/* ==========================================================
   PANVIYO Smart Pantry
   Version : 3.0 Stable
   Build   : 090
   File    : css/style.css

   Shopping Page Redesign
   Light + Dark Mode
========================================================== */


/* ==========================================================
   ROOT VARIABLES
========================================================== */

:root {

    /* Brand */
    --primary: #2E7D32;
    --primary-dark: #1B5E20;
    --primary-light: #66BB6A;
    --primary-soft: #E8F5E9;

    /* Status */
    --success: #2E7D32;
    --success-light: #E8F5E9;

    --warning: #F9A825;
    --warning-light: #FFF8E1;

    --danger: #C62828;
    --danger-light: #FFEBEE;

    --info: #1565C0;
    --info-light: #E3F2FD;

    /* Light mode */
    --background: #F5F7F5;
    --surface: #FFFFFF;
    --surface-alt: #F8FAF8;

    --text-primary: #1F2933;
    --text-secondary: #607080;
    --text-muted: #8A969F;

    --border: #DDE4DE;
    --border-strong: #C8D2C9;

    --shadow: rgba(27, 45, 30, 0.08);
    --shadow-strong: rgba(27, 45, 30, 0.16);

    /* Inputs */
    --input-background: #FFFFFF;
    --input-border: #CBD5CE;
    --input-focus: #2E7D32;

    /* Navigation */
    --nav-background: #FFFFFF;
    --nav-border: #E0E6E1;

    /* Modal */
    --modal-overlay: rgba(0, 0, 0, 0.55);

    /* Shopping */
    --shopping-card: #FFFFFF;
    --shopping-bought: #F1F8F2;
    --shopping-bought-border: #A5D6A7;

    --budget-background: #E5E7EB;
    --budget-progress: #2E7D32;

    /* Radius */
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 16px;
    --radius-xl: 20px;

    /* Typography */
    --font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    /* Layout */
    --max-width: 1100px;

}


/* ==========================================================
   DARK MODE
========================================================== */

body.dark-mode {

    --background: #101512;

    --surface: #18201B;
    --surface-alt: #1D2720;

    --text-primary: #F1F5F2;
    --text-secondary: #B6C2BA;
    --text-muted: #84928A;

    --border: #2E3A31;
    --border-strong: #3D4A40;

    --shadow:
        rgba(0, 0, 0, 0.28);

    --shadow-strong:
        rgba(0, 0, 0, 0.45);

    --primary-soft:
        #18351D;

    --success-light:
        #18351D;

    --warning-light:
        #3B3216;

    --danger-light:
        #3A1B1B;

    --info-light:
        #172B40;

    --input-background:
        #141B17;

    --input-border:
        #39473E;

    --nav-background:
        #18201B;

    --nav-border:
        #2E3A31;

    --shopping-card:
        #1A231D;

    --shopping-bought:
        #182B1C;

    --shopping-bought-border:
        #356B3A;

    --budget-background:
        #303933;

    --budget-progress:
        #66BB6A;

    --modal-overlay:
        rgba(0, 0, 0, 0.72);

}


/* ==========================================================
   GLOBAL RESET
========================================================== */

* {

    box-sizing: border-box;

    margin: 0;

    padding: 0;

}


html {

    scroll-behavior: smooth;

}


body {

    min-height: 100vh;

    background:
        var(--background);

    color:
        var(--text-primary);

    font-family:
        var(--font-family);

    font-size: 16px;

    line-height: 1.5;

    transition:
        background-color 0.25s ease,
        color 0.25s ease;

}


button,
input,
select,
textarea {

    font-family:
        inherit;

}


button {

    cursor: pointer;

}


img {

    max-width: 100%;

}


ul {

    list-style: none;

}


/* ==========================================================
   APP CONTAINER
========================================================== */

#app {

    min-height: 100vh;

}


.app-container {

    width: 100%;

    max-width:
        var(--max-width);

    margin:
        0 auto;

    padding:
        24px 20px 110px;

}


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

.logo-area {

    padding:
        24px 0 28px;

}


.logo-area h1 {

    color:
        var(--primary);

    font-size:
        clamp(28px, 5vw, 38px);

    font-weight:
        800;

    letter-spacing:
        -0.5px;

}


.tagline {

    color:
        var(--text-secondary);

    margin-top:
        4px;

    font-size:
        15px;

}


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

.page {

    display: none;

    animation:
        fadeIn 0.2s ease;

}


.page.active {

    display: block;

}


@keyframes fadeIn {

    from {

        opacity: 0;

        transform:
            translateY(4px);

    }

    to {

        opacity: 1;

        transform:
            translateY(0);

    }

}


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

.page-header {

    margin-bottom:
        24px;

}


.page-header h2 {

    color:
        var(--text-primary);

    font-size:
        clamp(24px, 5vw, 32px);

    font-weight:
        750;

}


.page-header p {

    color:
        var(--text-secondary);

    margin-top:
        5px;

}


/* ==========================================================
   HEADINGS
========================================================== */

h1,
h2,
h3,
h4 {

    color:
        var(--text-primary);

}


h3 {

    font-size:
        18px;

}


/* ==========================================================
   DASHBOARD GRID
========================================================== */

.dashboard-grid {

    display:
        grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap:
        16px;

    margin-bottom:
        20px;

}


.dashboard-card {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

    padding:
        20px;

    box-shadow:
        0 5px 18px var(--shadow);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.25s ease;

}


.dashboard-card:hover {

    transform:
        translateY(-2px);

    box-shadow:
        0 8px 24px var(--shadow-strong);

}


.dashboard-card h1,
.dashboard-card h2 {

    margin-top:
        6px;

}


.card-icon {

    display:
        block;

    font-size:
        28px;

    margin-bottom:
        8px;

}


/* Status cards */

.dashboard-card.warning {

    border-left:
        4px solid var(--warning);

}


.dashboard-card.danger {

    border-left:
        4px solid var(--danger);

}


.dashboard-card.success {

    border-left:
        4px solid var(--success);

}


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

.info-card {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

    padding:
        20px;

    margin-bottom:
        18px;

    box-shadow:
        0 4px 16px var(--shadow);

}


.info-card h3 {

    margin-bottom:
        8px;

}


.info-card p,
.info-card li {

    color:
        var(--text-secondary);

}


/* ==========================================================
   DASHBOARD DETAILS
========================================================== */

.dashboard-details {

    display:
        grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap:
        16px;

    margin-bottom:
        24px;

}


/* ==========================================================
   SECTION
========================================================== */

section {

    margin-bottom:
        24px;

}


.section-header {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        16px;

    margin-bottom:
        16px;

}


.section-header p {

    color:
        var(--text-secondary);

    font-size:
        14px;

}


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

.form-card,
.search-card,
.settings-card,
.scanner-card {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

    padding:
        22px;

    margin-bottom:
        18px;

    box-shadow:
        0 5px 18px var(--shadow);

}


.form-card h3,
.settings-card h3 {

    margin-bottom:
        18px;

}


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

input,
select,
textarea {

    width:
        100%;

    background:
        var(--input-background);

    color:
        var(--text-primary);

    border:
        1px solid var(--input-border);

    border-radius:
        var(--radius-medium);

    padding:
        12px 14px;

    font-size:
        15px;

    outline:
        none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.25s ease;

}


input::placeholder,
textarea::placeholder {

    color:
        var(--text-muted);

}


input:focus,
select:focus,
textarea:focus {

    border-color:
        var(--input-focus);

    box-shadow:
        0 0 0 3px
        rgba(46, 125, 50, 0.12);

}


textarea {

    resize:
        vertical;

}


label {

    display:
        block;

    color:
        var(--text-secondary);

    font-size:
        14px;

    font-weight:
        600;

    margin:
        14px 0 6px;

}


/* ==========================================================
   TWO COLUMNS
========================================================== */

.two-columns {

    display:
        grid;

    grid-template-columns:
        1fr 1fr;

    gap:
        12px;

}


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

.button-group {

    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        10px;

    margin-top:
        18px;

}


.primary-button,
.secondary-button,
.danger-button,
.success-button {

    border:
        none;

    border-radius:
        var(--radius-medium);

    padding:
        11px 16px;

    font-size:
        14px;

    font-weight:
        700;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease,
        box-shadow 0.15s ease;

}


.primary-button {

    background:
        var(--primary);

    color:
        #FFFFFF;

}


.primary-button:hover {

    background:
        var(--primary-dark);

}


.secondary-button {

    background:
        var(--surface-alt);

    color:
        var(--text-primary);

    border:
        1px solid var(--border);

}


.danger-button {

    background:
        var(--danger);

    color:
        #FFFFFF;

}


.success-button {

    background:
        var(--success);

    color:
        #FFFFFF;

}


.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.success-button:hover {

    transform:
        translateY(-1px);

}


.primary-button:active,
.secondary-button:active,
.danger-button:active,
.success-button:active {

    transform:
        translateY(0);

}


/* ==========================================================
   SHOPPING PAGE
========================================================== */

#shoppingPage {

    padding-bottom:
        30px;

}


/* ==========================================================
   CURRENT SHOPPING TRIP
========================================================== */

.shopping-trip-card {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-xl);

    padding:
        22px;

    box-shadow:
        0 6px 22px var(--shadow);

    margin-bottom:
        18px;

}


.shopping-trip-header {

    display:
        flex;

    justify-content:
        space-between;

    align-items:
        center;

    gap:
        16px;

    padding-bottom:
        16px;

    margin-bottom:
        6px;

    border-bottom:
        1px solid var(--border);

}


.shopping-trip-header h3 {

    font-size:
        20px;

}


.shopping-trip-header p {

    color:
        var(--text-secondary);

    font-size:
        14px;

    margin-top:
        3px;

}


/* ==========================================================
   SHOPPING ITEM
========================================================== */

.shopping-item {

    display:
        grid;

    grid-template-columns:
        1fr auto;

    gap:
        18px;

    padding:
        18px 4px;

    border-bottom:
        1px solid var(--border);

}


.shopping-item:last-child {

    border-bottom:
        none;

}


.shopping-item-info {

    min-width:
        0;

}


.shopping-item-name {

    color:
        var(--text-primary);

    font-size:
        18px;

    font-weight:
        750;

    margin-bottom:
        5px;

}


.shopping-item-details {

    color:
        var(--text-secondary);

    font-size:
        14px;

}


.shopping-item-total {

    display:
        flex;

    align-items:
        center;

    justify-content:
        flex-end;

    min-width:
        100px;

    font-size:
        17px;

    font-weight:
        800;

    color:
        var(--text-primary);

}


.shopping-item-actions {

    display:
        flex;

    flex-wrap:
        wrap;

    gap:
        8px;

    margin-top:
        12px;

}


.shopping-item-actions button {

    padding:
        8px 11px;

    border-radius:
        9px;

    border:
        1px solid var(--border);

    background:
        var(--surface-alt);

    color:
        var(--text-primary);

    font-size:
        13px;

    font-weight:
        650;

}


.shopping-item-actions button:hover {

    border-color:
        var(--primary);

    color:
        var(--primary);

}


.shopping-item-actions .bought-button {

    color:
        var(--success);

}


.shopping-item-actions .delete-button {

    color:
        var(--danger);

}


/* ==========================================================
   BOUGHT SHOPPING ITEM
========================================================== */

.shopping-item.bought {

    background:
        var(--shopping-bought);

    border:
        1px solid var(--shopping-bought-border);

    border-radius:
        var(--radius-medium);

    margin:
        8px 0;

    padding:
        16px;

}


.shopping-item.bought .shopping-item-name {

    color:
        var(--text-secondary);

    text-decoration:
        line-through;

}


.shopping-item-bought-badge {

    display:
        inline-flex;

    align-items:
        center;

    gap:
        5px;

    margin-top:
        8px;

    padding:
        5px 9px;

    border-radius:
        999px;

    background:
        var(--success-light);

    color:
        var(--success);

    font-size:
        12px;

    font-weight:
        800;

}


/* ==========================================================
   SHOPPING ADD ITEM CARD
========================================================== */

.shopping-add-card {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

    padding:
        22px;

    margin-bottom:
        18px;

    box-shadow:
        0 5px 18px var(--shadow);

}


.shopping-add-card h3 {

    margin-bottom:
        16px;

}


/* ==========================================================
   SHOPPING TRIP CALCULATOR BUTTON
========================================================== */

.shopping-trip-calculator-button {

    display:
        flex;

    justify-content:
        center;

    margin:
        18px 0;

}


.shopping-trip-calculator-button button {

    width:
        100%;

    max-width:
        500px;

    padding:
        15px 20px;

    font-size:
        16px;

    border-radius:
        var(--radius-medium);

}


/* ==========================================================
   SHOPPING SUMMARY
========================================================== */

.shopping-summary {

    display:
        grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap:
        12px;

    margin-bottom:
        24px;

}


.shopping-summary-card {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-medium);

    padding:
        16px;

    box-shadow:
        0 4px 14px var(--shadow);

}


.shopping-summary-label {

    display:
        block;

    color:
        var(--text-secondary);

    font-size:
        13px;

    margin-bottom:
        5px;

}


.shopping-summary-value {

    display:
        block;

    color:
        var(--text-primary);

    font-size:
        18px;

    font-weight:
        800;

}


/* ==========================================================
   SHOPPING BUDGET
========================================================== */

.shopping-budget-card {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

    padding:
        20px;

    margin-bottom:
        18px;

}


.shopping-budget-card h3 {

    margin-bottom:
        6px;

}


.shopping-budget-card p {

    color:
        var(--text-secondary);

    font-size:
        14px;

    margin-bottom:
        12px;

}


/* ==========================================================
   BUDGET PROGRESS
========================================================== */

.budget-progress-container {

    margin-top:
        14px;

}


.budget-progress-bar {

    width:
        100%;

    height:
        12px;

    overflow:
        hidden;

    border-radius:
        999px;

    background:
        var(--budget-background);

}


.budget-progress-fill {

    width:
        0%;

    height:
        100%;

    border-radius:
        inherit;

    background:
        var(--budget-progress);

    transition:
        width 0.3s ease;

}


.budget-progress-text {

    margin-top:
        8px;

    color:
        var(--text-secondary);

    font-size:
        13px;

}


/* ==========================================================
   SHOPPING SEARCH
========================================================== */

.shopping-search-card {

    margin-bottom:
        18px;

}


.shopping-search-card input {

    width:
        100%;

}


/* ==========================================================
   EMPTY STATE
========================================================== */

.empty-state {

    padding:
        35px 20px;

    text-align:
        center;

    color:
        var(--text-secondary);

}


.empty-state .emoji {

    font-size:
        40px;

    margin-bottom:
        10px;

}


.empty-state h3 {

    margin-bottom:
        6px;

}


.empty-state p {

    color:
        var(--text-secondary);

    font-size:
        14px;

}


/* ==========================================================
   SHOPPING EDIT MODAL
========================================================== */

.shopping-edit-modal {

    position:
        fixed;

    inset:
        0;

    z-index:
        2000;

    display:
        none;

    align-items:
        center;

    justify-content:
        center;

    padding:
        20px;

    background:
        var(--modal-overlay);

    backdrop-filter:
        blur(4px);

}


.shopping-edit-modal.active {

    display:
        flex;

}


.shopping-edit-modal-content {

    width:
        100%;

    max-width:
        480px;

    max-height:
        calc(100vh - 40px);

    overflow-y:
        auto;

    background:
        var(--surface);

    color:
        var(--text-primary);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-xl);

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.3);

    animation:
        modalIn 0.2s ease;

}


@keyframes modalIn {

    from {

        opacity:
            0;

        transform:
            translateY(15px)
            scale(0.98);

    }

    to {

        opacity:
            1;

        transform:
            translateY(0)
            scale(1);

    }

}


.shopping-edit-modal-header {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    padding:
        18px 20px;

    border-bottom:
        1px solid var(--border);

}


.shopping-edit-modal-header h3 {

    font-size:
        19px;

}


.shopping-edit-close {

    width:
        36px;

    height:
        36px;

    border:
        none;

    border-radius:
        50%;

    background:
        var(--surface-alt);

    color:
        var(--text-primary);

    font-size:
        18px;

}


.shopping-edit-modal-body {

    padding:
        20px;

}


.shopping-edit-item-name {

    margin-bottom:
        20px;

    font-size:
        20px;

    font-weight:
        800;

}


.shopping-edit-total {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    margin:
        18px 0;

    padding:
        15px;

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-medium);

    background:
        var(--surface-alt);

}


.shopping-edit-total span {

    color:
        var(--text-secondary);

}


.shopping-edit-total strong {

    color:
        var(--primary);

    font-size:
        20px;

}


.shopping-edit-modal-footer {

    display:
        flex;

    gap:
        10px;

    padding:
        18px 20px;

    border-top:
        1px solid var(--border);

}


.shopping-edit-modal-footer button {

    flex:
        1;

}


/* ==========================================================
   TRIP CALCULATOR MODAL
========================================================== */

.shopping-trip-calculator-modal {

    position:
        fixed;

    inset:
        0;

    z-index:
        1900;

    display:
        none;

    align-items:
        center;

    justify-content:
        center;

    padding:
        20px;

    background:
        var(--modal-overlay);

    backdrop-filter:
        blur(4px);

}


.shopping-trip-calculator-modal.active {

    display:
        flex;

}


.shopping-trip-calculator-content {

    width:
        100%;

    max-width:
        520px;

    max-height:
        calc(100vh - 40px);

    overflow-y:
        auto;

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-xl);

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.3);

}


.shopping-trip-calculator-header {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    padding:
        18px 20px;

    border-bottom:
        1px solid var(--border);

}


.shopping-trip-calculator-body {

    padding:
        20px;

}


.trip-calculator-total {

    margin-top:
        18px;

    padding:
        20px;

    border-radius:
        var(--radius-large);

    background:
        var(--primary-soft);

    text-align:
        center;

}


.trip-calculator-total span {

    display:
        block;

    color:
        var(--text-secondary);

    font-size:
        13px;

}


.trip-calculator-total strong {

    display:
        block;

    color:
        var(--primary);

    font-size:
        30px;

    margin-top:
        4px;

}


/* ==========================================================
   CALCULATOR RECEIPTS
========================================================== */

.shopping-calculator-card {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

    padding:
        20px;

}


.shopping-calculator-header {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    margin-bottom:
        18px;

}


.calculator-close-button {

    width:
        36px;

    height:
        36px;

    border:
        none;

    border-radius:
        50%;

    background:
        var(--surface-alt);

    color:
        var(--text-primary);

}


.calculator-selected-product {

    display:
        flex;

    flex-direction:
        column;

    gap:
        3px;

    padding:
        14px;

    margin-bottom:
        15px;

    border-radius:
        var(--radius-medium);

    background:
        var(--surface-alt);

}


.calculator-product-label {

    color:
        var(--text-secondary);

    font-size:
        12px;

}


.calculator-product-name {

    color:
        var(--primary);

    font-size:
        18px;

}


.calculator-results {

    margin-top:
        18px;

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-medium);

    overflow:
        hidden;

}


.calculator-result-row,
.calculator-result-total {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    padding:
        12px 14px;

    border-bottom:
        1px solid var(--border);

}


.calculator-result-row span {

    color:
        var(--text-secondary);

}


.calculator-result-total {

    border-bottom:
        none;

    background:
        var(--primary-soft);

}


.calculator-result-total span {

    font-weight:
        800;

}


.calculator-result-total strong {

    color:
        var(--primary);

    font-size:
        19px;

}


/* ==========================================================
   PRODUCT LIST
========================================================== */

.product-list-section {

    margin-top:
        24px;

}


.product-list-section > h3 {

    margin-bottom:
        14px;

}


#productList {

    display:
        flex;

    flex-direction:
        column;

    gap:
        12px;

}


/* Product cards generated by JS */

.product-card {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

    padding:
        16px;

    box-shadow:
        0 4px 14px var(--shadow);

}


.product-card h3 {

    margin-bottom:
        5px;

}


.product-card p {

    color:
        var(--text-secondary);

    font-size:
        14px;

}


/* ==========================================================
   SEARCH / FILTERS
========================================================== */

.search-card {

    padding:
        14px;

}


.filter-bar {

    display:
        grid;

    grid-template-columns:
        1fr 1fr;

    gap:
        12px;

    margin-bottom:
        20px;

}


/* ==========================================================
   IMAGE PREVIEW
========================================================== */

.image-preview {

    display:
        block;

    max-width:
        180px;

    max-height:
        180px;

    margin:
        12px 0;

    border-radius:
        var(--radius-medium);

    border:
        1px solid var(--border);

    object-fit:
        cover;

}


/* ==========================================================
   CATEGORY LIST
========================================================== */

#categorySummary {

    display:
        grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap:
        8px;

}


#categorySummary li {

    padding:
        10px 12px;

    background:
        var(--surface-alt);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-medium);

    color:
        var(--text-secondary);

}


/* ==========================================================
   REPORTS
========================================================== */

#reportsPage .info-card ul {

    display:
        flex;

    flex-direction:
        column;

    gap:
        8px;

}


#reportsPage .info-card li {

    padding:
        10px 12px;

    background:
        var(--surface-alt);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-small);

}


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

.calculator-receipt-card,
.calculator-receipt {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

    padding:
        18px;

    margin-bottom:
        12px;

    box-shadow:
        0 4px 14px var(--shadow);

}


.calculator-receipt-header {

    display:
        flex;

    justify-content:
        space-between;

    margin-bottom:
        12px;

}


.calculator-receipt-header small {

    color:
        var(--text-muted);

}


.calculator-receipt-details {

    display:
        grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap:
        10px;

}


.calculator-receipt-details div {

    padding:
        10px;

    border-radius:
        var(--radius-small);

    background:
        var(--surface-alt);

}


.calculator-receipt-details span {

    display:
        block;

    color:
        var(--text-secondary);

    font-size:
        12px;

}


.calculator-receipt-details strong {

    display:
        block;

    margin-top:
        3px;

}


/* ==========================================================
   COMPLETED SHOPPING
========================================================== */

.completed-shopping-card {

    background:
        var(--surface);

    border:
        1px solid var(--border);

    border-radius:
        var(--radius-large);

    padding:
        18px;

    margin-bottom:
        14px;

    box-shadow:
        0 4px 14px var(--shadow);

}


.completed-shopping-item {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        10px;

    padding:
        9px 0;

    border-bottom:
        1px solid var(--border);

}


.completed-shopping-item:last-child {

    border-bottom:
        none;

}


.calculator-receipt-total {

    display:
        flex;

    justify-content:
        space-between;

    margin-top:
        14px;

    padding-top:
        14px;

    border-top:
        1px solid var(--border);

}


/* ==========================================================
   SCANNER
========================================================== */

#scanner {

    min-height:
        250px;

    border:
        1px dashed var(--border-strong);

    border-radius:
        var(--radius-large);

    overflow:
        hidden;

    background:
        var(--surface-alt);

    margin-bottom:
        18px;

}


#scanner video {

    width:
        100%;

}


#scanner canvas {

    max-width:
        100%;

}


/* ==========================================================
   SETTINGS
========================================================== */

.setting-row {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    gap:
        20px;

    padding:
        15px 0;

    border-bottom:
        1px solid var(--border);

}


.setting-row:last-child {

    border-bottom:
        none;

}


.setting-row label {

    margin:
        0;

    color:
        var(--text-primary);

}


.setting-row small {

    display:
        block;

    color:
        var(--text-muted);

    margin-top:
        4px;

}


.settings-option {

    display:
        flex;

    align-items:
        center;

    justify-content:
        space-between;

    padding:
        15px 0;

}


.settings-option input[type="checkbox"] {

    width:
        20px;

    height:
        20px;

    accent-color:
        var(--primary);

}


/* ==========================================================
   FILE INPUT
========================================================== */

input[type="file"] {

    padding:
        9px;

}


input[type="file"]::file-selector-button {

    margin-right:
        10px;

    padding:
        7px 10px;

    border:
        none;

    border-radius:
        7px;

    background:
        var(--primary);

    color:
        white;

    cursor:
        pointer;

}


/* ==========================================================
   BOTTOM NAVIGATION
========================================================== */

.bottom-nav {

    position:
        fixed;

    left:
        0;

    right:
        0;

    bottom:
        0;

    z-index:
        1000;

    display:
        grid;

    grid-template-columns:
        repeat(6, 1fr);

    background:
        var(--nav-background);

    border-top:
        1px solid var(--nav-border);

    box-shadow:
        0 -5px 20px var(--shadow);

    padding:
        7px 8px;

    transition:
        background-color 0.25s ease;

}


.bottom-nav button {

    display:
        flex;

    flex-direction:
        column;

    align-items:
        center;

    justify-content:
        center;

    gap:
        2px;

    min-height:
        58px;

    border:
        none;

    background:
        transparent;

    color:
        var(--text-muted);

    border-radius:
        10px;

    transition:
        color 0.2s ease,
        background-color 0.2s ease;

}


.bottom-nav button:hover {

    background:
        var(--surface-alt);

}


.bottom-nav button.active {

    color:
        var(--primary);

    background:
        var(--primary-soft);

}


.nav-icon {

    font-size:
        20px;

}


.nav-text {

    font-size:
        11px;

    font-weight:
        650;

}


/* ==========================================================
   TOAST
========================================================== */

.toast {

    position:
        fixed;

    left:
        50%;

    bottom:
        90px;

    z-index:
        3000;

    transform:
        translateX(-50%);

    max-width:
        calc(100vw - 40px);

    padding:
        12px 18px;

    border-radius:
        999px;

    background:
        #26332A;

    color:
        #FFFFFF;

    box-shadow:
        0 8px 25px
        rgba(0, 0, 0, 0.25);

    font-size:
        14px;

    font-weight:
        600;

    animation:
        toastIn 0.2s ease;

}


@keyframes toastIn {

    from {

        opacity:
            0;

        transform:
            translate(-50%, 10px);

    }

    to {

        opacity:
            1;

        transform:
            translate(-50%, 0);

    }

}


/* ==========================================================
   DARK MODE SELECT / OPTION FIX
========================================================== */

body.dark-mode select option {

    background:
        #18201B;

    color:
        #F1F5F2;

}


/* ==========================================================
   DARK MODE DATE / NUMBER CONTROLS
========================================================== */

body.dark-mode input[type="date"],
body.dark-mode input[type="number"] {

    color-scheme:
        dark;

}


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

@media (max-width: 900px) {

    .dashboard-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .dashboard-details {

        grid-template-columns:
            repeat(2, 1fr);

    }


    .shopping-summary {

        grid-template-columns:
            repeat(2, 1fr);

    }

}


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

@media (max-width: 650px) {

    .app-container {

        padding:
            16px 14px 105px;

    }


    .logo-area {

        padding:
            16px 0 22px;

    }


    .dashboard-grid {

        grid-template-columns:
            1fr 1fr;

        gap:
            10px;

    }


    .dashboard-card {

        padding:
            15px;

    }


    .dashboard-card h3 {

        font-size:
            14px;

    }


    .dashboard-card h1,
    .dashboard-card h2 {

        font-size:
            24px;

    }


    .dashboard-details {

        grid-template-columns:
            1fr;

    }


    .two-columns {

        grid-template-columns:
            1fr;

    }


    .filter-bar {

        grid-template-columns:
            1fr;

    }


    .shopping-trip-header {

        align-items:
            flex-start;

        flex-direction:
            column;

    }


    .shopping-trip-header .primary-button {

        width:
            100%;

    }


    .shopping-item {

        grid-template-columns:
            1fr;

        gap:
            8px;

    }


    .shopping-item-total {

        justify-content:
            flex-start;

        min-width:
            auto;

    }


    .shopping-item-actions {

        width:
            100%;

    }


    .shopping-item-actions button {

        flex:
            1;

        min-width:
            85px;

    }


    .shopping-summary {

        grid-template-columns:
            1fr 1fr;

    }


    .shopping-summary-card {

        padding:
            14px;

    }


    .calculator-receipt-details {

        grid-template-columns:
            1fr;

    }


    .section-header {

        align-items:
            flex-start;

        flex-direction:
            column;

    }


    .section-header button {

        width:
            100%;

    }


    .bottom-nav {

        padding:
            5px 4px;

    }


    .bottom-nav button {

        min-height:
            55px;

    }


    .nav-icon {

        font-size:
            18px;

    }


    .nav-text {

        font-size:
            9px;

    }

}


/* ==========================================================
   VERY SMALL DEVICES
========================================================== */

@media (max-width: 400px) {

    .dashboard-grid {

        grid-template-columns:
            1fr;

    }


    .shopping-summary {

        grid-template-columns:
            1fr;

    }


    .button-group {

        flex-direction:
            column;

    }


    .button-group button {

        width:
            100%;

    }


    .shopping-edit-modal-footer {

        flex-direction:
            column;

    }


    .bottom-nav {

        grid-template-columns:
            repeat(6, 1fr);

    }


    .nav-text {

        display:
            none;

    }

}


/* ==========================================================
   ACCESSIBILITY
========================================================== */

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {

    outline:
        3px solid
        rgba(102, 187, 106, 0.45);

    outline-offset:
        2px;

}


/* ==========================================================
   REDUCED MOTION
========================================================== */

@media (prefers-reduced-motion: reduce) {

    * {

        scroll-behavior:
            auto !important;

        animation-duration:
            0.01ms !important;

        animation-iteration-count:
            1 !important;

        transition-duration:
            0.01ms !important;

    }

}

/* ==========================================================
   PANVIYO Smart Pantry
   EXPIRY ALERT UI
   Light Mode + Dark Mode
========================================================== */


/* ==========================================================
   EXPIRY ALERTS CONTAINER
========================================================== */

#expiryAlerts {

    display: flex;

    flex-direction: column;

    gap: 14px;

    margin-top: 16px;

}


/* ==========================================================
   BASE EXPIRY ALERT
========================================================== */

.expiry-alert {

    display: block;

    width: 100%;

    padding: 18px 20px;

    border-radius: 16px;

    border-left: 6px solid;

    box-shadow:
        0 3px 10px var(--shadow);

    font-family:
        var(--font-family);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.25s ease;

}


/* ==========================================================
   HOVER
========================================================== */

.expiry-alert:hover {

    transform:
        translateY(-1px);

    box-shadow:
        0 6px 18px var(--shadow-strong);

}


/* ==========================================================
   ALERT TITLE
========================================================== */

.expiry-alert strong {

    display: block;

    font-size: 18px;

    font-weight: 700;

    line-height: 1.3;

    margin-bottom: 6px;

}


/* ==========================================================
   ALERT MESSAGE
========================================================== */

.expiry-alert p {

    margin: 0;

    font-size: 15px;

    line-height: 1.5;

}


/* ==========================================================
   EXPIRY REMINDER
   LIGHT MODE
========================================================== */

.expiry-alert.warning {

    background-color:
        #FFF8E7;

    border-left-color:
        #FF9800;

}


.expiry-alert.warning strong {

    color:
        #E65100;

}


.expiry-alert.warning p {

    color:
        #8D6E63;

}


/* ==========================================================
   EXPIRED PRODUCT
   LIGHT MODE
========================================================== */

.expiry-alert.danger {

    background-color:
        #FDECEF;

    border-left-color:
        #F44336;

}


.expiry-alert.danger strong {

    color:
        #D32F2F;

}


.expiry-alert.danger p {

    color:
        #B71C1C;

}


/* ==========================================================
   DARK MODE
========================================================== */

body.dark-mode .expiry-alert {

    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.40);

}


body.dark-mode .expiry-alert:hover {

    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.55);

}


/* ==========================================================
   EXPIRY REMINDER
   DARK MODE
========================================================== */

body.dark-mode .expiry-alert.warning {

    background-color:
        #3B3216;

    border-left-color:
        #FF9800;

}


body.dark-mode .expiry-alert.warning strong {

    color:
        #FFB74D;

}


body.dark-mode .expiry-alert.warning p {

    color:
        #D6B66B;

}


/* ==========================================================
   EXPIRED PRODUCT
   DARK MODE
========================================================== */

body.dark-mode .expiry-alert.danger {

    background-color:
        #3A1E22;

    border-left-color:
        #F44336;

}


body.dark-mode .expiry-alert.danger strong {

    color:
        #EF9A9A;

}


body.dark-mode .expiry-alert.danger p {

    color:
        #E0A2A6;

}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 600px) {

    #expiryAlerts {

        gap: 12px;

    }


    .expiry-alert {

        padding:
            16px 16px;

        border-left-width:
            5px;

        border-radius:
            14px;

    }


    .expiry-alert strong {

        font-size:
            17px;

    }


    .expiry-alert p {

        font-size:
            14px;

    }

}

/* ==========================================================
   PANVIYO PRODUCT CARD
   STATUS + ACTION BUTTONS
   Light Mode + Dark Mode
========================================================== */


/* ==========================================================
   PRODUCT STATUS BADGE
========================================================== */

.product-card .badge {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: fit-content;

    padding: 6px 12px;

    margin-top: 12px;

    border-radius: 999px;

    font-size: 13px;

    font-weight: 700;

    line-height: 1;

    border: 1px solid transparent;

}


/* ==========================================================
   FRESH
   GREEN
========================================================== */

.product-card .badge.fresh {

    background-color: #E8F5E9;

    color: #2E7D32;

    border-color: #A5D6A7;

}


/* ==========================================================
   EXPIRING SOON
   ORANGE
========================================================== */

.product-card .badge.warning {

    background-color: #FFF3E0;

    color: #E65100;

    border-color: #FFCC80;

}


/* ==========================================================
   EXPIRED
   RED
========================================================== */

.product-card .badge.expired,
.product-card .badge.danger {

    background-color: #FFEBEE;

    color: #C62828;

    border-color: #EF9A9A;

}


/* ==========================================================
   PRODUCT ACTIONS
========================================================== */

.product-card .actions {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 16px;

}


/* ==========================================================
   ALL ACTION BUTTONS
========================================================== */

.product-card .actions button {

    border: 1px solid transparent;

    border-radius: 10px;

    padding: 8px 12px;

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;

}


/* ==========================================================
   BUTTON HOVER
========================================================== */

.product-card .actions button:hover {

    transform: translateY(-1px);

    box-shadow:
        0 3px 8px var(--shadow);

}


/* ==========================================================
   EDIT BUTTON
   BLUE
========================================================== */

.product-card .actions button:first-child {

    background-color: #E3F2FD;

    color: #1565C0;

    border-color: #90CAF9;

}


/* ==========================================================
   EDIT HOVER
========================================================== */

.product-card .actions button:first-child:hover {

    background-color: #BBDEFB;

    color: #0D47A1;

}


/* ==========================================================
   REMOVE IMAGE BUTTON
   PURPLE
========================================================== */

.product-card .actions button:nth-child(3) {

    background-color: #F3E5F5;

    color: #7B1FA2;

    border-color: #CE93D8;

}


/* ==========================================================
   REMOVE IMAGE HOVER
========================================================== */

.product-card .actions button:nth-child(3):hover {

    background-color: #E1BEE7;

    color: #6A1B9A;

}


/* ==========================================================
   DELETE BUTTON
   RED
========================================================== */

.product-card .actions button:last-child {

    background-color: #FFEBEE;

    color: #C62828;

    border-color: #EF9A9A;

}


/* ==========================================================
   DELETE HOVER
========================================================== */

.product-card .actions button:last-child:hover {

    background-color: #FFCDD2;

    color: #B71C1C;

}


/* ==========================================================
   DARK MODE
========================================================== */

body.dark-mode .product-card .badge.fresh {

    background-color: #183A21;

    color: #81C784;

    border-color: #388E3C;

}


body.dark-mode .product-card .badge.warning {

    background-color: #3B2B16;

    color: #FFB74D;

    border-color: #EF6C00;

}


body.dark-mode .product-card .badge.expired,
body.dark-mode .product-card .badge.danger {

    background-color: #3A1E22;

    color: #EF9A9A;

    border-color: #C62828;

}


/* ==========================================================
   DARK MODE - EDIT
========================================================== */

body.dark-mode .product-card .actions button:first-child {

    background-color: #172B3D;

    color: #90CAF9;

    border-color: #1976D2;

}


body.dark-mode .product-card .actions button:first-child:hover {

    background-color: #1E3A52;

    color: #BBDEFB;

}


/* ==========================================================
   DARK MODE - REMOVE IMAGE
========================================================== */

body.dark-mode .product-card .actions button:nth-child(3) {

    background-color: #302039;

    color: #CE93D8;

    border-color: #8E24AA;

}


body.dark-mode .product-card .actions button:nth-child(3):hover {

    background-color: #432A50;

    color: #E1BEE7;

}


/* ==========================================================
   DARK MODE - DELETE
========================================================== */

body.dark-mode .product-card .actions button:last-child {

    background-color: #3A1E22;

    color: #EF9A9A;

    border-color: #C62828;

}


body.dark-mode .product-card .actions button:last-child:hover {

    background-color: #4A252A;

    color: #FFCDD2;

}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 600px) {

    .product-card .actions {

        gap: 7px;

    }


    .product-card .actions button {

        padding: 8px 10px;

        font-size: 12px;

    }


    .product-card .badge {

        font-size: 12px;

        padding: 6px 10px;

    }

}
/* ==========================================================
   PRODUCT CARD STATUS + ACTION BUTTONS
   PANVIYO Smart Pantry
========================================================== */


/* ==========================================================
   PRODUCT CARD BASE
========================================================== */

.product-card {

    position: relative;

    border-left: 6px solid transparent;

    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.2s ease;

}


/* ==========================================================
   PRODUCT CARD HOVER
========================================================== */

.product-card:hover {

    transform: translateY(-2px);

}


/* ==========================================================
   FRESH PRODUCT
   Green
========================================================== */

.product-card:has(.badge.fresh) {

    border-left-color: #2E7D32;

}


/* ==========================================================
   EXPIRING PRODUCT
   Orange
========================================================== */

.product-card:has(.badge.warning),
.product-card:has(.badge.expiring),
.product-card:has(.badge.expiring-soon) {

    border-left-color: #FF9800;

}


/* ==========================================================
   EXPIRED PRODUCT
   Red
========================================================== */

.product-card:has(.badge.expired),
.product-card:has(.badge.danger) {

    border-left-color: #F44336;

}


/* ==========================================================
   STATUS BADGES
========================================================== */


/* Fresh */

.product-card .badge.fresh {

    background-color: #E8F5E9;

    color: #2E7D32;

    border: 1px solid #A5D6A7;

}


/* Expiring */

.product-card .badge.warning,
.product-card .badge.expiring,
.product-card .badge.expiring-soon {

    background-color: #FFF3E0;

    color: #E65100;

    border: 1px solid #FFCC80;

}


/* Expired */

.product-card .badge.expired,
.product-card .badge.danger {

    background-color: #FFEBEE;

    color: #C62828;

    border: 1px solid #EF9A9A;

}


/* ==========================================================
   PRODUCT ACTION BUTTONS
========================================================== */

.product-card .actions {

    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin-top: 16px;

}


/* Base action button */

.product-card .actions button {

    border: none;

    border-radius: 10px;

    padding: 9px 13px;

    font-family: inherit;

    font-size: 13px;

    font-weight: 600;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;

}


/* Button press */

.product-card .actions button:active {

    transform: scale(0.97);

}


/* ==========================================================
   EDIT BUTTON
   Blue
========================================================== */

.product-card .actions button:nth-child(1) {

    background-color: #E3F2FD;

    color: #1565C0;

    border: 1px solid #90CAF9;

}


.product-card .actions button:nth-child(1):hover {

    background-color: #BBDEFB;

    color: #0D47A1;

}


/* ==========================================================
   ADD TO SHOPPING
   Green
========================================================== */

.product-card .actions button:nth-child(2) {

    background-color: #E8F5E9;

    color: #2E7D32;

    border: 1px solid #A5D6A7;

}


.product-card .actions button:nth-child(2):hover {

    background-color: #C8E6C9;

    color: #1B5E20;

}


/* ==========================================================
   REMOVE IMAGE
   Purple
========================================================== */

.product-card .actions button:nth-child(3) {

    background-color: #F3E5F5;

    color: #7B1FA2;

    border: 1px solid #CE93D8;

}


.product-card .actions button:nth-child(3):hover {

    background-color: #E1BEE7;

    color: #6A1B9A;

}


/* ==========================================================
   DELETE
   Red
========================================================== */

.product-card .actions button:last-child {

    background-color: #FFEBEE;

    color: #C62828;

    border: 1px solid #EF9A9A;

}


.product-card .actions button:last-child:hover {

    background-color: #FFCDD2;

    color: #B71C1C;

}


/* ==========================================================
   DARK MODE
========================================================== */

body.dark-mode .product-card {

    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.35);

}


/* ==========================================================
   DARK MODE — STATUS BADGES
========================================================== */


/* Fresh */

body.dark-mode .product-card .badge.fresh {

    background-color: #1B3A22;

    color: #81C784;

    border-color: #388E3C;

}


/* Expiring */

body.dark-mode .product-card .badge.warning,
body.dark-mode .product-card .badge.expiring,
body.dark-mode .product-card .badge.expiring-soon {

    background-color: #3B2B14;

    color: #FFB74D;

    border-color: #F57C00;

}


/* Expired */

body.dark-mode .product-card .badge.expired,
body.dark-mode .product-card .badge.danger {

    background-color: #3A1E22;

    color: #EF9A9A;

    border-color: #D32F2F;

}


/* ==========================================================
   DARK MODE — EDIT
========================================================== */

body.dark-mode .product-card .actions button:nth-child(1) {

    background-color: #162D40;

    color: #64B5F6;

    border-color: #1976D2;

}


body.dark-mode .product-card .actions button:nth-child(1):hover {

    background-color: #1E3A52;

}


/* ==========================================================
   DARK MODE — ADD TO SHOPPING
========================================================== */

body.dark-mode .product-card .actions button:nth-child(2) {

    background-color: #193522;

    color: #81C784;

    border-color: #388E3C;

}


body.dark-mode .product-card .actions button:nth-child(2):hover {

    background-color: #21462B;

}


/* ==========================================================
   DARK MODE — REMOVE IMAGE
========================================================== */

body.dark-mode .product-card .actions button:nth-child(3) {

    background-color: #302039;

    color: #CE93D8;

    border-color: #8E24AA;

}


body.dark-mode .product-card .actions button:nth-child(3):hover {

    background-color: #3E2949;

}


/* ==========================================================
   DARK MODE — DELETE
========================================================== */

body.dark-mode .product-card .actions button:last-child {

    background-color: #3A1E22;

    color: #EF9A9A;

    border-color: #D32F2F;

}


body.dark-mode .product-card .actions button:last-child:hover {

    background-color: #4A252A;

}


/* ==========================================================
   MOBILE PRODUCT ACTIONS
========================================================== */

@media (max-width: 600px) {

    .product-card .actions {

        gap: 6px;

    }


    .product-card .actions button {

        flex: 1 1 auto;

        min-width: 120px;

        padding: 9px 10px;

        font-size: 12px;

    }

}

/* ==========================================================
   PANVIYO PRODUCT EXPIRY BADGES
   Works with existing createProductCard()
   No JavaScript changes required
========================================================== */


/* ==========================================================
   BASE BADGE
========================================================== */

.product-card .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: fit-content;

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

    border-radius: 999px;

    font-size: 0.82rem;
    font-weight: 700;

    line-height: 1;

    letter-spacing: 0.2px;

    border: 1px solid transparent;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}


/* ==========================================================
   FRESH
   Green
========================================================== */

.product-card .badge.fresh {

    background: #DCFCE7;

    color: #166534;

    border-color: #86EFAC;
}


/* ==========================================================
   EXPIRING SOON / WARNING
   Orange
========================================================== */

.product-card .badge.warning {

    background: #FEF3C7;

    color: #B45309;

    border-color: #F59E0B;
}


/* ==========================================================
   EXPIRED
   Red
========================================================== */

.product-card .badge.expired {

    background: #FEE2E2;

    color: #B91C1C;

    border-color: #FCA5A5;
}


/* ==========================================================
   DARK MODE
========================================================== */

body.dark-mode .product-card .badge.fresh {

    background: #14532D;

    color: #BBF7D0;

    border-color: #22C55E;
}


body.dark-mode .product-card .badge.warning {

    background: #78350F;

    color: #FDE68A;

    border-color: #F59E0B;
}


body.dark-mode .product-card .badge.expired {

    background: #7F1D1D;

    color: #FECACA;

    border-color: #EF4444;
}


/* ==========================================================
   ALTERNATIVE DARK-MODE SELECTOR
   Supports applications using data-theme="dark"
========================================================== */

[data-theme="dark"] .product-card .badge.fresh {

    background: #14532D;

    color: #BBF7D0;

    border-color: #22C55E;
}


[data-theme="dark"] .product-card .badge.warning {

    background: #78350F;

    color: #FDE68A;

    border-color: #F59E0B;
}


[data-theme="dark"] .product-card .badge.expired {

    background: #7F1D1D;

    color: #FECACA;

    border-color: #EF4444;
}


/* ==========================================================
   HOVER EFFECT
========================================================== */

.product-card .badge:hover {

    transform: translateY(-1px);

}


/* ==========================================================
   OPTIONAL STATUS DOT
   Adds a small visual indicator before the text
========================================================== */

.product-card .badge.fresh::before {

    content: "●";

    margin-right: 6px;

    font-size: 0.65rem;
}


.product-card .badge.warning::before {

    content: "●";

    margin-right: 6px;

    font-size: 0.65rem;
}


.product-card .badge.expired::before {

    content: "●";

    margin-right: 6px;

    font-size: 0.65rem;
}
/* ==========================================================
   PRODUCT CARD - EXPIRING SOON
   Existing JS classes:
   .badge.soon
   .badge.today
========================================================== */


/* ==========================================================
   EXPIRING SOON - ORANGE
========================================================== */

.product-card:has(.badge.soon) {

    border: 2px solid #F59E0B;

    background: #FFFBEB;

    box-shadow:
        0 4px 12px rgba(245, 158, 11, 0.12);

}


/* ==========================================================
   EXPIRING TODAY - ORANGE / STRONGER WARNING
========================================================== */

.product-card:has(.badge.today) {

    border: 2px solid #F97316;

    background: #FFF7ED;

    box-shadow:
        0 4px 12px rgba(249, 115, 22, 0.15);

}


/* ==========================================================
   SOON BADGE
========================================================== */

.product-card .badge.soon {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: fit-content;

    margin-top: 12px;

    padding: 7px 14px;

    border-radius: 999px;

    background: #FEF3C7;

    color: #B45309;

    border: 1px solid #F59E0B;

    font-size: 0.82rem;

    font-weight: 700;

    line-height: 1;

    letter-spacing: 0.2px;

}


/* ==========================================================
   TODAY BADGE
========================================================== */

.product-card .badge.today {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: fit-content;

    margin-top: 12px;

    padding: 7px 14px;

    border-radius: 999px;

    background: #FFEDD5;

    color: #C2410C;

    border: 1px solid #F97316;

    font-size: 0.82rem;

    font-weight: 700;

    line-height: 1;

    letter-spacing: 0.2px;

}


/* ==========================================================
   STATUS DOT
========================================================== */

.product-card .badge.soon::before {

    content: "●";

    margin-right: 6px;

    font-size: 0.65rem;

}


.product-card .badge.today::before {

    content: "●";

    margin-right: 6px;

    font-size: 0.65rem;

}


/* ==========================================================
   DARK MODE - EXPIRING SOON
========================================================== */

body.dark-mode .product-card:has(.badge.soon) {

    background: #422006;

    border-color: #F59E0B;

    box-shadow:
        0 4px 12px rgba(245, 158, 11, 0.18);

}


body.dark-mode .product-card .badge.soon {

    background: #78350F;

    color: #FDE68A;

    border-color: #F59E0B;

}


/* ==========================================================
   DARK MODE - EXPIRING TODAY
========================================================== */

body.dark-mode .product-card:has(.badge.today) {

    background: #431407;

    border-color: #F97316;

    box-shadow:
        0 4px 12px rgba(249, 115, 22, 0.2);

}


body.dark-mode .product-card .badge.today {

    background: #7C2D12;

    color: #FED7AA;

    border-color: #F97316;

}


/* ==========================================================
   ALTERNATIVE DARK MODE
   For themes using data-theme="dark"
========================================================== */

[data-theme="dark"] .product-card:has(.badge.soon) {

    background: #422006;

    border-color: #F59E0B;

}


[data-theme="dark"] .product-card .badge.soon {

    background: #78350F;

    color: #FDE68A;

    border-color: #F59E0B;

}


[data-theme="dark"] .product-card:has(.badge.today) {

    background: #431407;

    border-color: #F97316;

}


[data-theme="dark"] .product-card .badge.today {

    background: #7C2D12;

    color: #FED7AA;

    border-color: #F97316;

}

/* ==========================================================
   PRODUCT CARD - EXPIRING SOON
   Existing JS classes:
   .badge.soon
   .badge.today
========================================================== */


/* ==========================================================
   EXPIRING SOON - ORANGE
========================================================== */

.product-card:has(.badge.soon) {

    border: 2px solid #F59E0B;

    background: #FFFBEB;

    box-shadow:
        0 4px 12px rgba(245, 158, 11, 0.12);

}


/* ==========================================================
   EXPIRING TODAY - ORANGE / STRONGER WARNING
========================================================== */

.product-card:has(.badge.today) {

    border: 2px solid #F97316;

    background: #FFF7ED;

    box-shadow:
        0 4px 12px rgba(249, 115, 22, 0.15);

}


/* ==========================================================
   SOON BADGE
========================================================== */

.product-card .badge.soon {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: fit-content;

    margin-top: 12px;

    padding: 7px 14px;

    border-radius: 999px;

    background: #FEF3C7;

    color: #B45309;

    border: 1px solid #F59E0B;

    font-size: 0.82rem;

    font-weight: 700;

    line-height: 1;

    letter-spacing: 0.2px;

}


/* ==========================================================
   TODAY BADGE
========================================================== */

.product-card .badge.today {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    width: fit-content;

    margin-top: 12px;

    padding: 7px 14px;

    border-radius: 999px;

    background: #FFEDD5;

    color: #C2410C;

    border: 1px solid #F97316;

    font-size: 0.82rem;

    font-weight: 700;

    line-height: 1;

    letter-spacing: 0.2px;

}


/* ==========================================================
   STATUS DOT
========================================================== */

.product-card .badge.soon::before {

    content: "●";

    margin-right: 6px;

    font-size: 0.65rem;

}


.product-card .badge.today::before {

    content: "●";

    margin-right: 6px;

    font-size: 0.65rem;

}


/* ==========================================================
   DARK MODE - EXPIRING SOON
========================================================== */

body.dark-mode .product-card:has(.badge.soon) {

    background: #422006;

    border-color: #F59E0B;

    box-shadow:
        0 4px 12px rgba(245, 158, 11, 0.18);

}


body.dark-mode .product-card .badge.soon {

    background: #78350F;

    color: #FDE68A;

    border-color: #F59E0B;

}


/* ==========================================================
   DARK MODE - EXPIRING TODAY
========================================================== */

body.dark-mode .product-card:has(.badge.today) {

    background: #431407;

    border-color: #F97316;

    box-shadow:
        0 4px 12px rgba(249, 115, 22, 0.2);

}


body.dark-mode .product-card .badge.today {

    background: #7C2D12;

    color: #FED7AA;

    border-color: #F97316;

}


/* ==========================================================
   ALTERNATIVE DARK MODE
   For themes using data-theme="dark"
========================================================== */

[data-theme="dark"] .product-card:has(.badge.soon) {

    background: #422006;

    border-color: #F59E0B;

}


[data-theme="dark"] .product-card .badge.soon {

    background: #78350F;

    color: #FDE68A;

    border-color: #F59E0B;

}


[data-theme="dark"] .product-card:has(.badge.today) {

    background: #431407;

    border-color: #F97316;

}


[data-theme="dark"] .product-card .badge.today {

    background: #7C2D12;

    color: #FED7AA;

    border-color: #F97316;

}

/* ==========================================================
   SHOPPING MODALS
========================================================== */

.shopping-modal {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.shopping-modal.active {
    display: flex;
}

.shopping-edit-card {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    background: white;
    border-radius: 18px;
    box-sizing: border-box;
    padding: 24px;
    position: relative;
}

.shopping-edit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.shopping-edit-header h2 {
    margin: 0 0 5px 0;
}

.shopping-edit-header p {
    margin: 0;
}

.shopping-modal-close {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.shopping-edit-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shopping-edit-item-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.shopping-edit-total-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 12px;
    background: #f3f4f6;
    margin-top: 10px;
}

.shopping-edit-total-box strong {
    font-size: 22px;
}

.shopping-trip-details-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: end;
    margin-top: 20px;
}

.shopping-trip-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shopping-current-trip-display {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 12px;
    background: #f3f4f6;
    font-size: 15px;
}

.shopping-trip-total-store {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

@media (max-width: 700px) {

    .shopping-trip-details-form {
        grid-template-columns: 1fr;
    }

    .shopping-edit-card {
        max-width: 100%;
        padding: 18px;
    }

}
/* ==========================================================
   SHOPPING DASHBOARD
========================================================== */

.shopping-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 20px 0;
}

.shopping-dashboard-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    border-radius: 18px;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.07);
}

.shopping-dashboard-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 24px;
    background: #f3f4f6;
}

.shopping-dashboard-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shopping-dashboard-info span {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.shopping-dashboard-info strong {
    font-size: 22px;
    font-weight: 800;
    color: #111827;
}

.shopping-dashboard-items .shopping-dashboard-icon {
    background: #e0f2fe;
}

.shopping-dashboard-estimated .shopping-dashboard-icon {
    background: #dcfce7;
}

.shopping-dashboard-bought .shopping-dashboard-icon {
    background: #dbeafe;
}

.shopping-dashboard-purchased .shopping-dashboard-icon {
    background: #ede9fe;
}

.shopping-dashboard-budget .shopping-dashboard-icon {
    background: #fef3c7;
}

.shopping-dashboard-remaining .shopping-dashboard-icon {
    background: #d1fae5;
}


/* ==========================================================
   TRIP DETAILS
========================================================== */

.shopping-trip-details-card {
    margin-bottom: 20px;
}

.shopping-trip-details-status {
    margin-top: 14px;
    padding: 12px 15px;
    border-radius: 12px;
    background: #f0fdf4;
    color: #166534;
    font-size: 14px;
}

.shopping-current-trip-display {
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f8fafc;
    color: #475569;
}

.shopping-current-trip-display strong {
    color: #111827;
}


/* ==========================================================
   EDIT MODAL
========================================================== */

.shopping-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
}

.shopping-modal.active {
    display: flex;
}

.shopping-edit-card {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.shopping-edit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 22px;
    border-bottom: 1px solid #e5e7eb;
}

.shopping-edit-header h2 {
    margin: 0;
}

.shopping-edit-header p {
    margin: 6px 0 0;
    color: #6b7280;
}

.shopping-modal-close {
    border: none;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
}

.shopping-edit-body {
    padding: 22px;
}

.shopping-edit-item-name {
    margin-bottom: 18px;
    padding: 12px;
    border-radius: 10px;
    background: #f8fafc;
    font-weight: 700;
}

.shopping-edit-total-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 18px 0;
    padding: 16px;
    border-radius: 12px;
    background: #f0fdf4;
}

.shopping-edit-total-box strong {
    font-size: 22px;
}


/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 700px) {

    .shopping-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 480px) {

    .shopping-dashboard {
        grid-template-columns: 1fr;
    }

}

/* ==========================================================
   AUTHENTICATION
========================================================== */

body.auth-locked {
    min-height: 100vh;
}

body.auth-locked .app-header,
body.auth-locked #app,
body.auth-locked .bottom-nav,
body.auth-locked #floatingAddButton {
    display: none !important;
}

.auth-page {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-y: auto;
    background: var(--background);
}

/* Build 053: neutral session-restoration screen; never flash the login form. */
body.auth-checking .auth-card {
    display: none !important;
}

body.auth-checking .auth-page::after {
    content: "Checking your session…";
    display: block;
    padding: 22px 28px;
    color: var(--text);
    font-size: 1rem;
    text-align: center;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    box-sizing: border-box;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 24px 70px var(--shadow-strong);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.auth-brand-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--primary-soft);
    font-size: 25px;
}

.auth-brand strong,
.auth-brand span {
    display: block;
}

.auth-brand strong {
    color: var(--text-primary);
    font-size: 20px;
}

.auth-brand span {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 13px;
}

.auth-heading h2 {
    margin: 0 0 8px;
    color: var(--text-primary);
}

.auth-heading p {
    margin: 0 0 22px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-primary);
    font-weight: 700;
}

.auth-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 13px;
    border: 1px solid var(--input-border);
    border-radius: 10px;
    background: var(--input-background);
    color: var(--text-primary);
    font: inherit;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.auth-submit {
    width: 100%;
    margin-top: 4px;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.auth-link {
    border: 0;
    padding: 3px 6px;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-message {
    min-height: 22px;
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

.auth-message.error {
    color: var(--danger);
}

.auth-message.success {
    color: var(--success);
}

.auth-message.info {
    color: var(--text-secondary);
}

.auth-security-note {
    margin: 20px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.auth-account-card p {
    word-break: break-word;
}

@media (max-width: 480px) {

    .auth-page {
        padding: 14px;
    }

    .auth-card {
        padding: 22px;
        border-radius: 18px;
    }

}
/* ==========================================================
   PANVIYO MODAL DARK MODE CONSISTENCY
   ----------------------------------------------------------
   Applies the same theme to all current and runtime modals.
========================================================== */

/* Shared theme aliases */
:root {
    --card-bg: var(--surface);
    --border-color: var(--border);
}

/* ----------------------------------------------------------
   MODAL OVERLAYS
---------------------------------------------------------- */

.shopping-modal,
.shopping-edit-modal,
.shopping-trip-calculator-modal {
    background: var(--modal-overlay) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}


/* ----------------------------------------------------------
   MODAL CONTENT
---------------------------------------------------------- */

.shopping-modal-content,
.shopping-add-modal-content,
.shopping-edit-card,
.shopping-edit-modal-content,
.shopping-trip-calculator-content {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 20px 60px var(--shadow-strong) !important;
}


/* ----------------------------------------------------------
   MODAL HEADINGS
---------------------------------------------------------- */

.shopping-modal h1,
.shopping-modal h2,
.shopping-modal h3,
.shopping-modal h4,

.shopping-modal-content h1,
.shopping-modal-content h2,
.shopping-modal-content h3,
.shopping-modal-content h4,

.shopping-edit-card h1,
.shopping-edit-card h2,
.shopping-edit-card h3,
.shopping-edit-card h4,

.shopping-edit-modal-content h1,
.shopping-edit-modal-content h2,
.shopping-edit-modal-content h3,
.shopping-edit-modal-content h4,

.shopping-trip-calculator-content h1,
.shopping-trip-calculator-content h2,
.shopping-trip-calculator-content h3,
.shopping-trip-calculator-content h4 {
    color: var(--text-primary) !important;
}


/* ----------------------------------------------------------
   MODAL SECONDARY TEXT
---------------------------------------------------------- */

.shopping-modal p,
.shopping-modal-content p,
.shopping-edit-card p,
.shopping-edit-modal-content p,
.shopping-trip-calculator-content p {
    color: var(--text-secondary) !important;
}


/* ----------------------------------------------------------
   MODAL LABELS
---------------------------------------------------------- */

.shopping-modal label,
.shopping-edit-card label,
.shopping-edit-modal-content label,
.shopping-trip-calculator-content label {
    color: var(--text-secondary) !important;
}


/* ----------------------------------------------------------
   MODAL INPUTS
---------------------------------------------------------- */

.shopping-modal input,
.shopping-modal select,
.shopping-modal textarea,

.shopping-modal-content input,
.shopping-modal-content select,
.shopping-modal-content textarea,

.shopping-edit-card input,
.shopping-edit-card select,
.shopping-edit-card textarea,

.shopping-edit-modal-content input,
.shopping-edit-modal-content select,
.shopping-edit-modal-content textarea,

.shopping-trip-calculator-content input,
.shopping-trip-calculator-content select,
.shopping-trip-calculator-content textarea {
    background: var(--input-background) !important;
    color: var(--text-primary) !important;
    border-color: var(--input-border) !important;
}


/* Placeholder text */

.shopping-modal input::placeholder,
.shopping-modal textarea::placeholder,
.shopping-modal-content input::placeholder,
.shopping-modal-content textarea::placeholder,
.shopping-edit-card input::placeholder,
.shopping-edit-card textarea::placeholder,
.shopping-edit-modal-content input::placeholder,
.shopping-edit-modal-content textarea::placeholder,
.shopping-trip-calculator-content input::placeholder,
.shopping-trip-calculator-content textarea::placeholder {
    color: var(--text-muted) !important;
}


/* ----------------------------------------------------------
   CLOSE BUTTONS
---------------------------------------------------------- */

.shopping-modal-close,
.shopping-edit-close {
    color: var(--text-primary) !important;
    background: transparent !important;
}

.shopping-modal-close:hover,
.shopping-edit-close:hover {
    background: var(--surface-alt) !important;
}


/* ----------------------------------------------------------
   MODAL TOTAL / SUMMARY BOXES
---------------------------------------------------------- */

.shopping-modal-total,
.shopping-edit-total,
.shopping-edit-total-box,
.shopping-current-trip-display,
.shopping-trip-details-status {
    background: var(--surface-alt) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}


/* ----------------------------------------------------------
   TRIP TOTAL ROWS
---------------------------------------------------------- */

.shopping-trip-total-store {
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}


/* ==========================================================
   RUNTIME-GENERATED SHOPPING MODALS
   ----------------------------------------------------------
   These are created by shopping.js with inline styles.
========================================================== */

#shoppingAddModal,
#shoppingBudgetModal,
#shoppingEditModalRuntime {
    background: var(--modal-overlay) !important;
}


/* Runtime modal card */

#shoppingAddModal > div,
#shoppingBudgetModal > div,
#shoppingEditModalRuntime > div {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
    box-shadow: 0 20px 60px var(--shadow-strong) !important;
}


/* Runtime modal text */

#shoppingAddModal p,
#shoppingBudgetModal p,
#shoppingEditModalRuntime p {
    color: var(--text-secondary) !important;
}


/* Runtime inputs */

#shoppingAddModal input,
#shoppingAddModal select,
#shoppingAddModal textarea,

#shoppingBudgetModal input,
#shoppingBudgetModal select,
#shoppingBudgetModal textarea,

#shoppingEditModalRuntime input,
#shoppingEditModalRuntime select,
#shoppingEditModalRuntime textarea {
    background: var(--input-background) !important;
    color: var(--text-primary) !important;
    border-color: var(--input-border) !important;
}


/* Runtime calculated totals */

#shoppingAddModal [id$="Total"],
#shoppingEditModalRuntime [id$="TotalRuntime"] {
    background: var(--surface-alt) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
}


/* Runtime close buttons */

#shoppingAddModal button[aria-label="Close"],
#shoppingBudgetModal button[aria-label="Close"],
#shoppingEditModalRuntime button[aria-label="Close"] {
    color: var(--text-primary) !important;
}


/* ==========================================================
   LEGACY SHOPPING MODAL ELEMENTS
========================================================== */

body.dark-mode .shopping-edit-card,
body.dark-mode .shopping-edit-modal-content {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}


body.dark-mode .shopping-edit-item-name,
body.dark-mode .shopping-edit-total-box,
body.dark-mode .shopping-current-trip-display {
    background: var(--surface-alt) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}


body.dark-mode .shopping-edit-header,
body.dark-mode .shopping-edit-modal-header {
    border-color: var(--border) !important;
}


body.dark-mode .shopping-edit-header p,
body.dark-mode .shopping-edit-modal-header p {
    color: var(--text-secondary) !important;
}


/* ==========================================================
   DARK MODE RUNTIME FALLBACK
   ----------------------------------------------------------
   Protects against inline #fff backgrounds.
========================================================== */

body.dark-mode #shoppingAddModal > div,
body.dark-mode #shoppingBudgetModal > div,
body.dark-mode #shoppingEditModalRuntime > div {
    background: var(--surface) !important;
    color: var(--text-primary) !important;
}


body.dark-mode #shoppingAddModal input,
body.dark-mode #shoppingAddModal select,
body.dark-mode #shoppingAddModal textarea,
body.dark-mode #shoppingBudgetModal input,
body.dark-mode #shoppingBudgetModal select,
body.dark-mode #shoppingBudgetModal textarea,
body.dark-mode #shoppingEditModalRuntime input,
body.dark-mode #shoppingEditModalRuntime select,
body.dark-mode #shoppingEditModalRuntime textarea {
    background: var(--input-background) !important;
    color: var(--text-primary) !important;
    border-color: var(--input-border) !important;
}

/* ==========================================================
   AUTHENTICATION THEME CONSISTENCY
   ----------------------------------------------------------
   The authentication gate is displayed before user-scoped
   settings are loaded. These rules explicitly bind its
   typography and surfaces to the PANVIYO theme tokens.
========================================================== */

.auth-page,
.auth-card,
.auth-card input,
.auth-card button {
    font-family: var(--font-family);
}

.auth-page {
    background-color: var(--background);
    color: var(--text-primary);
    transition:
        background-color 0.25s ease,
        color 0.25s ease;
}

.auth-card {
    background-color: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
}

.auth-card input {
    background-color: var(--input-background);
    color: var(--text-primary);
    border-color: var(--input-border);
    color-scheme: light;
}

body.dark-mode .auth-card input {
    color-scheme: dark;
}

.auth-card input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

body.dark-mode .auth-card input::placeholder {
    color: var(--text-muted);
}

body.dark-mode .auth-card,
body.dark-mode .auth-page {
    color: var(--text-primary);
}

body.dark-mode .auth-brand strong,
body.dark-mode .auth-heading h2,
body.dark-mode .auth-field label {
    color: var(--text-primary);
}

body.dark-mode .auth-brand span,
body.dark-mode .auth-heading p,
body.dark-mode .auth-message.info {
    color: var(--text-secondary);
}

body.dark-mode .auth-security-note {
    color: var(--text-muted);
    border-color: var(--border);
}

body.dark-mode .auth-link {
    color: var(--primary-light);
}

body.dark-mode .auth-message.success {
    color: var(--primary-light);
}

body.dark-mode .auth-message.error {
    color: #FF8A80;
}

/* ==========================================================
   BUILD 047 — CONSISTENT PAGE GUTTERS + PRODUCT FORM MODAL
========================================================== */

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

/* Give every application page a safe gutter instead of letting
   page cards and borders touch the viewport edge. */
#app {
    width: 100%;
    min-width: 0;
    padding-inline: clamp(12px, 2.4vw, 30px);
    box-sizing: border-box;
}

#app > .page {
    width: 100%;
    min-width: 0;
    max-width: 1500px;
    margin-inline: auto;
}

#app .page,
#app .page * {
    min-width: 0;
}

#app input,
#app select,
#app textarea,
#app table,
#app .card,
#app .form-card,
#app .search-card,
#app .section-card {
    max-width: 100%;
}

#app input,
#app select,
#app textarea {
    box-sizing: border-box;
}

@media (max-width: 650px) {
    #app {
        padding-inline: 12px;
        padding-bottom: 112px;
    }
}

@media (max-width: 380px) {
    #app {
        padding-inline: 9px;
    }
}

/* Add Product dialog */
.product-add-trigger {
    margin-top: 12px;
}

.product-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 3vw, 28px);
    background: var(--modal-overlay, rgba(0, 0, 0, .62));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.product-modal.active {
    display: flex;
}

.product-modal-content {
    width: min(100%, 720px);
    max-height: min(92dvh, 900px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--surface, #fff);
    color: var(--text-primary, #1f2933);
    border: 1px solid var(--border, #dce4dd);
    border-radius: var(--radius-large, 16px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .32);
    padding: clamp(14px, 2.5vw, 24px);
    animation: productModalIn .18s ease-out;
}

@keyframes productModalIn {
    from { opacity: 0; transform: translateY(8px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.product-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.product-modal-header h3 {
    margin: 0;
    font-size: clamp(19px, 3vw, 24px);
    line-height: 1.3;
}

.product-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border, #dce4dd);
    border-radius: 10px;
    color: var(--text-primary, #1f2933);
    background: var(--surface-alt, #f8faf8);
    font-size: 18px;
}

.product-modal-form {
    display: grid;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
}

.product-modal-form > input,
.product-modal-form > select,
.product-modal-form > textarea,
.product-modal-form .two-columns > input,
.product-modal-form .two-columns > select {
    width: 100%;
    min-height: 44px;
}

.product-modal-form label {
    display: block;
    margin: 3px 0 -7px;
    font-weight: 600;
}

.product-modal-form .image-preview {
    max-width: 100%;
    max-height: 220px;
    object-fit: contain;
}

.product-modal-form .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

body.product-modal-open {
    overflow: hidden;
}

@media (max-width: 520px) {
    .product-modal {
        align-items: flex-end;
        padding: 8px;
    }

    .product-modal-content {
        width: 100%;
        max-height: 94dvh;
        border-radius: 16px 16px 10px 10px;
        padding: 15px;
    }

    .product-modal-form .button-group {
        display: grid;
        grid-template-columns: 1fr;
    }

    .product-modal-form .button-group button {
        width: 100%;
        min-height: 44px;
    }
}


/* ==========================================================
   BUILD 048 — HEADER BRAND GUTTERS
   Keep the PANVIYO title and tagline inside the same safe
   responsive page margins as the rest of the application.
========================================================== */
.app-header {
    width: 100%;
    max-width: 1500px;
    margin-inline: auto;
    padding-inline: clamp(12px, 2.4vw, 30px);
    box-sizing: border-box;
}

.app-header .logo-area {
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 650px) {
    .app-header {
        padding-inline: 12px;
    }
}

@media (max-width: 380px) {
    .app-header {
        padding-inline: 9px;
    }
}

/* ==========================================================
   BUILD 054 — KEEP PAGE CONTENT CLEAR OF FIXED NAVIGATION
   The bottom navigation is fixed to the viewport. Reserve
   space for it on every screen size so the last card/buttons
   never sit underneath the menu bar.
========================================================== */
#app {
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
}

#app > .page {
    padding-bottom: 12px;
}

@media (max-width: 650px) {
    #app {
        padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
        scroll-padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    }
}


/* ==========================================================
   SETTINGS DATA MANAGEMENT ACTIONS
   Keep the export/import/delete controls aligned on mobile.
========================================================== */
.settings-data-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.settings-data-actions > button {
    margin: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .settings-data-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .settings-data-actions > button {
        width: 100%;
        min-height: 54px;
        padding: 12px 10px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .settings-data-actions > button:last-of-type {
        grid-column: 1 / -1;
    }
}

@media (max-width: 360px) {
    .settings-data-actions {
        grid-template-columns: minmax(0, 1fr);
    }

    .settings-data-actions > button:last-of-type {
        grid-column: auto;
    }
}


/* ==========================================================
   PANVIYO 2.0 — PREMIUM VISUAL FOUNDATION
   Keeps existing component classes and functionality intact.
========================================================== */
:root {
    --primary: #174C36;
    --primary-dark: #103B2A;
    --primary-light: #4E8A68;
    --primary-soft: #EAF2E9;
    --success: #2F8055;
    --success-light: #EAF4EC;
    --background: #F7F8F2;
    --surface: #FFFFFF;
    --surface-alt: #F1F4EC;
    --text-primary: #1D2B24;
    --text-secondary: #65736A;
    --text-muted: #89958D;
    --border: #E3E9E0;
    --border-strong: #CCD7CC;
    --shadow: rgba(24, 57, 39, .055);
    --shadow-strong: rgba(24, 57, 39, .12);
    --input-focus: #174C36;
    --nav-border: #E3E9E0;
    --budget-progress: #174C36;
    --radius-small: 10px;
    --radius-medium: 14px;
    --radius-large: 18px;
    --radius-xl: 24px;
}
body {
    background: var(--background);
    color: var(--text-primary);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: -.01em;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 3px solid rgba(168, 217, 78, .75);
    outline-offset: 2px;
}
.dashboard-card, .settings-card, .shopping-trip-card, .shopping-add-card,
.shopping-summary-card, .shopping-budget-card, .shopping-search-card,
.product-card, .report-card, .notification-card {
    border-radius: var(--radius-large);
    box-shadow: 0 8px 26px var(--shadow);
}
.dashboard-card:hover, .product-card:hover {
    box-shadow: 0 12px 30px var(--shadow-strong);
}

/* PWA install prompt — shared Android/iOS presentation */
.pwa-install-prompt {
    position: fixed;
    z-index: 10050;
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    max-width: 560px;
    margin-left: auto;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 30px;
    gap: 14px;
    align-items: start;
    padding: 20px;
    color: #1D2B24;
    background: #FFFFFF;
    border: 1px solid #E0E9DE;
    border-radius: 22px;
    box-shadow: 0 22px 70px rgba(13, 39, 25, .22);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .24s ease, transform .24s ease;
}
.pwa-install-prompt[hidden] { display: none !important; }
.pwa-install-prompt.is-visible { opacity: 1; transform: translateY(0); }
.pwa-install-brand-mark {
    width: 52px; height: 52px; display: grid; place-items: center;
    border-radius: 16px; background: #EAF2E9; font-size: 27px;
}
.pwa-install-copy { min-width: 0; }
.pwa-install-eyebrow { color: #548064; font-size: 10px; font-weight: 800; letter-spacing: .13em; margin: 1px 0 5px; }
.pwa-install-copy h2 { color: #174C36; font-size: 18px; line-height: 1.25; margin: 0 0 5px; }
.pwa-install-copy > p:not(.pwa-install-eyebrow) { color: #66736A; font-size: 13px; line-height: 1.5; margin: 0; }
.pwa-install-steps { color: #3B4A40; font-size: 13px; line-height: 1.55; margin-top: 12px; }
.pwa-install-steps ol { padding-left: 19px; margin: 0; }
.pwa-install-steps li + li { margin-top: 6px; }
.pwa-install-steps strong { color: #174C36; }
.pwa-install-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 14px; }
.pwa-install-actions button { min-height: 40px; border: 0; border-radius: 12px; padding: 0 16px; font-size: 13px; font-weight: 750; cursor: pointer; }
.pwa-install-primary { background: #174C36; color: #FFFFFF; }
.pwa-install-primary:hover { background: #103B2A; transform: translateY(-1px); }
.pwa-install-secondary { background: #F1F4EC; color: #435247; }
.pwa-install-close { width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #758078; font-size: 24px; line-height: 1; cursor: pointer; }
.pwa-install-close:hover { background: #F1F4EC; color: #174C36; }
@media (min-width: 700px) {
    .pwa-install-prompt { right: 24px; left: auto; bottom: 24px; }
}
@media (max-width: 420px) {
    .pwa-install-prompt { grid-template-columns: 42px minmax(0, 1fr) 24px; gap: 10px; padding: 15px; border-radius: 18px; }
    .pwa-install-brand-mark { width: 42px; height: 42px; border-radius: 13px; font-size: 23px; }
    .pwa-install-copy h2 { font-size: 16px; }
    .pwa-install-actions button { min-height: 38px; padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .pwa-install-prompt, button { transition: none !important; }
}


/* Premium page hierarchy and responsive navigation polish */
#app > .page > h2,
#app .page-header h2 {
    font-weight: 780;
    letter-spacing: -.035em;
}
#homePage > h2 {
    font-size: clamp(26px, 4vw, 34px);
    margin: 6px 0 22px;
}
.page-header { padding-top: 8px; }
.page-header p { line-height: 1.55; }
.dashboard-grid { gap: 18px; }
.dashboard-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 5px 20px var(--shadow);
}
.dashboard-card h3 {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 650;
    letter-spacing: .005em;
}
.dashboard-card h1,
.dashboard-card h2 {
    font-size: clamp(27px, 3vw, 35px);
    font-weight: 780;
    letter-spacing: -.04em;
}
.card-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    border-radius: 14px;
    background: var(--primary-soft);
    font-size: 21px;
}
.dashboard-card.warning { border-left: 0; border-top: 3px solid var(--warning); }
.dashboard-card.danger { border-left: 0; border-top: 3px solid var(--danger); }
.dashboard-card.success { border-left: 0; border-top: 3px solid var(--success); }
.info-card {
    margin: 0;
    border-radius: 18px;
    padding: 18px;
}
.info-card h3 { color: var(--text-secondary); font-size: 13px; font-weight: 650; }
.info-card h2 { font-size: 25px; letter-spacing: -.03em; }
.categories-section, .alerts-section, .recent-section {
    margin-top: 24px;
    padding: clamp(16px, 2.5vw, 22px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 5px 20px var(--shadow);
}
.categories-section > h2, .alerts-section > h2, .recent-section h2 {
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 740;
    letter-spacing: -.02em;
}
.primary-button, .pwa-install-primary {
    background: var(--primary);
}
.primary-button:hover { background: var(--primary-dark); box-shadow: 0 7px 18px rgba(23, 76, 54, .18); }
.bottom-nav {
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--nav-background) 94%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--nav-border);
    box-shadow: 0 -8px 28px rgba(18, 47, 31, .07);
}
.bottom-nav button { min-height: 58px; border-radius: 14px; font-weight: 650; }
.bottom-nav button.active { color: var(--primary); background: var(--primary-soft); }
.nav-text { font-size: 11px; }
.app-header {
    padding-top: max(16px, env(safe-area-inset-top, 0px));
    padding-bottom: 14px;
}
.app-header .logo-area h1 {
    color: var(--primary);
    font-size: 25px;
    font-weight: 850;
    letter-spacing: -.055em;
}
.app-header .tagline { color: var(--text-secondary); font-size: 12px; }
.auth-card {
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 18px 55px rgba(25, 57, 38, .10);
}
.auth-brand strong { color: var(--primary); letter-spacing: -.04em; }
@media (min-width: 900px) {
    #app > .page { max-width: 1240px; }
    .bottom-nav {
        left: 50%; right: auto; bottom: 18px;
        width: min(720px, calc(100% - 48px));
        transform: translateX(-50%);
        border: 1px solid var(--nav-border);
        border-radius: 20px;
        padding: 8px 12px;
        box-shadow: 0 12px 40px rgba(18, 47, 31, .13);
    }
    #app { padding-bottom: 130px; }
}
@media (max-width: 760px) {
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
    .dashboard-card { padding: 15px; border-radius: 16px; }
    .dashboard-card h3 { font-size: 12px; }
    .card-icon { width: 36px; height: 36px; border-radius: 12px; margin-bottom: 10px; }
    .dashboard-details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 360px) {
    .dashboard-grid { gap: 8px; }
    .dashboard-card { padding: 12px; }
    .bottom-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); padding-inline: 3px; }
    .nav-text { font-size: 10px; }
}

/* ==========================================================
   PANVIYO 2.0 — DASHBOARD SIGNATURE LAYOUT
========================================================== */
.dashboard-page { padding-top: 8px; }
.dashboard-welcome {
    position: relative; isolation: isolate; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between;
    gap: 24px; min-height: 218px; padding: clamp(24px, 4vw, 42px);
    margin: 0 0 30px; border-radius: 26px;
    color: #fff; background: linear-gradient(112deg, #123F2D 0%, #1D6042 62%, #2F7950 100%);
    box-shadow: 0 16px 38px rgba(19, 67, 44, .16);
}
.dashboard-welcome-copy { position: relative; z-index: 2; max-width: 570px; }
.dashboard-eyebrow { display: block; color: #779B83; font-size: 10px; font-weight: 850; letter-spacing: .15em; margin-bottom: 8px; }
.dashboard-welcome .dashboard-eyebrow { color: #B9D8BF; }
.dashboard-welcome h2 { color: #fff; margin: 0 0 8px; font-size: clamp(27px, 4vw, 38px); line-height: 1.12; letter-spacing: -.045em; }
.dashboard-welcome p { max-width: 480px; margin: 0; color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.65; }
.dashboard-welcome-actions {
    position: relative;
    z-index: 3;
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 245px 0 0;
    max-width: 100%;
}
@media (min-width: 901px) and (max-width: 1120px) {
    .dashboard-welcome { gap: 16px; }
    .dashboard-welcome-copy { max-width: 470px; }
    .dashboard-welcome-actions { margin-right: 190px; gap: 8px; }
    .dashboard-welcome-actions button { padding: 0 12px; font-size: 12px; }
}
.dashboard-welcome-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 17px; border: 1px solid rgba(255,255,255,.24); border-radius: 13px; font-size: 13px; font-weight: 750; cursor: pointer; }
.dashboard-action-primary { color: #174C36; background: #F5F8EF; }
.dashboard-action-secondary { color: #fff; background: rgba(255,255,255,.09); }
.dashboard-welcome-actions button:hover { transform: translateY(-2px); }
.dashboard-hero-art { position: absolute; z-index: 1; right: 5%; top: 50%; width: 210px; height: 210px; transform: translateY(-50%); border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: rgba(255,255,255,.055); display: grid; place-items: center; }
.dashboard-hero-art:before, .dashboard-hero-art:after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.dashboard-hero-art:before { inset: 17px; }.dashboard-hero-art:after { inset: 35px; }
.hero-basket { font-size: 78px; filter: drop-shadow(0 12px 12px rgba(0,0,0,.18)); transform: rotate(-9deg); }
.hero-leaf { position: absolute; color: #C6E58B; font-size: 30px; }.hero-leaf-one { top: 24px; right: 34px; }.hero-leaf-two { bottom: 25px; left: 29px; font-size: 24px; }
.dashboard-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 0 0 15px; }
.dashboard-section-heading h2 { margin: 0; font-size: 21px; font-weight: 780; letter-spacing: -.035em; }
.dashboard-section-heading .dashboard-eyebrow { margin-bottom: 4px; }
.dashboard-live-label { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 11px; font-weight: 650; padding-bottom: 3px; }
.dashboard-live-label span { width: 7px; height: 7px; border-radius: 50%; background: #48A36A; box-shadow: 0 0 0 4px #E8F4EA; }
.dashboard-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-card { min-width: 0; padding: 19px 20px 17px; }
.dashboard-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dashboard-card .card-icon { margin: 0 0 14px; }
.metric-caption { color: var(--text-muted); font-size: 9px; font-weight: 850; letter-spacing: .11em; text-align: right; }
.dashboard-card h3 { margin: 0 0 3px; }
.dashboard-card h1 { margin: 0; line-height: 1.15; }
.metric-footnote { margin: 8px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.4; }
.dashboard-card.warning { background: linear-gradient(145deg, #FFFDF7, #FFFFFF); }
.dashboard-card.danger { background: linear-gradient(145deg, #FFF9F7, #FFFFFF); }
.dashboard-card.success { background: linear-gradient(145deg, #F8FCF7, #FFFFFF); }
.dashboard-details { gap: 13px; margin-top: 15px; }
.dashboard-details .info-card { display: flex; align-items: flex-start; gap: 12px; min-width: 0; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 4px 16px var(--shadow); }
.insight-icon { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-alt); font-size: 17px; }
.dashboard-details .info-card > div { min-width: 0; }
.dashboard-details .info-card h3 { margin: 1px 0 5px; }
.dashboard-details .info-card h2 { margin: 0; }
.dashboard-details .info-card p { margin: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.5; }
.dashboard-details .info-card p#todayExpiry, .dashboard-details .info-card p#longestExpiry { color: var(--text-primary); font-weight: 650; }
.dashboard-content-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 18px; margin-top: 20px; }
.dashboard-panel { min-width: 0; margin-top: 0; padding: 21px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-heading .dashboard-eyebrow { margin-bottom: 4px; }
.panel-heading h2 { margin: 0; font-size: 19px; font-weight: 780; letter-spacing: -.03em; }
.panel-heading-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 17px; }
.dashboard-panel > h2 { margin-bottom: 0; }
.dashboard-panel #categorySummary { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.dashboard-panel #categorySummary li { display: flex; align-items: center; gap: 9px; min-height: 39px; padding: 8px 10px; border-radius: 11px; background: var(--surface-alt); color: var(--text-primary); font-size: 12px; }
.dashboard-panel #categorySummary li span { margin-left: auto; display: grid; place-items: center; min-width: 25px; height: 25px; padding: 0 6px; border-radius: 8px; background: var(--surface); color: var(--primary); font-weight: 800; }
.dashboard-panel #expiryAlerts { display: grid; gap: 8px; }
.dashboard-panel .expiry-alert { border-radius: 12px; padding: 12px 14px; }
.dashboard-panel .empty-state { padding: 18px 10px; text-align: center; }
.dashboard-panel .empty-state .emoji { font-size: 27px; }
.dashboard-panel .empty-state h3 { margin: 7px 0 3px; font-size: 14px; }
.dashboard-panel .empty-state p { margin: 0; font-size: 12px; }
.dashboard-panel #recentProducts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0; padding: 0; list-style: none; }
.dashboard-panel #recentProducts .recent-product { min-width: 0; padding: 12px 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-alt); overflow-wrap: anywhere; }
.dashboard-panel #recentProducts .recent-product strong { font-size: 12px; }
.dashboard-panel #recentProducts .recent-product small { display: inline-block; margin-top: 4px; color: var(--text-secondary); font-size: 11px; }
@media (max-width: 900px) {
    .dashboard-welcome { align-items: flex-start; flex-direction: column; gap: 14px; }
    .dashboard-welcome-copy { max-width: calc(100% - 175px); }
    .dashboard-welcome-actions { margin: 0 175px 0 0; }
    .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-content-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-hero-art { right: 3%; width: 165px; height: 165px; }
}
@media (max-width: 650px) {
    .dashboard-welcome { min-height: 0; padding: 25px 21px; margin-bottom: 24px; border-radius: 21px; }
    .dashboard-welcome-copy { max-width: 100%; }
    .dashboard-welcome h2 { max-width: 260px; font-size: 29px; }
    .dashboard-welcome p { max-width: 300px; font-size: 12px; }
    .dashboard-welcome-actions { margin: 17px 0 0; }
    .dashboard-welcome-actions button { min-height: 41px; padding: 0 12px; font-size: 11px; }
    .dashboard-hero-art { right: -61px; top: 20px; width: 145px; height: 145px; transform: none; opacity: .55; }
    .hero-basket { font-size: 55px; }
    .hero-leaf-one { top: 17px; right: 24px; }.hero-leaf-two { bottom: 19px; left: 20px; }
    .dashboard-section-heading h2 { font-size: 19px; }
    .dashboard-grid { gap: 10px; }
    .dashboard-card { padding: 14px; }
    .dashboard-card .card-icon { width: 33px; height: 33px; margin-bottom: 10px; font-size: 17px; }
    .metric-caption { font-size: 7px; }
    .dashboard-card h3 { font-size: 11px; }
    .dashboard-card h1 { font-size: 27px; }
    .metric-footnote { font-size: 9px; }
    .dashboard-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-details .info-card { padding: 12px; gap: 8px; }
    .insight-icon { flex-basis: 29px; width: 29px; height: 29px; border-radius: 9px; font-size: 14px; }
    .dashboard-details .info-card h3 { font-size: 10px; }
    .dashboard-details .info-card h2 { font-size: 21px; }
    .dashboard-details .info-card p { font-size: 10px; }
    .dashboard-content-grid { grid-template-columns: 1fr; gap: 13px; margin-top: 14px; }
    .dashboard-panel { padding: 16px; }
    .dashboard-panel #recentProducts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
    .dashboard-welcome { padding: 20px 16px; }
    .dashboard-welcome h2 { font-size: 25px; }
    .dashboard-welcome-actions { flex-direction: column; align-items: stretch; max-width: 180px; }
    .dashboard-details { gap: 8px; }
    .dashboard-details .info-card { padding: 10px; }
    .dashboard-panel #recentProducts { grid-template-columns: 1fr; }
}

/* ==========================================================
   PANVIYO 2.0 — PREMIUM PRODUCTS INVENTORY
========================================================== */
#productsPage { padding-top: 8px; }
.products-hero {
    position: relative; isolation: isolate; overflow: hidden; display: flex;
    align-items: center; justify-content: space-between; gap: 24px;
    min-height: 220px; margin: 0 0 20px; padding: clamp(24px, 4vw, 40px);
    border-radius: 25px; color: #fff;
    background: linear-gradient(112deg, #123F2D 0%, #1D6042 62%, #347C50 100%);
    box-shadow: 0 16px 38px rgba(19,67,44,.14);
}
.products-hero-copy { position: relative; z-index: 2; max-width: 560px; }
.products-hero .dashboard-eyebrow { color: #B9D8BF; }
.products-hero h2 { margin: 0 0 9px; color: #fff; font-size: clamp(28px,4vw,39px); line-height: 1.08; letter-spacing: -.045em; }
.products-hero h2 em { color: #D1E9A7; font-style: normal; }
.products-hero p { max-width: 470px; margin: 0; color: rgba(255,255,255,.78); font-size: 13px; line-height: 1.65; }
.products-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 21px; }
.products-hero-actions button { min-height: 43px; padding: 0 16px; border-radius: 12px; font-size: 12px; font-weight: 750; cursor: pointer; transition: transform .2s ease, background .2s ease; }
.products-hero-actions button:hover { transform: translateY(-2px); }
.products-primary-action { border: 1px solid #F5F8EF; background: #F5F8EF; color: #174C36; }
.products-primary-action span { margin-right: 5px; font-size: 17px; }
.products-secondary-action { border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.09); color: #fff; }
.products-hero-art { position: absolute; right: 8%; top: 50%; width: 180px; height: 180px; transform: translateY(-50%); display: grid; place-items: center; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; background: rgba(255,255,255,.055); font-size: 76px; }
.products-hero-art:before { content: ""; position: absolute; inset: 15px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; }
.products-hero-art i,.products-hero-art b { position: absolute; color: #D1E9A7; font-size: 22px; font-style: normal; }
.products-hero-art i { top: 20px; right: 25px; }.products-hero-art b { bottom: 17px; left: 22px; font-size: 27px; }
.products-overview { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.products-overview-card { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 4px 16px var(--shadow); }
.products-overview-card .overview-icon { flex: 0 0 39px; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: #EEF4EA; font-size: 18px; }
.products-overview-card .fresh-icon { background: #EAF4E9; }.products-overview-card .soon-icon { background: #FFF4DD; }.products-overview-card .expired-icon { background: #FCEAE7; }
.products-overview-card div { display: grid; min-width: 0; }
.products-overview-card small { color: var(--text-muted); font-size: 8px; font-weight: 850; letter-spacing: .1em; }
.products-overview-card strong { margin: 1px 0; color: var(--text-primary); font-size: 25px; line-height: 1.1; letter-spacing: -.04em; }
.products-overview-card div span { color: var(--text-secondary); font-size: 10px; }
.products-toolbar { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; padding: 12px; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); box-shadow: 0 4px 16px var(--shadow); }
.products-search-wrap { display: flex; align-items: center; flex: 1 1 320px; min-width: 140px; gap: 9px; padding: 0 12px; }
.products-search-wrap > span { color: var(--primary); font-size: 25px; line-height: 1; }
.products-search-wrap input { width: 100%; min-width: 0; height: 40px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 13px; box-shadow: none; }
.products-search-wrap kbd { flex: 0 0 auto; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); font-size: 9px; }
.products-toolbar .filter-bar { display: flex; gap: 8px; margin: 0; }
.products-toolbar .filter-bar select { min-width: 145px; height: 40px; margin: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-alt); color: var(--text-primary); font-size: 11px; }
.products-inventory-section { margin-top: 0; padding: 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: 0 6px 24px var(--shadow); }
.products-list-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.products-list-heading .dashboard-eyebrow { margin-bottom: 4px; }
.products-list-heading h3 { margin: 0 0 4px; color: var(--text-primary); font-size: 21px; font-weight: 800; letter-spacing: -.035em; }
.products-list-heading p { margin: 0; color: var(--text-secondary); font-size: 11px; }
.products-view-label { padding: 7px 10px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-size: 10px; font-weight: 750; white-space: nowrap; }
#productList { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; margin: 0; padding: 0; list-style: none; }
#productList > .empty-state { grid-column: 1/-1; }
#productList .premium-product-card { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 14px; min-width: 0; margin: 0; padding: 13px; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 3px 12px rgba(27,45,30,.035); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
#productList .premium-product-card:hover { transform: translateY(-2px); border-color: #B7CEB8; box-shadow: 0 10px 24px var(--shadow); }
.premium-product-visual { position: relative; min-height: 142px; overflow: hidden; border-radius: 12px; background: linear-gradient(145deg,#F1F5EA,#E7EEE1); }
.premium-product-visual .product-image,.premium-product-visual .product-image-placeholder { display: grid; width: 100%; height: 100%; min-height: 142px; margin: 0; object-fit: cover; place-items: center; font-size: 43px; }
.premium-product-visual .badge { position: absolute; left: 7px; bottom: 7px; max-width: calc(100% - 14px); padding: 5px 7px; border-radius: 7px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.premium-product-category { position: absolute; top: 7px; left: 7px; max-width: calc(100% - 14px); overflow: hidden; padding: 5px 7px; border: 1px solid rgba(255,255,255,.7); border-radius: 7px; background: rgba(255,255,255,.88); color: #31563B; font-size: 8px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(8px); }
.premium-product-content { display: flex; flex-direction: column; min-width: 0; }
.premium-product-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.product-overline { color: var(--text-muted); font-size: 7px; font-weight: 850; letter-spacing: .13em; }
.premium-product-heading h3 { overflow-wrap: anywhere; margin: 3px 0 0; color: var(--text-primary); font-size: 15px; font-weight: 800; line-height: 1.25; letter-spacing: -.025em; }
.premium-product-quantity { flex: 0 0 auto; display: grid; place-items: center; min-width: 37px; min-height: 37px; padding: 4px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-size: 15px; font-weight: 850; }
.premium-product-quantity small { font-size: 7px; font-weight: 750; }
.premium-product-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 13px 0 0; }
.premium-product-meta > div { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.premium-product-meta > div > span { color: var(--primary); font-size: 13px; }
.premium-product-meta > div > div { display: grid; min-width: 0; }
.premium-product-meta small { color: var(--text-muted); font-size: 7px; font-weight: 850; letter-spacing: .08em; }
.premium-product-meta strong { overflow: hidden; color: var(--text-primary); font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.premium-product-barcode { overflow: hidden; margin-top: 8px; color: var(--text-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
#productList .premium-product-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 11px; }
#productList .premium-product-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 29px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-alt); color: var(--text-secondary); font-size: 10px; font-weight: 750; cursor: pointer; }
#productList .premium-product-actions button:first-child { border-color: #D5E6D5; background: var(--primary-soft); color: var(--primary); }
#productList .premium-product-actions button:last-child { margin-left: auto; color: #B64B40; }
#productList .premium-product-actions button:hover { border-color: var(--primary); }
body.dark-mode .products-overview-card .overview-icon { background: #26372B; }
body.dark-mode .products-overview-card .soon-icon { background: #40351E; }
body.dark-mode .products-overview-card .expired-icon { background: #402522; }
body.dark-mode .products-hero-art { background: rgba(255,255,255,.04); }
body.dark-mode .premium-product-visual { background: linear-gradient(145deg,#25372A,#1D2B21); }
body.dark-mode .premium-product-category { border-color: rgba(255,255,255,.1); background: rgba(25,39,29,.9); color: #CFE5CB; }
body.dark-mode #productList .premium-product-actions button { background: var(--surface-alt); }
@media (max-width: 900px) {
    .products-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .products-hero-art { right: 4%; width: 150px; height: 150px; }
    #productList { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
    #productsPage { padding-top: 4px; }
    .products-hero { min-height: 0; padding: 25px 20px; border-radius: 20px; }
    .products-hero h2 { max-width: 255px; font-size: 29px; }
    .products-hero p { max-width: 280px; font-size: 11px; }
    .products-hero-art { top: 17px; right: -55px; width: 135px; height: 135px; transform: none; opacity: .48; }
    .products-hero-art > span { font-size: 55px; }
    .products-hero-actions { margin-top: 16px; }
    .products-hero-actions button { min-height: 39px; padding: 0 11px; font-size: 10px; }
    .products-overview { gap: 8px; margin-bottom: 15px; }
    .products-overview-card { gap: 8px; padding: 11px; border-radius: 13px; }
    .products-overview-card .overview-icon { flex-basis: 31px; width: 31px; height: 31px; border-radius: 9px; font-size: 14px; }
    .products-overview-card small { font-size: 7px; }
    .products-overview-card strong { font-size: 21px; }
    .products-overview-card div span { font-size: 8px; }
    .products-toolbar { align-items: stretch; flex-direction: column; gap: 7px; padding: 9px; border-radius: 14px; }
    .products-search-wrap { flex-basis: auto; }
    .products-search-wrap input { height: 36px; font-size: 12px; }
    .products-toolbar .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
    .products-toolbar .filter-bar select { min-width: 0; width: 100%; height: 37px; font-size: 9px; }
    .products-inventory-section { padding: 14px; border-radius: 16px; }
    .products-list-heading h3 { font-size: 18px; }
    .products-list-heading p { font-size: 9px; }
    .products-view-label { font-size: 8px; }
    #productList .premium-product-card { grid-template-columns: 88px minmax(0,1fr); gap: 10px; padding: 9px; border-radius: 13px; }
    .premium-product-visual,.premium-product-visual .product-image,.premium-product-visual .product-image-placeholder { min-height: 125px; }
    .premium-product-heading h3 { font-size: 13px; }
    .premium-product-meta { gap: 5px; margin-top: 10px; }
    .premium-product-meta strong { font-size: 8px; }
    #productList .premium-product-actions { gap: 4px; padding-top: 9px; }
    #productList .premium-product-actions button { min-height: 27px; padding: 0 6px; font-size: 9px; }
}
@media (max-width: 360px) {
    .products-hero { padding: 21px 16px; }
    .products-hero h2 { font-size: 25px; }
    .products-overview-card { padding: 9px; }
    #productList .premium-product-card { grid-template-columns: 76px minmax(0,1fr); }
    .premium-product-meta { grid-template-columns: 1fr; }
    #productList .premium-product-actions button span { display: none; }
}

/* ==========================================================
   PANVIYO FIX — UNIFIED PRODUCT EXPIRY BADGE DIMENSIONS
   Keep Fresh, Expiring Soon, Expires Today and Expired badges
   exactly the same size inside the premium product image tile.
   This intentionally overrides legacy .badge.soon rules.
========================================================== */
.product-card.premium-product-card .premium-product-visual > .badge,
.product-card.premium-product-card .premium-product-visual > .badge.fresh,
.product-card.premium-product-card .premium-product-visual > .badge.soon,
.product-card.premium-product-card .premium-product-visual > .badge.today,
.product-card.premium-product-card .premium-product-visual > .badge.expired,
.product-card.premium-product-card .premium-product-visual > .badge.danger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: calc(100% - 14px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 5px 7px !important;
    border-radius: 7px !important;
    font-size: 8px !important;
    font-weight: 800 !important;
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
}

.product-card.premium-product-card .premium-product-visual > .badge::before {
    flex: 0 0 auto;
    margin-right: 4px !important;
    font-size: 6px !important;
    line-height: 1 !important;
}


/* ==========================================================
   PANVIYO PREMIUM BARCODE SCANNER
========================================================== */
.scanner-page-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.scanner-eyebrow,.scanner-section-label { display:block; color:var(--primary); font-size:11px; font-weight:800; letter-spacing:.13em; margin-bottom:7px; }
.scanner-page-heading h2 { margin:0 0 7px; }
.scanner-page-heading p { margin:0; color:var(--text-secondary); max-width:620px; }
.scanner-heading-icon { display:grid; place-items:center; flex:0 0 54px; height:54px; border-radius:17px; color:var(--primary-dark); background:var(--primary-soft); font-size:27px; }
.scanner-workspace { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(250px,.85fr); gap:18px; align-items:start; }
.scanner-main-card { min-width:0; padding:clamp(16px,3vw,24px); }
.scanner-card-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:17px; }
.scanner-card-heading h3,.scanner-help-card h3,.scanner-manual-card h3 { margin:0; color:var(--text-primary); font-size:19px; }
.scanner-status-pill { display:inline-flex; align-items:center; gap:7px; border:1px solid var(--border); border-radius:999px; padding:7px 11px; color:var(--text-secondary); background:var(--surface-alt); font-size:12px; font-weight:750; white-space:nowrap; }
.scanner-status-dot,.scanner-live-indicator { width:8px; height:8px; border-radius:50%; background:#8b9890; display:inline-block; }
.scanner-status-pill.is-scanning { color:var(--primary-dark); background:var(--primary-soft); border-color:var(--primary-light); }
.scanner-status-pill.is-scanning .scanner-status-dot,.scanner-live-indicator { background:#35a76b; box-shadow:0 0 0 4px rgba(53,167,107,.13); }
.scanner-status-pill.is-error { color:var(--danger); background:var(--danger-light); border-color:#efb8b8; }
.scanner-status-pill.is-error .scanner-status-dot { background:var(--danger); }
.scanner-viewport-wrap { position:relative; overflow:hidden; border-radius:20px; background:#101713; min-height:300px; isolation:isolate; }
#scanner { position:relative; z-index:1; min-height:300px; width:100%; margin:0; border:0; border-radius:20px; overflow:hidden; background:#101713; }
#scanner video { display:block; width:100%!important; height:auto!important; max-height:520px; object-fit:cover; border-radius:20px; }
#scanner canvas { max-width:100%; }
#scanner__dashboard_section_csr button { border-radius:10px!important; }
#scanner__dashboard_section_swaplink { display:none!important; }
.scanner-empty-state { min-height:300px; padding:34px 24px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; color:#fff; }
.scanner-camera-icon { width:62px; height:62px; display:grid; place-items:center; border-radius:20px; background:rgba(255,255,255,.12); color:#c9f2d6; font-size:30px; margin-bottom:15px; }
.scanner-empty-state h3 { margin:0 0 8px; color:#fff; font-size:18px; }
.scanner-empty-state p { max-width:390px; margin:0; color:rgba(255,255,255,.72); font-size:13px; line-height:1.6; }
.scanner-guide-frame { pointer-events:none; z-index:2; position:absolute; width:min(68%,390px); height:110px; top:50%; left:50%; transform:translate(-50%,-50%); border:0; border-radius:13px; display:none; }
.scanner-guide-frame span { position:absolute; width:25px; height:25px; border-color:#b8f0c8; border-style:solid; }
.scanner-guide-frame span:nth-child(1){top:0;left:0;border-width:3px 0 0 3px;border-radius:8px 0 0}
.scanner-guide-frame span:nth-child(2){top:0;right:0;border-width:3px 3px 0 0;border-radius:0 8px 0 0}
.scanner-guide-frame span:nth-child(3){bottom:0;left:0;border-width:0 0 3px 3px;border-radius:0 0 0 8px}
.scanner-guide-frame span:nth-child(4){bottom:0;right:0;border-width:0 3px 3px 0;border-radius:0 0 8px}
.scanner-guide-frame i { position:absolute; top:50%; left:8px; right:8px; height:2px; background:rgba(184,240,200,.75); box-shadow:0 0 12px rgba(184,240,200,.6); }
.scanner-viewport-wrap.is-active .scanner-guide-frame { display:block; }
.scanner-viewport-caption { position:absolute; z-index:3; bottom:13px; left:50%; transform:translateX(-50%); display:none; align-items:center; gap:9px; white-space:nowrap; border-radius:999px; padding:8px 12px; color:#fff; background:rgba(8,18,12,.72); font-size:11px; font-weight:650; }
.scanner-viewport-wrap.is-active .scanner-viewport-caption { display:flex; }
.scanner-feedback { min-height:20px; margin:14px 0; color:var(--text-secondary); font-size:13px; line-height:1.5; }
.scanner-feedback.is-success { color:var(--success); font-weight:700; }
.scanner-feedback.is-error { color:var(--danger); font-weight:700; }
.scanner-actions { display:flex; gap:10px; }
.scanner-actions button { min-height:48px; flex:1; display:flex; justify-content:center; align-items:center; gap:9px; }
.scanner-actions button:disabled { opacity:.48; cursor:not-allowed; }
.scanner-trust-note { margin-top:15px; padding-top:13px; border-top:1px solid var(--border); color:var(--text-muted); font-size:11px; line-height:1.5; }
.scanner-side-column { display:grid; gap:16px; }
.scanner-help-card,.scanner-manual-card { padding:20px; border:1px solid var(--border); border-radius:var(--radius-large); background:var(--surface); box-shadow:0 5px 18px var(--shadow); }
.scanner-help-icon { width:38px; height:38px; display:grid; place-items:center; border-radius:12px; margin-bottom:13px; color:var(--primary-dark); background:var(--primary-soft); font-size:19px; }
.scanner-help-card ul { margin:14px 0 0; padding-left:19px; color:var(--text-secondary); font-size:13px; line-height:1.65; }
.scanner-help-card li+li { margin-top:7px; }
.scanner-manual-card p { margin:8px 0 15px; color:var(--text-secondary); font-size:13px; line-height:1.55; }
.scanner-manual-form { display:grid; gap:9px; }
.scanner-manual-form label { color:var(--text-secondary); font-size:12px; font-weight:700; }
.scanner-manual-form input { min-height:45px; }
.scanner-manual-form button { min-height:44px; display:flex; align-items:center; justify-content:center; gap:8px; }
@media(max-width:760px){ .scanner-workspace{grid-template-columns:1fr;gap:14px}.scanner-side-column{grid-template-columns:1fr 1fr}.scanner-viewport-wrap,#scanner{min-height:260px}.scanner-empty-state{min-height:260px} }
@media(max-width:520px){ .scanner-side-column{grid-template-columns:1fr}.scanner-main-card{padding:14px}.scanner-card-heading h3{font-size:17px}.scanner-viewport-wrap,#scanner{min-height:245px}.scanner-empty-state{min-height:245px;padding:24px 18px}.scanner-actions{flex-direction:column}.scanner-actions button{width:100%}.scanner-page-heading{align-items:flex-start}.scanner-heading-icon{flex-basis:46px;height:46px;border-radius:14px} }

/* ==========================================================
   PANVIYO 2.0 — SHOPPING EXPERIENCE
   Presentation-only layer; existing shopping data and
   trip/budget actions remain owned by shopping.js.
========================================================== */
#shoppingPage { max-width: 1180px; margin-inline: auto; padding-bottom: 34px; }
#shoppingPage .shopping-page-hero {
    position: relative; display: flex; align-items: center; justify-content: space-between;
    gap: 20px; overflow: hidden; margin: 4px 0 22px; padding: clamp(22px, 4vw, 34px);
    min-height: 142px; border: 1px solid rgba(255,255,255,.12); border-radius: 24px;
    color: #fff; background: linear-gradient(118deg, #123f2d 0%, #1b6545 62%, #4b875c 100%);
    box-shadow: 0 14px 34px rgba(23,76,54,.16);
}
#shoppingPage .shopping-page-hero::after { content:""; position:absolute; width:260px; height:260px; right:7%; top:-150px; border:1px solid rgba(255,255,255,.13); border-radius:50%; box-shadow:0 0 0 28px rgba(255,255,255,.035),0 0 0 58px rgba(255,255,255,.025); }
.shopping-hero-copy { position:relative; z-index:1; max-width:650px; }
.shopping-eyebrow { display:block; margin-bottom:8px; color:#d1e8c4; font-size:10px; font-weight:850; letter-spacing:.16em; }
#shoppingPage .shopping-page-hero h2 { margin:0 0 7px; color:#fff; font-size:clamp(26px,4vw,34px); font-weight:800; letter-spacing:-.04em; }
#shoppingPage .shopping-page-hero p { margin:0; color:rgba(255,255,255,.82); font-size:14px; line-height:1.55; }
.shopping-hero-mark { position:relative; z-index:1; display:grid; place-items:center; flex:0 0 86px; width:86px; height:86px; border:1px solid rgba(255,255,255,.2); border-radius:25px; background:rgba(255,255,255,.12); font-size:42px; }
#shoppingPage .shopping-toolbar { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom:14px; padding:17px 19px; border:1px solid var(--border); border-radius:18px; background:var(--surface); box-shadow:0 5px 18px var(--shadow); }
.shopping-toolbar-copy { display:flex; flex-direction:column; gap:4px; min-width:0; }
.shopping-toolbar-copy strong { color:var(--text-primary); font-size:15px; font-weight:780; }
.shopping-toolbar-copy span { color:var(--text-secondary); font-size:12px; line-height:1.45; }
#shoppingPage .shopping-add-button { min-height:46px; flex:0 0 auto; border-radius:13px; padding:0 19px; font-weight:750; box-shadow:0 5px 12px rgba(23,76,54,.13); }
#shoppingPage .shopping-search-container { position:relative; margin:0 0 22px; }
.shopping-search-icon { position:absolute; left:16px; top:50%; z-index:1; transform:translateY(-52%); color:#6e8274; font-size:25px; pointer-events:none; }
#shoppingPage #shoppingSearch { width:100%; min-height:50px; box-sizing:border-box; padding:0 16px 0 47px; border:1px solid var(--border); border-radius:15px; background:var(--surface); color:var(--text-primary); font-size:14px; box-shadow:0 4px 14px var(--shadow); }
#shoppingPage #shoppingSearch::placeholder { color:var(--text-muted); }
#shoppingPage .shopping-trip-card { margin:0 0 20px !important; padding:clamp(16px,2.6vw,24px) !important; border:1px solid var(--border); border-radius:22px !important; background:var(--surface); box-shadow:0 7px 24px var(--shadow); }
#shoppingPage .shopping-trip-header { align-items:center !important; padding-bottom:15px; border-bottom:1px solid var(--border); }
#shoppingPage .shopping-trip-header h3 { margin:0 0 5px; color:var(--text-primary); font-size:19px; font-weight:800; letter-spacing:-.025em; }
#shoppingPage .shopping-trip-header p { margin:0; color:var(--text-secondary); font-size:12px; }
#shoppingPage .shopping-trip-header button { min-height:40px; border-radius:12px; padding:0 13px; font-size:12px; font-weight:720; }
#shoppingPage .shopping-trip-summary { grid-template-columns:repeat(4,minmax(0,1fr)) !important; gap:10px !important; margin:15px 0 17px !important; }
#shoppingPage .shopping-metric { display:flex; flex-direction:column; gap:5px; min-width:0; padding:13px 14px; border:1px solid var(--border); border-radius:15px; background:var(--surface-alt); }
#shoppingPage .shopping-metric strong { color:var(--primary); font-size:clamp(18px,2.3vw,23px); font-weight:820; letter-spacing:-.035em; overflow-wrap:anywhere; }
#shoppingPage .shopping-metric span { color:var(--text-secondary); font-size:11px; font-weight:650; }
#shoppingPage .shopping-metric-bought { background:#edf6ee; border-color:#dcebdd; }
#shoppingPage .shopping-metric-remaining { background:#f7f4e9; border-color:#eee7d2; }
#shoppingPage .shopping-items { overflow:hidden; border:1px solid var(--border); border-radius:16px; background:var(--surface); }
#shoppingPage .shopping-item { align-items:center !important; padding:15px 16px !important; border-bottom:1px solid var(--border) !important; transition:background .18s ease; }
#shoppingPage .shopping-item:last-child { border-bottom:0 !important; }
#shoppingPage .shopping-item-information strong { display:inline-block; margin-bottom:5px; color:var(--text-primary); font-size:14px; font-weight:760; }
#shoppingPage .shopping-item-information > div { margin-top:3px; color:var(--text-secondary); font-size:12px; }
#shoppingPage .shopping-item.is-purchased { background:rgba(234,244,236,.58); }
#shoppingPage .shopping-item.is-purchased .shopping-item-information > strong { color:var(--text-muted); text-decoration:line-through; }
#shoppingPage .shopping-item > div:last-child { gap:7px !important; }
#shoppingPage .shopping-item > div:last-child button { min-height:36px; border-radius:10px; padding:0 11px; font-size:11px; font-weight:720; }
#shoppingPage .shopping-trip-budget { margin-top:17px !important; padding:16px !important; border:1px solid var(--border); border-radius:15px; background:var(--surface-alt); }
#shoppingPage .shopping-trip-budget > div:first-child { color:var(--text-secondary); font-size:12px; }
#shoppingPage .shopping-trip-budget strong { color:var(--text-primary); }
#shoppingPage .shopping-trip-budget [aria-label="Shopping budget usage"] { height:9px !important; background:#dfe8df !important; }
#shoppingPage .shopping-trip-budget [aria-label="Shopping budget usage"] > div { background:linear-gradient(90deg,#2f8055,#8bbd61) !important; }
#shoppingPage .shopping-trip-budget > div:last-child > div:last-child { color:var(--text-secondary); font-size:11px !important; }
#shoppingPage .empty-state { padding:38px 20px; border:1px dashed var(--border-strong); border-radius:20px; background:var(--surface); }
@media (max-width:680px) {
    #shoppingPage .shopping-page-hero { min-height:124px; padding:21px 18px; border-radius:20px; }
    .shopping-hero-mark { flex-basis:58px; width:58px; height:58px; border-radius:18px; font-size:29px; }
    #shoppingPage .shopping-toolbar { align-items:stretch; flex-direction:column; padding:15px; }
    #shoppingPage .shopping-add-button { width:100%; }
    #shoppingPage .shopping-trip-header { align-items:stretch !important; }
    #shoppingPage .shopping-trip-header > div:last-child { width:100%; }
    #shoppingPage .shopping-trip-header button { flex:1 1 145px; }
    #shoppingPage .shopping-trip-summary { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
    #shoppingPage .shopping-item { align-items:flex-start !important; }
    #shoppingPage .shopping-item > div:last-child { width:100%; }
    #shoppingPage .shopping-item > div:last-child button { flex:1 1 82px; }
}
@media (max-width:380px) {
    #shoppingPage .shopping-page-hero p { max-width:235px; font-size:12px; }
    .shopping-hero-mark { display:none; }
    #shoppingPage .shopping-trip-card { padding:13px !important; }
    #shoppingPage .shopping-trip-budget { padding:12px !important; }
}
body.dark-mode #shoppingPage .shopping-trip-card,
body.dark-mode #shoppingPage .shopping-toolbar,
body.dark-mode #shoppingPage #shoppingSearch,
body.dark-mode #shoppingPage .shopping-items,
body.dark-mode #shoppingPage .shopping-empty-state { background:var(--surface); }
body.dark-mode #shoppingPage .shopping-metric { background:var(--surface-alt); border-color:var(--border); }
body.dark-mode #shoppingPage .shopping-metric-bought { background:rgba(47,128,85,.14); }
body.dark-mode #shoppingPage .shopping-metric-remaining { background:rgba(180,145,52,.12); }
body.dark-mode #shoppingPage .shopping-item.is-purchased { background:rgba(47,128,85,.08); }
body.dark-mode #shoppingPage .shopping-trip-budget { background:var(--surface-alt); }


/* ==========================================================
   PANVIYO 2.0 — REPORTS & ANALYTICS REDESIGN
   Presentation-only layer; all report calculations and IDs
   remain owned by reports.js.
========================================================== */
#reportsPage { max-width: 1180px; margin-inline: auto; }
#reportsPage .reports-header {
    position:relative; overflow:hidden; margin:0 0 22px; padding:clamp(22px,3.5vw,34px);
    border:1px solid rgba(255,255,255,.12); border-radius:24px;
    color:#fff; background:linear-gradient(118deg,#153f30 0%,#236344 58%,#47865a 100%);
    box-shadow:0 14px 34px rgba(24,75,49,.18);
}
#reportsPage .reports-header:after { content:""; position:absolute; width:230px; height:230px; right:-55px; top:-105px; border:1px solid rgba(255,255,255,.16); border-radius:50%; box-shadow:0 0 0 25px rgba(255,255,255,.045),0 0 0 52px rgba(255,255,255,.035); }
#reportsPage .reports-header h2 { position:relative; z-index:1; margin:0 0 8px; color:#fff; font-size:clamp(24px,3vw,32px); font-weight:850; letter-spacing:-.04em; }
#reportsPage .reports-header p { position:relative; z-index:1; margin:0; max-width:570px; color:rgba(255,255,255,.82); font-size:13px; }
#reportsPage .reports-overview-grid { display:grid !important; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px !important; margin:0 0 17px; }
#reportsPage .reports-overview-grid .dashboard-card { position:relative; min-width:0; padding:19px 18px !important; border:1px solid var(--border); border-radius:19px !important; background:var(--surface); box-shadow:0 6px 20px var(--shadow); }
#reportsPage .reports-overview-grid .dashboard-card:before { content:""; display:block; width:32px; height:4px; margin-bottom:13px; border-radius:8px; background:#47865a; }
#reportsPage .reports-overview-grid .dashboard-card.warning:before { background:#d99a2b; }
#reportsPage .reports-overview-grid .dashboard-card.danger:before { background:#cf5d58; }
#reportsPage .reports-overview-grid .dashboard-card.success:before { background:#4b9a68; }
#reportsPage .reports-overview-grid h3 { margin:0 0 8px; color:var(--text-secondary); font-size:12px; font-weight:700; }
#reportsPage .reports-overview-grid h2 { margin:0; color:var(--text-primary); font-size:clamp(25px,3vw,33px); font-weight:850; letter-spacing:-.045em; }
#reportsPage .reports-waste-card { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:0 0 17px; padding:22px 24px !important; border:1px solid #dbe9dc; border-radius:20px; background:linear-gradient(110deg,#edf6ed,#f8fbf5); box-shadow:0 6px 20px var(--shadow); }
#reportsPage .reports-waste-card h3 { margin:0; color:#315d3e; font-size:14px; font-weight:780; }
#reportsPage .reports-waste-card h2 { margin:0; color:#24623e; font-size:clamp(29px,4vw,40px); font-weight:880; letter-spacing:-.05em; }
#reportsPage .reports-category-card,#reportsPage .reports-expiry-card { margin:0 0 17px; padding:21px !important; border:1px solid var(--border); border-radius:20px; background:var(--surface); box-shadow:0 6px 20px var(--shadow); }
#reportsPage .reports-category-card h3,#reportsPage .reports-expiry-card h3 { margin:0 0 15px; color:var(--text-primary); font-size:16px; font-weight:800; letter-spacing:-.02em; }
#reportsPage .reports-category-card ul,#reportsPage .reports-expiry-card ul { margin:0; padding:0; list-style:none; }
#reportsPage .reports-category-card li,#reportsPage .reports-expiry-card li { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:43px; padding:10px 13px; border:1px solid var(--border); border-radius:12px; background:var(--surface-alt); color:var(--text-secondary); font-size:13px; }
#reportsPage .reports-category-card li strong { min-width:30px; padding:4px 9px; border-radius:9px; background:#e8f2e8; color:#28613d; text-align:center; font-size:12px; }
#reportsPage .reports-shopping-heading { margin:25px 0 13px; }
#reportsPage .reports-shopping-heading h3 { color:var(--text-primary); font-size:19px; font-weight:830; letter-spacing:-.03em; }
#reportsPage .reports-shopping-heading p { color:var(--text-secondary); font-size:12px; }
#reportsPage #completedShoppingList { display:grid; gap:13px; }
#reportsPage #completedShoppingList > * { border-radius:18px; }
#reportsPage .info-card:has(#shoppingReportTripLimit) { margin-bottom:17px; padding:18px 20px; border:1px solid var(--border); border-radius:18px; background:var(--surface); box-shadow:0 5px 18px var(--shadow); }
#reportsPage #shoppingReportTripLimit { min-height:42px; border:1px solid var(--border-strong); border-radius:11px; background:var(--surface); color:var(--text-primary); padding:0 12px; }
body.dark-mode #reportsPage .reports-waste-card { border-color:rgba(113,172,125,.25); background:linear-gradient(110deg,rgba(49,104,63,.22),rgba(49,104,63,.10)); }
body.dark-mode #reportsPage .reports-waste-card h3,body.dark-mode #reportsPage .reports-waste-card h2 { color:#a8d6ae; }
body.dark-mode #reportsPage .reports-category-card li strong { background:rgba(69,139,83,.2); color:#b6dfbc; }
@media(max-width:760px) { #reportsPage .reports-overview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px !important; } #reportsPage .reports-overview-grid .dashboard-card { padding:15px !important; } #reportsPage .reports-category-card,#reportsPage .reports-expiry-card { padding:16px !important; } }
@media(max-width:390px) { #reportsPage .reports-header { padding:21px 17px; } #reportsPage .reports-overview-grid h3 { font-size:11px; } #reportsPage .reports-waste-card { padding:17px !important; }
}

/* Completed shopping history controls and expandable trip cards */
.completed-history-toolbar { display:grid; grid-template-columns:minmax(220px,1.5fr) minmax(260px,1fr); gap:16px; align-items:end; margin:14px 0 18px; }
.completed-history-toolbar label { display:block; font-size:.82rem; font-weight:700; margin-bottom:7px; color:var(--text-secondary, var(--text)); }
.completed-history-toolbar input, .completed-history-toolbar select { width:100%; min-height:44px; border:1px solid var(--border); border-radius:12px; padding:10px 12px; background:var(--surface); color:var(--text); font:inherit; }
.completed-history-controls { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.completed-history-result-count { grid-column:1/-1; margin:0; color:var(--text-secondary, var(--text)); font-size:.82rem; }
.completed-shopping-card .section-header { align-items:flex-start; gap:14px; }
.completed-shopping-card .section-header > strong { white-space:nowrap; font-size:1.15rem; color:var(--primary, #246b4a); }
.completed-shopping-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(125px,1fr)); gap:8px; padding:12px 0; }
.completed-shopping-summary p { margin:0; padding:10px 12px; border-radius:12px; background:var(--surface-alt, rgba(120,140,120,.09)); font-size:.88rem; }
.completed-shopping-details { margin-top:8px; border-top:1px solid var(--border); }
.completed-shopping-details summary { cursor:pointer; padding:13px 2px 5px; font-weight:700; color:var(--primary, #246b4a); }
.completed-shopping-details[open] summary { margin-bottom:8px; }
@media(max-width:640px) { .completed-history-toolbar { grid-template-columns:1fr; } .completed-history-controls { grid-template-columns:1fr 1fr; } .completed-shopping-card { padding:14px; } .completed-shopping-card .section-header { flex-direction:column; } .completed-shopping-summary { grid-template-columns:1fr 1fr; } }


/* ==========================================================
   PANVIYO 2.0 — EXPIRY ALERTS PAGE
========================================================== */
.expiry-page{padding-bottom:28px}
.expiry-hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:28px 32px;margin:0 0 20px;border-radius:24px;background:linear-gradient(115deg,#174c36,#286b49);color:#fff;box-shadow:0 12px 30px rgba(23,76,54,.16)}
.expiry-hero h2{margin:7px 0;color:#fff;font-size:clamp(29px,4vw,40px);font-weight:850;letter-spacing:-.045em}.expiry-hero h2 em{color:#c9e8a8;font-style:normal}.expiry-hero p{max-width:560px;margin:0;color:rgba(255,255,255,.78);font-size:14px}.expiry-hero-icon{display:grid;place-items:center;width:76px;height:76px;border-radius:23px;background:rgba(255,255,255,.13);font-size:38px}
.expiry-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:13px;margin-bottom:25px}.expiry-summary-card{display:flex;flex-direction:column;gap:5px;padding:18px 20px;border:1px solid var(--border);border-radius:18px;background:var(--surface);box-shadow:0 5px 18px var(--shadow)}.expiry-summary-card span{font-size:10px;font-weight:850;letter-spacing:.09em;color:var(--text-secondary)}.expiry-summary-card strong{font-size:32px;line-height:1.1;font-weight:850;letter-spacing:-.04em;color:var(--text-primary)}.expiry-summary-card small{font-size:11px;color:var(--text-secondary)}.expiry-summary-danger strong{color:#c34c45}.expiry-summary-today strong{color:#d36a35}.expiry-summary-soon strong{color:#b77b24}.expiry-summary-fresh strong{color:#328052}
.expiry-toolbar{display:flex;align-items:end;justify-content:space-between;gap:18px;margin:8px 0 14px}.expiry-toolbar h3{margin:0;color:var(--text-primary);font-size:20px;font-weight:830}.expiry-toolbar p{margin:4px 0 0;color:var(--text-secondary);font-size:12px}.expiry-controls{display:flex;gap:9px}.expiry-controls input,.expiry-controls select{min-height:42px;padding:0 13px;border:1px solid var(--border-strong);border-radius:11px;background:var(--surface);color:var(--text-primary);font:inherit;font-size:13px}.expiry-controls input{width:min(250px,45vw)}.expiry-timeline{display:grid;gap:11px}.expiry-item{display:flex;align-items:center;gap:14px;padding:16px 18px;border:1px solid var(--border);border-left:4px solid #83a98b;border-radius:16px;background:var(--surface);box-shadow:0 4px 15px var(--shadow)}.expiry-expired{border-left-color:#c34c45}.expiry-today{border-left-color:#dc713d}.expiry-soon{border-left-color:#d2a044}.expiry-fresh{border-left-color:#4d9b68}.expiry-item-icon{display:grid;place-items:center;flex:0 0 43px;width:43px;height:43px;border-radius:13px;background:var(--surface-alt);font-size:21px}.expiry-item-main{flex:1;min-width:0}.expiry-item-heading{display:flex;align-items:center;flex-wrap:wrap;gap:9px}.expiry-item-heading h4{margin:0;color:var(--text-primary);font-size:15px;font-weight:800}.expiry-status-pill{padding:5px 9px;border-radius:999px;background:#edf4e8;color:#356b43;font-size:10px;font-weight:800;white-space:nowrap}.expiry-expired .expiry-status-pill{background:#fae9e7;color:#a83d37}.expiry-today .expiry-status-pill{background:#fff0e7;color:#b95a2b}.expiry-soon .expiry-status-pill{background:#fbf2df;color:#946719}.expiry-item-main p{margin:5px 0;color:var(--text-secondary);font-size:12px}.expiry-item-meta{display:flex;flex-wrap:wrap;gap:12px;color:var(--text-secondary);font-size:11px}.expiry-item-action{padding:8px 12px;border:1px solid var(--border-strong);border-radius:10px;background:var(--surface-alt);color:var(--text-primary);font-size:11px;font-weight:750;white-space:nowrap}.expiry-footnote{display:flex;gap:10px;margin-top:17px;padding:14px 16px;border-radius:14px;background:var(--surface-alt);color:var(--text-secondary);font-size:12px}.panel-view-all{border:0;background:transparent;color:var(--accent,#286b49);font-size:12px;font-weight:800;cursor:pointer}
body.dark-mode .expiry-status-pill{background:rgba(74,135,83,.2);color:#b9dfbd}body.dark-mode .expiry-expired .expiry-status-pill{background:rgba(190,72,66,.2);color:#ffb2ab}body.dark-mode .expiry-today .expiry-status-pill{background:rgba(205,113,61,.2);color:#ffc09b}body.dark-mode .expiry-soon .expiry-status-pill{background:rgba(199,153,58,.2);color:#f0d08b}
@media(max-width:760px){.expiry-hero{padding:22px 19px}.expiry-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.expiry-summary-card{padding:14px}.expiry-summary-card strong{font-size:28px}.expiry-toolbar{align-items:stretch;flex-direction:column}.expiry-controls input{flex:1;width:50%}.expiry-controls select{flex:1;min-width:0}.expiry-item{align-items:flex-start;padding:13px;gap:10px}.expiry-item-action{align-self:center;padding:7px 9px}}
@media(max-width:390px){.expiry-item-icon{display:none}.expiry-item-heading h4{font-size:14px}.expiry-item-action{font-size:10px}.expiry-controls input,.expiry-controls select{font-size:11px;padding:0 8px}}

/* ==========================================================
   PANVIYO 2.0 — FOOD WASTE INSIGHTS
========================================================== */
#reportsPage .food-waste-panel{margin:0 0 20px;padding:22px;border:1px solid var(--border);border-radius:22px;background:var(--surface);box-shadow:0 8px 24px var(--shadow)}
#reportsPage .food-waste-hero{display:flex;align-items:center;justify-content:space-between;gap:22px;padding:24px;border-radius:17px;background:linear-gradient(115deg,#173f30,#286044);color:#fff}
#reportsPage .food-waste-eyebrow{font-size:10px;font-weight:850;letter-spacing:.15em;color:#b9dfbf}
#reportsPage .food-waste-hero h2{margin:8px 0 7px;color:#fff;font-size:clamp(23px,3vw,32px);font-weight:850;letter-spacing:-.045em}
#reportsPage .food-waste-hero h2 em{color:#b9df87;font-style:normal}
#reportsPage .food-waste-hero p{max-width:560px;margin:0;color:rgba(255,255,255,.78);font-size:13px;line-height:1.6}
#reportsPage .food-waste-score{flex:0 0 150px;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:126px;padding:15px;border:1px solid rgba(255,255,255,.2);border-radius:16px;background:rgba(255,255,255,.09)}
#reportsPage .food-waste-score span,#reportsPage .food-waste-score small{color:rgba(255,255,255,.75);font-size:11px}
#reportsPage .food-waste-score strong{color:#fff;font-size:38px;line-height:1.2;font-weight:900;letter-spacing:-.06em}
#reportsPage .food-waste-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:16px 0}
#reportsPage .food-waste-metric{display:flex;align-items:center;gap:12px;min-width:0;padding:16px;border:1px solid var(--border);border-radius:15px;background:var(--surface-alt)}
#reportsPage .food-waste-metric .metric-icon{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;border-radius:11px;background:#e9f0eb;color:#315e40;font-size:18px;font-weight:900}
#reportsPage .food-waste-metric div{display:flex;flex-direction:column;gap:3px;min-width:0}
#reportsPage .food-waste-metric small{color:var(--text-secondary);font-size:11px;font-weight:650}
#reportsPage .food-waste-metric strong{color:var(--text-primary);font-size:23px;font-weight:850;line-height:1.1}
#reportsPage .food-waste-metric.waste-danger .metric-icon{background:#fae9e7;color:#a53d35}
#reportsPage .food-waste-metric.waste-warning .metric-icon{background:#fff1d9;color:#996016}
#reportsPage .food-waste-metric.waste-good .metric-icon{background:#e5f2e7;color:#28643d}
#reportsPage .food-waste-guidance{display:flex;align-items:flex-start;gap:12px;padding:15px 17px;border:1px solid #dce9d9;border-radius:14px;background:#f2f7ef}
#reportsPage .guidance-icon{display:grid;place-items:center;flex:0 0 30px;height:30px;border-radius:10px;background:#dcebd8;color:#28613d;font-weight:900}
#reportsPage .food-waste-guidance strong{display:block;margin:1px 0 4px;color:#244d32;font-size:13px;font-weight:800}
#reportsPage .food-waste-guidance p{margin:0;color:#536b58;font-size:12px;line-height:1.55}
body.dark-mode #reportsPage .food-waste-guidance{border-color:rgba(113,172,125,.22);background:rgba(49,104,63,.16)}
body.dark-mode #reportsPage .food-waste-guidance strong{color:#b9dfbf}
body.dark-mode #reportsPage .food-waste-guidance p{color:#c0cfc2}
body.dark-mode #reportsPage .food-waste-metric .metric-icon{background:rgba(113,172,125,.15);color:#b9dfbf}
body.dark-mode #reportsPage .food-waste-metric.waste-danger .metric-icon{background:rgba(180,70,60,.2);color:#f0aaa2}
body.dark-mode #reportsPage .food-waste-metric.waste-warning .metric-icon{background:rgba(185,125,38,.2);color:#f0c47f}
@media(max-width:760px){#reportsPage .food-waste-panel{padding:14px}#reportsPage .food-waste-hero{align-items:stretch;padding:18px;flex-direction:column}#reportsPage .food-waste-score{flex:initial;min-height:88px;align-items:flex-start}#reportsPage .food-waste-score strong{font-size:32px}#reportsPage .food-waste-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}#reportsPage .food-waste-metric{padding:12px;gap:9px}#reportsPage .food-waste-metric strong{font-size:20px}}


/* ==========================================================
   PANVIYO 2.0 — SETTINGS CONTROL CENTRE
========================================================== */
#settingsPage { max-width: 1080px; margin-inline: auto; }
#settingsPage .settings-hero {
  display:flex; align-items:center; justify-content:space-between; gap:24px;
  padding:clamp(22px,4vw,38px); margin:0 0 22px; border-radius:26px;
  color:#fff; background:linear-gradient(120deg,#123f2e 0%,#1d6546 58%,#43845b 100%);
  box-shadow:0 14px 34px rgba(19,75,51,.18); overflow:hidden; position:relative;
}
#settingsPage .settings-hero:after { content:""; position:absolute; width:230px; height:230px; border:1px solid rgba(255,255,255,.12); border-radius:50%; right:70px; top:-145px; box-shadow:0 0 0 28px rgba(255,255,255,.035),0 0 0 58px rgba(255,255,255,.025); }
#settingsPage .settings-hero-copy { position:relative; z-index:1; max-width:680px; }
#settingsPage .settings-eyebrow { display:block; font-size:11px; font-weight:800; letter-spacing:.16em; opacity:.78; margin-bottom:10px; }
#settingsPage .settings-hero h2 { color:#fff; font-size:clamp(25px,4vw,36px); line-height:1.12; margin:0 0 10px; }
#settingsPage .settings-hero p { color:rgba(255,255,255,.84); margin:0; max-width:590px; line-height:1.6; }
#settingsPage .settings-hero-mark { flex:0 0 76px; width:76px; height:76px; display:grid; place-items:center; border-radius:23px; background:rgba(255,255,255,.13); border:1px solid rgba(255,255,255,.2); font-size:38px; position:relative; z-index:1; }
#settingsPage .settings-card { padding:clamp(18px,3vw,26px); border-radius:22px; margin-bottom:17px; box-shadow:0 7px 24px var(--shadow); }
#settingsPage .settings-card-heading { display:flex; align-items:center; gap:13px; margin-bottom:20px; }
#settingsPage .settings-card-heading h3 { margin:0 0 4px; font-size:18px; letter-spacing:-.02em; }
#settingsPage .settings-card-heading p { margin:0; color:var(--text-secondary); font-size:13px; line-height:1.45; }
#settingsPage .settings-icon-tile { width:46px; height:46px; flex:0 0 46px; display:grid; place-items:center; border-radius:15px; background:rgba(46,125,80,.11); font-size:21px; }
#settingsPage .settings-account-card > p { color:var(--text-secondary); }
#settingsPage .settings-account-card #accountEmail { color:var(--text-primary); overflow-wrap:anywhere; }
#settingsPage .setting-row { display:grid; grid-template-columns:minmax(170px,.8fr) minmax(220px,1.2fr); gap:18px; align-items:center; padding:15px 0; border-bottom:1px solid var(--border); }
#settingsPage .setting-row > label, #settingsPage .settings-option label { font-weight:650; color:var(--text-primary); }
#settingsPage .setting-row small { display:block; margin-top:7px; color:var(--text-secondary); line-height:1.45; }
#settingsPage .settings-option { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:17px 0 20px; }
#settingsPage .settings-option input[type=checkbox] { width:22px; height:22px; accent-color:#2e7d50; }
#settingsPage .settings-card > button { margin:5px 8px 0 0; }
#settingsPage .settings-data-actions { gap:10px; }
#settingsPage .settings-roadmap-card li { padding:8px 0; color:var(--text-secondary); }
#settingsPage .shopping-store-settings-list { margin-top:12px; }
@media(max-width:640px) {
  #settingsPage .settings-hero { border-radius:21px; padding:23px 20px; gap:10px; }
  #settingsPage .settings-hero-mark { width:52px; height:52px; flex-basis:52px; border-radius:16px; font-size:27px; }
  #settingsPage .setting-row { grid-template-columns:1fr; gap:9px; }
  #settingsPage .settings-card-heading { align-items:flex-start; }
  #settingsPage .settings-data-actions > button { width:100%; }
}
body.dark-mode #settingsPage .settings-hero { background:linear-gradient(120deg,#102f25,#174b36 62%,#286044); }
body.dark-mode #settingsPage .settings-icon-tile { background:rgba(112,184,137,.14); }


/* ==========================================================
   PANVIYO 2.0 — NAVIGATION & PAGE VISIBILITY PATCH
   Keep dashboard-only content hidden with its parent page and
   keep all navigation destinations on one horizontally
   scrollable row on narrow screens.
========================================================== */
#app > .page:not(.active) {
    display: none !important;
}
#app > .page.active {
    display: block !important;
}

.bottom-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: fixed;
}
.bottom-nav::-webkit-scrollbar {
    display: none;
}
.bottom-nav > button:not(.nav-scroll-next) {
    flex: 1 0 0;
    min-width: 58px;
    max-width: none;
}
.bottom-nav .nav-scroll-next {
    position: sticky;
    right: 0;
    z-index: 3;
    flex: 0 0 34px;
    min-width: 34px;
    min-height: 58px;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--nav-border);
    border-radius: 12px;
    color: var(--primary);
    background: color-mix(in srgb, var(--nav-background) 90%, white);
    box-shadow: -8px 0 16px rgba(18, 47, 31, .08);
    font-size: 26px;
    line-height: 1;
}
.bottom-nav .nav-scroll-next[hidden] {
    display: none !important;
}
@media (min-width: 900px) {
    .bottom-nav {
        overflow: visible;
        justify-content: space-between;
    }
    .bottom-nav > button:not(.nav-scroll-next) {
        min-width: 0;
    }
    .bottom-nav .nav-scroll-next {
        display: none !important;
    }
}


/* PANVIYO navigation correction — one horizontal strip, no wrapping */
#app .page:not(.active) {
    display: none !important;
    visibility: hidden !important;
}
#app .page.active {
    display: block !important;
    visibility: visible !important;
}
.bottom-nav {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch;
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom, 0px)) !important;
}
.bottom-nav::-webkit-scrollbar { display: none !important; }
.bottom-nav > button:not(.nav-scroll-next) {
    display: flex !important;
    flex: 0 0 16.6667% !important;
    width: 16.6667% !important;
    min-width: 0 !important;
    max-width: none !important;
    box-sizing: border-box !important;
    padding: 4px 1px !important;
    white-space: nowrap !important;
}
.bottom-nav > button:not(.nav-scroll-next) .nav-text {
    font-size: clamp(8px, 2.5vw, 11px) !important;
}
.bottom-nav > .nav-scroll-next {
    position: sticky !important;
    right: 0 !important;
    flex: 0 0 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 58px !important;
    align-self: center !important;
    z-index: 5 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    background: var(--nav-background) !important;
    box-shadow: -8px 0 16px rgba(18,47,31,.10) !important;
}
.bottom-nav > .nav-scroll-next[hidden] { display: none !important; }
@media (min-width: 900px) {
    .bottom-nav {
        width: min(720px, calc(100% - 48px)) !important;
        height: auto !important;
        overflow: visible !important;
        padding: 8px 12px !important;
    }
    .bottom-nav > button:not(.nav-scroll-next) {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
    }
    .bottom-nav > .nav-scroll-next { display: none !important; }
}


/* PANVIYO page visibility: the dashboard (including Recently Added)
   must only render while the Home destination is selected. */
body[data-panviyo-page="home"] #homePage { display: block !important; visibility: visible !important; }
body:not([data-panviyo-page="home"]) #homePage { display: none !important; visibility: hidden !important; }
body[data-panviyo-page="products"] #productsPage,
body[data-panviyo-page="scan"] #scanPage,
body[data-panviyo-page="shopping"] #shoppingPage,
body[data-panviyo-page="notifications"] #notificationsPage,
body[data-panviyo-page="reports"] #reportsPage,
body[data-panviyo-page="settings"] #settingsPage {
    display: block !important;
    visibility: visible !important;
}
body[data-panviyo-page="products"] #homePage,
body[data-panviyo-page="scan"] #homePage,
body[data-panviyo-page="shopping"] #homePage,
body[data-panviyo-page="notifications"] #homePage,
body[data-panviyo-page="reports"] #homePage,
body[data-panviyo-page="settings"] #homePage {
    display: none !important;
    visibility: hidden !important;
}


/* PANVIYO Reports refinement — remove duplicate Food Waste metrics
   and give Completed Shopping a clear new-section treatment. */
#reportsPage .food-waste-panel .food-waste-hero {
    margin-bottom: 14px;
}
#reportsPage .food-waste-panel .food-waste-score {
    min-width: 150px;
}
#reportsPage .food-waste-panel .food-waste-guidance {
    margin-top: 14px;
}
#reportsPage .reports-shopping-section {
    margin: 34px 0 16px;
}
#reportsPage .reports-shopping-heading {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 0;
    padding: 20px 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(115deg, rgba(27,82,58,.10), rgba(185,223,135,.13));
}
#reportsPage .reports-shopping-heading::after {
    content: "";
    position: absolute;
    right: -35px;
    top: -55px;
    width: 150px;
    height: 150px;
    border: 1px solid rgba(37,105,70,.12);
    border-radius: 50%;
    box-shadow: 0 0 0 18px rgba(37,105,70,.035), 0 0 0 36px rgba(37,105,70,.025);
    pointer-events: none;
}
#reportsPage .reports-shopping-heading-icon {
    display: grid;
    place-items: center;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 5px 15px rgba(20,55,35,.08);
    font-size: 27px;
}
#reportsPage .reports-shopping-heading-copy { min-width: 0; }
#reportsPage .reports-shopping-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .16em;
    text-transform: uppercase;
}
#reportsPage .reports-shopping-heading h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(20px, 4vw, 25px);
    font-weight: 850;
    letter-spacing: -.04em;
}
#reportsPage .reports-shopping-heading p {
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}
#reportsPage .reports-shopping-heading-mark {
    position: relative;
    z-index: 1;
    margin-left: auto;
    color: var(--primary);
    font-size: 25px;
    font-weight: 700;
}
body.dark-mode #reportsPage .reports-shopping-heading {
    border-color: rgba(130,180,145,.20);
    background: linear-gradient(115deg, rgba(36,91,65,.25), rgba(105,143,76,.12));
}
body.dark-mode #reportsPage .reports-shopping-heading-icon {
    background: rgba(255,255,255,.08);
}
@media (max-width: 520px) {
    #reportsPage .reports-shopping-section { margin-top: 27px; }
    #reportsPage .reports-shopping-heading { gap: 11px; padding: 16px 14px; border-radius: 17px; }
    #reportsPage .reports-shopping-heading-icon { flex-basis: 46px; width: 46px; height: 46px; border-radius: 14px; font-size: 23px; }
    #reportsPage .reports-shopping-heading-mark { font-size: 20px; }
}


/* PANVIYO visual consistency pass — build 071 */

/* Use the supplied brand mark on the authentication screen. */
.auth-brand-icon {
    display: grid;
    place-items: center;
    overflow: hidden;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: #102820;
}
.auth-brand-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Dashboard metric cards must follow the active theme.
   Previous status gradients were hard-coded to white. */
body.dark-mode .dashboard-card,
body.dark-mode .info-card,
body.dark-mode .dashboard-details .info-card {
    color: var(--text-primary);
    background: var(--surface);
    border-color: var(--border);
    box-shadow: 0 5px 20px rgba(0,0,0,.24);
}
body.dark-mode .dashboard-card h3,
body.dark-mode .info-card h3,
body.dark-mode .dashboard-card .metric-footnote,
body.dark-mode .info-card p {
    color: var(--text-secondary);
}
body.dark-mode .dashboard-card h1,
body.dark-mode .dashboard-card h2,
body.dark-mode .info-card h1,
body.dark-mode .info-card h2 {
    color: var(--text-primary);
}
body.dark-mode .dashboard-card.warning {
    background: linear-gradient(145deg, #282419, #1D211C);
    border-color: #574722;
}
body.dark-mode .dashboard-card.danger {
    background: linear-gradient(145deg, #2B1D1D, #1D211C);
    border-color: #583333;
}
body.dark-mode .dashboard-card.success {
    background: linear-gradient(145deg, #1B2B20, #1D211C);
    border-color: #31543B;
}
body.dark-mode .dashboard-card.warning h3,
body.dark-mode .dashboard-card.danger h3,
body.dark-mode .dashboard-card.success h3 {
    color: #D4DED6;
}
body.dark-mode .dashboard-card.warning h2,
body.dark-mode .dashboard-card.danger h2,
body.dark-mode .dashboard-card.success h2 {
    color: #F1F5F2;
}

/* Scanner and Completed Shopping use the same banner treatment
   as Expiry Alerts, while retaining their own content and icon. */
#scanPage .scanner-page-heading.expiry-hero,
#reportsPage .reports-shopping-heading.expiry-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 32px;
    margin: 0 0 20px;
    border: 0;
    border-radius: 24px;
    background: linear-gradient(115deg, #174C36, #286B49);
    color: #fff;
    box-shadow: 0 12px 30px rgba(23,76,54,.16);
}
#scanPage .scanner-page-heading h2,
#reportsPage .reports-shopping-heading h3 {
    margin: 0 0 7px;
    color: #fff;
    font-size: clamp(25px, 4vw, 34px);
    font-weight: 850;
    letter-spacing: -.04em;
}
#scanPage .scanner-page-heading p,
#reportsPage .reports-shopping-heading p {
    margin: 0;
    max-width: 620px;
    color: rgba(255,255,255,.82);
    font-size: 15px;
    line-height: 1.55;
}
#scanPage .scanner-eyebrow,
#reportsPage .reports-shopping-eyebrow {
    display: block;
    margin-bottom: 12px;
    color: #C7E3CB;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .16em;
    text-transform: uppercase;
}
#scanPage .scanner-heading-icon,
#reportsPage .reports-shopping-heading-icon,
#reportsPage .reports-shopping-heading-mark {
    color: #fff;
}
#scanPage .scanner-heading-icon,
#reportsPage .reports-shopping-heading-icon {
    display: grid;
    place-items: center;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: rgba(255,255,255,.12);
    font-size: 30px;
}
#reportsPage .reports-shopping-heading {
    position: relative;
}
#reportsPage .reports-shopping-heading::after {
    border-color: rgba(255,255,255,.14);
    box-shadow: 0 0 0 18px rgba(255,255,255,.035), 0 0 0 36px rgba(255,255,255,.025);
}
#reportsPage .reports-shopping-heading-icon {
    box-shadow: none;
}
#reportsPage .reports-shopping-heading-mark {
    z-index: 1;
}
@media (max-width: 600px) {
    #scanPage .scanner-page-heading.expiry-hero,
    #reportsPage .reports-shopping-heading.expiry-hero {
        gap: 12px;
        padding: 22px 18px;
        border-radius: 21px;
    }
    #scanPage .scanner-heading-icon,
    #reportsPage .reports-shopping-heading-icon {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
        border-radius: 15px;
        font-size: 24px;
    }
    #scanPage .scanner-page-heading p,
    #reportsPage .reports-shopping-heading p {
        font-size: 13px;
    }
}


/* PANVIYO Reports — Completed Shopping heading must retain the
   same Expiry Alerts hero treatment in dark mode. */
body.dark-mode #reportsPage .reports-shopping-heading.expiry-hero {
    border: 0 !important;
    background: linear-gradient(115deg, #174C36, #286B49) !important;
    color: #FFFFFF !important;
    box-shadow: 0 12px 30px rgba(0,0,0,.28) !important;
}
body.dark-mode #reportsPage .reports-shopping-heading.expiry-hero .reports-shopping-eyebrow {
    color: rgba(220,242,224,.82) !important;
}
body.dark-mode #reportsPage .reports-shopping-heading.expiry-hero h3 {
    color: #FFFFFF !important;
}
body.dark-mode #reportsPage .reports-shopping-heading.expiry-hero p {
    color: rgba(255,255,255,.84) !important;
}
body.dark-mode #reportsPage .reports-shopping-heading.expiry-hero .reports-shopping-heading-icon {
    background: rgba(255,255,255,.12) !important;
    color: #FFFFFF !important;
}
body.dark-mode #reportsPage .reports-shopping-heading.expiry-hero .reports-shopping-heading-mark {
    color: #FFFFFF !important;
}
body.dark-mode #reportsPage .reports-shopping-heading.expiry-hero::after {
    border-color: rgba(255,255,255,.14) !important;
    box-shadow: 0 0 0 18px rgba(255,255,255,.035), 0 0 0 36px rgba(255,255,255,.025) !important;
}


/* Clear registration and authentication feedback. */
#authMessage {
    display: block;
    min-height: 0;
    margin: 18px 0 8px;
    padding: 13px 15px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
    text-align: left;
}
#authMessage:empty {
    display: none;
}
#authMessage.success {
    color: #17633D;
    background: #E8F6EC;
    border-color: #B8E2C4;
}
#authMessage.info {
    color: #285B43;
    background: #EDF5EF;
    border-color: #D3E5D8;
}
#authMessage.error {
    color: #9C302B;
    background: #FCEDEC;
    border-color: #F1C7C4;
}
body.dark-mode #authMessage.success {
    color: #BCEBCB;
    background: #173A28;
    border-color: #2E6846;
}
body.dark-mode #authMessage.info {
    color: #D2E6D8;
    background: #1C3025;
    border-color: #355442;
}
body.dark-mode #authMessage.error {
    color: #FFC2BC;
    background: #3A211F;
    border-color: #71413D;
}

/* PANVIYO guided onboarding */
.settings-tour-button{margin-top:14px;display:inline-flex;align-items:center;gap:8px;border:1px solid rgba(38,112,72,.25);border-radius:12px;padding:10px 15px;background:rgba(38,112,72,.09);color:var(--primary);font-weight:750;cursor:pointer}
.panviyo-onboarding[hidden]{display:none!important}
.panviyo-onboarding{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;padding:18px}
.onboarding-backdrop{position:absolute;inset:0;background:rgba(8,24,16,.68);backdrop-filter:blur(7px)}
.onboarding-dialog{position:relative;width:min(100%,540px);max-height:min(90vh,760px);overflow:auto;background:var(--surface,#fff);color:var(--text-primary);border:1px solid var(--border);border-radius:24px;padding:30px;box-shadow:0 28px 90px rgba(0,0,0,.28)}
.onboarding-close{position:absolute;right:16px;top:12px;border:0;background:transparent;color:var(--text-secondary);font-size:28px;cursor:pointer}
.onboarding-brand{display:flex;align-items:center;gap:10px;color:var(--primary);font-weight:900;letter-spacing:.06em}
.onboarding-brand small{display:block;font-size:9px;letter-spacing:.18em;font-weight:700}
.onboarding-mark{font-size:30px}
.onboarding-progress{height:6px;border-radius:9px;background:var(--surface-secondary);overflow:hidden;margin:24px 0 18px}
.onboarding-progress span{display:block;height:100%;width:20%;background:#328454;transition:width .2s ease}
.onboarding-step-label{font-size:10px;font-weight:850;letter-spacing:.16em;color:var(--primary)}
.onboarding-dialog h2{font-size:clamp(24px,5vw,32px);margin:8px 0;color:var(--text-primary)}
.onboarding-dialog>p:not(.onboarding-step-label){color:var(--text-secondary);line-height:1.6}
.onboarding-content{margin:22px 0;padding:18px;border-radius:16px;background:var(--surface-secondary);color:var(--text-primary);line-height:1.7;min-height:100px}
.onboarding-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:24px}
.onboarding-actions button{border-radius:12px;padding:11px 16px;font-weight:750;cursor:pointer}
.onboarding-skip,.onboarding-back-button{background:transparent;border:1px solid var(--border);color:var(--text-primary)}
.onboarding-next-button{border:0;background:#174C36;color:white;margin-left:8px}
.onboarding-back-button:disabled{opacity:.35;cursor:not-allowed}
body.onboarding-open{overflow:hidden}
body.dark-mode .onboarding-dialog{background:#18231d;color:#f2f5f0;border-color:#34483b}
body.dark-mode .onboarding-dialog h2{color:#f2f5f0}
body.dark-mode .onboarding-content{background:#223329;color:#e4eee6}
body.dark-mode .onboarding-progress{background:#34483b}
@media(max-width:520px){.onboarding-dialog{padding:24px 20px;border-radius:20px}.onboarding-actions{align-items:stretch}.onboarding-actions button{padding:10px 12px}}

/* PANVIYO Build 077 — make the Take a Tour action unmistakable in the Settings hero */
#settingsPage .settings-hero .settings-tour-button {
  position:relative;
  z-index:2;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:48px;
  margin-top:18px;
  padding:12px 21px;
  border:2px solid rgba(255,255,255,.92);
  border-radius:14px;
  background:#fff;
  color:#174c36;
  font-size:15px;
  font-weight:850;
  letter-spacing:.01em;
  box-shadow:0 7px 18px rgba(4,28,17,.24);
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease;
}
#settingsPage .settings-hero .settings-tour-button span {
  display:inline-grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:8px;
  background:#e7f3eb;
  color:#174c36;
  font-size:17px;
}
#settingsPage .settings-hero .settings-tour-button:hover {
  transform:translateY(-2px);
  background:#f0f8f2;
  box-shadow:0 10px 22px rgba(4,28,17,.3);
}
#settingsPage .settings-hero .settings-tour-button:focus-visible {
  outline:3px solid #f6d36b;
  outline-offset:4px;
}
@media(max-width:640px) {
  #settingsPage .settings-hero .settings-tour-button {
    min-height:46px;
    padding:11px 17px;
    font-size:14px;
  }
}


/* ==========================================================
   DATA & BACKUP SETTINGS
========================================================== */
.panviyo-backup-card .settings-card-heading { margin-bottom: 18px; }
.panviyo-backup-summary {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    background: var(--input-background);
    margin-bottom: 16px;
}
.panviyo-backup-status-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--surface);
    font-size: 21px;
}
.panviyo-backup-summary strong { display: block; color: var(--text-primary); }
.panviyo-backup-summary p,
.panviyo-backup-item p {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}
.panviyo-backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.panviyo-backup-history-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 24px 0 10px;
}
.panviyo-backup-history-heading h4 { margin: 0; color: var(--text-primary); }
.panviyo-backup-history-heading span,
.panviyo-backup-item small,
.panviyo-backup-footnote {
    color: var(--text-secondary);
    font-size: 12px;
}
.panviyo-backup-history {
    max-height: 430px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 5px;
    scrollbar-gutter: stable;
}
.panviyo-backup-history::-webkit-scrollbar { width: 7px; }
.panviyo-backup-history::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 99px;
}
.panviyo-backup-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}
.panviyo-backup-item:last-child { border-bottom: 0; }
.panviyo-backup-item-main { min-width: 0; }
.panviyo-backup-item strong { color: var(--text-primary); }
.panviyo-backup-item-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.panviyo-backup-type {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .02em;
    text-transform: uppercase;
    background: var(--input-background);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.panviyo-backup-type.is-manual { color: var(--primary); }
.panviyo-backup-type.is-daily { color: #18794e; }
.panviyo-backup-type.is-safety { color: #8a5a12; }
.panviyo-backup-item small { display: block; margin-top: 5px; }
.panviyo-restore-button { flex: 0 0 auto; }
.panviyo-backup-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0 2px;
}
.panviyo-backup-pagination span {
    color: var(--text-secondary);
    font-size: 12px;
}
.panviyo-backup-pagination button:disabled { opacity: .45; cursor: not-allowed; }
.panviyo-backup-empty {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 12px 0;
}
.panviyo-backup-restore-warning {
    margin-top: 18px;
    padding: 13px 15px;
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    background: var(--input-background);
}
.panviyo-backup-restore-warning strong { color: var(--text-primary); }
.panviyo-backup-restore-warning p {
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}
.panviyo-backup-message {
    display: none;
    margin: 10px 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    background: var(--input-background);
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.panviyo-backup-message:not(:empty) { display: block; }
.panviyo-backup-message[data-kind="success"] {
    color: #18794e;
    border-color: rgba(24, 121, 78, .25);
    background: rgba(24, 121, 78, .07);
}
.panviyo-backup-message[data-kind="error"] {
    color: #b42318;
    border-color: rgba(180, 35, 24, .25);
    background: rgba(180, 35, 24, .06);
}
.panviyo-backup-message[data-kind="info"] { color: var(--text-secondary); }
.panviyo-backup-footnote { margin: 8px 0 0; line-height: 1.5; }
/* Restore confirmation dialog */
.panviyo-restore-dialog {
    width: min(92vw, 480px);
    max-width: 480px;
    max-height: min(88vh, 760px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 18px;
    color: var(--text-primary);
    background: var(--surface);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}
.panviyo-restore-dialog::backdrop { background: rgba(12, 20, 16, .58); backdrop-filter: blur(3px); }
.panviyo-restore-dialog-content { padding: 24px; }
.panviyo-restore-dialog-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--input-background);
    color: var(--primary);
    font-size: 24px;
}
.panviyo-restore-dialog h3 { margin: 14px 0 7px; color: var(--text-primary); }
.panviyo-restore-dialog-intro,
.panviyo-restore-selected span,
.panviyo-restore-dialog-warning p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}
.panviyo-restore-selected {
    display: grid;
    gap: 4px;
    margin: 14px 0;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--input-background);
}
.panviyo-restore-selected strong { color: var(--text-primary); }
.panviyo-restore-dialog-warning {
    margin: 14px 0;
    padding: 12px 13px;
    border-left: 3px solid #c28a27;
    border-radius: 8px;
    background: rgba(194, 138, 39, .08);
}
.panviyo-restore-dialog-warning strong { color: var(--text-primary); font-size: 13px; }
.panviyo-restore-dialog-warning p { margin: 5px 0 0; }
.panviyo-restore-confirm-label {
    display: block;
    margin: 16px 0 7px;
    color: var(--text-primary);
    font-size: 12px;
}
.panviyo-restore-dialog input {
    box-sizing: border-box;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text-primary);
    background: var(--input-background);
}
.panviyo-restore-dialog-message { min-height: 1em; margin: 7px 0 0; color: #b42318; font-size: 12px; }
.panviyo-restore-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 15px;
}
.panviyo-restore-dialog-actions button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 520px) {
    .panviyo-backup-actions { flex-direction: column; }
    .panviyo-backup-actions button { width: 100%; }
    .panviyo-backup-item { align-items: flex-start; }
    .panviyo-restore-button { padding: 9px 11px; }
}


/* PANVIYO ADVANCED EXPIRY INTELLIGENCE — BUILD 084 */
.expiry-intelligence-panel{margin:0 0 24px;padding:22px;border:1px solid var(--border);border-radius:20px;background:var(--surface);box-shadow:0 6px 22px var(--shadow)}
.expiry-intelligence-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:17px}.expiry-intelligence-eyebrow{font-size:9px;font-weight:900;letter-spacing:.13em;color:var(--accent,#286b49)}.expiry-intelligence-heading h3{display:flex;align-items:center;flex-wrap:wrap;gap:9px;margin:5px 0;color:var(--text-primary);font-size:19px;font-weight:850}.expiry-intelligence-heading p{margin:0;color:var(--text-secondary);font-size:12px}.expiry-premium-tag{padding:4px 8px;border-radius:999px;background:#f5eddc;color:#8b641d;font-size:9px;letter-spacing:.07em}.expiry-intelligence-mark{display:grid;place-items:center;flex:0 0 43px;width:43px;height:43px;border-radius:14px;background:var(--surface-alt);color:var(--accent,#286b49);font-size:23px}.expiry-intelligence-grid{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:14px}.expiry-schedule-card,.expiry-calendar-card{min-width:0;padding:17px;border:1px solid var(--border);border-radius:15px;background:var(--surface-alt)}.expiry-card-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;color:var(--text-primary);font-size:13px}.expiry-card-heading span{color:var(--text-secondary);font-size:10px;font-weight:700}.expiry-schedule-card>p{margin:7px 0 13px;color:var(--text-secondary);font-size:11px}.expiry-interval-options{display:flex;flex-wrap:wrap;gap:8px}.expiry-interval-options label{position:relative;cursor:pointer}.expiry-interval-options input{position:absolute;opacity:0;pointer-events:none}.expiry-interval-options label span{display:block;padding:8px 11px;border:1px solid var(--border-strong);border-radius:10px;background:var(--surface);color:var(--text-secondary);font-size:11px;font-weight:750}.expiry-interval-options input:checked+span{border-color:#286b49;background:#eaf3eb;color:#20583b;box-shadow:inset 0 0 0 1px #286b49}.expiry-interval-options input:focus-visible+span{outline:2px solid var(--accent,#286b49);outline-offset:2px}.expiry-schedule-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:14px}.expiry-schedule-actions .primary-button{padding:9px 13px;font-size:11px}.expiry-schedule-actions>span{color:var(--text-secondary);font-size:10px}.expiry-feature-note{display:block;margin-top:12px;color:var(--text-secondary);font-size:10px;line-height:1.5}.expiry-calendar-toolbar{display:flex;justify-content:space-between;align-items:center;margin:11px 0 9px}.expiry-calendar-toolbar strong{color:var(--text-primary);font-size:12px}.expiry-calendar-toolbar button{width:29px;height:29px;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--text-primary);font-size:20px;line-height:1;cursor:pointer}.expiry-calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.expiry-calendar-weekdays span{text-align:center;padding:5px 0;color:var(--text-secondary);font-size:9px;font-weight:800}.expiry-calendar-day,.expiry-calendar-empty{position:relative;display:grid;place-items:center;min-height:31px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--text-primary);font-size:10px}.expiry-calendar-day{cursor:pointer}.expiry-calendar-day:hover{background:var(--surface);border-color:var(--border-strong)}.expiry-calendar-day.has-expiry{background:#eaf3eb;color:#20583b;font-weight:850}.expiry-calendar-day.has-expired{background:#fae9e7;color:#a83d37}.expiry-calendar-day.is-today{outline:1px solid var(--accent,#286b49);outline-offset:-1px}.expiry-calendar-day.is-selected{box-shadow:inset 0 0 0 2px var(--accent,#286b49)}.expiry-calendar-count{position:absolute;right:2px;top:1px;display:grid;place-items:center;min-width:12px;height:12px;padding:0 2px;border-radius:999px;background:#286b49;color:white;font-size:8px}.expiry-calendar-legend{display:flex;gap:13px;margin-top:10px;color:var(--text-secondary);font-size:9px}.expiry-calendar-legend span{display:flex;align-items:center;gap:5px}.calendar-dot{width:7px;height:7px;border-radius:50%;background:#8dbb91}.calendar-dot-expired{background:#c34c45}.expiry-calendar-selection{min-height:35px;margin-top:10px;padding-top:9px;border-top:1px solid var(--border);color:var(--text-secondary);font-size:10px}.expiry-calendar-selection ul{display:grid;gap:4px;margin:6px 0 0;padding-left:17px}.expiry-calendar-selection li{color:var(--text-primary)}.expiry-calendar-selection li span{margin-left:5px;color:var(--text-secondary);font-size:9px}.expiry-priority-pill{padding:4px 8px;border-radius:999px;background:#eef1f2;color:#58656a;font-size:9px;font-weight:850;white-space:nowrap}.priority-critical{background:#fae9e7;color:#a83d37}.priority-high{background:#fff0e7;color:#b95a2b}.priority-medium{background:#fbf2df;color:#946719}.priority-low{background:#eaf3eb;color:#356b43}body.dark-mode .expiry-interval-options input:checked+span,body.dark-mode .expiry-calendar-day.has-expiry{background:#203e2d;color:#c6e8ce}body.dark-mode .expiry-calendar-day.has-expired{background:#482b2a;color:#f1b7b2}body.dark-mode .expiry-premium-tag{background:#44391f;color:#f0d79a}
@media(max-width:760px){.expiry-intelligence-panel{padding:16px}.expiry-intelligence-grid{grid-template-columns:1fr}.expiry-schedule-card,.expiry-calendar-card{padding:14px}}


/* ==========================================================
   PANVIYO ADMIN DASHBOARD
========================================================== */
.admin-page { padding: 8px 0 28px; margin-top: 0; }
.admin-page[hidden], #navAdmin[hidden] { display: none !important; }
.admin-page-heading, .admin-section-heading {
    display:flex; align-items:center; justify-content:space-between;
    gap:16px; margin: 8px 0 22px;
}
.admin-page-heading h2 { font-size:clamp(26px,4vw,34px); margin-top:4px; }
.admin-page-heading p { color:var(--text-secondary); margin-top:5px; }
.admin-eyebrow { color:var(--primary); font-size:11px; font-weight:800; letter-spacing:1.25px; }
.admin-section-heading { margin-top:30px; margin-bottom:14px; }
.admin-section-heading h3 { font-size:19px; margin-top:3px; }
.admin-updated { color:var(--text-muted); font-size:12px; }
.admin-refresh-button {
    border:1px solid var(--border); border-radius:10px; padding:10px 15px;
    background:var(--surface); color:var(--text-primary); font-weight:700;
}
.admin-refresh-button:disabled { opacity:.55; cursor:wait; }
.admin-status {
    padding:13px 15px; border-radius:12px; margin:12px 0 20px;
    background:var(--surface-alt); border:1px solid var(--border);
    color:var(--text-secondary); font-size:14px;
}
.admin-status[hidden] { display:none; }
.admin-status.success { background:var(--success-light); border-color:var(--primary-light); color:var(--primary-dark); }
.admin-status.error { background:var(--danger-light); border-color:var(--danger); color:var(--danger); }
.admin-status.loading { background:var(--info-light); border-color:var(--info); color:var(--info); }
.admin-metric-grid {
    display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px;
}
.admin-metric-grid-three { grid-template-columns:repeat(3,minmax(0,1fr)); }
.admin-metric-card {
    min-width:0; display:flex; flex-direction:column; align-items:flex-start;
    gap:7px; padding:18px; border:1px solid var(--border);
    border-radius:15px; background:var(--surface);
    box-shadow:0 4px 16px var(--shadow);
}
.admin-metric-card.compact { padding:16px 18px; }
.admin-metric-icon { font-size:21px; }
.admin-metric-label { color:var(--text-muted); font-size:10px; font-weight:800; letter-spacing:.8px; }
.admin-metric-card strong, .admin-backup-panel strong {
    color:var(--text-primary); font-size:clamp(23px,3vw,31px); line-height:1.2;
    overflow-wrap:anywhere;
}
.admin-metric-card small { color:var(--text-secondary); font-size:12px; line-height:1.4; }
.admin-backup-panel {
    display:grid; grid-template-columns:repeat(4,minmax(0,1fr));
    gap:18px; padding:20px; border:1px solid var(--border);
    border-radius:15px; background:var(--surface);
}
.admin-backup-panel > div { display:flex; flex-direction:column; gap:7px; }
.admin-backup-panel strong { font-size:23px; }
.admin-backup-panel .admin-latest-backup { grid-column:1/-1; padding-top:14px; border-top:1px solid var(--border); }
.admin-backup-panel .admin-latest-backup strong { font-size:16px; }
.admin-data-note { margin-top:16px; color:var(--text-muted); font-size:12px; line-height:1.5; }
@media (max-width:760px) {
    .admin-metric-grid, .admin-metric-grid-three { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .admin-backup-panel { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .admin-page-heading { align-items:flex-start; }
    .admin-updated { display:none; }
}
@media (max-width:420px) {
    .admin-metric-card { padding:14px; }
    .admin-metric-card strong { font-size:24px; }
    .admin-page-heading { flex-direction:column; }
}


/* PANVIYO ADMIN/UI FIX — remove legacy floating add control */
#floatingAddButton { display: none !important; }
.admin-page { margin-block-start: 0 !important; }


/* ==========================================================
   ADMIN DASHBOARD — DARK MODE CONTRAST + STATUS LEGIBILITY
========================================================== */
body.dark-mode .admin-eyebrow {
    color: #8FD3A8 !important;
}

body.dark-mode .admin-status {
    color: #D7E5DB;
    background: #202B24;
    border-color: #405347;
}

body.dark-mode .admin-status.success {
    color: #D9F5E1 !important;
    background: #173B29;
    border-color: #43865D;
}

body.dark-mode .admin-status.error {
    color: #FFDAD6 !important;
    background: #452522;
    border-color: #A9534B;
}

body.dark-mode .admin-status.loading {
    color: #D7E9FF !important;
    background: #1B3045;
    border-color: #527BA5;
}

body.dark-mode .admin-metric-label,
body.dark-mode .admin-updated,
body.dark-mode .admin-data-note {
    color: #AEBDB2;
}

body.dark-mode .admin-page-heading h2,
body.dark-mode .admin-section-heading h3,
body.dark-mode .admin-metric-card strong,
body.dark-mode .admin-backup-panel strong {
    color: #F1F7F2;
}

body.dark-mode .admin-page-heading p,
body.dark-mode .admin-metric-card small {
    color: #C0CCC3;
}

/* Make the active Admin destination use the same selected state as
   the other navigation destinations. */
.bottom-nav #navAdmin.active {
    background: var(--primary-soft);
    color: var(--primary);
}
body.dark-mode .bottom-nav #navAdmin.active {
    background: #203D2B;
    color: #BDE8C9;
}
body.dark-mode .bottom-nav #navAdmin.active .nav-text,
body.dark-mode .bottom-nav #navAdmin.active .nav-icon {
    color: #BDE8C9;
}


/* ==========================================================
   ADMIN USER MANAGEMENT — READ-ONLY DIRECTORY
========================================================== */
.admin-users-heading { align-items:flex-start; }
.admin-users-intro { margin-top:5px; color:var(--text-secondary); font-size:13px; }
.admin-users-panel { border:1px solid var(--border); border-radius:16px; background:var(--surface); padding:16px; box-shadow:0 4px 16px var(--shadow); }
.admin-users-toolbar { display:grid; grid-template-columns:minmax(220px,1fr) auto minmax(130px,180px) auto; gap:10px; align-items:end; margin-bottom:12px; }
.admin-users-search-label,.admin-users-filter-label { display:none; }
.admin-users-toolbar input,.admin-users-toolbar select { min-width:0; width:100%; min-height:42px; border:1px solid var(--border); border-radius:10px; padding:9px 12px; background:var(--surface-alt); color:var(--text-primary); font:inherit; }
.admin-users-toolbar input::placeholder { color:var(--text-muted); }
.admin-users-status { min-height:20px; margin:6px 0 10px; color:var(--text-secondary); font-size:12px; }
.admin-users-table-wrap { width:100%; overflow-x:auto; border:1px solid var(--border); border-radius:12px; }
.admin-users-table { width:100%; border-collapse:collapse; min-width:780px; font-size:12px; }
.admin-users-table th { padding:12px 13px; text-align:left; color:var(--text-muted); background:var(--surface-alt); font-size:10px; letter-spacing:.6px; text-transform:uppercase; white-space:nowrap; }
.admin-users-table td { padding:13px; border-top:1px solid var(--border); color:var(--text-primary); vertical-align:middle; }
.admin-users-table tbody tr:hover { background:var(--surface-alt); }
.admin-user-account { display:flex; flex-direction:column; gap:4px; min-width:180px; }
.admin-user-account strong { font-size:12px; font-weight:700; overflow-wrap:anywhere; }
.admin-user-account small { color:var(--text-muted); font-size:10px; }
.admin-user-pill { display:inline-flex; align-items:center; border-radius:999px; padding:4px 8px; font-size:10px; font-weight:700; white-space:nowrap; background:var(--surface-alt); color:var(--text-secondary); }
.admin-user-pill.good { background:var(--success-light); color:var(--primary-dark); }
.admin-user-pill.warn { background:var(--warning-light); color:var(--warning); }
.admin-user-pill.premium { background:#fff1c9; color:#825500; }
.admin-user-pill.disabled { background:var(--danger-light); color:var(--danger); }
.admin-users-empty { text-align:center; padding:24px !important; color:var(--text-secondary) !important; }
.admin-users-pagination { display:flex; justify-content:space-between; align-items:center; gap:12px; padding-top:13px; color:var(--text-secondary); font-size:12px; }
.admin-users-pagination > div { display:flex; gap:8px; }
.admin-page-button { border:1px solid var(--border); border-radius:9px; padding:8px 11px; background:var(--surface); color:var(--text-primary); cursor:pointer; }
.admin-page-button:disabled { opacity:.4; cursor:not-allowed; }
body.dark-mode .admin-users-panel { background:var(--surface); }
body.dark-mode .admin-users-table th { color:#b6c5ba; background:#202a23; }
body.dark-mode .admin-users-table td { color:#edf5ef; }
body.dark-mode .admin-user-account small,body.dark-mode .admin-users-status,body.dark-mode .admin-users-pagination { color:#b7c5bb; }
body.dark-mode .admin-users-toolbar input,body.dark-mode .admin-users-toolbar select,body.dark-mode .admin-page-button { background:#18221c; color:#edf5ef; border-color:#34463a; }
body.dark-mode .admin-user-pill.good { background:#183d27; color:#a8e2b7; }
body.dark-mode .admin-user-pill.warn { background:#473719; color:#f5d28a; }
body.dark-mode .admin-user-pill.premium { background:#493b18; color:#ffdf8b; }
body.dark-mode .admin-user-pill.disabled { background:#482323; color:#ffb3b3; }
@media(max-width:680px) {
  .admin-users-panel { padding:11px; }
  .admin-users-toolbar { grid-template-columns:1fr 1fr; }
  .admin-users-toolbar input { grid-column:1/-1; }
  .admin-users-pagination { align-items:flex-start; flex-direction:column; }
}


/* ==========================================================
   ADMIN USER ACCOUNT DETAILS — READ-ONLY PROFILE
========================================================== */
.admin-user-details { margin-top:16px; padding:18px; border:1px solid var(--border); border-radius:14px; background:var(--surface-alt); }
.admin-user-details[hidden] { display:none !important; }
.admin-user-details-header { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin-bottom:12px; }
.admin-user-details-header h4 { margin:5px 0 3px; color:var(--text-primary); font-size:18px; }
.admin-user-details-header p { margin:0; color:var(--text-secondary); font-size:12px; overflow-wrap:anywhere; }
.admin-user-details-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:12px 0 18px; }
.admin-user-detail-card { min-width:0; padding:13px; border:1px solid var(--border); border-radius:11px; background:var(--surface); }
.admin-user-detail-card span { display:block; color:var(--text-muted); font-size:10px; font-weight:700; letter-spacing:.45px; text-transform:uppercase; }
.admin-user-detail-card strong { display:block; margin-top:6px; color:var(--text-primary); font-size:16px; overflow-wrap:anywhere; }
.admin-user-detail-section { margin-top:16px; }
.admin-user-detail-section h5 { margin:0 0 9px; color:var(--text-primary); font-size:14px; }
.admin-user-detail-table-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:10px; background:var(--surface); }
.admin-user-detail-table { width:100%; min-width:560px; border-collapse:collapse; font-size:11px; }
.admin-user-detail-table th,.admin-user-detail-table td { padding:9px 11px; border-bottom:1px solid var(--border); text-align:left; color:var(--text-primary); vertical-align:top; }
.admin-user-detail-table th { color:var(--text-muted); background:var(--surface-alt); font-size:9px; letter-spacing:.4px; text-transform:uppercase; }
.admin-user-detail-table tr:last-child td { border-bottom:0; }
.admin-user-detail-empty { padding:14px; color:var(--text-secondary); font-size:12px; }
.admin-user-details-button { border:1px solid var(--border); border-radius:8px; padding:6px 10px; background:var(--surface); color:var(--text-primary); font:inherit; font-size:11px; font-weight:700; cursor:pointer; }
.admin-user-details-button:hover { border-color:var(--primary); }
body.dark-mode .admin-user-details { background:#18221c; border-color:#34463a; }
body.dark-mode .admin-user-detail-card,body.dark-mode .admin-user-detail-table-wrap { background:#111a14; border-color:#34463a; }
body.dark-mode .admin-user-detail-table th { background:#202a23; color:#b6c5ba; }
body.dark-mode .admin-user-detail-table td,body.dark-mode .admin-user-detail-card strong,body.dark-mode .admin-user-details-header h4 { color:#edf5ef; }
body.dark-mode .admin-user-detail-card span,body.dark-mode .admin-user-details-header p,body.dark-mode .admin-user-detail-empty { color:#b7c5bb; }
body.dark-mode .admin-user-details-button { background:#202a23; border-color:#405447; color:#edf5ef; }
@media(max-width:760px) { .admin-user-details-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:480px) { .admin-user-details { padding:12px; } .admin-user-details-header { flex-direction:column; } .admin-user-details-grid { grid-template-columns:1fr 1fr; } }


/* ==========================================================
   ADMIN SUBSCRIPTION MANAGEMENT — BUILD 087
========================================================== */
.admin-subscriptions-panel { margin:18px 0 22px; padding:16px; border:1px solid var(--border); border-radius:16px; background:var(--surface); box-shadow:0 4px 16px var(--shadow); }
.admin-subscriptions-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.admin-subscriptions-heading p { margin:5px 0 0; color:var(--text-secondary); font-size:12px; }
.admin-subscription-metrics { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; margin:12px 0; }
.admin-subscription-finance-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:12px 0 18px; }
.admin-subscription-section { margin-top:18px; }
.admin-subscription-section h4 { margin:0 0 10px; color:var(--text-primary); font-size:14px; }
.admin-subscription-toolbar { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.admin-subscription-toolbar label { color:var(--text-secondary); font-size:12px; }
.admin-subscription-toolbar select { min-height:36px; border:1px solid var(--border); border-radius:8px; padding:6px 10px; background:var(--surface-alt); color:var(--text-primary); }
.admin-subscription-table { min-width:850px; }
.admin-subscription-table td { font-size:11px; }
body.dark-mode .admin-subscriptions-panel { background:var(--surface); border-color:#34463a; }
body.dark-mode .admin-subscriptions-heading p,body.dark-mode .admin-subscription-toolbar label { color:#b7c5bb; }
body.dark-mode .admin-subscription-toolbar select { background:#18221c; border-color:#34463a; color:#edf5ef; }
@media(max-width:900px) { .admin-subscription-metrics { grid-template-columns:repeat(3,minmax(0,1fr)); } .admin-subscription-finance-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:520px) { .admin-subscriptions-panel { padding:11px; } .admin-subscription-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .admin-subscription-finance-grid { grid-template-columns:1fr 1fr; } .admin-subscriptions-heading { flex-direction:column; } .admin-subscription-toolbar { flex-wrap:wrap; } }


/* ==========================================================
   ADMIN SYSTEM HEALTH — BUILD 088
========================================================== */
.admin-system-health-panel { margin:18px 0 22px; padding:16px; border:1px solid var(--border); border-radius:16px; background:var(--surface); box-shadow:0 4px 16px var(--shadow); }
.admin-system-health-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.admin-system-health-heading p { margin:5px 0 0; color:var(--text-secondary); font-size:12px; }
.admin-system-health-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:12px; }
.admin-system-health-card { min-width:0; padding:14px; border:1px solid var(--border); border-radius:12px; background:var(--surface-alt); }
.admin-system-health-card-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.admin-system-health-card p { margin:10px 0 0; color:var(--text-secondary); font-size:12px; line-height:1.55; }
.admin-health-pill { display:inline-flex; align-items:center; border-radius:999px; padding:4px 8px; font-size:10px; font-weight:700; white-space:nowrap; background:#e9eef0; color:#45545b; }
.admin-health-pill.healthy { background:#e5f4eb; color:#17663a; }
.admin-health-pill.warning { background:#fff2d9; color:#865400; }
.admin-health-pill.error { background:#fde8e7; color:#a32020; }
.admin-health-pill.info { background:#e8eefb; color:#31558c; }
.admin-system-health-note { margin-top:12px; color:var(--text-secondary); font-size:11px; line-height:1.5; }
.admin-system-health-panel .admin-updated { margin-top:8px; }
body.dark-mode .admin-system-health-panel { background:var(--surface); border-color:#34463a; }
body.dark-mode .admin-system-health-heading p, body.dark-mode .admin-system-health-card p, body.dark-mode .admin-system-health-note { color:#b7c5bb; }
body.dark-mode .admin-system-health-card { background:#18221c; border-color:#34463a; }
body.dark-mode .admin-health-pill.healthy { background:#173b27; color:#a6e5bb; }
body.dark-mode .admin-health-pill.warning { background:#493718; color:#ffdb91; }
body.dark-mode .admin-health-pill.error { background:#4b2020; color:#ffb5b5; }
body.dark-mode .admin-health-pill.info { background:#1d3151; color:#b8d0ff; }
@media(max-width:900px) { .admin-system-health-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:520px) { .admin-system-health-panel { padding:11px; } .admin-system-health-grid { grid-template-columns:1fr; } .admin-system-health-heading { flex-direction:column; } }


/* ==========================================================
   BUILD 090 — BUSINESS ANALYTICS
========================================================== */
.admin-analytics-panel {
    margin-top: 28px;
    padding: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-large);
    box-shadow: 0 5px 18px var(--shadow);
}
.admin-analytics-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.admin-analytics-heading p,
.admin-analytics-chart-card > p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 5px;
}
.admin-analytics-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}
.admin-analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.admin-analytics-chart-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-medium);
    background: var(--surface-alt);
}
.admin-analytics-chart-card h4 {
    font-size: 16px;
    color: var(--text-primary);
}
.admin-analytics-bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    min-height: 190px;
    padding: 18px 4px 4px;
    overflow-x: auto;
}
.admin-analytics-bar {
    flex: 1 0 24px;
    min-width: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    height: 160px;
}
.admin-analytics-bar-stack {
    width: min(100%, 38px);
    min-height: 2px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    overflow: hidden;
    border-radius: 6px 6px 2px 2px;
    background: var(--border);
}
.admin-analytics-bar-fill { width: 100%; min-height: 0; }
.admin-analytics-bar-fill.registrations { background: var(--primary); }
.admin-analytics-bar-fill.sent { background: #269b65; }
.admin-analytics-bar-fill.failed { background: #d84b4b; }
.admin-analytics-bar-fill.pending { background: #e2a52d; }
.admin-analytics-bar-fill.other { background: #82909a; }
.admin-analytics-bar-value {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}
.admin-analytics-bar-label {
    color: var(--text-muted);
    font-size: 10px;
    white-space: nowrap;
}
.admin-analytics-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 11px;
}
.admin-analytics-legend span { display: inline-flex; align-items: center; gap: 5px; }
.admin-analytics-legend i { width: 8px; height: 8px; display: inline-block; border-radius: 2px; background: var(--text-muted); }
.admin-analytics-legend i.sent { background: #269b65; }
.admin-analytics-legend i.failed { background: #d84b4b; }
.admin-analytics-legend i.pending { background: #e2a52d; }
.admin-analytics-legend i.other { background: #82909a; }
@media (max-width: 760px) {
    .admin-analytics-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-analytics-grid { grid-template-columns: 1fr; }
    .admin-analytics-panel { padding: 15px; }
}
@media (max-width: 420px) {
    .admin-analytics-heading { flex-direction: column; }
    .admin-analytics-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
}


/* ==========================================================
   BUILD 091.5 — MEAL LAUNCH BUTTON VISUAL CONSISTENCY
   Keep both dashboard quick actions on the shared secondary style.
========================================================== */
.meal-assistant-page { max-width: 1120px; margin-inline: auto; padding-bottom: 34px; }
.meal-assistant-hero { position:relative; overflow:hidden; display:flex; align-items:center; justify-content:space-between; gap:24px; min-height:220px; padding:28px 32px; margin:8px 0 22px; border-radius:24px; color:#fff; background:linear-gradient(120deg,#174f3c 0%,#237a57 58%,#76a879 100%); }
.meal-back-button { position:absolute; top:16px; left:22px; border:0; background:rgba(255,255,255,.14); color:#fff; border-radius:999px; padding:8px 13px; cursor:pointer; }
.meal-hero-content { max-width:650px; padding-top:22px; position:relative; z-index:1; }
.meal-eyebrow { display:block; color:#5d9b79; font-size:11px; font-weight:800; letter-spacing:.13em; margin-bottom:7px; }
.meal-assistant-hero .meal-eyebrow { color:#d1ead8; }
.meal-assistant-hero h2 { color:#fff; font-size:clamp(28px,4vw,42px); margin:0 0 8px; }
.meal-assistant-hero h2 em { color:#d5efbd; font-style:normal; }
.meal-assistant-hero p { max-width:580px; margin:0; color:rgba(255,255,255,.88); line-height:1.6; }
.meal-hero-art { font-size:clamp(74px,11vw,120px); filter:drop-shadow(0 14px 16px rgba(0,0,0,.16)); padding-right:25px; }
.meal-pantry-summary { display:grid; grid-template-columns:repeat(2,minmax(0,150px)) 1fr; gap:12px; align-items:center; padding:16px 20px; border:1px solid var(--border-color,#e5e9e5); border-radius:18px; background:var(--card-bg,#fff); margin-bottom:18px; }
.meal-stat { display:flex; flex-direction:column; gap:2px; }.meal-stat strong { font-size:25px; color:var(--primary,#237a57); }.meal-stat span,.meal-pantry-note { color:var(--text-secondary,#68736d); font-size:12px; }.meal-stat-priority strong { color:#bd7625; }
.meal-controls-panel { padding:22px; border:1px solid var(--border-color,#e5e9e5); border-radius:20px; background:var(--card-bg,#fff); box-shadow:0 8px 26px rgba(28,60,43,.04); }
.meal-section-heading,.meal-results-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }.meal-section-heading h3,.meal-results-heading h3 { margin:0; font-size:21px; }.meal-sparkle { color:#d39a39; font-size:28px; }
.meal-preference-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; }.meal-preference-grid label { display:flex; flex-direction:column; gap:7px; color:var(--text-secondary,#59645e); font-size:12px; font-weight:700; }.meal-preference-grid select,.meal-preference-grid input { width:100%; min-height:44px; padding:10px 12px; border:1px solid var(--border-color,#dfe6e0); border-radius:11px; color:var(--text-color,#24332b); background:var(--input-bg,#fff); font:inherit; }.meal-avoid-field { grid-column:span 2; }
.meal-generate-button { display:block; width:100%; margin-top:18px; min-height:50px; border:0; border-radius:13px; background:var(--primary,#237a57); color:#fff; font-weight:800; cursor:pointer; }.meal-generate-button:disabled { opacity:.65; cursor:wait; }.meal-assistant-status { min-height:20px; text-align:center; color:var(--text-secondary,#68736d); font-size:13px; margin:12px 0 5px; }.meal-usage-note,.meal-disclaimer { text-align:center; color:var(--text-secondary,#7b857f); font-size:11px; line-height:1.55; }.meal-results-heading { margin:28px 2px 14px; }.meal-results { display:grid; grid-template-columns:1fr; gap:16px; }.meal-empty { text-align:center; padding:36px 18px; border:1px dashed var(--border-color,#dce5dd); border-radius:18px; color:var(--text-secondary,#68736d); background:var(--card-bg,#fff); }.meal-empty>span { font-size:38px; }.meal-empty h3 { margin:8px 0 4px; color:var(--text-color,#24332b); }.meal-recipe-card { border:1px solid var(--border-color,#e2e9e3); border-radius:18px; padding:20px; background:var(--card-bg,#fff); box-shadow:0 7px 22px rgba(28,60,43,.035); }.meal-recipe-top { display:flex; flex-wrap:wrap; gap:12px; align-items:center; color:var(--text-secondary,#6d7871); font-size:12px; }.meal-type-pill { padding:5px 9px; border-radius:999px; color:#1e6b4a; background:#e8f4ec; font-weight:800; text-transform:capitalize; }.meal-recipe-card h3 { margin:10px 0 5px; font-size:22px; }.meal-description { margin:0 0 12px; color:var(--text-secondary,#68736d); line-height:1.5; }.meal-priority-note { margin:10px 0; padding:10px 12px; border-radius:10px; color:#82551d; background:#fff6e7; font-size:13px; }.meal-recipe-columns { display:grid; grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr); gap:24px; margin-top:14px; }.meal-recipe-columns h4 { margin:0 0 8px; }.meal-recipe-columns ul { padding-left:20px; line-height:1.7; }.meal-steps { list-style:none; padding:0; margin:0; display:grid; gap:10px; }.meal-steps li { display:flex; gap:10px; line-height:1.55; }.meal-steps li span { flex:0 0 24px; height:24px; display:grid; place-items:center; border-radius:50%; color:#216c4b; background:#e7f2e9; font-size:12px; font-weight:800; }.meal-missing { margin-top:14px; padding:12px; border-radius:12px; background:var(--surface-secondary,#f5f7f4); }.meal-missing h5 { margin:0 0 5px; }.meal-missing ul { margin:4px 0 10px; }.meal-secondary-button { border:1px solid rgba(35,122,87,.28); border-radius:9px; padding:9px 11px; color:var(--primary,#237a57); background:transparent; font-weight:700; cursor:pointer; }.meal-all-available { color:#237a57; font-size:13px; font-weight:700; }.meal-disclaimer { margin-top:18px; }
@media(max-width:700px) { .meal-assistant-hero { min-height:190px; padding:26px 20px; }.meal-hero-art { font-size:68px; padding-right:0; }.meal-pantry-summary { grid-template-columns:1fr 1fr; }.meal-pantry-note { grid-column:1/-1; }.meal-preference-grid { grid-template-columns:1fr 1fr; }.meal-avoid-field { grid-column:1/-1; }.meal-recipe-columns { grid-template-columns:1fr; gap:14px; } }
@media(max-width:420px) { .meal-assistant-hero { display:block; }.meal-hero-art { position:absolute; right:12px; bottom:8px; opacity:.35; }.meal-preference-grid { grid-template-columns:1fr; } }


/* ==========================================================
   BUILD 091.2 — RECIPE TO SHOPPING LIST INTEGRATION
========================================================== */
.meal-missing-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.meal-missing-heading h5 { margin: 0; }
.meal-missing-heading > span {
    color: var(--text-secondary, #68736d);
    font-size: 11px;
    font-weight: 700;
}
.meal-missing-options { display: grid; gap: 7px; margin: 8px 0 12px; }
.meal-missing-option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border: 1px solid var(--border-color, #e2e9e3);
    border-radius: 9px;
    background: var(--card-bg, #fff);
    cursor: pointer;
    font-size: 13px;
}
.meal-missing-option input {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    accent-color: var(--primary, #237a57);
}
.meal-missing-option.is-already-added { opacity: .72; cursor: default; }
.meal-missing-name { flex: 1; }
.meal-already-label {
    color: var(--primary, #237a57);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}
.meal-secondary-button:disabled { opacity: .55; cursor: not-allowed; }
.meal-shopping-feedback {
    min-height: 16px;
    margin: 7px 0 0;
    color: var(--primary, #237a57);
    font-size: 12px;
    font-weight: 700;
}
