/* ==========================================================================
   TaxiPET — 2026 admin theme
   Sits on top of AdminLTE 3.2 / Bootstrap 4. Markup is unchanged; this file
   only restyles. Remove the <link> in templates/layout/default.php to revert.
   ========================================================================== */

:root {
  --tp-brand: #104068;
  --tp-primary: #1f63b3;
  --tp-primary-600: #184f8f;
  --tp-primary-soft: rgba(31, 99, 179, .10);
  --tp-accent: #19a7b8;

  --tp-success: #12a150;
  --tp-info: #0b8fd6;
  --tp-warning: #e8930c;
  --tp-danger: #e5484d;
  --tp-secondary: #64748b;

  --tp-bg: #f4f6fb;
  --tp-surface: #ffffff;
  --tp-surface-2: #f8fafc;
  --tp-border: #e6eaf1;
  --tp-border-strong: #d5dbe6;
  --tp-text: #0f1b2d;
  --tp-text-2: #3b4a5e;
  --tp-muted: #6b7a90;

  --tp-radius-sm: 8px;
  --tp-radius: 12px;
  --tp-radius-lg: 16px;
  --tp-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --tp-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --tp-shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);
  --tp-ring: 0 0 0 4px rgba(31, 99, 179, .16);

  --tp-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tp-sidebar-w: 250px;
  --tp-header-h: 64px;
}

body.dark-mode {
  --tp-primary: #5b9cf0;
  --tp-primary-600: #7fb2f5;
  --tp-primary-soft: rgba(91, 156, 240, .14);
  --tp-bg: #0b111b;
  --tp-surface: #121a26;
  --tp-surface-2: #172131;
  --tp-border: #222e40;
  --tp-border-strong: #2d3b51;
  --tp-text: #e7edf6;
  --tp-text-2: #c3cddb;
  --tp-muted: #8a98ad;
  --tp-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --tp-shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
  --tp-ring: 0 0 0 4px rgba(91, 156, 240, .22);
}

/* ---------- Base ---------- */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body.tp-theme {
  font-family: var(--tp-font);
  font-size: 14px;
  color: var(--tp-text);
  background: var(--tp-bg);
  letter-spacing: -0.003em;
}
.tp-theme .wrapper,
.tp-theme .content-wrapper { background: var(--tp-bg); color: var(--tp-text); }
.tp-theme .content { font-size: 13.5px; }
.tp-theme h1, .tp-theme h2, .tp-theme h3, .tp-theme h4, .tp-theme h5, .tp-theme h6 {
  font-family: var(--tp-font); color: var(--tp-text); font-weight: 650; letter-spacing: -0.015em;
}
.tp-theme a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item) { color: var(--tp-primary); text-decoration: none; }
.tp-theme a:not(.btn):not(.nav-link):not(.page-link):not(.dropdown-item):hover { color: var(--tp-primary-600); }
.tp-theme hr { border-color: var(--tp-border); }
.tp-theme ::selection { background: rgba(31, 99, 179, .18); }
.tp-theme pre { font-family: var(--tp-font); margin: 0; overflow: visible; }
.tp-theme .text-muted { color: var(--tp-muted) !important; }
.tp-theme *::-webkit-scrollbar { width: 10px; height: 10px; }
.tp-theme *::-webkit-scrollbar-thumb { background: var(--tp-border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
.tp-theme *::-webkit-scrollbar-track { background: transparent; }

/* ---------- Top progress bar (page navigation feedback) ---------- */
#tp-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9999;
  background: linear-gradient(90deg, var(--tp-accent), var(--tp-primary));
  box-shadow: 0 0 10px rgba(31, 99, 179, .5);
  transition: width .4s ease, opacity .3s ease; opacity: 0;
}
#tp-progress.is-loading { opacity: 1; width: 75%; transition: width 6s cubic-bezier(.1, .7, .2, 1), opacity .2s; }

/* ---------- Header ---------- */
.tp-theme .main-header.navbar {
  min-height: var(--tp-header-h);
  background: rgba(255, 255, 255, .78) !important;
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--tp-border) !important;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 1034;
}
body.dark-mode.tp-theme .main-header.navbar { background: rgba(18, 26, 38, .78) !important; }
.tp-theme .main-header .nav-link { color: var(--tp-text-2) !important; height: auto; }
.tp-icon-btn {
  display: inline-flex !important; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0 !important; border-radius: 10px;
  color: var(--tp-text-2) !important; background: transparent; border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s; cursor: pointer;
}
.tp-icon-btn:hover { background: var(--tp-surface-2); border-color: var(--tp-border); color: var(--tp-text) !important; }
.tp-header-title { font-weight: 600; font-size: 15px; color: var(--tp-text); margin-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.tp-header-actions { display: flex; align-items: center; gap: 6px; }
.tp-user { position: relative; margin-left: 6px; }
.tp-user-btn {
  display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px;
  border-radius: 999px; border: 1px solid var(--tp-border); background: var(--tp-surface);
  color: var(--tp-text); cursor: pointer; font: inherit; transition: box-shadow .15s, border-color .15s;
}
.tp-user-btn:hover { border-color: var(--tp-border-strong); box-shadow: var(--tp-shadow-sm); }
.tp-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--tp-accent), var(--tp-primary));
  flex-shrink: 0;
}
.tp-user-name { font-size: 13px; font-weight: 600; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 6px;
  background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius);
  box-shadow: var(--tp-shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s; z-index: 1040;
}
.tp-user.open .tp-user-menu { opacity: 1; visibility: visible; transform: none; }
.tp-user-menu .tp-user-head { padding: 10px 12px; border-bottom: 1px solid var(--tp-border); margin-bottom: 6px; }
.tp-user-menu .tp-user-head small { color: var(--tp-muted); display: block; }
.tp-user-menu a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: var(--tp-text-2); font-weight: 500;
}
.tp-user-menu a:hover { background: var(--tp-surface-2); color: var(--tp-text); }
.tp-user-menu a.tp-danger { color: var(--tp-danger); }
.tp-user-menu a.tp-danger:hover { background: rgba(229, 72, 77, .08); color: var(--tp-danger); }
@media (max-width: 575.98px) { .tp-user-name, .tp-header-title { display: none; } }

