/* ==========================================================================
   IzzahTech ERP - Operations Hub v2 enterprise theme
   Loaded after style.css; overrides the legacy ERP shell.
   ========================================================================== */
#erpView { background: #f4f1e9; }
#erpView .erp-header {
  position: relative;
  padding: 14px 28px;
  gap: 18px;
  flex-wrap: wrap;
  background:
    radial-gradient(1200px 260px at 15% -40%, rgba(201, 162, 39, .18), transparent 60%),
    linear-gradient(135deg, #0a1120 0%, #101d35 55%, #0a1120 100%);
  border-bottom: 1px solid rgba(201, 162, 39, .32);
}
#erpView .erp-header::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201, 162, 39, .85), transparent);
  opacity: .55;
}
.erp-brand { gap: 13px; }
.erp-brand-mark {
  width: 66px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 9px; padding: 4px 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}
.erp-brand-mark img { max-width: 100%; max-height: 100%; object-fit: contain; }
.erp-eyebrow {
  display: block; font-size: .56rem; font-weight: 800; letter-spacing: 2.4px;
  text-transform: uppercase; color: #d8b64a; margin-bottom: 1px;
}
.erp-brand h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.3px; color: #fff; }
.erp-header-right { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.erp-system-live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .68rem; font-weight: 700; color: #86efac;
  background: rgba(16, 185, 129, .1); border: 1px solid rgba(16, 185, 129, .22);
  padding: 5px 10px; border-radius: 999px;
}
.erp-system-live .online-indicator { width: 6px; height: 6px; box-shadow: 0 0 6px #10b981; }
.erp-date-chip {
  font-size: .68rem; font-weight: 600; color: #cbd5e1;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.erp-admin-chip {
  display: flex; align-items: center; gap: 9px;
  padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, .12);
}
.erp-admin-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #d8b64a, #a5801b);
  color: #0f172a; font-size: .68rem; font-weight: 800; letter-spacing: .4px;
}
.erp-admin-meta { display: flex; flex-direction: column; line-height: 1.15; }
.erp-admin-meta small { font-size: .58rem; color: #94a3b8; text-transform: uppercase; letter-spacing: .8px; font-weight: 700; }
.erp-admin-meta strong { font-size: .78rem; color: #f8fafc; font-weight: 700; }
#erpView .btn-store-switch {
  display: inline-flex; align-items: center; gap: 7px;
  background: #1a2942; color: #e2e8f0; border: 1px solid #33415c;
  border-radius: 8px; padding: 7px 12px; font-family: inherit;
  font-size: .76rem; font-weight: 700; cursor: pointer; transition: .16s;
}
#erpView .btn-store-switch:hover { background: #253752; border-color: #C9A227; color: #fff; }

/* Sidebar */
@media (min-width: 1025px) {
  #erpView.active-view {
    display: grid;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    grid-template-columns: 248px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "erphead erphead" "erpnav erpmain";
    align-items: stretch;
  }
  #erpView .erp-header {
    grid-area: erphead;
    position: relative;
    z-index: 40;
  }
  #erpView .erp-nav {
    grid-area: erpnav;
    display: flex; flex-direction: column; flex-wrap: nowrap;
    gap: 14px; padding: 14px 12px 18px;
    background: linear-gradient(180deg, #0c1526 0%, #0a1120 100%);
    border-right: 1px solid rgba(201, 162, 39, .14);
    min-height: 0; height: 100%; max-height: none;
    overflow-y: auto; overscroll-behavior: contain;
    position: static; z-index: 30;
    scrollbar-width: thin;
  }
  #erpView .erp-main {
    grid-area: erpmain;
    height: 100%; min-height: 0;
    overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 24px 28px 64px;
  }
}
.erp-nav-group { display: flex; flex-direction: column; gap: 3px; }
.erp-nav-label {
  font-size: .56rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.7px;
  color: #5b6b85; padding: 6px 12px 4px;
}
.erp-nav .erp-tab-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 11px;
  color: #a9b6cb; background: transparent; border: none;
  border-left: 3px solid transparent; border-radius: 8px;
  font-family: inherit; font-size: .78rem; font-weight: 600;
  text-align: left; white-space: nowrap; cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.erp-nav .erp-tab-btn svg { flex-shrink: 0; opacity: .8; }
