/* ============================================================
   MORETECH ERP — CORE UI FRAMEWORK
   File: erp_core.css
   Version: v2026.6
   Scope: Global / Shared / Enterprise Core
============================================================ */

/* ------------------------------------------------------------
   ROOT VARIABLES (Design Tokens)
------------------------------------------------------------ */
:root {
    --erp-border: #e2e2e2;
    --erp-border-light: #e9e9e9;

    --erp-text-dark: #222;
    --erp-text-medium: #555;
    --erp-text-light: #777;

    --erp-bg-white: #ffffff;
    --erp-bg-app: #f4f6f8;

    --erp-radius: 12px;
    --erp-radius-sm: 6px;

    --erp-shadow: 0 2px 8px rgba(0,0,0,0.07);
    --erp-shadow-hover: 0 4px 14px rgba(0,0,0,0.08);

    --erp-transition: 0.25s ease;
}

/* =========================================================
   GLOBAL BASE STYLES & TYPOGRAPHY (ERP CORE)
   Single Source of Truth
========================================================= */

/* =========================================================
   GLOBAL BASE STYLES & TYPOGRAPHY (ERP CORE)
========================================================= */

body {
    background: var(--erp-bg-app);
    color: var(--erp-text-dark);

    font-family: 'Source Sans 3', system-ui, -apple-system,
                 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    font-weight: 400;
    line-height: 1.35;       /* 👈 tighter for dashboards */
    letter-spacing: 0;      /* 👈 ERP style */

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
.erp-page-title,
.chart-title,
.kpi-card h5 {
    font-weight: 600;
}

/* ------------------------------------------------------------
   ERP PAGE HEADER (Generic – Not Sticky)
------------------------------------------------------------ */
.erp-header {
    background: var(--erp-bg-white);
    padding: 14px 22px;
    box-shadow: var(--erp-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.erp-header .logo-area {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.erp-header .logo-area h4 {
    margin: 0;
}

.erp-header .module-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--erp-text-dark);
}

.erp-header .action-buttons .btn {
    margin-left: 6px;
}

/* ------------------------------------------------------------
   PAGE BODY WRAPPER
------------------------------------------------------------ */
.erp-body {
    padding: 28px 36px;
}

/* ------------------------------------------------------------
   KPI CARDS (Unified System-wide)
------------------------------------------------------------ */
.kpi-card {
    position: relative;
    background: var(--erp-bg-white);
    border-radius: var(--erp-radius);
    border: 1px solid var(--erp-border);
    min-height: 150px;
    padding: 20px 22px;
    overflow: hidden;
    transition: var(--erp-transition);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--erp-shadow-hover);
}

.kpi-card h5 {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--erp-text-medium);
    margin-bottom: 8px;
}

.kpi-card h3 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--erp-text-dark);
    margin-bottom: 10px;
}

/* KPI icon background */
.kpi-icon {
    position: absolute;
    right: 15px;
    bottom: 10px;
    font-size: 38px;
    opacity: 0.06;
    color: #000;
}

/* Low stock / compact lists */
.low-stock-list {
    max-height: 80px;
    overflow: hidden;
}

.low-stock-list div {
    font-size: 0.78rem;
    padding: 1px 0;
}

.low-stock-list .badge {
    font-size: 0.70rem;
    padding: 3px 6px;
}

/* ------------------------------------------------------------
   FILTER BAR (ERP Standard)
------------------------------------------------------------ */
.filter-bar {
    background: var(--erp-bg-white);
    padding: 18px 25px;
    border-radius: var(--erp-radius);
    border: 1px solid var(--erp-border-light);
    margin-bottom: 25px;
}

.filter-bar label,
.filter-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #444;
    margin-bottom: 4px;
}

.filter-btn {
    height: 40px;
    font-size: 0.9rem;
}

/* ------------------------------------------------------------
   SELECT2 — ERP THEME (Scoped)
------------------------------------------------------------ */
.erp-body .select2-container--default .select2-selection--single {
    height: 40px !important;
    border-radius: var(--erp-radius-sm);
    border: 1px solid #d0d0d0;
    padding-top: 4px;
}

.erp-body
.select2-container--default
.select2-selection--single
.select2-selection__rendered {
    line-height: 36px !important;
}

.erp-body
.select2-container--default
.select2-selection--single
.select2-selection__arrow b {
    margin-top: 4px;
}
/* =========================================================
   ERP Global Link Reset
========================================================= */

a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}
/* ======================================================
   ERP FOOTER – Standalone (Dell Blue Glass)
====================================================== */

.erp-footer {
  margin-top: 40px;
  padding: 14px 0;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,0.06);
  font-size: 13px;
  color: #333;
}

.erp-footer a {
  color: #0d6efd;
  font-weight: 600;
  text-decoration: none;
}

.erp-footer a:hover {
  text-decoration: underline;
}

.erp-footer-brand {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.erp-footer-version {
  background: rgba(13,110,253,0.08);
  color: #0d6efd;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
}

.erp-footer-tagline {
  color: #6c757d;
  font-weight: 500;
}

/* ===== STATUS CHIPS ===== */

.erp-footer-status {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.erp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.erp-chip-primary {
  background: rgba(13,110,253,0.1);
  color: #0d6efd;
}

.erp-chip-info {
  background: rgba(13,202,240,0.15);
  color: #055160;
}

.erp-chip-warning {
  background: rgba(255,193,7,0.2);
  color: #664d03;
}

.erp-chip-danger {
  background: rgba(220,53,69,0.15);
  color: #842029;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .erp-footer-status {
    justify-content: center;
  }
  .erp-footer-brand {
    justify-content: center;
  }
}
