:root {
    --bg: #edf3ef;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --surface-alt: #eef4eb;
    --text: #16251f;
    --muted: #5c7065;
    --brand: #0f6a4c;
    --brand-dark: #0a4f38;
    --brand-soft: #d8efe4;
    --accent: #e4a43b;
    --danger: #b74747;
    --border: rgba(171, 191, 179, 0.45);
    --shadow: 0 20px 48px rgba(16, 39, 29, 0.1);
    --shadow-soft: 0 12px 28px rgba(16, 39, 29, 0.07);
    --radius: 22px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(228, 164, 59, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(15, 106, 76, 0.12), transparent 22%),
        linear-gradient(180deg, #f7faf7 0%, var(--bg) 54%, #e8f0eb 100%);
    color: var(--text);
    font-family: "Candara", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: clamp(15px, 1rem + 0.2vw, 18px);
    line-height: 1.45;
}

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

.app-shell {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    padding: clamp(16px, 2vw, 24px) clamp(12px, 2vw, 24px) 104px;
}

.feedback-toast {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1200;
    width: min(92vw, 360px);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(171, 191, 179, 0.4);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 22px 48px rgba(16, 39, 29, 0.18);
    transform: translateY(-18px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.feedback-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.feedback-toast-success {
    border-left: 5px solid #1b8a61;
}

.feedback-toast-error {
    border-left: 5px solid #bb4d4d;
}

.feedback-toast-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
}

.feedback-toast-success .feedback-toast-icon {
    background: #e4f6ed;
    color: #177352;
}

.feedback-toast-error .feedback-toast-icon {
    background: #fdeaea;
    color: #b74747;
}

.feedback-toast-copy {
    flex: 1;
    display: grid;
    gap: 4px;
}

.feedback-toast-copy strong {
    font-size: 15px;
}

.feedback-toast-copy span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

.feedback-toast-close {
    border: none;
    background: transparent;
    color: #6b7d72;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.topbar,
.hero,
.card,
.table-card {
    background: var(--surface);
    backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.topbar,
.hero {
    padding: 22px;
    margin-bottom: 18px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(247, 251, 248, 0.84));
}

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--muted);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
}

h2 {
    font-size: clamp(1.2rem, 1rem + 0.8vw, 1.7rem);
}

h3 {
    font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
}

.user-chip {
    padding: 12px 16px;
    background: linear-gradient(180deg, #f7fbf8 0%, #edf5ef 100%);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--muted);
    min-width: 180px;
    box-shadow: var(--shadow-soft);
}

.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 26%),
        linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 54%, #17815b 100%);
    color: #fff;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -40px -50px auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.login-brand {
    margin-bottom: 6px;
    font-size: clamp(2.1rem, 1.7rem + 1.6vw, 3.2rem);
    letter-spacing: -0.03em;
}

.hero-subtitle,
.hero-copy,
.topbar-subtitle {
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: clamp(1rem, 0.95rem + 0.35vw, 1.15rem);
    color: rgba(255, 255, 255, 0.88);
}

.hero-copy {
    margin-top: 16px;
    max-width: 620px;
    font-size: clamp(1rem, 0.95rem + 0.35vw, 1.2rem);
    color: rgba(255, 255, 255, 0.92);
}

.topbar-subtitle {
    margin-top: 6px;
    font-size: 14px;
    color: var(--muted);
}

.hero-grid,
.stats-grid,
.form-grid {
    display: grid;
    gap: 12px;
}

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

.metric {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
}

.metric span {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
}

.metric strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
}

.card,
.table-card {
    padding: 18px;
    margin-bottom: 18px;
}

.mini-card {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #f6f9f4 100%);
    box-shadow: var(--shadow-soft);
}

.order-item-list {
    margin: 12px 0;
}

.order-item-list ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.order-item-list li {
    margin-bottom: 6px;
}

.stack {
    display: grid;
    gap: 12px;
}

label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

input,
select,
button,
textarea {
    width: 100%;
    border: 1px solid rgba(159, 181, 167, 0.5);
    border-radius: 16px;
    padding: 13px 15px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.96);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(15, 106, 76, 0.55);
    box-shadow: 0 0 0 4px rgba(15, 106, 76, 0.12);
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand) 0%, #14835d 100%);
    border: none;
    color: #fff;
    font-weight: 700;
    min-height: 46px;
    box-shadow: 0 12px 24px rgba(15, 106, 76, 0.18);
}

