﻿:root {
    --top-nav-height: 76px;
    --bg: #fafaf9;
    --bg-soft: #f5f2ee;
    --card: #ffffff;
    --card-tint: #fffdf9;
    --border: #e7e5e4;
    --border-strong: #d6d3d1;
    --text: #292524;
    --muted: #78716c;
    --light-grey: #f5f5f4;
    --accent: #b45309;
    --accent-2: #92400e;
    --accent-soft: #ffedd5;
    --queued: #f59e0b;
    --hopper: #FCD34D;
    --drum: #ef4444;
    --cooling: #0ea5e9;
    --completed: #16a34a;
    --cancelled: #78716c;
    --shadow-sm: 0 8px 20px rgba(28, 25, 23, 0.05);
    --shadow-md: 0 16px 34px rgba(28, 25, 23, 0.08);
}

* {
    box-sizing: border-box;
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 0 0, #ffffff 0%, transparent 48%),
        radial-gradient(circle at 100% 0, #fff7ed 0%, transparent 38%),
        linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 25%, var(--bg) 100%);
    color: var(--text);
    font-family: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.45;
    padding-top: var(--top-nav-height);
}

a {
    color: inherit;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 1.15rem;
}

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: var(--top-nav-height);
    margin-top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 253, 250, 0.92);
    border-bottom: 1px solid rgba(214, 211, 209, 0.7);
    backdrop-filter: blur(10px);
    padding: 0.85rem 1.15rem;
}

.logo {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    line-height: 1;
    min-width: 170px;
}

.logo-wordmark {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: #57534e;
}

.logo-wordmark strong {
    color: var(--accent-2);
    font-weight: 800;
}

.logo-subtitle {
    margin-top: 0.2rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #a8a29e;
}

.nav-links {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #44403c;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.8rem;
    border: 1px solid transparent;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-link i {
    width: 16px;
    height: 16px;
}

.nav-link:hover {
    background: #f6f2ee;
    border-color: #ece8e4;
    color: #292524;
}

.nav-link.active {
    background: #ffffff;
    border-color: #e4ddd6;
    color: var(--accent-2);
    box-shadow: 0 2px 10px rgba(120, 53, 15, 0.07);
}

.nav-logout {
    margin: 0;
}

.nav-link-button {
    font: inherit;
    cursor: pointer;
    background: transparent;
}

/* Account dropdown */
.nav-account {
    position: relative;
}

.nav-account-toggle {
    border: none;
}

.account-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 180px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    box-shadow: var(--shadow-md);
    z-index: 200;
    padding: 0.35rem;
    overflow: hidden;
}

.account-dropdown.open {
    display: block;
}

.account-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 0.6rem;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.account-dropdown-item i {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--muted);
}

.account-dropdown-item:hover {
    background: var(--bg-soft);
}

.account-dropdown-item--danger {
    color: #b91c1c;
}

.account-dropdown-item--danger i {
    color: #b91c1c;
}

.account-dropdown-item--danger:hover {
    background: #fef2f2;
}

.account-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0.3rem 0;
}

/* Account page */
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.15rem;
    align-items: start;
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: 0.6rem;
    background: var(--bg-soft);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.input-sm {
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
}

.card {
    background: linear-gradient(180deg, var(--card) 0%, var(--card-tint) 100%);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

.card + .card {
    margin-top: 1rem;
}

.card-nb{   
    background: none;
    border: none;
    border-radius: none;
    box-shadow: none;
    padding: none;
}

.grid {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.grid > .card + .card,
.grid > .card-nb + .card,
.grid > .card + .card-nb,
.grid > .card-nb + .card-nb {
    margin-top: 0;
}

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

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

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

.grid-4-blend {
    grid-template-columns: 6fr 2fr 1fr 1fr;
}

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

.label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--muted);
    margin: 0 0 0.55rem;
    font-weight: 600;
}

