/* MABA — estilos base del shell (tema claro naranja, marca MABA #F75714). */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f7f8fa; --card: #ffffff; --border: #eceef2; --border-2: #e3e6ec;
  /* Marca MABA (naranja). --brand-dark = gradiente/hover; --brand-text = acento oscuro legible. */
  --brand: #F75714; --brand-soft: #FEEEE7; --brand-soft-2: #FCD9C9; --brand-dark: #E04A0C; --brand-text: #C2440F;
  --green: #16a34a; --green-soft: #e9f7ee; --red: #dc2626; --red-soft: #fdeceb;
  --amber: #d97706; --amber-soft: #fdf3e6;
  --ml: #eab308; --ml-soft: #fdf6e3; --ml-text: #a16207;
  --text: #1a1d23; --text-2: #6b7280; --text-3: #9ca3af;
  --radius: 16px; --shadow: 0 1px 2px rgba(16,24,40,0.04), 0 4px 16px -8px rgba(16,24,40,0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; display: flex; }

/* SIDEBAR */
.sidebar { width: 252px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--border); height: 100vh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 26px 18px 20px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 28px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; box-shadow: 0 6px 16px -5px rgba(247,87,20,0.45); }
.brand-mark img, .brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.brand-sub { font-size: 11px; color: var(--text-3); font-weight: 500; margin-top: 1px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-3); font-weight: 600; padding: 6px 12px 8px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: 11px; color: var(--text-2); font-size: 14.5px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s; }
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: #f4f5f7; color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.sidebar-footer { margin-top: auto; }
.user-card { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(140deg, #FB7B4D, #E04A0C); display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0; }
.user-name { font-size: 13.5px; font-weight: 600; }
.user-role { font-size: 11.5px; color: var(--text-3); margin-top: 1px; text-transform: capitalize; }
.logout-btn { margin-top: 10px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; height: 38px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--card); color: var(--text-2); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.logout-btn:hover { color: var(--red); border-color: #f0c9c7; background: var(--red-soft); }

/* MAIN */
.main { flex: 1; min-width: 0; padding: 28px 36px 60px; max-width: 1460px; }
.topbar { display: flex; align-items: center; gap: 20px; margin-bottom: 26px; }
.topbar h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.7px; }
.topbar .sub { font-size: 14px; color: var(--text-2); margin-top: 4px; font-weight: 500; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.placeholder { padding: 56px 40px; text-align: center; color: var(--text-3); }
.placeholder .ico { width: 56px; height: 56px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 16px; }
.placeholder .ico svg { width: 26px; height: 26px; }
.placeholder h2 { color: var(--text); font-size: 18px; margin-bottom: 6px; }

/* ACCESO DENEGADO */
.denied-wrap { flex: 1; display: grid; place-items: center; padding: 24px; }
.denied { text-align: center; max-width: 380px; }
.denied .ico { width: 64px; height: 64px; border-radius: 16px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; margin: 0 auto 18px; }
.denied .ico svg { width: 30px; height: 30px; }
.denied h1 { font-size: 22px; margin-bottom: 8px; }
.denied p { color: var(--text-2); font-size: 14px; margin-bottom: 20px; }
.btn-primary { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 11px; font-family: inherit; font-size: 14px; font-weight: 600; border: none; cursor: pointer; background: var(--brand); color: #fff; text-decoration: none; box-shadow: 0 6px 16px -7px rgba(247,87,20,0.45); }
.btn-primary:hover { background: var(--brand-dark); }

/* TOPBAR ACTIONS + BOTONES */
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 11px; font-family: inherit; font-size: 14px; font-weight: 600; border: none; cursor: pointer; transition: background .15s, border-color .15s; text-decoration: none; }
.btn svg { width: 17px; height: 17px; }
.btn-secondary { background: var(--card); color: var(--text-2); border: 1px solid var(--border-2); }
.btn-secondary:hover { color: var(--text); border-color: #cfd4dc; }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13px; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #fbdbd9; }

/* KPIs */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
.kpi { padding: 22px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.kpi-ico svg { width: 18px; height: 18px; }
.kpi-ico.violet { background: var(--brand-soft-2); color: var(--brand); }
.kpi-ico.green { background: var(--green-soft); color: var(--green); }
.kpi-ico.amber { background: var(--amber-soft, #fdf3e6); color: var(--amber); }
.kpi-ico.red { background: var(--red-soft); color: var(--red); }
.kpi-value { font-size: 27px; font-weight: 700; letter-spacing: -0.9px; margin-top: 18px; }
.kpi-foot { margin-top: 10px; font-size: 13px; color: var(--text-3); font-weight: 500; }
.kpi-foot.alert { color: var(--red); font-weight: 600; }

/* TABLAS */
.table-card { overflow: hidden; }
.tbl-toolbar { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.tbl-title { font-size: 16px; font-weight: 600; }
.tbl-title span { color: var(--text-3); font-weight: 500; margin-left: 7px; font-size: 14px; }
.search { display: flex; align-items: center; gap: 9px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 10px; padding: 0 12px; height: 38px; width: 230px; color: var(--text-3); margin-left: auto; }
.search svg { width: 16px; height: 16px; }
.search input { background: none; border: none; outline: none; color: var(--text); font-family: inherit; font-size: 13.5px; width: 100%; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-3); font-weight: 600; padding: 13px 22px; border-bottom: 1px solid var(--border); background: #fbfbfc; }
thead th.r, tbody td.r { text-align: right; } thead th.c, tbody td.c { text-align: center; }
tbody td { padding: 14px 22px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafb; }
tbody tr.low { background: var(--red-soft); }
tbody tr.low:hover { background: #fce4e3; }
tbody tr.low td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.empty-row td { text-align: center; color: var(--text-3); padding: 34px; font-style: italic; }
.prod-name { font-weight: 600; }
.prod-sku { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.money { font-variant-numeric: tabular-nums; }
.money.cost { color: var(--text-2); }
.money.price { font-weight: 600; }
.margin { font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
.stock-cell { font-weight: 600; font-variant-numeric: tabular-nums; }
.stock-cell .u { font-weight: 400; color: var(--text-3); font-size: 12.5px; margin-left: 3px; }
.stock-cell.low { color: var(--red); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 8px; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.badge.ok { color: var(--green); background: var(--green-soft); } .badge.ok::before { background: var(--green); }
.badge.low { color: var(--red); background: var(--red-soft); } .badge.low::before { background: var(--red); }
.row-action { width: 30px; height: 30px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--text-3); cursor: pointer; }
.row-action:hover { background: var(--bg); color: var(--text); }
.row-action.del:hover { color: var(--red); }
.row-action svg { width: 16px; height: 16px; }

/* MODAL + CAMPOS */
.overlay { position: fixed; inset: 0; background: rgba(17,20,28,.45); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.overlay.open { display: flex; }
.modal { background: var(--card); border-radius: 18px; width: 100%; max-width: 460px; box-shadow: 0 24px 60px -15px rgba(16,24,40,.4); animation: pop .18s ease; max-height: 92vh; display: flex; flex-direction: column; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 13px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.mh-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.mh-ico svg { width: 20px; height: 20px; }
.modal-title { font-size: 16px; font-weight: 700; } .modal-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.modal-close { margin-left: auto; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--text-3); cursor: pointer; } .modal-close:hover { background: var(--bg); color: var(--text); }
.modal-close svg { width: 18px; height: 18px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--text-2); }
.field label .opt { color: var(--text-3); font-weight: 400; margin-left: 6px; }
.input { width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--border-2); border-radius: 10px; font-family: inherit; font-size: 14px; color: var(--text); background: var(--card); outline: none; }
.input:focus { border-color: var(--brand); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

/* TOAST */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: #fff; padding: 12px 20px; border-radius: 11px; font-size: 13.5px; font-weight: 600; box-shadow: 0 12px 30px -8px rgba(0,0,0,.4); opacity: 0; transition: .25s; z-index: 200; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* CHIPS de canal */
.chip { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; padding: 4px 11px; border-radius: 8px; }
.chip.web { color: var(--brand); background: var(--brand-soft); }
.chip.ml { color: var(--ml-text, #a16207); background: var(--ml-soft, #fdf6e3); }
.chip.general { color: var(--text-2); background: var(--bg); border: 1px solid var(--border-2); }
.kpi-ico.ml { background: var(--ml-soft, #fdf6e3); color: var(--ml-text, #a16207); }
.gain { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
.neg-amt { color: var(--red); font-weight: 600; font-variant-numeric: tabular-nums; }
.date-cell { color: var(--text-2); font-variant-numeric: tabular-nums; }
.comis-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding: 16px 20px; }
.comis-line .cl-main { display: flex; align-items: center; gap: 14px; }
.comis-line .cl-label { font-weight: 600; }
.comis-line .cl-sub { font-size: 12.5px; color: var(--text-2); margin-top: 2px; max-width: 540px; }
.comis-line .cl-right { text-align: right; white-space: nowrap; }
.comis-line .cl-total { font-size: 22px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.comis-line .cl-break { display: flex; gap: 16px; justify-content: flex-end; font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.comis-line .cl-break b { color: var(--text-1); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .comis-line { flex-direction: column; align-items: flex-start; } .comis-line .cl-right { text-align: left; } .comis-line .cl-break { justify-content: flex-start; flex-wrap: wrap; } }
.orden-num { font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--text-1); background: var(--surface-2, #f4f4f5); border: 1px solid var(--border, #e4e4e7); border-radius: 7px; padding: 2px 8px; cursor: pointer; white-space: nowrap; user-select: all; }
.orden-num:hover { border-color: var(--brand, #0F9C76); color: var(--brand, #0F9C76); }
.orden-num.muted { color: var(--text-3); background: transparent; border-color: transparent; cursor: default; user-select: none; }
.total { font-weight: 600; font-variant-numeric: tabular-nums; }

/* CONTROL SEGMENTADO (canal) */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; border: 1px solid var(--border-2); border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; background: var(--card); }
.seg .dot { width: 9px; height: 9px; border-radius: 50%; }
.seg.web .dot { background: var(--brand); } .seg.ml .dot { background: var(--ml, #eab308); }
.seg.active { border-width: 2px; }
.seg.web.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.seg.ml.active { border-color: var(--ml, #eab308); color: var(--ml-text, #a16207); background: var(--ml-soft, #fdf6e3); }
.select { width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--border-2); border-radius: 10px; font-family: inherit; font-size: 14px; color: var(--text); background: var(--card); outline: none; }
.select:focus { border-color: var(--brand); }
.summary { display: flex; align-items: center; justify-content: space-between; background: var(--bg); border: 1px solid var(--border); border-radius: 11px; padding: 14px 16px; }
.summary .l { font-size: 12.5px; color: var(--text-3); } .summary .g { font-size: 13px; color: var(--green); font-weight: 600; margin-top: 2px; } .summary .v { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }

/* DROPZONE + PREVIEW import */
.modal.lg { max-width: 680px; }
.mh-ico.ml { background: var(--ml-soft, #fdf6e3); color: var(--ml-text, #a16207); }
.dropzone { border: 2px dashed #d4d8e0; border-radius: 14px; background: var(--bg); padding: 28px 24px; text-align: center; cursor: pointer; transition: border-color .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dz-ico { width: 54px; height: 54px; border-radius: 14px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 14px; }
.dz-ico svg { width: 26px; height: 26px; }
.dz-title { font-size: 15px; font-weight: 600; } .dz-title b { color: var(--brand); }
.dz-sub { font-size: 13px; color: var(--text-3); margin-top: 5px; }
.detected { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--green); background: var(--green-soft); padding: 5px 11px; border-radius: 8px; }
.detected svg { width: 14px; height: 14px; }
.preview-head { display: flex; align-items: center; gap: 10px; margin: 20px 0 12px; }
.preview-head .pt { font-size: 14px; font-weight: 600; }
.preview-table-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; max-height: 240px; overflow-y: auto; }
.preview-table-wrap th { padding: 10px 14px; position: sticky; top: 0; } .preview-table-wrap td { padding: 10px 14px; font-size: 13px; }
.comis-box { display: flex; align-items: flex-start; gap: 11px; background: var(--ml-soft, #fdf6e3); border: 1px solid #f3e3b8; border-radius: 12px; padding: 14px 16px; margin-top: 16px; }
.comis-box input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--brand); }
.comis-box .t { font-size: 13.5px; font-weight: 600; color: var(--ml-text, #a16207); }
.comis-box .s { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* TABS */
.tabs { display: inline-flex; gap: 4px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; border: none; background: none; font-family: inherit; }
.tab svg { width: 16px; height: 16px; }
.tab.active { background: var(--brand-soft); color: #C2440F; }

/* GRID + SECCIONES */
.grid2 { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; margin-bottom: 20px; align-items: start; }
.section-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.sh-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft-2); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.sh-ico svg { width: 18px; height: 18px; }
.sh-title { font-size: 15.5px; font-weight: 700; }
.sh-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.sh-action { margin-left: auto; }
.form-body { padding: 18px 22px; }
.zone { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.zone-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.zone-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.cust-name { font-weight: 600; } .cust-id { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.price-hint { display: flex; align-items: center; justify-content: space-between; background: var(--brand-soft); border: 1px solid var(--brand-soft-2); border-radius: 11px; padding: 12px 15px; margin: 4px 0 16px; }
.price-hint .l { font-size: 13px; color: #C2440F; font-weight: 500; }
.price-hint .v { font-size: 18px; font-weight: 800; color: #A8380C; }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; }

/* RESUMEN SEMANAL */
.week-grid { padding: 12px 22px 18px; }
.week-row { display: grid; grid-template-columns: 130px 1fr 110px; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--border-2); }
.week-row:last-child { border-bottom: none; }
.week-zone { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 13.5px; }
.week-bar-wrap { display: flex; align-items: center; gap: 12px; }
.week-bar-track { flex: 1; height: 10px; background: #eef0f4; border-radius: 99px; overflow: hidden; }
.week-bar { height: 100%; border-radius: 99px; }
.week-count { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.week-amount { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.week-total { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; background: var(--bg); border-top: 1px solid var(--border); }
.week-total .l { font-weight: 600; } .week-total .v { font-size: 20px; font-weight: 800; letter-spacing: -.5px; }
.compare-box { padding: 16px 22px; display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; border-top: 1px solid var(--border); }

@media (max-width: 1000px) { .sidebar { display: none; } .main { padding: 20px; } .kpi-row { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr; } }
/* KPI acento + delta */
.kpi.accent { background: var(--brand-soft); border-color: var(--brand-soft-2); }
.kpi.accent .kpi-label { color: #C2440F; } .kpi.accent .kpi-value { color: #A8380C; } .kpi.accent .kpi-ico.violet { background: #fff; }
.kpi-foot .falta { color: #C2440F; font-weight: 600; }
.kpi-foot .margen { color: var(--green); font-weight: 600; background: var(--green-soft); padding: 2px 8px; border-radius: 7px; }
.pace-ok { color: var(--green); font-weight: 600; } .pace-bad { color: var(--red); font-weight: 600; }

/* BARRA DE PROGRESO */
.progress-card { margin-bottom: 20px; padding: 22px 24px; }
.progress-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.progress-head .t { font-size: 15px; font-weight: 600; } .progress-head .t span { color: var(--text-2); font-weight: 500; margin-left: 8px; font-size: 13.5px; }
.progress-head .pct { font-size: 22px; font-weight: 700; color: var(--brand); }
.track { height: 12px; background: #eef0f4; border-radius: 99px; overflow: hidden; }
.fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #FB7B4D, #E04A0C); transition: width .4s; }
.progress-foot { display: flex; justify-content: space-between; margin-top: 11px; font-size: 12.5px; color: var(--text-3); }
.progress-foot b { color: var(--text-2); font-weight: 600; }

/* BANNER GANADOR */
.winner { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 20px; border-radius: var(--radius); background: var(--brand-soft); border: 1px solid var(--brand-soft-2); }
.winner svg { width: 22px; height: 22px; color: var(--brand); flex-shrink: 0; }
.winner b { color: #A8380C; }

/* TARJETAS DE CANAL */
.channels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.channel { padding: 0; overflow: hidden; }
.ch-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 18px; border-bottom: 1px solid var(--border); }
.ch-badge { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; }
.ch-badge svg { width: 20px; height: 20px; }
.ch-badge.web { background: var(--brand-soft); color: var(--brand); } .ch-badge.ml { background: var(--ml-soft); color: var(--ml-text); }
.ch-title { font-size: 15.5px; font-weight: 700; } .ch-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.ch-tag { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 8px; }
.ch-tag.web { color: var(--brand); background: var(--brand-soft); } .ch-tag.ml { color: var(--ml-text); background: var(--ml-soft); }
.ch-body { padding: 8px 22px 6px; }
.pl-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px dashed var(--border-2); }
.pl-row:last-child { border-bottom: none; }
.pl-label { font-size: 14px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 9px; }
.pl-op { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.pl-op.plus { background: var(--brand-soft); color: var(--brand); } .pl-op.minus { background: var(--red-soft); color: var(--red); }
.pl-amount { font-size: 14.5px; font-weight: 600; } .pl-amount.neg { color: var(--red); }
.ch-iva { font-size: 12px; color: var(--ml-text); background: var(--ml-soft); padding: 8px 12px; margin: 0 22px 8px; border-radius: 9px; }
.ch-total { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; background: var(--green-soft); }
.ch-total .lbl { font-size: 14px; font-weight: 600; color: #137a39; display: flex; align-items: center; gap: 9px; }
.ch-total .lbl .pl-op { background: rgba(22,163,74,.15); color: var(--green); }
.ch-total .amt { font-size: 22px; font-weight: 800; color: var(--green); letter-spacing: -.6px; }
.ch-total.neg { background: var(--red-soft); } .ch-total.neg .lbl { color: var(--red); } .ch-total.neg .amt { color: var(--red); }

/* GRÁFICO */
.chart-card { padding-bottom: 24px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 0; }
.sec-title { font-size: 16px; font-weight: 600; } .sec-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.legend { display: flex; gap: 18px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; }
.chart-wrap { padding: 26px 14px 0; }
.bars { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; height: 220px; padding: 0 10px; border-bottom: 1px solid var(--border); }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar-pair { display: flex; gap: 8px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.bar { width: 28px; border-radius: 7px 7px 0 0; transition: filter .18s; }
.bar.web { background: linear-gradient(180deg, #FB7B4D, #E04A0C); } .bar.ml { background: linear-gradient(180deg, #f7c948, #eab308); }
.bar:hover { filter: brightness(1.06); }
.bar-labels { display: flex; justify-content: space-between; gap: 24px; padding: 12px 10px 0; }
.bar-labels .bl { flex: 1; text-align: center; font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.bar-labels .bl.cur { color: var(--text); font-weight: 600; }

@media (max-width: 1000px) { .sidebar { display: none; } .main { padding: 20px; } .kpi-row { grid-template-columns: repeat(2, 1fr); } .grid2, .channels { grid-template-columns: 1fr; } }
/* AJUSTES */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.set-card { padding: 22px; }
.set-card h3 { font-size: 15px; margin-bottom: 6px; }
.set-card p { font-size: 13px; color: var(--text-2); margin-bottom: 16px; line-height: 1.5; }
.chip.rol-admin { color: #A8380C; background: var(--brand-soft); }
.chip.rol-ventas { color: var(--ml-text); background: var(--ml-soft); }
.chip.rol-deposito { color: #137a39; background: var(--green-soft); }
.btn-ghost { background: none; border: 1px solid var(--border-2); color: var(--text-2); height: 32px; padding: 0 11px; border-radius: 8px; font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.btn-ghost:hover { color: var(--text); border-color: #cfd4dc; }
.btn-ghost.danger:hover { color: var(--red); border-color: #f0c9c7; background: var(--red-soft); }

@media print { .sidebar, .topbar-actions, .tabs, .form-body, .sh-action { display: none !important; } .main { padding: 0; } }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }
