:root {
    color-scheme: light;
    --ink: #111827;
    --muted: #737373;
    --line: #dedede;
    --paper: #ffffff;
    --panel: #ffffff;
    --brand: #111827;
    --brand-strong: #111827;
    --accent: #f59e0b;
    --shadow: 0 18px 45px rgba(0, 0, 0, .08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--paper);
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

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

.page-shell {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 86px 18px 36px;
}

.auth-page,
.welcome-page {
    background: var(--paper);
}

.auth-page .page-shell,
.welcome-page .page-shell {
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding-top: 28px;
}

.welcome-screen {
    display: grid;
    min-height: calc(100vh - 56px);
    place-items: center;
    position: relative;
}

.welcome-screen::before,
.auth-shell.single::before {
    display: none;
}

.welcome-content {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(100%, 420px);
    justify-items: center;
    gap: 18px;
    padding: 24px;
    text-align: center;
}

.hero-logo {
    width: 200px;
    height: 200px;
    filter: none;
}

.welcome-content h1 {
    margin: 0;
    color: #0b1220;
    font-size: clamp(2rem, 8vw, 3.25rem);
    line-height: .98;
    font-weight: 900;
}

.welcome-button {
    margin-top: 42px;
    width: min(100%, 280px);
}

.install-button {
    display: inline-flex;
    width: min(100%, 280px);
    min-height: 50px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7d7d7;
    border-radius: 6px;
    background: white;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 850;
    box-shadow: none;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.install-button:hover {
    border-color: #a8a8a8;
    background: #f7f7f7;
}

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

.install-button[hidden] {
    display: none;
}

.install-help {
    width: min(100%, 320px);
    margin: -6px 0 0;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.45;
}

.install-help[hidden] {
    display: none;
}

.auth-shell {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 28px;
    align-items: center;
}

.auth-shell.single {
    grid-template-columns: minmax(0, 480px);
    justify-content: center;
}

.auth-brand {
    padding: 16px;
}

.brand-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: var(--ink);
    color: white;
    font-weight: 900;
}

.brand-mark.large {
    width: 66px;
    height: 66px;
    font-size: 1.7rem;
}

.app-logo {
    display: block;
    object-fit: contain;
}

.topbar-logo {
    width: 54px;
    height: 54px;
}

.eyebrow {
    margin: 22px 0 8px;
    color: var(--brand-strong);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

.auth-brand h1 {
    max-width: 560px;
    margin-bottom: 16px;
    font-size: clamp(2.35rem, 7vw, 4.7rem);
    line-height: .96;
}

.auth-brand p:last-child {
    max-width: 470px;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 38px;
    border: 1px solid #dedede;
    border-radius: 6px;
    background: white;
    box-shadow: 0 14px 42px rgba(0, 0, 0, .06);
}

.form-heading {
    display: block;
    margin-bottom: 26px;
}

.form-heading h2 {
    margin-bottom: 0;
    color: #0b1220;
    font-size: 1.75rem;
    font-weight: 900;
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: #5f6368;
    font-size: .82rem;
    font-weight: 700;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

input,
select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    background: white;
    color: var(--ink);
    font-family: inherit;
    font-size: .96rem;
    font-weight: 650;
    outline: none;
    padding: 0 16px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, #737373 50%),
        linear-gradient(135deg, #737373 50%, transparent 50%);
    background-position:
        calc(100% - 20px) 20px,
        calc(100% - 14px) 20px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 42px;
}

select:disabled {
    color: #9ca3af;
    background-color: white;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    box-shadow: 0 0 0 1000px white inset;
    transition: background-color 9999s ease-in-out 0s;
}

label.is-focused input,
label.is-focused select,
input:focus,
select:focus {
    border-color: rgba(17, 24, 39, .18);
    background: white;
    box-shadow: 0 0 0 4px rgba(17, 24, 39, .06);
}

[hidden] {
    display: none !important;
}

.primary-button {
    display: inline-flex;
    width: 100%;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: #0b1220;
    color: white;
    cursor: pointer;
    font: inherit;
    font-weight: 850;
    transition: transform .2s ease, background .2s ease;
}

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

.primary-button:hover {
    background: #172033;
}

.secondary-button {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    border: 1px solid #d7d7d7;
    border-radius: 6px;
    background: white;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-weight: 850;
    padding: 0 18px;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.secondary-button:hover {
    border-color: #a8a8a8;
    background: #f7f7f7;
}

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

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid #fecdd3;
    border-radius: 6px;
    background: #fff1f2;
    color: #9f1239;
    font-weight: 750;
    transition: opacity .2s ease, transform .2s ease;
}

.alert.is-dismissing {
    opacity: 0;
    transform: translateY(-4px);
}

.alert.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.credentials-box {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
}

.credentials-box p {
    margin: 8px 0 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: .9rem;
}

.app-topbar {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    height: 68px;
    align-items: center;
    justify-content: space-between;
    padding: 10px max(18px, calc((100vw - 1120px) / 2 + 18px));
    border-bottom: 1px solid #e5e5e5;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(20px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 700;
}

.brand strong {
    font-size: 1.02rem;
}

.icon-button {
    display: inline-grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white;
    color: var(--ink);
    font-size: 1.2rem;
    font-weight: 900;
}

.topbar-menu {
    position: static;
}

.burger-button {
    position: relative;
    overflow: hidden;
    background: #111827;
    border-color: #111827;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.burger-button:hover {
    background: #0f172a;
    box-shadow: 0 10px 24px rgba(23, 32, 51, .2);
}

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

.burger-button span {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: white;
    transition: transform .22s ease, top .22s ease, width .22s ease;
}

.burger-button span:first-child {
    top: 17px;
}

.burger-button span:last-child {
    top: 25px;
    width: 14px;
}

.burger-button[aria-expanded="true"] span:first-child {
    top: 21px;
    transform: rotate(45deg);
}

.burger-button[aria-expanded="true"] span:last-child {
    top: 21px;
    width: 20px;
    transform: rotate(-45deg);
}

.menu-popover {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    display: none;
    width: 100%;
    padding: 8px max(18px, calc((100vw - 1120px) / 2 + 18px));
    border: 0;
    border-bottom: 1px solid rgba(17, 24, 39, .18);
    background: #111827;
    box-shadow: 0 16px 32px rgba(17, 24, 39, .18);
}

.menu-popover.is-open {
    display: block;
}

.menu-popover a {
    display: flex;
    min-height: 46px;
    align-items: center;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    border-radius: 0;
    color: white;
    font-weight: 800;
}

.menu-popover a:last-child {
    border-bottom: 0;
}

.menu-popover a:hover {
    color: rgba(255, 255, 255, .78);
}

.dashboard-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 26px;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .12), rgba(245, 158, 11, .13)),
        white;
    box-shadow: 0 12px 38px rgba(23, 32, 51, .08);
}

