/* ==========================================================================
 *  Wienerberger look & feel for the POS tool backend (wb-app.css)
 * ==========================================================================
 *  Loaded AFTER sb-admin-2.min.css, theme.php and custom.css so it wins the
 *  cascade. It re-skins the SB Admin 2 / Bootstrap 4 components the backend
 *  already uses (sidebar, topbar, cards, buttons, forms, tables, modals,
 *  badges, pagination, DataTables, bootstrap-select) with the Wienerberger
 *  design tokens: flat / square aesthetic, black primary actions, red as
 *  brand accent, no card shadows, square corners.
 *  No markup IDs or JS hooks are changed - only appearance.
 * ========================================================================== */

:root {
  --wb-red: #DC1E24;
  --wb-red-dark: #B81820;
  --wb-primary: #0f172a;
  --wb-primary-hover: #1e293b;
  --wb-primary-active: #020617;
  --wb-text: #0f172a;
  --wb-text-muted: #64748b;
  --wb-text-label: #334155;
  --wb-text-subtle: #94a3b8;
  --wb-bg: #ffffff;
  --wb-bg-subtle: #f8fafc;
  --wb-disabled-bg: #f1f5f9;
  --wb-border: #e2e8f0;
  --wb-border-strong: #cbd5e1;
  --wb-error-bg: #fef2f2;
  --wb-error-text: #991b1b;
  --wb-error-border: #fecaca;
  --wb-success-bg: #ecfdf5;
  --wb-success-text: #065f46;
  --wb-success-border: #a7f3d0;
  --wb-warning-bg: #fffbeb;
  --wb-warning-text: #92400e;
  --wb-warning-border: #fde68a;
  --wb-radius: 0px;
  --wb-shadow-focus: 0 0 0 3px rgba(15, 23, 42, 0.12);
  --wb-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --wb-sidebar-width: 14rem;
}

/* ===== Base ===== */
body {
  color: var(--wb-text);
  background-color: var(--wb-bg-subtle);
  font-size: 0.95rem;
  line-height: 1.5;
}
a { color: var(--wb-primary); }
a:hover { color: var(--wb-red); text-decoration: underline; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--wb-text); }
label { color: var(--wb-text-label); font-weight: 600; font-size: 0.85rem; }
hr { border-top-color: var(--wb-border); }
.text-primary { color: var(--wb-primary) !important; }
.text-gray-800, .text-gray-900 { color: var(--wb-text) !important; }
.text-gray-700 { color: var(--wb-text-label) !important; }
.text-gray-600 { color: var(--wb-text-muted) !important; }
.text-gray-300, .text-gray-400 { color: var(--wb-text-subtle) !important; }
.text-white-50 { color: rgba(255, 255, 255, 0.7) !important; }

/* Kill every SB Admin 2 shadow: the Wienerberger UI is flat */
.shadow, .shadow-sm, .shadow-lg,
.card.shadow, .navbar.shadow,
.sidebar .nav-item .collapse .collapse-inner,
.sidebar.toggled .nav-item .collapse .collapse-inner {
  box-shadow: none !important;
}
.rounded, .rounded-lg { border-radius: var(--wb-radius) !important; }

/* ===== Layout (PROplus): fixed full-width topbar, sidebar underneath ===== */
:root { --wb-sidebar-w: 240px; --wb-topbar-h: 60px; }
#wrapper { top: var(--wb-topbar-h) !important; }
body.sidebar-toggled #wrapper { top: var(--wb-topbar-h) !important; }
#wrapper #content-wrapper { background: var(--wb-bg-subtle); }
#content-wrapper .container-fluid { padding: 0 1.5rem 1.5rem; }
body { min-width: 0 !important; }