.button-secondary {
    background: linear-gradient(180deg, #f3f7ef 0%, #e9f0e4 100%);
    color: var(--text);
    box-shadow: none;
}

.button-danger {
    background: linear-gradient(135deg, #eda132 0%, #da8c1b 100%);
    color: #fff;
}

.alert {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 14px;
    font-size: 14px;
}

.alert-error {
    background: #f8e6e6;
    color: var(--danger);
}

.alert-success {
    background: #e7f5ec;
    color: var(--brand-dark);
}

.list-row,
table {
    width: 100%;
}

.list-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.list-row:last-child {
    border-bottom: none;
}

.list-row-tight {
    padding: 0;
    border-bottom: none;
}

table {
    border-collapse: collapse;
}

th,
td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--surface-alt);
    font-size: 12px;
    color: var(--muted);
}

.tab-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.tab-pill {
    text-align: center;
    padding: 13px 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, #f3f7ef 0%, #e7efe3 100%);
    color: #456053;
    font-weight: 700;
}

.tab-pill.is-active {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
}

.order-line {
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #f7faf6 100%);
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: var(--shadow-soft);
}

.shop-meta {
    display: grid;
    justify-items: end;
    gap: 8px;
    text-align: right;
}

.shop-category-pill {
    min-width: 110px;
    justify-content: center;
    background: linear-gradient(135deg, #fff4d9 0%, #f7e5ad 100%);
    color: #7b5914;
}

.line-head,
.horizontal-line {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) 80px 90px 90px 90px;
    gap: 8px;
    min-width: 760px;
    align-items: center;
}

.line-head {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.product-search {
    position: relative;
    min-width: 360px;
}

.line-offer-hint {
    margin-top: 6px;
    padding: 5px 8px;
    border-radius: 12px;
    background: #e4f6ed;
    color: #117352;
    font-size: 11px;
    font-weight: 700;
    white-space: normal;
}

.line-offer-hint.is-hidden {
    display: none;
}

.product-offer-page {
    display: inline-flex;
    width: auto;
}

.product-offer-card .shop-meta {
    align-self: center;
}

.shop-search {
    position: relative;
}

.shop-search-input {
    width: 100%;
}

.inline-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.shop-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 24;
    display: grid;
    gap: 4px;
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(159, 181, 167, 0.46);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 24px rgba(16, 39, 29, 0.1);
}

.shop-suggestions.is-hidden {
    display: none;
}

.product-offer-badge,
.picker-item-offer {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: fit-content;
    max-width: 100%;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e4f6ed;
    color: #117352;
    font-size: 11px;
    font-weight: 700;
    white-space: normal;
}

.product-offer-badge.is-hidden,
.picker-item-offer.is-hidden {
    display: none;
}

.picker-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
}

.picker-modal.is-hidden {
    display: none;
}

.picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 24, 19, 0.34);
}

.picker-sheet {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: min(94vw, 760px);
    max-height: min(80vh, 680px);
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 12px;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid rgba(159, 181, 167, 0.42);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 50px rgba(16, 39, 29, 0.24);
}

.picker-category {
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(159, 181, 167, 0.4);
    background: linear-gradient(180deg, #f5f8f2 0%, #eaf0e5 100%);
    color: #355245;
    box-shadow: none;
    text-align: left;
    font-weight: 700;
}

.picker-category:hover,
.picker-category:focus {
    background: var(--brand-soft);
    color: #1f4332;
}

.picker-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.picker-header p {
    margin-bottom: 0;
    font-size: 13px;
    color: var(--muted);
}

.picker-close {
    width: auto;
    min-width: 84px;
    padding: 10px 14px;
}

.picker-results {
    overflow-y: auto;
    display: grid;
    gap: 6px;
    padding-right: 4px;
}

.picker-selection-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, #f5f8f2 0%, #eaf0e5 100%);
}

.picker-selection-bar.is-hidden {
    display: none;
}

.picker-selection-label {
    font-size: 14px;
    font-weight: 700;
    color: #254536;
}

.picker-change-category {
    width: auto;
    min-width: 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
    box-shadow: none;
}

