:root {
    --bg: #fbfaf2;
    --surface: #ffffff;
    --surface-soft: #f2f7df;
    --ink: #18331f;
    --muted: #687764;
    --green: #1f8a46;
    --green-dark: #126332;
    --lime: #d7ed5c;
    --tomato: #e34831;
    --orange: #f7a738;
    --line: #dde8d4;
    --shadow: 0 18px 45px rgba(24, 51, 31, 0.12);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body.cart-is-open {
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.site-shell {
    min-height: 100vh;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 25;
    border-bottom: 1px solid rgba(221, 232, 212, 0.9);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.app-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    width: min(1180px, calc(100% - 24px));
    min-height: 72px;
    margin: 0 auto;
}

.nav-side {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-side-right {
    justify-content: flex-end;
}

.nav-pill,
.header-login-button,
.header-cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--green-dark);
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 850;
}

.nav-desktop-link {
    display: none;
}

.header-login-button,
.header-cart-button {
    width: 42px;
    min-width: 42px;
    padding: 0;
}

.header-login-button svg,
.header-cart-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-logo img {
    width: 148px;
    height: auto;
}

.header-cart-button {
    position: relative;
    border-color: rgba(31, 138, 70, 0.25);
    background: var(--green-dark);
    color: #fff;
    cursor: pointer;
}

.cart-symbol {
    display: block;
}

.cart-count {
    position: absolute;
    top: -7px;
    right: -7px;
    display: none;
    min-width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 999px;
    border: 2px solid #fff;
    background: var(--tomato);
    color: #fff;
    padding: 0 6px;
    font-size: 0.74rem;
    font-weight: 900;
}

.header-cart-button.has-items .cart-count {
    display: grid;
}

.hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(18, 99, 50, 0.92), rgba(31, 138, 70, 0.76)),
        url("../images/verduleria-hero.jpg") center/cover;
    color: #fff;
}

.hero-content,
.catalog {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: var(--radius);
    background: var(--lime);
    color: var(--green-dark);
    font-weight: 900;
}

.brand small,
.combo-footer span,
.checkout-note,
.success-summary span {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.88rem;
}

.hero-content {
    display: grid;
    gap: 18px;
    padding: 26px 0 30px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: var(--lime);
}

.hero h1,
.section-heading h2,
.success-card h1 {
    margin: 8px 0 12px;
    font-size: clamp(2rem, 8vw, 3.35rem);
    line-height: 1.04;
}

.section-heading h2 {
    font-size: clamp(1.65rem, 4vw, 2.45rem);
}

.hero p,
.section-heading p {
    margin: 0;
    max-width: 680px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.03rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 0;
    border-radius: var(--radius);
    padding: 11px 16px;
    cursor: pointer;
    font-weight: 850;
}

.button-primary {
    background: var(--lime);
    color: var(--green-dark);
    box-shadow: 0 10px 24px rgba(17, 73, 37, 0.2);
}

.button-secondary {
    background: var(--surface-soft);
    color: var(--green-dark);
}

.button-glass {
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.button-full {
    width: 100%;
}

.hero-promo {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.14);
    padding: 14px;
}

.hero-promo span,
.hero-promo strong,
.hero-promo p {
    display: block;
}

.hero-promo span {
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.82rem;
    font-weight: 850;
    text-transform: uppercase;
}

.hero-promo strong {
    font-size: 1.5rem;
    line-height: 1.1;
}

.hero-promo p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.94rem;
}

.catalog {
    padding: 26px 0 110px;
}

.section-heading {
    display: grid;
    gap: 12px;
    margin-bottom: 22px;
}

.section-heading p {
    color: var(--muted);
}

.combo-grid {
    display: grid;
    gap: 16px;
}

.combo-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 26px rgba(24, 51, 31, 0.06);
}

.combo-image-wrap {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--surface-soft);
}

