/* ============================================================================
   Trakpoints — UI/UX Refresh (Scope #6)
   Modern AdminLTE-3-style visual layer. Override-only: no markup changes, so it
   restyles every existing view at once. Loaded LAST in comman/code_css.php.
   ========================================================================== */

:root {
  --tp-brand: #0b2f6b;
  /* indigo-600 */
  --tp-brand-600: #08275a;
  --tp-brand-700: #061a3f;
  --tp-brand-soft: #eef5ff;
  /* indigo-50 */
  --tp-ink: #0f172a;
  /* slate-900 */
  --tp-body: #334155;
  /* slate-700 */
  --tp-muted: #64748b;
  /* slate-500 */
  --tp-bg: #f1f5f9;
  /* slate-100 */
  --tp-surface: #ffffff;
  --tp-border: #e5e9f0;
  /* slate-200-ish */
  --tp-sidebar: #1e293b;
  /* slate-800 */
  --tp-sidebar-2: #172033;
  --tp-radius: 10px;
  --tp-radius-sm: 8px;
  --tp-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .05);
  --tp-shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --tp-success: #16a34a;
  --tp-info: #0ea5e9;
  --tp-warning: #f59e0b;
  --tp-danger: #dc2626;
  --tp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ---------- Base ---------- */
body,
.content-wrapper,
.wrapper {
  background-color: var(--tp-bg) !important;
}

body {
  font-family: var(--tp-font) !important;
  color: var(--tp-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--tp-brand);
}

a:hover,
a:focus {
  color: var(--tp-brand-700);
}

h1,
h2,
h3,
h4,
h5,
h6,
.box-title {
  color: var(--tp-ink);
  font-weight: 600;
}

