/* =========================================================
   LoyalOn — theme (Redstar template style, Navy main color)
   ========================================================= */

:root {
  --lo-primary: #1e3a6e;        /* Navy — main color */
  --lo-primary-dark: #142a52;   /* hover / pressed */
  --lo-primary-light: #7da2d6;  /* accent on dark backgrounds */
  --lo-primary-rgb: 30, 58, 110;
  --lo-sidebar-bg: #0f1a2e;
  --lo-sidebar-border: #1d2a42;
}

/* ---------- Login ---------- */
body.login-page {
  background: linear-gradient(135deg, var(--lo-sidebar-bg) 0%, var(--lo-primary) 100%);
  min-height: 100vh;
}
.login-logo a {
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
}
.login-logo .accent,
.login-logo small {
  color: var(--lo-primary-light);
}
.login-logo small {
  display: block;
  font-size: .9rem;
  font-weight: 400;
  letter-spacing: .5px;
}
.login-card-body {
  border-top: 4px solid var(--lo-primary);
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}
.login-box-msg {
  color: #495057;
  font-weight: 500;
}
.login-page .input-group-text {
  background-color: #fff;
}
a.text-lo { color: var(--lo-primary); }
a.text-lo:hover { color: var(--lo-primary-dark); }

/* ---------- Topbar ---------- */
.main-header.navbar-lo {
  background: #fff;
  border-bottom: 1px solid #e9ecef;
}
.main-header.navbar-lo .nav-link { color: #495057; }
.main-header.navbar-lo .nav-link:hover { color: var(--lo-primary); }
.navbar-lo .user-menu .user-header {
  background: var(--lo-primary);
  height: 110px;
}
.navbar-lo .user-menu .user-header i { font-size: 56px; }

/* ---------- Brand ---------- */
.brand-link.brand-lo {
  background: var(--lo-sidebar-bg);
  color: #fff;
  border-bottom: 1px solid var(--lo-sidebar-border);
}
.brand-link.brand-lo:hover { color: #fff; }
.brand-link.brand-lo .brand-text b { color: #fff; }
.brand-link.brand-lo .brand-text .accent { color: var(--lo-primary-light); }

/* ---------- Sidebar ---------- */
.main-sidebar.sidebar-lo { background: var(--lo-sidebar-bg); }
.sidebar-lo .nav-sidebar .nav-link {
  color: #c2c7d0;
  border-radius: 0;
}
.sidebar-lo .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-lo .nav-sidebar > .nav-item > .nav-link.active:hover {
  background-color: var(--lo-primary);
  color: #fff;
  box-shadow: none;
}
.sidebar-lo .nav-sidebar .nav-link:hover {
  background-color: rgba(var(--lo-primary-rgb), .35);
  color: #fff;
}
.sidebar-lo .nav-treeview > .nav-item > .nav-link.active {
  background-color: rgba(var(--lo-primary-rgb), .85);
  color: #fff;
}
.sidebar-lo .nav-sidebar .nav-icon { color: var(--lo-primary-light); }
.sidebar-lo .nav-sidebar > .nav-item > .nav-link.active .nav-icon { color: #fff; }
.sidebar-lo .nav-header {
  color: #6c7a93;
  font-size: .75rem;
  letter-spacing: .5px;
}
.user-panel-lo { border-bottom: 1px solid var(--lo-sidebar-border) !important; }
.user-panel-lo .image i { font-size: 32px; }
.user-panel-lo .info a { color: #fff !important; }

/* ---------- Content ---------- */
.content-header h1 {
  color: #343a40;
  font-weight: 600;
}

/* ---------- Buttons ---------- */
.btn-lo {
  background-color: var(--lo-primary);
  border-color: var(--lo-primary);
  color: #fff;
  font-weight: 500;
}
.btn-lo:hover,
.btn-lo:focus {
  background-color: var(--lo-primary-dark);
  border-color: var(--lo-primary-dark);
  color: #fff;
}
.btn-outline-lo {
  color: var(--lo-primary);
  border-color: var(--lo-primary);
  background: transparent;
}
.btn-outline-lo:hover {
  background-color: var(--lo-primary);
  color: #fff;
}
/* The chosen one of a toggle group (a channel, say): filled, so it reads as selected. */
.btn-outline-lo.active,
.btn-outline-lo:not(:disabled):not(.disabled):active {
  background-color: var(--lo-primary);
  border-color: var(--lo-primary);
  color: #fff;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .15);
}
.btn-group-toggle .btn-outline-lo.focus,
.btn-group-toggle .btn-outline-lo:focus-within {
  box-shadow: 0 0 0 .2rem rgba(var(--lo-primary-rgb), .35);
}

/* ---------- Cards ---------- */
.filter-card { border-top: 3px solid var(--lo-primary); }
.table-card { box-shadow: 0 1px 4px rgba(0, 0, 0, .06); }
.table-card-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #212529;
}
.table-card-title .badge {
  font-size: .85rem;
  vertical-align: middle;
}
.badge-lo {
  background-color: var(--lo-primary);
  color: #fff;
}

/* ---------- Status badges ---------- */
.badge-active,
.badge-passive {
  display: inline-block;
  font-weight: 600;
  font-size: .8rem;
  padding: 5px 10px;
  border-radius: 12px;
}
.badge-active {
  background: rgba(40, 167, 69, .12);
  color: #28a745;
}
.badge-passive {
  background: rgba(108, 117, 125, .15);
  color: #6c757d;
}

/* ---------- Action buttons (grouped, icon-only) ---------- */
.btn-action {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.btn-group .btn-action { border-radius: 0; }
.btn-group .btn-action:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}
.btn-group .btn-action:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}
.btn-group .btn-action + .btn-action { margin-left: -1px; }
.btn-group .btn-action:hover,
.btn-group .btn-action:focus {
  position: relative;
  z-index: 1;
}

/* ---------- Tables ---------- */
.table thead th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  color: #495057;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.table td { vertical-align: middle; }
.table .actions { white-space: nowrap; }

/* ---------- Pagination ---------- */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.pagination .page-item.active .page-link {
  background-color: var(--lo-primary);
  border-color: var(--lo-primary);
  color: #fff;
}
.pagination .page-link { color: var(--lo-primary); }
.pagination .page-link:hover {
  color: var(--lo-primary-dark);
  background-color: rgba(var(--lo-primary-rgb), .08);
}
.pagination .page-item.disabled .page-link { color: #adb5bd; }
.page-size-select {
  width: auto;
  display: inline-block;
}

/* ---------- Modals ---------- */
.modal-header.modal-header-lo {
  background: var(--lo-primary);
  color: #fff;
}
.modal-header.modal-header-lo .close,
.modal-header.bg-danger .close {
  color: #fff;
  opacity: .85;
  text-shadow: none;
}

/* ---------- Dashboard ---------- */
.welcome-card {
  border-top: 4px solid var(--lo-primary);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}
.welcome-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(var(--lo-primary-rgb), .1);
  color: var(--lo-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.stat-card .inner h3 { font-weight: 600; }
.bg-lo {
  background-color: var(--lo-primary) !important;
  color: #fff !important;
}
.small-box.bg-lo > .icon > i { color: rgba(255, 255, 255, .2); }

.dash-card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  border-top: 3px solid var(--lo-primary);
  margin-bottom: 20px;
}
.dash-card .card-header {
  background: #fff;
  border-bottom: 1px solid #f1f3f5;
  padding: 14px 18px;
}
.dash-card .card-title {
  font-weight: 600;
  color: #212529;
}

/* iCheck in main color */
.icheck-primary > input:first-child:checked + label::before,
.icheck-primary > input:first-child:checked + input[type="hidden"] + label::before {
  background-color: var(--lo-primary);
  border-color: var(--lo-primary);
}
.icheck-primary > input:first-child:not(:checked):not(:disabled):hover + label::before {
  border-color: var(--lo-primary);
}

/* Breadcrumb */
.breadcrumb a { color: var(--lo-primary); }
.breadcrumb a:hover { color: var(--lo-primary-dark); }

/* ---------- Context banner (parent entity) ---------- */
.context-banner {
  background: linear-gradient(135deg, var(--lo-sidebar-bg) 0%, var(--lo-primary) 100%);
  color: #fff;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .08);
}
.context-banner .ctx-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: var(--lo-primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-right: 14px;
  flex-shrink: 0;
}
.context-banner .ctx-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: rgba(255, 255, 255, .6);
}
.context-banner .ctx-name {
  font-size: 1.15rem;
  font-weight: 600;
}
.context-banner .btn-ctx {
  color: #fff;
  border-color: rgba(255, 255, 255, .5);
}
.context-banner .btn-ctx:hover {
  background: #fff;
  color: var(--lo-primary);
}

/* ---------- Coordinates ---------- */
.coords {
  font-family: SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem;
  white-space: nowrap;
}
.coords a { color: var(--lo-primary); }
.coords a:hover { text-decoration: underline; }

/* ---------- Language tabs ---------- */
.lang-tabs .nav-link {
  color: #495057;
  border: 1px solid transparent;
  border-bottom: none;
  padding: 6px 14px;
  font-weight: 500;
  font-size: .85rem;
}
.lang-tabs .nav-link.active {
  color: var(--lo-primary);
  border-color: #dee2e6 #dee2e6 #fff;
  background-color: #fff;
}
.lang-tabs .nav-link .lang-required {
  color: #dc3545;
  margin-left: 2px;
}
.lang-tab-content {
  border: 1px solid #dee2e6;
  border-top: none;
  padding: 14px;
  border-radius: 0 0 4px 4px;
  background: #fff;
}

/* ---------- Modules ---------- */
.module-name {
  display: flex;
  align-items: center;
}
.module-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(var(--lo-primary-rgb), .1);
  color: var(--lo-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}
.module-name .m-title {
  font-weight: 600;
  color: #212529;
  line-height: 1.2;
}
.module-name .m-desc {
  font-size: .8rem;
  color: #6c757d;
}

/* ---------- Switch (status) ---------- */
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--lo-primary);
  border-color: var(--lo-primary);
}
.custom-switch .custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 .2rem rgba(var(--lo-primary-rgb), .25);
}
.custom-switch .custom-control-input:focus:not(:checked) ~ .custom-control-label::before {
  border-color: var(--lo-primary-light);
}
.custom-switch .custom-control-label { cursor: pointer; }
.custom-switch .custom-control-input:disabled ~ .custom-control-label { cursor: not-allowed; }

