/* =================================
   EVSEPETI - MODERN LIGHT DESIGN
================================= */

:root {
    --primary: #193747;
    --primary-dark: #142d3b;
    --green: #269b69;
    --green-light: #e9f6ef;
    --orange: #f2a65a;

    --background: #f7f9fa;
    --surface: #ffffff;
    --text: #263640;
    --muted: #84919a;
    --border: #e9eef0;

    --radius: 18px;
    --shadow: 0 5px 22px rgba(27, 52, 66, .045);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, select {
    font: inherit;
}

button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(38, 155, 105, .2);
    outline-offset: 2px;
}

.app {
    max-width: 1180px;
    min-height: 100vh;
    margin: auto;
}

/* HEADER */

.topbar {
    height: 76px;
    padding: 0 34px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    box-shadow: 0 3px 12px rgba(20, 45, 59, .08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-size: 22px;
    font-weight: 750;
    letter-spacing: -.5px;
    cursor: pointer;
}

.brand-icon {
    font-size: 27px;
}

.profile-button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: white;
    font-size: 19px;
}

/* MAIN CONTENT */

.content {
    padding: 36px 34px 60px;
}

.page {
    display: none;
    animation: pageEnter .22s ease;
}

.page.active {
    display: block;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* WELCOME */

.welcome {
    position: relative;
    overflow: hidden;
    background: linear-gradient(120deg, #193747, #244b5c);
    color: white;
    padding: 42px;
    border-radius: 23px;
    margin-bottom: 25px;
}

.welcome::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 45px solid rgba(255,255,255,.035);
    right: -65px;
    top: -105px;
}

.eyebrow {
    color: #b8d4dc;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 1.8px;
}

.welcome h1 {
    position: relative;
    z-index: 1;
    font-size: 34px;
    letter-spacing: -1px;
    margin: 17px 0 9px;
}

.welcome p {
    position: relative;
    z-index: 1;
    color: #d0dfe5;
    font-size: 15px;
    margin: 0;
    line-height: 1.6;
}

/* STATISTICS */

.stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 38px;
}

.stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow);
    transition: transform .2s ease, box-shadow .2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 25px rgba(27,52,66,.07);
}

.stat-icon {
    font-size: 23px;
    margin-bottom: 3px;
}

.stat-card strong {
    font-size: 30px;
    font-weight: 750;
    color: var(--primary);
    letter-spacing: -1px;
}

.stat-card small {
    color: var(--muted);
    font-size: 13px;
}

/* HEADINGS */

h2 {
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -.35px;
    margin: 0 0 17px;
}

/* HOME MENU */

.menu-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 17px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 17px;
    padding: 19px;
    margin-bottom: 13px;
    text-align: left;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform .2s ease, border-color .2s ease,
                box-shadow .2s ease;
}

.menu-card:hover {
    transform: translateY(-2px);
    border-color: #d5e4dc;
    box-shadow: 0 9px 25px rgba(27,52,66,.07);
}

.menu-card:active {
    transform: scale(.99);
}

.menu-icon {
    width: 51px;
    height: 51px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-size: 22px;
    flex-shrink: 0;
}

.green {
    background: #e8f6ee;
}

.orange {
    background: #fff3e6;
}

.blue {
    background: #edf2fa;
}

.menu-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.menu-info strong {
    font-size: 15px;
    font-weight: 700;
}

.menu-info small {
    color: var(--muted);
    font-size: 12px;
}

.arrow {
    font-size: 26px;
    color: #aab7bd;
    padding: 0 5px;
}

/* PAGE HEADINGS */

.page-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.page-heading h1 {
    font-size: 25px;
    letter-spacing: -.6px;
    margin: 0 0 6px;
}

.page-heading p {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
    line-height: 1.5;
}

.back-button {
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: white;
    color: var(--primary);
    border-radius: 12px;
    width: 43px;
    height: 43px;
    font-size: 23px;
    transition: background .2s;
}

.back-button:hover {
    background: #edf3f4;
}

/* FORMS */

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 23px;
    margin-bottom: 17px;
    box-shadow: var(--shadow);
}

.form-card h3 {
    font-size: 16px;
    margin: 0 0 17px;
    font-weight: 750;
}

.form-card form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-card input,
.form-card select,
.search-input {
    width: 100%;
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid #e2e9eb;
    border-radius: 11px;
    background: #fbfcfc;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .2s, background .2s, box-shadow .2s;
}

.form-card input:focus,
.form-card select:focus,
.search-input:focus {
    border-color: var(--green);
    background: white;
    box-shadow: 0 0 0 3px rgba(38,155,105,.09);
}

.primary-button {
    border: 0;
    border-radius: 11px;
    background: var(--green);
    color: white;
    padding: 13px 20px;
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    transition: background .2s, transform .2s;
}

.primary-button:hover {
    background: #20885c;
}

.primary-button:active {
    transform: scale(.98);
}

/* CATALOG */

.catalog-heading,
.shopping-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 27px 0 15px;
}

.catalog-heading h3 {
    margin: 0;
    font-size: 17px;
}

.catalog-heading span {
    color: var(--muted);
    font-size: 13px;
}

.category-block {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 17px 19px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}

.category-block h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 750;
}