/* ===== Sidebar (white, section labels, brand-red active indicator) ===== */
.sidebar,
.sidebar.bg-gradient-primary,
ul.navbar-nav.bg-gradient-primary.sidebar {
  background: var(--wb-bg) !important;
  background-image: none !important;
  border-right: 1px solid var(--wb-border);
  min-height: 100%;
  padding-top: 0.5rem;
}
@media (min-width: 768px) {
  .sidebar { width: var(--wb-sidebar-w) !important; }
  .sidebar.toggled { width: var(--wb-sidebar-w) !important; overflow: visible; }
  .sidebar.toggled .nav-item .nav-link { text-align: left; width: 100% !important; }
  .sidebar.toggled .nav-item .nav-link span { display: inline; font-size: 0.88rem; }
  .sidebar.toggled .nav-item .nav-link i { margin-right: 0.25rem; }
}
.sidebar .sidebar-brand,
.sidebar.sidebar-dark .sidebar-brand { display: none; }
.sidebar .nav-section {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wb-text-subtle);
  padding: 1.1rem 1.25rem 0.35rem;
  font-weight: 700;
  list-style: none;
}
.sidebar hr.sidebar-divider,
.sidebar.sidebar-dark hr.sidebar-divider {
  border-top: 1px solid var(--wb-border);
  margin: 0.35rem 0.75rem;
}
.sidebar .nav-item:last-child { margin-bottom: 1rem; }
.sidebar.sidebar-dark .nav-item .nav-link {
  color: var(--wb-text-label);
  font-weight: 600;
  font-size: 0.88rem;
  border-left: 2px solid transparent;
  padding: 0.5rem 1.25rem !important;
  border-radius: var(--wb-radius);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.sidebar.sidebar-dark .nav-item .nav-link i { color: var(--wb-text-subtle); font-size: 1rem; width: 1.1rem; text-align: center; margin-right: 0; }
.sidebar.sidebar-dark .nav-item .nav-link span { font-size: 0.88rem; }
.sidebar.sidebar-dark .nav-item .nav-link:hover,
.sidebar.sidebar-dark .nav-item .nav-link:focus {
  color: var(--wb-text);
  background: var(--wb-disabled-bg);
  text-decoration: none;
}
.sidebar.sidebar-dark .nav-item .nav-link:hover i,
.sidebar.sidebar-dark .nav-item .nav-link:focus i { color: var(--wb-text-label); }
.sidebar.sidebar-dark .nav-item.active .nav-link {
  color: var(--wb-red);
  border-left-color: var(--wb-red);
  background: var(--wb-bg);
}
.sidebar.sidebar-dark .nav-item.active .nav-link i { color: var(--wb-red); }
.sidebar.sidebar-dark .nav-item .nav-link.disabled { color: var(--wb-text-subtle); opacity: 0.55 !important; }
.sidebar.sidebar-dark .nav-item .nav-link i.wb-nav-alert,
.sidebar.sidebar-dark .nav-item .nav-link:hover i.wb-nav-alert { color: var(--wb-red) !important; font-size: 11px; width: auto; margin-left: 0.25rem; }
/* mobile icon rail (sb-admin: 6.5rem below 768px) */
@media (max-width: 767.98px) {
  .sidebar .nav-section { display: none; }
  .sidebar.sidebar-dark .nav-item .nav-link { display: block; text-align: center; padding: 0.75rem 0.5rem !important; border-left: 0; border-top: 2px solid transparent; }
  .sidebar.sidebar-dark .nav-item.active .nav-link { border-top-color: var(--wb-red); }
  .sidebar.sidebar-dark .nav-item .nav-link i { display: block; margin: 0 auto 0.2rem; width: auto; }
  .sidebar.sidebar-dark .nav-item .nav-link span { font-size: 0.65rem; display: block; }
}
/* demo badge inside sidebar */
.sidebar .card.bg-danger { background: var(--wb-red) !important; border-radius: 0 !important; }

/* ===== Topbar (fixed, full width, logo left) ===== */
.topbar,
nav.navbar.topbar.bg-white {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: var(--wb-topbar-h) !important;
  padding: 0 1.5rem !important;
  background: var(--wb-bg) !important;
  border-bottom: 1px solid var(--wb-border);
  box-shadow: none !important;
}
.topbar .topbar-brand { display: inline-flex; align-items: center; height: 100%; margin-right: 1rem; }
.topbar .brand-logo { height: 28px; width: auto; display: block; }
.topbar .navbar-nav { align-items: center; gap: 0.25rem; }
.topbar .nav-item .nav-link,
.topbar.navbar-light .navbar-nav .nav-item .nav-link {
  height: auto !important;
  padding: 0.4rem 0.6rem !important;
  color: var(--wb-text-label);
  font-weight: 600;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.topbar .nav-item .nav-link i { font-size: 1rem; color: var(--wb-text-muted); }
.topbar.navbar-light .navbar-nav .nav-item .nav-link:hover { color: var(--wb-red); }
.topbar .nav-item .nav-link:hover i { color: var(--wb-red); }
.topbar .nav-item.dropdown .dropdown-toggle::after {
  content: '';
  float: none;
  display: inline-block;
  width: 0; height: 0;
  margin-left: 0.15rem;
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-left: 0.3em solid transparent;
  vertical-align: 0.15em;
  font-family: inherit;
}
.topbar .dropdown .dropdown-menu { width: auto; right: 0; min-width: 11rem; }
.topbar .lang_switcher .dropdown-menu { max-height: calc(100vh - 80px); overflow-y: auto; }
.topbar #sidebarToggleTop { border-radius: var(--wb-radius) !important; color: var(--wb-text-label); height: 2.25rem; width: 2.25rem; padding: 0; margin-right: 0.75rem !important; }
.topbar #sidebarToggleTop:hover { background: var(--wb-disabled-bg); }
.topbar .topbar-divider { display: none; }
.topbar .header_menu_title { display: none; }

/* ===== Page header (title + breadcrumb + page actions), sticky under the topbar ===== */
.page-header {
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 1.1rem 1.5rem 0.9rem;
  margin: 0 0 0.5rem;
  background: var(--wb-bg-subtle);
}
.page-header h1 { font-size: 1.35rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; color: var(--wb-text); }
.page-header .breadcrumb { background: transparent; padding: 0; margin: 0.15rem 0 0; font-size: 0.82rem; border-radius: 0; }
.page-header .breadcrumb-item { color: var(--wb-text-label); }
.page-header .breadcrumb-item a { color: var(--wb-text-label); }
.page-header .breadcrumb-item a:hover { color: var(--wb-red); text-decoration: none; }
.page-header .breadcrumb-item + .breadcrumb-item::before { color: var(--wb-text-subtle); }
.page-header .breadcrumb-item.active { color: var(--wb-text-muted); }
.page-header-actions { display: flex; align-items: center; }
@media (min-width: 992px) {
  .page-header-main { display: flex; align-items: baseline; gap: 1rem; flex: 1 1 auto; }
  .page-header .breadcrumb { margin: 0 0 0 auto; }
}
/* Page actions that used to sit in a separate sticky bar (map selector / SAVE) */
.page-header-actions .map_select_header {
  position: static;
  min-height: 0;
  width: auto;
  text-align: right;
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-header-actions .map_select_header #save_btn,
.page-header-actions .map_select_header .tooltip_arrows,
.page-header-actions .map_select_header .btn-danger { margin-top: 0; }
.page-header-actions .quick_action { margin-left: 0.25rem; }
.map_selector_btn,
.bootstrap-select > .dropdown-toggle.map_selector_btn {
  color: var(--wb-text);
  background: var(--wb-bg);
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius);
  font-weight: 600;
  margin-top: 0;
  min-height: 40px;
}
.bootstrap-select > .dropdown-toggle.map_selector_btn:hover { background: var(--wb-disabled-bg); }
.map_select_header .quick_action i { color: var(--wb-text-muted); }
.map_select_header .quick_action:hover i { color: var(--wb-red); }
#loading_header { line-height: 40px; color: var(--wb-text-subtle); }

/* ===== Cards / panels ===== */
.card {
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
  background: var(--wb-bg);
}
.card-header {
  background: var(--wb-bg);
  border-bottom: 1px solid var(--wb-border);
  color: var(--wb-text);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.25rem;
}
.card-header h6, .card-header .h6 { font-size: 0.95rem; color: var(--wb-text) !important; }
.card-header h6 i { color: var(--wb-red); }
.card-footer { background: var(--wb-bg-subtle); border-top: 1px solid var(--wb-border); }
/* Stat cards (PROplus): icon left, big value, uppercase label */
.stat-row { margin-bottom: 0.5rem; }
.stat-row > [class*="col-"] { margin-bottom: 1rem; }
.stat-card .card-body { display: flex; align-items: center; gap: 1rem; padding: 1.25rem; }
.stat-card .card-body > i { font-size: 1.6rem; color: var(--wb-text-subtle); width: 2.2rem; text-align: center; flex: 0 0 auto; }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--wb-text); line-height: 1.1; letter-spacing: -0.02em; }
.stat-card .stat-label { font-size: 0.72rem; color: var(--wb-text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; margin-top: 0.15rem; }
.dashboard-welcome { margin: 0 0 1rem; font-size: 0.9rem; }
.dashboard-welcome p { margin: 0; }
/* legacy SB Admin "border-left-*" cards used on other pages */
.card.border-left-primary,
.card.border-left-success,
.card.border-left-warning,
.card.border-left-info,
.card.border-left-danger { border-left: 1px solid var(--wb-border) !important; }
.card .text-warning { color: var(--wb-text-label) !important; }
/* map rows on the Maps page */
.div_map { border-left: 3px solid var(--wb-border) !important; }
.div_map:hover { border-left-color: var(--wb-red) !important; background: var(--wb-bg-subtle); }

/* ===== Buttons ===== */
.btn {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  padding: 0.55rem 1rem;
  border-radius: var(--wb-radius);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:focus, .btn.focus, .btn:focus-visible { outline: none; box-shadow: var(--wb-shadow-focus) !important; }
.btn-sm, .btn-group-sm > .btn { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.btn-lg, .btn-group-lg > .btn { padding: 0.75rem 1.4rem; font-size: 1rem; }
/* Solid black: primary actions (save, create, publish, preview, login) */
.btn-primary, .btn-success, .btn-dark,
.btn-primary:not(:disabled):not(.disabled).active,
.btn-success:not(:disabled):not(.disabled).active,
.btn-dark:not(:disabled):not(.disabled).active {
  color: #fff !important;
  background: var(--wb-primary) !important;
  border-color: var(--wb-primary) !important;
}
.btn-primary:hover, .btn-success:hover, .btn-dark:hover,
.btn-primary:focus, .btn-success:focus, .btn-dark:focus {
  color: #fff !important;
  background: var(--wb-primary-hover) !important;
  border-color: var(--wb-primary-hover) !important;
}
.btn-primary:not(:disabled):not(.disabled):active,
.btn-success:not(:disabled):not(.disabled):active,
.btn-dark:not(:disabled):not(.disabled):active {
  background: var(--wb-primary-active) !important;
  border-color: var(--wb-primary-active) !important;
}
.btn-primary.disabled, .btn-primary:disabled,
.btn-success.disabled, .btn-success:disabled,
.btn-dark.disabled, .btn-dark:disabled {
  background: var(--wb-text-subtle) !important;
  border-color: var(--wb-text-subtle) !important;
  color: #fff !important;
}
/* Ghost / outline: secondary actions (edit, duplicate, markers, close, cancel) */
.btn-secondary, .btn-info, .btn-warning, .btn-light,
.btn-outline-primary, .btn-outline-secondary {
  color: var(--wb-text-label) !important;
  background: var(--wb-bg) !important;
  border-color: var(--wb-border-strong) !important;
}
.btn-secondary:hover, .btn-info:hover, .btn-warning:hover, .btn-light:hover,
.btn-outline-primary:hover, .btn-outline-secondary:hover,
.btn-secondary:focus, .btn-info:focus, .btn-warning:focus, .btn-light:focus {
  color: var(--wb-text) !important;
  background: var(--wb-disabled-bg) !important;
  border-color: var(--wb-border-strong) !important;
}
.btn-secondary:not(:disabled):not(.disabled):active,
.btn-info:not(:disabled):not(.disabled):active,
.btn-warning:not(:disabled):not(.disabled):active {
  background: var(--wb-border) !important;
  border-color: var(--wb-border-strong) !important;
  color: var(--wb-text) !important;
}
/* Red: destructive actions (outline variant = red ghost) */
.btn-danger {
  color: #fff !important;
  background: var(--wb-red) !important;
  border-color: var(--wb-red) !important;
}
.btn-danger:hover, .btn-danger:focus,
.btn-danger:not(:disabled):not(.disabled):active {
  background: var(--wb-red-dark) !important;
  border-color: var(--wb-red-dark) !important;
  color: #fff !important;
}
.btn-outline-danger {
  color: var(--wb-red) !important;
  background: var(--wb-bg) !important;
  border-color: var(--wb-red) !important;
}
.btn-outline-danger:hover, .btn-outline-danger:focus,
.btn-outline-danger:not(:disabled):not(.disabled):active {
  color: #fff !important;
  background: var(--wb-red) !important;
  border-color: var(--wb-red) !important;
}
.btn-link { color: var(--wb-primary); font-weight: 600; }
.btn-link:hover { color: var(--wb-red); }
.btn-circle, .btn-circle.btn-sm, .btn-circle.btn-lg { border-radius: var(--wb-radius); }
.btn-icon-split .icon { background: rgba(0, 0, 0, 0.25); }
.btn-icon-split.btn-secondary .icon,
.btn-icon-split.btn-info .icon,
.btn-icon-split.btn-warning .icon { background: var(--wb-disabled-bg); color: var(--wb-text-muted) !important; }
.map_buttons .btn { border-radius: var(--wb-radius) !important; margin-left: 2px; }
.btn-block + .btn-block { margin-top: 0.5rem; }

/* ===== Forms ===== */
.form-control,
.custom-select,
.form-control-user {
  color: var(--wb-text);
  background: var(--wb-bg);
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius) !important;
  font-size: 0.9rem;
  padding: 0.5rem 0.65rem;
  height: auto;
  min-height: calc(1.5em + 1rem + 2px);
}
.form-control::placeholder { color: var(--wb-text-subtle); }
.form-control:focus, .custom-select:focus {
  color: var(--wb-text);
  border-color: var(--wb-primary) !important;
  box-shadow: var(--wb-shadow-focus) !important;
  outline: none;
}
.form-control:disabled, .form-control[readonly] { background: var(--wb-disabled-bg); color: var(--wb-text-muted); }
.form-control-sm { padding: 0.35rem 0.5rem; font-size: 0.82rem; min-height: 0; }
textarea.form-control { min-height: 5rem; }
.form-group { margin-bottom: 1rem; }
.form-text, .text-muted, small.text-muted { color: var(--wb-text-muted) !important; }
.input-highlight { border-color: var(--wb-primary) !important; box-shadow: var(--wb-shadow-focus) !important; }
.error-highlight { border-color: var(--wb-red) !important; box-shadow: 0 0 0 3px rgba(220, 30, 36, 0.15) !important; }
.style-highlight { border-color: var(--wb-primary) !important; box-shadow: 0 0 0 2px var(--wb-primary) !important; }
.image-highlight { border-color: var(--wb-primary) !important; box-shadow: 0 0 0 2px var(--wb-primary) !important; }
.input-group-text {
  background: var(--wb-bg-subtle);
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius) !important;
  color: var(--wb-text-label);
  font-size: 0.85rem;
}
.custom-file-label,
.custom-file-label::after {
  border-radius: var(--wb-radius) !important;
  border-color: var(--wb-border-strong);
  color: var(--wb-text-label);
  height: auto;
  min-height: calc(1.5em + 1rem + 2px);
}
.custom-file-label::after { background: var(--wb-primary); color: #fff; font-weight: 600; }
.custom-file-input:focus ~ .custom-file-label { border-color: var(--wb-primary); box-shadow: var(--wb-shadow-focus); }
.form-control-range { accent-color: var(--wb-primary); }
/* bootstrap-select */
.bootstrap-select > .dropdown-toggle,
.bootstrap-select > .dropdown-toggle.btn-light,
.bootstrap-select > .dropdown-toggle.bs-placeholder {
  color: var(--wb-text);
  background: var(--wb-bg) !important;
  border: 1px solid var(--wb-border-strong) !important;
  border-radius: var(--wb-radius) !important;
  font-weight: 500;
}
.bootstrap-select > .dropdown-toggle:focus { box-shadow: var(--wb-shadow-focus) !important; border-color: var(--wb-primary) !important; }
.bootstrap-select .dropdown-menu li a.active, .bootstrap-select .dropdown-menu li a:active,
.bootstrap-select .dropdown-menu li.selected a { background: var(--wb-primary) !important; color: #fff !important; }
.bootstrap-select .bs-searchbox .form-control { border-radius: var(--wb-radius) !important; }
/* bootstrap4-toggle */
.toggle.btn { border-radius: var(--wb-radius) !important; }
.toggle-handle { border-radius: var(--wb-radius) !important; }
.toggle-on.btn, .toggle-on.btn-primary, .toggle-on.btn-success { background: var(--wb-primary) !important; border-color: var(--wb-primary) !important; }
.toggle-off.btn { background: var(--wb-disabled-bg) !important; border-color: var(--wb-border-strong) !important; color: var(--wb-text-muted) !important; }
/* spectrum color picker */
.sp-replacer { border-radius: var(--wb-radius); border-color: var(--wb-border-strong); background: var(--wb-bg); }
/* Quill editor & ace editor frames */
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--wb-border-strong) !important; }
.extra_field_value, #description_mc, #description_mc_edit, #description_story, #description_story_edit, #extra_button_value_1 {
  border: 1px solid var(--wb-border-strong) !important;
}
.ace_editor { border: 1px solid var(--wb-border-strong); }