.dashboard-hero h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 7vw, 4.2rem);
    line-height: 1;
}

.dashboard-hero p:last-child {
    max-width: 650px;
    color: var(--muted);
    line-height: 1.65;
}

.status-pill {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #f0fdf4;
    color: #166534;
    font-size: .86rem;
    font-weight: 850;
}

.status-pill span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #22c55e;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.action-card,
.timeline-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    box-shadow: 0 10px 28px rgba(23, 32, 51, .06);
}

.action-card {
    min-height: 178px;
    padding: 20px;
}

.action-card.primary {
    border-color: rgba(15, 118, 110, .38);
    background: #f0fdfa;
}

.card-icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 8px;
    background: var(--ink);
    color: white;
    font-size: 1.35rem;
    font-weight: 900;
}

.action-card h2 {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.action-card p {
    margin-bottom: 0;
    color: var(--muted);
    line-height: 1.55;
}

.timeline-panel {
    margin-top: 18px;
    padding: 22px;
}

.section-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.section-title h2 {
    margin-bottom: 0;
}

.section-title p {
    margin-bottom: 0;
    color: var(--muted);
}

.timeline {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline li {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: 8px;
    background: var(--paper);
}

.timeline span {
    color: var(--muted);
}

.dashboard-page {
    background: white;
}

.blank-dashboard {
    min-height: calc(100vh - 136px);
    background: white;
}

.wip-dashboard {
    display: grid;
    min-height: calc(100vh - 180px);
    place-items: center;
    align-content: center;
    gap: 12px;
    text-align: center;
}

.construction-mark {
    position: relative;
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    border-radius: 18px;
    background: #fef3c7;
    box-shadow: 0 12px 30px rgba(245, 158, 11, .18);
}

.construction-mark::before {
    content: "";
    width: 42px;
    height: 32px;
    border-radius: 5px 5px 3px 3px;
    background:
        repeating-linear-gradient(135deg, #111827 0 7px, #f59e0b 7px 14px);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.construction-mark span {
    position: absolute;
    bottom: 17px;
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: #111827;
}

.wip-dashboard h1 {
    margin: 10px 0 0;
    color: #0b1220;
    font-size: clamp(1.6rem, 6vw, 2.4rem);
    line-height: 1.1;
    font-weight: 950;
}

.wip-dashboard p {
    margin: 0;
    color: #737373;
    font-weight: 850;
}

.seller-dashboard {
    width: min(100%, 760px);
    margin: 0 auto;
}

.seller-dashboard h1 {
    margin-bottom: 20px;
    color: #0b1220;
    font-size: clamp(1.35rem, 5vw, 1.85rem);
    line-height: 1.12;
    font-weight: 900;
}

.stocks-dashboard {
    width: min(100%, 980px);
    margin: 0 auto;
}

.stocks-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.stocks-header h1 {
    margin-bottom: 6px;
    color: #0b1220;
    font-size: clamp(1.5rem, 5vw, 2rem);
    line-height: 1.12;
    font-weight: 900;
}

.stocks-header p {
    margin: 0;
    color: #737373;
    font-size: .9rem;
    font-weight: 750;
}

.stock-refresh-button {
    min-height: 44px;
    white-space: nowrap;
}

.stock-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stock-summary-card {
    display: grid;
    gap: 10px;
    border: 1px solid #ececec;
    border-radius: 10px;
    background: white;
    padding: 16px;
    box-shadow: 0 8px 26px rgba(17, 24, 39, .06);
}

.stock-summary-card span {
    color: #4b5563;
    font-size: .82rem;
    font-weight: 850;
}

.stock-summary-card strong {
    color: #111827;
    font-size: 2rem;
    line-height: 1;
    font-weight: 950;
}

.stock-summary-low {
    border-color: #eeeeee;
}

.stock-summary-out {
    border-color: #eeeeee;
}

.stock-summary-warning {
    border-color: #eeeeee;
}

.stock-summary-ok {
    border-color: #eeeeee;
}

.stock-list {
    display: grid;
    gap: 12px;
}

.stock-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px 128px;
    gap: 16px;
    align-items: center;
    border: 1px solid #ececec;
    border-left: 5px solid #22c55e;
    border-radius: 10px;
    background: white;
    padding: 16px;
    box-shadow: 0 5px 18px rgba(17, 24, 39, .06);
}

.stock-card-main {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.stock-card-main strong {
    color: #111827;
    font-size: .98rem;
    line-height: 1.25;
}

.stock-card-main span,
.stock-card-quantity span {
    color: #737373;
    font-size: .78rem;
    font-weight: 750;
}

.stock-card-quantity {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.stock-card-quantity strong {
    color: #111827;
    font-size: 1.5rem;
    line-height: 1;
}

.stock-level-badge,
.stock-level-indicator {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #dcfce7;
    color: #166534;
    font-size: .78rem;
    font-weight: 900;
    padding: 0 10px;
    text-align: center;
}

.stock-level-indicator {
    justify-self: end;
    gap: 7px;
    min-width: 112px;
    min-height: auto;
    border-radius: 0;
    background: transparent;
    color: #166534;
    font-size: .78rem;
    font-weight: 850;
    padding: 0;
}

.stock-level-indicator span {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #22c55e;
}

.stock-level-low {
    border-left-color: #ef4444;
}

.stock-level-low .stock-level-badge {
    background: #fee2e2;
    color: #991b1b;
}

.stock-level-low .stock-level-indicator {
    color: #b91c1c;
}

.stock-level-low .stock-level-indicator span {
    background: #ef4444;
}

.stock-level-warning {
    border-left-color: #f59e0b;
}

.stock-level-warning .stock-level-badge {
    background: #ffedd5;
    color: #9a3412;
}

.stock-level-warning .stock-level-indicator {
    color: #9a3412;
}

.stock-level-warning .stock-level-indicator span {
    background: #f59e0b;
}

.stock-level-out {
    border-left-color: #6b7280;
}

.stock-level-out .stock-level-badge,
.stock-level-unknown .stock-level-badge {
    background: #f3f4f6;
    color: #4b5563;
}

.stock-level-out .stock-level-indicator,
.stock-level-unknown .stock-level-indicator {
    color: #6b7280;
}

.stock-level-out .stock-level-indicator span,
.stock-level-unknown .stock-level-indicator span {
    background: #9ca3af;
}

.stocks-dashboard {
    width: min(100%, 1080px);
}

.stocks-header {
    align-items: center;
    border-bottom: 1px solid #eeeeee;
    margin-bottom: 18px;
    padding-bottom: 18px;
}

.stocks-header h1 {
    margin-bottom: 4px;
    font-size: clamp(1.45rem, 4vw, 1.9rem);
}

.stock-refresh-button {
    border-color: #111827;
    background: #111827;
    color: white;
}

.stock-refresh-button:hover {
    border-color: #172033;
    background: #172033;
}

.stock-summary-grid {
    grid-template-columns: 1.15fr repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.stock-summary-card {
    position: relative;
    min-height: 92px;
    align-content: space-between;
    overflow: hidden;
    border-color: #eeeeee;
    border-radius: 8px;
    box-shadow: none;
    padding: 14px;
}

.stock-summary-card::before {
    content: "";
    position: absolute;
    top: 14px;
    right: 14px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #111827;
}

.stock-summary-card span {
    padding-right: 18px;
    color: #5f6368;
    font-size: .76rem;
    line-height: 1.25;
}

.stock-summary-card strong {
    font-size: 1.85rem;
}

.stock-summary-low::before {
    background: #ef4444;
}

.stock-summary-out::before {
    background: #6b7280;
}

.stock-summary-warning::before {
    background: #f59e0b;
}

.stock-summary-ok::before {
    background: #22c55e;
}

.stock-list-shell {
    border: 1px solid #eeeeee;
    border-radius: 10px;
    background: white;
    overflow: hidden;
}

.stock-list-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px 128px;
    gap: 16px;
    align-items: center;
    min-height: 42px;
    border-bottom: 1px solid #eeeeee;
    background: #fafafa;
    color: #737373;
    font-size: .72rem;
    font-weight: 900;
    padding: 0 16px;
    text-transform: uppercase;
}

.stock-list-header span:nth-child(2),
.stock-list-header span:nth-child(3) {
    text-align: right;
}

.stock-list {
    gap: 0;
}

.stock-card {
    border: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 14px 16px;
    position: relative;
}

.stock-card + .stock-card {
    border-top: 1px solid #f0f0f0;
}

.stock-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 14px;
    bottom: 14px;
    width: 3px;
    border-radius: 0 999px 999px 0;
    background: #22c55e;
}

.stock-card-main strong {
    font-size: .93rem;
    font-weight: 850;
}

.stock-card-main span,
.stock-card-quantity span {
    font-size: .74rem;
}

.stock-card-quantity strong {
    font-size: 1.25rem;
}

.stock-level-badge,
.stock-level-indicator {
    justify-self: end;
    min-width: 112px;
    min-height: 28px;
    border-radius: 5px;
    font-size: .72rem;
}

.stock-level-indicator {
    min-height: auto;
    border-radius: 0;
    font-size: .76rem;
}

.stock-level-low::before {
    background: #ef4444;
}

.stock-level-warning::before {
    background: #f59e0b;
}

.stock-level-out::before {
    background: #6b7280;
}

.stock-level-unknown::before {
    background: #94a3b8;
}

.order-form {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: white;
    padding: 18px;
}

.form-grid label:first-child {
    grid-column: 1 / -1;
}

.order-items {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.order-item {
    border: 1px solid #ececec;
    border-radius: 12px;
    background: white;
    padding: 18px;
}

.order-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.order-item h2 {
    margin: 0;
    color: #2f3137;
    font-size: .9rem;
    font-weight: 900;
}

.remove-item-button {
    border: 0;
    background: transparent;
    color: #9f1239;
    cursor: pointer;
    font: inherit;
    font-size: .88rem;
    font-weight: 850;
    padding: 6px 0;
}

.remove-item-button:hover {
    color: #be123c;
}

.item-grid label:first-child {
    grid-column: auto;
}

.item-grid {
    border: 0;
    border-radius: 0;
    padding: 0;
}

.personalization-note {
    grid-column: 1 / -1;
    margin: -4px 0 0;
    color: #737373;
    font-size: .82rem;
    line-height: 1.35;
}

.add-item-button {
    margin-top: 22px;
    width: 100%;
}

.delivery-card {
    margin-top: 18px;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: white;
    padding: 18px;
}

.delivery-card label {
    margin-bottom: 0;
}

.submit-order-button {
    margin-top: 18px;
}

.edit-order-form {
    width: min(100%, 760px);
}

.edit-action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 18px;
}

.danger-button {
    display: inline-flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: white;
    color: #b91c1c;
    cursor: pointer;
    font: inherit;
    font-weight: 850;
    padding: 0 18px;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.danger-button:hover {
    border-color: #fca5a5;
    background: #fff1f2;
}

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

body.modal-open {
    overflow: hidden;
}

.modal-backdrop {
    position: fixed;
    z-index: 60;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(17, 24, 39, .42);
    backdrop-filter: blur(8px);
}

.confirm-modal {
    width: min(100%, 420px);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    box-shadow: 0 24px 70px rgba(17, 24, 39, .22);
    padding: 24px;
}

.confirm-modal h2 {
    margin: 0 0 10px;
    color: #111827;
    font-size: 1.35rem;
    line-height: 1.15;
    font-weight: 900;
}

.confirm-modal p {
    margin: 0;
    color: #4b5563;
    font-size: .95rem;
    line-height: 1.55;
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 22px;
}

.history-dashboard,
.order-detail,
.schedule-dashboard {
    width: min(100%, 1160px);
    margin: 0 auto;
}

.history-dashboard h1,
.order-detail h1,
.schedule-dashboard h1 {
    margin-bottom: 22px;
    color: #0b1220;
    font-size: clamp(1.5rem, 5vw, 2rem);
    line-height: 1.12;
    font-weight: 900;
}

.history-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 28px;
}

.history-summary-card {
    display: grid;
    min-height: 116px;
    align-content: space-between;
    gap: 8px;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    background: white;
    color: #111827;
    padding: 16px;
    box-shadow: 0 8px 26px rgba(17, 24, 39, .06);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.history-summary-card:hover,
.history-summary-card.is-active {
    border-color: #111827;
    box-shadow: 0 14px 34px rgba(17, 24, 39, .11);
    transform: translateY(-1px);
}

.history-summary-card span {
    color: #4b5563;
    font-size: .82rem;
    font-weight: 850;
    line-height: 1.25;
}

.history-summary-card strong {
    color: #111827;
    font-size: 2rem;
    line-height: 1;
    font-weight: 950;
}

.history-summary-card small {
    color: #737373;
    font-size: .72rem;
    font-weight: 750;
    line-height: 1.25;
}

.clear-delivery-filter {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    color: #4b5563;
    font-size: .86rem;
    font-weight: 800;
}

.clear-delivery-filter:hover {
    color: #111827;
}

.proballers-section {
    width: 100%;
    overflow: hidden;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: white;
    padding: 16px;
}

.proballers-widget-team-schedule-results-banner,
.proballers-widget-league-standings-full {
    width: 100%;
}

.proballers-scale-frame {
    width: 100%;
    overflow: hidden;
}

.proballers-scale-frame .proballers-widget-team-schedule-results-banner {
    display: block;
}

.proballers-section + .proballers-section {
    margin-top: 18px;
}

.proballers-official-link {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 8px;
    color: #001e4a;
    font-size: .7rem;
    font-family: Montserrat, sans-serif;
    text-align: center;
}

.proballers-official-link a {
    color: #001e4a;
    font-style: italic;
    font-weight: 650;
}

.history-filters {
    display: grid;
    grid-template-columns: minmax(0, 340px);
    gap: 12px;
    margin-bottom: 26px;
}

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

.history-list {
    display: grid;
    gap: 16px;
}

.history-card {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 180px;
    gap: 30px;
    align-items: center;
    min-height: 100px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .09);
    padding: 24px 20px;
}

.history-number-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.history-number-row strong {
    color: #2f3137;
    font-size: 1rem;
}

.history-number-row span {
    color: #6b7280;
    font-size: .82rem;
}

.history-customer {
    display: block;
    color: #23272f;
    font-size: .92rem;
}

.history-card-product {
    display: grid;
    gap: 4px;
    color: #273142;
    font-size: .9rem;
}

.history-card-product small {
    color: #6b7280;
    font-size: .82rem;
}

.history-card-product .more-products {
    color: #111827;
    font-weight: 850;
}

.status-badge {
    display: inline-flex;
    min-width: 90px;
    min-height: 26px;
    align-items: center;
    justify-content: center;
    justify-self: center;
    border-radius: 6px;
    color: white;
    font-size: .78rem;
    font-weight: 850;
    padding: 0 14px;
}

.status-pending {
    background: #ef4444;
}

.status-validated {
    background: #f8b600;
}

.status-received {
    background: #3b82f6;
}

.status-shipped {
    background: #8b5cf6;
}

.status-delivered {
    background: #22c55e;
}

.status-cancelled {
    background: #6b7280;
}

.empty-state {
    color: var(--muted);
}

.order-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 30px;
    padding-bottom: 18px;
}

.print-sheet-header {
    display: none;
}

.print-only {
    display: none !important;
}

.order-detail-header h1 {
    margin-bottom: 0;
}

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

.detail-panel {
    border-radius: 12px;
    background: white;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .08);
    padding: 24px;
}

.detail-panel h2 {
    border-bottom: 2px solid #5b7cfa;
    margin: 0 0 20px;
    padding-bottom: 10px;
    color: #111827;
    font-size: 1.05rem;
}

.detail-panel dl {
    display: grid;
    gap: 0;
    margin: 0;
}

.detail-panel dl div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid #eeeeee;
    padding: 14px 0;
}

