:root {
  --red: #e20b17;
  --red-dark: #b90712;
  --yellow: #ffd400;
  --orange: #f59e0b;
  --cream: #fff8ea;
  --ink: #211c18;
  --muted: #716b65;
  --line: #e9e3dc;
  --surface: #ffffff;
  --surface-2: #faf7f2;
  --success: #14804a;
  --danger: #c52233;
  --warning: #a85d00;
  --shadow: 0 16px 40px rgba(58, 35, 12, .10);
  --shadow-sm: 0 8px 24px rgba(58, 35, 12, .08);
  --radius: 20px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 212, 0, .12), transparent 30%),
    linear-gradient(180deg, #fffdf9 0%, #f7f3ed 100%);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }

.btn {
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--red), var(--red-dark)); box-shadow: 0 10px 20px rgba(226, 11, 23, .22); }
.btn-yellow { color: #4a2700; background: linear-gradient(135deg, #ffe14b, var(--yellow)); box-shadow: 0 10px 20px rgba(255, 212, 0, .22); }
.btn-secondary { color: var(--ink); background: #f1ece6; }
.btn-outline { color: var(--red); background: #fff; border: 1px solid rgba(226, 11, 23, .28); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-success { color: #fff; background: var(--success); }
.btn-sm { min-height: 36px; padding: 7px 11px; border-radius: 10px; font-size: .88rem; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; font-size: 1.1rem;
}

.field { display: grid; gap: 7px; }
.field label { font-size: .85rem; color: #514b45; font-weight: 800; }
.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 11px 13px;
  outline: none;
  color: var(--ink);
  transition: box-shadow .18s ease, border-color .18s ease;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(226, 11, 23, .45); box-shadow: 0 0 0 4px rgba(226, 11, 23, .08); }
.input-group { position: relative; }
.input-group .input { padding-left: 42px; }
.input-group .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.card {
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(226, 219, 210, .85);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 20px; }
.card-title { margin: 0 0 6px; font-size: 1.05rem; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 212, 0, .24), transparent 22%),
    radial-gradient(circle at 90% 80%, rgba(226, 11, 23, .16), transparent 24%),
    #fff9ee;
}
.login-card {
  width: min(100%, 440px);
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(226, 219, 210, .8);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(90, 45, 10, .16);
  padding: 30px;
}
.login-logo { display: block; width: 220px; margin: 0 auto 18px; }
.login-card h1 { margin: 0; text-align: center; font-size: 1.55rem; }
.login-card .subtitle { margin: 8px 0 24px; text-align: center; color: var(--muted); }
.login-card form { display: grid; gap: 14px; }
.login-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .82rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px clamp(16px, 3vw, 34px);
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(226,219,210,.8);
  backdrop-filter: blur(18px);
}
.topbar-logo { width: 150px; flex: 0 0 auto; }
.topbar-spacer { flex: 1; }
.user-box { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 42px; height: 42px; border-radius: 50%; background: linear-gradient(135deg, var(--red), #ff6b48); color: white; display: grid; place-items: center; font-weight: 900; }
.user-meta { line-height: 1.15; }
.user-meta strong { display: block; font-size: .92rem; }
.user-meta span { font-size: .77rem; color: var(--muted); }
.status-pill { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px; background: #edf8f2; color: var(--success); font-size: .78rem; font-weight: 800; }
.status-pill.offline { color: var(--warning); background: #fff5df; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.seller-main { width: min(1500px, 100%); margin: 0 auto; padding: 24px clamp(14px, 3vw, 34px) 110px; }
.seller-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}
.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  padding: 26px;
  border-radius: 26px;
  color: white;
  background: linear-gradient(130deg, #d80c17 0%, #f04320 62%, #ffbf00 135%);
  box-shadow: 0 18px 44px rgba(205, 18, 26, .22);
}
.hero-panel::after {
  content: '';
  position: absolute;
  width: 280px; height: 280px; border-radius: 50%; right: -110px; top: -120px;
  border: 38px solid rgba(255,255,255,.12);
}
.hero-kicker { font-size: .84rem; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; opacity: .82; }
.hero-panel h1 { margin: 8px 0 8px; max-width: 650px; font-size: clamp(1.65rem, 3vw, 2.55rem); line-height: 1.03; }
.hero-panel p { margin: 0; max-width: 620px; color: rgba(255,255,255,.85); }
.client-card { padding: 20px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.client-card-top { display: flex; gap: 12px; align-items: flex-start; }
.client-icon { width: 48px; height: 48px; border-radius: 15px; background: var(--cream); display: grid; place-items: center; font-size: 1.35rem; }
.client-card h3 { margin: 0 0 5px; }
.client-summary { min-height: 48px; color: var(--muted); font-size: .9rem; }

.catalog-toolbar { display: grid; grid-template-columns: minmax(250px, 1fr) auto; gap: 14px; align-items: center; margin: 18px 0 14px; }
.category-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; background: #fff; color: #554e47; font-weight: 800; white-space: nowrap; }
.chip.active { border-color: var(--red); color: white; background: var(--red); box-shadow: 0 8px 16px rgba(226,11,23,.18); }
.catalog-heading { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin: 18px 0 12px; }
.catalog-heading h2 { margin: 0; }
.catalog-heading span { color: var(--muted); font-size: .88rem; }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.product-card { overflow: hidden; display: flex; flex-direction: column; min-width: 0; transition: transform .18s ease, box-shadow .18s ease; }
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.product-image-wrap { position: relative; aspect-ratio: 1.42 / 1; background: linear-gradient(150deg, #fff8e8, #fff); display: grid; place-items: center; overflow: hidden; }
.product-image { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.product-code { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.92); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; font-size: .68rem; font-weight: 900; }
.product-content { padding: 15px; display: grid; gap: 10px; flex: 1; }
.product-title-line { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.product-title { margin: 0; font-size: 1rem; line-height: 1.25; }
.product-weight { flex: 0 0 auto; color: var(--red); font-weight: 900; font-size: .86rem; background: #fff0f0; padding: 5px 8px; border-radius: 999px; }
.price-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.price-box { border: 1px solid var(--line); background: #fcfaf7; border-radius: 12px; padding: 9px; }
.price-box span { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 2px; }
.price-box strong { font-size: .92rem; }
.price-box.unavailable strong { color: var(--muted); font-weight: 700; }
.product-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }

.cart-fab {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 24px));
  border: 0;
  border-radius: 18px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #251b12, #4b2b10);
  color: white;
  box-shadow: 0 20px 48px rgba(37, 27, 18, .35);
  display: flex;
  align-items: center;
  gap: 12px;
}
.cart-fab .cart-count { width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); color: #4b2b10; display: grid; place-items: center; font-weight: 900; }
.cart-fab .cart-fab-copy { text-align: left; flex: 1; }
.cart-fab .cart-fab-copy strong { display: block; }
.cart-fab .cart-fab-copy span { font-size: .78rem; color: rgba(255,255,255,.68); }
.cart-fab .cart-total { font-size: 1.08rem; font-weight: 900; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(25, 18, 12, .48); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 18px; }
.modal { width: min(720px, 100%); max-height: calc(100vh - 36px); overflow: auto; background: #fff; border-radius: 24px; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.modal-lg { width: min(980px, 100%); }
.modal-header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.modal-header h2 { margin: 0; font-size: 1.2rem; flex: 1; }
.modal-body { padding: 20px; }
.modal-footer { position: sticky; bottom: 0; z-index: 3; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); }

.client-list { display: grid; gap: 8px; margin-top: 14px; max-height: 55vh; overflow: auto; }
.client-item { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 13px 14px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.client-item:hover { border-color: rgba(226,11,23,.45); background: #fffafa; }
.client-item strong { display: block; }
.client-item span { font-size: .8rem; color: var(--muted); }

.cart-list { display: grid; gap: 10px; }
.cart-item { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; }
.cart-item img { width: 58px; height: 58px; object-fit: contain; border-radius: 10px; background: var(--cream); }
.cart-item h4 { margin: 0 0 3px; font-size: .92rem; }
.cart-item p { margin: 0; color: var(--muted); font-size: .78rem; }
.qty-control { display: inline-flex; align-items: center; gap: 7px; margin-top: 7px; }
.qty-control button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-weight: 900; }
.qty-control strong { min-width: 24px; text-align: center; }
.cart-item-total { text-align: right; }
.cart-item-total strong { display: block; }
.cart-item-total button { border: 0; background: transparent; color: var(--danger); font-size: .78rem; margin-top: 7px; }
.cart-summary { margin-top: 14px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.summary-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.summary-row:last-child { border-bottom: 0; }
.summary-row.total { background: #fff7df; font-size: 1.1rem; font-weight: 900; }
.payment-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.payment-option { min-height: 70px; border: 1px solid var(--line); border-radius: 14px; background: #fff; display: grid; place-items: center; gap: 3px; font-weight: 800; }
.payment-option span { font-size: 1.25rem; }
.payment-option.active { border-color: var(--red); background: #fff1f1; color: var(--red); box-shadow: 0 0 0 3px rgba(226,11,23,.08); }
.pix-box { margin-top: 14px; padding: 16px; border-radius: 16px; background: #f7fff9; border: 1px solid #ccebd8; }
.qr-wrap { display: grid; place-items: center; margin: 12px auto; min-height: 220px; }
.qr-wrap img, .qr-wrap canvas { border: 10px solid #fff; border-radius: 8px; }
.pix-code { width: 100%; min-height: 76px; font-size: .74rem; word-break: break-all; }
.success-icon { width: 78px; height: 78px; margin: 4px auto 16px; border-radius: 50%; background: #e7f8ef; color: var(--success); display: grid; place-items: center; font-size: 2.4rem; font-weight: 900; }

.empty-state { padding: 34px 20px; text-align: center; color: var(--muted); border: 1px dashed #d7cec4; border-radius: 18px; background: rgba(255,255,255,.68); }
.loading-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.skeleton { min-height: 320px; border-radius: 20px; background: linear-gradient(90deg, #f2eee8 25%, #faf8f4 40%, #f2eee8 55%); background-size: 240% 100%; animation: shine 1.4s infinite linear; }
@keyframes shine { to { background-position-x: -240%; } }

/* Admin */
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 16px; background: linear-gradient(180deg, #24170f, #3d1b12); color: #fff; overflow-y: auto; }
.sidebar-logo { width: 175px; display: block; margin: 0 auto 24px; filter: drop-shadow(0 8px 15px rgba(0,0,0,.2)); }
.sidebar-label { padding: 0 10px 8px; color: rgba(255,255,255,.45); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; }
.nav-list { display: grid; gap: 6px; }
.nav-btn { width: 100%; min-height: 46px; border: 0; border-radius: 12px; background: transparent; color: rgba(255,255,255,.72); text-align: left; padding: 10px 12px; display: flex; align-items: center; gap: 10px; font-weight: 800; }
.nav-btn:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-btn.active { background: linear-gradient(135deg, var(--red), #ff4b2e); color: #fff; box-shadow: 0 10px 24px rgba(226,11,23,.28); }
.sidebar-foot { margin-top: 26px; padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-foot .user-meta span { color: rgba(255,255,255,.5); }
.sidebar-foot .btn { margin-top: 12px; width: 100%; color: #fff; background: rgba(255,255,255,.08); }
.admin-main { min-width: 0; }
.admin-topbar { position: sticky; top: 0; z-index: 25; min-height: 72px; padding: 12px clamp(16px,3vw,30px); display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.admin-topbar h1 { margin: 0; font-size: 1.35rem; }
.mobile-menu-btn { display: none; }
.admin-content { padding: 24px clamp(16px,3vw,30px) 50px; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.section-head h2 { margin: 0 0 5px; }
.section-head p { margin: 0; color: var(--muted); }
.section-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.period-stat-grid, .sales-period-grid { margin-top: 14px; }
.period-card { background: linear-gradient(180deg, #ffffff 0%, #fff9e9 100%); }
.sales-period-grid { margin-bottom: 16px; }
.my-sale-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.table-actions { flex-wrap: wrap; }

.stat-card { padding: 18px; }
.stat-card .stat-label { color: var(--muted); font-size: .82rem; font-weight: 800; }
.stat-card .stat-value { margin-top: 6px; font-size: 1.55rem; font-weight: 950; letter-spacing: -.03em; }
.stat-card .stat-foot { margin-top: 8px; color: var(--muted); font-size: .75rem; }
.dashboard-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; margin-top: 16px; }
.table-card { overflow: hidden; }
.table-toolbar { padding: 14px; display: grid; grid-template-columns: minmax(220px,1fr) auto; gap: 10px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #faf7f2; color: #5d554e; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; position: sticky; top: 0; }
td { font-size: .88rem; }
.table-actions { display: flex; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; font-size: .72rem; font-weight: 900; background: #f1ece6; color: #5e554e; }
.badge-success { background: #e8f7ef; color: var(--success); }
.badge-warning { background: #fff3d9; color: #965400; }
.badge-danger { background: #ffeaec; color: var(--danger); }
.badge-info { background: #e9f3ff; color: #1768a7; }
.product-admin-cell { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.product-admin-cell img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: var(--cream); }
.product-admin-cell strong { display: block; }
.product-admin-cell span { display: block; font-size: .75rem; color: var(--muted); }
.filter-bar { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; padding: 14px; border-bottom: 1px solid var(--line); }
.config-card { max-width: 900px; }
.help-box { padding: 14px; border-radius: 14px; background: #fff8dc; border: 1px solid #f0d98a; color: #6d4c00; font-size: .86rem; }

.toast-container { position: fixed; z-index: 200; top: 18px; right: 18px; display: grid; gap: 8px; width: min(360px, calc(100% - 36px)); }
.toast { transform: translateX(120%); opacity: 0; transition: .24s ease; padding: 13px 15px; border-radius: 12px; color: #fff; box-shadow: 0 14px 32px rgba(0,0,0,.18); font-weight: 750; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast-success { background: #157a48; }
.toast-error { background: #b92332; }
.toast-warning { background: #9b5c00; }

@media (max-width: 1100px) {
  .product-grid, .loading-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 860px) {
  .seller-hero { grid-template-columns: 1fr; }
  .catalog-toolbar { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; z-index: 70; transform: translateX(-110%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu-btn { display: grid; }
  .admin-content { padding-top: 18px; }
  .user-meta.hide-mobile { display: none; }
}

@media (max-width: 620px) {
  .topbar { height: 68px; padding: 9px 12px; gap: 10px; }
  .topbar-logo { width: 118px; }
  .status-pill { display: none; }
  .seller-main { padding: 14px 10px 100px; }
  .hero-panel { padding: 20px; min-height: 150px; }
  .client-card { padding: 16px; }
  .product-grid, .loading-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .product-content { padding: 10px; gap: 8px; }
  .product-title-line { display: block; }
  .product-title { font-size: .84rem; min-height: 42px; }
  .product-weight { display: inline-flex; margin-top: 6px; font-size: .72rem; }
  .product-image-wrap { aspect-ratio: 1 / .78; }
  .product-image { padding: 7px; }
  .price-grid { grid-template-columns: 1fr; gap: 5px; }
  .price-box { padding: 7px; }
  .price-box:nth-child(2) { display: none; }
  .product-actions { grid-template-columns: 1fr; }
  .product-actions .btn { min-height: 39px; padding: 7px; font-size: .78rem; }
  .payment-options { grid-template-columns: 1fr; }
  .payment-option { min-height: 52px; display: flex; justify-content: flex-start; padding: 0 14px; }
  .cart-item { grid-template-columns: 46px 1fr; }
  .cart-item img { width: 46px; height: 46px; }
  .cart-item-total { grid-column: 2; display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .modal-footer { flex-direction: column-reverse; }
  .modal-footer .btn { width: 100%; }
  .section-head { display: grid; }
  .section-actions { justify-content: flex-start; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 13px; }
  .stat-card .stat-value { font-size: 1.15rem; }
  .filter-bar { grid-template-columns: 1fr; }
  .table-toolbar { grid-template-columns: 1fr; }
}

/* Melhorias v1.2 */
.field-hint { color: var(--muted); font-size: .74rem; line-height: 1.35; }
.money-input { font-weight: 850; letter-spacing: .01em; }
.mobile-copy { display: none; }
.admin-return-btn { white-space: nowrap; }

.seller-day-summary {
  margin: 0 0 18px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,248,234,.96));
}
.seller-day-copy { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.seller-day-label { color: var(--muted); font-size: .8rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.seller-day-copy strong { font-size: 1.12rem; }
.seller-day-copy > span:last-child { color: var(--red); font-weight: 950; font-size: 1.14rem; }

.client-pending-alert {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #efc36c;
  background: #fff5d7;
  color: #805000;
  font-size: .82rem;
}
.pending-inline { display: inline-block; margin-top: 5px; color: #8d5600; font-weight: 850; }

.my-sales-modal-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 14px;
}
.my-sales-modal-summary > div {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
}
.my-sales-modal-summary span { color: var(--muted); font-size: .76rem; font-weight: 800; }
.my-sales-modal-summary strong { font-size: 1.12rem; }
.my-sales-list { display: grid; gap: 10px; }
.my-sale-item { padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.my-sale-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.my-sale-head > div { display: grid; gap: 2px; }
.my-sale-head span { color: var(--muted); font-size: .74rem; }
.my-sale-client { margin-top: 9px; font-weight: 850; }
.my-sale-meta { margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .8rem; }
.sale-status { padding: 5px 8px; border-radius: 999px; background: #f1ece6; font-size: .7rem; font-weight: 900; }
.sale-status-pago { background: #e8f7ef; color: var(--success); }
.sale-status-pendente { background: #fff3d9; color: #965400; }
.sale-status-aguardando_confirmacao { background: #e9f3ff; color: #1768a7; }
.sale-status-cancelado { background: #ffeaec; color: var(--danger); }

.today-payment-summary { margin-top: 14px; padding: 15px 18px; display: grid; gap: 12px; }
.today-payment-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.today-payment-title span { color: var(--muted); font-size: .76rem; }
.today-payment-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.today-payment-items > div { padding: 11px 13px; border-radius: 13px; background: var(--surface-2); display: flex; justify-content: space-between; gap: 10px; }
.today-payment-items span { color: var(--muted); font-size: .8rem; font-weight: 800; }
.today-payment-items strong { white-space: nowrap; }

@media (max-width: 760px) {
  .desktop-copy { display: none; }
  .mobile-copy { display: inline; }
  .admin-return-btn { padding-inline: 10px; }
  .seller-day-summary { align-items: stretch; }
  .seller-day-copy { display: grid; gap: 3px; }
  .my-sales-modal-summary { grid-template-columns: 1fr 1fr; }
  .my-sales-modal-summary .btn { grid-column: 1 / -1; }
  .today-payment-items { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .topbar-logo { width: 102px; }
  .topbar { gap: 7px; }
  .admin-return-btn { min-height: 38px; font-size: .8rem; }
  .seller-day-summary { display: grid; }
  .seller-day-summary .btn { width: 100%; }
}

.discount-panel {
  border: 1px solid var(--line);
  background: #fffaf0;
  border-radius: 16px;
  padding: 14px;
}

/* V1.5 - Dashboard compacto e meta mensal */
.dashboard-stat-grid { grid-template-columns: repeat(6, minmax(118px, 1fr)); gap: 10px; }
.compact-stat-grid .stat-card { padding: 13px 14px; min-height: 112px; }
.compact-stat-grid .stat-card .stat-label { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-stat-grid .stat-card .stat-value { font-size: 1.22rem; margin-top: 4px; letter-spacing: -.04em; }
.compact-stat-grid .stat-card .stat-foot { margin-top: 5px; font-size: .68rem; }
.goal-card { margin-top: 12px; padding: 16px; border: 1px solid #f1d69b; background: linear-gradient(135deg, #fffaf0, #fff4cf); }
.goal-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.goal-header p { margin: 5px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.35; }
.goal-progress { height: 12px; border-radius: 999px; background: #efe4d5; overflow: hidden; margin: 14px 0; }
.goal-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #e20b17, #ffb703); transition: width .35s ease; }
.goal-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.goal-stats div { background: rgba(255,255,255,.72); border: 1px solid rgba(120,80,20,.12); border-radius: 14px; padding: 10px 12px; }
.goal-stats span { display: block; color: var(--muted); font-size: .72rem; font-weight: 800; }
.goal-stats strong { display: block; margin-top: 4px; font-size: 1.05rem; }
.sales-period-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 14px; }
@media (max-width: 1260px) {
  .dashboard-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .dashboard-stat-grid, .sales-period-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .goal-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 520px) {
  .compact-stat-grid .stat-card { padding: 11px; min-height: 98px; }
  .compact-stat-grid .stat-card .stat-value { font-size: 1.05rem; }
  .goal-header { display: block; }
  .goal-header .badge { margin-top: 8px; }
  .goal-stats { grid-template-columns: 1fr; }
}

/* V1.6 - Alerta visual forte da meta mensal */
.goal-card {
  position: relative;
  overflow: hidden;
  border-width: 2px;
  box-shadow: 0 20px 50px rgba(226, 11, 23, .10);
}
.goal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  background: radial-gradient(circle at top right, currentColor, transparent 36%);
}
.goal-card.goal-danger { color: #e20b17; border-color: rgba(226,11,23,.35); background: linear-gradient(135deg, #fff2f2, #fffaf0); }
.goal-card.goal-warning { color: #d97706; border-color: rgba(217,119,6,.35); background: linear-gradient(135deg, #fff7ed, #fffaf0); }
.goal-card.goal-almost { color: #15803d; border-color: rgba(21,128,61,.32); background: linear-gradient(135deg, #f0fdf4, #fffaf0); }
.goal-card.goal-success { color: #087f3f; border-color: rgba(8,127,63,.35); background: linear-gradient(135deg, #ecfdf5, #f7fee7); }
.goal-card.goal-success::after {
  content: "META BATIDA";
  position: absolute;
  right: -48px;
  top: 22px;
  transform: rotate(35deg);
  background: #087f3f;
  color: #fff;
  font-weight: 900;
  font-size: .72rem;
  letter-spacing: .08em;
  padding: 8px 58px;
  box-shadow: 0 10px 25px rgba(0,0,0,.12);
}
.goal-main-alert {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(150px, .6fr) minmax(180px, 1fr);
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(120,80,20,.12);
  padding: 14px 16px;
}
.goal-main-alert span {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.goal-missing-amount {
  display: block;
  text-align: right;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  line-height: 1;
  color: currentColor;
  text-shadow: 0 6px 18px rgba(226,11,23,.12);
}
.goal-missing-amount.goal-blink {
  animation: metaBlink 1s ease-in-out infinite;
}
.goal-card.goal-success .goal-missing-amount.goal-blink {
  animation: metaPulseGreen 1.25s ease-in-out infinite;
}
.goal-card.goal-danger .goal-progress span { background: linear-gradient(90deg, #e20b17, #ff595e); }
.goal-card.goal-warning .goal-progress span { background: linear-gradient(90deg, #f97316, #facc15); }
.goal-card.goal-almost .goal-progress span, .goal-card.goal-success .goal-progress span { background: linear-gradient(90deg, #22c55e, #84cc16); }
@keyframes metaBlink {
  0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 0 rgba(226,11,23,0)); }
  50% { opacity: .48; transform: scale(1.035); filter: drop-shadow(0 0 15px rgba(226,11,23,.55)); }
}
@keyframes metaPulseGreen {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(34,197,94,0)); }
  50% { transform: scale(1.035); filter: drop-shadow(0 0 14px rgba(34,197,94,.5)); }
}
@media (prefers-reduced-motion: reduce) {
  .goal-missing-amount.goal-blink { animation: none; }
}
@media (max-width: 700px) {
  .goal-main-alert { grid-template-columns: 1fr; }
  .goal-missing-amount { text-align: left; }
}

/* V1.7 - Clientes em massa, histórico e cliente rápido */
.client-toolbar { grid-template-columns: minmax(260px, 1fr) auto; }
.table-footer {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: #fffdf9;
}
.import-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.import-summary > div {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.import-summary span { display: block; color: var(--muted); font-size: .72rem; font-weight: 850; }
.import-summary strong { display: block; margin-top: 4px; font-size: 1.25rem; }
.import-progress {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 16px;
  background: #efe4d5;
}
.import-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--yellow));
  transition: width .25s ease;
}
@media (max-width: 720px) {
  .import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-footer { align-items: stretch; flex-direction: column; }
  .table-footer .btn { width: 100%; }
}

/* V1.9 — permissões e segurança */
.hidden, .access-hidden { display: none !important; }
.permission-panel { border: 1px solid var(--line); border-radius: 18px; background: #fffaf0; padding: 16px; }
.permission-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.permission-head p { margin: 4px 0 0; }
.permission-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.permission-group { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px; margin: 0; min-width: 0; }
.permission-group legend { font-weight: 900; color: var(--brown); padding: 0 4px; }
.permission-list { display: grid; gap: 8px; margin-top: 8px; }
.permission-item { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text); }
.permission-item input { width: 17px; height: 17px; accent-color: var(--red); }
@media (max-width: 950px) { .permission-groups { grid-template-columns: 1fr; } .permission-head { display: grid; } }

/* V2.1 — Clientes refeitos conforme planilha Santa Justina */
.m-16 { margin: 16px; }
.clients-card { overflow: hidden; }
.client-layout-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff8ec;
  font-size: .78rem;
  color: var(--muted);
}
.client-layout-note strong { color: var(--brown); margin-right: 4px; }
.client-layout-note span {
  display: inline-flex;
  align-items: center;
  border: 1px solid #efd9c3;
  background: #fff;
  color: var(--brown);
  border-radius: 999px;
  padding: 4px 8px;
  font-weight: 800;
  white-space: nowrap;
}
.client-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--line);
  scrollbar-color: var(--red) #f6eadc;
}
.clients-official-table {
  min-width: 2120px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}
.clients-official-table th,
.clients-official-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  background-clip: padding-box;
}
.clients-official-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: #fbf4eb;
  box-shadow: inset 0 -1px 0 var(--line);
}
.clients-official-table tbody td { background: #fff; }
.clients-official-table tbody tr:nth-child(even) td { background: #fffaf4; }
.clients-official-table tbody tr:hover td { background: #fff3e5; }
.clients-official-table .client-col-codigo_cliente { width: 128px; }
.clients-official-table .client-col-cliente { width: 260px; }
.clients-official-table .client-col-fantasia { width: 170px; }
.clients-official-table .client-col-cnpj { width: 165px; }
.clients-official-table .client-col-comprador { width: 160px; }
.clients-official-table .client-col-endereco { width: 230px; }
.clients-official-table .client-col-bairro { width: 150px; }
.clients-official-table .client-col-cidade { width: 150px; }
.clients-official-table .client-col-uf { width: 70px; text-align: center; }
.clients-official-table .client-col-codigo_vendedor { width: 135px; text-align: center; }
.clients-official-table .client-col-vendedor { width: 150px; }
.clients-official-table .client-col-status { width: 115px; text-align: center; }
.clients-official-table .client-col-inscricao_estadual { width: 160px; }
.clients-official-table .client-col-telefone { width: 145px; }
.clients-official-table .client-actions-col { width: 180px; }
.clients-official-table .sticky-client-col {
  position: sticky;
  z-index: 3;
  background: inherit;
  box-shadow: 1px 0 0 var(--line);
}
.clients-official-table th.sticky-client-col { z-index: 5; }
.clients-official-table .client-col-codigo_cliente.sticky-client-col { left: 0; }
.clients-official-table .client-col-cliente.sticky-client-col { left: 128px; }
.clients-official-table .sticky-client-actions {
  position: sticky;
  right: 0;
  z-index: 3;
  background: inherit;
  box-shadow: -1px 0 0 var(--line);
}
th.sticky-client-actions { z-index: 5 !important; background: #fbf4eb !important; }
.client-detail-table th {
  width: 220px;
  color: var(--brown);
  background: #fbf4eb;
  font-weight: 900;
}
.client-detail-table td { background: #fff; }
@media (max-width: 900px) {
  .client-layout-note { display: none; }
  .clients-official-table { min-width: 1900px; }
}


/* V2.2 - Clientes blindado e visual limpo */
.clients-card { overflow: hidden; }
.client-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 360px);
  min-height: 260px;
}
.clients-official-table {
  min-width: 1320px !important;
  width: max-content;
  table-layout: fixed;
  border-collapse: collapse !important;
  font-size: 12px;
}
.clients-official-table th,
.clients-official-table td {
  padding: 10px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clients-official-table .sticky-client-col,
.clients-official-table .sticky-client-actions {
  position: static !important;
  left: auto !important;
  right: auto !important;
  box-shadow: none !important;
}
.clients-official-table .client-col-codigo_cliente { width: 110px; }
.clients-official-table .client-col-cliente { width: 250px; }
.clients-official-table .client-col-fantasia { width: 200px; }
.clients-official-table .client-col-cnpj { width: 150px; }
.clients-official-table .client-col-telefone { width: 140px; }
.clients-official-table .client-col-cidade { width: 145px; }
.clients-official-table .client-col-uf { width: 55px; text-align: center; }
.clients-official-table .client-col-codigo_vendedor { width: 120px; text-align: center; }
.clients-official-table .client-col-vendedor { width: 130px; }
.clients-official-table .client-col-status { width: 90px; text-align: center; }
.clients-official-table .client-actions-col { width: 145px; }
.empty-client-cell { padding: 36px 18px !important; line-height: 1.55; }
@media (max-width: 900px) {
  .clients-official-table { min-width: 1180px !important; }
  .client-table-wrap { max-height: calc(100vh - 300px); }
}


/* V2.3 - layout compacto geral */
.section-head p, .help-box, .field-hint, .table-footer .small { font-size: .8rem; }
.section-head h2 { font-size: 1.75rem; }
.section-actions .btn { min-height: 40px; padding: 9px 14px; font-size: .86rem; }
.table-toolbar { padding: 12px 14px; }
.table-wrap { scrollbar-width: thin; }
.compact-table-wrap { max-width: 100%; overflow: auto; }
.compact-admin-table { min-width: 980px; width: 100%; border-collapse: collapse; }
.compact-admin-table th, .compact-admin-table td {
  padding: 9px 10px;
  font-size: .8rem;
  line-height: 1.28;
  white-space: nowrap;
  vertical-align: middle;
}
.compact-admin-table th { font-size: .72rem; }
.compact-admin-table td strong { font-size: .82rem; }
.compact-admin-table td .muted.small { font-size: .74rem; }
.compact-admin-table .badge { font-size: .68rem; padding: 4px 7px; }
.compact-admin-table .table-actions { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
.compact-admin-table .btn.btn-sm { min-height: 31px; padding: 6px 9px; font-size: .75rem; border-radius: 10px; white-space: nowrap; }
.users-admin-table { min-width: 1120px; }
.logs-admin-table { min-width: 900px; }
.compact-note {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}
.compact-note span {
  display: block;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  color: var(--muted);
  font-weight: 700;
  white-space: normal;
}
.compact-note .note-highlight { color: var(--brown); font-weight: 800; }
.clients-official-table {
  min-width: 1180px !important;
  font-size: 12px;
}
.clients-official-table th,
.clients-official-table td {
  padding: 8px 10px;
  line-height: 1.22;
}
.clients-official-table th { font-size: .7rem; }
.clients-official-table td { font-size: .8rem; }
.clients-official-table td strong { font-size: .82rem; }
.clients-official-table .badge { font-size: .66rem; padding: 4px 7px; }
.clients-official-table .table-actions { display: flex; flex-wrap: nowrap; gap: 6px; }
.clients-official-table .table-actions .btn { min-height: 30px; padding: 5px 9px; font-size: .74rem; white-space: nowrap; }
.clients-official-table .client-col-codigo_cliente { width: 92px; }
.clients-official-table .client-col-cliente { width: 220px; }
.clients-official-table .client-col-fantasia { width: 200px; }
.clients-official-table .client-col-cnpj { width: 150px; }
.clients-official-table .client-col-telefone { width: 130px; }
.clients-official-table .client-col-cidade { width: 140px; }
.clients-official-table .client-col-uf { width: 44px; }
.clients-official-table .client-col-codigo_vendedor { width: 92px; }
.clients-official-table .client-col-vendedor { width: 110px; }
.clients-official-table .client-col-status { width: 86px; }
.clients-official-table .client-actions-col { width: 128px; }
.client-table-wrap { max-height: calc(100vh - 320px); min-height: 250px; }
@media (max-width: 900px) {
  .section-head h2 { font-size: 1.45rem; }
  .compact-admin-table { min-width: 860px; }
  .clients-official-table { min-width: 1080px !important; }
}

/* V2.4 — Admin Clean: clientes e usuários refeitos */
.clean-card {
  border: 1px solid rgba(88, 55, 26, .10);
  box-shadow: 0 18px 48px rgba(52, 29, 13, .08);
}
.clean-info-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #fff8ec, #fffdf8);
}
.clean-info-strip strong {
  display: block;
  color: var(--brown);
  font-size: .9rem;
  line-height: 1.2;
}
.clean-info-strip span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}
.clean-toolbar {
  grid-template-columns: minmax(260px, 1fr) auto;
  padding: 12px 16px;
  background: #fff;
}
.clean-count-badge {
  min-height: 40px;
  padding-inline: 13px;
  background: #f6eee4;
  color: var(--brown);
}
.clean-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  max-height: calc(100vh - 330px);
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--red) #f6eadc;
}
.clients-clean-table,
.users-clean-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.clients-clean-table th,
.clients-clean-table td,
.users-clean-table th,
.users-clean-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  line-height: 1.24;
}
.clients-clean-table th,
.users-clean-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fbf4eb;
  color: #5d554e;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .045em;
  white-space: nowrap;
}
.clients-clean-table td,
.users-clean-table td {
  background: #fff;
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clients-clean-table tbody tr:nth-child(even) td,
.users-clean-table tbody tr:nth-child(even) td { background: #fffaf4; }
.clients-clean-table tbody tr:hover td,
.users-clean-table tbody tr:hover td { background: #fff4e1; }
.clients-clean-table th:nth-child(1), .clients-clean-table td:nth-child(1) { width: 82px; }
.clients-clean-table th:nth-child(2), .clients-clean-table td:nth-child(2) { width: 250px; }
.clients-clean-table th:nth-child(3), .clients-clean-table td:nth-child(3) { width: 155px; }
.clients-clean-table th:nth-child(4), .clients-clean-table td:nth-child(4) { width: 145px; }
.clients-clean-table th:nth-child(5), .clients-clean-table td:nth-child(5) { width: 135px; }
.clients-clean-table th:nth-child(6), .clients-clean-table td:nth-child(6) { width: 135px; }
.clients-clean-table th:nth-child(7), .clients-clean-table td:nth-child(7) { width: 88px; text-align: center; }
.clients-clean-table th:nth-child(8), .clients-clean-table td:nth-child(8) { width: 140px; }
.users-clean-table { min-width: 980px; }
.users-clean-table th:nth-child(1), .users-clean-table td:nth-child(1) { width: 285px; }
.users-clean-table th:nth-child(2), .users-clean-table td:nth-child(2) { width: 125px; }
.users-clean-table th:nth-child(3), .users-clean-table td:nth-child(3) { width: 155px; }
.users-clean-table th:nth-child(4), .users-clean-table td:nth-child(4) { width: 180px; }
.users-clean-table th:nth-child(5), .users-clean-table td:nth-child(5) { width: 90px; text-align: center; }
.users-clean-table th:nth-child(6), .users-clean-table td:nth-child(6) { width: 185px; }
.code-cell strong,
.clients-clean-table td strong,
.users-clean-table td strong {
  font-size: .84rem;
  font-weight: 900;
  color: #17120f;
}
.main-client-cell strong,
.user-main-cell strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main-client-cell span,
.user-main-cell span,
.subline {
  display: block;
  margin-top: 3px;
  max-width: 100%;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clean-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
}
.clean-actions .btn {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 10px;
  font-size: .72rem;
  white-space: nowrap;
}
.clients-clean-table .badge,
.users-clean-table .badge {
  font-size: .66rem;
  padding: 4px 7px;
}
.empty-client-cell {
  padding: 32px 18px !important;
  white-space: normal !important;
  line-height: 1.5 !important;
}
@media (max-width: 900px) {
  .clean-info-strip { display: grid; }
  .clean-toolbar { grid-template-columns: 1fr; }
  .clients-clean-table { min-width: 980px; }
  .users-clean-table { min-width: 900px; }
}


/* V2.4.1 — autocomplete real no campo Cliente da venda */
.client-autocomplete-shell {
  position: relative;
  z-index: 20;
}
.client-autocomplete-shell .input {
  min-height: 46px;
  font-weight: 800;
}
.client-autocomplete-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  max-height: 330px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 22px 55px rgba(36, 18, 9, .18);
  padding: 8px;
  display: grid;
  gap: 7px;
}
.client-autocomplete-item {
  width: 100%;
  border: 1px solid transparent;
  background: #fffaf4;
  border-radius: 13px;
  padding: 10px 12px;
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.client-autocomplete-item:hover,
.client-autocomplete-item:focus {
  outline: none;
  border-color: rgba(226, 11, 23, .36);
  background: #fff3e7;
}
.client-autocomplete-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.client-autocomplete-main strong {
  display: block;
  color: var(--text);
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-autocomplete-main span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-autocomplete-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff;
  color: var(--brown);
  font-size: .7rem;
  font-weight: 950;
  border: 1px solid #efdcc8;
}
.client-autocomplete-empty {
  padding: 13px 12px;
  border-radius: 12px;
  background: #fff8ec;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 750;
}
@media (max-width: 620px) {
  .client-autocomplete-list { max-height: 280px; }
  .client-autocomplete-item { grid-template-columns: 1fr; }
  .client-autocomplete-code { justify-self: start; }
}


/* V2.4.2 — correção de quebras/concatenação e busca de clientes */
.clients-clean-table td,
.users-clean-table td {
  line-height: 1.35;
}
.main-client-cell,
.user-main-cell {
  white-space: normal !important;
  overflow: hidden;
}
.main-client-cell strong,
.user-main-cell strong {
  display: inline !important;
  line-height: 1.25;
}
.main-client-cell span,
.user-main-cell span {
  display: inline !important;
  margin-top: 0 !important;
  margin-left: 0;
  white-space: normal;
  color: var(--muted);
}
.main-client-cell br,
.user-main-cell br {
  display: block;
  content: "";
  margin-top: 3px;
}
.seller-cell strong {
  white-space: nowrap;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clients-clean-table th:nth-child(2), .clients-clean-table td:nth-child(2) { width: 285px; }
.clients-clean-table th:nth-child(4), .clients-clean-table td:nth-child(4) { width: 160px; }
.clients-clean-table th:nth-child(5), .clients-clean-table td:nth-child(5) { width: 150px; }
.users-clean-table th:nth-child(1), .users-clean-table td:nth-child(1) { width: 330px; }
.users-clean-table th:nth-child(3), .users-clean-table td:nth-child(3) { width: 170px; }
.client-autocomplete-empty strong { display: block; color: var(--brown); margin-bottom: 4px; }


/* V2.4.3 — Cliente autocomplete/diagnóstico e linhas limpas */
.client-diagnostic-row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.client-load-status {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}
.client-load-status.status-warning { color: #9b5c00; }
.client-load-status.status-ok { color: var(--success); }
.mini-link-btn {
  border: 0;
  background: transparent;
  color: var(--red);
  font-weight: 900;
  font-size: .78rem;
  cursor: pointer;
  padding: 4px 0;
}
.mini-link-btn:hover { text-decoration: underline; }
.client-autocomplete-list { max-height: 320px; overflow: auto; }
.client-autocomplete-empty {
  padding: 14px;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.35;
}
.client-autocomplete-item { text-align: left; }
.client-autocomplete-main strong,
.client-autocomplete-main span { overflow-wrap: anywhere; }
.clients-clean-table td,
.users-clean-table td { line-height: 1.28; }
.main-client-cell strong,
.user-main-cell strong {
  display: block !important;
  line-height: 1.22;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main-client-cell span,
.user-main-cell span {
  display: block !important;
  margin-top: 4px !important;
  margin-left: 0 !important;
  white-space: normal;
  color: var(--muted);
  font-size: .72rem;
}
.main-client-cell br,
.user-main-cell br { display: none !important; }
.seller-cell strong { white-space: nowrap; }
