:root {
    --navy-950: #0b1f33;
    --navy-900: #122e47;
    --navy-700: #1f4a68;
    --teal-700: #147d7f;
    --teal-500: #24a0a0;
    --cream: #f5f7f6;
    --paper: #ffffff;
    --ink: #183143;
    --muted: #647584;
    --line: #d9e2e5;
    --line-strong: #b8c9cf;
    --danger: #a63838;
    --danger-bg: #fff3f1;
    --success: #126b54;
    --success-bg: #edf9f3;
    --shadow: 0 20px 55px rgba(16, 50, 72, .11);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--cream);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 92% 3%, rgba(36, 160, 160, .11), transparent 20rem),
        var(--cream);
}

.topbar {
    align-items: center;
    background: var(--navy-950);
    color: #fff;
    display: flex;
    gap: 14px;
    min-height: 86px;
    padding: 18px max(24px, calc((100% - 1160px) / 2));
}

.brand-mark {
    align-items: center;
    background: var(--teal-500);
    border-radius: 13px;
    display: flex;
    font-size: 1.05rem;
    font-weight: 800;
    height: 48px;
    justify-content: center;
    letter-spacing: .04em;
    width: 48px;
}

.topbar h1,
.topbar p {
    margin: 0;
}

.topbar h1 {
    font-size: 1.08rem;
    font-weight: 650;
    letter-spacing: .01em;
}

.eyebrow {
    color: #88d1cc;
    font-size: .69rem;
    font-weight: 750;
    letter-spacing: .15em;
    margin: 0 0 3px;
    text-transform: uppercase;
}

.page-shell {
    margin: 0 auto;
    max-width: 1160px;
    padding: 62px 24px 80px;
}

.intro {
    align-items: end;
    display: flex;
    gap: 32px;
    justify-content: space-between;
    margin-bottom: 32px;
}

.intro h2 {
    color: var(--navy-950);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.05rem, 4vw, 3.65rem);
    font-weight: 500;
    letter-spacing: -.045em;
    line-height: 1.04;
    margin: 0;
    max-width: 700px;
}

.intro .eyebrow {
    color: var(--teal-700);
    margin-bottom: 12px;
}

.intro-copy {
    color: var(--muted);
    font-size: 1rem;
    margin: 16px 0 0;
    max-width: 690px;
}

.schema-note {
    background: var(--navy-900);
    border-radius: 15px;
    color: #edf9fa;
    display: grid;
    gap: 2px;
    min-width: 205px;
    padding: 18px 19px;
}

.schema-note-label {
    color: #9ddbd4;
    font-size: .68rem;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.schema-note strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 1.1rem;
    letter-spacing: .02em;
}

.schema-note span:last-child {
    color: #c1d5dc;
    font-size: .78rem;
}

.alert {
    border: 1px solid;
    border-radius: 12px;
    font-size: .93rem;
    margin: 0 0 18px;
    padding: 15px 18px;
}

.alert ul {
    margin: 7px 0 0 20px;
    padding: 0;
}

.alert-success {
    background: var(--success-bg);
    border-color: #b8e4d0;
    color: var(--success);
}

.alert-error {
    background: var(--danger-bg);
    border-color: #efc4be;
    color: var(--danger);
}

.inventory-form {
    background: var(--paper);
    border: 1px solid rgba(184, 201, 207, .65);
    border-radius: 20px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.form-section {
    border-bottom: 1px solid var(--line);
    padding: 34px 42px 40px;
}

.section-heading {
    align-items: flex-start;
    display: flex;
    gap: 17px;
    margin-bottom: 30px;
}

.section-number {
    align-items: center;
    background: #e8f4f3;
    border-radius: 9px;
    color: var(--teal-700);
    display: flex;
    flex: 0 0 auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .76rem;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    letter-spacing: .03em;
    width: 40px;
}

.section-heading h3 {
    color: var(--navy-950);
    font-size: 1.12rem;
    margin: 0 0 4px;
}

.section-heading p {
    color: var(--muted);
    font-size: .88rem;
    margin: 0;
}

.field-grid {
    display: grid;
    gap: 22px 20px;
}

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

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

.field-span-2 {
    grid-column: span 2;
}

.field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.field label {
    color: #284457;
    font-size: .82rem;
    font-weight: 750;
    margin-bottom: 8px;
}

.required {
    color: var(--teal-700);
    font-weight: 850;
}

.field input,
.field select,
.field textarea {
    appearance: none;
    background-color: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    color: var(--ink);
    font: inherit;
    font-size: .92rem;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
    width: 100%;
}

.field input,
.field select {
    min-height: 46px;
    padding: 10px 13px;
}

.field textarea {
    min-height: 124px;
    padding: 12px 13px;
    resize: vertical;
}

.field select {
    background-image: linear-gradient(45deg, transparent 50%, var(--teal-700) 50%), linear-gradient(135deg, var(--teal-700) 50%, transparent 50%);
    background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
    padding-right: 34px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px rgba(36, 160, 160, .13);
}

.field input:invalid:not(:placeholder-shown),
.field select:invalid,
.field textarea:invalid:not(:placeholder-shown),
.was-validated .field input:invalid,
.was-validated .field select:invalid,
.was-validated .field textarea:invalid {
    border-color: #d9877c;
}

.field small {
    color: var(--muted);
    font-size: .73rem;
    margin-top: 7px;
}

.input-with-suffix {
    align-items: center;
    display: flex;
    gap: 8px;
}

.input-with-suffix input {
    min-width: 0;
}

.input-with-suffix span {
    color: var(--muted);
    flex: 0 0 auto;
    font-size: .66rem;
    white-space: nowrap;
}

.form-actions {
    align-items: center;
    display: flex;
    gap: 22px;
    justify-content: space-between;
    padding: 24px 42px;
}

.form-actions p {
    color: var(--muted);
    font-size: .78rem;
    margin: 0;
}

.actions-right {
    display: flex;
    gap: 12px;
}

.button {
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: .88rem;
    font-weight: 750;
    min-height: 45px;
    padding: 0 20px;
    transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

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

.button:focus-visible {
    outline: 3px solid rgba(36, 160, 160, .35);
    outline-offset: 2px;
}

.button-primary {
    background: var(--teal-700);
    box-shadow: 0 6px 16px rgba(20, 125, 127, .2);
    color: #fff;
}

.button-primary:hover {
    background: #0d6c6e;
}

.button-secondary {
    background: #edf1f2;
    color: var(--navy-700);
}

.button-secondary:hover {
    background: #e1e9eb;
}

@media (max-width: 880px) {
    .intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .schema-note {
        min-width: 240px;
    }

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

    .field-span-2 {
        grid-column: span 2;
    }
}

@media (max-width: 620px) {
    .page-shell {
        padding: 38px 14px 48px;
    }

    .topbar {
        padding: 15px 16px;
    }

    .intro h2 {
        font-size: 2.25rem;
    }

    .form-section {
        padding: 28px 20px 30px;
    }

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

    .field-span-2 {
        grid-column: auto;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column;
        padding: 20px;
    }

    .actions-right {
        flex-direction: column-reverse;
    }

    .button {
        width: 100%;
    }

    .input-with-suffix span {
        display: none;
    }
}