.detail-panel dl div:last-child {
    border-bottom: 0;
}

.detail-panel dt {
    color: #5f6368;
    font-weight: 800;
}

.detail-panel dd {
    margin: 0;
    text-align: right;
}

.products-panel {
    grid-column: span 1;
}

.detail-products {
    display: grid;
    gap: 12px;
}

.detail-product-card {
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    padding: 16px;
}

.detail-product-card p {
    margin-bottom: 12px;
    color: #374151;
    font-size: .9rem;
}

.detail-customization {
    display: grid;
    gap: 8px;
    border-radius: 4px;
    background: #e5e7eb;
    color: #4b5563;
    padding: 12px;
    font-size: .86rem;
}

.detail-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 54px;
}

.detail-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-weight: 850;
    padding: 0 20px;
    transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.inline-status-form {
    margin: 0;
}

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

.primary-detail-button {
    background: #111827;
    border-color: #111827;
    color: white;
}

.primary-detail-button:hover {
    background: #172033;
}

.back-detail-button {
    background: white;
    border-color: #d7d7d7;
    color: var(--ink);
}

.print-detail-button {
    background: white;
    border-color: #d7d7d7;
    color: var(--ink);
}

.back-detail-button:hover {
    border-color: #a8a8a8;
    background: #f7f7f7;
}