/* ---------- Top header ---------- */
.main-header .navbar,
.skin-blue .main-header .navbar {
  /* Match the sidebar/logo color so the header reads as one continuous bar
     with the dark sidebar, instead of a disconnected white strip. */
  background: var(--tp-sidebar) !important;
  box-shadow: var(--tp-shadow);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.main-header .logo,
.skin-blue .main-header .logo {
  background: var(--tp-sidebar) !important;
  color: #fff !important;
  font-weight: 700;
  letter-spacing: .2px;
  border-bottom: 0;
}

.skin-blue .main-header .logo:hover {
  background: var(--tp-sidebar-2) !important;
}

/* Keep long store names on one line inside the fixed-height logo box.
   Without this, names like "Green Grocers Grocery Store" wrap to a
   second line that gets clipped by the parent's overflow:hidden. */
.main-header .logo .logo-lg,
.skin-blue .main-header .logo .logo-lg {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 50px;
  height: 50px;
}

.main-header .navbar .nav>li>a,
.skin-blue .main-header .navbar .nav>li>a {
  /* Dark navbar needs light link text (was --tp-body dark on white). */
  color: #cbd5e1 !important;
}

.main-header .navbar .nav>li>a:hover,
.skin-blue .main-header .navbar .nav>li>a:hover {
  background: rgba(79, 70, 229, .22) !important;
  color: #fff !important;
}

.main-header .sidebar-toggle,
.skin-blue .main-header .sidebar-toggle {
  color: #cbd5e1 !important;
  background: transparent !important;
}

/* Dark navbar: keep the right-side user menu / labels readable too. */
.main-header .navbar .navbar-custom-menu .nav>li>a,
.skin-blue .main-header .navbar .navbar-custom-menu .nav>li>a {
  color: #cbd5e1 !important;
}
.main-header .navbar .navbar-custom-menu .nav>li>a:hover,
.skin-blue .main-header .navbar .navbar-custom-menu .nav>li>a:hover {
  background: rgba(79, 70, 229, .22) !important;
  color: #fff !important;
}
.main-header .navbar .navbar-custom-menu .text-white { color:#fff !important; }

.main-header .navbar .bg-green {
  background: var(--tp-brand) !important;
  border-radius: 8px;
}

/* ---------- Sidebar ---------- */
.main-sidebar,
.left-side,
.skin-blue .main-sidebar,
.skin-blue .wrapper {
  background: var(--tp-sidebar) !important;
}

.skin-blue .sidebar-menu>li.header {
  color: #94a3b8 !important;
  background: transparent !important;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .08em;
  padding: 14px 15px 6px;
}

.skin-blue .sidebar-menu>li>a {
  color: #cbd5e1 !important;
  border-left: 3px solid transparent;
  font-weight: 500;
  padding: 11px 15px;
  transition: background .15s, color .15s;
}

.skin-blue .sidebar-menu>li:hover>a,
.skin-blue .sidebar-menu>li.active>a,
.skin-blue .sidebar-menu>li.menu-open>a {
  background: rgba(79, 70, 229, .14) !important;
  color: #fff !important;
  border-left-color: var(--tp-brand) !important;
}

.skin-blue .sidebar-menu .treeview-menu {
  background: rgba(0, 0, 0, .18) !important;
}

.skin-blue .sidebar-menu .treeview-menu>li>a {
  color: #94a3b8 !important;
  padding: 8px 5px 8px 20px;
}

.skin-blue .sidebar-menu .treeview-menu>li.active>a,
.skin-blue .sidebar-menu .treeview-menu>li>a:hover {
  color: #fff !important;
}

.skin-blue .sidebar-menu .treeview-menu>li.active>a {
  background: rgba(79, 70, 229, .20) !important;
}

.sidebar-menu li>a>.fa,
.sidebar-menu li>a>.glyphicon,
.sidebar-menu li>a>.ion {
  width: 22px;
}

.user-panel>.info,
.user-panel>.info>a {
  color: #e2e8f0 !important;
}

/* ---------- Content header + breadcrumb ---------- */
.content-header {
  padding: 18px 20px 4px;
}

.content-header>h1 {
  font-size: 22px;
  font-weight: 650;
  margin: 0;
}

.content-header>h1>small {
  color: var(--tp-muted);
  font-size: 13px;
}

.content-header>.breadcrumb {
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: 999px;
  padding: 6px 14px;
  top: 16px;
  right: 20px;
  box-shadow: var(--tp-shadow);
}

.content-header>.breadcrumb>li+li:before {
  color: #cbd5e1;
}

.content-header>.breadcrumb a {
  color: var(--tp-muted);
}


/* ---------- Boxes / cards ---------- */
.box {
  border: 1px solid var(--tp-border) !important;
  border-top: 1px solid var(--tp-border) !important;
  border-radius: var(--tp-radius);
  box-shadow: var(--tp-shadow) !important;
  background: var(--tp-surface);
}

.box.box-primary,
.box.box-info,
.box.box-success,
.box.box-warning,
.box.box-danger {
  border-top: 3px solid var(--tp-brand) !important;
}

.box.box-info {
  border-top-color: var(--tp-info) !important;
}

.box.box-success {
  border-top-color: var(--tp-success) !important;
}

.box.box-warning {
  border-top-color: var(--tp-warning) !important;
}

.box.box-danger {
  border-top-color: var(--tp-danger) !important;
}

.box-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--tp-border);
}

.box-header.with-border {
  border-bottom: 1px solid var(--tp-border);
}

.box-header .box-title {
  font-size: 16px;
  font-weight: 600;
}

.box-body {
  padding: 18px;
}

.box-footer {
  background: transparent;
  border-top: 1px solid var(--tp-border);
  border-radius: 0 0 var(--tp-radius) var(--tp-radius);
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: var(--tp-radius-sm);
  font-weight: 500;
  padding: 7px 14px;
  border: 1px solid transparent;
  transition: filter .15s, box-shadow .15s;
}

.btn:active {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .12);
}