/* ---------- Sidebar ---------- */
.tp-theme .main-sidebar {
  background: var(--tp-surface) !important;
  border-right: 1px solid var(--tp-border);
  box-shadow: none !important;
}
.tp-theme .main-sidebar .brand-link {
  height: var(--tp-header-h); display: flex; align-items: center; gap: 10px;
  padding: 0 18px !important; border-bottom: 1px solid var(--tp-border) !important;
  color: var(--tp-text) !important; background: transparent !important;
}
.tp-theme .main-sidebar .brand-link .brand-image {
  float: none; margin: 0 !important; max-height: 36px; width: 36px; height: 36px;
  border-radius: 10px; box-shadow: none; opacity: 1 !important; object-fit: cover;
}
.tp-theme .main-sidebar .brand-text { font-weight: 500 !important; font-size: 17px; letter-spacing: -0.02em; color: var(--tp-text); }
.tp-theme .main-sidebar .brand-text b { font-weight: 800; color: var(--tp-brand); }
body.dark-mode.tp-theme .main-sidebar .brand-text b { color: var(--tp-primary); }
.tp-theme .sidebar { padding: 12px 12px 24px; }
.tp-theme .nav-sidebar .nav-header {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--tp-muted) !important; padding: 16px 12px 6px !important; background: transparent !important;
}
.tp-theme .nav-sidebar .nav-item { margin-bottom: 2px; }
.tp-theme .nav-sidebar > .nav-item > .nav-link,
.tp-theme .nav-sidebar .nav-treeview > .nav-item > .nav-link {
  display: flex; align-items: center; gap: 2px;
  border-radius: 10px; padding: 9px 12px; margin: 0 !important; width: 100% !important;
  color: var(--tp-text-2) !important; font-weight: 500; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.tp-theme .nav-sidebar .nav-link p { color: inherit !important; flex: 1; margin: 0; white-space: nowrap; }
.tp-theme .nav-sidebar .nav-link .nav-icon,
.tp-theme .nav-sidebar .nav-link > i:first-child {
  color: var(--tp-muted) !important; font-size: 15px !important; width: 22px !important;
  margin: 0 10px 0 0 !important; padding: 0 !important; text-align: center; transition: color .15s;
}
.tp-theme .nav-sidebar .nav-link .right { color: var(--tp-muted) !important; top: auto !important; font-size: 11px; transition: transform .2s; }
.tp-theme .nav-sidebar .nav-link:hover { background: var(--tp-surface-2) !important; color: var(--tp-text) !important; }
.tp-theme .nav-sidebar .nav-link:hover .nav-icon,
.tp-theme .nav-sidebar .nav-link:hover > i:first-child { color: var(--tp-primary) !important; }
.tp-theme .nav-sidebar > .nav-item > .nav-link.active,
.tp-theme .nav-sidebar .nav-treeview > .nav-item > .nav-link.active {
  background: var(--tp-primary-soft) !important; color: var(--tp-primary) !important; box-shadow: none !important; font-weight: 600;
}
.tp-theme .nav-sidebar .nav-link.active .nav-icon,
.tp-theme .nav-sidebar .nav-link.active > i:first-child { color: var(--tp-primary) !important; }
.tp-theme .nav-sidebar > .nav-item.menu-open > .nav-link { color: var(--tp-text) !important; background: transparent; }
.tp-theme .nav-sidebar > .nav-item.menu-is-opening > .nav-link .right,
.tp-theme .nav-sidebar > .nav-item.menu-open > .nav-link .right { transform: rotate(-90deg); }
/* tree children: thin guide line + dots */
.tp-theme .nav-sidebar .nav-treeview { margin: 2px 0 6px 22px; padding-left: 10px; border-left: 1px solid var(--tp-border); }
.tp-theme .nav-sidebar .nav-treeview > .nav-item > .nav-link { padding: 7px 10px; font-size: 13px; }
.tp-theme .nav-sidebar .nav-treeview .nav-link > i.nav-icon:first-child, .tp-theme .nav-sidebar .nav-treeview .nav-icon { font-size: 6px !important; width: 10px !important; margin-right: 10px !important; }
.tp-theme .nav-sidebar .nav-treeview .nav-link.active .nav-icon::before { content: "\f111"; font-weight: 900; }
.tp-theme .user-panel { border: 0 !important; }
/* collapsed (mini) sidebar */
.sidebar-mini.sidebar-collapse.tp-theme .main-sidebar:not(:hover) .nav-sidebar .nav-header { display: none; }
.sidebar-mini.sidebar-collapse.tp-theme .main-sidebar:not(:hover) .sidebar { padding: 12px 8px; }
.sidebar-mini.sidebar-collapse.tp-theme .main-sidebar:not(:hover) .nav-sidebar .nav-link { justify-content: center; padding: 10px 0; }
.sidebar-mini.sidebar-collapse.tp-theme .main-sidebar:not(:hover) .nav-sidebar .nav-link .nav-icon,
.sidebar-mini.sidebar-collapse.tp-theme .main-sidebar:not(:hover) .nav-sidebar .nav-link > i:first-child { margin: 0 !important; }
.sidebar-mini.sidebar-collapse.tp-theme .main-sidebar:not(:hover) .nav-sidebar .nav-treeview { margin-left: 0; border: 0; padding: 0; }
.sidebar-mini.sidebar-collapse.tp-theme .main-sidebar:not(:hover) .tp-sidebar-foot { display: none; }
.sidebar-mini.sidebar-collapse.tp-theme .main-sidebar:not(:hover) .brand-link { padding: 0 !important; justify-content: center; }
.tp-sidebar-foot {
  margin: 18px 4px 0; padding: 14px; border-radius: var(--tp-radius);
  background: linear-gradient(135deg, rgba(25, 167, 184, .12), rgba(31, 99, 179, .12));
  border: 1px solid var(--tp-border); font-size: 12px; color: var(--tp-text-2);
}
.tp-sidebar-foot strong { display: block; color: var(--tp-text); font-size: 13px; margin-bottom: 2px; }

/* ---------- Page header ---------- */
.tp-theme .content-header { padding: 26px 24px 10px; }
.tp-theme .content-header h1 { font-size: 24px !important; font-weight: 700 !important; color: var(--tp-text) !important; margin: 0; }
.tp-page-sub { color: var(--tp-muted); font-size: 13px; margin-top: 2px; }
.tp-theme .breadcrumb { background: transparent; padding: 0; margin: 0; font-size: 12.5px; }
.tp-theme .breadcrumb-item, .tp-theme .breadcrumb-item a { color: var(--tp-muted); }
.tp-theme .breadcrumb-item a:hover { color: var(--tp-primary); }
.tp-theme .breadcrumb-item.active { color: var(--tp-text-2); font-weight: 500; }
.tp-theme .breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--tp-border-strong); }
.tp-theme .content { padding: 8px 24px 32px; }
.tp-theme .content > .container-fluid { padding: 0; }
@media (max-width: 767.98px) {
  .tp-theme .content-header { padding: 18px 14px 6px; }
  .tp-theme .content { padding: 6px 14px 24px; }
  .tp-theme .main-header.navbar { padding: 0 10px; }
}
.tp-theme .main-footer { display: none; }

