/* OxyPC Inventory — Main Stylesheet */

:root {
  --sidebar-width: 240px;
  --sidebar-bg: #1e2a3a;
  --sidebar-text: #b8c5d6;
  --sidebar-active: #1a56db;
  --brand-blue: #1a56db;
  --topbar-height: 56px;
}

/* Layout */
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f0f4f8; }
#wrapper { align-items: flex-start; }

#sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--sidebar-bg);
  transition: width 0.25s ease;
  flex-shrink: 0;
}

#sidebar.collapsed { width: 0; }

.sidebar-brand {
  background: rgba(0,0,0,0.2);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
  min-height: var(--topbar-height);
}

#sidebar .nav-link {
  color: var(--sidebar-text);
  font-size: 0.875rem;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

#sidebar .nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
#sidebar .nav-link.active { background: var(--brand-blue); color: #fff; }

.nav-section {
  color: #576d87;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.75rem 0.75rem 0.25rem;
  list-style: none;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.15);
  background: var(--brand-blue);
  color: #fff;
}
.sidebar-footer small { color: rgba(255,255,255,0.85) !important; }

/* Topbar */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  height: var(--topbar-height);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Cards */
.stat-card { border-radius: 10px; }
.stat-icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }

/* Stage pipeline */
.stage-pill { min-width: 90px; }

/* Tables */
.table th { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.table td { vertical-align: middle; }
.table-success-subtle { background: rgba(25,135,84,0.05); }
.table-danger-subtle { background: rgba(220,53,69,0.05); }

/* Badges */
.bg-purple { background-color: #6f42c1 !important; }
.bg-pink { background-color: #d63384 !important; }

/* Barcode fields */
.barcode-field {
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  border: 2px solid #dee2e6;
  transition: border-color 0.15s;
}
.barcode-field:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 0.25rem rgba(26, 86, 219, 0.15);
}

/* Clickable KPI cards */
.card-hover { transition: transform 0.15s, box-shadow 0.15s; cursor: pointer; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.1) !important; }

/* P&L colors */
.profit-positive { color: #0f9e4e; font-weight: 600; }
.profit-negative { color: #d63031; font-weight: 600; }
.profit-zero { color: #888; }

/* Form labels */
.form-label { font-size: 0.875rem; }

/* DataTables override */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
}
.dataTables_wrapper .dataTables_length select {
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.2rem 0.4rem;
}

/* Responsive */
@media (max-width: 768px) {
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    height: 100vh !important;
    width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.25s ease;
  }
  #sidebar.show { width: var(--sidebar-width); }

  #sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1039;
  }
  #sidebar-overlay.show { display: block; }
}

/* Alert auto-dismiss animation */
.alert { animation: slideIn 0.3s ease; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Global disabled-button styling (applies app-wide) ───────────────────── */
.btn:disabled,
.btn.disabled,
.btn[disabled],
button:disabled,
button[disabled],
fieldset:disabled .btn {
  background-color: #D8D8D8 !important;
  border-color: #D8D8D8 !important;
  color: #212529 !important;
  opacity: 1 !important;
}
