/* ============================================================
   Wholesale ERP — theme
   Deep-navy sidebar, amber accent, soft elevated surfaces.
   Mobile-first: offcanvas menu + bottom app bar for delivery.
   ============================================================ */
:root {
  --erp-navy: #14263c;
  --erp-navy-2: #1d3653;
  --erp-navy-deep: #0c1826;
  --erp-accent: #f0a04b;
  --erp-accent-soft: #fdf3e7;
  --erp-bg: #eef1f6;
  --erp-card-border: #e6eaf0;
  --erp-text: #22303e;
  --erp-muted: #77839a;
  --erp-radius: 14px;
  --erp-shadow: 0 1px 2px rgba(20, 38, 60, .05), 0 4px 14px rgba(20, 38, 60, .06);
}

html { -webkit-tap-highlight-color: transparent; }
body.erp-body, body.login-body {
  background: var(--erp-bg);
  color: var(--erp-text);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
h1, h2, h3, h4, h5, h6, .fw-semibold, .fw-bold { letter-spacing: -.01em; }

/* ---------- topbar ---------- */
.erp-topbar {
  background: linear-gradient(90deg, var(--erp-navy-deep) 0%, var(--erp-navy) 55%, var(--erp-navy-2) 100%);
  min-height: 58px;
  box-shadow: 0 2px 10px rgba(12, 24, 38, .25);
}
.erp-topbar .navbar-brand { letter-spacing: -.01em; }
.erp-topbar .navbar-brand i { color: var(--erp-accent); }
.erp-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--erp-accent); color: var(--erp-navy-deep);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
}

/* ---------- shell + sidebar ---------- */
.erp-shell { display: flex; min-height: calc(100vh - 58px); }
.erp-sidebar {
  width: 248px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--erp-navy) 0%, var(--erp-navy-deep) 100%);
  border-right: 0;
}
@media (max-width: 991.98px) { .erp-sidebar { width: 280px; } }
.erp-sidebar .offcanvas-header { color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.erp-sidebar .offcanvas-header .btn-close { filter: invert(1) grayscale(1); }
.erp-sidebar .nav { padding-bottom: 1.5rem; }
.erp-sidebar .nav-link {
  color: #b9c4d4; padding: .6rem 1.15rem; margin: .05rem .55rem;
  border-radius: 9px; border-left: 0; font-size: .93rem;
  display: flex; align-items: center; transition: background .15s, color .15s;
}
.erp-sidebar .nav-link i { width: 1.55rem; font-size: 1.02rem; opacity: .85; }
.erp-sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.erp-sidebar .nav-link.active {
  color: var(--erp-navy-deep); background: var(--erp-accent);
  font-weight: 600; box-shadow: 0 3px 10px rgba(240,160,75,.35);
}
.erp-sidebar .nav-link.active i { opacity: 1; }
.erp-nav-heading {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .12em;
  color: #6e7f96; padding: 1rem 1.35rem .3rem; font-weight: 700;
}

/* ---------- main area ---------- */
.erp-main { flex: 1; padding: 1.4rem 1.6rem 2.5rem; min-width: 0; }
@media (max-width: 991.98px) { .erp-main { padding: 1rem .85rem 5.5rem; } }
.erp-main h1 { color: var(--erp-navy); }

/* ---------- cards ---------- */
.card {
  border: 1px solid var(--erp-card-border);
  border-radius: var(--erp-radius);
  box-shadow: var(--erp-shadow);
}
.card-header {
  background: #fff; border-bottom: 1px solid var(--erp-card-border);
  border-radius: var(--erp-radius) var(--erp-radius) 0 0 !important;
  font-size: .92rem; color: var(--erp-navy);
}
a.card { transition: transform .12s, box-shadow .12s; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(20,38,60,.12); }

.stat-card { border-top: 0; position: relative; overflow: hidden; }
.stat-card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(180deg, var(--erp-accent), #e07b39);
  border-radius: 4px 0 0 4px;
}
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--erp-muted); font-weight: 600; }
.stat-value { font-size: 1.35rem; font-weight: 800; margin-top: .1rem; color: var(--erp-navy); }

