/* ============================================================
   Construction ERP — Global Stylesheet (Upgraded UI v2)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary:      #7c3aed;
  --primary-dk:   #6d28d9;
  --primary-lt:   #a78bfa;
  --accent:       #06b6d4;
  --accent-lt:    #67e8f9;
  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;
  --info:         #3b82f6;
  --bg-main:      #080d1a;
  --bg-card:      #111827;
  --bg-card2:     #1a2236;
  --bg-sidebar:   #060b16;
  --bg-input:     #0d1424;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(124,58,237,0.4);
  --text-primary: #f0f6ff;
  --text-muted:   #8899b4;
  --radius:       14px;
  --radius-sm:    9px;
  --radius-lg:    20px;
  --shadow:       0 4px 28px rgba(0,0,0,0.5);
  --shadow-glow:  0 0 40px rgba(124,58,237,0.12);
  --sidebar-w:    265px;
  --transition:   0.22s cubic-bezier(.4,0,.2,1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.5); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── LAYOUT ── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  overflow-y: auto;
  z-index: 1000;
  transition: transform var(--transition);
  box-shadow: 4px 0 30px rgba(0,0,0,0.4);
}

.sidebar-brand {
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(124,58,237,0.08) 0%, transparent 100%);
}
.sidebar-brand .brand-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 12px;
  box-shadow: 0 6px 20px rgba(124,58,237,0.4);
}
.sidebar-brand h6 {
  font-size: 14px; font-weight: 800; color: var(--text-primary);
  line-height: 1.2; letter-spacing: -0.3px;
}
.sidebar-brand small { font-size: 11px; color: var(--text-muted); }

.sidebar-section-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: 1.8px;
  color: rgba(136,153,180,0.6); text-transform: uppercase;
  padding: 18px 18px 5px;
}

.nav-item-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 0;
  transition: all var(--transition);
  font-size: 13px; font-weight: 500;
  position: relative;
  margin: 1px 8px;
  border-radius: var(--radius-sm);
}
.nav-item-link i {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  flex-shrink: 0;
  transition: all var(--transition);
}
.nav-item-link:hover {
  color: var(--text-primary);
  background: rgba(124,58,237,0.1);
}
.nav-item-link:hover i {
  background: rgba(124,58,237,0.2);
  color: var(--primary-lt);
}
.nav-item-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(6,182,212,0.1));
  border: 1px solid rgba(124,58,237,0.2);
}
.nav-item-link.active i {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 3px 10px rgba(124,58,237,0.4);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  margin-top: auto;
  background: rgba(255,255,255,0.02);
}
.sidebar-footer .user-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(124,58,237,0.35);
}
.sidebar-footer .user-info { overflow: hidden; }
.sidebar-footer .user-name { font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .user-role { font-size: 11px; color: var(--text-muted); }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: radial-gradient(ellipse at 0% 0%, rgba(124,58,237,0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 100% 100%, rgba(6,182,212,0.04) 0%, transparent 50%),
              var(--bg-main);
}

/* ── TOPBAR ── */
.topbar {
  background: rgba(17,24,39,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 11px 28px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.topbar-title {
  font-size: 16px; font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary), var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--text-muted); width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; position: relative;
}
.topbar-btn:hover {
  border-color: var(--primary);
  color: var(--primary-lt);
  background: rgba(124,58,237,0.12);
  transform: translateY(-1px);
}
.alert-badge {
  position: absolute; top: -5px; right: -5px;
  background: linear-gradient(135deg, var(--danger), #c0392b);
  color: #fff;
  font-size: 9px; font-weight: 800;
  width: 17px; height: 17px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--bg-sidebar);
}

/* ── PAGE CONTENT ── */
.page-content { padding: 28px; flex: 1; }
.page-header { margin-bottom: 26px; }
.page-header h1 {
  font-size: 24px; font-weight: 800;
  display: flex; align-items: center; gap: 10px;
}
.page-header p { color: var(--text-muted); font-size: 13px; margin-top: 5px; }

/* ── CARDS ── */
.card-erp {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
  margin-bottom: 20px;
}
.card-erp:hover { border-color: rgba(124,58,237,0.15); }
.card-erp .card-title {
  font-size: 14px; font-weight: 700; margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-erp .card-title i { color: var(--primary-lt); }

/* ── KPI CARDS ── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), var(--shadow-glow);
  border-color: rgba(124,58,237,0.2);
}
.kpi-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--kpi-color, var(--primary));
  opacity: 0.9;
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--kpi-color, var(--primary));
  opacity: 0.04;
}
.kpi-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--kpi-color, var(--primary));
  margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(0,0,0,0.2), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.06);
  position: relative; z-index: 1;
}
.kpi-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.7px; font-weight: 700; position: relative; z-index: 1; }
.kpi-value { font-size: 22px; font-weight: 900; margin: 5px 0 3px; position: relative; z-index: 1; letter-spacing: -0.5px; }
.kpi-sub   { font-size: 11px; color: var(--text-muted); position: relative; z-index: 1; }

/* ── TABLES ── */
.table-erp { width: 100%; border-collapse: collapse; }
.table-erp thead tr {
  border-bottom: 2px solid var(--border);
  background: rgba(124,58,237,0.04);
}
.table-erp th {
  padding: 11px 14px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-muted); text-align: left;
}
.table-erp td {
  padding: 12px 14px; font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  vertical-align: middle;
}
.table-erp tbody tr {
  transition: background var(--transition);
}
.table-erp tbody tr:hover {
  background: rgba(124,58,237,0.04);
}
.table-erp .action-btns { display: flex; gap: 6px; }