.combo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.combo-image-fallback {
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(31, 138, 70, 0.92), rgba(247, 167, 56, 0.86)),
        url("../images/verduleria-hero.jpg") center/cover;
    color: #fff;
    font-weight: 900;
}

.combo-badges {
    position: absolute;
    left: 10px;
    top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.combo-badges span {
    border-radius: 999px;
    background: #fff;
    color: var(--green-dark);
    padding: 6px 9px;
    font-size: 0.78rem;
    font-weight: 850;
}

.combo-body {
    display: grid;
    gap: 12px;
    padding: 15px;
}

.combo-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.combo-title-row h3,
.combo-title-row strong,
.cart-header h2,
.cart-empty h3 {
    margin: 0;
}

.combo-title-row strong {
    color: var(--tomato);
    font-size: 1.25rem;
    white-space: nowrap;
}

.combo-body p {
    margin: 0;
    color: var(--muted);
}

.contents-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding-left: 18px;
    color: var(--ink);
    font-size: 0.94rem;
}

.combo-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.combo-footer span {
    color: var(--muted);
}

.alert,
.empty-state {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 16px;
    margin-bottom: 18px;
}

.alert-error {
    border-color: rgba(227, 72, 49, 0.35);
    color: #9f291a;
}

.empty-state h3,
.empty-state p {
    margin: 0;
}

.empty-state p {
    margin-top: 4px;
    color: var(--muted);
}

.cart-bar {
    position: fixed;
    z-index: 30;
    left: 16px;
    right: 16px;
    bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    border: 0;
    border-radius: var(--radius);
    background: var(--green-dark);
    color: #fff;
    padding: 12px 16px;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(12, 28, 17, 0.42);
}

.cart-drawer {
    position: fixed;
    z-index: 50;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 92vh;
    overflow: auto;
    border-radius: 16px 16px 0 0;
    background: var(--surface);
    box-shadow: var(--shadow);
    transform: translateY(110%);
    transition: transform 180ms ease;
    padding: 18px;
}

.cart-drawer.is-open {
    transform: translateY(0);
}

.cart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-weight: 900;
}

.cart-items {
    display: grid;
    gap: 10px;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
}

.cart-item span,
.checkout-note,
.cart-totals p,
.cart-empty p {
    color: var(--muted);
    font-size: 0.9rem;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.quantity-control button,
.remove-button {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--green-dark);
    cursor: pointer;
    font-weight: 850;
}

.quantity-control button {
    width: 34px;
    height: 34px;
}

.remove-button {
    grid-column: 1 / -1;
    padding: 8px;
}

.cart-empty {
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    padding: 16px;
}

.cart-totals {
    display: grid;
    gap: 8px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin: 16px 0;
    padding: 14px 0;
}

.cart-totals div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.cart-total {
    font-size: 1.2rem;
}

.cart-totals p,
.checkout-note {
    margin: 0;
}

.checkout-form {
    display: grid;
    gap: 12px;
}

.checkout-form label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-weight: 800;
}

.checkout-form input,
.checkout-form textarea,
.admin-input,
.admin-textarea,
.admin-select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    padding: 11px 12px;
    outline: 0;
}

.checkout-form input:focus,
.checkout-form textarea:focus,
.admin-input:focus,
.admin-textarea:focus,
.admin-select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(31, 138, 70, 0.14);
}

.success-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(251, 250, 242, 0.92), rgba(242, 247, 223, 0.92)),
        url("../images/verduleria-hero.jpg") center/cover;
}