.category-block h3 small {
    float: right;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

/* PRODUCT ROWS */

.product-row {
    min-height: 55px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #f0f3f4;
    padding: 10px 0;
    font-size: 14px;
}

.row-actions {
    display: flex;
    gap: 7px;
}

.row-actions button,
.product-row > button {
    background: #f5f7f8;
    border: 0;
    border-radius: 9px;
    padding: 8px 10px;
    transition: background .2s;
}

.row-actions button:hover,
.product-row > button:hover {
    background: #e9eff0;
}

/* SEARCH */

.search-input {
    margin-bottom: 18px;
    padding: 15px 17px;
    background: white;
}

/* ADD TO SHOPPING */

.add-button {
    border: 0;
    border-radius: 10px;
    padding: 9px 13px;
    background: var(--green-light);
    color: #218653;
    font-size: 12px;
    font-weight: 750;
    white-space: nowrap;
    transition: background .2s;
}

.add-button:hover {
    background: #d9f0e3;
}

.add-button.added {
    background: #edf1f2;
    color: #718088;
}

/* SHOPPING LIST */

.shopping-summary {
    margin-top: 0;
    font-size: 14px;
    font-weight: 700;
}

.text-button {
    background: #fff0ed;
    border: 0;
    border-radius: 9px;
    color: #bd574b;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 700;
}

.shopping-label {
    display: flex;
    align-items: center;
    gap: 13px;
    flex: 1;
    cursor: pointer;
}

.shopping-label input {
    width: 19px;
    height: 19px;
    accent-color: var(--green);
    cursor: pointer;
}

.shopping-label span {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shopping-label small {
    color: var(--muted);
    font-size: 11px;
}

.completed {
    opacity: .55;
}

.completed .shopping-label span {
    text-decoration: line-through;
}

.completed-heading {
    margin-top: 28px;
    font-size: 14px;
    color: var(--muted);
}

/* EMPTY STATES */

.empty-state {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 48px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-top: 15px;
}

.empty-state > span {
    display: inline-flex;
    width: 70px;
    height: 70px;
    border-radius: 22px;
    background: #f1f6f3;
    align-items: center;
    justify-content: center;
    font-size: 33px;
}

.empty-state h3 {
    font-size: 17px;
    margin: 18px 0 8px;
}

.empty-state p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    margin: 0;
}

/* MOBILE NAVIGATION */

.bottom-nav {
    display: none;
}

/* DESKTOP */

@media (min-width: 601px) {
    .content {
        max-width: 850px;
        margin: auto;
    }

    .form-card form {
        flex-direction: row;
        align-items: center;
    }

    .form-card input,
    .form-card select {
        flex: 1;
    }

    .form-card button {
        flex-shrink: 0;
    }
}

/* MOBILE */

@media (max-width: 600px) {
    .topbar {
        height: 62px;
        padding: 0 18px;
    }

    .brand {
        font-size: 19px;
    }

    .content {
        padding: 20px 15px 105px;
    }

    .welcome {
        padding: 27px 23px;
        border-radius: 19px;
        margin-bottom: 18px;
    }

    .welcome h1 {
        font-size: 28px;
    }

    .welcome p {
        font-size: 13px;
    }

    .stats {
        gap: 11px;
        margin-bottom: 30px;
    }

    .stat-card {
        padding: 17px;
        border-radius: 15px;
    }

    .stat-card strong {
        font-size: 26px;
    }

    .menu-card {
        padding: 14px;
        gap: 12px;
        border-radius: 15px;
    }

    .menu-icon {
        width: 45px;
        height: 45px;
        border-radius: 13px;
    }

    .menu-info strong {
        font-size: 13px;
    }

    .menu-info small {
        font-size: 11px;
        line-height: 1.4;
    }

    .page-heading {
        gap: 12px;
        margin-bottom: 22px;
    }

    .page-heading h1 {
        font-size: 21px;
    }

    .page-heading p {
        font-size: 12px;
    }

    .form-card {
        padding: 17px;
        border-radius: 15px;
    }

    .category-block {
        padding: 15px;
        border-radius: 14px;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: calc(70px + env(safe-area-inset-bottom));
        padding: 5px 8px env(safe-area-inset-bottom);
        background: rgba(255,255,255,.97);
        backdrop-filter: blur(15px);
        border-top: 1px solid var(--border);
        justify-content: space-around;
        align-items: center;
        z-index: 100;
    }

    .nav-item {
        flex: 1;
        height: 55px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #8b979e;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-size: 11px;
        transition: color .2s, background .2s;
    }

    .nav-item span {
        font-size: 21px;
    }

    .nav-item.active {
        color: var(--green);
        background: #eff8f2;
        font-weight: 750;
    }

    .empty-state {
        padding: 38px 18px;
    }
}

/* SMALL PHONES */

@media (max-width: 360px) {
    .content {
        padding-left: 11px;
        padding-right: 11px;
    }

    .menu-info small {
        font-size: 10px;
    }

    .stat-card {
        padding: 14px;
    }
}

.category-management-row {
    background: white;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 9px;
}

.category-management-row > div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-management-row small {
    color: var(--muted);
    font-size: 12px;
}

.delete-category-button {
    background: #fff0ed;
    color: #bd574b;
    border: 0;
    padding: 9px 13px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
}


/* PRODUCT IMAGE UPLOAD */

.product-image,
.product-image-placeholder {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: #f1f5f4;
    border: 1px solid var(--border);
}

.product-image-placeholder {
    display: grid;
    place-items: center;
    color: #9aa8a8;
    font-size: 19px;
}

.catalog-product-row,
.check-product-row,
.shopping-product-row {
    justify-content: flex-start;
}

.catalog-product-name,
.check-product-name {
    flex: 1;
    min-width: 0;
}

.catalog-product-row .row-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.image-file-input {
    display: none;
}

.image-action-button {
    background: #eaf5ee !important;
    color: #218653;
    border: 0;
    border-radius: 9px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.shopping-product-row .shopping-label {
    min-width: 0;
}

@media (max-width: 600px) {
    .catalog-product-row {
        flex-wrap: wrap;
    }

    .catalog-product-row .row-actions {
        width: 100%;
        padding-left: 60px;
        justify-content: flex-start;
    }

    .catalog-product-row .row-actions button {
        padding: 8px 9px;
    }
}