/* ===== Dropdowns ===== */
.dropdown-menu {
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius);
  color: var(--wb-text);
  font-size: 0.88rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}
.dropdown-item { color: var(--wb-text-label); font-weight: 500; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--wb-disabled-bg); color: var(--wb-text); }
.dropdown-item.active, .dropdown-item:active { background: var(--wb-primary); color: #fff; }
.dropdown-divider { border-top-color: var(--wb-border); }
.lang_active { color: var(--wb-red) !important; }

/* ===== Badges (PROplus: uppercase, pastel, hairline border) ===== */
.badge {
  padding: 0.28rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: var(--wb-radius) !important;
  border: 1px solid transparent;
}
.badge-pill { border-radius: var(--wb-radius) !important; }
.badge-primary, .badge-info, .badge-dark { background: var(--wb-disabled-bg) !important; color: var(--wb-text-label) !important; border-color: var(--wb-border-strong); }
.badge-success { background: var(--wb-success-bg) !important; color: var(--wb-success-text) !important; border-color: var(--wb-success-border); }
.badge-secondary, .badge-warning, .badge-light { background: var(--wb-warning-bg) !important; color: var(--wb-warning-text) !important; border-color: var(--wb-warning-border); }
.badge-danger { background: var(--wb-error-bg) !important; color: var(--wb-error-text) !important; border-color: var(--wb-error-border); }
.badge-primary-soft, .bg-primary-soft { background: var(--wb-disabled-bg) !important; color: var(--wb-text-label) !important; }
.bg-primary { background: var(--wb-primary) !important; }
.bg-warning { background: var(--wb-red) !important; }
.bg-danger { background: var(--wb-red) !important; }
.bg-success { background: var(--wb-primary) !important; }

/* ===== Alerts ===== */
.alert { border-radius: var(--wb-radius); font-size: 0.875rem; padding: 0.75rem 1rem; }
.alert-danger { background: var(--wb-error-bg); color: var(--wb-error-text); border-color: var(--wb-error-border); }
.alert-success { background: var(--wb-success-bg); color: var(--wb-success-text); border-color: var(--wb-success-border); }
.alert-warning { background: var(--wb-warning-bg); color: var(--wb-warning-text); border-color: var(--wb-warning-border); }
.alert-info, .alert-primary, .alert-secondary { background: var(--wb-bg-subtle); color: var(--wb-text-label); border-color: var(--wb-border); }

/* ===== Progress ===== */
.progress { border-radius: var(--wb-radius); background: var(--wb-disabled-bg); height: 0.8rem; }
.progress-bar { background: var(--wb-primary); }
.progress-bar.bg-success { background: var(--wb-primary) !important; }
.progress-bar.bg-danger { background: var(--wb-red) !important; }

/* ===== Tables / DataTables ===== */
.table { color: var(--wb-text); background: var(--wb-bg); }
.table th, .table td { border-top: 1px solid var(--wb-border); padding: 0.65rem 0.85rem; font-size: 0.9rem; vertical-align: middle; }
.table thead th {
  background: var(--wb-bg-subtle);
  color: var(--wb-text-label);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--wb-border);
}
.table-bordered, .table-bordered th, .table-bordered td { border-color: var(--wb-border); }
.table-hover tbody tr:hover { background: var(--wb-bg-subtle); color: inherit; }
.table.dataTable thead .sorting:before, .table.dataTable thead .sorting:after,
.table.dataTable thead .sorting_asc:after, .table.dataTable thead .sorting_desc:after { color: var(--wb-text-subtle); }
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius);
  padding: 0.35rem 0.5rem;
  color: var(--wb-text);
  background: var(--wb-bg);
}
.dataTables_wrapper .dataTables_filter input:focus { outline: none; border-color: var(--wb-primary); box-shadow: var(--wb-shadow-focus); }
.dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_length label, .dataTables_wrapper .dataTables_filter label {
  color: var(--wb-text-muted);
  font-size: 0.85rem;
  font-weight: 400;
}
.dataTables_wrapper .dataTables_processing { border: 1px solid var(--wb-border); background: var(--wb-bg); color: var(--wb-text); }