.btn-primary,
.btn-info {
  background: var(--tp-brand);
  border-color: var(--tp-brand);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-info:hover {
  background: var(--tp-brand-700);
  border-color: var(--tp-brand-700);
}

.btn-success {
  background: var(--tp-success);
  border-color: var(--tp-success);
}

.btn-warning {
  background: var(--tp-warning);
  border-color: var(--tp-warning);
  color: #fff;
}

.btn-danger {
  background: var(--tp-danger);
  border-color: var(--tp-danger);
}

.btn-default {
  background: #fff;
  border-color: var(--tp-border);
  color: var(--tp-body);
}

.btn-default:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-xs {
  padding: 3px 8px;
  border-radius: 6px;
}

.btn-o.dropdown-toggle {
  background: #fff;
  border: 1px solid var(--tp-border);
  color: var(--tp-body);
}

/* ---------- Forms ---------- */
.form-control {
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  box-shadow: none;
  color: var(--tp-ink);
  height: auto;
  padding: 8px 12px;
  min-height: 38px;
}

input.form-control {
  height: 38px;
}

.form-control:focus {
  border-color: var(--tp-brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}

/* one placeholder color everywhere (inputs, textareas, select2) */
.form-control::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.select2-selection__placeholder {
  color: #94a3b8 !important;
}

label.control-label,
.form-group>label {
  color: var(--tp-ink);
  font-weight: 600;
}

.select2-container--default .select2-selection--single {
  border: 1px solid var(--tp-border) !important;
  border-radius: var(--tp-radius-sm) !important;
  height: 38px !important;
  padding: 0 !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px !important;
  color: var(--tp-ink);
  padding-left: 12px !important;
  padding-right: 26px !important;
}

/* select2 gets the same focus ring as inputs */
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default .select2-selection--single:focus,
.select2-container--default.select2-container--open .select2-selection--multiple,
.select2-container--default.select2-container--focus .select2-selection--multiple {
  border-color: var(--tp-brand) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
  outline: none;
}

.select2-container--default .select2-selection--multiple {
  border: 1px solid var(--tp-border) !important;
  border-radius: var(--tp-radius-sm) !important;
  min-height: 38px !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px !important;
}

.select2-dropdown {
  border-color: var(--tp-border) !important;
  border-radius: var(--tp-radius-sm);
}

/* native selects match the select2 look (same chevron, same height) */
select.form-control:not([multiple]) {
  height: 38px;
  padding: 7px 30px 7px 12px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* readonly datepickers are interactive (click opens the picker) — don't
   render them as disabled */
input.datepicker[readonly] {
  background-color: #fff;
  cursor: pointer;
}

/* plain (non-iCheck) checkboxes/radios pick up the brand color */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--tp-brand);
}

/* file inputs: match the shared control look instead of bare browser chrome */
input[type="file"] {
  border: 1px dashed var(--tp-border);
  border-radius: var(--tp-radius-sm);
  padding: 6px 10px;
  width: 100%;
  background: #fff;
}

input[type="file"]::file-selector-button {
  border: 1px solid var(--tp-border);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--tp-ink);
  padding: 4px 10px;
  margin-right: 10px;
  cursor: pointer;
}

/* ---------- Combined inputs (input-groups): uniform 38px ---------- */
.input-group .form-control {
  height: 38px;
}

/* double selector beats AdminLTE's `.input-group .input-group-addon`
   (#d2d6de border / white bg) so every addon matches the inputs */
.input-group-addon,
.input-group .input-group-addon {
  background: #f8fafc;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  color: var(--tp-muted);
  min-width: 40px;
  text-align: center;
}