.erp-nav .erp-tab-btn:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.erp-nav .erp-tab-btn.active {
  color: #f1d47a;
  background: linear-gradient(90deg, rgba(201, 162, 39, .2), rgba(201, 162, 39, .03));
  border-left-color: #C9A227;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, .12);
}
.erp-nav .erp-tab-btn.active svg { opacity: 1; color: #e3c463; }
.erp-nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: rgba(239, 68, 68, .18); color: #fca5a5;
  font-size: .62rem; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.erp-nav-badge[hidden] { display: none; }
.erp-nav-badge.warn { background: rgba(201, 162, 39, .2); color: #f1d47a; }
.erp-nav-foot {
  margin-top: auto; padding: 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .07);
}
.erp-nav-foot-title { font-size: .58rem; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; color: #d8b64a; }
.erp-nav-foot p { margin: 5px 0 9px; font-size: .68rem; line-height: 1.45; color: #8ea0ba; }
.erp-nav-foot button {
  width: 100%; padding: 7px 10px; border: none; border-radius: 7px;
  background: #C9A227; color: #0f172a; font-family: inherit;
  font-size: .7rem; font-weight: 800; cursor: pointer; transition: .16s;
}
.erp-nav-foot button:hover { background: #dcb83f; }

/* Main canvas */
#erpView .erp-main { padding: 24px 28px 64px; }
.erp-page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 18px; flex-wrap: wrap; margin-bottom: 18px;
}
.erp-kicker {
  display: inline-block; margin-bottom: 7px;
  font-size: .56rem; font-weight: 800; letter-spacing: 2px;
  color: #8a6800; background: rgba(201, 162, 39, .1);
  border: 1px solid rgba(201, 162, 39, .24);
  padding: 3px 8px; border-radius: 4px;
}
.erp-kicker.is-loading { opacity: .45; }
.erp-page-head h2 { font-size: 1.48rem; font-weight: 800; letter-spacing: -.55px; }
.erp-page-head p { margin-top: 3px; font-size: .83rem; color: var(--text-muted); }
.erp-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.erp-range-wrap {
  display: flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--border-color);
  border-radius: 9px; padding: 4px 4px 4px 10px;
  font-size: .64rem; font-weight: 800; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-muted);
}
.erp-range-wrap select {
  border: none; background: #f6f2e8; border-radius: 6px;
  padding: 7px 8px; font-family: inherit; font-size: .76rem;
  font-weight: 700; color: var(--text-main); outline: none; cursor: pointer;
}
.erp-head-actions .erp-btn { min-height: 38px; padding: 0 13px; font-size: .76rem; gap: 7px; }

/* ERP buttons (shared by every tab) */
.erp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 14px; border-radius: 9px; cursor: pointer;
  font-family: inherit; font-size: .76rem; font-weight: 700; line-height: 1.1;
  background: #fff; border: 1px solid var(--border-color); color: var(--text-main);
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
}
.erp-btn:hover { background: #f6f2e8; border-color: #d9cfae; }
.erp-btn:active { transform: translateY(1px); }
.erp-btn:disabled { opacity: .55; cursor: not-allowed; }
.erp-btn-primary {
  background: linear-gradient(180deg, #d9b23a, #b8912a);
  border-color: transparent; color: #241d05;
  box-shadow: 0 4px 14px rgba(201, 162, 39, .28);
}
.erp-btn-primary:hover { background: linear-gradient(180deg, #e4c04a, #c39c2f); border-color: transparent; }
.erp-btn-ghost { background: transparent; border-color: var(--border-color); color: var(--text-muted); }
.erp-btn-ghost:hover { background: #f6f2e8; color: var(--text-main); }
.erp-btn-danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.erp-btn-danger:hover { background: #fee2e2; border-color: #fca5a5; }

/* KPI cards */
.erp-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 14px; }
.erp-kpi {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  background: #fff; border: 1px solid var(--border-color);
  border-radius: 13px; padding: 15px 17px 13px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  overflow: hidden;
}
.erp-kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--kpi-color, #C9A227); }
.erp-kpi.revenue { --kpi-color: #C9A227; --kpi-tint: rgba(201, 162, 39, .13); }
.erp-kpi.purchases { --kpi-color: #2563eb; --kpi-tint: rgba(37, 99, 235, .1); }
.erp-kpi.profit { --kpi-color: #10b981; --kpi-tint: rgba(16, 185, 129, .1); }
.erp-kpi.profit.negative { --kpi-color: #dc2626; --kpi-tint: rgba(239, 68, 68, .1); }
.erp-kpi.stock { --kpi-color: #8b5cf6; --kpi-tint: rgba(139, 92, 246, .1); }
.erp-kpi.prebook { --kpi-color: #f59e0b; --kpi-tint: rgba(245, 158, 11, .11); }
.erp-kpi.aov { --kpi-color: #0f172a; --kpi-tint: rgba(15, 23, 42, .07); }
.erp-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.erp-kpi-ico {
  width: 31px; height: 31px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--kpi-tint); color: var(--kpi-color);
}
.erp-kpi-tag {
  font-size: .59rem; font-weight: 700; letter-spacing: .2px;
  color: var(--text-muted); background: #f6f3eb;
  border-radius: 999px; padding: 3px 8px; white-space: nowrap;
}
.erp-kpi-tag small { font-weight: 600; opacity: .7; }
.erp-kpi-tag.up { color: #047857; background: rgba(16, 185, 129, .12); }
.erp-kpi-tag.down { color: #b91c1c; background: rgba(239, 68, 68, .1); }
.erp-kpi-tag.watch { color: #8a6800; background: rgba(201, 162, 39, .16); }
.erp-kpi-tag.critical { color: #b91c1c; background: rgba(239, 68, 68, .12); }
.erp-kpi-label { font-size: .61rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-muted); }
.erp-kpi-value { font-size: 1.52rem; font-weight: 800; letter-spacing: -.8px; line-height: 1.2; color: var(--text-main); }
.erp-kpi-sub { font-size: .73rem; color: var(--text-muted); }
.erp-kpi-foot { margin-top: 1px; font-size: .66rem; color: var(--text-light); }
.erp-kpi-spark { display: flex; align-items: flex-end; gap: 3px; height: 24px; margin-top: 9px; }
.erp-kpi-spark span {
  flex: 1; min-height: 3px; border-radius: 3px 3px 1px 1px;
  background: linear-gradient(180deg, var(--kpi-color), var(--kpi-tint));
  opacity: .8;
}

/* Cards */
.erp-card {
  min-width: 0; background: #fff; border: 1px solid var(--border-color);
  border-radius: 13px; padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.erp-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.erp-card-head h3 { font-size: .93rem; font-weight: 800; letter-spacing: -.2px; }
.erp-card-head p { margin-top: 2px; font-size: .69rem; color: var(--text-light); }
.erp-link { background: none; border: none; padding: 2px 0; font-family: inherit; font-size: .68rem; font-weight: 800; color: #8a6800; cursor: pointer; }
.erp-link:hover { text-decoration: underline; }
.erp-dash-row { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); gap: 13px; margin-bottom: 13px; align-items: stretch; }
.erp-chart-card { display: flex; flex-direction: column; }
.erp-chart { flex: 1; min-height: 240px; }
#erpTrendChart > svg { display: block; width: 100%; height: auto; }
.erp-chart-legend { display: flex; gap: 16px; margin: 0 0 4px; }
.erp-legend { display: inline-flex; align-items: center; gap: 6px; font-size: .66rem; font-weight: 700; color: var(--text-muted); }
.erp-legend i { width: 8px; height: 8px; border-radius: 50%; }
.erp-legend.sales i { background: #C9A227; }
.erp-legend.purchases i { background: #2563eb; }
.erp-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: #f4f0e6; border: 1px solid var(--border-color); }
.erp-seg button {
  border: none; background: transparent; border-radius: 6px;
  padding: 5px 9px; font-family: inherit; font-size: .66rem;
  font-weight: 800; color: var(--text-muted); cursor: pointer;
}
.erp-seg button.active { background: #0f172a; color: #fff; }
.erp-side-stack { display: flex; flex-direction: column; gap: 13px; min-width: 0; }

/* Alerts */
.erp-alert-list { display: flex; flex-direction: column; gap: 6px; }
.erp-alert {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 9px; border-radius: 9px; border: 1px solid transparent;
  background: #fbfaf6; text-align: left; font-family: inherit;
  color: inherit; cursor: pointer; transition: .15s;
}
button.erp-alert:hover { border-color: var(--border-dark); background: #f7f2e6; }
.erp-alert-ico {
  width: 29px; height: 29px; flex-shrink: 0; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.erp-alert.warn .erp-alert-ico { background: rgba(201, 162, 39, .15); color: #a17f14; }
.erp-alert.danger .erp-alert-ico { background: rgba(239, 68, 68, .1); color: #dc2626; }
.erp-alert.info .erp-alert-ico { background: rgba(37, 99, 235, .1); color: #2563eb; }
.erp-alert.ok { background: rgba(16, 185, 129, .06); }
.erp-alert.ok .erp-alert-ico { background: rgba(16, 185, 129, .12); color: #059669; }
.erp-alert-main { flex: 1; min-width: 0; }
.erp-alert-main strong { display: block; font-size: .74rem; font-weight: 700; color: var(--text-main); }
.erp-alert-main small { display: block; font-size: .65rem; color: var(--text-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-alert-count {
  font-size: .64rem; font-weight: 800; color: var(--text-muted);
  background: #fff; border: 1px solid var(--border-color);
  border-radius: 999px; padding: 2px 8px;
}
.erp-alert .chev { flex-shrink: 0; color: var(--text-light); }

/* Quick actions */
.erp-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.erp-quick-grid button {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 9px; border: 1px solid var(--border-color);
  border-radius: 9px; background: #fbfaf6;
  font-family: inherit; font-size: .68rem; font-weight: 700;
  color: var(--text-main); text-align: left; cursor: pointer; transition: .15s;
}
.erp-quick-grid button:hover { border-color: #C9A227; background: #faf6ea; }
.erp-quick-ico {
  width: 25px; height: 25px; flex-shrink: 0; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201, 162, 39, .13); color: #a17f14;
}

/* 3-up insight panels */
.erp-panel-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 13px; }
.erp-panel-row .erp-card { min-height: 238px; }
.erp-inv-wrap { display: flex; align-items: center; gap: 17px; }
.erp-donut {
  width: 106px; height: 106px; flex-shrink: 0; border-radius: 50%;
  display: grid; place-items: center; position: relative;
}
.erp-donut::after { content: ''; position: absolute; inset: 13px; border-radius: 50%; background: #fff; }
.erp-donut-center { position: relative; z-index: 1; text-align: center; }
.erp-donut-center strong { display: block; font-size: 1.15rem; font-weight: 800; line-height: 1.05; }
.erp-donut-center small { display: block; margin-top: 1px; font-size: .53rem; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-light); }
.erp-inv-legend { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.erp-inv-legend div { display: flex; align-items: center; gap: 7px; font-size: .68rem; color: var(--text-muted); }
.erp-inv-legend i { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.erp-inv-legend strong { margin-left: auto; font-size: .7rem; color: var(--text-main); font-weight: 800; }
.erp-brand-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--border-color); }
.erp-brand-row { display: grid; grid-template-columns: 62px 1fr 28px; align-items: center; gap: 8px; font-size: .65rem; color: var(--text-muted); }
.erp-brand-row strong { font-size: .66rem; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-brand-row .erp-bar { display: block; height: 5px; border-radius: 999px; background: #f1ede3; overflow: hidden; }
.erp-brand-row .erp-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #C9A227, #e2c65a); }
.erp-brand-row span:last-child { text-align: right; font-weight: 700; }

/* Top models */
.erp-model-row {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 3px; border: none; border-bottom: 1px dashed var(--border-color);
  background: none; font-family: inherit; text-align: left; cursor: pointer;
}
.erp-model-row:last-child { border-bottom: none; }
.erp-model-row:hover { background: #fbf8f0; }
.erp-rank {
  width: 21px; height: 21px; flex-shrink: 0; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  background: #f4efe2; color: #8a6800; font-size: .62rem; font-weight: 800;
}
.erp-model-row:first-child .erp-rank { background: #0f172a; color: #f1d47a; }
.erp-model-main { flex: 1; min-width: 0; }
.erp-model-main strong { display: block; font-size: .72rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-model-main small { display: block; margin-bottom: 4px; font-size: .62rem; color: var(--text-light); }
.erp-model-main .erp-bar { display: block; height: 4px; border-radius: 999px; background: #f1ede3; overflow: hidden; }
.erp-model-main .erp-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0f172a, #475569); }
.erp-model-share { font-size: .63rem; font-weight: 800; color: #8a6800; }

/* Activity */
.erp-activity { display: flex; flex-direction: column; }
.erp-activity-row {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 7px 2px; border-bottom: 1px dashed var(--border-color); cursor: pointer;
}
.erp-activity-row:last-child { border-bottom: none; }
.erp-activity-row:hover { background: #fbf8f0; }
.erp-act-ico { width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.erp-act-ico.sale { background: rgba(16, 185, 129, .1); color: #059669; }
.erp-act-ico.purchase { background: rgba(37, 99, 235, .1); color: #2563eb; }
.erp-act-ico.prebook { background: rgba(201, 162, 39, .14); color: #a17f14; }
.erp-act-main { flex: 1; min-width: 0; }
.erp-act-main strong { display: block; font-size: .7rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-act-main small { display: block; font-size: .63rem; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erp-act-time { font-size: .58rem; font-weight: 700; color: var(--text-light); white-space: nowrap; }

/* Recent tables */
.erp-table-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.erp-table-row .erp-card { padding-bottom: 6px; }
.erp-table-row .mini-table-container { border: none; border-radius: 0; box-shadow: none; background: transparent; }
.erp-table-row .data-table { width: 100%; min-width: 0; table-layout: fixed; font-size: .72rem; }
#miniSalesTable th:nth-child(1) { width: 21%; }
#miniSalesTable th:nth-child(2) { width: 16%; }
#miniSalesTable th:nth-child(3) { width: 21%; }
#miniSalesTable th:nth-child(4) { width: 12%; }
#miniSalesTable th:nth-child(5) { width: 16%; }
#miniSalesTable th:nth-child(6) { width: 14%; }
#miniPurchasesTable th:nth-child(1) { width: 22%; }
#miniPurchasesTable th:nth-child(2) { width: 16%; }
#miniPurchasesTable th:nth-child(3) { width: 19%; }
#miniPurchasesTable th:nth-child(4) { width: 11%; }
#miniPurchasesTable th:nth-child(5) { width: 13%; }
#miniPurchasesTable th:nth-child(6) { width: 19%; }
.erp-table-row .data-table th {
  padding: 8px 8px; background: #f8f5ed;
  font-size: .6rem; letter-spacing: .8px;
}
.erp-table-row .data-table td {
  padding: 9px 8px; font-size: .72rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.erp-muted-cell { color: var(--text-light) !important; font-size: .7rem !important; }
.erp-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; min-height: 155px; padding: 20px; text-align: center;
  color: var(--text-light);
}
.erp-empty svg { opacity: .4; margin-bottom: 2px; }
.erp-empty strong { font-size: .78rem; font-weight: 700; color: var(--text-muted); }
.erp-empty span { font-size: .68rem; max-width: 240px; }
.erp-empty-inline { padding: 22px 10px; text-align: center; font-size: .75rem; color: var(--text-light); }

/* ---------- Marketplace dashboard mode (store switch OFF) ---------- */
#erpDashStore[hidden], #erpDashMarket[hidden] { display: none !important; }

.erp-kpi.traffic { --kpi-color: #38bdf8; --kpi-tint: rgba(56, 189, 248, .13); }
.erp-kpi.visitors { --kpi-color: #34d399; --kpi-tint: rgba(16, 185, 129, .1); }
.erp-kpi.listings { --kpi-color: #C9A227; --kpi-tint: rgba(201, 162, 39, .13); }
.erp-kpi.pending { --kpi-color: #8b5cf6; --kpi-tint: rgba(139, 92, 246, .11); }
.erp-kpi.flagged { --kpi-color: #fb923c; --kpi-tint: rgba(251, 146, 60, .12); }
.erp-kpi.inbox { --kpi-color: #f472b6; --kpi-tint: rgba(244, 114, 182, .11); }

.erp-legend.views i { background: #C9A227; }
.erp-legend.visitors i { background: #2563eb; }
#erpMarketChart > svg { display: block; width: 100%; height: auto; }

.erp-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.erp-chip {
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-color);
  background: #f6f3eb; color: var(--text-muted);
  font-size: .62rem; font-weight: 700; white-space: nowrap;
}
.erp-refs { margin-top: 11px; padding-top: 9px; border-top: 1px dashed var(--border-color); }
.erp-refs small {
  display: block; margin-bottom: 4px; font-size: .57rem; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase; color: var(--text-light);
}
.erp-ref-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 3px 0; font-size: .69rem; color: var(--text-muted);
}
.erp-ref-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-ref-row strong { flex-shrink: 0; font-weight: 800; color: var(--text-main); }
.erp-ref-row strong small { font-weight: 600; color: var(--text-light); }

#erpTrafficOrigins .erp-brand-row,
#erpTopCategories .erp-brand-row { grid-template-columns: minmax(0, 104px) minmax(0, 1fr) auto; }
#erpTrafficOrigins .erp-brand-row span:last-child,
#erpTopCategories .erp-brand-row span:last-child { font-size: .61rem; white-space: nowrap; }

/* ---------- App install counter card ---------- */
.erp-install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.erp-install-tile {
  display: flex; flex-direction: column; gap: 2px;
  padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--border-color); background: #fbf9f4;
}
.erp-install-ico { display: inline-flex; color: #C9A227; }
.erp-install-label {
  font-size: .6rem; font-weight: 800; letter-spacing: .7px;
  text-transform: uppercase; color: var(--text-light);
}
.erp-install-value { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: var(--text-main); }
.erp-install-sub { font-size: .67rem; font-weight: 700; color: var(--text-muted); }
.erp-install-foot { font-size: .61rem; color: var(--text-light); }
.erp-install-total {
  display: flex; align-items: baseline; gap: 8px; margin-top: 10px;
  padding-top: 9px; border-top: 1px dashed var(--border-color);
  font-size: .68rem; color: var(--text-muted);
}
.erp-install-total strong { margin-left: auto; font-size: .95rem; font-weight: 800; color: var(--text-main); }
.erp-install-total small { font-size: .61rem; color: var(--text-light); }
.erp-install-chart { display: flex; align-items: flex-end; justify-content: flex-start; gap: 3px; height: 42px; margin-top: 11px; }
.erp-install-bar { display: flex; flex-direction: column; justify-content: flex-end; flex: 1 1 6px; max-width: 18px; min-width: 2px; height: 100%; }
.erp-install-bar i { display: block; width: 100%; }
.erp-install-bar i.a { background: #34d399; border-radius: 0 0 2px 2px; }
.erp-install-bar i.w { background: #38bdf8; border-radius: 2px 2px 0 0; }
.erp-install-legend { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: .6rem; color: var(--text-light); }
.erp-install-legend span { display: inline-flex; align-items: center; gap: 4px; }
.erp-install-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
.erp-install-legend i.a { background: #34d399; }
.erp-install-legend i.w { background: #38bdf8; }
.erp-install-legend .erp-install-note { margin-left: auto; max-width: 190px; text-align: right; }
.erp-install-empty { margin-top: 10px; font-size: .68rem; color: var(--text-light); }

.erp-msg-list { display: flex; flex-direction: column; }.erp-report-list .erp-activity,
.erp-msg-list .erp-activity { max-height: 320px; overflow-y: auto; scrollbar-width: thin; }

#miniAdsTable th:nth-child(1) { width: 23%; }
#miniAdsTable th:nth-child(2) { width: 18%; }
#miniAdsTable th:nth-child(3) { width: 13%; }
#miniAdsTable th:nth-child(4) { width: 12%; }
#miniAdsTable th:nth-child(5) { width: 13%; }
#miniAdsTable th:nth-child(6) { width: 11%; }
#miniAdsTable th:nth-child(7) { width: 9%; }

@media (max-width: 1350px) {
  #erpTrafficOrigins .erp-brand-row,
  #erpTopCategories .erp-brand-row { grid-template-columns: minmax(0, 96px) minmax(0, 1fr) auto; }
}

#aiGateStatus { line-height: 1.55; }
#aiGateStatus.gate-ok { color: #16a34a; }
#aiGateStatus.gate-bad { color: #dc2626; }

/* ERP responsive */
@media (max-width: 1350px) {
  .erp-dash-row { grid-template-columns: 1fr; }
  .erp-side-stack { display: grid; grid-template-columns: 1fr 1fr; }
  .erp-panel-row { grid-template-columns: 1fr 1fr; }
  .erp-panel-row > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  .erp-kpi-grid { grid-template-columns: 1fr 1fr; }
  .erp-table-row { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .erp-table-row .data-table { min-width: 520px; }
}
@media (max-width: 1024px) {
  #erpView .erp-nav {
    display: flex; flex-direction: row; flex-wrap: nowrap;
    gap: 5px; padding: 8px 12px;
    overflow-x: auto; overflow-y: hidden;
    background: linear-gradient(180deg, #0c1526, #0a1120);
    border-bottom: 1px solid rgba(201, 162, 39, .18);
    -webkit-mask-image: none; mask-image: none;
    scrollbar-width: thin;
  }
  .erp-nav-group { display: contents; }
  .erp-nav-label, .erp-nav-foot { display: none; }
  .erp-nav .erp-tab-btn {
    flex: 0 0 auto; width: auto; white-space: nowrap;
    border-left: none; border-bottom: 2px solid transparent;
    border-radius: 8px 8px 0 0; padding: 9px 11px; font-size: .75rem;
  }
  .erp-nav .erp-tab-btn.active { border-left: none; border-bottom-color: #C9A227; }
  .erp-nav-badge { margin-left: 4px; }
  #erpView .erp-main { padding: 20px 16px 52px; }
  .erp-header-right { justify-content: flex-end; }
}
@media (max-width: 900px) {
  .erp-side-stack { grid-template-columns: 1fr; }
  .erp-panel-row { grid-template-columns: 1fr; }
  .erp-panel-row > :last-child { grid-column: auto; }
}
@media (max-width: 720px) {
  #erpView .erp-header { padding: 12px 14px; gap: 10px; }
  .erp-brand h2 { font-size: 1.03rem; }
  .erp-brand-mark { width: 54px; height: 34px; }
  .erp-system-live, .erp-date-chip { display: none; }
  .erp-admin-chip { border-left: none; padding-left: 0; }
  #erpView .btn-store-switch { padding: 7px 10px; font-size: .7rem; }
  .erp-page-head { align-items: flex-start; }
  .erp-head-actions { width: 100%; }
  .erp-range-wrap { flex: 1; }
  .erp-head-actions .erp-btn { flex: 1; }
  .erp-kpi-grid { grid-template-columns: 1fr; gap: 10px; }
  .erp-kpi-value { font-size: 1.4rem; }
  .erp-quick-grid { grid-template-columns: 1fr 1fr; }
  .erp-chart { overflow-x: auto; scrollbar-width: thin; }
  #erpTrendChart > svg { min-width: 540px; }
  .erp-inv-wrap { align-items: flex-start; }
  .erp-donut { width: 96px; height: 96px; }
  .erp-card { padding: 14px; }
  .erp-page-head h2 { font-size: 1.22rem; }
}

/* ---------- App Management (banners, notifications, inbox) ---------- */
.form-group[hidden] { display: none; }
.appmgr-note { margin: 0 0 12px; color: #64748b; font-size: .85rem; line-height: 1.5; }
.appmgr-slides { display: flex; flex-direction: column; gap: 12px; }
.appmgr-slide {
  border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px; background: #f8fafc;
}
.appmgr-slide-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.appmgr-slide-head strong { font-size: .86rem; color: #0f172a; }
.appmgr-slide-grid { display: grid; grid-template-columns: 190px 1fr; gap: 14px; }
.appmgr-thumb {
  border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #16213a, #0f172a);
  aspect-ratio: 16 / 7.4; display: grid; place-items: center; color: #c9a227; font-size: .74rem;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.appmgr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.appmgr-fields { display: flex; flex-direction: column; gap: 8px; }
.appmgr-fields .form-group { margin: 0; }
.appmgr-fields label { font-size: .72rem; }
.appmgr-fields input, .appmgr-fields select { width: 100%; }
.appmgr-addbar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.appmgr-inbox { display: flex; flex-direction: column; gap: 9px; }
.appmgr-msg { border: 1px solid #e2e8f0; border-radius: 11px; padding: 11px 12px; background: #fff; }
.appmgr-msg.is-new { border-left: 3px solid #c9a227; }
.appmgr-msg-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.appmgr-msg-top strong { font-size: .86rem; color: #0f172a; }
.appmgr-msg-meta { font-size: .72rem; color: #64748b; }
.appmgr-msg p { margin: 6px 0 0; font-size: .82rem; color: #334155; line-height: 1.5; white-space: pre-line; }
.appmgr-msg .appmgr-reply {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #fdf6e3;
  border-left: 3px solid #c9a227; font-size: .78rem; color: #4a3a08; white-space: pre-line;
}
.appmgr-msg-actions { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.appmgr-empty { font-size: .82rem; color: #64748b; padding: 14px 2px; }
@media (max-width: 720px) {
  .appmgr-slide-grid { grid-template-columns: 1fr; }
  .appmgr-thumb { max-width: 260px; }
}