/* ===== Pagination ===== */
.page-link {
  color: var(--wb-text-label);
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius) !important;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 4px;
}
.page-link:hover { color: var(--wb-text); background: var(--wb-disabled-bg); border-color: var(--wb-border-strong); }
.page-item.active .page-link { background: var(--wb-primary) !important; border-color: var(--wb-primary) !important; color: #fff; }
.page-item.disabled .page-link { color: var(--wb-text-subtle); border-color: var(--wb-border); }

/* ===== Modals ===== */
.modal-content { border: 1px solid var(--wb-border); border-radius: var(--wb-radius); }
.modal-header { border-bottom: 1px solid var(--wb-border); padding: 1rem 1.25rem; }
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--wb-text); }
.modal-body { padding: 1.25rem; color: var(--wb-text); }
.modal-footer { border-top: 1px solid var(--wb-border); }
.modal-backdrop { background: var(--wb-primary); }
.modal-backdrop.show { opacity: 0.55; }
.close { color: var(--wb-text-muted); text-shadow: none; opacity: 1; }
.close:hover { color: var(--wb-text); }

/* ===== Misc SB Admin bits ===== */
.scroll-to-top { background: var(--wb-primary); border-radius: var(--wb-radius) !important; }
.scroll-to-top:hover { background: var(--wb-red); }
footer.sticky-footer { background: var(--wb-bg) !important; border-top: 1px solid var(--wb-border); padding: 1rem 0.75rem !important; }
footer.sticky-footer .copyright { color: var(--wb-text-subtle); font-size: 0.8rem; }
footer.sticky-footer a { color: var(--wb-text-label); }
footer.sticky-footer a:hover { color: var(--wb-red); }
.spinner-border.text-primary { color: var(--wb-primary) !important; }
.tooltipster-sidetip.tooltipster-borderless .tooltipster-box { background: var(--wb-primary); border-radius: var(--wb-radius); }
.tooltipster-sidetip.tooltipster-borderless.tooltipster-top .tooltipster-arrow-border { border-top-color: var(--wb-primary); }
.tooltipster-sidetip.tooltipster-borderless.tooltipster-bottom .tooltipster-arrow-border { border-bottom-color: var(--wb-primary); }
.tooltipster-sidetip.tooltipster-borderless.tooltipster-left .tooltipster-arrow-border { border-left-color: var(--wb-primary); }
.tooltipster-sidetip.tooltipster-borderless.tooltipster-right .tooltipster-arrow-border { border-right-color: var(--wb-primary); }
.image_icon, .image_icon img { border-radius: var(--wb-radius); }
.image_icon:before { border-radius: var(--wb-radius); }
.map_style img { border: 1px solid var(--wb-border); }
.highlight { background: var(--wb-primary) !important; color: #fff !important; }
.selected_room { background: var(--wb-disabled-bg) !important; }
.facebook-preview__content { background: var(--wb-bg-subtle); border: 1px solid var(--wb-border); border-top: 0; }
.facebook-preview__title { color: var(--wb-text); }
.facebook-preview__url, .facebook-preview__description { color: var(--wb-text-muted); }
.list-group-item { border-color: var(--wb-border); border-radius: 0 !important; }
.list-group-item.active { background: var(--wb-primary); border-color: var(--wb-primary); }
.nav-tabs .nav-link { border-radius: 0; color: var(--wb-text-label); font-weight: 600; }
.nav-tabs .nav-link.active { color: var(--wb-red); border-color: var(--wb-border) var(--wb-border) #fff; }
.nav-pills .nav-link { border-radius: 0; color: var(--wb-text-label); font-weight: 600; }
.nav-pills .nav-link.active { background: var(--wb-primary) !important; color: #fff; }
.jumbotron { background: var(--wb-bg); border: 1px solid var(--wb-border); border-radius: 0; }
img.rounded-circle.img-profile { border: 1px solid var(--wb-border); }
/* OpenLayers draw toolbar (Geometries page) */
.options li:hover { background: var(--wb-primary); }
.options li:before { background: var(--wb-primary); border-radius: var(--wb-radius); }

/* Focus visibility for keyboard users */
a:focus-visible, button:focus-visible, .nav-link:focus-visible { outline: none; box-shadow: var(--wb-shadow-focus); }


/* ===== Markers list (PROplus-style toolbar + table) ===== */
.wb-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}
.wb-toolbar-left, .wb-toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.wb-toolbar-bulk {
  background: var(--wb-warning-bg);
  border: 1px solid var(--wb-warning-border);
  padding: 0.6rem 1rem;
}
.wb-bulk-count { font-size: 0.9rem; color: var(--wb-warning-text); margin-right: 0.5rem; }
.wb-badge-btn { cursor: pointer; }
.wb-badge-btn:hover { background: var(--wb-warning-border) !important; }
.wb-table-card .card-body { padding: 0; }
.wb-table-card .dataTables_wrapper { padding: 0.75rem 1.25rem 1rem; }
.wb-table-card .dataTables_wrapper .row:first-child { margin-bottom: 0.5rem; }

/* --- Markers search: the field the team uses most, so it gets full width and a big target --- */
.wb-dt-search { margin-bottom: 0.75rem; }
.wb-dt-search .dataTables_filter { float: none; text-align: left; width: 100%; }
.wb-search { position: relative; display: block; }
.wb-search label { display: block; margin: 0; width: 100%; font-weight: 400; }
.wb-search .wb-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--wb-text-subtle);
  font-size: 0.95rem;
  pointer-events: none;
  z-index: 1;
}
input.wb-search-input,
.wb-search input[type="search"] {
  width: 100% !important;
  margin: 0 !important;
  min-height: 48px;
  padding: 0.6rem 2.75rem 0.6rem 2.6rem;
  /* 16px keeps iOS Safari from zooming in when the field gets focus */
  font-size: 16px;
  color: var(--wb-text);
  background: var(--wb-bg);
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius);
  -webkit-appearance: none;
  appearance: none;
}
input.wb-search-input::placeholder { color: var(--wb-text-subtle); }
input.wb-search-input:focus {
  outline: none;
  border-color: var(--wb-primary);
  box-shadow: var(--wb-shadow-focus);
}
/* the browser's own clear button would sit on top of ours */
input.wb-search-input::-webkit-search-cancel-button,
input.wb-search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.wb-search .wb-search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--wb-text-muted);
  cursor: pointer;
  z-index: 1;
}
.wb-search.has-value .wb-search-clear { display: inline-flex; }
.wb-search .wb-search-clear:hover { color: var(--wb-red); }
.wb-search .wb-search-clear:focus-visible { outline: none; box-shadow: var(--wb-shadow-focus); }
/* phones: 1.5x the height (72px instead of 48px), bigger text, icon and clear button,
   so the field is easy to hit with a thumb */