/* keep the group reading as one control: inner corners stay square */
.input-group .input-group-addon:first-child {
  border-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group .input-group-addon:last-child {
  border-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* clickable "add new" addons */
.input-group-addon.pointer {
  cursor: pointer;
  transition: background .15s;
}

.input-group-addon.pointer:hover {
  background: var(--tp-brand-soft);
}

/* attached buttons match the 38px input height */
.input-group-btn > .btn {
  height: 38px;
  padding-top: 0;
  padding-bottom: 0;
}

/* datepicker popup matches the shared look (native date inputs already do) */
.datepicker.dropdown-menu {
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}

/* ---------- Tables ---------- */
.table {
  color: var(--tp-body);
}

.table>thead>tr>th {
  background: #f8fafc;
  color: var(--tp-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 1px solid var(--tp-border) !important;
  border-top: 0;
}

.table>tbody>tr>td {
  border-top: 1px solid #eef2f7;
  vertical-align: middle;
}

.table-striped>tbody>tr:nth-of-type(odd) {
  background: #fbfcfe;
}

.table-hover>tbody>tr:hover {
  background: var(--tp-brand-soft);
}

.table-bordered,
.table-bordered>thead>tr>th,
.table-bordered>tbody>tr>td {
  border-color: var(--tp-border);
}

/* keep wide tables from breaking the layout on small screens */
.box-body>.table-responsive,
.table-responsive {
  border: 0;
}

@media (max-width:768px) {
  .box-body {
    overflow-x: auto;
  }
}

/* ---------- DataTables ---------- */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  padding: 6px 10px;
}

.pagination>li>a,
.pagination>li>span {
  color: var(--tp-brand);
  border-color: var(--tp-border);
}

.pagination>.active>a,
.pagination>.active>a:hover,
.pagination>.active>span {
  background: var(--tp-brand);
  border-color: var(--tp-brand);
}

/* ---------- Labels / badges / alerts ---------- */
.label {
  font-weight: 600;
  padding: .30em .6em;
  border-radius: 999px;
  font-size: 85%;
}

.label-success {
  background: var(--tp-success);
}

.label-danger {
  background: var(--tp-danger);
}

.label-warning {
  background: var(--tp-warning);
}

.label-info {
  background: var(--tp-info);
}

.label-primary {
  background: var(--tp-brand);
}

.label-default {
  background: #eef2f7;
  color: var(--tp-muted);
}

.alert {
  border: 0;
  border-radius: var(--tp-radius-sm);
  box-shadow: var(--tp-shadow);
}

.alert-success {
  background: #ecfdf5;
  color: #166534;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
}

.alert-info {
  background: #eff6ff;
  color: #1e40af;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
}

.callout {
  border-radius: var(--tp-radius-sm);
  box-shadow: var(--tp-shadow);
}

/* ---------- Dashboard: stat tiles (small-box) ---------- */
.small-box {
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .10);
  border: 0;
  color: #fff;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}

.small-box>.inner {
  padding: 22px 24px;
  position: relative;
  z-index: 1;
}

.small-box h3 {
  font-size: 30px;
  font-weight: 800;
  color: #fff !important;
  margin: 0 0 4px;
  text-shadow: none;
  line-height: 1.1;
}

.small-box p {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .92) !important;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  margin: 0;
}

.small-box .icon {
  font-size: 70px;
  top: 12px;
  right: 18px;
  color: rgba(255, 255, 255, .20);
  transition: transform .2s ease;
  z-index: 0;
}

.small-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(16, 24, 40, .18);
}

.small-box:hover .icon {
  transform: scale(1.06) rotate(-4deg);
}

.small-box .small-box-footer {
  background: rgba(0, 0, 0, .12);
  color: rgba(255, 255, 255, .9);
  border-radius: 0;
}

/* cohesive, modern gradients (override custom.css .bg-1..4) */
.small-box.bg-1 {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  background-position: 0 !important;
}

.small-box.bg-2 {
  background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%) !important;
  background-position: 0 !important;
}

.small-box.bg-3 {
  background: linear-gradient(135deg, #059669 0%, #34d399 100%) !important;
  background-position: 0 !important;
}

.small-box.bg-4 {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%) !important;
  background-position: 0 !important;
}

/* ---------- Dashboard: info boxes ---------- */
.info-box {
  border-radius: 16px;
  box-shadow: var(--tp-shadow);
  border: 1px solid var(--tp-border);
  background: var(--tp-surface);
  min-height: 96px;
  padding: 0;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  transition: box-shadow .18s, transform .18s;
}

.info-box:hover {
  box-shadow: var(--tp-shadow-md);
  transform: translateY(-2px);
}

.info-box .info-box-icon {
  width: 64px;
  height: 64px;
  line-height: 64px;
  font-size: 28px;
  margin: 16px;
  border-radius: 14px !important;
  background: var(--tp-brand-soft) !important;
  color: var(--tp-brand) !important;
  flex: 0 0 auto;
  text-align: center;
}

.info-box .info-box-content {
  margin-left: 0;
  padding: 10px 16px 10px 0;
  flex: 1 1 auto;
}

.info-box .info-box-text {
  color: var(--tp-ink) !important;
  font-weight: 800;
  font-size: 24px !important;
  display: block;
  line-height: 1.2;
}