.success-card {
    width: min(560px, 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    padding: 24px;
}

.success-icon {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border-radius: var(--radius);
    background: var(--lime);
    color: var(--green-dark);
    font-weight: 900;
}

.success-card h1 {
    font-size: clamp(2rem, 8vw, 3.4rem);
}

.success-card p {
    color: var(--muted);
}

.success-summary {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    margin: 18px 0;
}

.success-summary div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.success-summary span {
    color: var(--muted);
}

.success-actions {
    display: grid;
    gap: 10px;
}

@media (min-width: 720px) {
    .app-nav {
        min-height: 82px;
    }

    .header-logo img {
        width: 190px;
    }

    .nav-desktop-link {
        display: inline-flex;
    }

    .hero-content {
        grid-template-columns: minmax(0, 1fr) 270px;
        align-items: center;
        padding: 34px 0 38px;
    }

    .section-heading {
        grid-template-columns: 1fr 340px;
        align-items: end;
    }

    .combo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cart-drawer {
        left: auto;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(430px, 100%);
        max-height: none;
        border-radius: 0;
        transform: translateX(110%);
    }

    .cart-drawer.is-open {
        transform: translateX(0);
    }

    .cart-bar {
        left: 50%;
        right: auto;
        width: min(520px, calc(100% - 32px));
        transform: translateX(-50%);
    }

    .success-actions {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .hero-content {
        grid-template-columns: minmax(0, 720px) 300px;
        justify-content: space-between;
        min-height: 260px;
        padding: 42px 0;
    }

    .hero h1 {
        max-width: 720px;
        font-size: clamp(2.6rem, 4.6vw, 4rem);
    }

    .hero p {
        max-width: 610px;
    }

    .catalog {
        padding-top: 38px;
    }

    .combo-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }

    .combo-card {
        transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
    }

    .combo-card:hover {
        border-color: rgba(31, 138, 70, 0.26);
        box-shadow: 0 18px 42px rgba(24, 51, 31, 0.12);
        transform: translateY(-3px);
    }

    .combo-image-wrap {
        aspect-ratio: 4 / 3;
    }
}

.auth-body,
.admin-body {
    background:
        linear-gradient(135deg, rgba(251, 250, 242, 0.96), rgba(242, 247, 223, 0.96)),
        url("../images/verduleria-hero.jpg") center/cover fixed;
}

.auth-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 18px;
}

.auth-card {
    width: min(460px, 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
    padding: 24px;
}

.auth-card h1 {
    margin: 8px 0 8px;
    font-size: clamp(2rem, 8vw, 3.4rem);
    line-height: 1.05;
}

.auth-card p,
.panel-heading p {
    color: var(--muted);
}

.auth-link {
    display: inline-flex;
    margin-top: 14px;
    color: var(--green-dark);
    font-weight: 800;
}

.admin-layout {
    display: grid;
    min-height: 100vh;
}

.admin-sidebar {
    display: grid;
    gap: 14px;
    align-content: start;
    background: var(--green-dark);
    color: #fff;
    padding: 16px;
}

.admin-brand .brand-mark {
    background: var(--lime);
}

.admin-brand small {
    display: block;
}

.admin-nav {
    display: grid;
    gap: 7px;
}

.admin-nav a,
.admin-sidebar-footer a {
    border-radius: var(--radius);
    color: #fff;
    font-weight: 800;
}

.admin-nav a {
    padding: 10px 12px;
}

.admin-nav a.is-active,
.admin-nav a:hover {
    background: rgba(255, 255, 255, 0.14);
}

.admin-sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    margin-top: 8px;
    padding-top: 14px;
}

.admin-sidebar-footer span {
    color: rgba(255, 255, 255, 0.78);
}

.admin-main {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 22px 0 44px;
}

.admin-topline,
.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.admin-topline {
    align-items: center;
}

.admin-topline h1,
.panel-heading h2 {
    margin: 4px 0 0;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card,
.admin-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 8px 26px rgba(24, 51, 31, 0.06);
}

.stat-card {
    display: grid;
    gap: 6px;
    padding: 16px;
}

.stat-card span {
    color: var(--muted);
    font-weight: 750;
}

.stat-card strong {
    font-size: clamp(1.5rem, 7vw, 2.5rem);
    line-height: 1;
}

.admin-panel {
    padding: 16px;
    margin-bottom: 16px;
}

