@import url("app.css");

.portal-body { background: var(--mint); }
.portal-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    background: var(--green-deep); color: var(--light-green); padding: 1.3rem .9rem;
    display: flex; flex-direction: column; gap: .4rem;
}
.sidebar a {
    color: var(--light-green); text-decoration: none; padding: .6rem .75rem; border-radius: var(--radius);
    display: flex; align-items: center; gap: .55rem; font-size: .9rem; font-weight: 600;
}
.sidebar a.active, .sidebar a:hover { background: var(--green); color: var(--white); }
.sidebar .brand { margin-bottom: .8rem; }
.sidebar .brand-logo { height: 48px; width: auto; display: block; }
.auth-visual .brand-logo { height: 68px; width: auto; display: block; }
.sidebar .count { margin-left: auto; background: var(--yellow); color: var(--ink); border-radius: 4px; padding: 0 .35rem; font-size: .7rem; }
.main { padding: 1.2rem 1.4rem 2rem; min-width: 0; width: 100%; max-width: 100%; }
.top-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.table-wrap {
    width: 100%;
    max-width: 100%;
    display: block;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.table-wrap table,
.portal-body table {
    width: 100%;
    min-width: 720px;
    table-layout: auto;
    border-collapse: collapse;
}
th, td {
    padding: .45rem .5rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    font-size: .82rem;
    vertical-align: top;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    word-wrap: normal;
}
th {
    color: var(--muted);
    font-weight: 700;
    background: var(--mint);
}
.cell-email, td.cell-email {
    word-break: keep-all;
    overflow-wrap: break-word;
}
.cell-url, td.cell-url {
    overflow-wrap: anywhere;
    word-break: normal;
}
.page-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.page-head h3 { margin: 0; }
.add-new-btn {
    display: inline-flex; align-items: center; gap: .45rem;
    border-radius: 6px; font-family: inherit; white-space: nowrap;
}
.add-panel { display: none; margin-bottom: 1.2rem; width: 100%; }
.add-panel.is-open { display: block; }
.add-panel .card { width: 100%; box-sizing: border-box; }
.empty-hint { color: var(--muted); padding: 1.2rem 0; }
.progress { height: 8px; background: var(--light-green); border-radius: 4px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); }
.modal {
    position: fixed; inset: 0; background: rgba(36,48,36,.5); display: none; place-items: center; z-index: 60; padding: 1rem;
}
.modal.open { display: grid; }
.modal .panel { width: min(720px, 100%); max-height: 86vh; overflow: auto; }
.welcome-panel {
    padding: 2rem 2.1rem 1.6rem;
    border-top: 4px solid var(--yellow);
}
.welcome-panel .welcome-greet {
    margin: 0 0 .35rem;
    color: var(--green-deep);
    font-weight: 700;
    font-size: 1.05rem;
}
.welcome-panel h2 {
    margin: 0 0 .75rem;
    color: var(--green-deep);
    font-size: 1.45rem;
}
.welcome-panel p { margin: 0 0 .85rem; color: var(--ink); }
.welcome-panel .btn { border-radius: 6px; }
.welcome-panel .welcome-later { margin: 1rem 0 0; }
.welcome-panel .welcome-later a {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
}
.welcome-panel .welcome-later a:hover { color: var(--green-deep); }
.status { padding: .15rem .5rem; border-radius: 4px; font-size: .72rem; font-weight: 700; text-transform: capitalize; }
.status-paid, .status-active, .status-completed, .status-in_progress, .status-approved { background: var(--light-green); color: var(--green-deep); }
.status-unpaid, .status-pending, .status-pending_payment, .status-rescheduled { background: #fff3cc; color: #6d5600; }
.status-failed, .status-cancelled, .status-suspended, .status-rejected { background: #ffe1d6; color: #7a2a12; }
.status-matured, .status-sent, .status-draft { background: var(--light-green); color: var(--green-deep); }

.portal-body .card:hover { transform: none; }
.portal-body .split { width: 100%; align-items: stretch; }
.portal-body .meta { color: var(--muted); font-size: .8rem; letter-spacing: 0; text-transform: none; font-weight: 500; }
.toolbar {
    display: flex; flex-wrap: wrap; gap: .7rem; align-items: end;
    margin: 0 0 1rem; background: #fff; padding: .9rem 1rem;
    border-radius: var(--radius); box-shadow: var(--shadow);
    width: 100%; box-sizing: border-box;
}
.toolbar label { min-width: 180px; flex: 1; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.actions-cell { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.actions-cell select, .actions-cell input { width: auto; min-width: 110px; padding: .4rem .5rem; }
.btn-sm { padding: .4rem .75rem; font-size: .8rem; }
.btn-icon {
    padding: .35rem .45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    min-width: 32px;
    height: 32px;
    box-sizing: border-box;
    line-height: 1;
    flex-shrink: 0;
}
.btn-icon:hover { transform: none; }
.table-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: .25rem;
    align-items: center;
    justify-content: flex-end;
    margin: 0;
}
.table-actions form,
form.table-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: .25rem;
    align-items: center;
    justify-content: flex-end;
    margin: 0;
}
.table-actions select,
.table-actions input:not([type="hidden"]):not([type="checkbox"]) {
    width: auto;
    min-width: 0;
    max-width: 88px;
    height: 32px;
    padding: .25rem .35rem;
    font-size: .72rem;
    flex-shrink: 0;
}
.table-actions input[type="datetime-local"] { max-width: 158px; }
th.col-title, td.col-title,
th.col-grow, td.col-grow { width: auto; }
th.col-type, td.col-type,
th.col-status, td.col-status,
th.col-kind, td.col-kind { width: 12%; }
th.col-price, td.col-price,
th.col-amount, td.col-amount,
th.col-num, td.col-num { width: 12%; }
th.col-date, td.col-date { width: 14%; }
th.col-progress, td.col-progress { width: 12%; }
th.col-ref, td.col-ref { width: 14%; }
th.col-audience, td.col-audience { width: 16%; }
th.col-actions, td.col-actions {
    width: 7.5rem;
    text-align: right;
    white-space: nowrap;
    vertical-align: middle;
    overflow: visible;
}
.table-actions-md th.col-actions,
.table-actions-md td.col-actions { width: 12.5rem; }
.table-actions-text th.col-actions,
.table-actions-text td.col-actions {
    width: 16rem;
    white-space: normal;
}
.table-actions-wide th.col-actions,
.table-actions-wide td.col-actions {
    width: 25rem;
    text-align: left;
}
.table-actions-wide .table-actions,
.table-actions-wide form.table-actions { justify-content: flex-start; }
.table-clients th.col-name,
.table-clients td.col-name,
.table-clients th.col-email,
.table-clients td.col-email,
.table-clients th.col-phone,
.table-clients td.col-phone {
    white-space: nowrap;
    overflow-wrap: normal;
    word-wrap: normal;
    word-break: keep-all;
    font-size: .78rem;
}
.table-clients th.col-name,
.table-clients td.col-name { width: 18%; }
.table-clients th.col-email,
.table-clients td.col-email { width: 22%; }
.table-clients th.col-phone,
.table-clients td.col-phone { width: 12%; }
.table-clients th.col-hide-lg,
.table-clients td.col-hide-lg { width: 11%; }
.table-clients th.col-kind,
.table-clients td.col-kind,
.table-clients th.col-status,
.table-clients td.col-status { width: 7%; }
.table-clients.table-actions-wide th.col-actions,
.table-clients.table-actions-wide td.col-actions {
    width: 14rem;
    min-width: 14rem;
    max-width: 16rem;
    white-space: normal;
    text-align: left;
    vertical-align: middle;
}
.table-clients .table-actions,
.table-clients form.table-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    align-content: flex-start;
    gap: .2rem;
    max-width: 14rem;
}
.table-clients .table-actions .btn-icon {
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: .25rem;
}
.table-clients .table-actions select {
    height: 28px;
    max-width: 78px;
    font-size: .7rem;
}
.top-tools { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.currency-switcher {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
    font-size: .78rem;
    font-weight: 700;
    color: var(--green-deep);
}
.currency-switcher label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin: 0;
}
.currency-switcher select {
    width: auto;
    min-width: 0;
    padding: .3rem .45rem;
    font-size: .78rem;
}
.pager { display: flex; gap: .4rem; margin: 1rem 0; flex-wrap: wrap; align-items: center; }
.pager a, .pager span {
    padding: .4rem .7rem; border: 1px solid var(--line); border-radius: var(--radius);
    text-decoration: none; font-weight: 700; font-size: .85rem; background: #fff;
}
.pager a.on, .pager span.on { background: var(--green); color: #fff; border-color: var(--green); }
.check-row { display: flex; align-items: center; gap: .5rem; color: var(--ink); font-weight: 600; }
.check-row input { width: auto; }
.portal-body code { background: var(--mint); padding: .1rem .35rem; border-radius: 4px; font-weight: 700; }

.auth-body { margin: 0; background: var(--white); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.auth-visual {
    position: relative; overflow: hidden; background: var(--green-deep); color: #fff;
    display: grid; align-content: center; padding: 3rem;
}
.auth-photo {
    position: absolute; inset: 0;
    background: var(--green-deep) center/cover no-repeat;
    opacity: 0; transition: opacity 1.1s ease;
}
.auth-photo.is-active {
    opacity: 1; z-index: 0;
    animation: kenburns 14s ease-in-out infinite alternate;
}
.auth-visual .shade { position: absolute; inset: 0; background: rgba(61, 122, 34, .72); z-index: 1; }
.auth-visual .inner { position: relative; z-index: 2; max-width: 420px; }
.auth-visual h1 { color: var(--yellow); font-size: clamp(2rem, 4vw, 3rem); }
.auth-card { animation: cardin .7s ease; }
@keyframes kenburns {
    from { transform: scale(1) translate(0, 0); }
    to { transform: scale(1.12) translate(-2%, -1.5%); }
}
@keyframes cardin {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}
.auth-panel {
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1.5rem 1.2rem; background: var(--white);
    min-height: 100vh; overflow-y: auto;
}
.auth-card { width: min(420px, 100%); }
.auth-card h2 { color: var(--green-deep); margin: 0 0 .4rem; }
.auth-card .form { gap: .55rem; }
.auth-card textarea { min-height: 90px; }
.auth-foot {
    margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line);
    display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap;
    font-size: .8rem; color: var(--muted);
}
.auth-foot a { color: var(--green-deep); text-decoration: none; font-weight: 600; }
.auth-body .site-footer, .auth-body .float-wa, .auth-body .chat-toggle, .auth-body .chatbox { display: none !important; }

.portal-burger, .sidebar-close {
    display: none; border: 0; background: var(--green); color: #fff;
    width: 40px; height: 40px; border-radius: var(--radius); cursor: pointer; font-size: 1.1rem;
}
.sidebar-overlay { display: none; }
.top-left { display: flex; align-items: center; gap: .7rem; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: .7rem; margin-top: .8rem; width: 100%; }
.media-grid img, .media-grid video { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius); background: #111; }
.portal-body .gallery-grid {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.portal-body .card-photo { position: relative; background: var(--mint); }
.portal-body .card-photo img.is-broken { display: none; }
.portal-body .card-photo img:not(.is-broken) + .media-thumb-ph { display: none; }
.portal-body .card-photo .media-thumb-ph { font-size: 1.8rem; }
th.col-media, td.col-media { width: 56px; padding: .4rem .35rem; vertical-align: middle; overflow: hidden; }
.media-thumb {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--mint);
    display: grid;
    place-items: center;
    color: var(--muted);
}
.media-thumb img, .media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--green-deep);
}
.media-thumb img.is-broken { display: none; }
.media-thumb-ph {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    color: var(--muted);
    pointer-events: none;
}
.media-thumb img:not(.is-broken) ~ .media-thumb-ph,
.media-thumb video ~ .media-thumb-ph { display: none; }
.media-thumb-play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #fff;
    background: rgba(36, 48, 36, .35);
    font-size: .85rem;
    pointer-events: none;
    z-index: 1;
}
.file-preview-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    align-items: flex-start;
    margin: .2rem 0 .5rem;
}
.form-grid .file-preview-wrap { grid-column: 1 / -1; }
.file-preview-wrap > label { flex: 1; min-width: 180px; }
.file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    min-width: 72px;
    min-height: 72px;
    max-width: 100%;
    padding: .4rem;
    background: var(--mint);
    border: 1px solid var(--line);
    border-radius: 6px;
}
.file-preview img, .file-preview video {
    width: 96px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--green-deep);
}
.file-preview img.is-broken { display: none; }
.file-preview img:not(.is-broken) + .file-preview-icon { display: none; }
.file-preview-icon {
    display: grid;
    place-items: center;
    min-width: 72px;
    min-height: 72px;
    padding: .35rem;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    text-align: center;
    word-break: break-word;
}
.file-preview-icon i {
    font-size: 1.5rem;
    color: var(--green-deep);
    display: block;
    margin-bottom: .2rem;
}