.info-box .info-box-number {
  color: var(--tp-muted) !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: 12px;
}

/* soft colour variety across the four info tiles */
.row>[class*="col-"]:nth-of-type(4n+1) .info-box .info-box-icon {
  background: #eef5ff !important;
  color: #0b2f6b !important;
}

.row>[class*="col-"]:nth-of-type(4n+2) .info-box .info-box-icon {
  background: #ecfeff !important;
  color: #0891b2 !important;
}

.row>[class*="col-"]:nth-of-type(4n+3) .info-box .info-box-icon {
  background: #fff7ed !important;
  color: #ea580c !important;
}

.row>[class*="col-"]:nth-of-type(4n+4) .info-box .info-box-icon {
  background: #ecfdf5 !important;
  color: #059669 !important;
}

/* ---------- Dashboard: period toggle (Today/Weekly/...) ---------- */
.box-header .btn-group .get_tab_records {
  background: #fff !important;
  color: var(--tp-body) !important;
  border: 1px solid var(--tp-border) !important;
  font-weight: 500;
}

.box-header .btn-group .get_tab_records.active,
.box-header .btn-group .get_tab_records:hover {
  background: var(--tp-brand) !important;
  color: #fff !important;
  border-color: var(--tp-brand) !important;
}

.box.box-solid.box-primary>.box-header {
  background: var(--tp-brand);
}

/* ---------- Modals ---------- */
.modal-content {
  border: 0;
  border-radius: var(--tp-radius);
  box-shadow: 0 20px 60px rgba(2, 6, 23, .28);
}

.modal-header {
  border-bottom: 1px solid var(--tp-border);
  padding: 16px 18px;
}

/* Legacy gradient header (.header-custom) used by the older modals — kill the
   teal/blue gradient so every modal shares the same white header. */
.modal-header.header-custom {
  background: transparent !important;
  background-image: none !important;
  color: var(--tp-ink);
}

.modal-header .modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--tp-ink);
  text-align: left; /* legacy modals center their titles */
}

.modal-header .close {
  color: var(--tp-muted);
  opacity: .8;
  text-shadow: none;
}

.modal-body {
  padding: 18px;
}

/* some legacy modals nest .box-body inside .modal-body — avoid double padding */
.modal-body .box-body {
  padding: 0;
}

.modal-footer {
  border-top: 1px solid var(--tp-border);
  padding: 14px 18px;
}

/* ---------- Login / auth ---------- */
.login-page,
.register-page {
  background: linear-gradient(135deg, #eef5ff 0%, #f1f5f9 100%) !important;
}

.login-box,
.register-box {
  margin-top: 6% !important;
}

.login-box-body,
.register-box-body {
  border-radius: var(--tp-radius);
  box-shadow: var(--tp-shadow-md);
  border: 1px solid var(--tp-border);
}

.login-logo a,
.register-logo a {
  color: var(--tp-ink);
  font-weight: 700;
}

/* ---------- DataTables export button group (Copy / Excel / PDF / Print / CSV / Columns) ----------
   The app tags these buttons with AdminLTE's .bg-teal (background-color:#39cccc!important),
   so the override must also use !important and beat .bg-teal on specificity. */
div.dt-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  float: none;
}

div.dt-buttons .btn,
div.dt-buttons .btn.bg-teal,
div.dt-buttons .buttons-html5,
div.dt-buttons .buttons-print,
div.dt-buttons .buttons-colvis {
  background: #fff !important;
  background-color: #fff !important;
  color: var(--tp-body) !important;
  border: 1px solid var(--tp-border) !important;
  border-radius: var(--tp-radius-sm) !important;
  padding: 6px 13px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  margin: 0 !important;
  transition: background .15s, border-color .15s, color .15s;
}

div.dt-buttons .btn:hover,
div.dt-buttons .btn.bg-teal:hover {
  background-color: var(--tp-brand-soft) !important;
  border-color: var(--tp-brand) !important;
  color: var(--tp-brand-700) !important;
}

div.dt-buttons .btn:active,
div.dt-buttons .btn.active {
  background-color: var(--tp-brand) !important;
  border-color: var(--tp-brand) !important;
  color: #fff !important;
}