.label-stage {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 0.55rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.label-stage.active {
    color: var(--text);
}

.stage-icon {
    display: inline-flex;
    align-items: center;
    padding: 8px;
    margin-right: 10px;
    border-radius: 6px;
    background-color: var(--light-grey);
}

.stage-icon.hopper.active {
    background-color: var(--hopper);
    color: #fff;
}

.stage-icon.drum.active {
    background-color: var(--drum);
    color: #fff;
}

.stage-icon.cooling.active {
    background-color: var(--cooling);
    color: #fff;
}

.stat {
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.btn {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    align-self: end; /* or center */
    border: 0;
    background: linear-gradient(180deg, #c9671c 0%, var(--accent) 100%);
    color: #fff;
    border-radius: 0.7rem;
    padding: 0.5rem 0.85rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
    gap: 8px;
}

.btn:hover {
    filter: brightness(0.98);
    box-shadow: 0 8px 16px rgba(180, 83, 9, 0.28);
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.55;
    background: var(--cancelled);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-outline {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.btn-outline:hover {
    box-shadow: 0 6px 12px rgba(41, 37, 36, 0.08);
}

.icon-btn {
    width: 15px;
}

.inline-btn {
    /*padding: 0.8rem 0.7rem;*/
    min-height: 45px;
}

.btn svg {
    display: block;
}

.icon-cancel {
    display: inline-flex;
    align-items: center;
    border: 0;
    border-radius: 0.7rem;
    padding: 0.5rem 0.85rem;
    background: none;
    color: var(--cancelled);
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
}

.icon-cancel:hover {
    color: rgb(204, 0, 0);
    background-color: rgb(248, 237, 237);
}

.inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.inline form {
    margin: 0;
    display: flex;
    align-items: center;
}

.inline-filters {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-filters label {
    margin: 0;
    white-space: nowrap;
}

.inline-filters select {
    min-width: 220px;
}

.packing-filters {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.packing-filters-customer {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    min-width: 400px;
}

.packing-filters-customer label {
    margin: 0;
    white-space: nowrap;
}

.packing-filters-customer select {
    min-width: 220px;
}


.stage-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.stage-actions form {
    margin: 0;
    display: flex;
    align-items: center;
}

.stage-actions form:first-child {
    flex: 9.5;
}

.stage-actions form:last-child {
    flex: 0.5;
}

.stage-actions button {
    width: 100%;
    justify-content: center;
}

.stage-actions .icon-cancel {
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-filters {
    align-items: flex-end;
}

.history-filters .input,
.history-filters select {
    width: 100%;
}

.history-filters .custom-select {
    width: 180px;
    min-width: 180px;
    max-width: 180px;
    flex: 0 0 180px;
}

.history-filters .input {
    flex: 1 1 260px;
    min-width: 220px;
}

.history-filters select {
    min-width: 170px;
}

label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.87rem;
    color: #57534e;
    font-weight: 600;
}


.input,
select,
textarea {
    width: 100%;
    min-height: 45px;
    border: 1px solid var(--border);
    border-radius: 0.72rem;
    padding: 0.58rem 0.7rem;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 500;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select {
    border-color: #d6d3d1;
    border-radius: 0.8rem;
}

select:hover {
    background-color: #f5f5f4;
    border-color: #cfcac6;
}

select[multiple] {
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    padding-right: 0.7rem;
    background-image: none;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select > select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    width: 100%;
    min-height: 40px;
    border: 1px solid #d6d3d1;
    border-radius: 0.8rem;
    background: #fff;
    color: var(--text);
    padding: 0.58rem 0.7rem;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.custom-select-trigger:hover {
    background: #f5f5f4;
    border-color: #cfcac6;
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus-visible {
    outline: none;
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.14);
}

.custom-select-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-value.is-placeholder {
    color: #78716c;
}

.custom-select-arrow {
    width: 10px;
    height: 10px;
    border-right: 2px solid #78716c;
    border-bottom: 2px solid #78716c;
    transform: rotate(45deg);
    transition: transform 0.14s ease;
    margin-top: -4px;
    flex: 0 0 auto;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(-135deg);
    margin-top: 2px;
}

.custom-select-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.35rem);
    background: #fff;
    border: 1px solid #d6d3d1;
    border-radius: 0.8rem;
    box-shadow: 0 16px 34px rgba(28, 25, 23, 0.14);
    padding: 0.32rem;
    max-height: 220px;
    overflow: auto;
    z-index: 120;
}

.custom-select.open .custom-select-menu {
    display: block;
}

.custom-select-option {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: #292524;
    border-radius: 0.55rem;
    padding: 0.48rem 0.55rem;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.custom-select-option:hover {
    background: #f1efed;
}

.custom-select-option.selected {
    background: #ece9e6;
    font-weight: 600;
}

.custom-select-option[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.custom-select.invalid .custom-select-trigger {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

select option {
    background: #fff;
    color: var(--text);
}

select option:checked {
    background: #ece9e6;
}

textarea {
    resize: vertical;
    min-height: 2.3rem;
}

.input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.14);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: 0.9rem;
    overflow: hidden;
    background: #fff;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid var(--border);
    padding: 0.68rem 0.58rem;
    font-size: 0.9rem;
    vertical-align: top;
}

tbody tr:last-child td {
    border-bottom: 0;
}

thead th {
    position: sticky;
    top: 0;
    background: #fcfaf8;
    z-index: 1;
}

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

.mono {
    font-family: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.58rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.status-queued,
.status-hopper {
    color: #78350f;
    background: #fef3c7;
}

.status-drum {
    color: #7f1d1d;
    background: #fee2e2;
}

.status-cooling {
    color: #0c4a6e;
    background: #e0f2fe;
}

.status-completed {
    color: #14532d;
    background: #dcfce7;
}

.status-cancelled {
    color: #44403c;
    background: #dadada;
}

.status-active {
    color: #14532d;
    background: #dcfce7;
}

.stage {
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 0.9rem;
    margin-bottom: 0.85rem;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
    background: #fff;
    border-color: #d6d3d1;
}

.stage.active::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #22c55e;
    position: absolute;
    right: 0.8rem;
    top: 0.8rem;
    animation: pulse 1.3s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    70% {
        opacity: 0.35;
        transform: scale(1.35);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.stage.hopper.active {
    background: #fffbeb;
    border-color: #fde68a;
}

.stage.drum.active {
    background: #fef2f2;
    border-color: #fecaca;
}

.stage.cooling.active {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.stage .empty {
    color: var(--muted);
    font-style: italic;
    margin: 0.35rem 0 0;
}

.stack-arrow {
    text-align: center;
    color: #a8a29e;
    margin: -0.1rem 0 0.4rem;
}

.toast {
    padding: 0.76rem 0.9rem;
    border-radius: 0.76rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-weight: 600;
}

.toast.ok {
    background: #dcfce7;
    color: #14532d;
    border-color: #86efac;
}

.toast.err {
    background: #fee2e2;
    color: #7f1d1d;
    border-color: #fca5a5;
}

.login-body {
    padding-top: 0;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.login-panel {
    width: min(100%, 420px);
    padding: 1.5rem;
}

.login-brand h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.3rem);
}

.login-eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent-2);
    font-weight: 700;
}

.login-copy {
    margin: 0.45rem 0 0;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 0.9rem;
    margin-top: 1.25rem;
}

.login-form .btn {
    justify-content: center;
}

.login-help {
    margin-top: 1rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid #fed7aa;
    border-radius: 0.8rem;
    background: #fff7ed;
    color: #9a3412;
    font-size: 0.92rem;
}

.stage-line {
    display: flex;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.48rem;
    font-size: 0.72rem;
    font-weight: 600;
    background: #f8f6f3;
    border: 1px solid var(--border);
    margin-right: 0.28rem;
    margin-left: auto;
}

.queue-item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid #ece9e6;
    border-radius: 0.85rem;
    padding: 1rem;
    margin-bottom: 0.62rem;
    background: #fff;
    box-shadow: 0 2px 8px rgba(41, 37, 36, 0.03);
}

.queue-list {
    position: relative;
}

.queue-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 0.7rem;
    background: none;
    color: #78716c;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
    margin-left: -0.5rem;
}

.queue-handle:active {
    cursor: grabbing;
}

.queue-item-dragging {
    position: fixed;
    z-index: 30;
    opacity: 0.96;
    box-shadow: 0 16px 36px rgba(41, 37, 36, 0.18);
    cursor: grabbing;
}

.queue-placeholder {
    margin-bottom: 0.62rem;
    border: 1px dashed #d6d3d1;
    border-radius: 0.85rem;
    background: #faf8f6;
}

.admin-item {
    flex-direction: column;
    align-items: stretch;
}

.tabs {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
    flex-wrap: wrap;
}

.tab {
    text-decoration: none;
    padding: 0.43rem 0.76rem;
    border-radius: 0.7rem;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.tab:hover {
    background: #f9f7f4;
}

.tab.active {
    background: var(--accent-soft);
    border-color: #f6c083;
    color: #7c2d12;
}

.chart-wrap {
    position: relative;
    width: 100%;
    min-height: 220px;
}

.chart-wrap-md {
    height: 220px;
}

.chart-wrap-lg {
    height: 300px;
}

.chart-wrap > canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
}

small {
    color: #78716c;
}

.stage-time {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.dim {
    opacity: 0.64;
}

@media (max-width: 1024px) {
    .grid-4,
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    :root {
        --top-nav-height: 112px;
    }

    .top-nav {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.7rem;
    }

    .logo {
        min-width: auto;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-link {
        padding: 0.45rem 0.65rem;
    }

    .container {
        padding: 0.9rem;
    }

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

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

    .queue-modal-trigger {
        margin-left: 0;
    }

    .history-filters .input,
    .history-filters select,
    .history-filters .custom-select,
    .history-filters .btn {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .nav-link span {
        display: none;
    }

    .logo-subtitle {
        display: none;
    }

    th,
    td {
        font-size: 0.84rem;
    }
}

.admin-edit-panel {
    display: none;
    margin-top: 0.6rem;
}

.admin-edit-panel.open {
    display: block;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-family: inherit;
}

.toggle input {
    display: none; /* hide default checkbox */
}

.slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

/* When checked */
.toggle input:checked + .slider {
    background-color:var(--accent);
}

.toggle input:checked + .slider::before {
    transform: translateX(20px);
}

.queue-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.queue-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.qty {
    display: block;
    margin-top: 4px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.section-head .label {
    margin-bottom: 0;
}

.queue-modal-trigger {
    margin-left: auto;
}

.modal-open {
    overflow: hidden;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal-shell[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 25, 23, 0.55);
    backdrop-filter: blur(3px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(100%, 560px);
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    background: linear-gradient(180deg, var(--card) 0%, var(--card-tint) 100%);
    border: 1px solid var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    padding: 1rem;
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-title {
    margin: 0;
    font-size: 1.15rem;
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
}

.modal-form {
    gap: 0.85rem;
}

.qty-option-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.45rem;
}

.qty-option {
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--text);
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.qty-option:hover {
    border-color: #d97706;
    color: #9a3412;
}

.qty-option.active {
    background: var(--accent-soft);
    border-color: #f6c083;
    color: #7c2d12;
    box-shadow: 0 6px 16px rgba(180, 83, 9, 0.12);
}

.qty-option-hint {
    margin: 0.55rem 0 0;
}

.stock-option-list {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.45rem;
}

.stock-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.stock-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.stock-option span {
    display: block;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--text);
    border-radius: 0.9rem;
    padding: 0.75rem 0.9rem;
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.stock-option:hover span {
    border-color: #d97706;
    color: #9a3412;
}

.stock-option input:checked + span {
    background: var(--accent-soft);
    border-color: #f6c083;
    color: #7c2d12;
    box-shadow: 0 6px 16px rgba(180, 83, 9, 0.12);
}

.stock-option input:focus-visible + span {
    border-color: #d97706;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.14);
}