@media (max-width: 767.98px) {
  input.wb-search-input,
  .wb-search input[type="search"] {
    min-height: 72px;
    height: 72px;
    padding: 0.6rem 4.25rem 0.6rem 3.4rem;
    font-size: 20px;
    border-width: 2px;
  }
  .wb-search .wb-search-icon { left: 1.1rem; font-size: 1.4rem; }
  .wb-search .wb-search-clear { right: 6px; width: 60px; height: 60px; font-size: 1.4rem; }
}
/* length menu + result count sit on one quiet row under the search */
.wb-dt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.wb-dt-top .dataTables_length, .wb-dt-top .dataTables_info { float: none; padding: 0; margin: 0; }
.wb-dt-top .dataTables_length select { min-height: 36px; }
.wb-dt-bottom .dataTables_paginate { float: none; display: flex; justify-content: center; padding-top: 0.75rem; }
.wb-table-card table.dataTable { margin: 0 !important; border: 0; }
.wb-table-card .table th, .wb-table-card .table td { border-left: 0; border-right: 0; }
.wb-table-card .table thead th { border-top: 0; }
.wb-table-card .table tbody tr:last-child td { border-bottom: 0; }
.wb-table-card .dataTables_scrollBody, .wb-table-card .dataTables_scrollHead { border-bottom: 0 !important; }
.wb-table-card .dataTables_wrapper .dataTables_paginate { padding-top: 0.75rem; }
.wb-marker-name { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; white-space: nowrap; }
.wb-marker-name a { color: var(--wb-text); }
.wb-marker-name a:hover { color: var(--wb-red); text-decoration: none; }
.wb-marker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: 0 0 24px;
  background: var(--wb-disabled-bg);
}
.wb-marker-icon i { font-size: 9px; }
.wb-marker-icon-img { background: transparent; }
.wb-marker-icon-img img { width: 22px; height: 22px; object-fit: contain; }
.wb-flag { display: inline-block; width: 100%; text-align: center; color: var(--wb-text-subtle); font-size: 0.8rem; }
.wb-flag.is-on { color: var(--wb-success-text); }
#markers_table td.wb-col-centered, #markers_table td.wb-col-featured { text-align: center; }
.wb-order { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; width: 100%; }
.wb-order .order_icon { font-size: 16px; color: var(--wb-text-muted); padding: 0 3px; cursor: pointer; line-height: 1; }
.wb-order .order_icon:hover { color: var(--wb-red); outline: none; }
.wb-order-value { min-width: 1.5rem; text-align: center; font-weight: 600; color: var(--wb-text-label); }
.wb-row-actions { display: inline-flex; gap: 0.25rem; justify-content: flex-end; width: 100%; white-space: nowrap; }
.wb-row-actions .btn { line-height: 1; padding: 0.4rem 0.55rem; }
#markers_table td:last-child { text-align: right; }
#markers_table tbody tr.selected, #markers_table tbody tr.selected:hover { background: var(--wb-warning-bg) !important; }