/* ---------- DataTables Columns (colVis) dropdown ---------- */
/* Match the app's canonical .dropdown-menu look (see line ~1084), using the
   same --tp-* tokens. Real DOM: ul.dt-button-collection.dropdown-menu > li.dt-button > a */

ul.dt-button-collection,
div.dt-button-collection {
  position: absolute !important;
  z-index: 9999 !important;
  background-color: var(--tp-surface) !important;
  border: 1px solid var(--tp-border) !important;
  border-radius: var(--tp-radius-sm) !important;
  box-shadow: var(--tp-shadow-md) !important;
  padding: 6px !important;
  min-width: 200px;
  margin-top: 4px !important;
  float: none !important;
}

/* Hide the empty title bar the Buttons extension injects */
div.dt-button-collection .dt-button-collection-title {
  display: none !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

/* Each column toggle row — strip Bootstrap's solid-fill active bg */
ul.dt-button-collection li.dt-button,
div.dt-button-collection li.dt-button {
  margin: 2px 0 !important;
  padding: 0 !important;
  list-style: none !important;
  border: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

ul.dt-button-collection li.dt-button > a,
div.dt-button-collection li.dt-button > a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 7px 12px !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
  color: var(--tp-body) !important;
  text-decoration: none !important;
  border-radius: 6px !important;
  border: none !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  transition: background .12s, color .12s;
}

/* Checkbox indicator (empty box / checked) rendered before the label */
ul.dt-button-collection li.dt-button > a::before,
div.dt-button-collection li.dt-button > a::before {
  content: "" !important;
  display: inline-block !important;
  flex: 0 0 auto !important;
  width: 15px !important;
  height: 15px !important;
  margin-right: 2px !important;
  border: 1.5px solid var(--tp-border) !important;
  border-radius: 4px !important;
  background: #fff !important;
  transition: all .12s;
}

/* Checked state (column visible / active) */
ul.dt-button-collection li.dt-button.active > a::before,
div.dt-button-collection li.dt-button.active > a::before {
  background: var(--tp-brand) !important;
  border-color: var(--tp-brand) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 11px 11px !important;
}

/* Hover — same as .dropdown-menu>li>a:hover */
ul.dt-button-collection li.dt-button:hover > a,
div.dt-button-collection li.dt-button:hover > a {
  background: var(--tp-brand-soft) !important;
  color: var(--tp-brand-700) !important;
}

/* Active (column visible) — brand-soft fill, brand text */
ul.dt-button-collection li.dt-button.active > a,
div.dt-button-collection li.dt-button.active > a {
  background: var(--tp-brand-soft) !important;
  color: var(--tp-brand-700) !important;
  font-weight: 500 !important;
}

/* Inactive (column hidden) — muted */
ul.dt-button-collection li.buttons-columnVisibility:not(.active) > a,
div.dt-button-collection li.buttons-columnVisibility:not(.active) > a {
  color: var(--tp-muted) !important;
  background: transparent !important;
}

/* The first colVis item is the checkbox column with an empty <a> label — give it a name */
ul.dt-button-collection li.dt-button[data-cv-idx="0"] > a:empty::before,
div.dt-button-collection li.dt-button[data-cv-idx="0"] > a:empty::before {
  margin-right: 0 !important;
}
ul.dt-button-collection li.dt-button[data-cv-idx="0"] > a:empty::after,
div.dt-button-collection li.dt-button[data-cv-idx="0"] > a:empty::after {
  content: "Select / Checkbox" !important;
  color: inherit !important;
}

/* ---------- Table footer / totals row ---------- */
.table>tfoot>tr>th,
.table>tfoot>tr>td {
  background: #f8fafc;
  border-top: 2px solid var(--tp-border) !important;
  color: var(--tp-ink);
  font-weight: 600;
}

/* A "Total" summary row rendered inside tbody with the default gray gets lightened too */
.table>tbody>tr.info>td,
.table>tbody>tr.total-row>td {
  background: #f8fafc !important;
  color: var(--tp-ink);
  font-weight: 600;
}

/* ---------- DataTables controls ---------- */
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--tp-radius-sm) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--tp-brand) !important;
  border-color: var(--tp-brand) !important;
  color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--tp-brand-soft) !important;
  border-color: var(--tp-brand) !important;
  color: var(--tp-brand-700) !important;
}