.print-detail-button:hover {
    border-color: #a8a8a8;
    background: #f7f7f7;
}

.signature-panel {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 18px;
    margin-top: 34px;
    border: 1px solid #d7d7d7;
    border-radius: 8px;
    background: white;
    padding: 18px;
}

.signature-panel > div {
    display: grid;
    gap: 12px;
    min-height: 96px;
}

.signature-panel strong {
    color: #111827;
    font-size: .92rem;
}

.signature-panel span {
    color: #111827;
}

@media (min-width: 761px) {
    .dashboard-page .page-shell {
        padding-top: 108px;
    }

    .app-topbar {
        height: 88px;
        padding-top: 14px;
        padding-bottom: 14px;
    }

    .brand {
        gap: 14px;
    }

    .brand strong {
        font-size: 1.24rem;
    }

    .brand small {
        font-size: 1rem;
    }

    .topbar-logo {
        width: 74px;
        height: 74px;
    }

    .icon-button {
        width: 52px;
        height: 52px;
    }

    .burger-button span {
        left: 15px;
        width: 22px;
    }

    .burger-button span:first-child {
        top: 20px;
    }

    .burger-button span:last-child {
        top: 29px;
        width: 16px;
    }

    .burger-button[aria-expanded="true"] span:first-child,
    .burger-button[aria-expanded="true"] span:last-child {
        top: 25px;
        width: 22px;
    }

    .menu-popover {
        top: 88px;
        left: auto;
        right: max(18px, calc((100vw - 1120px) / 2 + 18px));
        width: 260px;
        padding: 8px;
        border: 0;
        border-radius: 6px;
    }

    .menu-popover a {
        padding: 0 12px;
        border-bottom: 0;
        border-radius: 4px;
    }

    .menu-popover a:hover {
        background: rgba(255, 255, 255, .08);
        color: white;
    }
}