/* ===== Marker images: upload bar, tile grid, preview modal ===== */
.wb-upload-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.wb-upload-bar .wb-upload-file { flex: 1 1 260px; margin: 0; }
.wb-upload-bar .custom-file-label { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-right: 6rem; }
.wb-upload-bar .btn { min-height: calc(1.5em + 1rem + 2px); }
.wb-upload-status { flex: 1 1 200px; min-width: 160px; }
.wb-upload-status .progress { height: 1.4rem; }
.wb-upload-status .progress-bar { font-size: 0.75rem; line-height: 1.4rem; }
.wb-gallery-hint { font-size: 0.82rem; margin: 0 0 0.75rem; }
.wb-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}
.wb-image-tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--wb-bg-subtle);
  border: 1px solid var(--wb-border);
  overflow: hidden;
  cursor: zoom-in;
}
.wb-image-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wb-image-tile.is-main { border-color: var(--wb-primary); box-shadow: inset 0 0 0 2px var(--wb-primary); }
.wb-image-tile.image-highlight { box-shadow: inset 0 0 0 2px var(--wb-primary); opacity: 1 !important; }
.wb-image-main {
  position: absolute;
  top: 8px;
  left: 8px;
  display: none;
  background: var(--wb-primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
}
.wb-image-tile.is-main .wb-image-main { display: inline-block; }
.wb-image-tools {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  padding: 6px;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.75), rgba(15, 23, 42, 0));
  opacity: 0;
  transition: opacity 0.15s ease;
}
.wb-image-tile:hover .wb-image-tools,
.wb-image-tile:focus-within .wb-image-tools { opacity: 1; }
@media (hover: none) { .wb-image-tools { opacity: 1; } }
.wb-tile-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--wb-bg);
  color: var(--wb-text);
  border: 1px solid var(--wb-border-strong);
  cursor: pointer;
  padding: 0;
  font-size: 0.8rem;
}
.wb-tile-btn:hover { background: var(--wb-primary); color: #fff; border-color: var(--wb-primary); }
.wb-tile-btn.wb-tile-btn-danger:hover { background: var(--wb-red); border-color: var(--wb-red); }
.wb-image-tile.is-main .wb-tile-btn[data-act="main"] { background: var(--wb-primary); color: #fff; border-color: var(--wb-primary); pointer-events: none; }
.wb-image-undo { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; }
.wb-image-undo .btn.wb-tile-btn { width: auto; height: auto; padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.wb-image-tile.is-deleted { cursor: default; border-color: var(--wb-error-border); }
.wb-image-tile.is-deleted img { opacity: 0.25; filter: grayscale(1); }
.wb-image-tile.is-deleted .wb-image-tools, .wb-image-tile.is-deleted .wb-image-main { display: none; }
.wb-image-tile.is-deleted .wb-image-undo { display: flex; }
.wb-image-preview-body { padding: 0; background: var(--wb-bg-subtle); text-align: center; }
.wb-image-preview-body img { max-width: 100%; max-height: 75vh; display: inline-block; }
#modal_image_preview .modal-dialog { max-width: 960px; }

/* ===== Bulk icon dialog (markers list) ===== */
.wb-bulk-field {
  border: 1px solid var(--wb-border);
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--wb-bg);
}
.wb-bulk-field .custom-control-label { font-weight: 600; color: var(--wb-text); font-size: 0.9rem; }
.wb-bulk-field-body { margin-top: 0.65rem; padding-left: 1.5rem; }
.wb-bulk-field-body.disabled { opacity: 0.45; pointer-events: none; }
.wb-bulk-field-body #bulk_icon_input { border: 1px solid var(--wb-border-strong); padding: 0.3rem 0.5rem; font-size: 0.85rem; max-width: 220px; }
.wb-bulk-preview {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--wb-bg-subtle);
  border: 1px solid var(--wb-border);
}
.wb-bulk-preview-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--wb-text-muted); }
.wb-bulk-preview-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--wb-red);
}
.wb-bulk-preview-marker i { font-size: 13px; color: #fff; }
#modal_bulk_library_icons .modal-body { max-height: 60vh; overflow-y: auto; }
#modal_bulk_library_icons img:hover { outline: 2px solid var(--wb-primary); }

/* Bootstrap custom checkboxes / radios in Wienerberger colours (Bootstrap default is blue) */
.custom-control-label::before { border: 1px solid var(--wb-border-strong); background: var(--wb-bg); border-radius: var(--wb-radius) !important; }
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before,
.custom-control-input:checked ~ .custom-control-label::before {
  background: var(--wb-primary) !important;
  border-color: var(--wb-primary) !important;
}
.custom-control-input:focus ~ .custom-control-label::before { box-shadow: var(--wb-shadow-focus) !important; border-color: var(--wb-primary); }
.custom-control-input:not(:disabled):active ~ .custom-control-label::before { background: var(--wb-primary-active); border-color: var(--wb-primary-active); }
.custom-radio .custom-control-label::before { border-radius: 50% !important; }
.custom-switch .custom-control-label::before { border-radius: 1rem !important; }


/* ===== Markers list on small screens ===== */
@media (max-width: 767.98px) {
  .wb-toolbar .btn { flex: 1 1 auto; justify-content: center; }
  .wb-table-card .dataTables_wrapper { padding: 0.75rem 0.75rem 1rem; }
  /* keep the search reachable while scrolling a long list */
  .wb-dt-search {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--wb-bg);
    padding: 0.5rem 0 0.6rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--wb-border);
  }
  .wb-dt-top { font-size: 0.8rem; }
  .wb-dt-top .dataTables_length { order: 2; }
  /* address, centered, featured and order drop away; name, category, status and actions stay */
  #markers_table .wb-col-address,
  #markers_table .wb-col-centered,
  #markers_table .wb-col-featured,
  #markers_table .wb-col-order { display: none; }
  #markers_table { width: 100% !important; }
  #markers_table th, #markers_table td { padding: 0.75rem 0.6rem; }
  .wb-marker-name { white-space: normal; }
  .wb-row-actions .btn { padding: 0.5rem 0.65rem; }
  .pagination { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 575.98px) {
  /* narrowest phones: name, status and the row actions are what matters */
  #markers_table .wb-col-category,
  #markers_table .wb-col-validated { display: none; }
  .wb-toolbar .btn { width: 100%; }
  .wb-dt-top { justify-content: flex-start; }
}

/* ===== Marker editor role: read-only Details card ===== */
.wb-readonly-card .form-control[readonly],
.wb-readonly-card .ql-container.ql-disabled { background: var(--wb-disabled-bg); color: var(--wb-text-label); cursor: default; }
.wb-readonly-card .ql-container.ql-disabled { border-top: 1px solid var(--wb-border-strong) !important; }
.wb-readonly-card .ql-disabled .ql-editor { min-height: 0; }
.wb-readonly-card input[type="checkbox"]:disabled { cursor: not-allowed; }
.wb-readonly-card .bootstrap-select.disabled > .dropdown-toggle { background: var(--wb-disabled-bg) !important; opacity: 1; }

/* ===== Users: marker editors only use the "Assign" column of the map table ===== */
.assign_map_div.is-marker-editor table th:nth-child(n+3),
.assign_map_div.is-marker-editor table td:nth-child(n+3) { display: none; }

/* ===== Viewer role: read-only marker page ===== */
body.wb-viewer .wb-image-tools,
body.wb-viewer .wb-image-undo { display: none !important; }
body.wb-viewer #content input:disabled,
body.wb-viewer #content select:disabled,
body.wb-viewer #content textarea:disabled { cursor: default; }

/* ===== "Requires renovation" ===== */
/* markers list: whole row tinted red, red bar on the left */
#markers_table tbody tr.wb-needs-renovation > td { background: var(--wb-error-bg) !important; color: var(--wb-error-text); }
#markers_table tbody tr.wb-needs-renovation > td:first-child { box-shadow: inset 4px 0 0 var(--wb-red); }
#markers_table tbody tr.wb-needs-renovation:hover > td { background: #fee2e2 !important; }
#markers_table tbody tr.wb-needs-renovation .wb-marker-name a { color: var(--wb-red-dark); }
.wb-renovation-badge { white-space: nowrap; cursor: help; }
.wb-renovation-badge i { margin-right: 0.2rem; }
/* marker page: the field block turns red when ticked */
.wb-renovation-box { border: 1px solid var(--wb-border); background: var(--wb-bg-subtle); padding: 0.85rem 1rem; }
.wb-renovation-box.is-on { border-color: var(--wb-error-border); background: var(--wb-error-bg); box-shadow: inset 4px 0 0 var(--wb-red); }
.wb-renovation-box.is-on > label[for="requires_renovation"] { color: var(--wb-red-dark); }
.wb-renovation-box > label[for="requires_renovation"] { font-weight: 700; }
.wb-renovation-box .wb-renovation-note-label { display: block; margin: 0.6rem 0 0.35rem; }
.wb-renovation-box textarea { min-height: 4.5rem; }