/* ---------- Notifications ---------- */
.badge-scheduled {
  display: inline-block;
  font-weight: 600;
  font-size: .8rem;
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(var(--lo-primary-rgb), .12);
  color: var(--lo-primary);
}
.channel-chip {
  display: inline-flex;
  align-items: center;
  background: #f1f3f5;
  color: #495057;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
}
.channel-chip i {
  color: var(--lo-primary);
  margin-right: 6px;
  font-size: .8rem;
}

/* ---------- Users ---------- */
.user-cell {
  display: flex;
  align-items: center;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(var(--lo-primary-rgb), .1);
  color: var(--lo-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .85rem;
  margin-right: 10px;
  flex-shrink: 0;
}
.user-cell .u-name {
  font-weight: 600;
  color: #212529;
  line-height: 1.2;
}
.user-cell .u-username {
  font-size: .8rem;
  color: #6c757d;
}
.role-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
}
.role-chip i { margin-right: 5px; font-size: .75rem; }
.role-super  { background: rgba(var(--lo-primary-rgb), .12); color: var(--lo-primary); }
.role-admin  { background: rgba(23, 162, 184, .12); color: #138496; }
.role-editor { background: rgba(111, 66, 193, .12); color: #6f42c1; }
.role-viewer { background: rgba(108, 117, 125, .15); color: #6c757d; }

/* ---------- Checkboxes (main color) ---------- */
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--lo-primary);
  border-color: var(--lo-primary);
}
.custom-checkbox .custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 .2rem rgba(var(--lo-primary-rgb), .25);
}
.custom-checkbox .custom-control-label { cursor: pointer; }

