:root {
    --bg: #eef2ff;
    --bg-2: #f8fafc;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-strong: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #0f766e;
    --primary-2: #14b8a6;
    --primary-dark: #115e59;
    --accent: #f97316;
    --danger: #dc2626;
    --success: #16a34a;
    --line: rgba(15, 23, 42, 0.10);
    --line-strong: rgba(15, 23, 42, 0.14);
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
    --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
    --radius: 24px;
    --radius-sm: 16px;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Segoe UI Variable Text", "Segoe UI", "Bahnschrift", Tahoma, Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.20), transparent 28%),
        radial-gradient(circle at top right, rgba(249, 115, 22, 0.14), transparent 26%),
        linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
    background-attachment: fixed;
}

.bg-orb {
    position: fixed;
    inset: auto;
    border-radius: 999px;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
}

.bg-orb-1 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.30), rgba(20, 184, 166, 0));
    top: -80px;
    right: 4%;
}

.bg-orb-2 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.24), rgba(249, 115, 22, 0));
    bottom: -120px;
    left: 0;
}

.shell {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px 18px 48px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px 22px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.74));
    border-radius: calc(var(--radius) + 2px);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    backdrop-filter: blur(16px);
}

.brand {
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.subtitle {
    color: var(--muted);
    margin-top: 4px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.operator-box {
    padding: 12px 14px;
    min-width: 180px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.10), rgba(20, 184, 166, 0.06));
    border: 1px solid rgba(15, 118, 110, 0.16);
    text-align: right;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.operator-box span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.operator-box strong {
    font-size: 1rem;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.nav a,
.button-link,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.nav a {
    color: var(--text);
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: var(--shadow-soft);
}

.nav a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 16px 30px rgba(15, 118, 110, 0.22);
}

.button-link,
button {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    box-shadow: 0 16px 30px rgba(15, 118, 110, 0.22);
    cursor: pointer;
}

.nav a:hover,
.button-link:hover,
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 34px rgba(15, 118, 110, 0.26);
}

[hidden],
.is-hidden {
    display: none !important;
}

.content {
    display: grid;
    gap: 18px;
}

.grid-two {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
}

.card {
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.80));
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--shadow);
    padding: 24px;
    backdrop-filter: blur(16px);
}

.soft-card {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.86));
}

.hero-card h1,
.card h1,
.card h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.muted {
    color: var(--muted);
}

.card p {
    line-height: 1.6;
}

.small {
    font-size: 0.92rem;
}

.scanner-layout {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.camera-box {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.03), rgba(255, 255, 255, 0.95));
}

.camera-view {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 18px;
    background: #020617;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.camera-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(15, 23, 42, 0.10);
}

.scanner-status {
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.5;
}

.search-shell {
    display: grid;
    gap: 12px;
}

.search-input-wrap {
    position: relative;
}

.autocomplete-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.16);
    overflow: hidden;
    display: grid;
}

.autocomplete-item {
    width: 100%;
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    text-align: left;
    background: transparent;
    color: var(--text);
    box-shadow: none;
    cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item:focus {
    background: rgba(20, 184, 166, 0.08);
    box-shadow: none;
    transform: none;
}

.autocomplete-item strong {
    font-size: 0.98rem;
}

.autocomplete-item span {
    color: var(--muted);
    font-size: 0.88rem;
}

.autocomplete-empty {
    padding: 14px;
    color: var(--muted);
}

.autocomplete-add {
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(249, 115, 22, 0.07);
}

.product-preview {
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(20, 184, 166, 0.05));
    border: 1px solid rgba(15, 118, 110, 0.14);
}

.product-preview strong,
.product-preview span {
    display: block;
}

.product-preview strong {
    margin-bottom: 4px;
}

.product-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #065f46;
    background: rgba(220, 252, 231, 0.95);
    border: 1px solid rgba(187, 247, 208, 0.9);
    width: fit-content;
}

.scanner-note {
    padding: 12px 14px;
    border-radius: 16px;
    color: #0f172a;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.12);
}

.stack-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.stack-form label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="file"] {
    width: 100%;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.96);
    font: inherit;
    color: var(--text);
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

input:focus {
    outline: 3px solid rgba(20, 184, 166, 0.18);
    border-color: rgba(20, 184, 166, 0.55);
}

.flash {
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    font-weight: 600;
}

.flash-success {
    color: #065f46;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.flash-error {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.alert-card {
    border-left: 6px solid var(--accent);
}

.plain-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 10px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 18px;
}

.compact-head {
    margin-bottom: 14px;
}

.compact-head {
    margin-bottom: 14px;
}

.filter-row {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.summary-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 18px;
}

.summary-box {
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(255, 255, 255, 0.92));
    border: 1px solid rgba(15, 118, 110, 0.12);
    box-shadow: var(--shadow-soft);
}

.summary-box span {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.summary-box strong {
    font-size: 1.2rem;
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: var(--shadow-soft);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
    background: var(--panel-strong);
}

th,
td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    vertical-align: top;
}

th {
    background: linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(15, 118, 110, 0.04));
    font-size: 0.92rem;
    color: #0f172a;
}

tr:hover td {
    background: rgba(20, 184, 166, 0.03);
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 22px 12px;
}

@media (max-width: 900px) {
    .grid-two,
    .scanner-layout,
    .filter-row,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .topbar,
    .section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .operator-box {
        text-align: left;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    .shell {
        padding: 14px 10px 28px;
    }

    .topbar,
    .card {
        padding: 16px;
        border-radius: 18px;
    }

    .brand {
        font-size: 1.2rem;
    }

    .nav {
        position: sticky;
        top: 8px;
        z-index: 10;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding: 10px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.72);
        backdrop-filter: blur(14px);
        box-shadow: var(--shadow-soft);
    }

    .nav a,
    .button-link,
    button {
        width: 100%;
    }

    .camera-toolbar {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .camera-toolbar button {
        width: 100%;
    }

    .scanner-layout {
        gap: 12px;
    }

    .product-chip {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .autocomplete-menu {
        top: calc(100% + 6px);
        max-height: 44vh;
        overflow: auto;
    }

    .camera-box,
    .product-preview,
    .scanner-note {
        border-radius: 16px;
    }

    .section-head {
        gap: 12px;
    }

    .search-shell {
        gap: 10px;
    }

    .compact-head h2 {
        font-size: 1.05rem;
    }

    .summary-box strong {
        font-size: 1.05rem;
    }
}
