:root {
    --bg: #f4efe4;
    --bg-strong: #e7dcc6;
    --panel: rgba(255, 251, 245, 0.86);
    --panel-border: rgba(89, 64, 32, 0.12);
    --ink: #1e1a16;
    --muted: #6c6152;
    --accent: #0e6b58;
    --accent-strong: #0a4b3f;
    --accent-soft: #d9efe8;
    --danger: #9f2d2d;
    --shadow: 0 18px 40px rgba(63, 42, 19, 0.08);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

html {
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 35%),
        linear-gradient(160deg, #efe7d7 0%, #f5f1e8 45%, #ece2d0 100%);
}

body {
    margin: 0;
    min-height: 100vh;
}

a {
    color: inherit;
}

.shell {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 6px 0 8px;
    font-family: "IBM Plex Serif", Georgia, serif;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.02;
}

.eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    color: var(--accent);
    font-weight: 700;
}

.intro {
    margin: 0;
    max-width: 760px;
    color: var(--muted);
    line-height: 1.6;
}

.topbar-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inline-form {
    margin: 0;
}

.content {
    display: grid;
    gap: 18px;
}

.panel {
    background: var(--panel);
    backdrop-filter: blur(10px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.search-form,
.login-form {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: end;
}

.stack-form {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 8px;
    flex: 1 1 280px;
}

.field span {
    font-size: 0.92rem;
    color: var(--muted);
}

input {
    width: 100%;
    border: 1px solid rgba(37, 25, 9, 0.14);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink);
}

select {
    width: 100%;
    border: 1px solid rgba(37, 25, 9, 0.14);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink);
}

input:focus {
    outline: 2px solid rgba(14, 107, 88, 0.22);
    border-color: var(--accent);
}

.button,
.page-chip,
.ghost-link,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 999px;
    transition: 160ms ease;
}

.button {
    border: 0;
    cursor: pointer;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
    color: #fff;
    font-weight: 700;
    min-width: 120px;
}

.button:hover {
    transform: translateY(-1px);
}

.ghost-link,
.ghost-button,
.page-chip {
    padding: 10px 14px;
    border: 1px solid rgba(30, 26, 22, 0.12);
    background: rgba(255, 255, 255, 0.55);
    color: var(--ink);
}

.ghost-button {
    cursor: pointer;
    font: inherit;
}

.page-chip.active {
    background: var(--accent-soft);
    border-color: rgba(14, 107, 88, 0.2);
    color: var(--accent-strong);
    font-weight: 700;
}

.stats-grid,
.detail-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(228, 244, 238, 0.88));
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid rgba(14, 107, 88, 0.09);
    box-shadow: var(--shadow);
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 1.8rem;
}

.stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid rgba(30, 26, 22, 0.08);
    text-align: left;
    vertical-align: top;
}

th {
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.table-link {
    text-decoration: none;
    color: var(--accent-strong);
    font-weight: 700;
}

.numeric {
    text-align: right;
    white-space: nowrap;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.definition-list {
    display: grid;
    gap: 14px;
    margin: 0;
}

.definition-list div {
    display: grid;
    gap: 4px;
}

.definition-list dt {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.definition-list dd {
    margin: 0;
    font-size: 1.02rem;
}

.detail-card h2,
.error-panel h2 {
    margin-top: 0;
    font-family: "IBM Plex Serif", Georgia, serif;
}

.empty-state {
    color: var(--muted);
    text-align: center;
    padding: 30px 12px;
}

.login-shell {
    display: grid;
    place-items: center;
    min-height: 55vh;
}

.login-panel {
    width: min(480px, 100%);
}

.notice {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(14, 107, 88, 0.08);
    color: var(--accent-strong);
}

.notice.error,
.error-panel {
    background: rgba(159, 45, 45, 0.08);
    color: #561313;
}

.intro-text {
    color: var(--muted);
    line-height: 1.6;
}

.code-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.code-note code {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(30, 26, 22, 0.06);
}

.select-field {
    appearance: none;
}

.highlight-row td {
    background: rgba(14, 107, 88, 0.08);
    font-weight: 700;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.stock-badge.ok {
    background: rgba(14, 107, 88, 0.12);
    color: var(--accent-strong);
}

.stock-badge.low {
    background: rgba(194, 127, 28, 0.14);
    color: #8a5605;
}

.stock-badge.out {
    background: rgba(159, 45, 45, 0.12);
    color: #7e1f1f;
}

@media (max-width: 720px) {
    .shell {
        width: min(100vw - 20px, 1180px);
        padding-top: 20px;
    }

    .topbar {
        flex-direction: column;
    }

    th,
    td {
        padding: 12px 8px;
    }

    .button,
    .field,
    .login-panel {
        width: 100%;
    }
}
