:root {
    color-scheme: light;
    font-family: "DM Sans", sans-serif;
    color: #17251d;
    background: #f3f1ea;
    font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f3f1ea; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.topbar { height: 76px; padding: 0 clamp(18px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; background: #17251d; color: white; }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #e8ff58; color: #17251d; font-family: Manrope, sans-serif; font-weight: 800; font-size: 21px; }
.brand strong, .brand small { display: block; }
.brand strong { font: 800 18px Manrope, sans-serif; }
.brand small { margin-top: 1px; color: #aebbb2; font-size: 11px; }
.online-badge { padding: 7px 11px; border: 1px solid #526157; border-radius: 999px; color: #dbe5dd; font-size: 12px; }
main { width: min(1160px, calc(100% - 36px)); margin: 0 auto; padding: 46px 0 72px; }
h1, h2, h3 { font-family: Manrope, sans-serif; margin-top: 0; }
h1 { letter-spacing: -.04em; }
p { line-height: 1.55; }
.eyebrow { display: block; margin-bottom: 10px; color: #667269; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

.login-wrap { min-height: calc(100vh - 170px); display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(40px, 8vw, 120px); }
.hero-copy h1 { margin-bottom: 22px; font-size: clamp(48px, 7vw, 86px); line-height: .98; }
.hero-copy p { max-width: 520px; color: #647067; font-size: 18px; }
.panel, .setup-card { background: #fff; border: 1px solid #dddcd5; border-radius: 22px; box-shadow: 0 18px 50px rgba(31, 44, 35, .06); }
.login-panel { padding: clamp(26px, 4vw, 42px); }
.login-panel h2 { margin-bottom: 28px; font-size: 27px; }
.setup-card { max-width: 700px; margin: 10vh auto; padding: 46px; }

label { display: block; margin: 18px 0 7px; font-size: 13px; font-weight: 700; }
input, select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #cfd3ce; border-radius: 11px; background: #fff; color: #17251d; outline: none; }
input:focus, select:focus { border-color: #516b5a; box-shadow: 0 0 0 3px rgba(81, 107, 90, .13); }
button { min-height: 44px; padding: 10px 17px; border: 0; border-radius: 11px; font-weight: 700; }
button:disabled { cursor: wait; opacity: .55; }
.primary { width: 100%; margin-top: 24px; background: #17251d; color: #fff; }
.primary:hover { background: #294234; }
.secondary { background: #fff; border: 1px solid #cfd3ce; color: #17251d; }
.ghost { background: transparent; color: #5b675e; }
.ghost.full { width: 100%; margin-top: 5px; }
.message { margin: 0 0 18px; padding: 13px 16px; border-radius: 12px; font-weight: 600; }
.message.error { background: #ffebe8; color: #8d2f25; }
.message.success { background: #e4f7e7; color: #265e34; }

.dashboard-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 32px; }
.dashboard-head h1 { margin-bottom: 8px; font-size: clamp(36px, 5vw, 58px); }
.dashboard-head p { margin: 0; color: #69736c; }
.head-actions { display: flex; gap: 8px; }
.tabs { display: flex; gap: 6px; margin-bottom: 22px; padding: 5px; overflow-x: auto; background: #e5e3dc; border-radius: 14px; }
.tabs button { flex: 1; min-width: 120px; color: #5e675f; background: transparent; }
.tabs button.active { color: #17251d; background: #fff; box-shadow: 0 2px 10px rgba(30, 43, 34, .08); }
.content-grid { display: grid; gap: 22px; }
.sell-grid { grid-template-columns: minmax(0, .85fr) minmax(340px, 1.15fr); align-items: start; }
.inventory-grid { grid-template-columns: minmax(0, 1.35fr) minmax(310px, .65fr); align-items: start; }
.form-panel, .history-panel, .inventory-list { padding: clamp(22px, 3vw, 32px); }
.panel-title { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.panel-title h2 { margin-bottom: 3px; font-size: 21px; }
.panel-title p { margin: 0; color: #758078; font-size: 13px; }
.step { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: #e8ff58; font-weight: 800; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sale-details { align-items: end; }
.automatic-price { min-height: 73px; padding: 10px 13px; border: 1px solid #dfe2dc; border-radius: 11px; background: #f5f5f0; }
.automatic-price label { margin: 0 0 5px; color: #778078; }
.automatic-price strong { font: 800 20px Manrope, sans-serif; }
.cart-panel { padding: clamp(22px, 3vw, 32px); }
.cart-empty { min-height: 170px; display: grid; place-items: center; padding: 28px; border: 1px dashed #ced3cd; border-radius: 14px; color: #778078; text-align: center; }
.cart-list { display: grid; }
.cart-line { display: grid; grid-template-columns: 1fr auto 34px; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid #ecebe6; }
.cart-line:first-child { border-top: 0; }
.cart-copy strong, .cart-copy span { display: block; }
.cart-copy span { margin-top: 3px; color: #778078; font-size: 12px; }
.cart-price { white-space: nowrap; }
.remove-line { width: 34px; min-height: 34px; padding: 0; border-radius: 50%; background: #ffebe8; color: #9a342a; font-size: 21px; }
.discount-box { margin-top: 14px; padding: 15px; border: 1px solid #dfe2dc; border-radius: 14px; background: #f7f7f3; }
.discount-box label:first-child { margin-top: 0; }
.cart-values { display: grid; gap: 7px; padding: 18px 3px 4px; }
.cart-values > div { display: flex; justify-content: space-between; gap: 15px; font-size: 13px; }
.discount-value { color: #397046; }
.cart-total { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-top: 12px; padding: 20px; border-radius: 15px; background: #e8ff58; }
.cart-total span { font-size: 13px; font-weight: 700; }
.cart-total strong { font: 800 clamp(25px, 4vw, 34px) Manrope, sans-serif; letter-spacing: -.04em; }
.forms-stack { display: grid; gap: 18px; }
.compact h2 { margin-bottom: 10px; font-size: 20px; }
.form-help { margin: -2px 0 4px; color: #778078; font-size: 12px; }
.import-panel { grid-column: 1 / -1; }
.import-summary { display: flex; justify-content: space-between; gap: 14px; margin-top: 17px; padding: 13px 15px; border-radius: 12px; background: #e8ff58; font-size: 13px; }
.preview-scroll { max-height: 310px; margin-top: 12px; overflow: auto; border: 1px solid #e1e3de; border-radius: 12px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.preview-table th, .preview-table td { padding: 9px 10px; border-bottom: 1px solid #eceee9; text-align: center; white-space: nowrap; }
.preview-table th:first-child, .preview-table td:first-child { position: sticky; left: 0; min-width: 150px; text-align: left; background: #fff; }
.preview-table th { position: sticky; top: 0; z-index: 1; background: #f1f2ec; }
.preview-table th:first-child { z-index: 2; background: #f1f2ec; }
.import-warning { margin: 12px 0 0; padding: 11px 12px; border-radius: 10px; background: #fff4dd; color: #79571b; font-size: 12px !important; }

.product-card { padding: 20px 0; border-top: 1px solid #ecebe6; }
.product-card:first-of-type { border-top: 0; }
.product-card h3 { margin-bottom: 3px; }
.product-card p { margin: 0; color: #778078; font-size: 13px; }
.product-identity { display: flex; align-items: flex-start; gap: 16px; }
.product-photo { width: 90px; height: 90px; flex: 0 0 auto; border-radius: 15px; object-fit: cover; background: #eceee8; }
.product-photo.placeholder { display: grid; place-items: center; color: #657066; font: 800 28px Manrope, sans-serif; }
.product-meta { flex: 1; min-width: 0; }
.price-tag { display: block; margin-top: 8px; font: 800 19px Manrope, sans-serif; }
.edit-product { min-height: 34px; margin: 7px 0 0 -7px; padding: 6px 7px; color: #50645a; background: transparent; font-size: 12px; }
.file-input { padding: 8px; }
.file-note { margin: 6px 0 0; color: #778078; font-size: 11px !important; }
.size-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.size-chip { min-width: 92px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; background: #f1f2ec; color: #17251d; }
.size-chip span { font-size: 13px; }
.size-chip strong { font-size: 18px; }
.size-chip small { grid-column: 1 / -1; color: #748078; font-size: 10px; }
.history-list { display: grid; gap: 12px; }
.history-summary { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 20px; margin-bottom: 22px; padding: 20px; border-radius: 15px; background: #e8ff58; }
.history-summary span { font-size: 13px; font-weight: 700; }
.history-summary strong { grid-row: 1 / span 2; grid-column: 2; font: 800 clamp(27px, 5vw, 40px) Manrope, sans-serif; letter-spacing: -.04em; }
.history-summary small { color: #58631a; }
.order-card { padding: 18px; border: 1px solid #e5e5df; border-radius: 15px; }
.order-card.deleted { opacity: .55; }
.order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.order-head div strong, .order-head div span { display: block; }
.order-head div span { margin-top: 3px; color: #778078; font-size: 12px; }
.order-lines { display: grid; gap: 6px; margin: 14px 0; padding: 12px 0; border-top: 1px solid #ecebe6; border-bottom: 1px solid #ecebe6; }
.order-line { display: flex; justify-content: space-between; gap: 15px; color: #59645c; font-size: 13px; }
.order-line span:last-child { white-space: nowrap; }
.order-discount { display: flex; justify-content: space-between; gap: 15px; margin: -3px 0 13px; color: #397046; font-size: 13px; }
.cancelled { color: #8d2f25; font-size: 12px; font-weight: 700; text-align: right; }
.danger-link { padding: 7px; color: #a1392f; background: transparent; font-size: 12px; }
.empty-state { padding: 32px 10px; color: #78817a; text-align: center; }
.loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; color: #6c776f; }
.loading .brand-mark { width: 54px; height: 54px; font-size: 28px; }
#blazor-error-ui { display: none; position: fixed; inset: auto 12px 12px; padding: 14px; background: #ffebe8; color: #8d2f25; border-radius: 10px; z-index: 1000; }

@media (max-width: 780px) {
    .topbar { height: 68px; }
    main { width: min(100% - 24px, 1160px); padding-top: 28px; }
    .login-wrap, .sell-grid, .inventory-grid { grid-template-columns: 1fr; }
    .login-wrap { align-content: start; gap: 24px; }
    .hero-copy h1 { font-size: 46px; }
    .hero-copy p { font-size: 15px; }
    .dashboard-head { align-items: flex-start; flex-direction: column; }
    .head-actions { width: 100%; }
    .head-actions button { flex: 1; }
    .cart-panel { order: 2; }
    .product-photo { width: 76px; height: 76px; }
    .order-line { align-items: flex-start; flex-direction: column; gap: 2px; }
}

@media (max-width: 430px) {
    .two-cols { grid-template-columns: 1fr; }
    .cart-line { grid-template-columns: 1fr auto; }
    .remove-line { grid-column: 1 / -1; justify-self: end; }
    .cart-total, .order-head { align-items: flex-start; flex-direction: column; }
    .history-summary { grid-template-columns: 1fr; }
    .history-summary strong { grid-row: auto; grid-column: auto; }
}
