.ap-card, .ap-kpi { background: var(--ap-color-surface); border: 1px solid var(--ap-color-border); border-radius: var(--ap-radius-lg); box-shadow: var(--ap-shadow-sm); }
.ap-card { padding: 18px; }
.ap-card-xl { min-height: 320px; }
.ap-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ap-card-head h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.ap-card-head p { margin: 3px 0 0; color: var(--ap-color-muted); font-size: 12px; }
.ap-card-head a { color: var(--ap-color-primary); font-weight: 800; font-size: 12px; }
.ap-kpi { min-height: 100px; padding: 18px; display: flex; align-items: center; gap: 16px; }
.ap-kpi-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 18px; background: rgba(232,0,79,.12); color: var(--ap-color-primary); font-weight: 900; }
.ap-kpi-warning { background: rgba(245,158,11,.13); color: var(--ap-warning); }
.ap-kpi span { display: block; color: var(--ap-color-muted); font-size: 12px; font-weight: 700; }
.ap-kpi strong { display: block; font-size: 25px; margin: 3px 0; letter-spacing: -.04em; }
.ap-kpi small { color: var(--ap-success); font-size: 11px; font-weight: 700; }
.ap-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--ap-color-primary); color: #fff; font-weight: 900; }
.ap-avatar-sm { width: 34px; height: 34px; font-size: 12px; }
.ap-icon-btn { width: 38px; height: 38px; border: 1px solid var(--ap-color-border); border-radius: 12px; background: #fff; display: grid; place-items: center; cursor: pointer; }
.ap-btn { border: 1px solid transparent; border-radius: 10px; min-height: 42px; padding: 0 18px; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ap-btn-primary { background: var(--ap-color-primary); color: #fff; }
.ap-btn-outline { border-color: var(--ap-color-primary); background: #fff; color: var(--ap-color-primary); }
.ap-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.ap-badge.success { background: rgba(22,163,74,.12); color: var(--ap-success); }
.ap-badge.warning { background: rgba(245,158,11,.13); color: var(--ap-warning); }
.ap-badge.danger { background: rgba(220,38,38,.12); color: var(--ap-danger); }
.ap-chart-placeholder { height: 250px; border-radius: 14px; background: linear-gradient(180deg, rgba(232,0,79,.10), transparent), repeating-linear-gradient(to top, transparent, transparent 48px, rgba(148,163,184,.18) 49px); border: 1px dashed rgba(148,163,184,.35); }
.ap-bars { display: grid; gap: 13px; }
.ap-bars div { display: grid; grid-template-columns: 95px 1fr 72px; align-items: center; gap: 10px; font-size: 12px; }
.ap-bars b { display: block; height: 13px; background: var(--ap-color-primary); border-radius: 4px; }
.ap-bars em { font-style: normal; color: #334155; text-align: right; }
.ap-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.ap-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--ap-color-border); }
.ap-list em { font-style: normal; color: #334155; }
.ap-toast-root { position: fixed; right: 20px; top: 20px; z-index: 2000; display: grid; gap: 10px; }
.ap-toast { background: #111827; color: #fff; padding: 13px 16px; border-radius: 12px; box-shadow: var(--ap-shadow-md); }
.ap-modal { position: fixed; inset: 0; background: rgba(15,23,42,.42); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 1000; }
.ap-modal.is-open { display: flex; }
.ap-modal-box { width: min(520px, 100%); background: #fff; border-radius: 20px; padding: 22px; box-shadow: var(--ap-shadow-md); }
.ap-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.ap-modal-head h3 { margin: 0; }
.ap-modal-head button { border: 0; background: transparent; font-size: 26px; cursor: pointer; }
.ap-btn-light { background: #fff; border-color: var(--ap-color-border); color: #334155; }
.ap-note { background: #f8fafc; border: 1px solid var(--ap-color-border); border-radius: 12px; padding: 12px 14px; color: #475569; font-size: 12px; font-weight: 700; margin: 6px 0 14px; }
.ap-empty { text-align: center; color: var(--ap-color-muted); padding: 24px !important; }
.ap-modal-lg { width: min(760px, 100%); }
.ap-color-dot { width: 24px; height: 24px; display: inline-block; border-radius: 8px; background: var(--dot); border: 1px solid rgba(15,23,42,.12); margin-right: 6px; vertical-align: middle; }
.ap-addon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ap-addon-card { border: 1px solid var(--ap-color-border); border-radius: 16px; padding: 16px; background: #fff; display: grid; gap: 4px; }
.ap-addon-card strong { font-size: 15px; }
.ap-addon-card span { color: var(--ap-color-primary); font-weight: 800; font-size: 12px; }
.ap-addon-card small { color: var(--ap-color-muted); }
.ap-kpi { display: block; }
.ap-kpi strong { font-size: 28px; }
.ap-kpi small { color: var(--ap-color-muted); }
.mt-3 { margin-top: 16px; }
.ap-page { padding: 22px; }
.ap-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.ap-page-head h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: -.04em; }
.ap-page-head p { margin: 0; color: var(--ap-color-muted); }
.ap-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ap-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ap-filter-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.ap-filter-pills a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--ap-color-border); border-radius: 10px; color: #334155; font-weight: 800; background: #fff; }
.ap-filter-pills a.active { background: var(--ap-color-primary); border-color: var(--ap-color-primary); color: #fff; }
.ap-table-actions { display: flex; gap: 10px; white-space: nowrap; }
.ap-table-actions a { font-weight: 800; color: var(--ap-color-primary); }
.ap-btn-sm { min-height: 34px; padding: 0 12px; font-size: 12px; }
.ap-detail-list { display: grid; gap: 10px; }
.ap-detail-list div, .ap-total-box div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ap-color-border); padding: 10px 0; }
.ap-detail-list span, .ap-total-box span { color: var(--ap-color-muted); font-size: 12px; font-weight: 800; }
.ap-detail-list strong, .ap-total-box strong { color: #111827; }
.ap-total-box .total { color: var(--ap-color-primary); font-size: 18px; border-bottom: 0; border-top: 1px solid var(--ap-color-border); margin-top: 4px; }
.ap-total-box .total strong { color: var(--ap-color-primary); }
.ap-inline-form { display: flex; gap: 10px; align-items: center; }
.ap-inline-form select { border: 1px solid var(--ap-color-border); border-radius: 10px; min-height: 42px; padding: 0 12px; }
.ap-modal-xl { width: min(1080px, 100%); }
.ap-soft-card { background: #f8fafc; box-shadow: none; }
.ap-recipe-lines { display: grid; gap: 12px; }
.ap-recipe-line { display: grid; grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(120px, 1fr)); gap: 12px; align-items: end; padding: 12px; border: 1px solid var(--ap-color-border); border-radius: 14px; background: #fff; }
.ap-filter-card { padding: 14px 18px; }
.ap-report-filter { align-items: end; flex-wrap: wrap; }
.ap-report-filter .ap-field { min-width: 180px; }
.ap-table small { color: var(--ap-color-muted); font-weight: 700; }
.ap-badge.info { background: rgba(37,99,235,.12); color: var(--ap-info); }
.ap-toast.success { background: #14532d; }
.ap-toast.error { background: #7f1d1d; }
@media (max-width: 900px) {
  .ap-recipe-line { grid-template-columns: 1fr; }
  .ap-report-filter { display: grid; grid-template-columns: 1fr; }
}

.ap-muted{color:var(--ap-color-muted);font-size:.9rem}.ap-empty{text-align:center;color:var(--ap-color-muted);padding:24px}.ap-text-danger{color:var(--ap-danger);display:block;margin-top:6px}.ap-alert{border:1px solid var(--ap-color-border);border-radius:var(--ap-radius-md);padding:12px 14px;background:var(--ap-color-surface);margin-bottom:16px}.ap-alert-warning{border-color:rgba(245,158,11,.35);background:rgba(245,158,11,.08)}.ap-status{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:6px 10px;font-size:.78rem;font-weight:700;text-transform:capitalize;background:#eef2f7;color:#334155}.ap-status-aceptado{background:rgba(22,163,74,.12);color:var(--ap-success)}.ap-status-procesando{background:rgba(37,99,235,.12);color:var(--ap-info)}.ap-status-rechazado,.ap-status-error{background:rgba(220,38,38,.12);color:var(--ap-danger)}.ap-status-sin-respuesta{background:rgba(245,158,11,.14);color:#b45309}.ap-status-anulado{background:rgba(100,116,139,.14);color:#475569}.ap-icon-btn{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:6px 10px;border:1px solid var(--ap-color-border);border-radius:10px;background:var(--ap-color-surface);color:var(--ap-color-text);font-size:.78rem;font-weight:700;text-decoration:none;cursor:pointer}.ap-icon-btn:hover{background:var(--ap-color-bg)}.ap-row-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.ap-inline-action{display:inline-flex;margin:0}.ap-actions-end{justify-content:flex-end}.ap-detail-list{display:grid;gap:10px}.ap-detail-list>div{display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--ap-color-border);padding-bottom:8px}.ap-detail-list span{color:var(--ap-color-muted);font-size:.86rem}.ap-detail-list strong{text-align:right}.ap-col-2{grid-column:span 2}@media(max-width:760px){.ap-col-2{grid-column:span 1}.ap-detail-list>div{align-items:flex-start;flex-direction:column;gap:4px}.ap-detail-list strong{text-align:left}}
