/* Parabilis Tech — brand styling. Loaded after Bootstrap so vars override. */
:root {
  --brand-primary: #4A90D9;
  --brand-primary-hover: #3A7BC0;
  --brand-dark: #1B2B47;
  --brand-bg: #F5F7FA;
  --brand-border: #E2E8F0;
  --bs-primary: #4A90D9;
  --bs-primary-rgb: 74, 144, 217;
  --bs-link-color: #4A90D9;
  --bs-link-hover-color: #3A7BC0;
}

html, body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
}

body {
  background: var(--brand-bg);
  color: #2c3e50;
}

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background-color: var(--brand-primary-hover) !important;
  border-color: var(--brand-primary-hover) !important;
}
.btn-outline-primary {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-outline-primary:hover {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

a { color: var(--brand-primary); }
a:hover { color: var(--brand-primary-hover); }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.card > .card-body { padding: 16px; }
.card > .card-header {
  background: #fff;
  border-bottom: 1px solid var(--brand-border);
  font-weight: 600;
  color: var(--brand-dark);
}

/* Section gaps — any .card or .mb-section gets a breathing room below */
.section-gap { margin-bottom: 24px; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  min-height: 100vh;
  background: var(--brand-dark);
  color: #c9d1d9;
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar .brand-header {
  padding: 1rem 1rem;
  border-bottom: 1px solid #2d3f55;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .brand-header img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}
.sidebar .brand-header .brand-text {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.1;
}
.sidebar .brand-header .brand-text small {
  display: block;
  font-weight: 400;
  color: #7a90ac;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar .nav-group {
  margin-top: 0.25rem;
}
.sidebar .nav-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem 0.35rem;
  background: none;
  border: none;
  color: #7a90ac;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.sidebar .nav-group-header:hover { color: #c9d1d9; }
.sidebar .nav-group-header .chevron {
  transition: transform 0.15s ease;
  font-size: 0.8rem;
}
.sidebar .nav-group.collapsed .chevron { transform: rotate(-90deg); }
.sidebar .nav-group.collapsed .nav-group-body { display: none; }

.sidebar .nav-link {
  color: #9aacbd;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  margin: 2px 10px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
}
.sidebar .nav-link i { width: 18px; }
.sidebar .nav-link:hover {
  background: #2d3f55;
  color: #fff;
}
.sidebar .nav-link.active {
  background: var(--brand-primary);
  color: #fff;
  font-weight: 500;
}

.sidebar .role-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  background: #2d3f55;
  color: #9aacbd;
}

/* ── Topbar ──────────────────────────────────────────────────────────── */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--brand-border);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.topbar .page-title {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--brand-dark);
  flex: 1;
  text-align: center;
}
.topbar .topbar-logo img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: contain;
}
.topbar .user-menu .dropdown-toggle {
  background: none;
  border: none;
  color: var(--brand-dark);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.topbar .user-menu .dropdown-toggle:hover { color: var(--brand-primary); }
.topbar .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.main-content { flex: 1; min-width: 0; }
.content-area { padding: 24px; }

/* ── Tables ──────────────────────────────────────────────────────────── */
table.table { font-size: 0.875rem; }
.table thead th {
  background: #fafbfc;
  color: var(--brand-dark);
  font-weight: 600;
  border-bottom: 2px solid var(--brand-border);
}

/* ── Status badges (preserve existing) ───────────────────────────────── */
.status-badge { font-size: 0.75rem; padding: 0.25rem 0.6rem; border-radius: 20px; font-weight: 500; }
.status-incoming        { background: #e3efff; color: #1a56db; }
.status-received        { background: #e8f5e9; color: #2e7d32; }
.status-in_qc           { background: #fff8e1; color: #f57f17; }
.status-ready_to_sell_qcd   { background: #e8f5e9; color: #1b5e20; }
.status-ready_to_sell_asis  { background: #f3e5f5; color: #6a1b9a; }
.status-in_repair       { background: #fce4ec; color: #c62828; }
.status-lot_awaiting_buyer  { background: #e0f2f1; color: #00695c; }
.status-reserved        { background: #fff3e0; color: #e65100; }
.status-at_best_buy     { background: #e8eaf6; color: #283593; }
.status-sold            { background: #212121; color: #fff; }
.status-returned        { background: #fafafa; color: #616161; border: 1px solid #ccc; }
.status-scrapped        { background: #424242; color: #fff; }

.flash { border-radius: 8px; }

/* ── KPI cards (dashboard) ───────────────────────────────────────────── */
.kpi-card {
  border-radius: 10px;
  border: 1px solid var(--brand-border);
  background: #fff;
  padding: 18px 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 16px;
}
.kpi-card .kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.kpi-card .kpi-label {
  font-size: 0.78rem;
  color: #6b7a8f;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.kpi-card .kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--brand-dark);
}
.kpi-icon.icon-blue    { background: #e3f0ff; color: #1967d2; }
.kpi-icon.icon-green   { background: #e6f4ea; color: #137333; }
.kpi-icon.icon-orange  { background: #fef7e0; color: #b06000; }
.kpi-icon.icon-red     { background: #fce8e6; color: #c5221f; }

/* ── Quick action tiles ─────────────────────────────────────────────── */
.quick-action {
  display: block;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--brand-dark);
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.1s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(74, 144, 217, 0.15);
  border-color: var(--brand-primary);
  color: var(--brand-dark);
}
.quick-action i { font-size: 1.6rem; color: var(--brand-primary); }
.quick-action .label {
  display: block;
  margin-top: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #7b8794;
}
.empty-state i {
  font-size: 3rem;
  color: #cbd5e0;
  margin-bottom: 12px;
  display: block;
}
.empty-state .empty-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brand-dark);
  margin-bottom: 4px;
}
.empty-state .empty-hint { font-size: 0.9rem; }

/* ── Activity feed ───────────────────────────────────────────────────── */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--brand-border);
}
.activity-item:last-child { border-bottom: none; }
.activity-item .activity-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e3f0ff;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.activity-item .activity-meta {
  font-size: 0.78rem;
  color: #7b8794;
}

/* ── Auth pages (login/forgot/reset) ─────────────────────────────────── */
body.auth-body {
  background: linear-gradient(135deg, #e6eef9 0%, #f5f7fa 50%, #e9ecf2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.auth-card {
  width: 420px;
  max-width: 100%;
  border-radius: 14px;
  border: none;
  box-shadow: 0 10px 40px rgba(27, 43, 71, 0.12);
  background: #fff;
  overflow: hidden;
}
.auth-header {
  background: linear-gradient(135deg, var(--brand-dark) 0%, #2a4770 100%);
  color: #fff;
  padding: 2rem 2rem 1.5rem;
  text-align: center;
}
.auth-header img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  object-fit: contain;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.auth-header h5 {
  margin-top: 14px;
  margin-bottom: 2px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.auth-header small { color: #a4b4cd; }
.auth-body-inner { padding: 1.75rem 2rem 2rem; }
.auth-body-inner .form-control {
  border: 1px solid var(--brand-border);
  padding: 0.55rem 0.75rem;
}
.auth-body-inner .form-control:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 0.2rem rgba(74, 144, 217, 0.15);
}
.auth-body-inner .btn-brand {
  background: var(--brand-primary);
  color: #fff;
  font-weight: 600;
  padding: 0.65rem;
  border: none;
}
.auth-body-inner .btn-brand:hover {
  background: var(--brand-primary-hover);
  color: #fff;
}
.auth-body-inner .forgot-link {
  color: var(--brand-primary);
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 500;
}
.auth-body-inner .forgot-link:hover {
  text-decoration: underline;
  color: var(--brand-primary-hover);
}

/* ── Print ───────────────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  body, .main-content, .content-area {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }
  a { color: #000 !important; text-decoration: none !important; }
  .btn, .dropdown { display: none !important; }
}