/* markers list: status filter in the header of the "Active" column */
#markers_table th.wb-th-filter { min-width: 170px; vertical-align: top; }
.wb-th-filter .wb-th-label { display: block; margin-bottom: 0.35rem; }
.wb-col-filter {
  display: block;
  width: 100%;
  min-height: 34px;
  padding: 0.25rem 0.4rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--wb-text);
  background: var(--wb-bg);
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius);
  cursor: pointer;
}
.wb-col-filter:focus { outline: none; border-color: var(--wb-primary); box-shadow: var(--wb-shadow-focus); }
.wb-col-filter.is-filtered { border-color: var(--wb-primary); box-shadow: inset 0 -2px 0 var(--wb-red); font-weight: 700; }
@media (max-width: 575.98px) {
  #markers_table th.wb-th-filter { min-width: 130px; }
  /* 16px stops iOS from zooming in when the filter is opened */
  .wb-col-filter { font-size: 16px; min-height: 40px; }
  /* keep name, status and actions inside the screen */
  #markers_table .wb-renovation-badge { white-space: normal; display: inline-block; line-height: 1.3; }
  #markers_table .wb-row-actions { flex-direction: column; align-items: flex-end; gap: 0.3rem; }
}

/* ===== Markers list: per-user "Columns" menu ===== */
.wb-columns-menu .dropdown-menu { min-width: 14rem; padding: 0.35rem 0; }
.wb-col-toggle { display: flex; align-items: center; gap: 0.6rem; margin: 0; padding: 0.45rem 1rem; cursor: pointer; user-select: none; }
/* uses the app's own checkbox style (custom.css, 21px); only keep it from shrinking */
.wb-col-toggle input { flex: 0 0 auto; margin: 0; }
.wb-col-toggle:active { background: var(--wb-disabled-bg); color: var(--wb-text); }
.wb-col-toggle-hint { margin: 0; padding: 0.25rem 1rem 0.45rem; font-size: 0.78rem; color: var(--wb-text-muted); white-space: normal; }
#markers_columns_reset { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 1rem; }
#markers_columns_reset i { width: 21px; text-align: center; }
/* note shown when the list is filtered by status but the "Active" column is hidden */
.wb-filter-note { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; padding: 0.6rem 1rem; margin-bottom: 1rem; }
.wb-filter-note .btn { margin-left: auto; }
@media (max-width: 575.98px) {
  .wb-toolbar-right, .wb-columns-menu { width: 100%; }
  .wb-columns-menu .dropdown-menu { width: 100%; }
  .wb-col-toggle { padding: 0.7rem 1rem; }
  .wb-filter-note .btn { margin-left: 0; width: 100%; }
}

/* ===== Phones: menu as a slide-in drawer (the hamburger opens it) =====
   Replaces the permanent icon rail, which took ~90px of every screen's width. */
@media (max-width: 767.98px) {
  #accordionSidebar.sidebar {
    position: fixed;
    top: var(--wb-topbar-h);
    left: 0;
    bottom: 0;
    width: 17rem !important;
    max-width: 85vw;
    min-height: 0;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    z-index: 1025;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
  }
  #accordionSidebar.sidebar.toggled {
    width: 17rem !important;
    transform: none;
    visibility: visible;
    transition: transform 0.2s ease;
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.15);
  }
  /* full rows with labels, like on desktop */
  #accordionSidebar .nav-section { display: block; }
  #accordionSidebar.sidebar-dark .nav-item .nav-link,
  #accordionSidebar.sidebar.toggled .nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100% !important;
    text-align: left;
    padding: 0.85rem 1.25rem !important;
    border-top: 0;
    border-left: 2px solid transparent;
  }
  #accordionSidebar.sidebar-dark .nav-item.active .nav-link { border-left-color: var(--wb-red); }
  #accordionSidebar.sidebar-dark .nav-item .nav-link i,
  #accordionSidebar.sidebar.toggled .nav-item .nav-link i { display: inline-block; width: 1.25rem; margin: 0; font-size: 1.05rem; }
  #accordionSidebar.sidebar-dark .nav-item .nav-link span,
  #accordionSidebar.sidebar.toggled .nav-item .nav-link span { display: inline; font-size: 1rem; }
  /* dim the page behind the open menu; a tap on it closes the menu (sb-admin-2.js) */
  body.sidebar-toggled::after {
    content: '';
    position: fixed;
    top: var(--wb-topbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1020;
    background: rgba(15, 23, 42, 0.35);
  }
  #content-wrapper .container-fluid { padding: 0 0.75rem 1rem; }
  .page-header { padding: 0.8rem 0.75rem 0.6rem; }
}