.dataTables_wrapper .dataTables_info {
  color: var(--tp-muted);
  padding-top: 12px;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--tp-brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
  outline: 0;
}

/* ---------- Action dropdown buttons in list tables ---------- */
.btn-group>.btn.dropdown-toggle,
.btn.btn-o {
  background: #fff;
  border: 1px solid var(--tp-border);
  color: var(--tp-body);
}

.btn-group>.btn.dropdown-toggle:hover,
.btn.btn-o:hover {
  background: var(--tp-brand-soft);
  border-color: var(--tp-brand);
  color: var(--tp-brand-700);
}

.dropdown-menu {
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  box-shadow: var(--tp-shadow-md);
  padding: 6px;
}

.dropdown-menu>li>a {
  border-radius: 6px;
  padding: 7px 12px;
}

.dropdown-menu>li>a:hover {
  background: var(--tp-brand-soft);
  color: var(--tp-brand-700);
}

/* ---------- Shared modal styling (tp-modal-*, tp-section*) ---------- */
.tp-modal-header .modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: var(--tp-radius-sm);
  background: var(--tp-brand-soft);
  color: var(--tp-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.tp-modal-header .modal-title {
  margin: 0;
  font-weight: 600;
}

.modal-subtitle {
  color: var(--tp-muted);
}

.req {
  color: var(--tp-danger);
}

.tp-section {
  margin-bottom: 20px;
}

.tp-section-head {
  font-weight: 600;
  color: var(--tp-ink);
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--tp-border);
}

.tp-section-head .fa {
  color: var(--tp-brand);
  margin-right: 6px;
}

/* Stack each field as label / control / hint / error so inputs line up
   across a row no matter how long a hint or error text is. */
.tp-modal-body .form-group {
  display: flex;
  flex-direction: column;
}

.tp-modal-body .form-group > label {
  order: 1;
  margin-bottom: 5px;
}

.tp-modal-body .form-group > .form-control,
.tp-modal-body .form-group > .input-group {
  order: 2;
}

.tp-modal-body .hint,
.tp-modal-body .verify-link {
  order: 3;
  font-size: 12px;
  color: var(--tp-muted);
  margin-top: 4px;
}

.tp-modal-body .form-group > label.field-error {
  order: 4;
  color: var(--tp-danger);
  font-size: 12px;
  font-weight: 400;
  margin: 4px 0 0;
}

.copy-toggle {
  float: right;
  font-weight: 400;
  color: var(--tp-body);
  margin: 0;
}

/* Float grid trips on unequal column heights (e.g. GST's Verify link);
   flex rows wrap cleanly instead. md-up only: below that cols are full width. */
@media (min-width: 992px) {
  .tp-modal-body .row {
    display: flex;
    flex-wrap: wrap;
  }
}

/* ---------- Checkboxes / small controls ---------- */
input[type=checkbox],
input[type=radio] {
  accent-color: var(--tp-brand);
}

/* ---------- Misc ---------- */
.nav-tabs-custom {
  border-radius: var(--tp-radius);
  box-shadow: var(--tp-shadow);
}

.nav-tabs-custom>.nav-tabs>li.active>a {
  border-top-color: var(--tp-brand);
}

.progress-bar {
  background: var(--tp-brand);
}

.logo .logo-mini img,
.login-logo img[src$="/"],
.register-logo img[src$="/"] {
  display: none;
}

/* hide broken/empty logo images */
::selection {
  background: rgba(79, 70, 229, .20);
}

/* =========================================================================
   RESPONSIVE — Below 991px (Bootstrap md breakpoint)
   Fixes: button rows, form-horizontal, modals, DataTables toolbar, sidebar
   ========================================================================= */