/* ---------- Cards ---------- */
.tp-theme .card {
  background: var(--tp-surface); color: var(--tp-text);
  border: 1px solid var(--tp-border); border-radius: var(--tp-radius-lg);
  box-shadow: var(--tp-shadow-sm); margin-bottom: 20px;
}
.tp-theme .card.card-outline, .tp-theme .card[class*="card-outline"] { border-top: 1px solid var(--tp-border) !important; }
.tp-theme .card-header {
  background: transparent !important; color: var(--tp-text) !important;
  border-bottom: 1px solid var(--tp-border); padding: 16px 20px;
  border-top-left-radius: var(--tp-radius-lg) !important; border-top-right-radius: var(--tp-radius-lg) !important;
}
.tp-theme .card-primary:not(.card-outline) > .card-header,
.tp-theme .card-info:not(.card-outline) > .card-header,
.tp-theme .card-success:not(.card-outline) > .card-header { border-bottom: 1px solid var(--tp-border); }
.tp-theme .card-title { font-size: 15px !important; font-weight: 650; color: var(--tp-text); margin: 0; }
.tp-theme .card-header .card-title + * { margin-left: auto; }
.tp-theme .card-body { padding: 18px 20px; }
.tp-theme .card-body.p-1 { padding: 10px !important; }
.tp-theme .card-footer { background: var(--tp-surface-2); border-top: 1px solid var(--tp-border); padding: 14px 20px; border-radius: 0 0 var(--tp-radius-lg) var(--tp-radius-lg) !important; }
.tp-theme .card-tools .btn-tool { color: var(--tp-muted); }

/* KPI tiles (AdminLTE small-box / info-box) */
.tp-theme .small-box {
  border-radius: var(--tp-radius-lg); box-shadow: var(--tp-shadow-sm); overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08); position: relative;
}
.tp-theme .small-box::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, .22), transparent 55%);
}
.tp-theme .small-box > .inner { padding: 18px 20px; position: relative; z-index: 1; }
.tp-theme .small-box h3, .tp-theme .small-box h4 { font-weight: 700; color: inherit; letter-spacing: -0.02em; }
.tp-theme .small-box p { opacity: .9; font-weight: 500; }
.tp-theme .small-box .icon > i { font-size: 54px; top: 18px; right: 18px; opacity: .22; }
.tp-theme .small-box.bg-default, .tp-theme .small-box.bg-white { background: var(--tp-surface) !important; border: 1px solid var(--tp-border); color: var(--tp-text); }
.tp-theme .small-box > .small-box-footer { background: rgba(0, 0, 0, .08); }
.tp-theme .info-box { border-radius: var(--tp-radius-lg); box-shadow: var(--tp-shadow-sm); border: 1px solid var(--tp-border); background: var(--tp-surface); }
.tp-theme .info-box .info-box-icon { border-radius: 12px; }