.alert-success {
    border-color: rgba(31, 138, 70, 0.3);
    color: var(--green-dark);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

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

.admin-table th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.admin-table a,
.table-action {
    color: var(--green-dark);
    font-weight: 850;
}

.status-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--surface-soft);
    color: var(--green-dark);
    font-size: 0.82rem;
    font-weight: 850;
    white-space: nowrap;
}

.status-new {
    background: #fff0c7;
    color: #7b5100;
}

.status-cancelled {
    background: #ffe1dc;
    color: #9f291a;
}

.status-delivered {
    background: #dff5df;
    color: var(--green-dark);
}

.admin-form {
    display: grid;
    gap: 13px;
}

.admin-form h2 {
    margin: 10px 0 0;
    font-size: 1.1rem;
}

.admin-form label {
    display: grid;
    gap: 6px;
    color: var(--ink);
    font-weight: 800;
}

.field-help {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 650;
}

.form-grid,
.check-grid,
.detail-grid {
    display: grid;
    gap: 12px;
}

.check-grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.check-row {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 9px !important;
    color: var(--muted);
}

.check-row input {
    width: 18px;
    height: 18px;
}

.admin-split {
    display: grid;
    gap: 16px;
}

.combo-admin-list {
    display: grid;
    gap: 10px;
}

.combo-admin-row {
    display: grid;
    grid-template-columns: 58px 1fr auto;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
}

.combo-admin-row img,
.admin-thumb {
    width: 58px;
    height: 58px;
    border-radius: var(--radius);
    object-fit: cover;
}

.admin-thumb {
    display: grid;
    place-items: center;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.75rem;
    text-align: center;
}

.combo-admin-row span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.order-detail {
    border-color: rgba(31, 138, 70, 0.28);
}

.detail-grid {
    margin-bottom: 16px;
}

.detail-grid div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
}

.detail-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-grid strong {
    display: block;
    margin-top: 4px;
}

.order-actions,
.status-form,
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.order-actions {
    margin-bottom: 16px;
}

.filter-form {
    justify-content: flex-end;
}

.filter-form .admin-select,
.status-form .admin-select {
    width: auto;
    min-width: 170px;
}

@media (min-width: 760px) {
    .admin-layout {
        grid-template-columns: 250px 1fr;
    }

    .admin-sidebar {
        position: sticky;
        top: 0;
        min-height: 100vh;
    }

    .admin-main {
        padding: 30px 0 58px;
    }

    .stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .form-grid,
    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .check-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .admin-form-wide .form-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1120px) {
    .admin-split {
        grid-template-columns: 430px 1fr;
        align-items: start;
    }
}

@media (max-width: 560px) {
    .admin-topline,
    .panel-heading {
        display: grid;
    }

    .combo-admin-row {
        grid-template-columns: 52px 1fr;
    }

    .combo-admin-row .button {
        grid-column: 1 / -1;
    }
}

.button-ghost {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--green-dark);
}

.admin-body {
    background:
        radial-gradient(circle at top left, rgba(215, 237, 92, 0.22), transparent 34rem),
        linear-gradient(180deg, #f7faef 0%, #fbfaf2 42%, #ffffff 100%);
}

.admin-body.admin-menu-open {
    overflow: hidden;
}

.admin-mobilebar {
    position: sticky;
    top: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(221, 232, 212, 0.92);
    background: rgba(255, 255, 255, 0.94);
    padding: 10px 14px;
    backdrop-filter: blur(14px);
}

.admin-mobile-logo img {
    width: 138px;
}

.admin-mobile-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-mobile-icon,
.admin-menu-button,
.admin-sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--green-dark);
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 850;
}

.admin-menu-button {
    display: grid;
    width: 42px;
    padding: 0;
    gap: 4px;
}

.admin-menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 99px;
    background: var(--green-dark);
}

.admin-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 75;
    background: rgba(12, 28, 17, 0.42);
}

.admin-layout {
    display: block;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(310px, 88vw);
    min-height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(221, 232, 212, 0.72);
    background:
        linear-gradient(180deg, rgba(18, 99, 50, 0.98), rgba(24, 51, 31, 0.98)),
        url("../images/verduleria-hero.jpg") center/cover;
    box-shadow: var(--shadow);
    transform: translateX(-106%);
    transition: transform 180ms ease;
}

