/* ============================================================
   Infinity Elite Trade ERP — Custom Theme
   Primary: #1F4E79 (deep navy) | Accent: #2E75B6 (blue)
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --erp-primary:      #1F4E79;
  --erp-accent:       #2E75B6;
  --erp-accent-light: #D6E4F0;
  --erp-sidebar-w:    240px;
  --erp-navbar-h:     56px;
  --erp-text-light:   #f8f9fa;
  --erp-border:       #dee2e6;
}

/* ── Base ──────────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  background: #f4f6f9;
  color: #333;
}

/* ── Navbar ────────────────────────────────────────────────── */
.erp-navbar {
  background: var(--erp-primary);
  height: var(--erp-navbar-h);
  z-index: 1050;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.erp-navbar .navbar-brand { font-size: 1rem; letter-spacing: .5px; }

/* ── Sidebar ───────────────────────────────────────────────── */
.erp-sidebar {
  position: fixed;
  top: var(--erp-navbar-h);
  left: 0;
  width: var(--erp-sidebar-w);
  height: calc(100vh - var(--erp-navbar-h));
  background: var(--erp-primary);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .25s ease, transform .25s ease;
  z-index: 1040;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
}
.erp-sidebar.collapsed { width: 0; transform: translateX(-240px); }

/* Sidebar links — adapted from siamon123 pattern */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-size: 13.5px;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover  { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-link.active { background: var(--erp-accent); color: #fff; border-left-color: #fff; }
.sidebar-link i      { width: 18px; text-align: center; font-size: 14px; }

.sidebar-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.4);
  padding: 8px 20px 4px;
}
.sidebar-divider {
  border-top: 1px solid rgba(255,255,255,.1);
  margin: 6px 0;
}
.sidebar-header { background: rgba(0,0,0,.15); }

/* ── Main content ──────────────────────────────────────────── */
.erp-content {
  margin-top: var(--erp-navbar-h);
  margin-left: var(--erp-sidebar-w);
  min-height: calc(100vh - var(--erp-navbar-h));
  transition: margin-left .25s ease;
}
.erp-content.expanded { margin-left: 0; }

/* ── Cards ─────────────────────────────────────────────────── */
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.1); border-radius: 8px; }
.card-header {
  background: var(--erp-accent);
  color: #fff;
  font-weight: 600;
  border-radius: 8px 8px 0 0 !important;
  padding: .6rem 1rem;
}
.card-header .fa { margin-right: 6px; }

/* ── KPI Cards (Dashboard) ─────────────────────────────────── */
.kpi-card { border-radius: 10px; overflow: hidden; }
.kpi-card .kpi-icon {
  font-size: 2.2rem;
  opacity: .25;
  position: absolute;
  right: 16px;
  bottom: 12px;
}
.kpi-card.bg-primary { background: var(--erp-accent) !important; }
.kpi-card.bg-dark    { background: var(--erp-primary) !important; }

/* ── Tables ────────────────────────────────────────────────── */
.table thead th {
  background: var(--erp-primary);
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  border-bottom: none;
}
.table tbody tr:hover { background: var(--erp-accent-light); }
.table td, .table th  { vertical-align: middle; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn-primary   { background: var(--erp-accent); border-color: var(--erp-accent); }
.btn-primary:hover { background: var(--erp-primary); border-color: var(--erp-primary); }

/* ── Login page ────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--erp-primary) 0%, var(--erp-accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
}
.login-card .card-header {
  background: var(--erp-primary);
  border-radius: 12px 12px 0 0 !important;
  text-align: center;
  padding: 1.5rem;
}
.login-logo { font-size: 2rem; color: #fff; margin-bottom: .4rem; }

/* ── Badges ────────────────────────────────────────────────── */
.badge-active   { background: #198754; }
.badge-inactive { background: #6c757d; }

/* ── Product image thumbnails ──────────────────────────────── */
.product-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  background: #f8f9fa;
  cursor: zoom-in;
  transition: transform .12s ease, box-shadow .12s ease;
}
.product-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.product-thumb-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px dashed #ced4da;
  background: #f1f3f5;
  color: #adb5bd;
  cursor: default;               /* not clickable — no image */
}
/* Enlarged preview inside the lightbox modal */
.image-preview-full {
  max-width: min(500px, 100%);
  max-height: 500px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ── Search module ─────────────────────────────────────────── */
.search-filters .form-label { font-size: 12px; font-weight: 600; color: #555; }
#searchResults { min-height: 200px; }
#searchSpinner { display: none; }
.result-table th { font-size: 12px; }

/* ── Print styles ──────────────────────────────────────────── */
@media print {
  .erp-navbar, .erp-sidebar, .btn, .pagination, .no-print { display: none !important; }
  .erp-content { margin: 0 !important; }
  .table thead th { background: #333 !important; color: #fff !important; }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .erp-sidebar            { transform: translateX(-240px); }
  .erp-sidebar.mobile-open{ transform: translateX(0); }
  .erp-content            { margin-left: 0; }
}
