/* ============================================================
   Alpha ERP — custom styles
   AdminLTE 4 / Bootstrap 5
   ============================================================ */

/* ---- Body & base ----------------------------------------- */
body {
  font-family: 'Source Sans Pro', system-ui, sans-serif;
  font-size: .9rem;
}

/* ---- Login page ------------------------------------------ */
.login-page {
  background: #1a2634;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  width: 100%;
  max-width: 380px;
}
.login-logo a {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
}
.login-logo img { max-height: 56px; width: auto; }
.login-card-body { padding: 1.5rem; }

/* ---- Sidebar brand logo ---------------------------------- */
.sidebar-brand .brand-link {
  display: flex;
  align-items: center;
  padding: .75rem 1rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-brand img {
  max-height: 42px;
  width: auto;
}

/* ---- Sidebar user panel ---------------------------------- */
.sidebar-user { font-size: .85rem; }
.sidebar-user .user-name { font-size: .9rem; }
.sidebar-user .user-role { font-size: .75rem; }

/* ---- Tables ---------------------------------------------- */
.table th {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}
.table td { vertical-align: middle; }

/* Money / number alignment */
.money { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Reorder warning ------------------------------------- */
.text-reorder { color: #dc3545; font-weight: 600; }

/* ---- Status badges --------------------------------------- */
.badge[class*="status-"] { font-size: .75rem; }
.status-planned    { background: #6c757d; color: #fff; }
.status-loading    { background: #fd7e14; color: #fff; }
.status-dispatched { background: #0d6efd; color: #fff; }
.status-in_transit { background: #0dcaf0; color: #000; }
.status-delivered  { background: #198754; color: #fff; }
.status-cancelled  { background: #dc3545; color: #fff; }
.status-draft      { background: #6c757d; color: #fff; }
.status-approved   { background: #0d6efd; color: #fff; }
.status-paid       { background: #198754; color: #fff; }
.status-unpaid     { background: #dc3545; color: #fff; }
.status-partial    { background: #fd7e14; color: #fff; }
.status-void       { background: #6c757d; color: #fff; }
.status-open       { background: #0d6efd; color: #fff; }
.status-in_progress{ background: #fd7e14; color: #fff; }
.status-completed  { background: #198754; color: #fff; }
.status-outstanding{ background: #dc3545; color: #fff; }
.status-recovered  { background: #198754; color: #fff; }
.status-written_off{ background: #6c757d; color: #fff; }
.status-partially_recovered { background: #fd7e14; color: #fff; }
.status-active     { background: #198754; color: #fff; }
.status-inactive   { background: #6c757d; color: #fff; }
.status-suspended  { background: #fd7e14; color: #fff; }
.status-terminated { background: #dc3545; color: #fff; }
.status-pending    { background: #0dcaf0; color: #000; }

/* ---- Role badges ----------------------------------------- */
.badge-role-admin       { background: #dc3545; color: #fff; }
.badge-role-accountant  { background: #0d6efd; color: #fff; }
.badge-role-manager     { background: #198754; color: #fff; }
.badge-role-clerk       { background: #6f42c1; color: #fff; }
.badge-role-storekeeper { background: #d63384; color: #fff; }
.badge-role-driver      { background: #0dcaf0; color: #000; }
.badge-role-mechanic    { background: #212529; color: #fff; }
.badge-role-viewer      { background: #6c757d; color: #fff; }

/* ---- Bootstrap 5 compatibility helpers ------------------- */
/* AdminLTE 4 uses Bootstrap 5; keep these for any BS4 remnants in module HTML */
.float-right  { float: right !important; }
.ml-auto      { margin-left: auto !important; }
.mr-auto      { margin-right: auto !important; }
.ml-1         { margin-left: .25rem !important; }
.ml-2         { margin-left: .5rem !important; }
.mr-1         { margin-right: .25rem !important; }
.mr-2         { margin-right: .5rem !important; }
.d-flex.gap-2 { gap: .5rem; }

/* ---- Card header tools ----------------------------------- */
.card-tools { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }

/* ---- Pagination spacing ---------------------------------- */
.pagination { margin-top: .5rem; margin-bottom: 0; }

/* ---- Small-box icon size fix for AdminLTE 4 -------------- */
.small-box .icon { font-size: 4rem; opacity: .4; }
.small-box h3 { font-size: 2rem; font-weight: 700; }

/* ---- Alert dismiss button (BS5 uses btn-close) ----------- */
/* Module pages still generate BS4-style dismiss buttons; keep both working */
.alert .btn-close { float: right; }

/* ---- Form row gap (BS5 removed .form-row) ---------------- */
.form-row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -.5rem;
  margin-left:  -.5rem;
}
.form-row > [class*="col"] {
  padding-right: .5rem;
  padding-left:  .5rem;
}

/* ---- Breadcrumb float fix (BS5) -------------------------- */
.float-sm-right { float: right !important; }
@media (min-width: 576px) { .float-sm-right { float: right !important; } }