/* ===== Phones: markers list as a compact list ===== */
@media (max-width: 767.98px) {
  /* the title already says "Markers"; the one-item breadcrumb only repeated it */
  .wb-p-markers .page-header .breadcrumb-nav { display: none; }
  /* the page header scrolls away here, so the search can stay pinned at the top */
  .wb-p-markers .page-header { position: static; }
  .wb-p-markers .wb-dt-search { background: var(--wb-bg-subtle); border-bottom: 0; }
  /* no box inside the page: the list uses the full width */
  .wb-table-card { border: 0; background: transparent; margin-bottom: 0 !important; }
  .wb-table-card .dataTables_wrapper { padding: 0; }
  /* rows-per-page is a desktop tool; the count stays */
  .wb-dt-top .dataTables_length { display: none; }
  .wb-dt-top { margin-bottom: 0.25rem; color: var(--wb-text-muted); }
}
@media (max-width: 575.98px) {
  /* toolbar: two buttons per row instead of one long column */
  .wb-toolbar { gap: 0.5rem; margin-bottom: 0.75rem; }
  .wb-toolbar-left, .wb-toolbar-right { display: flex; flex-wrap: wrap; width: 100%; gap: 0.5rem; }
  .wb-toolbar-left:empty { display: none; }
  /* two per row; one left alone in its row takes the full width */
  .wb-toolbar .wb-toolbar-left > *, .wb-toolbar .wb-toolbar-right > * { flex: 1 1 calc(50% - 0.25rem); min-width: 0; }
  .wb-toolbar .wb-toolbar-left > #btn_add_marker { flex-basis: 100%; }
  .wb-toolbar .btn { display: flex; align-items: center; justify-content: center; gap: 0.35rem; width: 100%; min-height: 48px; white-space: normal; line-height: 1.2; font-size: 0.8rem; padding: 0.5rem; }
  .wb-columns-menu > .btn { height: 100%; }

  /* every marker is one card-like row: name on top, status under it, button on the right */
  #markers_table, #markers_table thead, #markers_table tbody { display: block; width: 100% !important; }
  #markers_table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.75rem;
    padding: 0.8rem 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--wb-bg);
    border: 1px solid var(--wb-border);
  }
  #markers_table tbody tr > td { border: 0 !important; padding: 0 !important; background: transparent !important; }
  /* name across the full width, then status (left) and buttons (right) on one line */
  #markers_table tbody td.wb-col-name { grid-column: 1 / -1; grid-row: 1; }
  #markers_table tbody td.wb-col-status { grid-column: 1; grid-row: 2; padding: 0.6rem 0 0 2.2rem !important; }
  #markers_table tbody td.wb-col-buttons { grid-column: 2; grid-row: 2; padding-top: 0.6rem !important; }
  #markers_table .wb-row-actions { flex-direction: row; align-items: center; gap: 0.4rem; }
  #markers_table tbody td.dataTables_empty { grid-column: 1 / -1; text-align: center; }
  #markers_table .wb-marker-name { align-items: flex-start; font-size: 1rem; line-height: 1.35; }
  #markers_table .wb-marker-icon { margin-top: 1px; }
  /* no "display" here: the roles hide some of these buttons with display: none */
  #markers_table .wb-row-actions .btn { min-width: 44px; min-height: 44px; padding: 0.75rem 0.8rem; line-height: 1; }
  /* renovation rows keep their red look on the whole card */
  #markers_table tbody tr.wb-needs-renovation { background: var(--wb-error-bg); border-color: var(--wb-error-border); box-shadow: inset 4px 0 0 var(--wb-red); }
  #markers_table tbody tr.wb-needs-renovation > td:first-child { box-shadow: none; }
  #markers_table tbody tr.selected { background: var(--wb-warning-bg); }
  /* hover colours the whole card, never the single cells (the desktop rule tints each cell) */
  #markers_table tbody tr:hover > td,
  #markers_table tbody tr.wb-needs-renovation:hover > td,
  #markers_table tbody tr.selected > td { background: transparent !important; }
  /* css/theme.php forces tr.odd/tr.even:hover to light grey with !important, so these
     carry .odd/.even too (more specific) */
  #markers_table tbody tr.odd:hover, #markers_table tbody tr.even:hover { background: var(--wb-bg-subtle) !important; }
  #markers_table tbody tr.wb-needs-renovation.odd:hover,
  #markers_table tbody tr.wb-needs-renovation.even:hover { background: #fee2e2 !important; }
  #markers_table tbody tr.selected.odd:hover,
  #markers_table tbody tr.selected.even:hover { background: var(--wb-warning-bg) !important; }

  /* header row turns into the status filter bar: "Active [All v]" */
  #markers_table thead tr { display: flex; }
  #markers_table thead th { display: none; }
  #markers_table thead th.wb-col-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100% !important;
    min-width: 0;
    padding: 0 0 0.6rem !important;
    border: 0 !important;
    background: transparent !important;
    pointer-events: none; /* no sorting by tapping the label */
  }
  #markers_table thead th.wb-col-status::before,
  #markers_table thead th.wb-col-status::after { display: none !important; }
  #markers_table thead th.wb-col-status .wb-th-label { margin: 0; flex: 0 0 auto; }
  #markers_table thead th.wb-col-status .wb-col-filter { pointer-events: auto; flex: 1 1 auto; min-height: 48px; }
}

/* ===== Translations page (Administration > Translations) ===== */
.wb-tr-toolbar .form-control { width: auto; min-width: 12rem; min-height: 40px; }
.wb-tr-stats { font-size: 0.85rem; color: var(--wb-text-muted); }
.wb-tr-help { font-size: 0.82rem; color: var(--wb-text-muted); margin: 0 0 0.75rem; }
.wb-tr-head,
.wb-tr-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0.5rem 1.25rem; }
.wb-tr-head {
  padding: 0.6rem 0.75rem;
  background: var(--wb-bg-subtle);
  border-bottom: 1px solid var(--wb-border);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wb-text-label);
}
.wb-tr-row { padding: 0.75rem; border-bottom: 1px solid var(--wb-border); align-items: start; }
.wb-tr-row.is-edited { box-shadow: inset 3px 0 0 #d97706; }
.wb-tr-row.is-dirty { background: var(--wb-bg-subtle); }
.wb-tr-en { color: var(--wb-text); font-weight: 600; word-break: break-word; }
.wb-tr-used { margin-top: 0.25rem; font-size: 0.75rem; color: var(--wb-text-subtle); word-break: break-word; }
textarea.form-control.wb-tr-input { resize: none; overflow: hidden; min-height: 40px; line-height: 1.4; }
.wb-tr-row.is-empty .wb-tr-input { border-style: dashed; }
.wb-tr-meta { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 0.4rem 0.75rem; margin-top: 0.4rem; }
.wb-tr-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem 0.5rem; font-size: 0.75rem; min-width: 0; }
.wb-tr-hint { color: var(--wb-text-muted); }
.wb-tr-original { flex-basis: 100%; color: var(--wb-text-muted); word-break: break-word; }
.wb-tr-actions { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.wb-tr-status { font-size: 0.78rem; color: var(--wb-success-text); }
.wb-tr-status.is-error { color: var(--wb-red); font-weight: 600; }
.wb-tr-actions .btn { white-space: nowrap; }
.wb-tr-loading, .wb-tr-empty { padding: 1.5rem 0.75rem; margin: 0; color: var(--wb-text-muted); text-align: center; }
.wb-tr-empty.is-error { color: var(--wb-red); }
.wb-tr-pager { display: flex; justify-content: center; align-items: center; gap: 1rem; padding: 1rem 0 0.25rem; font-size: 0.85rem; color: var(--wb-text-muted); }
@media (max-width: 767.98px) {
  .wb-tr-head { display: none; }
  .wb-tr-row { grid-template-columns: minmax(0, 1fr); padding: 0.85rem 0; }
  .wb-tr-row.is-edited { box-shadow: none; border-left: 3px solid #d97706; padding-left: 0.6rem; }
  .wb-tr-toolbar .wb-toolbar-left { width: 100%; }
  .wb-tr-toolbar .form-control { flex: 1 1 100%; width: 100%; min-height: 48px; font-size: 16px; }
  textarea.form-control.wb-tr-input { font-size: 16px; min-height: 48px; }
  .wb-tr-actions .btn { min-height: 44px; }
}

/* ===== Server check page (Administration > Server check) ===== */
.wb-check-summary { display: flex; align-items: center; gap: 0.6rem; }
.wb-check-row {
  display: grid;
  grid-template-columns: 6.5rem minmax(10rem, 16rem) minmax(6rem, 10rem) minmax(0, 1fr);
  gap: 0.25rem 1rem;
  align-items: start;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--wb-border);
  font-size: 0.88rem;
}
.wb-check-row:last-child { border-bottom: 0; }
.wb-check-row.is-error { background: var(--wb-error-bg); box-shadow: inset 4px 0 0 var(--wb-red); }
.wb-check-badge { justify-self: start; }
.wb-check-item { font-weight: 600; color: var(--wb-text); word-break: break-word; }
.wb-check-value { color: var(--wb-text-label); font-variant-numeric: tabular-nums; word-break: break-word; }
.wb-check-note { color: var(--wb-text-muted); word-break: break-word; }
.wb-check-row.is-error .wb-check-note { color: var(--wb-error-text); }
@media (max-width: 767.98px) {
  .wb-check-row { grid-template-columns: auto minmax(0, 1fr); padding: 0.75rem; }
  .wb-check-value { grid-column: 2; }
  .wb-check-note { grid-column: 1 / -1; }
}