.inbox-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1rem; min-height: 520px; width: 100%; }
.thread-list a { display: block; padding: .8rem; border-bottom: 1px solid var(--line); text-decoration: none; }
.thread-list a.active, .thread-list a:hover { background: var(--mint); }
.qty-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.bill-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.bill-tabs a {
    padding: .4rem .85rem; border: 1px solid var(--line); border-radius: var(--radius);
    text-decoration: none; font-weight: 700; font-size: .85rem;
}
.bill-tabs a.on { background: var(--green); color: #fff; border-color: var(--green); }
.qty-row input { width: 70px; }

@media (max-width: 900px) {
    .portal-shell { grid-template-columns: 1fr; }
    .auth-shell, .inbox-grid { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; right: auto;
        width: min(280px, 86vw); height: 100%; max-height: none;
        z-index: 80; transform: translateX(-110%); transition: transform .25s ease;
        overflow-y: auto; flex-direction: column;
        box-shadow: 8px 0 24px rgba(36, 48, 36, .18);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar a.active { background: var(--green); color: #fff; border-left: 3px solid var(--yellow); }
    .sidebar-overlay {
        display: none; position: fixed; inset: 0; background: rgba(36,48,36,.45); z-index: 70;
    }
    .sidebar-overlay.show { display: block; }
    .portal-burger, .sidebar-close { display: inline-grid; place-items: center; }
    .sidebar-close { align-self: flex-end; margin-bottom: .4rem; background: transparent; color: #fff; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .auth-visual { min-height: 200px; padding: 1.4rem; }
    .auth-panel { min-height: auto; padding: 1.4rem 1.1rem 1.2rem; }
    .top-row { flex-wrap: wrap; }
    .table-wrap { width: 100%; max-width: 100%; }
    .col-hide-md { display: none; }
}
@media (max-width: 1100px) {
    .col-hide-lg { display: none; }
}
@media (max-width: 720px) {
    .col-hide-sm { display: none; }
}
@media (max-width: 600px) { .kpi-grid { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
    .table-wrap {
        overflow: visible;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }
    .portal-body .table-wrap table,
    .table-wrap table {
        display: block;
        width: 100%;
        min-width: 0;
        table-layout: auto;
    }
    .table-wrap tbody,
    .table-wrap table > tr,
    .table-wrap tbody > tr,
    .table-wrap tr:has(> td) {
        display: block;
        width: 100%;
    }
    .table-wrap table > tr,
    .table-wrap tbody > tr,
    .table-wrap tr:has(> td) {
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        margin-bottom: .75rem;
        padding: .35rem .85rem .45rem;
        box-sizing: border-box;
    }
    .table-wrap thead,
    .table-wrap table > tr:first-child,
    .table-wrap tr:has(> th) {
        display: none;
    }
    .portal-body .table-wrap td,
    .portal-body .table-wrap .table-clients th,
    .portal-body .table-wrap .table-clients td,
    .portal-body .table-wrap .table-clients.table-actions-wide th.col-actions,
    .portal-body .table-wrap .table-clients.table-actions-wide td.col-actions,
    .table-wrap td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        width: 100%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
        border-bottom: 1px solid var(--line);
        padding: .5rem 0;
        text-align: right;
        white-space: normal;
        word-break: normal;
        overflow-wrap: break-word;
        word-wrap: break-word;
        vertical-align: middle;
    }
    .table-wrap td:last-child { border-bottom: 0; }
    .table-wrap td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--muted);
        white-space: nowrap;
        word-break: normal;
        overflow-wrap: normal;
        text-align: left;
        flex: 0 0 auto;
    }
    .table-wrap td[data-label=""]::before,
    .table-wrap td[colspan]::before {
        content: none;
        display: none;
    }
    .table-wrap td[colspan] {
        display: block;
        text-align: left;
        justify-content: flex-start;
    }
    .table-wrap td.col-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        text-align: left;
        white-space: normal;
    }
    .table-wrap td.col-actions::before {
        width: 100%;
        margin-bottom: .2rem;
    }
    .table-wrap .col-hide-sm,
    .table-wrap .col-hide-md,
    .table-wrap .col-hide-lg,
    .table-wrap td.col-hide-sm,
    .table-wrap td.col-hide-md,
    .table-wrap td.col-hide-lg {
        display: flex;
    }
    .table-wrap .table-actions,
    .table-wrap form.table-actions,
    .table-wrap .table-clients .table-actions,
    .table-wrap .table-clients form.table-actions {
        max-width: none;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

.shop-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
    gap: .75rem;
    align-items: start;
}
.shop-main { min-width: 0; align-self: start; }
.shop-main h3 { margin: 0 0 .35rem; }
.shop-main > p { margin: 0 0 .7rem; color: var(--muted); font-size: .85rem; }
.shop-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
    align-items: start;
    grid-auto-rows: min-content;
}
.portal-body .shop-grid .shop-card,
.portal-body .shop-grid .shop-card.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
    min-height: 0;
    min-width: 0;
    align-self: start;
    padding: 0;
}
.portal-body .shop-grid .shop-card .shop-thumb,
.portal-body .shop-grid .shop-card .photo-frame,
.portal-body .shop-grid .shop-card .card-photo {
    height: 100px;
    max-height: 110px;
    min-height: 0;
    flex: 0 0 100px;
    overflow: hidden;
    margin: 0;
    background: var(--mint);
}
.portal-body .shop-grid .shop-card .shop-thumb img,
.portal-body .shop-grid .shop-card .photo-frame img,
.portal-body .shop-grid .shop-card .card-photo img,
.portal-body .shop-grid .shop-card img {
    width: 100%;
    height: 100px;
    max-height: 110px;
    min-height: 0;
    object-fit: cover;
    display: block;
}
.shop-body {
    padding: .4rem .5rem .5rem;
    display: flex;
    flex-direction: column;
    gap: .12rem;
    flex: 0 0 auto;
    min-height: 0;
}
.shop-card h3 { margin: 0; font-size: .85rem; line-height: 1.25; color: var(--green-deep); }
.shop-card .meta { font-size: .68rem; text-transform: capitalize; }
.shop-price { font-size: .82rem; color: var(--green-deep); font-weight: 700; margin: 0; }
.shop-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .3rem;
    margin-top: .2rem;
}
.shop-add { display: flex; gap: .3rem; align-items: center; margin: 0; min-width: 0; flex: 1; }
.shop-add input[type="number"] { width: 46px; padding: .25rem .3rem; font-size: .78rem; }
.shop-card .btn-sm { padding: .25rem .5rem; font-size: .72rem; white-space: nowrap; }
.shop-details { margin: 0; width: auto; flex-shrink: 0; }
.shop-summary {
    position: sticky;
    top: .8rem;
    min-width: 0;
    width: 100%;
    height: auto;
    max-height: none;
    min-height: 0;
    align-self: start;
}
.sel-title {
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--green-deep);
    margin: 0 0 .4rem;
}
.sel-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.sel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px minmax(52px, auto);
    gap: .3rem;
    background: #82B440;
    color: #fff;
    padding: .45rem .55rem;
    font-size: .68rem;
    font-weight: 700;
}
.sel-head span:nth-child(2),
.sel-head span:nth-child(3) { text-align: center; }
.sel-head span:nth-child(3) { text-align: right; }
.sel-empty { padding: .9rem .75rem 1rem; color: var(--muted); font-size: .85rem; }
.sel-empty p { margin: 0 0 .45rem; }
.sel-empty p:first-child { color: var(--ink); font-weight: 700; }
.sel-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px minmax(52px, auto);
    gap: .3rem;
    align-items: start;
    padding: .55rem .55rem;
    border-bottom: 1px solid var(--line);
}
.sel-product { display: flex; gap: .4rem; min-width: 0; }
.sel-product img {
    width: 40px; height: 40px; object-fit: cover; border-radius: 4px;
    background: var(--mint); flex-shrink: 0;
}
.sel-product strong { display: block; font-size: .78rem; line-height: 1.3; color: var(--ink); }
.sel-unit { font-size: .7rem; color: var(--muted); margin: .15rem 0; }
.sel-remove {
    background: none; border: 0; padding: 0;
    color: #7a5348; font: inherit; font-size: .72rem; font-weight: 600;
    cursor: pointer; text-decoration: underline;
}
.sel-remove:hover { color: var(--green-deep); }
.sel-qty { display: flex; justify-content: center; }
.sel-qty input[type="number"] {
    width: 40px; padding: .25rem .15rem; text-align: center;
    background: #fff; border: 1px solid var(--line);
}
.sel-sub {
    text-align: right; font-size: .72rem; font-weight: 600; padding-top: .15rem;
    overflow-wrap: anywhere;
}
.sel-totals {
    border-top: 2px solid #82B440;
    padding: .7rem .75rem .3rem;
    font-size: .85rem;
}
.sel-totals p { display: flex; justify-content: space-between; margin: 0 0 .4rem; }
.sel-grand { font-weight: 700; }
.sel-cta {
    display: flex; align-items: center; justify-content: center; gap: .45rem;
    width: calc(100% - 1.3rem); margin: .4rem .65rem .85rem;
    border-radius: 999px;
}
.pkg-detail-panel { position: relative; padding: 1.2rem 1.3rem 1.3rem; }
.pkg-modal-close {
    position: absolute; top: .6rem; right: .6rem;
    width: 34px; height: 34px; border: 0; border-radius: 4px;
    background: var(--mint); color: var(--green-deep); cursor: pointer;
}
.pkg-detail-photo { height: 200px; border-radius: var(--radius); overflow: hidden; background: var(--mint); margin-bottom: .8rem; }
.pkg-detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.pkg-modal-summary { margin: .35rem 0; }
.pkg-modal-copy { white-space: pre-wrap; font-size: .9rem; }
.pkg-modal-features { margin: .4rem 0 1rem; padding-left: 1.1rem; }
.pkg-modal-add { margin-top: .6rem; }
.pkg-modal-full { margin: .7rem 0 0; font-size: .85rem; }
.pkg-modal-full a { color: var(--green-deep); font-weight: 600; text-decoration: none; }
.shop-back { margin: 0 0 .8rem; }
.shop-back a { color: var(--green-deep); font-weight: 600; text-decoration: none; }
.pkg-page {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 1.1rem;
    align-items: start;
}
.pkg-page-photo { border-radius: var(--radius); overflow: hidden; min-height: 280px; background: var(--mint); box-shadow: var(--shadow); }
.pkg-page-photo img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; }

@media (min-width: 1100px) {
    .shop-layout {
        grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
        align-items: start;
    }
    .shop-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
    }
}
@media (max-width: 1099px) {
    .shop-layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
    .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 900px) {
    .shop-layout { grid-template-columns: 1fr; align-items: start; }
    .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .shop-summary {
        position: sticky;
        top: auto;
        bottom: 0;
        z-index: 25;
        max-height: 46vh;
        overflow: auto;
        background: var(--mint);
        box-shadow: 0 -8px 22px rgba(36, 48, 36, .14);
    }
    .pkg-page { grid-template-columns: 1fr; }
    .pkg-page-photo, .pkg-page-photo img { min-height: 200px; }
}
@media (max-width: 640px) {
    .shop-grid { grid-template-columns: 1fr; }
}
