:root {
  --navy: #081b83;
  --navy-2: #10248e;
  --orange: #ff5100;
  --orange-dark: #e84800;
  --cream: #fff8f2;
  --ink: #10172f;
  --muted: #667085;
  --line: #e5e9f2;
  --surface: #fff;
  --bg: #f5f7fb;
  --green: #12805c;
  --shadow: 0 12px 35px rgba(8,27,131,.08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .btn { cursor: pointer; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.topbar { height: 76px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1200px; height: 100%; padding: 0 28px; margin: auto; display: flex; align-items: center; gap: 34px; position: relative; }
.brand { display: inline-flex; align-items: center; color: var(--navy); font-size: 26px; font-weight: 900; letter-spacing: -1.5px; position: relative; line-height: 1; }
.brand img { width: 132px; height: auto; display: block; }
.brand-fallback { display: none; align-items: center; }
.brand-fallback i { width: 34px; height: 34px; margin-right: 6px; display: inline-grid; place-items: center; border-radius: 60% 48% 58% 42%; color: #fff; background: var(--orange); font-size: 27px; font-style: normal; transform: rotate(-8deg); }
.brand small { align-self: flex-end; margin: 0 0 -9px 5px; color: var(--orange); font-size: 8px; font-weight: 900; letter-spacing: 1.3px; }
.desktop-nav { display: flex; align-self: stretch; gap: 6px; }
.desktop-nav a { display: flex; align-items: center; gap: 8px; padding: 0 14px; color: #596078; font-size: 14px; font-weight: 700; border-bottom: 3px solid transparent; }
.desktop-nav a.active { color: var(--navy); border-bottom-color: var(--orange); }
.profile-button { margin-left: auto; padding: 6px 8px; border: 0; background: transparent; display: flex; align-items: center; gap: 10px; color: var(--ink); border-radius: 12px; }
.profile-button:hover { background: var(--bg); }
.profile-button > span:first-child { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; }
.profile-copy { display: grid; text-align: left; line-height: 1.25; }
.profile-copy b { font-size: 13px; }
.profile-copy small { color: var(--muted); font-size: 11px; }
.profile-button > .icon { width: 17px; color: var(--muted); }
.profile-menu { display: none; width: 245px; position: absolute; right: 28px; top: 67px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 18px 50px rgba(16,24,40,.15); }
.profile-menu.open { display: block; }
.profile-menu > div { padding: 8px 10px 12px; display: grid; border-bottom: 1px solid var(--line); }
.profile-menu > div small { margin-top: 3px; color: var(--muted); }
.profile-menu a, .profile-menu button { width: 100%; padding: 10px; display: flex; align-items: center; gap: 9px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.profile-menu a:hover, .profile-menu button:hover { background: var(--bg); }
.profile-menu form { margin: 0; }
.page { max-width: 1200px; min-height: calc(100vh - 76px); padding: 35px 28px 0; margin: 0 auto; }
.page-heading { margin-bottom: 22px; }
.page-heading h1 { margin: 4px 0 0; color: var(--navy); font-size: clamp(25px,3vw,34px); letter-spacing: -.9px; }
.eyebrow { color: var(--orange); font-size: 10px; font-weight: 900; letter-spacing: 1.7px; }
.footer { margin-top: 60px; padding: 25px 0; border-top: 1px solid var(--line); color: #8a91a5; font-size: 11px; text-align: center; }
.mobile-nav { display: none; }
.btn { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 800; transition: .18s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 7px 16px rgba(255,81,0,.22); }
.btn-primary:hover { background: var(--orange-dark); }
.btn-secondary { background: #fff; color: var(--navy); border-color: #d9deeb; }
.btn-block { width: 100%; }
.alert { max-width: 100%; margin: 0 0 18px; padding: 13px 16px; border-radius: 11px; font-size: 13px; font-weight: 650; }
.alert-success { background: #e7f8f0; border: 1px solid #b9ead4; color: #08734e; }
.alert-error { background: #fff0ed; border: 1px solid #ffc9be; color: #ac2d18; }

/* Login */
.auth-body { min-height: 100vh; background: #fff; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.04fr) minmax(420px, .96fr); }
.auth-brand { min-height: 100vh; padding: 48px clamp(42px,7vw,100px); background: var(--navy); color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.auth-brand .brand { color: #fff; }
.auth-brand .brand img { display: none; }
.auth-brand .brand-fallback { display: inline-flex; letter-spacing: -1.9px; }
.auth-brand .brand small { color: #ffb187; }
.auth-message { margin: auto 0; position: relative; z-index: 2; }
.pill-light { padding: 7px 12px; border: 1px solid rgba(255,255,255,.28); border-radius: 30px; color: #dfe4ff; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.auth-message h1 { margin: 28px 0 20px; font-size: clamp(42px,5.4vw,72px); line-height: .98; letter-spacing: -3px; }
.auth-message h1 em { color: #ff8b51; font-style: normal; }
.auth-message p { max-width: 465px; color: #c5cbed; font-size: 17px; line-height: 1.65; }
.auth-orb { width: 470px; height: 470px; position: absolute; right: -180px; bottom: -210px; border: 85px solid rgba(255,81,0,.9); border-radius: 50%; }
.auth-orb::before { content: ""; width: 175px; height: 175px; position: absolute; left: -185px; top: -130px; border-radius: 50%; background: rgba(255,81,0,.16); }
.auth-panel { padding: 40px; display: grid; place-items: center; background: #fff; }
.auth-card { width: min(420px,100%); }
.auth-card h2 { margin: 9px 0 8px; color: var(--navy); font-size: 33px; letter-spacing: -1px; }
.auth-card > p { margin: 0 0 28px; color: var(--muted); line-height: 1.55; }
.mobile-brand { display: none; }
.stack-form { display: grid; gap: 17px; }
label { display: grid; gap: 7px; color: #3d455c; font-size: 12px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #dce1eb; border-radius: 10px; background: #fff; color: var(--ink); outline: none; transition: .18s; }
input, select { height: 46px; padding: 0 13px; }
textarea { padding: 12px 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(8,27,131,.08); }
.password-field { position: relative; }
.password-field input { padding-right: 55px; }
.password-field button { position: absolute; right: 7px; top: 7px; height: 32px; padding: 0 8px; border: 0; background: var(--bg); color: var(--navy); border-radius: 7px; font-size: 11px; font-weight: 800; }
.email-field { position: relative; }
.email-field input { padding-right: 50px; }
.email-field button { position: absolute; right: 7px; top: 7px; width: 34px; height: 32px; padding: 0; border: 0; border-radius: 7px; background: var(--bg); color: var(--navy); font-size: 16px; font-weight: 850; cursor: pointer; }
.email-field button:hover, .email-field button:focus-visible { background: #e8ebf5; outline: none; }
.remember-login { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.remember-login input { width: 17px; height: 17px; flex: 0 0 auto; margin: 0; accent-color: var(--navy); }
.remember-login span { font-size: 11px; font-weight: 650; }
.security-note { display: block; margin-top: 22px; color: #959caf; text-align: center; }

/* Search */
.search-hero { margin: 0 0 32px; padding: 34px 38px 38px; color: #fff; background: var(--navy); border-radius: 24px; box-shadow: 0 16px 40px rgba(8,27,131,.16); position: relative; overflow: hidden; }
.search-hero::after { content: "a"; position: absolute; right: 14px; top: -62px; color: rgba(255,255,255,.035); font: 900 280px/1 Arial; transform: rotate(-8deg); }
.hero-copy { position: relative; z-index: 1; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; color: #dce2ff; font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: 1px; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: #55dfa8; box-shadow: 0 0 0 4px rgba(85,223,168,.14); }
.search-hero h2 { margin: 13px 0 7px; font-size: clamp(27px,3vw,39px); letter-spacing: -1.2px; }
.search-hero p { margin: 0 0 24px; color: #bdc6f2; font-size: 14px; }
.search-box { height: 62px; max-width: 770px; padding: 7px 7px 7px 19px; position: relative; z-index: 2; display: flex; align-items: center; gap: 11px; border-radius: 15px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.15); }
.search-box > .icon { color: var(--orange); width: 22px; height: 22px; }
.search-box input { flex: 1; height: 100%; padding: 0 4px; border: 0; box-shadow: none; font-size: 15px; }
.search-box .btn { height: 48px; padding: 0 25px; }
.empty-state { min-height: 310px; padding: 45px 20px; display: grid; justify-items: center; align-content: center; text-align: center; background: #fff; border: 1px dashed #d6dcea; border-radius: var(--radius); }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 50%; background: #eef1ff; color: var(--navy); font-size: 25px; font-weight: 800; }
.empty-icon .icon { width: 25px; height: 25px; }
.empty-state h3 { margin: 8px 0; color: var(--navy); font-size: 20px; }
.empty-state p { max-width: 480px; margin: 0; color: var(--muted); line-height: 1.55; }
.search-tips { margin-top: 22px; display: flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.search-tips span { padding: 6px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 30px; color: var(--muted); font-size: 11px; }
.results-heading { margin: 0 2px 14px; display: flex; align-items: flex-end; justify-content: space-between; }
.results-heading h3 { margin: 0; color: var(--navy); }
.results-heading span { color: var(--muted); font-size: 12px; }
.client-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.client-card { min-height: 135px; padding: 22px; display: grid; grid-template-columns: 1fr auto 24px; align-items: center; gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 18px rgba(12,32,94,.04); transition: .18s; }
.client-card:hover { transform: translateY(-2px); border-color: #c8d0e5; box-shadow: var(--shadow); }
.client-main { min-width: 0; display: flex; align-items: center; gap: 14px; }
.company-avatar { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; background: #edf0ff; color: var(--navy); font-size: 19px; font-weight: 900; }
.company-avatar.large { width: 64px; height: 64px; border-radius: 17px; background: #fff; font-size: 26px; }
.client-code { color: var(--orange); font-size: 9px; font-weight: 900; letter-spacing: 1.1px; }
.client-card h3 { max-width: 270px; margin: 3px 0; overflow: hidden; color: var(--navy); font-size: 15px; white-space: nowrap; text-overflow: ellipsis; }
.client-card p { margin: 0; color: var(--muted); font-size: 12px; }
.client-meta { margin-top: 8px; display: flex; gap: 12px; color: #80879a; font-size: 10px; }
.client-meta span { display: flex; align-items: center; gap: 3px; }
.client-meta .icon { width: 12px; height: 12px; }
.discount-tags { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.discount-tags span { padding: 4px 7px; color: #9c4623; background: #fff0e9; border: 1px solid #ffd8c6; border-radius: 20px; font-size: 8px; font-weight: 850; }
.discount-tags .normal-price-tag { color: #526078; background: #f0f3f8; border-color: #dce2ec; }
.my-client-grid .client-card { min-height: 155px; }
.mobile-client-hero { margin-bottom: 24px; }
.discount-badge { min-width: 83px; padding: 10px; display: grid; text-align: center; background: var(--cream); border: 1px solid #ffdccb; border-radius: 11px; }
.discount-badge small { color: #9c5734; font-size: 7px; font-weight: 900; letter-spacing: .7px; }
.discount-badge strong { margin-top: 2px; color: var(--orange); font-size: 20px; }
.discount-badge span { color: #9c5734; font-size: 8px; font-weight: 750; }
.card-arrow { color: #b7bdcc; }
.card-arrow .icon { width: 18px; }

/* Client detail */
.back-link { display: inline-block; margin: -8px 0 16px; color: var(--muted); font-size: 12px; font-weight: 700; }
.client-hero { padding: 28px 34px; display: flex; justify-content: space-between; align-items: center; gap: 25px; background: linear-gradient(125deg,var(--navy),#162d9d); color: #fff; border-radius: 22px; box-shadow: var(--shadow); }
.client-identity { min-width: 0; display: flex; align-items: center; gap: 17px; }
.client-identity h2 { margin: 4px 0; font-size: clamp(21px,3vw,31px); line-height: 1.1; }
.client-identity p { margin: 0; color: #c9d0f1; }
.discount-hero { min-width: 190px; padding-left: 28px; display: grid; border-left: 1px solid rgba(255,255,255,.2); }
.discount-hero small { color: #c9d0f1; font-size: 8px; font-weight: 900; letter-spacing: 1.1px; }
.discount-hero strong { color: #ff8a51; font-size: 45px; line-height: 1.05; letter-spacing: -2px; }
.discount-hero sup { font-size: 20px; }
.discount-hero span { color: #c9d0f1; font-size: 10px; }
.section-block { margin-top: 30px; }
.section-title { margin-bottom: 15px; display: flex; justify-content: space-between; align-items: end; }
.section-title h2 { margin: 4px 0 0; color: var(--navy); font-size: 21px; }
.section-description { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.updated { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.updated .icon { width: 15px; }
.price-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.price-card { padding: 20px; display: grid; grid-template-columns: 52px 1fr auto; gap: 15px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.price-calculator-item { transition: border-color .18s, box-shadow .18s; }
.price-calculator-item.has-quantity { border-color: rgba(255,81,0,.45); box-shadow: 0 8px 24px rgba(255,81,0,.08); }
.product-icon { width: 48px; height: 58px; display: grid; place-items: end center; background: #eef1ff; border-radius: 18px 18px 12px 12px; position: relative; }
.product-icon::before { content: ""; width: 22px; height: 7px; position: absolute; top: -3px; background: var(--navy); border-radius: 5px 5px 2px 2px; }
.product-icon span { width: 28px; height: 36px; margin-bottom: 5px; border: 3px solid var(--navy); border-radius: 10px 10px 7px 7px; }
.price-copy small { color: var(--orange); font-size: 8px; font-weight: 900; letter-spacing: 1px; }
.price-copy h3 { margin: 3px 0; color: var(--navy); font-size: 15px; }
.price-copy p { margin: 0; color: var(--muted); font-size: 10px; }
.price-values { display: grid; text-align: right; }
.price-values span { color: var(--muted); font-size: 10px; }
.price-values span s { margin-left: 4px; }
.price-values strong { color: var(--orange); font-size: 25px; letter-spacing: -.6px; }
.price-values em { color: var(--green); font-size: 9px; font-style: normal; font-weight: 800; }
.price-values em.price-kind-incentive { color: var(--orange); }
.calculator-row { grid-column: 1 / -1; padding-top: 15px; display: flex; align-items: end; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); }
.quantity-label, .line-total { display: grid; gap: 6px; }
.quantity-label > small, .line-total > small { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: 1px; }
.quantity-stepper { height: 42px; display: flex; align-items: center; overflow: hidden; border: 1px solid #dce1eb; border-radius: 11px; background: #fff; }
.quantity-stepper button { width: 42px; height: 100%; padding: 0; border: 0; background: #f1f3f9; color: var(--navy); font-size: 22px; font-weight: 700; }
.quantity-stepper button:active { background: #e4e8f4; }
.quantity-stepper input { width: 55px; height: 100%; padding: 0; border: 0; border-radius: 0; box-shadow: none; color: var(--ink); font-size: 16px; font-weight: 850; text-align: center; appearance: textfield; }
.quantity-stepper input::-webkit-inner-spin-button, .quantity-stepper input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.line-total { min-width: 125px; text-align: right; }
.line-total strong { color: var(--navy); font-size: 21px; }
.has-quantity .line-total strong { color: var(--orange); }
.charge-summary { margin-top: 16px; padding: 18px 20px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; color: #fff; background: var(--navy); border-radius: 16px; box-shadow: 0 13px 30px rgba(8,27,131,.17); }
.charge-summary-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: rgba(255,255,255,.12); color: #ff9865; font-size: 23px; font-weight: 900; }
.charge-summary-copy { display: grid; }
.charge-summary-copy small { color: #bdc7f2; font-size: 8px; font-weight: 900; letter-spacing: 1.2px; }
.charge-summary-copy strong { color: #fff; font-size: 29px; line-height: 1.15; letter-spacing: -.8px; }
.charge-summary.has-total .charge-summary-copy strong { color: #ff9865; }
.charge-summary-copy span { color: #bdc7f2; font-size: 9px; }
.clear-calculator { min-height: 36px; padding: 0 12px; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; background: transparent; color: #fff; font-size: 10px; font-weight: 800; }
.client-info { margin-top: 22px; padding: 18px 22px; display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.client-info > div { min-width: 0; display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; }
.client-info > div > span { grid-row: span 2; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #f0f2fa; color: var(--navy); }
.client-info .icon { width: 17px; }
.client-info small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.client-info strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; }
.notice { margin-top: 17px; padding: 13px 16px; background: #fff9eb; border: 1px solid #f6dfaa; border-radius: 10px; color: #78602b; font-size: 10px; line-height: 1.5; }

/* Órdenes de compra */
.order-create-panel { margin-top: 18px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 24px rgba(12,32,94,.05); }
.order-create-head { padding: 21px 23px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.order-create-head h2 { margin: 4px 0 3px; color: var(--navy); font-size: 20px; }
.order-create-head p { margin: 0; color: var(--muted); font-size: 11px; }
.order-create-head > .icon { width: 30px; height: 30px; color: var(--orange); }
.order-fields { padding: 20px 23px; display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.order-create-actions { padding: 17px 23px; display: flex; align-items: center; justify-content: space-between; gap: 15px; background: #f8f9fc; border-top: 1px solid var(--line); }
.order-create-actions small { color: var(--muted); font-size: 10px; }
.order-create-actions button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; transform: none; }
.order-row { grid-template-columns: 1fr 2fr 1fr .8fr 90px; }
.order-view-link { width: auto !important; padding: 7px 10px !important; gap: 5px; color: var(--navy) !important; font-size: 10px; font-weight: 800; }
.order-view-link .icon { width: 15px; }
.order-toolbar { margin: -7px 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.order-toolbar .back-link { margin: 0; }
.order-toolbar > div { display: flex; gap: 8px; }
.purchase-order { max-width: 920px; margin: 0 auto; padding: 38px 42px 28px; background: #fff; border: 1px solid #d9deea; border-radius: 8px; box-shadow: 0 12px 35px rgba(12,32,94,.08); }
.purchase-order-header { padding-bottom: 23px; display: flex; align-items: start; justify-content: space-between; gap: 25px; border-bottom: 3px solid var(--navy); }
.purchase-brand { display: grid; }
.purchase-brand img { width: 160px; height: auto; margin-bottom: 18px; }
.purchase-brand b { color: var(--navy); font-size: 25px; text-transform: uppercase; letter-spacing: .5px; }
.purchase-brand small { margin-top: 3px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; }
.folio-box { min-width: 205px; padding: 16px 18px; display: grid; border: 2px solid var(--orange); border-radius: 9px; text-align: right; }
.folio-box small { color: var(--orange); font-size: 9px; font-weight: 900; letter-spacing: 1.2px; }
.folio-box strong { margin: 5px 0; color: var(--navy); font-size: 18px; }
.folio-box span { color: var(--muted); font-size: 10px; }
.order-customer-grid, .order-delivery { padding: 22px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 25px; }
.order-customer-grid > div, .order-delivery > div { padding-bottom: 8px; display: grid; gap: 4px; border-bottom: 1px solid #cfd4df; }
.order-customer-grid .wide, .order-delivery .wide { grid-column: 1 / -1; }
.order-customer-grid small, .order-delivery small { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .7px; }
.order-customer-grid b, .order-delivery b { min-height: 16px; color: var(--ink); font-size: 11px; }
.order-items-wrap { overflow-x: auto; }
.order-items { width: 100%; border-collapse: collapse; border: 1px solid #aeb6c8; }
.order-items th { padding: 10px; color: #fff; background: var(--navy); font-size: 10px; text-transform: uppercase; }
.order-items th:first-child { text-align: left; }
.order-items td { padding: 11px 10px; border-bottom: 1px solid #dfe3eb; font-size: 11px; text-align: right; }
.order-items td:first-child { text-align: left; }
.order-items td small { margin-top: 3px; display: block; color: var(--muted); font-size: 8px; }
.order-total { padding: 17px 0 20px; display: grid; grid-template-columns: 1fr 280px; gap: 25px; border-bottom: 1px solid #dfe3eb; }
.order-total p { margin: 3px 0; color: var(--muted); font-size: 9px; }
.order-total dl { margin: 0; }
.order-total dl > div { padding: 5px 0; display: flex; justify-content: space-between; font-size: 11px; }
.order-total dt { font-weight: 700; }
.order-total dd { margin: 0; font-weight: 800; }
.order-total .grand { margin-top: 5px; padding-top: 10px; color: var(--orange); border-top: 2px solid var(--navy); font-size: 19px; }
.order-signatures { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 70px; text-align: center; }
.order-signatures span { display: block; height: 38px; border-bottom: 1px solid #6f778b; }
.order-signatures b { margin-top: 7px; display: block; color: var(--muted); font-size: 9px; }
.purchase-order-footer { margin-top: 35px; padding-top: 12px; color: var(--muted); border-top: 1px solid var(--line); font-size: 8px; text-align: center; }
.email-order-panel { max-width: 920px; margin: 18px auto 0; padding: 20px 23px; display: grid; grid-template-columns: 1fr 1.3fr; align-items: center; gap: 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.email-order-panel h2 { margin: 4px 0; color: var(--navy); font-size: 18px; }
.email-order-panel p { margin: 0; color: var(--muted); font-size: 10px; }
.email-order-panel form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

/* Admin */
.admin-tabs { margin: -4px 0 25px; display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.admin-tabs a { padding: 12px 17px; color: var(--muted); border-bottom: 3px solid transparent; font-size: 12px; font-weight: 750; white-space: nowrap; }
.admin-tabs a.active { color: var(--navy); border-bottom-color: var(--orange); }
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.stat-grid article { padding: 20px; display: grid; grid-template-columns: 47px 1fr; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.stat-icon { width: 47px; height: 47px; grid-row: span 2; display: grid; place-items: center; border-radius: 12px; }
.stat-icon.blue { color: var(--navy); background: #edf0ff; }
.stat-icon.orange { color: var(--orange); background: var(--cream); }
.stat-icon.teal { color: #087b72; background: #e8f9f7; }
.stat-grid article div { display: grid; }
.stat-grid article strong { color: var(--navy); font-size: 25px; line-height: 1; }
.stat-grid article small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.stat-grid article > a { grid-column: 2; display: flex; align-items: center; gap: 2px; color: var(--orange); font-size: 10px; font-weight: 800; }
.stat-grid article > a .icon { width: 12px; }
.admin-columns { margin-top: 18px; display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 18px rgba(12,32,94,.03); }
.panel-head { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 4px 0 0; color: var(--navy); font-size: 18px; }
.quick-grid { padding: 17px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-grid a { padding: 16px; display: grid; grid-template-columns: 38px 1fr; column-gap: 11px; border: 1px solid var(--line); border-radius: 12px; transition: .18s; }
.quick-grid a:hover { border-color: #bac3dc; transform: translateY(-1px); }
.quick-grid a > span { width: 38px; height: 38px; grid-row: span 2; display: grid; place-items: center; background: #eef1ff; color: var(--navy); border-radius: 10px; }
.quick-grid b { font-size: 12px; align-self: end; }
.quick-grid small { color: var(--muted); font-size: 9px; }
.activity-list { padding: 12px 21px 18px; }
.activity-list > div { padding: 10px 0; display: flex; gap: 10px; border-bottom: 1px solid #eef0f5; }
.activity-list > div:last-child { border: 0; }
.activity-dot { width: 8px; height: 8px; margin-top: 4px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px #fff0e9; }
.activity-list p { margin: 0; font-size: 10px; line-height: 1.35; }
.activity-list small { display: block; color: var(--muted); margin-top: 3px; }
.toolbar, .content-intro { margin-bottom: 17px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.content-intro h2 { margin: 0 0 4px; color: var(--navy); font-size: 20px; }
.content-intro p { margin: 0; color: var(--muted); font-size: 12px; }
.table-search { width: 340px; position: relative; }
.table-search .icon { position: absolute; left: 13px; top: 13px; width: 18px; color: var(--muted); }
.table-search input { padding-left: 40px; }
.form-panel { margin-bottom: 18px; }
.close-button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); background: var(--bg); border-radius: 9px; }
.close-button .icon { width: 17px; }
.form-grid { padding: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: span 2; }
.check-row { display: flex; align-items: center; gap: 9px; }
.check-row input { width: 16px; height: 16px; accent-color: var(--orange); }
.form-actions { padding-top: 5px; display: flex; justify-content: flex-end; gap: 9px; }
.format-discounts { padding: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fafbfe; }
.format-discounts > div:first-child { display: grid; gap: 4px; }
.format-discounts > div:first-child b { color: var(--navy); font-size: 13px; }
.format-discounts > div:first-child small { color: var(--muted); font-size: 10px; }
.format-discount-grid { margin-top: 15px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.format-discount-grid label { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.format-discount-grid label span { color: var(--ink); font-size: 11px; font-weight: 800; }
.format-discount-grid label small { color: var(--muted); font-size: 8px; font-weight: 650; }
.format-discount-grid input { margin-top: 3px; }
.table-panel { overflow: hidden; }
.data-table { width: 100%; }
.table-row { min-height: 68px; padding: 12px 20px; display: grid; grid-template-columns: 2fr 1.25fr .8fr .7fr 80px; align-items: center; gap: 14px; border-bottom: 1px solid #edf0f5; font-size: 11px; }
.table-row:last-child { border: 0; }
.table-head-row { min-height: 43px; background: #f8f9fc; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .7px; }
.table-row > span { min-width: 0; }
.table-row > span > b, .table-row > span > small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.table-row > span > b { color: var(--ink); font-size: 11px; }
.table-row > span > small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.discount-text { color: var(--orange)!important; font-size: 14px!important; }
.status, .role-badge { width: fit-content; padding: 5px 8px; display: inline-block; border-radius: 20px; font-size: 8px; font-style: normal; font-weight: 850; }
.status.on { color: #08734e; background: #e5f7ef; }
.status.off { color: #7b8292; background: #edf0f4; }
.role-badge { color: var(--navy); background: #edf0ff; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-actions a, .row-actions button { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 8px; font-weight: 800; }
.row-actions button { color: #a14232; }
.row-actions .icon { width: 15px; }
.row-actions form { margin: 0; }
.quick-price-panel { margin-bottom: 22px; overflow: hidden; }
.quick-price-panel .panel-head { background: linear-gradient(135deg,#f8f9ff,#fff); }
.quick-price-panel .panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.quick-price-panel .panel-head > .icon { width: 28px; height: 28px; color: var(--orange); }
.quick-price-form { padding: 5px 22px 20px; }
.quick-price-list { display: grid; }
.quick-price-row { padding: 14px 0; display: grid; grid-template-columns: minmax(210px,1.25fr) minmax(150px,.75fr) minmax(170px,.85fr); align-items: end; gap: 16px; border-bottom: 1px solid var(--line); }
.quick-price-row:last-child { border-bottom: 0; }
.quick-price-product { min-height: 46px; display: flex; align-items: center; gap: 12px; }
.quick-price-product > div { display: grid; gap: 3px; }
.quick-price-product small { color: var(--orange); font-size: 8px; font-weight: 900; letter-spacing: .7px; }
.quick-price-product b { color: var(--navy); font-size: 13px; }
.quick-format-icon { width: 32px; height: 42px; display: block; border: 3px solid var(--navy); border-radius: 8px; position: relative; background: #f5f7ff; }
.quick-format-icon::before { content: ""; width: 16px; height: 5px; position: absolute; left: 5px; top: -7px; border-radius: 3px 3px 0 0; background: var(--navy); }
.quick-price-row label { min-width: 0; }
.quick-price-row label > span { margin-bottom: 5px; display: block; color: var(--muted); font-size: 9px; font-weight: 800; }
.money-input { position: relative; }
.money-input > b { position: absolute; z-index: 1; left: 12px; top: 50%; color: var(--navy); font-size: 13px; transform: translateY(-50%); }
.money-input input { height: 46px; padding-left: 27px; color: var(--navy); font-size: 15px; font-weight: 850; background: #f8f9fc; }
.money-input input:focus { background: #fff; }
.incentive-input input { color: var(--orange); background: #fff8f4; border-color: #ffd8c6; }
.quick-price-footer { padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.quick-price-footer small { max-width: 520px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.format-settings-intro { margin-top: 27px; }
.product-admin-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.product-admin-card { padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.product-admin-card.muted { opacity: .62; }
.product-card-top { display: flex; align-items: start; justify-content: space-between; margin-bottom: 16px; }
.product-admin-card .product-icon { transform: scale(.82); transform-origin: left top; margin-bottom: -10px; }
.product-admin-card > small { color: var(--orange); font-size: 8px; font-weight: 900; letter-spacing: .9px; }
.product-admin-card h3 { margin: 5px 0; color: var(--navy); font-size: 15px; }
.product-admin-card p { min-height: 28px; margin: 0; color: var(--muted); font-size: 10px; }
.admin-price { margin: 16px 0; padding: 13px 0; display: grid; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.admin-price span { color: var(--muted); font-size: 8px; font-weight: 800; }
.admin-price strong { color: var(--navy); font-size: 24px; }
.admin-price .incentive-label { margin-top: 9px; color: var(--orange); }
.admin-price b { color: var(--orange); font-size: 16px; }
.admin-price small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.product-admin-card .btn { min-height: 39px; }
.import-layout { display: grid; grid-template-columns: 1.45fr .55fr; gap: 18px; }
.upload-panel { padding: 42px; text-align: center; }
.upload-illustration { width: 70px; height: 70px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 20px; background: #edf0ff; color: var(--navy); }
.upload-illustration .icon { width: 30px; height: 30px; }
.upload-panel h2 { margin: 7px 0 8px; color: var(--navy); }
.upload-panel > p { max-width: 480px; margin: 0 auto 22px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.upload-form { max-width: 460px; margin: auto; }
.file-drop { min-height: 155px; display: grid; place-items: center; border: 2px dashed #cad1e3; border-radius: 14px; background: #fafbfe; cursor: pointer; transition: .18s; }
.file-drop:hover { border-color: var(--navy); background: #f6f7ff; }
.file-drop input { display: none; }
.file-drop span { display: grid; justify-items: center; gap: 5px; color: var(--navy); }
.file-drop .icon { width: 27px; height: 27px; color: var(--orange); }
.file-drop small { color: var(--muted); font-size: 9px; }
.selected-file { min-height: 28px; padding: 8px; color: var(--green); font-size: 10px; font-weight: 700; }
.help-card { padding: 24px; }
.help-card h3 { margin: 7px 0 13px; color: var(--navy); }
.help-card ul { padding: 0; margin: 0 0 20px; list-style: none; }
.help-card li { padding: 8px 0 8px 20px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; position: relative; }
.help-card li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }
.info-card { margin-top: 14px; padding: 18px; background: #fff7e8; border: 1px solid #f4dfb8; border-radius: 14px; color: #6e5729; }
.info-card b { font-size: 11px; }
.info-card p { margin: 6px 0 0; font-size: 10px; line-height: 1.55; }
.user-row { grid-template-columns: 2fr .8fr 1fr .7fr 80px; }

@media (max-width: 900px) {
  .client-grid, .price-grid { grid-template-columns: 1fr; }
  .product-admin-grid { grid-template-columns: repeat(2,1fr); }
  .admin-columns, .import-layout { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .mobile-brand { display: block; margin-bottom: 58px; }
  .auth-panel { min-height: 100vh; }
}

@media (max-width: 650px) {
  body { padding-bottom: 68px; }
  .topbar { height: 64px; }
  .topbar-inner { padding: 0 17px; }
  .topbar .brand { font-size: 22px; }
  .topbar .brand img { width: 115px; }
  .desktop-nav, .profile-copy, .profile-button > .icon { display: none; }
  .profile-button { padding: 0; }
  .profile-menu { right: 14px; top: 57px; }
  .page { min-height: calc(100vh - 64px); padding: 23px 15px 0; }
  .page-heading { margin-bottom: 17px; }
  .page-heading h1 { font-size: 25px; }
  .mobile-nav { height: 66px; padding: 7px max(20px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)); position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-evenly; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
  .mobile-nav a { min-width: 70px; display: grid; justify-items: center; align-content: center; gap: 3px; color: #81889b; font-size: 9px; font-weight: 800; }
  .mobile-nav a.active { color: var(--navy); }
  .mobile-nav a.active .icon { color: var(--orange); }
  .mobile-nav .icon { width: 21px; height: 21px; }
  .search-hero { margin-bottom: 22px; padding: 25px 19px 20px; border-radius: 19px; }
  .search-hero h2 { font-size: 27px; }
  .search-hero p { font-size: 12px; line-height: 1.5; }
  .search-box { height: auto; padding: 9px 10px 9px 15px; display: grid; grid-template-columns: 22px 1fr; gap: 8px; }
  .search-box input { min-width: 0; height: 43px; font-size: 13px; }
  .search-box .btn { height: 43px; grid-column: span 2; }
  .empty-state { min-height: 285px; }
  .results-heading { align-items: start; }
  .results-heading span { max-width: 140px; text-align: right; }
  .client-card { padding: 17px 15px; grid-template-columns: 1fr auto 13px; gap: 10px; }
  .client-main { align-items: start; gap: 10px; }
  .company-avatar { width: 39px; height: 39px; border-radius: 10px; }
  .client-card h3 { max-width: 150px; font-size: 13px; white-space: normal; }
  .client-meta { display: grid; gap: 4px; }
  .discount-badge { min-width: 65px; padding: 8px 5px; }
  .discount-badge strong { font-size: 17px; }
  .client-hero { padding: 22px 18px; display: grid; }
  .client-identity { align-items: start; }
  .company-avatar.large { width: 48px; height: 48px; }
  .client-identity h2 { font-size: 20px; }
  .discount-hero { padding: 18px 0 0; grid-template-columns: 1fr auto; align-items: end; border-left: 0; border-top: 1px solid rgba(255,255,255,.2); }
  .discount-hero strong { grid-row: span 2; grid-column: 2; font-size: 43px; }
  .section-title { align-items: start; gap: 12px; }
  .updated { max-width: 100px; text-align: right; }
  .price-card { padding: 15px 13px; grid-template-columns: 43px 1fr auto; gap: 10px; }
  .price-card .product-icon { width: 40px; height: 50px; }
  .price-copy h3 { font-size: 13px; }
  .price-copy p { display: none; }
  .price-values strong { font-size: 20px; }
  .calculator-row { margin: 3px -2px 0; padding-top: 13px; }
  .quantity-stepper { height: 46px; }
  .quantity-stepper button { width: 46px; }
  .quantity-stepper input { width: 46px; }
  .line-total { min-width: 105px; }
  .line-total strong { font-size: 19px; }
  .charge-summary { margin: 14px 0 0; padding: 13px; grid-template-columns: 40px 1fr auto; gap: 10px; position: sticky; z-index: 35; bottom: 73px; border: 1px solid rgba(255,255,255,.13); box-shadow: 0 10px 30px rgba(8,27,131,.28); }
  .charge-summary-icon { width: 40px; height: 40px; border-radius: 10px; font-size: 19px; }
  .charge-summary-copy strong { font-size: 23px; }
  .clear-calculator { min-height: 34px; padding: 0 9px; }
  .client-info { grid-template-columns: 1fr; }
  .order-fields { padding: 17px; grid-template-columns: 1fr; }
  .order-fields .span-2 { grid-column: auto; }
  .order-create-head, .order-create-actions { padding: 17px; }
  .order-create-actions { align-items: stretch; flex-direction: column; }
  .order-create-actions .btn { width: 100%; }
  .order-row { grid-template-columns: 1fr 1fr; }
  .order-toolbar { align-items: stretch; flex-direction: column; }
  .order-toolbar > div { display: grid; }
  .purchase-order { padding: 22px 17px; border-radius: 7px; }
  .purchase-order-header { display: grid; }
  .purchase-brand img { width: 130px; margin-bottom: 13px; }
  .purchase-brand b { font-size: 20px; }
  .folio-box { width: 100%; min-width: 0; text-align: left; }
  .order-customer-grid, .order-delivery { grid-template-columns: 1fr; }
  .order-customer-grid .wide, .order-delivery .wide { grid-column: auto; }
  .order-items { min-width: 530px; }
  .order-total { grid-template-columns: 1fr; }
  .order-total dl { margin-left: auto; width: min(280px,100%); }
  .order-signatures { gap: 25px; }
  .email-order-panel { padding: 17px; grid-template-columns: 1fr; }
  .email-order-panel form { grid-template-columns: 1fr; }
  .format-discount-grid { grid-template-columns: 1fr; }
  .admin-tabs { margin-right: -15px; }
  .stat-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .toolbar, .content-intro { align-items: stretch; flex-direction: column; }
  .table-search { width: 100%; }
  .form-grid { padding: 17px; grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .table-head-row { display: none; }
  .table-row, .user-row { padding: 16px; grid-template-columns: 1fr 1fr; gap: 12px; }
  .table-row > span::before { content: attr(data-label); display: block; margin-bottom: 4px; color: #9299aa; font-size: 8px; font-weight: 850; text-transform: uppercase; }
  .table-row > span:first-child { grid-column: span 2; }
  .row-actions { grid-column: span 2; justify-content: flex-start; }
  .quick-price-form { padding: 4px 16px 17px; }
  .quick-price-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .quick-price-product { grid-column: span 2; }
  .quick-price-footer { align-items: stretch; flex-direction: column; }
  .quick-price-footer .btn { width: 100%; }
  .product-admin-grid { grid-template-columns: 1fr; }
  .upload-panel { padding: 30px 18px; }
  .auth-panel { padding: 26px 22px; align-items: start; }
  .auth-card { margin-top: 24px; }
  .auth-card h2 { font-size: 28px; }
  .mobile-brand { margin-bottom: 70px; }
  .footer { margin-top: 35px; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  body { padding: 0 !important; background: #fff; }
  .topbar, .page-heading, .alert, .no-print, .mobile-nav, .footer { display: none !important; }
  .page { width: 100%; max-width: none; min-height: 0; padding: 0; margin: 0; }
  .purchase-order { width: 100%; max-width: none; padding: 8mm; border: 0; box-shadow: none; }
  .purchase-order-header { break-inside: avoid; }
  .order-items-wrap { overflow: visible; }
  .order-items { min-width: 0; }
  .order-items tr, .order-total, .order-delivery, .order-signatures { break-inside: avoid; }
  .purchase-order { color-adjust: exact; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