@media (max-width:991px) {

  /* --- 1. Save/Update + Close button rows ---
     Target by unique signature class col-sm-8 col-sm-offset-2 which wraps
     every Save/Update + Close pair across all 77+ views. Works regardless
     of whether inside .box-footer or not. */

  /* Reset the outer wrapper — kill Bootstrap offsets/columns */
  .col-sm-offset-2.text-center,
  .col-sm-offset-2.text-center center {
    display: block !important;
    text-align: center;
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
    padding: 0 !important;
  }

  /* Each button container div: inline-block, equal width, centered */
  .col-sm-offset-2.text-center > div,
  .col-sm-offset-2.text-center center > div {
    display: inline-block !important;
    width: 45% !important;
    max-width: 200px;
    min-width: 130px;
    margin: 5px !important;
    float: none !important;
    padding: 0 !important;
    vertical-align: top;
  }

  /* The <a> wrapper around Close button fills its parent */
  .col-sm-offset-2.text-center > div > a,
  .col-sm-offset-2.text-center center > div > a {
    display: block;
    width: 100%;
    text-decoration: none;
  }

  /* ALL buttons fill their container, kill col-sm-3 on button itself */
  .col-sm-offset-2.text-center button,
  .col-sm-offset-2.text-center .btn-block {
    width: 100% !important;
    float: none !important;
    display: block;
    margin: 0 !important;
  }

  /* --- 2. form-horizontal: stack labels above inputs --- */
  .form-horizontal .control-label {
    text-align: left;
    padding-bottom: 4px;
    width: 100%;
  }
  .form-horizontal .form-group [class*="col-sm-"],
  .form-horizontal .form-group [class*="col-md-"] {
    width: 100%;
    float: none;
    margin-left: 0;
  }

  /* --- 3. Modals: cap modal-lg width to viewport --- */
  .modal-lg {
    width: 95% !important;
    max-width: 95vw !important;
  }
  /* Stack triple-column (col-md-4) grids inside modals */
  .modal-body [class*="col-md-4"],
  .modal-body [class*="col-md-3"] {
    width: 100%;
    float: none;
  }

  /* --- 4. DataTables toolbar: stack controls vertically --- */
  .dataTables_wrapper .row.margin-bottom-12 > .col-sm-12 {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .dataTables_wrapper .pull-left,
  .dataTables_wrapper .pull-right {
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  div.dt-buttons {
    justify-content: flex-start;
  }

  /* --- 5. Content header: breadcrumb below title (no overlap) --- */
  .content-header > .breadcrumb {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    float: none !important;
    margin-top: 5px;
  }

  /* --- 6. Tables: allow horizontal scroll on all box-bodies --- */
  .box-body {
    overflow-x: auto;
  }
}

/* =========================================================================
   RESPONSIVE — Below 767px (mobile)
   Fixes: navbar, sidebar, modals, spacing
   ========================================================================= */
@media (max-width:767px) {

  /* --- Modal: full-width with padding --- */
  .modal-dialog {
    width: 94% !important;
    margin: 10px auto !important;
  }
  .modal-lg {
    width: 94% !important;
  }
  .modal-body {
    padding: 12px;
  }

  /* --- Form inputs: full width --- */
  .form-horizontal .form-group [class*="col-"],
  .form-group [class*="col-sm-"],
  .form-group [class*="col-md-"] {
    width: 100%;
    float: none;
    margin-left: 0;
  }

  /* --- Button rows: stack vertically, full width --- */
  .col-sm-offset-2.text-center > div,
  .col-sm-offset-2.text-center center > div {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 5px 0 !important;
  }

  /* --- DataTables toolbar: tighten spacing on mobile --- */
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    font-size: 12px;
  }
  .dataTables_wrapper .dataTables_filter input,
  .dataTables_wrapper .dataTables_length select {
    width: 100%;
  }

  /* --- Content header: smaller title on mobile --- */
  .content-header {
    padding: 12px 12px 6px;
  }
  .content-header > h1 {
    font-size: 18px;
  }
  .content-header > h1 > small {
    display: block;
    margin-top: 2px;
  }

  /* --- Boxes: reduce padding on mobile --- */
  .box-header {
    padding: 12px;
  }
  .box-body {
    padding: 12px;
  }

  /* --- Navbar custom menu: prevent overflow --- */
  .navbar-custom-menu .navbar-nav > li {
    float: left;
  }
  .navbar-custom-menu .navbar-nav {
    margin-right: 0;
  }
}