:root {
    --ink: #17312b;
    --ink-soft: #5d756d;
    --cream: #fbf7ef;
    --card: rgba(255, 253, 248, 0.92);
    --line: rgba(23, 49, 43, 0.12);
    --accent: #f37824;
    --accent-deep: #bf510d;
    --success: #1e7f4f;
    --warning: #c06416;
    --pending: #6e7f78;
    --danger: #b73a2a;
    --shadow: 0 24px 80px rgba(23, 49, 43, 0.12);
    font-family: "Space Grotesk", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(243, 120, 36, 0.2), transparent 24%),
        radial-gradient(circle at bottom right, rgba(23, 49, 43, 0.1), transparent 18%),
        linear-gradient(160deg, #fff8ef 0%, #eef5ef 100%);
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    background: transparent;
}

h1, h2, h3 {
    font-family: "Newsreader", serif;
    margin: 0;
}

p {
    margin: 0;
}

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

.app-shell {
    min-height: 100vh;
}

.topbar {
    padding: 1rem 1rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand-block {
    display: grid;
    gap: 0.15rem;
}

.brand-eyebrow,
.screen-eyebrow,
.meta-label {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: var(--ink-soft);
}

.brand-title {
    font-size: 1.2rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-user {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.content-shell {
    padding: 1rem 1rem 6rem;
    display: grid;
    gap: 1rem;
}

.screen-card {
    background: var(--card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 1.6rem;
    box-shadow: var(--shadow);
    padding: 1.15rem;
    display: grid;
    gap: 1rem;
}

.hero-card,
.detail-card {
    gap: 1.1rem;
}

.hero-copy,
.detail-copy {
    display: grid;
    gap: 0.4rem;
}

.hero-copy h1,
.detail-copy h1,
.login-card h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    line-height: 0.96;
}

.toolbar-stack {
    display: grid;
    gap: 0.75rem;
}

.search-input {
    font-size: 1rem;
}

.delivery-grid,
.line-list {
    display: grid;
    gap: 1rem;
}

.delivery-card {
    border: 1px solid var(--line);
    border-radius: 1.45rem;
    background: rgba(255, 255, 255, 0.72);
    padding: 1rem;
    display: grid;
    gap: 0.55rem;
    text-align: left;
    color: inherit;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.delivery-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(23, 49, 43, 0.08);
    border-color: rgba(243, 120, 36, 0.35);
}

.delivery-card-head,
.delivery-card-foot,
.detail-header,
.entry-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.delivery-type {
    font-size: 0.86rem;
    color: var(--ink-soft);
}

.delivery-meta,
.line-subtitle,
.line-exact,
.login-intro {
    color: var(--ink-soft);
}

.status-pill,
.line-state,
.remaining-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.34rem 0.72rem;
    font-size: 0.86rem;
    font-weight: 600;
}

.status-pill.is-draft {
    background: rgba(243, 120, 36, 0.12);
    color: var(--accent-deep);
}

.status-pill.is-approved {
    background: rgba(30, 127, 79, 0.12);
    color: var(--success);
}

.line-state.is-complete,
.remaining-indicator.is-complete {
    background: rgba(30, 127, 79, 0.12);
    color: var(--success);
}

.line-state.is-warning,
.remaining-indicator.is-warning {
    background: rgba(192, 100, 22, 0.12);
    color: var(--warning);
}

.line-state.is-pending,
.remaining-indicator.is-pending {
    background: rgba(93, 117, 109, 0.12);
    color: var(--pending);
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.line-card {
    gap: 0.85rem;
}

.line-header {
    display: grid;
    gap: 0.65rem;
}

.entry-list {
    display: grid;
    gap: 0.8rem;
}

.entry-row {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.75fr) auto;
    align-items: end;
}

.entry-empty {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem 0.95rem;
    border: 1px dashed rgba(23, 49, 43, 0.16);
    border-radius: 1.2rem;
    background: rgba(255, 255, 255, 0.45);
}

.field {
    display: grid;
    gap: 0.42rem;
}

.field label {
    font-size: 0.9rem;
}

.input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(23, 49, 43, 0.18);
    border-radius: 1rem;
    padding: 0.95rem 1rem;
    background: rgba(255, 255, 255, 0.86);
    color: var(--ink);
    font: inherit;
}

.login-shell {
    min-height: calc(100vh - 90px);
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(520px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 1.7rem;
    box-shadow: var(--shadow);
    padding: 1.4rem;
    display: grid;
    gap: 1rem;
}

.login-form {
    display: grid;
    gap: 1rem;
}

.primary-button,
.ghost-button,
.icon-button {
    border: 0;
    border-radius: 999px;
    font: inherit;
    cursor: pointer;
}

.primary-button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
    color: white;
    padding: 0.95rem 1.3rem;
    box-shadow: 0 14px 30px rgba(243, 120, 36, 0.24);
}

.ghost-button {
    padding: 0.8rem 1.15rem;
    background: rgba(255, 255, 255, 0.6);
    color: var(--ink);
    border: 1px solid rgba(23, 49, 43, 0.1);
}

.large-button {
    width: 100%;
    min-height: 3.4rem;
}

.icon-button {
    width: 2.7rem;
    height: 2.7rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(23, 49, 43, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
}

.icon-button svg {
    width: 1rem;
    height: 1rem;
}

.sticky-savebar {
    position: sticky;
    bottom: 1rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 1.5rem;
    border: 1px solid rgba(23, 49, 43, 0.12);
    background: rgba(255, 252, 245, 0.94);
    box-shadow: 0 20px 40px rgba(23, 49, 43, 0.12);
    backdrop-filter: blur(14px);
}

.error-text {
    color: var(--danger);
}

.success-text {
    color: var(--success);
}

.empty-card {
    text-align: center;
}

#blazor-error-ui {
    display: none;
}

@media (min-width: 860px) {
    .content-shell {
        padding: 1.25rem 1.25rem 6rem;
    }

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

    .line-header {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding: 0.85rem 0.85rem 0;
    }

    .content-shell {
        padding: 0.85rem 0.85rem 5.5rem;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr 1fr;
    }

    .entry-row {
        grid-template-columns: 1fr;
    }

    .sticky-savebar {
        grid-template-columns: 1fr;
        display: grid;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }
}
