/* =====================================================================
   CJP Southern Star OPC - "Pro" design layer
   Loaded AFTER style.css on every page. Pure refinement: it never changes
   layout or behaviour, only polish - spacing, depth, typography, states.
   ===================================================================== */

:root {
  --pro-ring: 0 0 0 3px rgba(227, 30, 36, .16);
  --pro-border: #E6EAF0;
  --pro-shadow-card: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .045);
  --pro-shadow-hover: 0 2px 4px rgba(15, 23, 42, .05), 0 12px 28px rgba(15, 23, 42, .10);
  --pro-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Typography ---------- */
body {
  font-feature-settings: 'cv11', 'ss01', 'tnum' 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h4.section-title, .section-title { font-size: 1.12rem; }
h4.section-title { font-size: 1.3rem; }
.table td, .table th, .stat-card h3, .fw-bold.fs-5, .money, .text-end {
  font-variant-numeric: tabular-nums;
}
.text-muted { color: var(--slate-500) !important; }
.small, small { letter-spacing: .005em; }

/* links never underlined inside app chrome, buttons and menus */
.app-sidebar a, .app-topbar a, a.btn, .dropdown-menu a, .nav-link, .page-link, a.stat-link, .badge a, a.badge, .topbar-btn {
  text-decoration: none !important;
}
.user-menu-toggle, .user-menu-toggle:hover, .user-menu-toggle .user-name, .user-menu-toggle .user-role { text-decoration: none !important; }

/* ---------- Page shell ---------- */
body { background-color: #F5F7FA; }
.app-content { padding-bottom: 1.5rem; }
@media (prefers-reduced-motion: no-preference) {
  .app-content { animation: proEnter .28s var(--pro-ease) backwards; }
  @keyframes proEnter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
.app-topbar {
  position: sticky; top: 0;
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--pro-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}
footer.text-center { border-top: 1px solid var(--pro-border); margin-top: auto; color: var(--slate-400) !important; font-size: .78rem !important; }

/* ---------- Sidebar polish ---------- */
.app-sidebar { box-shadow: 6px 0 32px rgba(10, 12, 20, .22); }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); }
.sidebar-link, .sidebar-group-toggle, .sidebar-sublink { transition: background-color .16s var(--pro-ease), color .16s var(--pro-ease), transform .16s var(--pro-ease); }
.sidebar-link:hover:not(.active), .sidebar-group-toggle:hover:not(.active) { transform: translateX(2px); }
.sidebar-link.active, .sidebar-group-toggle.active {
  background: linear-gradient(90deg, rgba(227, 30, 36, .28), rgba(227, 30, 36, .10));
  box-shadow: inset 0 0 0 1px rgba(227, 30, 36, .22);
}
.sidebar-brand { background: linear-gradient(180deg, rgba(255, 255, 255, .05), transparent); }
.sidebar-brand-logo { box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.sidebar-section-label { color: rgba(255, 255, 255, .38); }

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--pro-border);
  border-radius: 14px;
  box-shadow: var(--pro-shadow-card);
  background: #fff;
}
.card-header { background: #fff; border-bottom: 1px solid var(--pro-border); border-radius: 14px 14px 0 0 !important; font-weight: 600; }
.card.p-3, .card.p-4 { transition: box-shadow .2s var(--pro-ease); }
.card.border-danger, .card.border-warning { box-shadow: var(--pro-shadow-card); }

/* ---------- Stat tiles ---------- */
.stat-card {
  border-radius: 14px;
  border: 1px solid var(--pro-border);
  border-left: 0;
  box-shadow: var(--pro-shadow-card);
  padding: 1.2rem 1.4rem 1.2rem 1.55rem;
  background: linear-gradient(180deg, #fff, #fff 60%, color-mix(in srgb, var(--stat-color, #E31E24) 3%, #fff));
}
.stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: linear-gradient(180deg, var(--stat-color, var(--cjp-red)), color-mix(in srgb, var(--stat-color, #E31E24) 55%, #fff));
}
.stat-card:hover { box-shadow: var(--pro-shadow-hover); transform: translateY(-3px); }
.stat-card h3 { font-weight: 800; letter-spacing: -.025em; }
.stat-card i.bg-icon { border-radius: 12px; }

/* ---------- Section titles ---------- */
.section-title { border-left: 0; padding-left: 0; gap: .6rem; }
.section-title > i:first-child {
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cjp-red-50); color: var(--cjp-red); font-size: 1rem; flex-shrink: 0;
}
.card .section-title > i:first-child { width: 30px; height: 30px; font-size: .92rem; }

/* ---------- Tables ---------- */
.table { --bs-table-hover-bg: #FBF3F3; --bs-table-bg: transparent; }
.table thead th {
  background: #F7F9FC; color: var(--slate-500);
  border-bottom: 1px solid var(--pro-border);
  font-size: .69rem; letter-spacing: .07em;
}
.table > :not(caption) > * > * { padding: .72rem .8rem; }
.table tbody td { border-bottom: 1px solid #EEF1F6; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > *, .table tbody tr:hover { background-color: #FBF4F4; }
.table-sm > :not(caption) > * > * { padding: .5rem .65rem; }
.table-responsive { border-radius: 12px; }
td.text-center.text-muted, td.text-muted.text-center { padding: 2rem .8rem !important; font-style: normal; }
.table-responsive::-webkit-scrollbar { height: 8px; }

/* ---------- Buttons ---------- */
.btn {
  border-radius: 10px; font-weight: 600; letter-spacing: .005em;
  transition: transform .14s var(--pro-ease), box-shadow .18s var(--pro-ease), background-color .15s, border-color .15s, color .15s;
}
.btn:not(:disabled):not(.disabled):active { transform: translateY(1px) scale(.99); }
.btn-primary {
  background: linear-gradient(180deg, #EC2A30, var(--cjp-red));
  border-color: var(--cjp-red-dark);
  box-shadow: 0 1px 2px rgba(180, 21, 26, .25), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover, .btn-primary:focus { background: linear-gradient(180deg, var(--cjp-red), var(--cjp-red-dark)); border-color: var(--cjp-red-dark); box-shadow: 0 6px 16px rgba(227, 30, 36, .30); transform: translateY(-1px); }
.btn-success { box-shadow: 0 1px 2px rgba(21, 128, 61, .25), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn-success:hover { box-shadow: 0 6px 16px rgba(21, 128, 61, .28); transform: translateY(-1px); }
.btn-outline-secondary { background: #fff; border-color: var(--slate-300); color: var(--slate-600); }
.btn-outline-primary { background: #fff; }
.btn-outline-primary:hover, .btn-outline-success:hover, .btn-outline-danger:hover, .btn-outline-info:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15, 23, 42, .10); }
/* the yellow "warning" outline had very poor contrast on white - use a readable amber */
.btn-outline-warning { color: #92400E; border-color: #F2C879; background: #FFFBEB; }
.btn-outline-warning:hover, .btn-outline-warning:focus { color: #7C2D12; background: #FEF3C7; border-color: #E8B04F; }
.btn-outline-info { color: #1D4ED8; border-color: #BFD3FB; background: #F5F8FF; }
.btn-outline-info:hover { color: #1E40AF; background: #DBEAFE; border-color: #93B4F5; }
.btn-outline-danger { background: #fff; }
.btn-sm { border-radius: 8px; }
.btn:focus-visible, .form-check-input:focus-visible, a:focus-visible { outline: 0; box-shadow: var(--pro-ring); }
.btn:disabled, .btn.disabled { opacity: .55; }
.btn-close:focus { box-shadow: var(--pro-ring); }

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-color: #D6DDE8; border-radius: 10px; background-color: #fff;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.form-control:hover:not(:focus):not(:disabled):not([readonly]), .form-select:hover:not(:focus):not(:disabled) { border-color: var(--slate-400); }
.form-control::placeholder { color: var(--slate-400); }
.form-control:disabled, .form-control[readonly], .form-select:disabled { background-color: #F4F6FA; color: var(--slate-600); }
.form-control:focus, .form-select:focus { border-color: var(--cjp-red); box-shadow: var(--pro-ring); }
.form-label { color: var(--slate-700); font-weight: 600; }
.form-text { color: var(--slate-500); }
.input-group-text { background: #F4F6FA; border-color: #D6DDE8; color: var(--slate-600); }
.form-check-input { border-color: var(--slate-400); }
.form-check-input:checked { background-color: var(--cjp-red); border-color: var(--cjp-red); }
.form-check-input:focus { border-color: var(--cjp-red); box-shadow: var(--pro-ring); }
.form-switch .form-check-input:checked { background-color: var(--cjp-green); border-color: var(--cjp-green); }
.was-validated .form-control:invalid, .form-control.is-invalid { border-color: #DC2626; }
input[type=file].form-control::file-selector-button {
  border: 0; border-right: 1px solid #D6DDE8; background: #F4F6FA; color: var(--slate-700);
  padding: .5rem .85rem; margin-right: .75rem; font-weight: 600; transition: background-color .15s;
}
input[type=file].form-control:hover::file-selector-button { background: #E9EDF4; }

/* ---------- Badges ---------- */
.badge:not(.rounded-pill) { border-radius: 999px; padding: .36em .7em; font-weight: 700; letter-spacing: .015em; }
.badge.rounded-pill { box-shadow: 0 0 0 2px #fff; }
.app-sidebar .badge.rounded-pill { box-shadow: 0 0 0 2px rgba(20, 23, 31, .9); }

/* ---------- Alerts ---------- */
.alert { border-radius: 12px; border-width: 1px; border-left-width: 4px; box-shadow: var(--pro-shadow-card); padding: .8rem 1rem; }
.alert-success { background: #F0FBF4; border-color: #BCE8CB; border-left-color: #16A34A; color: #14532D; }
.alert-danger  { background: #FEF2F2; border-color: #F6C4C4; border-left-color: #DC2626; color: #7F1D1D; }
.alert-warning { background: #FFFAEB; border-color: #F6DFA3; border-left-color: #F59E0B; color: #78350F; }
.alert-info    { background: #F2F7FF; border-color: #C5D8FA; border-left-color: #2563EB; color: #1E3A8A; }
.alert .btn-close { padding: 1rem; }

/* ---------- Dropdowns / modals / tabs / pagination ---------- */
.dropdown-menu { border: 1px solid var(--pro-border); border-radius: 14px; box-shadow: 0 12px 36px rgba(15, 23, 42, .16); padding: .45rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .875rem; font-weight: 500; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--slate-100); }
.dropdown-item.active, .dropdown-item:active { background: var(--cjp-red); color: #fff; }
.modal-content { border: 0; border-radius: 18px; box-shadow: 0 28px 70px rgba(10, 14, 30, .32); overflow: hidden; }
.modal-header { border-bottom: 1px solid var(--pro-border); background: #FAFBFD; padding: 1rem 1.25rem; }
.modal-footer { border-top: 1px solid var(--pro-border); background: #FAFBFD; }
.modal-title { font-weight: 700; letter-spacing: -.01em; }
.modal-backdrop.show { opacity: .55; }
.nav-tabs { border-bottom: 1px solid var(--pro-border); gap: .25rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--slate-500); font-weight: 600; padding: .6rem 1rem; transition: color .15s, border-color .15s; }
.nav-tabs .nav-link:hover { color: var(--slate-900); border-bottom-color: var(--slate-300); }
.nav-tabs .nav-link.active { color: var(--cjp-red-dark); border-bottom-color: var(--cjp-red); background: transparent; }
.nav-pills .nav-link { border-radius: 999px; font-weight: 600; color: var(--slate-600); }
.nav-pills .nav-link.active { background: var(--cjp-red); box-shadow: 0 4px 12px rgba(227, 30, 36, .28); }
.page-link { border-radius: 8px !important; margin: 0 .12rem; border-color: var(--pro-border); color: var(--slate-700); }
.page-item.active .page-link { background: var(--cjp-red); border-color: var(--cjp-red); }
.progress { border-radius: 999px; background: #EDF0F5; }
.list-group-item { border-color: var(--pro-border); }
.accordion-item { border-color: var(--pro-border); }
.tooltip-inner { border-radius: 8px; padding: .4rem .65rem; font-size: .78rem; }

/* ---------- Action Center ---------- */
.ac-panel { border: 1px solid var(--pro-border); border-radius: 16px; background: #fff; box-shadow: var(--pro-shadow-card); overflow: hidden; margin-bottom: 1.5rem; }
.ac-panel.has-danger { border-color: #F3C6C8; }
.ac-head { display: flex; align-items: center; gap: .7rem; padding: .85rem 1.1rem; cursor: pointer; background: linear-gradient(90deg, #FFF7F7, #fff 55%); border-bottom: 1px solid var(--pro-border); }
.ac-panel:not(.has-danger) .ac-head { background: linear-gradient(90deg, #FFFBEF, #fff 55%); }
.ac-head-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--cjp-red); color: #fff; font-size: 1.05rem; box-shadow: 0 4px 12px rgba(227, 30, 36, .3); flex-shrink: 0; }
.ac-panel:not(.has-danger) .ac-head-icon { background: #F59E0B; box-shadow: 0 4px 12px rgba(245, 158, 11, .35); }
.ac-head-title { font-weight: 800; letter-spacing: -.01em; color: var(--slate-900); line-height: 1.2; }
.ac-head-sub { font-size: .76rem; color: var(--slate-500); }
.ac-count { margin-left: .35rem; background: var(--slate-900); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .15rem .55rem; vertical-align: middle; }
.ac-chev { margin-left: auto; color: var(--slate-400); transition: transform .2s var(--pro-ease); }
.ac-head[aria-expanded="false"] .ac-chev { transform: rotate(-90deg); }
.ac-body { padding: .35rem 1.1rem 1rem; }
.ac-group + .ac-group { margin-top: .55rem; }
.ac-group-title { font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--slate-400); padding: .7rem 0 .3rem; display: flex; align-items: center; gap: .4rem; }
.ac-item { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; margin-bottom: .35rem; border: 1px solid #EEF1F6; border-radius: 12px; background: #FBFCFE; transition: border-color .15s, box-shadow .15s, transform .15s var(--pro-ease); }
.ac-item:hover { border-color: #D9DFEA; box-shadow: 0 4px 14px rgba(15, 23, 42, .06); transform: translateY(-1px); }
.ac-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1rem; flex-shrink: 0; }
.ac-danger .ac-dot { background: #FEE8E8; color: #DC2626; }
.ac-warning .ac-dot { background: #FEF3D7; color: #B45309; }
.ac-info .ac-dot { background: #E3EDFE; color: #2563EB; }
.ac-danger { border-left: 3px solid #EF4444; }
.ac-warning { border-left: 3px solid #F59E0B; }
.ac-info { border-left: 3px solid #3B82F6; }
.ac-text { flex: 1 1 auto; font-size: .85rem; color: var(--slate-700); line-height: 1.4; }
.ac-text strong { color: var(--slate-900); }
.ac-btn { border: 1px solid var(--slate-300); background: #fff; color: var(--slate-800); font-weight: 700; font-size: .78rem; padding: .38rem .8rem; border-radius: 9px; white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; transition: all .15s var(--pro-ease); text-decoration: none !important; cursor: pointer; }
.ac-btn::after { content: '\2192'; font-weight: 800; transition: transform .15s var(--pro-ease); }
.ac-btn:hover { background: var(--slate-900); border-color: var(--slate-900); color: #fff; }
.ac-btn:hover::after { transform: translateX(3px); }
.ac-clear { display: flex; align-items: center; gap: .75rem; padding: .85rem 1.1rem; background: linear-gradient(90deg, #F0FBF4, #fff 60%); border: 1px solid #BCE8CB; border-radius: 16px; color: #14532D; margin-bottom: 1.5rem; box-shadow: var(--pro-shadow-card); }
.ac-clear i { font-size: 1.4rem; color: #16A34A; }

/* ---------- Login ---------- */
.login-card { border-radius: 20px; box-shadow: 0 24px 60px rgba(15, 23, 42, .16); border-color: var(--pro-border); }
.login-card .form-control { padding: .7rem .9rem; }
.login-card .btn-primary { padding: .7rem; border-radius: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .login-card { animation: proEnter .45s var(--pro-ease) both; }
  .login-brand-panel h1, .login-brand-panel .lede, .login-feature-list li { animation: proEnter .6s var(--pro-ease) both; }
  .login-feature-list li:nth-child(2) { animation-delay: .08s; }
  .login-feature-list li:nth-child(3) { animation-delay: .16s; }
}

/* ---------- Misc ---------- */
::selection { background: #FBD5D6; color: #7F1D1D; }
.border-bottom, .border-top, hr { border-color: var(--pro-border) !important; }
hr { opacity: 1; }
.bg-light { background-color: #F5F7FA !important; }
.rounded { border-radius: 12px !important; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-radius: 10px 0 0 10px; }
.btn-group > .btn:last-child { border-radius: 0 10px 10px 0; }
.btn-group-sm > .btn:first-child { border-radius: 8px 0 0 8px; }
.btn-group-sm > .btn:last-child { border-radius: 0 8px 8px 0; }

@media (max-width: 575.98px) {
  .app-content { padding-left: .85rem; padding-right: .85rem; }
  .stat-card h3 { font-size: 1.5rem; }
  .ac-item { flex-wrap: wrap; }
  .ac-btn { margin-left: calc(34px + .75rem); }
}
@media print {
  .app-content { animation: none !important; }
  .card, .stat-card, .alert { box-shadow: none !important; }
}

/* ---- Fuel Orders list: S.O. / Truck column ---- */
.so-cell { min-width: 230px; max-width: 340px; font-size: .8rem; line-height: 1.35; }
.so-cell.so-scroll { max-height: 230px; overflow-y: auto; padding-right: 6px; border: 1px solid var(--pro-border, #E5E7EB); border-radius: 10px; padding: 6px 8px; background: #FBFBFC; }
.so-section-label { font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6B7280; margin: 6px 0 3px; }
.so-section-label:first-child { margin-top: 0; }
.so-row { padding: 5px 0; border-bottom: 1px dashed #E5E7EB; }
.so-row:last-child { border-bottom: 0; }
.so-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; font-size: .82rem; }
.so-sub { color: #6B7280; font-size: .75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.so-key { font-size: .65rem; font-weight: 700; letter-spacing: .05em; color: #6B7280; }
.so-meta { color: #4B5563; font-size: .75rem; }

/* ---- "Showing only these from the Action Center" bar ---- */
.ac-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #FFF7ED; border: 1px solid #FED7AA; border-left: 4px solid #F97316; color: #7C2D12;
  border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: .9rem; }
.ac-filter-bar i.bi-bell-fill { color: #F97316; }