.admin-sidebar.is-open {
    transform: translateX(0);
}

.admin-sidebar-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    padding: 0;
}

.admin-brand {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px 44px 18px 0;
}

.admin-brand img {
    width: 72px;
    border-radius: var(--radius);
    background: #fff;
    padding: 4px;
}

.admin-brand small {
    color: rgba(255, 255, 255, 0.72);
}

.admin-nav {
    margin-top: 4px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    padding: 11px 12px;
}

.admin-nav a span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.12);
    color: var(--lime);
    font-size: 0.72rem;
    font-weight: 900;
}

.admin-nav a.is-active {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.16);
}

.admin-nav a.is-active span {
    background: var(--lime);
    color: var(--green-dark);
}

.admin-sidebar-footer {
    align-self: end;
}

.admin-main {
    width: min(1220px, calc(100% - 28px));
    padding: 20px 0 54px;
}

.admin-topline {
    border: 1px solid rgba(221, 232, 212, 0.9);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 30px rgba(24, 51, 31, 0.06);
    padding: 14px;
}

.admin-topline h1 {
    font-size: clamp(1.7rem, 5vw, 2.8rem);
    line-height: 1.05;
}

.admin-top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.stat-card,
.admin-panel {
    border-color: rgba(221, 232, 212, 0.82);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 34px rgba(24, 51, 31, 0.07);
}

.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    position: absolute;
    right: -28px;
    top: -28px;
    width: 88px;
    height: 88px;
    border-radius: 999px;
    background: rgba(215, 237, 92, 0.42);
    content: "";
}

.admin-panel {
    padding: 18px;
}

.admin-input,
.admin-textarea,
.admin-select {
    min-height: 44px;
    background: rgba(255, 255, 255, 0.94);
}

.admin-table th {
    background: #f7faef;
}

.admin-table tbody tr:hover {
    background: rgba(242, 247, 223, 0.46);
}

@media (min-width: 860px) {
    .admin-mobilebar,
    .admin-sidebar-close {
        display: none;
    }

    .admin-layout {
        display: grid;
        grid-template-columns: 280px 1fr;
        min-height: 100vh;
    }

    .admin-sidebar {
        position: sticky;
        top: 0;
        z-index: 1;
        width: auto;
        transform: none;
        box-shadow: none;
    }

    .admin-main {
        padding: 28px 0 64px;
    }
}

@media (max-width: 640px) {
    .admin-mobile-logo img {
        width: 120px;
    }

    .admin-mobile-icon {
        min-height: 36px;
        padding: 7px 8px;
    }

    .admin-top-actions {
        justify-content: stretch;
    }

    .admin-top-actions .button {
        flex: 1;
    }

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

    .admin-panel {
        padding: 14px;
    }
}

.finance-stat-grid,
.reports-grid {
    grid-template-columns: 1fr;
}

.finance-stat small,
.report-card small {
    color: var(--muted);
    font-weight: 800;
}

.income-card strong,
.finance-amount.income {
    color: var(--green-dark);
}

.expense-card strong,
.finance-amount.expense {
    color: var(--tomato);
}

.net-card strong {
    color: var(--ink);
}

.finance-layout {
    grid-template-columns: 1fr;
}

.category-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.category-chip {
    display: inline-flex;
    border-radius: 999px;
    padding: 7px 10px;
    background: var(--surface-soft);
    color: var(--green-dark);
    font-size: 0.82rem;
    font-weight: 850;
}

.category-chip.category-expense {
    background: #ffe8e2;
    color: #9f291a;
}

.finance-list {
    display: grid;
    gap: 10px;
}

.finance-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 12px;
}

.finance-row span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.finance-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--green);
}

.finance-dot.expense {
    background: var(--tomato);
}

