:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #15233a;
  background: #f5f8fb;
  font-synthesis: none;
  --navy: #071831;
  --blue: #1267ee;
  --green: #0a8a48;
  --red: #de3346;
  --line: #dbe4ee;
  --muted: #66758a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: linear-gradient(125deg,#012190 0 52%,#eef5ff 52%); }
.brand-panel { color: white; padding: clamp(34px,7vw,90px); display: flex; flex-direction: column; justify-content: center; }
.logo { font-size: clamp(42px,7vw,72px); letter-spacing: .18em; font-weight: 300; line-height: 1; }
.logo small { display: block; font-size: 10px; letter-spacing: .55em; margin: 10px 0 34px 4px; }
.brand-panel h1 { font-size: clamp(30px,4vw,52px); max-width: 650px; margin: 0 0 16px; }
.brand-panel p { color: #b9c8dc; font-size: 18px; max-width: 580px; line-height: 1.6; }
.login-side { display: grid; place-items: center; padding: 28px; }
.login-card { background: white; width: min(440px,100%); border-radius: 22px; padding: 38px; box-shadow: 0 30px 70px #06142929; }
.login-logo { display: block; width: min(250px,75%); max-height: 150px; object-fit: contain; margin: 0 auto 24px; }
.shipping-owner-check { display: flex !important; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px !important; font-weight: 700; color: #8a5700 !important; cursor: pointer; }
.shipping-owner-check input { width: 18px !important; height: 18px; margin: 0; accent-color: #087f4f; }
.login-card h2 { margin: 0 0 8px; font-size: 28px; }
.login-card > p { margin: 0 0 26px; color: var(--muted); }
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field label { font-size: 12px; text-transform: uppercase; font-weight: 800; color: #526174; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #cbd7e5; border-radius: 4px; padding: 9px 10px; background: white; outline: none; font-size: 12px; }
.field textarea { min-height: 86px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #1267ee18; }
.primary { border: 0; border-radius: 4px; padding: 10px 15px; color: white; background: #0869f2; font-weight: 800; font-size: 12px; }
.success { border: 0; border-radius: 4px; padding: 10px 15px; color: white; background: #07813f; font-weight: 800; font-size: 12px; }
.secondary { border: 1px solid #b9c9db; border-radius: 4px; padding: 9px 14px; background: white; color: #24415f; font-weight: 700; font-size: 12px; }
.danger { border: 0; border-radius: 7px; padding: 7px 10px; background: var(--red); color: white; font-weight: 800; }
.ghost { background: #fff0f1; color: #b91f31; }
.row-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.order-detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.order-detail-item { min-height: 72px; padding: 12px 14px; border: 1px solid #dbe5ef; border-radius: 7px; background: #f8fbff; display: flex; flex-direction: column; gap: 7px; }
.order-detail-item span { color: #526783; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.order-detail-item strong { color: #15233a; font-size: 15px; }
.order-detail-item.positive strong { color: #08713d; }
.order-detail-item.negative strong { color: #c51f35; }
.order-detail-item.detail-total { background: #eaf2ff; border-color: #bed4f0; }
.order-detail-item.detail-total strong { color: #075fcf; font-size: 19px; }
.view-only-note { margin-top: 14px; }
#order-rows td:nth-child(7) { color: #15233a; }
.wide { width: 100%; }
.demo-note { margin-top: 18px; background: #edf5ff; color: #2c527f; padding: 12px; border-radius: 9px; font-size: 13px; line-height: 1.5; }
.topbar { min-height: 72px; background: #012190; color: #fff; display: flex; align-items: center; padding: 0 20px; gap: 14px; box-shadow: 0 2px 8px #0614292b; }
.topbar .mini-logo { flex: 0 0 105px; width: 105px; height: 52px; overflow: hidden; color: transparent; font-size: 0; background: url('/distribuidor/logo-dufe-white.png') center/contain no-repeat; }
.topbar .mini-logo small { display: none; }
.topbar nav { display: flex; gap: 0; flex: 1; overflow: visible; }
.topbar nav::-webkit-scrollbar { display: none; }
.nav-btn { border: 0; background: transparent; color: #fff; padding: 20px 5px; border-bottom: 3px solid transparent; white-space: nowrap; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 5px; }
.nav-btn .svg-icon { width: 20px; height: 20px; stroke-width: 2.2; }
.menu-image-icon { width: 19px; height: 19px; object-fit: contain; flex: 0 0 19px; filter: grayscale(1) brightness(0) invert(1); }
.nav-btn.active { background: #0c55c6; border-color: #3bc0ff; color: white; }
.nav-menu.open > .nav-btn { background: #0c55c6; border-color: #3bc0ff; color: white; }
.topbar:has(.nav-menu.open) nav > .nav-btn.active { background: transparent; border-color: transparent; color: #fff; }
.svg-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-menu { position: relative; display: flex; }
.nav-submenu { display: none; position: absolute; top: 70px; left: 0; right: auto; z-index: 30; min-width: 240px; background: white; border: 1px solid #cbd8e6; border-radius: 4px; box-shadow: 0 12px 28px #06142933; padding: 5px; }
.nav-menu.open .nav-submenu { display: grid; }
.nav-submenu button { border: 0; background: white; color: #17324f; padding: 12px 14px; text-align: left; font-size: 13px; font-weight: 700; border-radius: 3px; display: flex; align-items: center; gap: 8px; }
.nav-submenu button:hover { background: #eaf3ff; color: #075fcf; }
.user-chip { display: flex; align-items: center; gap: 9px; white-space: nowrap; font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #1d69d6; font-weight: 800; }
.avatar-photo { object-fit: cover; background: white; }
.profile-button { border: 0; background: transparent; color: white; display: flex; align-items: center; gap: 9px; padding: 4px; border-radius: 20px; font: inherit; cursor: pointer; }
.profile-button:hover { background: #ffffff1c; }
.profile-photo-area { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; padding: 16px; border-radius: 12px; background: #f3f7fc; }
.profile-photo-area > div:last-child { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.profile-photo-area small { display: block; width: 100%; color: var(--muted); }
.profile-preview { width: 92px; height: 92px; flex: 0 0 92px; border-radius: 50%; object-fit: cover; border: 3px solid #d6e3f1; background: white; }
.profile-initials { display: grid; place-items: center; background: #1d69d6; color: white; font-size: 25px; font-weight: 800; }
.photo-picker { display: inline-flex; align-items: center; cursor: pointer; }
.profile-form { width: min(720px,100%); }
.icon-btn { border: 0; background: transparent; color: white; font-size: 20px; padding: 8px; }
.mobile-menu-toggle, .mobile-nav-backdrop { display: none; }
.page { padding: 14px 22px 28px; max-width: 1500px; margin: auto; }
.hero-line { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 12px; background: #fff; border: 1px solid #dce6f0; border-radius: 5px; padding: 12px 15px; }
.title-group { display: flex; align-items: center; gap: 12px; }
.title-icon { width: 40px; height: 40px; border-radius: 5px; background: #0d69ef; color: white; display: grid; place-items: center; }
.title-icon .svg-icon { width: 24px; height: 24px; stroke-width: 2; }
.icon-btn .svg-icon { width: 21px; height: 21px; }
.hero-line h1 { margin: 0; font-size: 21px; color: #10284a; }
.hero-line p { margin: 3px 0 0; color: #73839a; font-size: 12px; }
.heading-actions { display: flex; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(180px,1fr)); gap: 10px; margin-bottom: 12px; }
.dashboard-stats { grid-template-columns: repeat(5,minmax(150px,1fr)); }
.stat, .panel { background: white; border: 1px solid #dbe5ef; border-radius: 6px; box-shadow: 0 2px 7px #08234c0a; }
.stat { padding: 13px 15px; }
.stat span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.stat strong { display: block; font-size: 21px; margin-top: 5px; color: var(--navy); }
.stat small { color: var(--muted); display: block; margin-top: 4px; }
.stat.blue { background: #edf5ff; }
.stat.green { background: #eaf9f0; }
.stat.red { background: #fff0f1; }
.panel { padding: 12px; }
.spaced { margin-top: 18px; }
.compact { grid-template-columns: repeat(3,minmax(180px,1fr)); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 15px; color: #10284a; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th { text-align: left; color: #526783; font-size: 10px; text-transform: uppercase; padding: 8px 9px; background: #eaf2fb; }
td { padding: 9px; border-top: 1px solid #e7edf4; font-size: 11px; }
td small { color: var(--muted); }
.badge { display: inline-block; padding: 5px 9px; border-radius: 999px; font-weight: 800; font-size: 11px; }
.badge.open { color: #a35d00; background: #fff0d3; }
.badge.paid { color: #08713d; background: #dff5e9; }
.badge.late { color: #b91f31; background: #ffe0e4; }
.form-page { background: white; border: 1px solid #dbe5ef; border-radius: 6px; padding: 12px; display: grid; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.form-grid.four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.field.double { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.section-title { background: linear-gradient(90deg,#e8f3ff,#f7fbff); border: 0; border-left: 4px solid var(--blue); padding: 8px 10px; font-size: 12px; font-weight: 900; color: #123f78; border-radius: 3px; margin-bottom: 8px; }
.section-title .svg-icon { width: 15px; height: 15px; vertical-align: middle; }
.total-field output { display: flex; align-items: center; min-height: 36px; border-radius: 4px; padding: 8px 11px; background: #eef5ff; border: 1px solid #bed4f0; color: #075fcf; font-size: 17px; font-weight: 900; }
.admin-order-layout { background: white; border: 1px solid #d7e2ee; border-radius: 7px; padding: 24px 28px; display: grid; grid-template-columns: minmax(0,1.85fr) minmax(330px,.95fr); gap: 26px; box-shadow: 0 4px 18px #08234c0a; }
.admin-order-main { display: grid; gap: 18px; align-content: start; }
.order-title { display: flex; align-items: center; gap: 20px; margin-bottom: 2px; }
.order-cart { color: #0871f9; }
.order-cart .svg-icon { width: 56px; height: 56px; stroke-width: 2.3; }
.order-title h1 { margin: 0; font-size: 30px; color: #071633; }
.order-title p { margin: 5px 0 0; color: #60718d; font-size: 14px; }
.order-top-grid { display: grid; grid-template-columns: 1.2fr .85fr; gap: 28px; }
.field-with-button { display: grid; grid-template-columns: 1fr 48px; gap: 7px; }
.square-search { border: 1px solid #c7d4e5; border-radius: 5px; background: #f8fbff; color: #0b2347; display: grid; place-items: center; }
.square-search .svg-icon { width: 23px; height: 23px; stroke-width: 2.4; }
.admin-order-layout .field label, .value-card label { color: #0b1732; font-size: 13px; font-weight: 900; text-transform: none; }
.admin-order-layout .field label b { color: #ef1c34; }
.admin-order-layout .field label span, .value-card label span { font-weight: 500; }
.admin-order-layout .field input, .admin-order-layout .field select { min-height: 45px; font-size: 15px; border-color: #c4d3e6; }
.value-card-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.value-card { border-radius: 7px; padding: 16px 14px; display: grid; gap: 10px; }
.value-card input { width: 100%; min-height: 48px; border: 1px solid #bfd0e5; border-radius: 5px; background: white; padding: 9px 12px; font-size: 19px; color: #132342; }
.value-card small { font-size: 12px; line-height: 1.45; color: #60718d; }
.green-card { background: linear-gradient(135deg,#e8faef,#f4fcf7); }
.green-card label { color: #087036; }
.blue-card { background: linear-gradient(135deg,#e9f5ff,#f4faff); }
.blue-card label { color: #0861ce; }
.gold-card { background: linear-gradient(135deg,#fff4d9,#fffaf0); }
.gold-card label { color: #132342; }
.info-banner { display: flex; align-items: center; gap: 16px; padding: 17px 22px; background: linear-gradient(90deg,#eef7ff,#f6fbff); color: #163569; border-radius: 6px; font-size: 13px; line-height: 1.55; }
.info-banner b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #0871f9; color: white; font-size: 19px; }
.admin-order-side { display: grid; gap: 14px; align-content: start; }
.date-field { width: 72%; margin-left: auto; }
.order-summary, .freight-summary { border-radius: 7px; padding: 14px; }
.order-summary { background: linear-gradient(135deg,#eaf5ff,#f6fbff); }
.freight-summary { background: linear-gradient(135deg,#e8faef,#f5fcf7); }
.order-summary h2, .freight-summary h2 { display: flex; align-items: center; gap: 9px; margin: 0 0 10px; font-size: 16px; color: #071a4c; }
.freight-summary h2 { color: #087036; }
.freight-summary h2 span { font-weight: 500; }
.order-summary h2 .svg-icon, .freight-summary h2 .svg-icon { width: 23px; height: 23px; }
.order-summary > div, .freight-summary > div { display: flex; justify-content: space-between; gap: 15px; background: white; padding: 11px 12px; border-bottom: 1px solid #dce6f0; font-size: 13px; }
.order-summary footer { display: flex; justify-content: space-between; align-items: center; padding: 14px 12px 2px; color: #071a6c; font-size: 18px; font-weight: 900; }
.order-summary footer strong { font-size: 25px; }
.freight-summary em { color: #60718d; font-style: normal; font-weight: 500; margin-left: 10px; }
.side-actions { display: grid; grid-template-columns: .7fr 1.3fr; gap: 10px; margin-top: 2px; }
.side-actions button { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 15px; }
.actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.filter-panel { background: white; border: 1px solid #dbe5ef; border-radius: 6px; margin-bottom: 10px; padding: 10px; }
.filter-caption { color: #164b8a; font-size: 11px; font-weight: 900; margin-bottom: 8px; }
.filters { display: grid; grid-template-columns: minmax(220px,1fr) minmax(170px,.35fr); gap: 8px; margin-bottom: 10px; }
.filters:has(#order-type) { grid-template-columns: minmax(220px,1fr) repeat(2,minmax(170px,.35fr)); }
.filters.bill-filters { grid-template-columns: minmax(220px,1fr) minmax(220px,.7fr) minmax(170px,.35fr); }
.filters input, .filters select { border: 1px solid #cbd7e5; border-radius: 4px; padding: 9px 10px; background: white; font-size: 12px; }
.report-filters { display: grid; grid-template-columns: minmax(210px,1.15fr) repeat(4,minmax(140px,.55fr)); gap: 10px; }
.report-filters .field { margin-bottom: 0; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.choice-card { display: flex; align-items: center; gap: 10px; border: 1px solid #cbd7e5; border-radius: 5px; padding: 11px; background: #fff; }
.choice-card:has(input:checked) { border-color: #1267ee; background: #f1f7ff; }
.choice-card span { display: grid; gap: 2px; }
.choice-card small { color: var(--muted); font-size: 10px; }
.empty { text-align: center; padding: 30px; color: var(--muted); }
.empty-box { border: 1px dashed #b9c8d9; color: var(--muted); background: #f8fafc; padding: 34px; text-align: center; border-radius: 10px; }
.positive { color: #08713d; }
.negative { color: #c51f35; }
.payment-grid { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(320px,.7fr); gap: 20px; margin-top: 18px; }
.debt-list { display: grid; gap: 9px; max-height: 520px; overflow: auto; }
.debt { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); padding: 13px; border-radius: 9px; background: #fbfdff; }
.debt:has(input:checked) { border-color: var(--blue); background: #edf5ff; }
.debt span { display: grid; gap: 3px; }
.debt small { color: var(--muted); }
.summary-card { background: #f4f8fd; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.summary-total { display: flex; align-items: center; justify-content: space-between; padding: 15px 0 19px; border-bottom: 1px solid var(--line); margin-bottom: 15px; }
.summary-total strong { font-size: 23px; color: var(--blue); }
.check-card { border: 1px solid var(--line); border-radius: 9px; padding: 13px; background: #f8fbff; font-weight: 700; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: #051225aa; display: grid; place-items: center; padding: 20px; }
.modal { background: white; border-radius: 16px; width: min(1000px,100%); max-height: 92vh; overflow: auto; padding: 24px; box-shadow: 0 30px 80px #0005; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { margin: 0; }
.modal-x { border: 0; background: transparent; font-size: 30px; line-height: 1; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; background: #083723; color: white; padding: 14px 18px; border-radius: 10px; box-shadow: 0 12px 35px #0004; max-width: 420px; }
.toast.error { background: #a51d30; }
.loading { padding: 80px; text-align: center; color: var(--muted); }
.error-box { border-color: #f3a5af; background: #fff7f8; }
@media (max-width: 900px) { .login-page { grid-template-columns: 1fr; background: #eef5ff; } .brand-panel { display: none; } .stats, .dashboard-stats { grid-template-columns: repeat(2,1fr); } .topbar { padding: 0 12px; } .user-chip span { display: none; } }
@media (max-width: 1100px) { .admin-order-layout { grid-template-columns: 1fr; } .date-field { width: 100%; } }
@media (max-width: 900px) { .form-grid, .form-grid.four, .payment-grid { grid-template-columns: 1fr 1fr; } .payment-grid > * { grid-column: 1 / -1; } }
@media (max-width: 900px) { .report-filters { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .stats, .compact, .form-grid, .form-grid.four, .filters, .choice-row { grid-template-columns: 1fr; } .page { padding: 10px; } .hero-line { align-items: flex-start; flex-direction: column; } .span-all, .field.double { grid-column: auto; } .modal { padding: 18px; } }
@media (max-width: 700px) { .order-detail-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .order-detail-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .admin-order-layout { padding: 16px; } .order-top-grid, .value-card-grid { grid-template-columns: 1fr; } .order-title h1 { font-size: 24px; } }

/* Ajustes para tablet */
@media (max-width: 1100px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .mini-logo { flex-basis: 90px; width: 90px; }
  .topbar nav { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .nav-btn { min-height: 58px; padding: 15px 8px; }
  .nav-submenu { position: fixed; top: 72px; right: 12px; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .page { padding: 12px 14px 24px; }
}

/* Ajustes para celular */
@media (max-width: 700px) {
  .topbar { display: grid; grid-template-columns: 44px auto 1fr; min-height: 62px; padding: 6px 10px; gap: 8px; position: sticky; top: 0; z-index: 40; }
  .mobile-menu-toggle { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #ffffff45; border-radius: 7px; background: #ffffff12; color: white; font-size: 25px; font-weight: 900; }
  .topbar .mini-logo { width: 88px; height: 48px; }
  .user-chip { justify-self: end; }
  .user-chip .avatar { width: 32px; height: 32px; }
  .topbar nav { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: min(86vw,330px); padding: 78px 12px 20px; background: #012190; box-shadow: 15px 0 40px #0007; overflow-y: auto; overflow-x: hidden; transform: translateX(-105%); transition: transform .22s ease; z-index: 70; }
  body.mobile-nav-open { overflow: hidden; }
  body.mobile-nav-open .topbar nav { transform: translateX(0); }
  .mobile-nav-backdrop { position: fixed; inset: 0; z-index: 60; background: #020a17a8; }
  body.mobile-nav-open .mobile-nav-backdrop { display: block; }
  .nav-btn { flex: 0 0 auto; width: 100%; min-height: 48px; padding: 12px 14px; border-bottom: 0; border-left: 4px solid transparent; border-radius: 6px; font-size: 13px; justify-content: flex-start; }
  .nav-btn.active { border-left-color: #3bc0ff; border-bottom: 0; }
  .nav-btn .svg-icon { width: 17px; height: 17px; }
  .nav-menu { width: 100%; display: grid; }
  .nav-submenu { position: static; min-width: 0; width: 100%; margin-top: 3px; max-height: none; box-shadow: none; border: 0; border-radius: 6px; }
  .page { padding: 8px; }
  .hero-line { padding: 11px; gap: 10px; }
  .title-group { align-items: flex-start; }
  .title-icon { width: 36px; height: 36px; flex: 0 0 36px; }
  .hero-line h1 { font-size: 18px; }
  .hero-line p { font-size: 11px; }
  .heading-actions, .actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .heading-actions button, .actions button, .side-actions button, .primary, .secondary, .success { min-height: 44px; }
  .stats, .compact { grid-template-columns: 1fr; }
  .stat { padding: 12px; }
  .panel { padding: 9px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .filters, .form-grid, .form-grid.four, .payment-grid, .choice-row { grid-template-columns: 1fr; }
  .report-filters { grid-template-columns: 1fr; }
  .span-all, .field.double, .payment-grid > * { grid-column: auto; }
  .field input, .field select, .field textarea, .filters input, .filters select { min-height: 44px; font-size: 16px; }
  .admin-order-layout { padding: 12px; gap: 16px; }
  .order-title { gap: 12px; }
  .order-cart .svg-icon { width: 42px; height: 42px; }
  .order-title h1 { font-size: 22px; }
  .order-top-grid, .value-card-grid { grid-template-columns: 1fr; gap: 10px; }
  .date-field { width: 100%; }
  .value-card { padding: 13px; }
  .value-card input { font-size: 18px; }
  .info-banner { padding: 13px; align-items: flex-start; }
  .order-summary > div, .freight-summary > div { gap: 8px; padding: 10px 8px; }
  .order-summary footer { font-size: 16px; }
  .order-summary footer strong { font-size: 21px; }
  .side-actions { grid-template-columns: 1fr; }
  .table-wrap { margin: 0 -9px; padding: 0 9px 7px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 850px; }
  th, td { white-space: nowrap; }
  .debt { grid-template-columns: auto minmax(0,1fr); }
  .debt b { grid-column: 2; }
  .summary-card { padding: 13px; }
  .modal-backdrop { padding: 8px; align-items: end; }
  .modal { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; padding: 15px; }
  .toast { left: 10px; right: 10px; bottom: 10px; max-width: none; }
  .login-side { padding: 14px; }
  .login-card { padding: 24px 18px; border-radius: 14px; }
  .login-logo { max-height: 110px; margin-bottom: 18px; }
}

@media (max-width: 390px) {
  .nav-btn { font-size: 12px; padding-inline: 7px; }
  .hero-line h1 { font-size: 17px; }
  .order-summary footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}


/* Quadros do pedido cliente e ações contidas no rateio do frete. */
.admin-order-layout .order-data-box, .admin-order-layout .order-values-box, .admin-order-layout .freight-action-box { min-width: 0; border: 1px solid #506078; border-radius: 8px; padding: 12px; }
.admin-order-layout .order-data-box { display: grid; gap: 14px; }
.admin-order-layout .order-data-box .field { margin-bottom: 0; min-width: 0; }
.admin-order-layout .order-data-box .form-grid { grid-template-columns: minmax(0, 280px); }
.admin-order-layout .order-values-box { display: grid; gap: 12px; }
.admin-order-layout .order-values-box .value-card-grid { min-width: 0; grid-template-columns: repeat(3,minmax(0,1fr)); }
.admin-order-layout .value-card, .admin-order-layout .value-card input { min-width: 0; }
.admin-order-layout .order-summary { border: 1px solid #506078; }
.admin-order-layout .freight-action-box { padding: 10px; }
.admin-order-layout .freight-action-box .freight-summary { padding: 10px; }
.admin-order-layout .freight-action-box .side-actions { grid-template-columns: minmax(0,.75fr) minmax(0,1.25fr); gap: 8px; margin-top: 12px; }
.admin-order-layout .freight-action-box .side-actions button { min-width: 0; width: 100%; min-height: 40px; padding: 9px 8px; gap: 6px; font-size: 12px; white-space: normal; }
.admin-order-layout .side-actions .svg-icon { width: 16px; height: 16px; }
.admin-order-layout .field-with-button { min-width: 0; }
.admin-order-layout .field-with-button input, .admin-order-layout .field-with-button select { min-width: 0; }
@media (min-width: 901px) { .admin-order-layout { grid-template-columns: minmax(0,2fr) minmax(285px,1fr); gap: 20px; padding: 20px; } }
@media (max-width: 700px) { .admin-order-layout .order-values-box .value-card-grid { grid-template-columns: 1fr; } .admin-order-layout .order-data-box .form-grid { grid-template-columns: 1fr; } }

/* Valores com dimensões iguais e alinhamento entre os três cartões. */
.admin-order-layout .order-values-box .value-card { display: grid; grid-template-rows: 38px 52px minmax(34px,auto) 30px; align-content: start; align-items: start; gap: 10px; }
.admin-order-layout .order-values-box .value-card > label:first-child { margin: 0; line-height: 1.4; }
.admin-order-layout .order-values-box .value-card > input[type="number"] { width: 100%; height: 52px; min-height: 52px; margin: 0; padding: 12px; font-size: 17px; }
.admin-order-layout .order-values-box .value-card > small { margin: 0; line-height: 1.5; }
.admin-order-layout .order-values-box .value-card .shipping-owner-check { margin-top: 0; }

/* Linhas alternadas para facilitar a leitura das listas. */
table tbody tr:nth-child(odd) { background-color: #edf5ff; }
table tbody tr:nth-child(even) { background-color: #ffffff; }
table tbody tr:hover { background-color: #dcecff; }

/* Pesquisa compacta e ações de saldo. */
.billing-balance-toolbar { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px; }
.billing-balance-toolbar .field { width:320px; max-width:100%; margin-bottom:0; }
.billing-balance-toolbar > button { min-height:40px; white-space:nowrap; }
.billing-balance-stats { grid-template-columns:repeat(5,minmax(0,1fr)); }
@media(max-width:1100px) { .billing-balance-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:560px) { .billing-balance-stats { grid-template-columns:1fr; } .billing-balance-toolbar .field { width:100%; } }

/* Confirmação visual do abatimento de saldo. */
.balance-confirm-backdrop { z-index:100; align-items:center; }
.balance-confirm-dialog { width:min(480px,100%); border-radius:16px; padding:24px; }
.balance-confirm-dialog > p { color:var(--muted); font-size:14px; line-height:1.6; }
.balance-confirm-dialog .modal-head h2 { font-size:20px; }
.balance-confirm-summary { background:#f1f7ff; border:1px solid #d6e6fb; border-radius:10px; padding:16px; margin:20px 0; }
.balance-confirm-summary > div { display:flex; justify-content:space-between; align-items:baseline; gap:16px; padding:8px 0; font-size:13px; }
.balance-confirm-summary span { color:#526783; }
.balance-confirm-summary strong { text-align:right; overflow-wrap:anywhere; min-width:0; }
.balance-confirm-summary .balance-confirm-value { border-top:1px solid #cfdef1; margin-top:8px; padding-top:16px; }
.balance-confirm-value strong { color:#1267ee; font-size:24px; }
.balance-confirm-dialog .actions button { min-height:42px; padding:10px 20px; }

/* Observação opcional ao lado da forma de pagamento. */
.admin-order-layout .order-data-box .form-grid { grid-template-columns:minmax(180px,280px) minmax(0,1fr); gap:14px; }
.order-notes-cell { min-width:180px; max-width:360px; white-space:normal; overflow-wrap:anywhere; }
@media(max-width:700px) { .admin-order-layout .order-data-box .form-grid { grid-template-columns:1fr; } }

/* Login: senha visível por opção e acesso lembrado somente com consentimento. */
.login-password-wrap { position:relative; }
.login-password-wrap input { padding-right:46px; }
.login-password-toggle { position:absolute; right:4px; top:50%; transform:translateY(-50%); width:36px; height:32px; border:0; border-radius:5px; background:transparent; color:#45617f; display:grid; place-items:center; }
.login-password-toggle:hover, .login-password-toggle:focus-visible { background:#eaf3ff; color:#1267ee; }
.login-remember { display:flex; align-items:center; gap:8px; margin:0 0 18px; font-size:13px; color:#526174; cursor:pointer; }
.login-remember input { width:16px; height:16px; margin:0; accent-color:#1267ee; }

/* Configuração do mínimo de frete em uma janela própria. */
.freight-settings-controls { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.freight-settings-summary { font-size:13px; color:#526783; }
.freight-settings-backdrop { z-index:110; align-items:center; }
.freight-settings-dialog { width:min(540px,100%); border-radius:16px; }
.freight-settings-help { color:#526783; font-size:13px; line-height:1.6; background:#edf5ff; border-radius:8px; padding:12px; }
.freight-settings-form > small { display:block; margin-top:14px; color:#66758a; }

/* Pesquisa compacta e período da consulta de pedidos. */
.filters.order-query-filters:has(#order-type) { grid-template-columns:minmax(180px,1.4fr) minmax(140px,1fr) minmax(130px,.8fr) minmax(145px,.8fr) minmax(145px,.8fr); gap:10px; align-items:end; }
.order-query-field { display:grid; gap:6px; min-width:0; }
.order-query-field > span { font-size:11px; font-weight:800; text-transform:uppercase; color:#526783; }
.order-query-field input, .order-query-field select { width:100%; min-width:0; min-height:40px; }
@media(max-width:1100px) { .filters.order-query-filters:has(#order-type) { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:700px) { .filters.order-query-filters:has(#order-type) { grid-template-columns:repeat(2,minmax(0,1fr)); } .order-query-field:first-child { grid-column:1/-1; } }
@media(max-width:420px) { .filters.order-query-filters:has(#order-type) { grid-template-columns:1fr; } }

/* Cartões como atalhos no painel do distribuidor. */
.distributor-dashboard-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
.dashboard-shortcut { width:100%; min-width:0; text-align:left; font:inherit; color:inherit; cursor:pointer; }
.dashboard-shortcut:hover { border-color:#1267ee; box-shadow:0 3px 12px #1267ee20; }
.dashboard-shortcut:focus-visible { outline:3px solid #1267ee; outline-offset:3px; }
.dashboard-shortcut small::after { content:' →'; color:#1267ee; }
@media(max-width:1100px) { .distributor-dashboard-stats { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:560px) { .distributor-dashboard-stats { grid-template-columns:1fr; } }