/* ---------- Roles & permissions ---------- */
.perm-progress {
  display: flex;
  align-items: center;
}
.perm-progress .progress {
  flex: 1;
  margin: 0 10px 0 0;
  background: #e9ecef;
}
.perm-progress span {
  margin-left: 8px;
  min-width: 44px;
  text-align: right;
  white-space: nowrap;
}
.perm-table td,
.perm-table th { vertical-align: middle; }
.perm-table td:first-child,
.perm-table th:first-child { padding-left: 1.25rem; }
.perm-table .custom-control {
  display: inline-block;
  min-height: 1.5rem;
  padding-left: 1.5rem;
}
.perm-table td:nth-child(2) { background: rgba(var(--lo-primary-rgb), .04); }

.role-options .role-option {
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.role-options .role-option:last-child { margin-bottom: 0; }
.role-options .custom-control-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}
.role-option-desc {
  font-weight: 400;
  font-size: .85rem;
  color: #6c757d;
  margin-left: 10px;
}

/* Radios (main color) */
.custom-radio .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--lo-primary);
  border-color: var(--lo-primary);
}
.custom-radio .custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 .2rem rgba(var(--lo-primary-rgb), .25);
}
.custom-radio .custom-control-label { cursor: pointer; }

/* Sidebar submenu */
.sidebar-lo .nav-treeview > .nav-item > .nav-link { padding-left: 1.6rem; }
.sidebar-lo .nav-treeview .nav-icon { font-size: .7rem; }
.sidebar-lo .nav-sidebar > .nav-item.menu-open > .nav-link:not(.active) { color: #fff; }

/* ---------- Settings ---------- */
.settings-card {
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  border-top: 3px solid var(--lo-primary);
}
.settings-nav .nav-link {
  color: #495057;
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  font-weight: 500;
  margin-bottom: 4px;
}
.settings-nav .nav-link i {
  width: 22px;
  color: #adb5bd;
  margin-right: 10px;
}
.settings-nav .nav-link:hover {
  background: rgba(var(--lo-primary-rgb), .06);
  color: var(--lo-primary);
}
.settings-nav .nav-link.active {
  background: var(--lo-primary);
  color: #fff;
}
.settings-nav .nav-link.active i { color: #fff; }
.settings-nav .nav-link small {
  display: block;
  font-weight: 400;
  font-size: .75rem;
  color: #6c757d;
  margin-top: 2px;
}
.settings-nav .nav-link.active small { color: rgba(255, 255, 255, .75); }

.section-title {
  font-weight: 600;
  color: #212529;
  margin-bottom: 4px;
}
.section-desc {
  color: #6c757d;
  margin-bottom: 20px;
}
.settings-subhead {
  text-transform: uppercase;
  color: #6c757d;
  font-size: .8rem;
  letter-spacing: .5px;
  margin: 1.5rem 0 1rem;
}
.field-help {
  font-size: .8rem;
  color: #6c757d;
  margin-top: 4px;
}

.logo-upload {
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-box {
  width: 92px;
  height: 92px;
  border-radius: 10px;
  background: #f8f9fa;
  border: 1px dashed #ced4da;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 28px;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-box img {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f1f3f5;
}
.toggle-row .label-wrap { flex: 1; }
.toggle-row .label-wrap label {
  margin-bottom: 2px;
  font-weight: 500;
  color: #343a40;
}
.toggle-row .label-wrap .hint {
  font-size: .8rem;
  color: #6c757d;
}

.save-bar {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  margin-top: 24px;
  border-top: 1px solid #f1f3f5;
}
.toggle-row:has(+ .save-bar) { border-bottom: none; }

/* Logo preview (upload) */
.logo-box img[src=""] { display: none; }
.logo-box.has-image > i { display: none; }
.logo-box.has-image {
  border-style: solid;
  background: #fff;
}
.custom-file-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.custom-file-input:focus ~ .custom-file-label {
  border-color: var(--lo-primary-light);
  box-shadow: 0 0 0 .2rem rgba(var(--lo-primary-rgb), .25);
}

/* ===== Portal ===== */
/* A validation summary with no errors (asp-validation-summary renders it with .validation-summary-valid) is hidden. */
.empty-hide.validation-summary-valid { display: none; }
.empty-hide ul { margin: 0; padding-left: 1rem; }

/* Lists: a small image in a row (brand logo, category image) */
.list-thumb { width: 40px; height: 40px; object-fit: contain; border: 1px solid #e3e6ea; border-radius: 6px; background: #fff; }

/* Banners: wide upload boxes (the app's and the website's slider) and their thumbnails in the list */
.logo-upload.banner-upload { flex-direction: column; align-items: stretch; gap: 8px; }
.logo-upload.banner-upload .logo-box { width: 100%; height: 130px; }
.logo-upload.banner-upload-web .logo-box { height: 90px; }
.logo-upload.banner-upload .logo-box img { width: 100%; height: 100%; object-fit: contain; }
.banner-thumb { height: 44px; max-width: 132px; object-fit: contain; border: 1px solid #e3e6ea; border-radius: 6px; background: #fff; }
.banner-thumb-empty { display: inline-block; width: 88px; height: 44px; border: 1px dashed #ced4da; border-radius: 6px; background: #f8f9fa; }
.banner-platform { border: 1px solid #e3e6ea; border-radius: 8px; padding: 14px 14px 0; margin-bottom: 16px; }
.banner-platform-title { font-weight: 600; margin-bottom: 4px; }
.lang-tab-content .banner-platform:last-child { margin-bottom: 0; }

/* An upload in progress */
.logo-upload.uploading .logo-box { opacity: .5; }

/* Product: the category tree with its main-category radio */
.category-picker { max-height: 320px; overflow-y: auto; padding: 6px 0; background: #fff; }
.category-picker .category-item { padding-top: 3px; padding-bottom: 3px; }
.category-picker .category-item:hover { background: rgba(var(--lo-primary-rgb), .05); }


/* Option values table */
.values-table td { vertical-align: middle; }
.values-table .color-pick { height: calc(1.8125rem + 2px); }
.values-table .color-pick.color-empty { opacity: .3; }
#optionValues.no-colors .color-col { display: none; }

/* Category: the attributes it lists */

/* Product: an attribute row of the specifications tab */
.attr-row .attr-name { width: 30%; }
.attr-row.attr-hidden { display: none; }

/* Filter zone: its title opens and collapses it too */
.filter-card .filter-toggle { cursor: pointer; user-select: none; }

/* Toasts: top right, under the navbar (not over the user menu) */
#toastsContainerTopRight { top: calc(57px + .5rem); right: .5rem; z-index: 1060; }

/* ---------- Notifications: the customer picker ---------- */
.picker-results, .picker-picked { max-height: 280px; overflow-y: auto; }
.picker-results .list-group-item.disabled { opacity: .45; }

/* ---------- Customers: marketing consent icons ---------- */
.consent-off { color: #adb5bd; opacity: .45; }

/* ---------- Orders: the buttons that move an order on ---------- */
.order-moves .btn { margin-right: .25rem; }
