/* Presta-ERP overrides on top of Vuexy (Bootstrap 5). Keep minimal. */

/* ==== Fix button hover cursor flicker ===================================== *
 * Vuexy scales every button by 1.001 (a GPU-compositing hack). The sub-pixel
 * scale re-rasterises with ~1px jitter on the hover color transition, which
 * flickers the cursor. Force an integer scale (the :active scale(.98) stays). */
.btn:not(.dropdown-toggle):not([class*="btn-text-"]) { transform: scale(1); }

/* ==== Two-tone: dark navy sidebar (premium contrast vs light content) ===== */
#layout-menu.bg-menu-theme { background: #232a3b !important; box-shadow: none; }
#layout-menu .menu-inner-shadow { display: none !important; }
#layout-menu .brand-wordmark { color: #fff !important; }
#layout-menu .menu-link { color: #aab3c5 !important; }
#layout-menu .menu-link .menu-icon { color: #8892a6 !important; }
#layout-menu .menu-header-text { color: #6b7488 !important; }
#layout-menu .menu-item > .menu-link:hover:not(.active) { color: #fff !important; background: rgba(255,255,255,.06) !important; }
#layout-menu .menu-item > .menu-link:hover:not(.active) .menu-icon { color: #fff !important; }
#layout-menu .menu-inner > .menu-item.active > .menu-link {
  background: linear-gradient(270deg, rgba(47,107,255,.9) 0%, #2f6bff 100%) !important;
  color: #fff !important; box-shadow: 0 .25rem .6rem rgba(47,107,255,.4);
}
#layout-menu .menu-inner > .menu-item.active > .menu-link .menu-icon { color: #fff !important; }
#layout-menu .layout-menu-toggle .menu-toggle-icon { color: #aab3c5 !important; }

/* ==== Brand re-theme: professional blue primary =========================== */
:root, .light-style, [data-bs-theme="light"] {
  --bs-primary: #2f6bff;
  --bs-primary-rgb: 47, 107, 255;
  --bs-link-color: #2f6bff;
  --bs-link-color-rgb: 47, 107, 255;
  --bs-link-hover-color: #1f52d8;
}
.btn-primary {
  --bs-btn-bg: #2f6bff; --bs-btn-border-color: #2f6bff;
  --bs-btn-hover-bg: #245ceb; --bs-btn-hover-border-color: #245ceb;
  --bs-btn-active-bg: #245ceb; --bs-btn-active-border-color: #245ceb;
  --bs-btn-disabled-bg: #2f6bff; --bs-btn-disabled-border-color: #2f6bff;
  box-shadow: 0 .125rem .35rem rgba(47, 107, 255, .35);
}
.bg-primary { background-color: #2f6bff !important; }
.text-primary { color: #2f6bff !important; }
.bg-label-primary { background-color: rgba(47, 107, 255, .16) !important; color: #2f6bff !important; }
.btn-label-primary {
  --bs-btn-color: #2f6bff; --bs-btn-bg: rgba(47, 107, 255, .16); --bs-btn-border-color: transparent;
  --bs-btn-hover-bg: #2f6bff; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #2f6bff;
  --bs-btn-active-bg: #2f6bff; --bs-btn-active-color: #fff;
}
.btn-text-primary, .btn-outline-primary { --bs-btn-color: #2f6bff; --bs-btn-border-color: #2f6bff; --bs-btn-hover-bg: #2f6bff; }
.badge.bg-primary { background-color: #2f6bff !important; }
.form-check-input:checked { background-color: #2f6bff; border-color: #2f6bff; }
.form-check-input:focus { border-color: #2f6bff; box-shadow: 0 0 0 .25rem rgba(47, 107, 255, .25); }
.form-control:focus, .form-select:focus { border-color: #2f6bff; box-shadow: 0 0 0 .15rem rgba(47, 107, 255, .15); }
.page-item.active .page-link, .dataTables_wrapper .pagination .page-item.active .page-link { background-color: #2f6bff; border-color: #2f6bff; }
.nav-tabs .nav-link.active { color: #2f6bff; border-bottom-color: #2f6bff; }
.nav-pills .nav-link.active { background-color: #2f6bff; }
a { color: #2f6bff; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background-color: #2f6bff; }
/* Sidebar active item → blue */
.bg-menu-theme .menu-inner > .menu-item.active > .menu-link {
  background: linear-gradient(270deg, rgba(47,107,255,.75) 0%, #2f6bff 100%) !important;
  color: #fff !important;
}
.bg-menu-theme .menu-inner > .menu-item.active > .menu-link .menu-icon { color: #fff !important; }

/* ---- Brand wordmark (Sora display font) ---- */
.brand-wordmark {
  font-family: "Sora", "Public Sans", sans-serif;
  font-weight: 700; font-size: 1.35rem; letter-spacing: -.4px;
  color: #2f6bff; line-height: 1;
}
.app-brand-logo svg { display: block; }

/* ---- Initials avatar (list name columns) ---- */
.avatar-initial-brand { background-color: rgba(47,107,255,.16); color: #2f6bff; font-weight: 600; }

/* ---- Card hover lift ---- */
.card-hover { transition: box-shadow .2s ease, transform .2s ease; }
.card-hover:hover { box-shadow: 0 .5rem 1.4rem rgba(0,0,0,.09); transform: translateY(-2px); }

/* ---- Empty-state illustration ---- */
.empty-state { padding: 2.5rem 1rem; text-align: center; }
.empty-state img { max-width: 140px; opacity: .9; margin-bottom: 1rem; }

/* Line-items editor */
table.lines-table td { vertical-align: middle; }
table.lines-table .form-control,
table.lines-table .form-select { min-width: 5rem; }
[data-line-total] { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Totals box */
.totals-box { max-width: 340px; margin-left: auto; }
.totals-box .row-line { display: flex; justify-content: space-between; padding: .25rem 0; }
.totals-box .row-line.grand { border-top: 2px solid var(--bs-border-color); margin-top: .35rem; padding-top: .55rem; font-size: 1.1rem; font-weight: 700; }

/* Numeric table cells */
.text-nowrap-num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Definition list for detail pages */
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.5rem; margin: 0; }
dl.kv dt { color: var(--bs-secondary-color); font-weight: 500; }
dl.kv dd { margin: 0; }