.picker-item {
    display: grid;
    gap: 4px;
    text-align: left;
    align-items: start;
    justify-items: start;
    justify-content: flex-start;
    align-content: start;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(159, 181, 167, 0.28);
    background: #f5f8f4;
    color: var(--text);
    box-shadow: none;
    min-height: auto;
    width: 100%;
}

.picker-item:hover,
.picker-item:focus {
    background: var(--brand-soft);
    color: var(--text);
}

.picker-item-name {
    font-size: 14px;
    font-weight: 700;
}

.picker-item-meta {
    font-size: 12px;
    color: var(--muted);
}

.picker-empty {
    padding: 14px;
    text-align: center;
    color: var(--muted);
    border-radius: 14px;
    background: #f5f8f4;
}

.compact-input {
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
}

.line-field {
    width: 100%;
    min-width: 0;
}

.line-total-wrap {
    width: 100%;
    min-width: 0;
}

.line-total,
.summary-total {
    border: 1px solid rgba(228, 164, 59, 0.22);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff9ea 0%, #f8eed2 100%);
    padding: 10px 12px;
    font-weight: 700;
}

.line-total {
    min-height: 44px;
    display: flex;
    align-items: center;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-summary-sheet {
    border: 1px solid rgba(171, 191, 179, 0.45);
    border-radius: 14px;
    overflow: hidden;
    background: #f4f5f6;
}

.order-summary-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(171, 191, 179, 0.38);
    background: linear-gradient(180deg, #f4f5f6 0%, #eceff1 100%);
    font-size: 16px;
}

.order-summary-row span:first-child {
    font-weight: 600;
}

.order-summary-row strong {
    font-size: 17px;
}

.order-summary-row-discount strong {
    color: #9d2f2f;
}

.order-summary-divider {
    height: 4px;
    background: linear-gradient(90deg, #c89f1e 0%, #f0cf54 100%);
}

.order-summary-row-total {
    background: linear-gradient(180deg, #f8f8f9 0%, #eef1f3 100%);
    border-bottom: none;
}

.summary-total strong,
.big-number {
    font-size: clamp(1.35rem, 1.2rem + 0.9vw, 2rem);
}

.action-stack {
    display: grid;
    gap: 8px;
    min-width: 100px;
}

.line-action {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.line-action .button {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
}

.team-child-name {
    padding-left: 18px;
}

.report-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.route-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 10px;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
}

.route-dot-green {
    background: #2f9a58;
}

.route-dot-red {
    background: #d34b4b;
}

.report-name.level-1 {
    padding-left: 18px;
}

.report-toggle {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(159, 181, 167, 0.46);
    background: linear-gradient(180deg, #f6f9f4 0%, #ecf2e7 100%);
    color: var(--text);
    box-shadow: none;
}

.report-toggle.placeholder {
    border: none;
    background: transparent;
}

.report-row.is-hidden {
    display: none;
}

table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
    gap: 8px;
    box-shadow: 0 -10px 24px rgba(27, 43, 31, 0.08);
}

.bottom-nav a {
    text-align: center;
    font-size: 12px;
    color: #4c6559;
    background: linear-gradient(180deg, #ffffff 0%, #f3f7f1 100%);
    border: 1px solid rgba(159, 181, 167, 0.38);
    border-radius: 16px;
    padding: 10px 8px;
    font-weight: 600;
}

.bottom-nav a:hover,
.bottom-nav a:focus {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
    color: #fff;
}

.hidden-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 560px) {
    .feedback-toast {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-shell {
        padding: 16px 12px 108px;
    }

    .hero-grid,
    .stats-grid,
    .form-grid,
    .tab-bar {
        grid-template-columns: 1fr;
    }

    .bottom-nav {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 8px;
    }

    .action-stack {
        width: 100%;
    }

    .list-row {
        flex-direction: column;
    }

    .shop-meta {
        justify-items: start;
        text-align: left;
    }

    .bottom-nav a {
        padding: 12px 6px;
    }

    .line-head,
    .horizontal-line {
        min-width: 760px;
    }

    .picker-sheet {
        width: calc(100vw - 14px);
        bottom: 10px;
        max-height: 78vh;
        padding: 14px;
        border-radius: 20px;
    }

    .hero,
    .topbar,
    .card,
    .table-card {
        border-radius: 20px;
    }
}