.finance-amount {
    white-space: nowrap;
}

.reports-layout {
    display: grid;
    gap: 16px;
}

.trend {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 5px 8px;
    background: var(--surface-soft);
}

.trend.positive {
    background: #e3f6df;
    color: var(--green-dark);
}

.trend.negative {
    background: #ffe8e2;
    color: #9f291a;
}

.trend.neutral {
    color: var(--muted);
}

.bar-list {
    display: grid;
    gap: 14px;
}

.bar-row {
    display: grid;
    gap: 7px;
}

.bar-row > div:first-child {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.bar-row span {
    color: var(--muted);
    font-weight: 800;
}

.bar-track {
    overflow: hidden;
    height: 12px;
    border-radius: 999px;
    background: #edf4e6;
}

.bar-track span {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.bar-track .income,
.month-bar-pair .income,
.legend-income {
    background: var(--green);
}

.bar-track .expense,
.month-bar-pair .expense,
.legend-expense {
    background: var(--tomato);
}

.month-bars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.month-card {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 12px;
}

.month-bar-pair {
    display: flex;
    align-items: end;
    gap: 6px;
    height: 92px;
    border-radius: var(--radius);
    background: #f7faef;
    padding: 8px;
}

.month-bar-pair span {
    flex: 1;
    min-height: 5px;
    border-radius: 999px 999px 0 0;
}

.month-card small {
    color: var(--muted);
    font-weight: 800;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 850;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.chart-legend i {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 999px;
}

.insight-grid {
    display: grid;
    gap: 12px;
}

.insight-grid div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 14px;
}

.insight-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 850;
    text-transform: uppercase;
}

.insight-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 1.4rem;
}

@media (min-width: 760px) {
    .finance-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .reports-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .reports-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .month-bars {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .insight-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1120px) {
    .finance-layout {
        grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    }
}

@media (max-width: 560px) {
    .finance-row {
        grid-template-columns: auto 1fr;
    }

    .finance-amount {
        grid-column: 2;
        justify-self: start;
    }
}

/* Final layout stabilizers: keep the public header and admin shell from inheriting older rules. */
.app-nav {
    grid-template-columns: minmax(52px, 1fr) auto minmax(52px, 1fr);
}

.header-logo {
    grid-column: 2;
    min-width: 0;
    position: static;
    transform: none;
}

.nav-side-left {
    grid-column: 1;
    justify-self: start;
    min-width: 0;
}

.nav-side-right {
    grid-column: 3;
    justify-self: end;
    min-width: 0;
}

.admin-body .admin-layout {
    display: block;
    min-height: 100vh;
}

.admin-body .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    display: flex;
    width: min(310px, 88vw);
    min-height: 100vh;
    flex-direction: column;
    align-content: normal;
    overflow-y: auto;
    transform: translateX(-106%);
}

.admin-body .admin-sidebar.is-open {
    transform: translateX(0);
}

.admin-body .admin-main {
    min-width: 0;
}

.admin-body .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.admin-body .admin-split {
    grid-template-columns: 1fr;
}

.admin-body .panel-heading {
    display: flex;
}

@media (min-width: 860px) {
    .admin-body .admin-layout {
        display: grid;
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .admin-body .admin-sidebar {
        position: sticky;
        top: 0;
        z-index: 1;
        width: auto;
        height: 100vh;
        transform: none;
    }

    .admin-body .admin-mobilebar,
    .admin-body .admin-sidebar-close {
        display: none;
    }

    .admin-body .admin-main {
        width: min(1220px, calc(100% - 32px));
    }
}

@media (min-width: 1120px) {
    .admin-body .admin-split {
        grid-template-columns: 430px minmax(0, 1fr);
    }

    .admin-body .finance-layout {
        grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    }
}

@media (max-width: 720px) {
    .header-logo img {
        width: 128px;
    }

    .app-nav {
        min-height: 66px;
        gap: 6px;
    }

    .admin-body .panel-heading {
        display: grid;
    }
}