/* ---------- Tables ---------- */
.tp-theme .table { color: var(--tp-text); margin-bottom: 0; font-size: 13px; }
.tp-theme .table thead th,
.tp-theme table thead tr,
.tp-theme table.main-table thead tr {
  background: var(--tp-surface-2) !important; color: var(--tp-muted) !important;
}
.tp-theme .table thead th {
  font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em;
  border-top: 0 !important; border-bottom: 1px solid var(--tp-border) !important;
  padding: 11px 14px; white-space: nowrap; vertical-align: middle;
}
.tp-theme .table thead th a, .tp-theme table thead a { color: var(--tp-muted) !important; }
.tp-theme .table thead th a:hover { color: var(--tp-text) !important; }
.tp-theme .table thead th a.asc::after { content: " ↑"; }
.tp-theme .table thead th a.desc::after { content: " ↓"; }
.tp-theme .table td { padding: 11px 14px; border-top: 1px solid var(--tp-border) !important; vertical-align: middle; }
.tp-theme table tr { background: transparent; }
.tp-theme .table tbody tr { transition: background .12s; }
.tp-theme .table-hover tbody tr:hover, .tp-theme .table tbody tr:hover { background: var(--tp-surface-2); color: var(--tp-text); }
.tp-theme .table-striped tbody tr:nth-of-type(odd) { background: transparent; }
.tp-theme .table-striped tbody tr:nth-of-type(even) { background: rgba(100, 116, 139, .035); }
.tp-theme .table-bordered, .tp-theme .table-bordered td, .tp-theme .table-bordered th { border-color: var(--tp-border) !important; }
.tp-theme .table-responsive { border-radius: var(--tp-radius); }
.tp-theme .card-body > .table-responsive, .tp-theme .card-body.p-0 .table { border-radius: 0 0 var(--tp-radius-lg) var(--tp-radius-lg); }
.tp-theme .table td .btn + .btn, .tp-theme .table td .btn + form, .tp-theme .table td a.btn + a.btn { margin-left: 4px; }
.tp-theme td.actions { white-space: nowrap; }
.tp-theme td.actions form { display: inline; }
/* status labels rendered as <p class="bg-*"> inside cells */
.tp-theme td > p[class*="bg-"], .tp-theme td > span[class*="bg-"]:not(.small-box) {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.4; white-space: nowrap;
}
.tp-theme td > p[class*="bg-"]::before, .tp-theme td > span[class*="bg-"]:not(.small-box)::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85;
}
.tp-theme td > p.bg-success, .tp-theme td > span.bg-success { background: rgba(18, 161, 80, .12) !important; color: var(--tp-success) !important; }
.tp-theme td > p.bg-info, .tp-theme td > span.bg-info { background: rgba(11, 143, 214, .12) !important; color: var(--tp-info) !important; }
.tp-theme td > p.bg-warning, .tp-theme td > span.bg-warning { background: rgba(232, 147, 12, .14) !important; color: #b86e00 !important; }
.tp-theme td > p.bg-danger, .tp-theme td > span.bg-danger { background: rgba(229, 72, 77, .12) !important; color: var(--tp-danger) !important; }
.tp-theme td > p.bg-secondary, .tp-theme td > span.bg-secondary { background: rgba(100, 116, 139, .14) !important; color: var(--tp-secondary) !important; }
.tp-theme td > p.bg-primary, .tp-theme td > span.bg-primary { background: var(--tp-primary-soft) !important; color: var(--tp-primary) !important; }
body.dark-mode.tp-theme td > p.bg-warning, body.dark-mode.tp-theme td > span.bg-warning { color: #f5b544 !important; }
/* "Oui / Non" bordered spans */
.tp-theme td span.border.border-success, .tp-theme td span.border.border-danger {
  display: inline-block; min-width: 54px; padding: 3px 10px; border-radius: 999px !important; font-size: 11.5px; font-weight: 600; width: auto !important;
}
.tp-theme td span.border.border-success { border-color: transparent !important; background: rgba(18, 161, 80, .12); }
.tp-theme td span.border.border-danger { border-color: transparent !important; background: rgba(229, 72, 77, .1); }

/* ---------- Buttons ---------- */
.tp-theme .btn {
  border-radius: 10px; font-weight: 550; font-size: 13.5px; padding: 8px 14px;
  box-shadow: none; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.tp-theme .btn:active { transform: translateY(1px); }
.tp-theme .btn:focus, .tp-theme .btn.focus { box-shadow: var(--tp-ring) !important; }
.tp-theme .btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.tp-theme .btn-xs { padding: 3px 8px; font-size: 11.5px; border-radius: 7px; line-height: 1.5; }
.tp-theme .btn-lg { padding: 11px 20px; font-size: 15px; border-radius: 12px; }
.tp-theme .btn-primary { background: var(--tp-primary); border-color: var(--tp-primary); color: #fff; }
.tp-theme .btn-primary:hover, .tp-theme .btn-primary:focus, .tp-theme .btn-primary:not(:disabled):not(.disabled):active { background: var(--tp-primary-600); border-color: var(--tp-primary-600); color: #fff; }
body.dark-mode.tp-theme .btn-primary { color: #0b111b; }
.tp-theme .btn-success { background: var(--tp-success); border-color: var(--tp-success); }
.tp-theme .btn-info { background: var(--tp-info); border-color: var(--tp-info); color: #fff; }
.tp-theme .btn-warning { background: var(--tp-warning); border-color: var(--tp-warning); color: #fff; }
.tp-theme .btn-warning:hover { color: #fff; filter: brightness(.95); }
.tp-theme .btn-danger { background: var(--tp-danger); border-color: var(--tp-danger); }
.tp-theme .btn-secondary { background: var(--tp-surface-2); border-color: var(--tp-border-strong); color: var(--tp-text-2); }
.tp-theme .btn-secondary:hover { background: var(--tp-border); border-color: var(--tp-border-strong); color: var(--tp-text); }
.tp-theme .btn-secondary .text-white { color: var(--tp-text-2) !important; }
.tp-theme .btn-default, .tp-theme .btn-light { background: var(--tp-surface); border-color: var(--tp-border-strong); color: var(--tp-text-2); }
.tp-theme .btn-default:hover, .tp-theme .btn-light:hover { background: var(--tp-surface-2); color: var(--tp-text); }
.tp-theme .btn-outline-primary { color: var(--tp-primary); border-color: rgba(31, 99, 179, .35); background: transparent; }
.tp-theme .btn-outline-primary:hover { background: var(--tp-primary); border-color: var(--tp-primary); color: #fff; }
.tp-theme .btn-outline-success { color: var(--tp-success); border-color: rgba(18, 161, 80, .35); }
.tp-theme .btn-outline-success:hover { background: var(--tp-success); border-color: var(--tp-success); color: #fff; }
.tp-theme .btn-outline-danger { color: var(--tp-danger); border-color: rgba(229, 72, 77, .35); }
.tp-theme .btn-outline-danger:hover { background: var(--tp-danger); color: #fff; }
.tp-theme .btn-outline-secondary { color: var(--tp-text-2); border-color: var(--tp-border-strong); }
.tp-theme .btn-outline-secondary:hover { background: var(--tp-surface-2); color: var(--tp-text); }
.tp-theme .btn-link { color: var(--tp-primary); }

/* ---------- Forms ---------- */
.tp-theme .form-control, .tp-theme .custom-select, .tp-theme select.form-control {
  border-radius: 10px; border: 1px solid var(--tp-border-strong); background-color: var(--tp-surface);
  color: var(--tp-text); font-size: 13.5px; min-height: 40px; padding: 8px 12px; box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.tp-theme textarea.form-control { min-height: 90px; }
.tp-theme .form-control-sm { min-height: 32px; padding: 4px 10px; font-size: 12.5px; border-radius: 8px; }
.tp-theme .form-control:focus, .tp-theme .custom-select:focus {
  border-color: var(--tp-primary); box-shadow: var(--tp-ring); background-color: var(--tp-surface); color: var(--tp-text);
}
.tp-theme .form-control::placeholder { color: var(--tp-muted); opacity: .8; }
.tp-theme .form-control:disabled, .tp-theme .form-control[readonly] { background: var(--tp-surface-2); }
.tp-theme label, .tp-theme .col-form-label { font-weight: 550; font-size: 12.5px; color: var(--tp-text-2); margin-bottom: 6px; }
.tp-theme .form-check-label, .tp-theme .custom-control-label { font-weight: 450; font-size: 13.5px; }
.tp-theme .input-group-text { background: var(--tp-surface-2); border-color: var(--tp-border-strong); color: var(--tp-muted); border-radius: 10px; }
.tp-theme .input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tp-theme .input-group > .input-group-append > .input-group-text { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tp-theme .input-group > .input-group-prepend > .input-group-text { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tp-theme .input-group > .input-group-prepend + .form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tp-theme .error-message, .tp-theme .invalid-feedback { color: var(--tp-danger); font-size: 12.5px; margin-top: 4px; }
.tp-theme .form-control.is-invalid, .tp-theme .form-error .form-control { border-color: var(--tp-danger); }
.tp-theme input[type=checkbox], .tp-theme input[type=radio] { accent-color: var(--tp-primary); margin-right: 5px; }
.tp-theme .filters-container form.form-inline > div,
.tp-theme .filters-container form.form-inline div.input { padding: 8px; display: flex; align-items: center; gap: 8px; }

/* Select2 */
.tp-theme .select2-container--default .select2-selection--single,
.tp-theme .select2-container--default .select2-selection--multiple,
.tp-theme .select2-container--bootstrap4 .select2-selection {
  border-radius: 10px !important; border-color: var(--tp-border-strong) !important; min-height: 40px; background: var(--tp-surface);
}
.tp-theme .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; color: var(--tp-text); padding-left: 12px; }
.tp-theme .select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; }
.tp-theme .select2-container--default.select2-container--focus .select2-selection,
.tp-theme .select2-container--default.select2-container--open .select2-selection { border-color: var(--tp-primary) !important; box-shadow: var(--tp-ring); }
.select2-dropdown { border-color: var(--tp-border-strong) !important; border-radius: 10px !important; overflow: hidden; box-shadow: var(--tp-shadow-lg); }
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--tp-primary) !important; }
.tp-theme .select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--tp-primary-soft); border: 0; color: var(--tp-primary); border-radius: 6px; }

/* ---------- Pagination ---------- */
.tp-theme .pagination { gap: 4px; flex-wrap: wrap; }
.tp-theme .page-item .page-link {
  border-radius: 8px !important; border: 1px solid var(--tp-border); color: var(--tp-text-2);
  background: var(--tp-surface); min-width: 34px; text-align: center; font-weight: 550; font-size: 13px; padding: 6px 10px;
}
.tp-theme .page-item .page-link:hover { background: var(--tp-surface-2); color: var(--tp-text); }
.tp-theme .page-item.active .page-link { background: var(--tp-primary) !important; border-color: var(--tp-primary) !important; color: #fff; }
.tp-theme .page-item.disabled .page-link { background: var(--tp-surface); color: var(--tp-muted); opacity: .6; }
.tp-theme .paginator p, .tp-theme .paginator-text { color: var(--tp-muted); font-size: 12.5px; }

/* ---------- Badges / alerts / flash ---------- */
.tp-theme .badge { border-radius: 999px; font-weight: 600; padding: .38em .7em; letter-spacing: .01em; }
.tp-theme .alert { border-radius: var(--tp-radius); border: 1px solid transparent; padding: 12px 16px; font-weight: 500; box-shadow: var(--tp-shadow-sm); }
.tp-theme .alert-success { background: rgba(18, 161, 80, .10); border-color: rgba(18, 161, 80, .25); color: #0b7a3b; }
.tp-theme .alert-danger { background: rgba(229, 72, 77, .09); border-color: rgba(229, 72, 77, .25); color: #b42328; }
.tp-theme .alert-warning { background: rgba(232, 147, 12, .10); border-color: rgba(232, 147, 12, .28); color: #925600; }
.tp-theme .alert-info { background: rgba(11, 143, 214, .09); border-color: rgba(11, 143, 214, .25); color: #075f8f; }
body.dark-mode.tp-theme .alert-success { color: #4ade80; }
body.dark-mode.tp-theme .alert-danger { color: #fb7185; }
body.dark-mode.tp-theme .alert-warning { color: #fbbf24; }
body.dark-mode.tp-theme .alert-info { color: #7dd3fc; }
.tp-theme .alert .close { opacity: .5; text-shadow: none; }

/* ---------- Modals / dropdowns ---------- */
.tp-theme .modal-content { border: 1px solid var(--tp-border); border-radius: 18px; box-shadow: var(--tp-shadow-lg); background: var(--tp-surface); color: var(--tp-text); }
.tp-theme .modal-header { border-bottom: 1px solid var(--tp-border); padding: 18px 22px; }
.tp-theme .modal-title { font-size: 16px; font-weight: 650; }
.tp-theme .modal-body { padding: 20px 22px; }
.tp-theme .modal-footer { border-top: 1px solid var(--tp-border); padding: 14px 22px; }
.tp-theme .modal-header .close { color: var(--tp-muted); text-shadow: none; }
.modal-backdrop.show { opacity: .45; }
.modal-backdrop { background: #0b1220; }
.tp-theme .dropdown-menu { border: 1px solid var(--tp-border); border-radius: var(--tp-radius); box-shadow: var(--tp-shadow-lg); padding: 6px; background: var(--tp-surface); }
.tp-theme .dropdown-item { border-radius: 8px; padding: 8px 12px; color: var(--tp-text-2); }
.tp-theme .dropdown-item:hover { background: var(--tp-surface-2); color: var(--tp-text); }

/* ---------- Tabs / list groups ---------- */
.tp-theme .nav-tabs { border-bottom: 1px solid var(--tp-border); }
.tp-theme .nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--tp-muted); font-weight: 550; padding: 10px 14px; }
.tp-theme .nav-tabs .nav-link.active { color: var(--tp-primary); border-bottom-color: var(--tp-primary); background: transparent; }
.tp-theme .nav-pills:not(.nav-sidebar) .nav-link { border-radius: 10px; }
.tp-theme .nav-pills:not(.nav-sidebar) .nav-link.active { background: var(--tp-primary); }
.tp-theme .list-group-item { border-color: var(--tp-border); background: var(--tp-surface); color: var(--tp-text); }

/* ---------- DataTables ---------- */
.tp-theme .dataTables_wrapper .dataTables_filter input,
.tp-theme .dataTables_wrapper .dataTables_length select {
  border-radius: 10px; border: 1px solid var(--tp-border-strong); padding: 6px 10px; background: var(--tp-surface); color: var(--tp-text);
}
.tp-theme .dataTables_wrapper .dataTables_info { color: var(--tp-muted); font-size: 12.5px; }
.tp-theme div.dt-buttons .btn, .tp-theme div.dt-buttons .dt-button {
  background: var(--tp-surface) !important; border: 1px solid var(--tp-border-strong) !important; color: var(--tp-text-2) !important;
  border-radius: 8px !important; padding: 5px 12px !important; font-size: 12.5px !important; margin-right: 4px;
}
.tp-theme div.dt-buttons .btn:hover, .tp-theme div.dt-buttons .dt-button:hover { background: var(--tp-surface-2) !important; }
.tp-theme .dataTables_filter, .tp-theme .dataTables_info { position: sticky; left: 0; }

/* ---------- FullCalendar ---------- */
.tp-theme .fc { --fc-border-color: var(--tp-border); --fc-today-bg-color: var(--tp-primary-soft); --fc-button-bg-color: var(--tp-surface); --fc-button-border-color: var(--tp-border-strong); --fc-button-text-color: var(--tp-text-2); --fc-button-active-bg-color: var(--tp-primary); --fc-button-active-border-color: var(--tp-primary); --fc-button-hover-bg-color: var(--tp-surface-2); --fc-button-hover-border-color: var(--tp-border-strong); }
.tp-theme .fc .fc-button { border-radius: 8px; font-weight: 550; text-transform: capitalize; box-shadow: none !important; }
.tp-theme .fc .fc-button-primary:not(:disabled).fc-button-active, .tp-theme .fc .fc-button-primary:not(:disabled):active { color: #fff; }
.tp-theme .fc .fc-toolbar-title { font-size: 18px; font-weight: 650; }
.tp-theme .fc .fc-event { border-radius: 6px; border: 0; padding: 1px 4px; }
.tp-theme .fc-theme-standard .fc-scrollgrid { border-radius: var(--tp-radius); overflow: hidden; }
.tp-theme .fc .fc-col-header-cell-cushion { color: var(--tp-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.tp-theme .fc .fc-daygrid-day-number { color: var(--tp-text-2); }

/* ---------- Theme colour remap (Bootstrap utilities) ---------- */
.tp-theme .bg-primary { background-color: var(--tp-primary) !important; }
.tp-theme .bg-success { background-color: var(--tp-success) !important; }
.tp-theme .bg-info { background-color: var(--tp-info) !important; }
.tp-theme .bg-warning { background-color: var(--tp-warning) !important; color: #fff !important; }
.tp-theme .bg-danger { background-color: var(--tp-danger) !important; }
.tp-theme .bg-secondary { background-color: var(--tp-secondary) !important; }
.tp-theme .text-primary { color: var(--tp-primary) !important; }
.tp-theme .text-success { color: var(--tp-success) !important; }
.tp-theme .text-danger { color: var(--tp-danger) !important; }
.tp-theme .text-info { color: var(--tp-info) !important; }
.tp-theme .text-warning { color: var(--tp-warning) !important; }

/* ---------- Legacy helpers used by templates (previously in style.css) ---------- */
.moz-view-table th { border-right: 1px solid var(--tp-border); }
.moz-view-table tr:nth-child(even) { background-color: var(--tp-surface-2); }
.moz_empty_state { width: 440px; max-width: 100%; height: auto; }
.moz-main-color { color: var(--tp-accent) !important; }
.moz-display-table { display: table !important; }
.moz-inline-display-table { display: inline-table !important; }
.moz-overflow-x-scroll { overflow-x: scroll !important; }
.moz-overflow-x-auto { overflow-x: auto !important; }
.scrollable-table { width: 100% !important; }
.avatar { width: 250px; max-width: 100%; height: auto; border-radius: var(--tp-radius); }
.details-control-content.truncated { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; display: inline-block; vertical-align: middle; }
.details-control-button { vertical-align: middle; }
.tp-theme h2.section { color: var(--tp-text); font-size: 17px; font-weight: 650; }
.tp-theme .table th.moz-view-table, .tp-theme .moz-view-table th { color: var(--tp-text-2); font-weight: 600; background: var(--tp-surface-2); width: 220px; }

/* ---------- Dark-mode surface fixes for AdminLTE components ---------- */
body.dark-mode.tp-theme .card, body.dark-mode.tp-theme .modal-content, body.dark-mode.tp-theme .dropdown-menu { background: var(--tp-surface); color: var(--tp-text); }
body.dark-mode.tp-theme .form-control, body.dark-mode.tp-theme .custom-select, body.dark-mode.tp-theme .input-group-text { background-color: var(--tp-surface-2); border-color: var(--tp-border-strong); color: var(--tp-text); }
body.dark-mode.tp-theme .table, body.dark-mode.tp-theme .table td { color: var(--tp-text); }
body.dark-mode.tp-theme .bg-white, body.dark-mode.tp-theme .bg-light { background-color: var(--tp-surface) !important; color: var(--tp-text) !important; }
body.dark-mode.tp-theme .text-dark { color: var(--tp-text) !important; }
body.dark-mode.tp-theme .select2-dropdown, body.dark-mode.tp-theme .select2-container--default .select2-selection { background: var(--tp-surface-2); color: var(--tp-text); }
body.dark-mode.tp-theme .page-item .page-link { background: var(--tp-surface); color: var(--tp-text-2); border-color: var(--tp-border); }
body.dark-mode.tp-theme .tp-dash-table td a, body.dark-mode.tp-theme .table td a:not(.btn) { color: var(--tp-primary); }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.tp-dash { display: grid; gap: 20px; }
.tp-kpis { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1199.98px) { .tp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .tp-kpis { grid-template-columns: 1fr; } }
.tp-kpi {
  position: relative; overflow: hidden; background: var(--tp-surface); border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-lg); padding: 18px 20px; box-shadow: var(--tp-shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.tp-kpi:hover { box-shadow: var(--tp-shadow); transform: translateY(-1px); }
.tp-kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.tp-kpi-label { font-size: 12.5px; font-weight: 600; color: var(--tp-muted); }
.tp-kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.tp-kpi-value { font-size: 28px; font-weight: 750; letter-spacing: -0.03em; line-height: 1.1; color: var(--tp-text); }
.tp-kpi-value small { font-size: 13px; font-weight: 600; color: var(--tp-muted); letter-spacing: 0; margin-left: 4px; }
.tp-kpi-foot { margin-top: 8px; font-size: 12px; color: var(--tp-muted); display: flex; align-items: center; gap: 6px; }
.tp-kpi-bar { height: 6px; border-radius: 999px; background: var(--tp-surface-2); overflow: hidden; margin-top: 12px; }
.tp-kpi-bar > span { display: block; height: 100%; border-radius: inherit; }
.tp-tone-blue .tp-kpi-icon { background: rgba(31, 99, 179, .12); color: var(--tp-primary); }
.tp-tone-teal .tp-kpi-icon { background: rgba(25, 167, 184, .14); color: var(--tp-accent); }
.tp-tone-green .tp-kpi-icon { background: rgba(18, 161, 80, .12); color: var(--tp-success); }
.tp-tone-amber .tp-kpi-icon { background: rgba(232, 147, 12, .14); color: var(--tp-warning); }
.tp-tone-violet .tp-kpi-icon { background: rgba(124, 92, 230, .14); color: #7c5ce6; }
.tp-tone-rose .tp-kpi-icon { background: rgba(229, 72, 77, .12); color: var(--tp-danger); }

.tp-grid-2 { display: grid; gap: 20px; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); }
@media (max-width: 1199.98px) { .tp-grid-2 { grid-template-columns: 1fr; } }
.tp-dash .card { margin-bottom: 0; }
.tp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tp-card-head .tp-sub { font-size: 12.5px; color: var(--tp-muted); margin-top: 2px; }
.tp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--tp-surface-2); border: 1px solid var(--tp-border); color: var(--tp-text-2); }
.tp-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tp-success); box-shadow: 0 0 0 3px rgba(18, 161, 80, .18); }
.tp-highlight { display: flex; align-items: center; gap: 14px; padding: 14px 0; }
.tp-highlight + .tp-highlight { border-top: 1px solid var(--tp-border); }
.tp-highlight .tp-kpi-icon { flex-shrink: 0; }
.tp-highlight-label { font-size: 12px; color: var(--tp-muted); font-weight: 600; }
.tp-highlight-value { font-size: 15px; font-weight: 650; color: var(--tp-text); }
.tp-highlight-meta { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--tp-text-2); background: var(--tp-surface-2); border: 1px solid var(--tp-border); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tp-donut-wrap { position: relative; height: 180px; margin: 6px 0 4px; }
.tp-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.tp-donut-center strong { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; }
.tp-donut-center span { font-size: 11.5px; color: var(--tp-muted); font-weight: 600; }
.tp-legend { display: grid; gap: 8px; margin-top: 10px; }
.tp-legend-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tp-text-2); }
.tp-legend-row .sw { width: 10px; height: 10px; border-radius: 3px; }
.tp-legend-row b { margin-left: auto; color: var(--tp-text); }
.tp-empty { text-align: center; padding: 48px 16px; color: var(--tp-muted); }
.tp-empty i { font-size: 34px; color: var(--tp-border-strong); margin-bottom: 12px; display: block; }
.tp-empty strong { display: block; color: var(--tp-text); font-size: 15px; margin-bottom: 4px; }
.tp-dash-table td .tp-ref { font-weight: 650; color: var(--tp-text); font-variant-numeric: tabular-nums; }
.tp-dash-table td .tp-time { font-variant-numeric: tabular-nums; color: var(--tp-text-2); }
.tp-dash-table td .tp-region { font-size: 12px; color: var(--tp-muted); }
.tp-num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Login ---------- */
.tp-login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--tp-surface); font-family: var(--tp-font); color: var(--tp-text); }
@media (max-width: 991.98px) { .tp-login { grid-template-columns: 1fr; } .tp-login-art { display: none !important; } }
.tp-login-art {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px; color: #fff;
  background:
    radial-gradient(60% 50% at 85% 10%, rgba(25, 167, 184, .55), transparent 60%),
    radial-gradient(70% 60% at 10% 100%, rgba(31, 99, 179, .65), transparent 60%),
    linear-gradient(160deg, #0d3558 0%, #104068 45%, #0a2a46 100%);
}
.tp-login-art::before {
  content: ""; position: absolute; inset: 0; opacity: .12;
  background-image: linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 40%, #000, transparent);
}
.tp-login-art > * { position: relative; }
.tp-login-brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.tp-login-brand img { width: 44px; height: 44px; border-radius: 12px; background: #fff; }
.tp-login-art h2 { color: #fff; font-size: 40px; font-weight: 750; line-height: 1.1; letter-spacing: -0.035em; max-width: 460px; margin: 0 0 14px; }
.tp-login-art p { color: rgba(255, 255, 255, .78); font-size: 15.5px; max-width: 420px; margin: 0; }
.tp-login-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.tp-login-pills span { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); font-size: 13px; font-weight: 500; backdrop-filter: blur(6px); }
.tp-login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--tp-bg); }
.tp-login-card { width: 100%; max-width: 400px; }
.tp-login-card .tp-logo { width: 56px; height: 56px; border-radius: 16px; box-shadow: var(--tp-shadow); margin-bottom: 22px; }
.tp-login-card h1 { font-size: 26px; font-weight: 750; letter-spacing: -0.03em; margin: 0 0 6px; color: var(--tp-text); }
.tp-login-card .tp-login-sub { color: var(--tp-muted); margin-bottom: 28px; font-size: 14.5px; }
.tp-login-card .card { border: 0; background: transparent; box-shadow: none; margin: 0; }
.tp-login-card .card-body { padding: 0; background: transparent; }
.tp-login-card .login-box-msg, .tp-login-card center { display: none; }
.tp-login-card .form-group, .tp-login-card .input { margin-bottom: 16px; }
.tp-login-card .form-control { height: 46px; border-radius: 12px; font-size: 14.5px; }
.tp-login-card .input-group-text { border-radius: 12px; }
.tp-login-card .row { margin: 0; display: block; }
.tp-login-card .row > [class*="col-"] { max-width: 100%; flex: none; padding: 0; }
.tp-login-card .row > .col-4:first-child { display: none; }
.tp-login-card .btn-primary { width: 100%; height: 46px; border-radius: 12px; font-size: 15px; font-weight: 600; margin-top: 6px;
  background: linear-gradient(135deg, var(--tp-primary), var(--tp-brand)); border: 0; box-shadow: 0 8px 20px rgba(16, 64, 104, .25); }
.tp-login-card .btn-primary:hover { filter: brightness(1.06); }
.tp-login-foot { margin-top: 28px; font-size: 12.5px; color: var(--tp-muted); text-align: center; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) { .tp-theme *, .tp-login * { transition: none !important; animation: none !important; } }

/* ---------- Fixes after visual review ---------- */
.tp-theme .btn-primary, .tp-theme .btn-success, .tp-theme .btn-danger, .tp-theme .btn-info, .tp-theme .btn-warning,
.tp-theme a.btn-primary, .tp-theme a.btn-success, .tp-theme a.btn-danger, .tp-theme a.btn-info, .tp-theme a.btn-warning { color: #fff; }
.tp-theme a.btn-primary:hover, .tp-theme a.btn-success:hover, .tp-theme a.btn-danger:hover, .tp-theme a.btn-info:hover, .tp-theme a.btn-warning:hover { color: #fff; }
body.dark-mode.tp-theme .btn-primary, body.dark-mode.tp-theme a.btn-primary { color: #0b111b; }
/* buttons given an inline background colour in templates keep light text */
.tp-theme .btn[style*="background"] { color: #fff !important; border-color: transparent; }
.tp-theme .btn[style*="background"]:hover { filter: brightness(1.1); }
/* cards nested inside cards: flatten */
.tp-theme .card .card { box-shadow: none; }
.tp-theme .card-header.tp-empty-header { display: none; }

/* ---------- Admin notification center (bell, list page, preferences) ---------- */
.tp-c-primary { --tp-c: var(--tp-primary); }
.tp-c-info { --tp-c: var(--tp-info); }
.tp-c-success { --tp-c: var(--tp-success); }
.tp-c-warning { --tp-c: var(--tp-warning); }
.tp-c-danger { --tp-c: var(--tp-danger); }
.tp-c-secondary { --tp-c: var(--tp-secondary); }
.tp-c-accent { --tp-c: var(--tp-accent); }
body.dark-mode .tp-c-secondary { --tp-c: #94a3b8; }

.tp-notif { position: relative; }
.tp-notif-btn { position: relative; }
.tp-notif.has-unread .tp-notif-btn i { color: var(--tp-text); }
.tp-notif-badge {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--tp-danger); color: #fff; font-size: 10.5px; font-weight: 700;
  line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--tp-surface); pointer-events: none;
}
.tp-notif-badge[hidden] { display: none; }
.tp-notif-panel {
  position: absolute; right: -60px; top: calc(100% + 8px); width: 400px; max-width: calc(100vw - 24px);
  background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius);
  box-shadow: var(--tp-shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .15s, transform .15s, visibility .15s; z-index: 1040; overflow: hidden;
  display: flex; flex-direction: column;
}
.tp-notif.open .tp-notif-panel { opacity: 1; visibility: visible; transform: none; }
.tp-notif-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 8px; }
.tp-notif-head strong { font-size: 15px; color: var(--tp-text); }
.tp-notif-head-actions { display: flex; align-items: center; gap: 4px; }
.tp-notif-textbtn {
  border: 0; background: transparent; color: var(--tp-primary); font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 6px 8px; border-radius: 8px; cursor: pointer;
}
.tp-notif-textbtn:hover { background: var(--tp-primary-soft); }
.tp-notif-iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px;
  color: var(--tp-muted) !important;
}
.tp-notif-iconbtn:hover { background: var(--tp-surface-2); color: var(--tp-text) !important; }
.tp-notif-tabs { display: flex; gap: 4px; padding: 0 14px 8px; border-bottom: 1px solid var(--tp-border); }
.tp-notif-tabs button {
  border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600; color: var(--tp-muted);
  padding: 5px 10px; border-radius: 999px; cursor: pointer;
}
.tp-notif-tabs button.active { background: var(--tp-primary-soft); color: var(--tp-primary); }
.tp-notif-list { max-height: min(460px, 60vh); overflow-y: auto; padding: 4px; }
.tp-notif-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 16px; color: var(--tp-muted); font-size: 13px; text-align: center; }
.tp-notif-empty i { font-size: 22px; opacity: .6; }
.tp-notif-item, .tp-toast {
  position: relative; display: flex; align-items: flex-start; gap: 11px; padding: 10px 34px 10px 10px; border-radius: 10px;
  color: var(--tp-text-2) !important; text-decoration: none !important;
}
.tp-notif-item:hover { background: var(--tp-surface-2); }
.tp-notif-item.is-unread { background: var(--tp-primary-soft); }
.tp-notif-item.is-unread:hover { background: rgba(31, 99, 179, .15); }
body.dark-mode .tp-notif-item.is-unread:hover { background: rgba(91, 156, 240, .2); }
.tp-notif-ic {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--tp-c, var(--tp-primary)); background: color-mix(in srgb, var(--tp-c, var(--tp-primary)) 13%, transparent); font-size: 14px;
}
.tp-notif-body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.tp-notif-title { color: var(--tp-text); font-size: 13.5px; font-weight: 500; line-height: 1.35; }
.is-unread .tp-notif-title { font-weight: 650; }
.tp-notif-msg { font-size: 12.5px; color: var(--tp-text-2); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tp-notif-meta { font-size: 11.5px; color: var(--tp-muted); display: flex; flex-wrap: wrap; gap: 0 6px; }
.tp-notif-meta > span + span::before { content: "\00B7"; margin-right: 6px; }
.tp-notif-dot {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; padding: 0;
}
.tp-notif-dot::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--tp-primary); }
.tp-notif-dot:hover { background: var(--tp-surface); box-shadow: var(--tp-shadow-sm); }
.tp-notif-foot {
  display: block; text-align: center; padding: 11px; border-top: 1px solid var(--tp-border); font-size: 13px; font-weight: 600;
  color: var(--tp-primary) !important;
}
.tp-notif-foot:hover { background: var(--tp-surface-2); }
.tp-notif-foot i { font-size: 11px; margin-left: 4px; }
@media (max-width: 575.98px) {
  .tp-notif { position: static; }
  .tp-notif-panel { position: fixed; left: 12px; right: 12px; top: calc(var(--tp-header-h) + 4px); width: auto; max-width: none; }
}

.tp-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1090; display: flex; flex-direction: column; gap: 8px; width: 360px; max-width: calc(100vw - 32px); pointer-events: none; }
.tp-toast {
  pointer-events: auto; background: var(--tp-surface); border: 1px solid var(--tp-border); box-shadow: var(--tp-shadow-lg);
  padding: 12px 36px 12px 12px; border-radius: var(--tp-radius); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s;
}
.tp-toast.show { opacity: 1; transform: none; }
.tp-toast-close {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent;
  color: var(--tp-muted); font-size: 18px; line-height: 1; cursor: pointer;
}
.tp-toast-close:hover { background: var(--tp-surface-2); color: var(--tp-text); }

/* Notification center page */
.tp-nc-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.tp-nc-summary { color: var(--tp-text-2); font-size: 14px; }
.tp-nc-summary strong { color: var(--tp-text); }
.tp-nc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-nc-filters { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(5, minmax(120px, 1fr)) auto; gap: 10px; align-items: end; }
.tp-nc-filters label { display: block; font-size: 12px; font-weight: 600; color: var(--tp-muted); margin-bottom: 4px; }
.tp-nc-filters .form-control { height: 38px; font-size: 13.5px; }
.tp-nc-filters .tp-nc-filter-btns { display: flex; gap: 6px; }
@media (max-width: 1199.98px) { .tp-nc-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tp-nc-filters .tp-nc-q { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .tp-nc-filters { grid-template-columns: 1fr 1fr; } .tp-nc-filters .tp-nc-filter-btns { grid-column: 1 / -1; } }
.tp-nc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tp-nc-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--tp-border);
  background: var(--tp-surface); color: var(--tp-text-2) !important; font-size: 13px; font-weight: 500;
}
.tp-nc-chip:hover { border-color: var(--tp-border-strong); color: var(--tp-text) !important; }
.tp-nc-chip.active { background: var(--tp-primary); border-color: var(--tp-primary); color: #fff !important; }
body.dark-mode .tp-nc-chip.active { color: #0b111b !important; }
.tp-nc-chip i { font-size: 12px; opacity: .85; }
.tp-nc-day { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--tp-muted); padding: 14px 20px 6px; }
.tp-nc-day:first-child { padding-top: 6px; }
.tp-nc-row { display: flex; align-items: flex-start; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--tp-border); }
.tp-nc-day + .tp-nc-row { border-top: 0; }
.tp-nc-row.is-unread { background: var(--tp-primary-soft); }
.tp-nc-row .tp-notif-ic { width: 38px; height: 38px; font-size: 15px; }
.tp-nc-main { flex: 1; min-width: 0; }
.tp-nc-main .tp-notif-title { font-size: 14px; color: var(--tp-text) !important; }
.tp-nc-row.is-unread .tp-notif-title { font-weight: 650; }
.tp-nc-main .tp-notif-msg { -webkit-line-clamp: 3; font-size: 13px; margin: 2px 0; }
.tp-nc-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--tp-surface-2); border: 1px solid var(--tp-border); color: var(--tp-text-2); }
.tp-nc-side { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.tp-nc-time { font-size: 12px; color: var(--tp-muted); white-space: nowrap; margin-right: 4px; }
.tp-nc-empty { padding: 56px 20px; text-align: center; color: var(--tp-muted); }
.tp-nc-empty i { font-size: 30px; opacity: .5; display: block; margin-bottom: 10px; }
@media (max-width: 767.98px) {
  .tp-nc-row { flex-wrap: wrap; padding: 12px 14px; }
  .tp-nc-side { width: 100%; padding-left: 52px; }
}

/* Notification preferences */
.tp-np-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 400px) { .tp-np-grid { grid-template-columns: 1fr; } }
.tp-np-grid .card { margin: 0; }
.tp-np-cat { display: flex; align-items: center; gap: 12px; width: 100%; }
.tp-np-cat .tp-notif-ic { width: 36px; height: 36px; }
.tp-np-cat-text { flex: 1; min-width: 0; }
.tp-np-cat-text strong { display: block; font-size: 15px; color: var(--tp-text); }
.tp-np-cat-text small { color: var(--tp-muted); font-size: 12px; }
.tp-np-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--tp-border); margin: 0; cursor: pointer; font-weight: 400; }
.tp-np-row:first-child { border-top: 0; padding-top: 0; }
.tp-np-row:last-child { padding-bottom: 0; }
.tp-np-row-text { flex: 1; min-width: 0; }
.tp-np-row-text span { display: block; font-size: 13.5px; font-weight: 600; color: var(--tp-text); }
.tp-np-row-text small { display: block; color: var(--tp-muted); font-size: 12px; }
.tp-np-vol { font-size: 11.5px; color: var(--tp-muted); white-space: nowrap; }
.tp-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; margin: 0; }
.tp-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.tp-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--tp-border-strong); transition: background .15s; }
.tp-switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s;
}
.tp-switch input:checked + span { background: var(--tp-primary); }
.tp-switch input:checked + span::after { transform: translateX(16px); }
.tp-switch input:focus-visible + span { box-shadow: var(--tp-ring); }
.tp-switch input:indeterminate + span { background: color-mix(in srgb, var(--tp-primary) 55%, var(--tp-border-strong)); }
.tp-switch input:indeterminate + span::after { transform: translateX(8px); }
.tp-np-savebar {
  position: sticky; bottom: 0; z-index: 5; margin-top: 18px; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 10px; background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius);
  box-shadow: var(--tp-shadow);
}
.tp-np-savebar small { color: var(--tp-muted); }