/* ---------- tables ---------- */
.table { --bs-table-hover-bg: #f6f8fb; margin-bottom: 0; }
.table thead th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--erp-muted); font-weight: 700;
  background: #f8fafc !important; border-bottom: 1px solid var(--erp-card-border);
  white-space: nowrap;
}
.table td { vertical-align: middle; }
.table-responsive { border-radius: 0 0 var(--erp-radius) var(--erp-radius); }
.card > .table-responsive:first-child { border-radius: var(--erp-radius); }
@media (max-width: 767.98px) {
  .table { font-size: .875rem; }
  .table td, .table th { padding: .5rem .6rem; }
}

/* ---------- badges & buttons ---------- */
.badge { border-radius: 20rem; padding: .38em .72em; font-weight: 600; letter-spacing: .01em; }
.btn { border-radius: 10px; font-weight: 600; }
.btn-sm { border-radius: 8px; }
.btn-primary { background: var(--erp-navy); border-color: var(--erp-navy); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background: var(--erp-navy-deep) !important; border-color: var(--erp-navy-deep) !important;
}
.btn-outline-primary { color: var(--erp-navy); border-color: #c3cdda; }
.btn-outline-primary:hover { background: var(--erp-navy); border-color: var(--erp-navy); }
.btn-success { background: #1f8a4c; border-color: #1f8a4c; }
.btn-success:hover { background: #16693a; border-color: #16693a; }

/* ---------- forms ---------- */
.form-control, .form-select {
  border-radius: 10px; border-color: #d5dce6; padding: .5rem .8rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--erp-accent);
  box-shadow: 0 0 0 .2rem rgba(240,160,75,.18);
}
.form-label { font-size: .82rem; font-weight: 600; color: #4a586b; margin-bottom: .3rem; }
.form-control-lg, .form-select-lg { border-radius: 12px; }
.input-group-text { border-radius: 10px; }

/* ---------- alerts ---------- */
.alert { border: 0; border-radius: 12px; box-shadow: var(--erp-shadow); }
.alert-success { background: #e7f6ed; color: #14602f; }
.alert-danger  { background: #fdecec; color: #8f1f24; }
.alert-warning { background: #fff6e3; color: #7a5410; }

/* ---------- login ---------- */
.login-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(240,160,75,.22), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, rgba(240,160,75,.12), transparent 55%),
    linear-gradient(160deg, var(--erp-navy) 0%, var(--erp-navy-deep) 100%);
  padding: 1rem;
}
.login-card { width: 100%; max-width: 410px; border: 0; border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.login-logo {
  color: var(--erp-accent);
  background: var(--erp-accent-soft);
  width: 72px; height: 72px; border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem;
}

/* ---------- delivery bottom app bar (mobile) ---------- */
.erp-bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030;
  background: #fff; border-top: 1px solid var(--erp-card-border);
  display: flex; justify-content: space-around;
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(20,38,60,.08);
}
.erp-bottomnav a {
  flex: 1; text-align: center; text-decoration: none;
  color: var(--erp-muted); font-size: .62rem; font-weight: 600;
  padding: .2rem 0; border-radius: 10px;
}
.erp-bottomnav a i { display: block; font-size: 1.25rem; margin-bottom: .1rem; }
.erp-bottomnav a.active { color: var(--erp-navy); }
.erp-bottomnav a.active i { color: var(--erp-accent); }
@media (min-width: 992px) { .erp-bottomnav { display: none; } }

/* ---------- misc ---------- */
::selection { background: rgba(240,160,75,.35); }
@media (max-width: 575.98px) {
  .btn:not(.btn-sm) { min-height: 44px; }
  .form-control, .form-select { min-height: 44px; }
  .form-control-sm, .form-select-sm, .btn-sm { min-height: 36px; }
  h1.h4 { font-size: 1.15rem; }
}
/* horizontal scroll hint shadows on tables (mobile) */
@media (max-width: 767.98px) {
  .table-responsive {
    background:
      linear-gradient(90deg, #fff 30%, rgba(255,255,255,0)) left / 24px 100% no-repeat local,
      linear-gradient(270deg, #fff 30%, rgba(255,255,255,0)) right / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(20,38,60,.14), transparent) left / 10px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(20,38,60,.14), transparent) right / 10px 100% no-repeat scroll;
  }
}
@media print {
  .erp-sidebar, .erp-topbar, .erp-bottomnav, .d-print-none { display: none !important; }
  .erp-main { padding: 0 !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  body.erp-body { background: #fff; }
}