/* ── FORMS ── */
.form-erp .form-label {
  font-size: 11.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 7px; display: block;
}
.form-erp .form-control,
.form-erp .form-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 13px;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-erp .form-control:focus,
.form-erp .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.18);
  background: rgba(124,58,237,0.04);
}
.form-erp .form-control::placeholder { color: rgba(136,153,180,0.5); }
.form-erp textarea.form-control { resize: vertical; min-height: 80px; }
.form-group { margin-bottom: 16px; }

/* ── BUTTONS ── */
.btn-erp {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700; cursor: pointer;
  border: none; transition: all var(--transition);
  text-decoration: none; letter-spacing: 0.1px;
}
.btn-primary-erp {
  background: linear-gradient(135deg, var(--primary), var(--primary-dk));
  color: #fff;
  box-shadow: 0 4px 14px rgba(124,58,237,0.35);
}
.btn-primary-erp:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.5);
  color: #fff;
}
.btn-success-erp { background: var(--success); color: #fff; box-shadow: 0 3px 12px rgba(16,185,129,0.3); }
.btn-success-erp:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-danger-erp  { background: var(--danger); color: #fff; box-shadow: 0 3px 12px rgba(239,68,68,0.3); }
.btn-danger-erp:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-warning-erp { background: var(--warning); color: #000; }
.btn-warning-erp:hover { filter: brightness(0.95); }
.btn-outline-erp {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline-erp:hover {
  border-color: var(--primary);
  color: var(--primary-lt);
  background: rgba(124,58,237,0.08);
}
.btn-sm-erp { padding: 5px 11px; font-size: 12px; }
.btn-icon-erp {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}

/* ── MODALS ── */
.modal-erp {
  display: none; position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
}
.modal-erp.show { display: flex; }
.modal-erp-box {
  background: var(--bg-card2);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  padding: 30px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.7), 0 0 60px rgba(124,58,237,0.08);
  animation: slideUp 0.28s cubic-bezier(.34,1.56,.64,1);
}
.modal-erp-box.wide { max-width: 860px; }
@keyframes slideUp {
  from { transform: translateY(40px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1);    opacity: 1; }
}
.modal-header-erp {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header-erp h5 { font-size: 16px; font-weight: 800; }
.modal-close {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 18px; line-height: 1;
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { color: var(--danger); border-color: var(--danger); background: rgba(239,68,68,0.1); }
.modal-footer-erp { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }

/* ── TOASTS ── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 99999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast-erp {
  min-width: 300px; padding: 14px 18px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  display: flex; align-items: center; gap: 12px;
  animation: slideIn 0.3s cubic-bezier(.34,1.56,.64,1);
  font-size: 13px; color: var(--text-primary);
  backdrop-filter: blur(10px);
}
.toast-erp.success { border-color: var(--success); }
.toast-erp.error   { border-color: var(--danger); }
.toast-erp.warning { border-color: var(--warning); }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(120%); opacity: 0; } }

/* ── BADGES ── */
.badge-erp {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 100px; font-size: 11px; font-weight: 700;
  text-transform: capitalize; letter-spacing: 0.2px;
}
.badge-success { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.badge-warning { background: rgba(245,158,11,0.12); color: #fbbf24; border: 1px solid rgba(245,158,11,0.2); }
.badge-danger  { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.badge-info    { background: rgba(59,130,246,0.12);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.2); }
.badge-primary { background: rgba(124,58,237,0.12);  color: var(--primary-lt); border: 1px solid rgba(124,58,237,0.2); }
.badge-muted   { background: rgba(148,163,184,0.08);  color: var(--text-muted); border: 1px solid rgba(148,163,184,0.1); }

/* ── TABS ── */
.tab-nav { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab-btn {
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); border: none; background: none;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: all var(--transition); margin-bottom: -1px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn.active {
  color: var(--primary-lt);
  border-color: var(--primary);
  background: rgba(124,58,237,0.06);
}
.tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── FILTERS BAR ── */
.filters-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
  margin-bottom: 20px;
}
.filter-group { display: flex; flex-direction: column; gap: 5px; }
.filter-group label { font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.7px; }
.filter-group input,
.filter-group select {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: 8px 12px; font-size: 13px; min-width: 140px;
  transition: border-color var(--transition);
}
.filter-group input:focus,
.filter-group select:focus { outline: none; border-color: var(--primary); }

/* ── CHARTS ── */
.chart-wrap { position: relative; height: 280px; }

/* ── STATUS INDICATORS ── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot-success { background: var(--success); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.dot-warning { background: var(--warning); box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.dot-danger  { background: var(--danger); box-shadow: 0 0 6px rgba(239,68,68,0.5); }
.dot-info    { background: var(--info); box-shadow: 0 0 6px rgba(59,130,246,0.5); }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state i  { font-size: 48px; margin-bottom: 16px; opacity: 0.2; display: block; }
.empty-state h6 { font-size: 15px; color: var(--text-primary); margin-bottom: 6px; font-weight: 700; }
.empty-state p  { font-size: 13px; }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(124,58,237,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 15%, rgba(6,182,212,0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 90%, rgba(124,58,237,0.08) 0%, transparent 40%),
    var(--bg-main);
  position: relative;
}

/* grid lines background */
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124,58,237,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

.login-card {
  width: 100%; max-width: 430px;
  background: rgba(17,24,39,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 24px;
  padding: 46px 42px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.6), 0 0 80px rgba(124,58,237,0.1);
  position: relative; z-index: 1;
  animation: fadeUp 0.5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes fadeUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.login-logo {
  width: 62px; height: 62px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; margin: 0 auto 24px;
  box-shadow: 0 10px 30px rgba(124,58,237,0.5), 0 0 0 6px rgba(124,58,237,0.1);
}
.login-card h1 {
  font-size: 24px; font-weight: 900; text-align: center; margin-bottom: 5px;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,0.7));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-card > p { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 32px; }
.login-input-wrap { position: relative; }
.login-input-wrap i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 14px;
  transition: color var(--transition);
}
.login-input-wrap input {
  padding-left: 42px; width: 100%; height: 50px;
  background: rgba(13,20,36,0.8); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 14px; font-family: 'Inter', sans-serif;
  transition: all var(--transition);
}
.login-input-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.15);
  background: rgba(124,58,237,0.05);
}
.login-input-wrap input:focus + i,
.login-input-wrap:focus-within i { color: var(--primary-lt); }

.btn-login {
  width: 100%; height: 50px;
  background: linear-gradient(135deg, var(--primary) 0%, #5b21b6 50%, var(--accent) 100%);
  background-size: 200%;
  background-position: 0%;
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-size: 15px; font-weight: 800; font-family: 'Inter', sans-serif;
  cursor: pointer; transition: all var(--transition);
  margin-top: 10px;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 25px rgba(124,58,237,0.4);
}
.btn-login:hover {
  background-position: 100%;
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(124,58,237,0.55);
}
.btn-login:active { transform: translateY(0); }

.login-error {
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25);
  color: #f87171; border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 13px; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
  animation: fadeUp 0.3s ease;
}

/* ── REPORT SUMMARY TABLE ── */
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table th { background: rgba(124,58,237,0.08); padding: 10px 14px; font-size: 11px; font-weight: 700; text-align: left; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.summary-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.summary-table tr:last-child td { border-bottom: none; }
.summary-table .total-row { background: rgba(124,58,237,0.06); font-weight: 700; }
.text-success-erp { color: #34d399 !important; }
.text-danger-erp  { color: #f87171 !important; }
.text-warning-erp { color: #fbbf24 !important; }

/* ── PROGRESS ── */
.progress-erp {
  height: 6px; background: rgba(255,255,255,0.06);
  border-radius: 100px; overflow: hidden;
}
.progress-erp-bar {
  height: 100%; border-radius: 100px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.7s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 8px rgba(124,58,237,0.5);
}

/* ── GRID HELPERS ── */
.row { display: flex; flex-wrap: wrap; margin: 0 -8px; }
.row.g-3 > * { padding: 0 8px; margin-bottom: 16px; }
.col-md-4 { width: 33.333%; }
.col-md-5 { width: 41.666%; }
.col-md-6 { width: 50%; }
.col-md-7 { width: 58.333%; }
.col-12   { width: 100%; }
@media(max-width:768px) { .col-md-4,.col-md-5,.col-md-6,.col-md-7 { width: 100%; } }
.ms-auto { margin-left: auto; }
.d-flex   { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.mb-4 { margin-bottom: 24px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
  .modal-erp-box { margin: 16px; padding: 22px; }
  .login-card { margin: 16px; padding: 32px 24px; }
}

/* ── PRINT ── */
@media print {
  .sidebar, .topbar, .btn-erp, .filters-bar, #toast-container { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body, .card-erp { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .table-erp th, .table-erp td { color: #000 !important; border-color: #ddd !important; }
  .badge-erp { border: 1px solid #ddd !important; background: transparent !important; color: #000 !important; }
}

/* ── MISC UTILITY ── */
code { background: rgba(124,58,237,0.1); border: 1px solid rgba(124,58,237,0.15); color: var(--primary-lt); padding: 2px 7px; border-radius: 5px; font-size: 12px; }
