/* Batch72: final commercial operations UI layer. Loaded after the legacy bundles. */
:root {
  --b72-ink: #14243a;
  --b72-ink-soft: #334862;
  --b72-muted: #6d7d92;
  --b72-line: #dfe7f0;
  --b72-canvas: #f4f7fb;
  --b72-surface: #ffffff;
  --b72-blue: #2563eb;
  --b72-blue-dark: #15458f;
  --b72-teal: #0f9f8d;
  --b72-amber: #c48118;
  --b72-red: #c54d5c;
  --b72-shadow: 0 8px 24px rgba(27, 49, 79, .06);
  --b72-shadow-hover: 0 14px 32px rgba(27, 49, 79, .11);
  --b72-ease: cubic-bezier(.2, .72, .24, 1);
}

html { scroll-behavior: smooth; }
body.erp-mode { background: var(--b72-canvas) !important; color: var(--b72-ink) !important; }
body.erp-mode .erp-app,
body.erp-mode .erp-content { background: var(--b72-canvas) !important; }
body.erp-mode .erp-content { padding: 26px clamp(18px, 2.3vw, 38px) 68px !important; }

/* Shell */
body.erp-mode .erp-sidebar {
  background: #102945 !important;
  border-right: 1px solid rgba(255,255,255,.1) !important;
  box-shadow: 10px 0 28px rgba(11, 29, 52, .16) !important;
}
body.erp-mode .erp-sidebar-aurora { display: none !important; }
body.erp-mode .erp-brand { min-height: 82px; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
body.erp-mode .erp-brand-mark { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 7px 18px rgba(37,99,235,.28); }
body.erp-mode .erp-brand-text strong { font-size: 17px; letter-spacing: 0; }
body.erp-mode .erp-brand-text span { margin-top: 3px; color: #90a8c7; font-size: 9px; letter-spacing: 0; }
body.erp-mode .erp-nav { padding: 17px 11px 20px; }
body.erp-mode .erp-nav-group { margin: 14px 11px 7px; }
body.erp-mode .erp-nav-group span { color: #88a0bd !important; font-size: 9px; letter-spacing: 0 !important; }
body.erp-mode .erp-nav button {
  min-height: 46px; margin: 3px 0; padding: 7px 10px; border: 1px solid transparent;
  border-radius: 10px; color: #b7c7dc; transition: background .2s var(--b72-ease), border-color .2s var(--b72-ease), transform .2s var(--b72-ease), color .2s var(--b72-ease);
}
body.erp-mode .erp-nav button:hover { background: rgba(255,255,255,.075); color: #f6fbff; transform: translateX(2px); }
body.erp-mode .erp-nav button.active { background: #1b4e87 !important; border-color: rgba(113, 189, 255, .36) !important; color: #fff !important; box-shadow: inset 3px 0 0 #65c7ff, 0 7px 16px rgba(4, 17, 36, .16); }
body.erp-mode .erp-nav-icon { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.07); color: #a8bfdc; }
body.erp-mode .erp-nav button.active .erp-nav-icon { background: rgba(125, 211, 252, .15); color: #d9f5ff; }
body.erp-mode .erp-nav-copy b { font-size: 12px; }
body.erp-mode .erp-nav-copy small { margin-top: 2px; color: #8ea5c0; font-size: 9px; }
body.erp-mode .erp-nav button.active .erp-nav-copy small { color: #c3e4fb; }
body.erp-mode .erp-sidebar-bottom { border-top-color: rgba(255,255,255,.08); background: rgba(4,16,34,.14); }
body.erp-mode .erp-sidebar-collapse { border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.055); color: #c3d2e6; }
body.erp-mode .erp-sidebar-foot { padding: 11px 16px 15px; }

body.erp-mode .erp-topbar {
  height: 72px !important; padding: 0 clamp(14px, 2.25vw, 32px) !important;
  background: rgba(255,255,255,.95) !important; border-bottom: 1px solid var(--b72-line) !important;
  box-shadow: 0 5px 18px rgba(27,49,79,.045) !important; backdrop-filter: blur(14px) !important;
}
body.erp-mode .erp-topbar-left, body.erp-mode .erp-topbar-right { gap: 9px; min-width: 0; }
body.erp-mode .erp-page-icon { width: 38px; height: 38px; border: 1px solid #d4e2f4; border-radius: 11px; background: #f1f6fd; color: var(--b72-blue); box-shadow: none; }
body.erp-mode .erp-breadcrumb strong { color: var(--b72-ink); font-size: 17px; }
body.erp-mode .erp-breadcrumb small { color: #8492a5; font-size: 10px; }
body.erp-mode .erp-breadcrumb small i { color: #bdc8d6; }
body.erp-mode .erp-page-updated { color: #8492a5; font-size: 9px; }
body.erp-mode .erp-date-chip, body.erp-mode .erp-status-pill, body.erp-mode .erp-user-chip, body.erp-mode .erp-top-icon { border-color: var(--b72-line); box-shadow: none; }
body.erp-mode .erp-status-pill { color: #58708c; background: #fbfdff; }
body.erp-mode .erp-status-dot { box-shadow: 0 0 0 3px rgba(15,159,141,.12); }
body.erp-mode .erp-user-chip:hover, body.erp-mode .erp-top-icon:hover { border-color: #a9c6ec; background: #f4f8ff; transform: translateY(-1px); }

/* Page rhythm and controls */
body.erp-mode .erp-page-heading { margin: 0 0 20px !important; padding: 2px 0 2px 15px !important; }
body.erp-mode .erp-page-heading:before { width: 4px; top: 1px; bottom: 1px; border-radius: 4px; background: var(--b72-blue) !important; }
body.erp-mode .erp-page-heading h1 { color: var(--b72-ink) !important; font-size: 28px !important; letter-spacing: 0 !important; }
body.erp-mode .erp-page-heading p { max-width: 760px; color: var(--b72-muted) !important; font-size: 11px; line-height: 1.65; }
body.erp-mode .erp-page-heading > .actions { display: flex; align-items: center; gap: 8px; }
body.erp-mode button { min-height: 36px; border-radius: 9px; font-size: 11px; font-weight: 720; transition: background .18s var(--b72-ease), border-color .18s var(--b72-ease), color .18s var(--b72-ease), box-shadow .18s var(--b72-ease), transform .18s var(--b72-ease); }
body.erp-mode button.primary { border-color: var(--b72-blue) !important; background: var(--b72-blue) !important; color: #fff !important; box-shadow: 0 6px 14px rgba(37,99,235,.16); }
body.erp-mode button.primary:hover { background: #1d55cd !important; box-shadow: 0 9px 19px rgba(37,99,235,.23); transform: translateY(-1px); }
body.erp-mode button.success { border-color: var(--b72-teal) !important; background: var(--b72-teal) !important; color: #fff !important; }
body.erp-mode button.ghost { border: 1px solid #d6e1ec !important; background: #fff !important; color: #45617f !important; }
body.erp-mode button.ghost:hover { border-color: #a9c6ec !important; background: #f4f8ff !important; color: var(--b72-blue-dark) !important; transform: translateY(-1px); }
body.erp-mode button:disabled { cursor: not-allowed; opacity: .52; transform: none !important; box-shadow: none !important; }
body.erp-mode input, body.erp-mode select, body.erp-mode textarea { min-height: 36px; border: 1px solid #d7e2ed !important; border-radius: 9px !important; background: #fff !important; color: #263b55 !important; box-shadow: inset 0 1px 2px rgba(24,54,89,.025); }
body.erp-mode input:hover, body.erp-mode select:hover, body.erp-mode textarea:hover { border-color: #b9cde4 !important; }
body.erp-mode input:focus, body.erp-mode select:focus, body.erp-mode textarea:focus { border-color: #74a2e8 !important; box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important; outline: none; }

body.erp-mode .erp-panel, body.erp-mode .erp-module-card, body.erp-mode .intel-card, body.erp-mode .card, body.erp-mode .viz-panel, body.erp-mode .smart-analysis-panel, body.erp-mode .smart-preview-panel, body.erp-mode .maint-box {
  border: 1px solid var(--b72-line) !important; border-radius: 12px !important; background: var(--b72-surface) !important; box-shadow: var(--b72-shadow) !important;
}
body.erp-mode .erp-panel:hover, body.erp-mode .erp-module-card:hover, body.erp-mode .viz-panel:hover, body.erp-mode .intel-card:hover { border-color: #c9d8e9 !important; box-shadow: var(--b72-shadow-hover) !important; }
body.erp-mode .erp-panel-head, body.erp-mode .box-head { min-height: 44px; margin-bottom: 12px; }
body.erp-mode .erp-panel-head h3, body.erp-mode .box-head h2 { color: var(--b72-ink); font-size: 14px; }
body.erp-mode .erp-panel-head span, body.erp-mode .box-head p { color: var(--b72-muted); font-size: 10px; }
body.erp-mode .erp-module-grid { gap: 13px; }
body.erp-mode .erp-module-card { padding: 16px !important; }
body.erp-mode .erp-module-card .erp-module-icon { width: 40px; height: 40px; border-radius: 10px; background: #f0f6ff; border: 1px solid #d7e6f8; color: var(--b72-blue); box-shadow: none; }
body.erp-mode .erp-module-card h3 { color: var(--b72-ink); font-size: 14px; }
body.erp-mode .erp-module-card p { color: var(--b72-muted); font-size: 11px; line-height: 1.65; }

/* Dashboard and intelligent analysis */
body.erp-mode .erp-dashboard-hero { min-height: 174px; padding: 26px 29px; border-radius: 14px; background: #173b64 !important; border: 1px solid #23527f; box-shadow: 0 16px 34px rgba(16,51,91,.18); }
body.erp-mode .erp-dashboard-hero:before, body.erp-mode .erp-dashboard-hero:after { display: none !important; }
body.erp-mode .erp-dashboard-hero h2 { color: #fff !important; font-size: 25px !important; }
body.erp-mode .erp-dashboard-hero p { color: #c4d8ed; font-size: 12px; }
body.erp-mode .erp-hero-eyebrow { color: #8fcef4; font-size: 9px; letter-spacing: 0; }
body.erp-mode .erp-hero-tags span { border-color: rgba(192,229,255,.25); background: rgba(255,255,255,.08); color: #e0f1ff; }
body.erp-mode .erp-dashboard-hero button:not(.primary) { border-color: rgba(255,255,255,.23) !important; background: rgba(255,255,255,.08) !important; color: #e7f3ff !important; }
body.erp-mode .erp-kpi-grid, body.erp-mode .intel-kpis { gap: 11px; }
body.erp-mode .erp-kpi-card, body.erp-mode .intel-kpi, body.erp-mode .kpi { min-height: 106px; padding: 15px !important; border: 1px solid var(--b72-line) !important; border-radius: 11px !important; background: #fff !important; box-shadow: var(--b72-shadow) !important; }
body.erp-mode .erp-kpi-card:hover, body.erp-mode .intel-kpi:hover, body.erp-mode .kpi:hover { transform: translateY(-2px); }
body.erp-mode .erp-kpi-head, body.erp-mode .erp-kpi-note { color: var(--b72-muted); }
body.erp-mode .erp-kpi-value, body.erp-mode .kpi b { color: var(--b72-ink); font-size: 25px; font-variant-numeric: tabular-nums; }
body.erp-mode .ai-dashboard-brief, body.erp-mode .ai-center-hero, body.erp-mode .ai-task-center { border-radius: 12px !important; }
body.erp-mode .ai-dashboard-task-grid, body.erp-mode .ai-center-task-grid { gap: 11px; }
body.erp-mode .intel-alert-card, body.erp-mode .ai-task-card { border-radius: 10px !important; }

/* Visualization */
body.erp-mode .viz-control-bar { gap: 11px; padding: 13px; border: 1px solid var(--b72-line); border-radius: 11px; background: #fff; box-shadow: var(--b72-shadow); }
body.erp-mode .viz-summary-grid { gap: 10px; }
body.erp-mode .viz-summary-card { border-radius: 11px; padding: 14px; box-shadow: var(--b72-shadow); }
body.erp-mode .viz-summary-card strong { color: var(--b72-ink); font-size: 23px; }
body.erp-mode .viz-main-grid, body.erp-mode .viz-secondary-grid { gap: 13px; }
body.erp-mode .viz-panel { padding: 16px; }
body.erp-mode .viz-panel h2 { color: var(--b72-ink); font-size: 17px; }
body.erp-mode .viz-chart { border-color: #e0e8f1; background: #fbfdff; }
body.erp-mode .viz-point circle { transition: r .16s var(--b72-ease), fill .16s var(--b72-ease), stroke-width .16s var(--b72-ease); }
body.erp-mode .viz-point:hover circle, body.erp-mode .viz-point.selected circle { filter: drop-shadow(0 3px 5px rgba(37,99,235,.28)); }
body.erp-mode .viz-rank-row:hover, body.erp-mode .viz-table-wrap tbody tr:hover { background: #f2f7ff; }
body.erp-mode .viz-table-wrap { border-radius: 9px; }

/* Data-heavy modules */
body.erp-mode .table-wrap, body.erp-mode .ui3-table-scroll, body.erp-mode .control-display-wrap { border: 1px solid var(--b72-line); border-radius: 10px; background: #fff; }
body.erp-mode table thead th { background: #f1f5f9; color: #51647d; font-size: 10px; font-weight: 800; }
body.erp-mode table tbody td { border-top-color: #edf2f7; color: #344b66; font-size: 11px; }
body.erp-mode table tbody tr:hover { background: #f6f9fd; }
body.erp-mode .control-display-wrap { box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
body.erp-mode .control-display-wrap table { min-width: max-content; }
body.erp-mode .message, body.erp-mode .tip { border-radius: 9px; }
body.erp-mode .progress { height: 6px; border-radius: 99px; background: #e7eef6; overflow: hidden; }
body.erp-mode .progress > div { border-radius: inherit; background: var(--b72-blue); }

/* Motion */
@keyframes b72PageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes b72PanelIn { from { opacity: 0; transform: translateY(8px) scale(.992); } to { opacity: 1; transform: none; } }
@keyframes b72Pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(15,159,141,.15); } 50% { box-shadow: 0 0 0 5px rgba(15,159,141,0); } }
@keyframes b72Ripple { from { transform: scale(0); opacity: .32; } to { transform: scale(2.8); opacity: 0; } }
body.erp-mode .erp-page-active.ui-page-enter { animation: b72PageIn .34s var(--b72-ease) both !important; }
body.erp-mode .erp-panel.ui-revealed, body.erp-mode .erp-module-card.ui-revealed, body.erp-mode .erp-kpi-card.ui-revealed, body.erp-mode .viz-panel.ui-revealed, body.erp-mode .viz-summary-card.ui-revealed { animation: b72PanelIn .34s var(--b72-ease) both; animation-delay: var(--motion-delay, 0ms); }
body.erp-mode .erp-status-dot { animation: b72Pulse 2.8s ease-in-out infinite; }
body.erp-mode .b72-ripple { position: absolute; width: 18px; height: 18px; border-radius: 50%; pointer-events: none; background: currentColor; animation: b72Ripple .46s ease-out forwards; }
body.erp-mode .b72-route-busy .erp-content { cursor: progress; }

@media (max-width: 1260px) {
  body.erp-mode .erp-content { padding-inline: 24px !important; }
  body.erp-mode .erp-dashboard-hero { padding: 23px 25px; }
}
@media (max-width: 1400px) and (min-width: 781px) {
  body.erp-mode #intelGlobalSearch {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    flex: 0 0 40px !important;
    padding-inline: 0;
    justify-content: center;
  }
  body.erp-mode #intelGlobalSearch > span:not(.ui-btn-icon),
  body.erp-mode #intelGlobalSearch > kbd { display: none; }
  body.erp-mode #intelGlobalSearch > b {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  body.erp-mode .erp-breadcrumb { min-width: 170px; }
}
@media (max-width: 780px) {
  body.erp-mode .erp-content { padding: 17px 11px calc(94px + env(safe-area-inset-bottom)) !important; }
  body.erp-mode .erp-topbar { height: 64px !important; padding: 0 10px !important; }
  body.erp-mode .erp-page-heading { gap: 9px; margin-bottom: 14px !important; padding-left: 12px !important; }
  body.erp-mode .erp-page-heading h1 { font-size: 21px !important; }
  body.erp-mode .erp-page-heading > .actions { width: 100%; overflow-x: auto; padding-bottom: 3px; scrollbar-width: none; }
  body.erp-mode .erp-page-heading > .actions::-webkit-scrollbar { display: none; }
  body.erp-mode .erp-page-heading > .actions button { flex: 0 0 auto; }
  body.erp-mode .erp-panel, body.erp-mode .erp-module-card, body.erp-mode .intel-card, body.erp-mode .card, body.erp-mode .viz-panel { border-radius: 11px !important; padding: 13px !important; }
  body.erp-mode .erp-dashboard-hero { min-height: 0; padding: 20px 17px; }
  body.erp-mode .erp-dashboard-hero h2 { font-size: 21px !important; }
  body.erp-mode .erp-dashboard-hero .hero-actions { width: 100%; display: grid; grid-template-columns: 1fr; gap: 7px; }
  body.erp-mode .erp-dashboard-hero .hero-actions button { width: 100%; }
  body.erp-mode .erp-kpi-grid, body.erp-mode .intel-kpis, body.erp-mode .sales-kpis, body.erp-mode .receipt-kpis, body.erp-mode .peer-trend-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  body.erp-mode .erp-kpi-card, body.erp-mode .intel-kpi, body.erp-mode .kpi { min-height: 92px; padding: 11px !important; }
  body.erp-mode .erp-kpi-value, body.erp-mode .kpi b { font-size: 20px; }
  body.erp-mode .viz-control-bar { align-items: stretch; padding: 10px; }
  body.erp-mode .viz-control-group, body.erp-mode .viz-control-field, body.erp-mode .viz-search-field { width: 100%; min-width: 0; }
  body.erp-mode .viz-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body.erp-mode .viz-summary-card { padding: 11px; }
  body.erp-mode .viz-summary-card strong { font-size: 19px; }
  body.erp-mode .viz-main-grid, body.erp-mode .viz-secondary-grid { grid-template-columns: minmax(0, 1fr); }
  body.erp-mode .viz-chart-scroll { overscroll-behavior-x: contain; scrollbar-width: thin; }
  body.erp-mode .erp-table-toolbar, body.erp-mode .control-toolbar, body.erp-mode .control-filter-grid { gap: 8px; }
  body.erp-mode .erp-topbar-right { gap: 4px; }
  body.erp-mode .erp-user-chip { width: 40px; padding: 4px; }
  body.erp-mode .erp-user-chip > div:nth-child(2), body.erp-mode .erp-user-chevron { display: none !important; }
}
@media (max-width: 430px) {
  body.erp-mode .erp-content { padding-inline: 9px !important; }
  body.erp-mode .erp-page-heading p { font-size: 10px; }
  body.erp-mode .erp-kpi-grid, body.erp-mode .intel-kpis, body.erp-mode .sales-kpis, body.erp-mode .receipt-kpis, body.erp-mode .peer-trend-kpis { grid-template-columns: 1fr 1fr !important; }
  body.erp-mode .viz-point-detail { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.erp-mode .erp-page-active.ui-page-enter, body.erp-mode .erp-panel.ui-revealed, body.erp-mode .erp-module-card.ui-revealed, body.erp-mode .erp-kpi-card.ui-revealed, body.erp-mode .viz-panel.ui-revealed, body.erp-mode .viz-summary-card.ui-revealed, body.erp-mode .erp-status-dot, body.erp-mode .b72-ripple { animation: none !important; transition: none !important; }
}