@media (max-width: 760px) {
    html,
    .auth-page,
    .welcome-page {
        background: #ffffff;
    }

    .welcome-screen::before,
    .auth-shell.single::before {
        display: none;
    }

    .page-shell {
        padding: 82px 14px 28px;
    }

    .auth-page .page-shell,
    .welcome-page .page-shell {
        padding-top: 20px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .auth-brand {
        padding: 8px 2px;
    }

    .auth-brand h1 {
        font-size: 2.65rem;
    }

    .auth-card {
        padding: 24px 18px;
        border: 0;
        box-shadow: none;
    }

    .dashboard-hero,
    .section-title {
        display: grid;
    }

    .role-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        padding: 20px;
    }

    .status-pill {
        width: fit-content;
    }

    .seller-dashboard h1 {
        margin-bottom: 22px;
    }

    .stocks-header {
        display: grid;
    }

    .stock-refresh-button {
        width: 100%;
    }

    .stock-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .stock-summary-card {
        padding: 14px;
    }

    .stock-summary-card strong {
        font-size: 1.7rem;
    }

    .stock-card {
        grid-template-columns: 1fr auto;
        gap: 12px;
        padding: 14px;
    }

    .stock-card-main {
        grid-column: 1 / -1;
    }

    .stock-card-quantity {
        justify-items: start;
    }

    .stocks-header {
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .stock-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-bottom: 18px;
    }

    .stock-summary-card {
        min-height: 92px;
        border-radius: 8px;
    }

    .stock-list-header {
        display: none;
    }

    .stock-list-shell {
        border-radius: 8px;
    }

    .stock-card {
        grid-template-columns: 1fr auto;
        gap: 10px 14px;
        padding: 15px 14px 15px 18px;
    }

    .stock-card::before {
        top: 16px;
        bottom: 16px;
    }

    .stock-level-badge,
    .stock-level-indicator {
        min-width: 0;
        justify-self: end;
        padding: 0 9px;
    }

    .stock-level-indicator {
        padding: 0;
    }

    .order-form {
        border: 0;
        padding: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

    .history-dashboard h1,
    .order-detail h1,
    .schedule-dashboard h1 {
        margin-bottom: 18px;
        font-size: 1.35rem;
    }

    .proballers-section {
        padding: 10px;
    }

    .proballers-widget-team-schedule-results-banner,
    .proballers-widget-league-standings-full {
        width: 100%;
    }

    .proballers-official-link {
        flex-wrap: wrap;
        line-height: 1.35;
    }

    .history-filters {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 28px;
    }

    .history-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 24px;
    }

    .history-summary-card {
        min-height: 108px;
        padding: 14px;
    }

    .history-summary-card strong {
        font-size: 1.7rem;
    }

    .history-card {
        grid-template-columns: 1fr auto;
        gap: 14px;
        align-items: start;
        min-height: auto;
        padding: 20px;
    }

    .history-card-main {
        grid-column: 1;
    }

    .history-card-product {
        grid-column: 1 / -1;
    }

    .history-card .status-badge {
        grid-column: 2;
        grid-row: 1;
        min-width: 82px;
    }

    .order-detail-header {
        margin-bottom: 24px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .detail-panel {
        padding: 20px;
    }

    .detail-panel dl div {
        display: grid;
        gap: 6px;
    }

    .detail-panel dd {
        text-align: left;
    }

    .detail-actions {
        margin-top: 28px;
    }

    .detail-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .detail-actions .detail-button {
        width: 100%;
    }

    .inline-status-form {
        width: 100%;
    }

    .modal-actions {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    html,
    body {
        width: 210mm;
        min-height: auto;
        background: white !important;
        color: #000;
        font-size: 10pt;
    }

    .app-topbar,
    .detail-actions,
    .menu-popover {
        display: none !important;
    }

    .page-shell {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .order-detail {
        width: 100%;
        min-height: calc(297mm - 24mm);
        margin: 0;
        display: flex;
        flex-direction: column;
    }

    .print-sheet-header {
        display: flex;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid #d7d7d7;
        margin-bottom: 14px;
        padding-bottom: 10px;
    }

    .print-logo {
        width: 54px;
        height: 54px;
    }

    .print-sheet-header strong,
    .print-sheet-header small {
        display: block;
        color: #111827;
        font-size: 12pt;
        line-height: 1.2;
    }

    .print-sheet-header small {
        font-size: 9pt;
        font-weight: 900;
        text-transform: uppercase;
    }

    .print-only {
        display: grid !important;
    }

    .order-detail-header {
        border-bottom: 1px solid #d7d7d7;
        margin-bottom: 16px;
        padding-bottom: 10px;
    }

    .order-detail-header h1 {
        font-size: 20pt;
    }

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

    .detail-panel {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #d7d7d7;
        border-radius: 6px;
        padding: 12px;
    }

    .detail-panel h2 {
        border-bottom: 1px solid #5b7cfa;
        margin-bottom: 10px;
        padding-bottom: 6px;
        font-size: 12pt;
    }

    .detail-panel dl div {
        padding: 8px 0;
    }

    .products-panel {
        grid-column: 1 / -1;
    }

    .detail-products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .detail-product-card {
        break-inside: avoid;
        padding: 10px;
    }

    .detail-product-card p {
        margin-bottom: 7px;
        font-size: 9.5pt;
    }

    .detail-customization {
        gap: 5px;
        padding: 8px;
        font-size: 9pt;
    }

    .signature-panel {
        break-inside: avoid;
        grid-template-columns: 160px 190px;
        justify-content: end;
        gap: 12px;
        margin-top: auto;
        border: 0;
        border-radius: 0;
        padding: 0;
    }

    .signature-panel > div {
        min-height: 70px;
        gap: 8px;
    }

}
