/* ==========================================================================
   Textpie portal theme — matches the "Textpie Portal – New Theme Mockup"
   Dark green sidebar · white top bar · light grey workspace · Textpie green.
   Replaces glass_theme/style.css (still on disk, no longer loaded). Loads
   after bootstrap.min.css, icons.min.css and app.min.css.
   Every rule is scoped to body.tp-theme; remove that class to roll back.

   Colours come from views/layouts/_theme_vars.php, which reads the five
   colour columns of the reseller row for the current domain.
   ========================================================================== */

:root {
  /* These defaults are the Textpie palette. views/layouts/_theme_vars.php
     overrides them with the colours saved in reseller_partner. */

  /* links_color */
  --tp-accent: #13a04f;
  --tp-accent-text: #0f8a43;     /* accent as text on white, 4.5:1 */
  --tp-accent-soft: #e7f6ec;     /* tinted backgrounds */
  /* button_color */
  --tp-btn: #0f8a43;
  --tp-btn-ink: #ffffff;
  --tp-btn-hover: #0d753a;
  --tp-btn-edge: #0f8a43;        /* differs from --tp-btn only when the button would vanish */
  --tp-mpesa-btn: #0f8a43;
  --tp-mpesa-ink: #ffffff;
  /* side_menu_color */
  --tp-side: #0e1f17;
  --tp-side-strong: #ffffff;
  --tp-side-text: #c9d6cf;
  --tp-side-muted: #8fa79a;
  --tp-side-hover: rgba(255, 255, 255, 0.06);
  --tp-side-line: rgba(255, 255, 255, 0.14);
  --tp-side-raised: #16302a;
  --tp-side-accent: #84d4a5;
  --tp-side-active: rgba(19, 160, 79, 0.2);
  /* top_menu_color */
  --tp-top: #ffffff;
  --tp-top-strong: #0f1a14;
  --tp-top-text: #33433a;
  --tp-top-muted: #5b6b62;
  --tp-top-chip: #f3f6f4;
  --tp-top-border: #e2e8e4;
  /* body_color */
  --tp-bg: #f3f6f4;
  --tp-on-bg: #0f1a14;
  --tp-on-bg-muted: #5b6b62;
  --tp-on-bg-line: #e2e8e4;

  /* fixed neutrals used inside white cards */
  --tp-tint: #f3f6f4;
  --tp-surface: #ffffff;
  --tp-surface-2: #f8faf9;
  --tp-border: #e2e8e4;
  --tp-border-strong: #cfdad3;
  --tp-row: #edf1ee;

  --tp-text: #0f1a14;
  --tp-text-2: #33433a;
  --tp-muted: #5b6b62;

  --tp-success-bg: #e3f5ea; --tp-success: #0b6a33;
  --tp-warning-bg: #fff1dc; --tp-warning: #8a4b00;
  --tp-danger-bg: #fde6e4;  --tp-danger: #a3261b;
  --tp-info-bg: #e3effd;    --tp-info: #1d4f91;

  --tp-radius: 14px;
  --tp-radius-sm: 10px;

  --tp-font: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tp-font-display: "Manrope", "Inter", sans-serif;
}

/* ---------- Base ---------------------------------------------------------- */
body.tp-theme {
  font-family: var(--tp-font);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--tp-text);
  background: var(--tp-bg);
  -webkit-font-smoothing: antialiased;
}
.tp-theme h1, .tp-theme h2, .tp-theme h3, .tp-theme h4, .tp-theme h5, .tp-theme h6,
.tp-theme .h1, .tp-theme .h2, .tp-theme .h3, .tp-theme .h4, .tp-theme .h5, .tp-theme .h6 {
  font-family: var(--tp-font-display);
  color: var(--tp-text);
  font-weight: 700;
}
.tp-theme a { color: var(--tp-accent-text); }
.tp-theme a:hover { color: #075c2c; text-decoration: none; }
.tp-theme hr { border-top-color: var(--tp-border); }
.tp-theme b, .tp-theme strong { font-weight: 600; }
.tp-theme .small, .tp-theme small { color: var(--tp-muted); }
.tp-theme :focus-visible { outline: 2px solid var(--tp-accent); outline-offset: 2px; }

/* ---------- Bootstrap 3 compatibility (moved from the old inline <style>) --
   yii2-bootstrap renders BS3 markup (alerts with "fade in", .pull-right)
   on a Bootstrap 4 template; these keep it working. */
.tp-theme .fade:not(.show) { opacity: 1; }
.tp-theme .pull-right { float: right; }
.tp-theme .pull-left { float: left; }
.tp-theme .grid-view { overflow-x: auto; }


/* ---------- Shell: sidebar + main column (markup from layouts/main.php) --- */
.tp-theme .dashboard { display: flex; min-height: 100vh; }
.tp-theme .sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 264px;
  background: var(--tp-side);
  border-right: 1px solid var(--tp-side-line);
  padding: 0 0 24px;
  overflow-y: auto;
  z-index: 1001;
  transition: transform .25s ease;
}
.tp-theme .sidebar::-webkit-scrollbar { width: 6px; }
.tp-theme .sidebar::-webkit-scrollbar-thumb { background: var(--tp-side-line); border-radius: 6px; }
.tp-theme .sidebar-header {
  height: 72px;
  display: flex; align-items: center;
  padding: 0 20px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--tp-side-line);
  position: sticky; top: 0; z-index: 2;
  background: var(--tp-side);
}
/* Logos are designed for white backgrounds, so sit them on a white tile. */
.tp-theme .tp-logo img {
  background: #fff; border-radius: 10px; padding: 6px 10px;
  height: 42px; max-width: 200px; object-fit: contain;
}
.tp-theme #sidebar-menu { padding: 0; }
.tp-theme #sidebar-menu ul { list-style: none; padding: 0; margin: 0; }
.tp-theme .main-content {
  flex: 1;
  min-width: 0;
  margin-left: 264px;
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--tp-bg);
}
.tp-theme .tp-content { flex: 1; padding: 28px 32px 40px; }
.tp-theme .site-footer {
  border-top: 1px solid var(--tp-on-bg-line);
  color: var(--tp-on-bg-muted);
  font-size: 12.5px;
  padding: 18px 32px;
  text-align: left;
  margin: 0;
}
.tp-theme .site-footer a { color: var(--tp-accent-text); }
.tp-theme .mobile-menu-toggle {
  display: none;
  position: fixed; right: 20px; bottom: 20px; z-index: 1002;
  width: 52px; height: 52px; border: 0; border-radius: 14px;
  background: var(--tp-side); color: var(--tp-side-strong);
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .45);
  align-items: center; justify-content: center;
}
.tp-theme .mobile-menu-toggle svg { width: 22px; height: 22px; }

/* ---------- Top bar ------------------------------------------------------- */
.tp-theme .tp-topbar {
  position: sticky; top: 0; z-index: 1000;
  min-height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 32px;
  background: var(--tp-top);
  border-bottom: 1px solid var(--tp-top-border);
}
.tp-theme .tp-topbar__title { min-width: 0; }
.tp-theme .tp-topbar .page-title {
  font-family: var(--tp-font-display);
  font-size: 1.25rem; font-weight: 800; line-height: 1.2;
  color: var(--tp-top-strong);
  margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tp-theme .tp-topbar__date { font-size: 12.5px; color: var(--tp-top-muted); }
.tp-theme .tp-topbar__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.tp-theme .tp-user-box { display: flex; align-items: center; gap: 10px; padding-left: 6px; }
.tp-theme .tp-icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--tp-top-muted); background: transparent;
}
.tp-theme .tp-icon-btn:hover { background: rgba(214, 69, 69, .1); color: #c53030; }

.tp-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--tp-top-chip);
  color: var(--tp-top-text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.tp-chip i { color: var(--tp-top-muted); }
.tp-chip b { color: var(--tp-top-strong); font-weight: 600; }
.tp-chip--accent { background: var(--tp-accent-soft); color: var(--tp-accent-text); font-weight: 600; }
.tp-chip--accent b { color: var(--tp-accent-text); font-variant-numeric: tabular-nums; }
.tp-chip--danger { background: var(--tp-danger-bg); color: var(--tp-danger); font-weight: 600; }
.tp-chip--danger b { color: var(--tp-danger); }
.tp-chip--danger .tp-dot { background: var(--tp-danger); }
.tp-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tp-accent); display: inline-block; flex: none; }

.tp-meter { width: 56px; height: 6px; border-radius: 99px; background: var(--tp-border); overflow: hidden; display: inline-block; }
.tp-meter > span { display: block; height: 100%; border-radius: 99px; background: var(--tp-accent); }
.tp-meter--warn > span { background: #d9822b; }
.tp-meter--danger > span { background: #d64545; }

.tp-topup.btn { height: 40px; display: inline-flex; align-items: center; vertical-align: middle; }

.tp-theme .nav-user { display: flex !important; align-items: center; gap: 10px; height: 70px; }
.tp-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  color: var(--tp-side-accent);
  background: var(--tp-side);
  box-shadow: 0 0 0 2px var(--tp-top-border);
  flex: none;
}
.tp-user { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; }
.tp-user b { color: var(--tp-top-strong); font-weight: 600; }
.tp-user span { color: var(--tp-top-muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the template hides every top-bar link on phones; keep balance + avatar */

/* Dropdowns */
.tp-theme .dropdown-menu {
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  box-shadow: 0 16px 40px -12px rgba(15, 26, 20, .25);
  padding: 6px;
}
.tp-theme .dropdown-item, .tp-theme .dropdown-menu > li > a { color: var(--tp-text-2); border-radius: 8px; padding: 9px 12px; }
.tp-theme .dropdown-item:hover, .tp-theme .dropdown-item:focus, .tp-theme .dropdown-menu > li > a:hover { background: var(--tp-tint); color: var(--tp-text); }
.tp-theme .dropdown-header, .tp-theme .noti-title { color: var(--tp-muted); background: transparent; }
.tp-theme .dropdown-divider { border-top-color: var(--tp-border); }

/* ---------- Sidebar menu ------------------------------------------------- */
.tp-theme #sidebar-menu .menu-title {
  color: var(--tp-side-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  padding: 16px 24px 6px;
}
.tp-theme #sidebar-menu > ul > li > a {
  color: var(--tp-side-text);
  margin: 1px 14px;
  padding: 10px 12px;
  border-radius: var(--tp-radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  transition: background .15s, color .15s;
}
.tp-theme #sidebar-menu > ul > li > a > span:not(.menu-arrow) { flex: 1; }
.tp-theme #sidebar-menu > ul > li > a i {
  width: 20px;
  font-size: 15px;
  color: inherit;
  opacity: .9;
  margin-right: 12px;
  text-align: center;
}
.tp-theme #sidebar-menu > ul > li > a:hover,
.tp-theme #sidebar-menu > ul > li > a:focus { color: var(--tp-side-strong); background: var(--tp-side-hover); }
.tp-theme #sidebar-menu > ul > li > a.active,
.tp-theme #sidebar-menu > ul > li.mm-active > a { color: var(--tp-side-strong); background: var(--tp-side-active); }
.tp-theme #sidebar-menu > ul > li > a.active i,
.tp-theme #sidebar-menu > ul > li.mm-active > a i { color: var(--tp-side-accent); opacity: 1; }
.tp-theme #sidebar-menu .menu-arrow { color: var(--tp-side-muted); position: static; margin-left: auto; }
.tp-theme .nav-second-level { padding: 2px 0 6px; margin: 0 14px; }
.tp-theme .nav-second-level li a {
  color: var(--tp-side-muted);
  padding: 7px 12px 7px 20px;
  font-size: 13px;
  border-radius: 8px;
}
.tp-theme .nav-second-level li a:hover { color: var(--tp-side-strong); background: var(--tp-side-hover); }
.tp-theme .nav-second-level li.mm-active > a,
.tp-theme .nav-second-level li > a.active { color: var(--tp-side-strong); background: var(--tp-side-hover); font-weight: 600; position: relative; }
.tp-theme .nav-second-level li > a.active::before { content: ""; position: absolute; left: 8px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--tp-side-accent); }
.tp-theme .nav-second-level hr { margin: 6px 12px; border-top-color: var(--tp-side-line); }
.tp-theme #sidebar-menu > ul > li > a { white-space: nowrap; }
.tp-theme #sidebar-menu > ul > li > a > span:not(.menu-arrow) { overflow: hidden; text-overflow: ellipsis; }
.tp-theme #sidebar-menu .nav-second-level { list-style: none; }

/* page headings inside content (glass template "page-header") */
.tp-theme .page-header { margin: 0 0 20px; }
.tp-theme .page-header .page-title { color: var(--tp-on-bg); font-size: 1.5rem; font-weight: 800; margin: 0 0 4px; }
.tp-theme .breadcrumb { background: transparent; padding: 0; margin: 0 0 16px; }
.tp-theme .breadcrumb-item, .tp-theme .breadcrumb-item + .breadcrumb-item::before, .tp-theme .breadcrumb-item > a { color: var(--tp-on-bg-muted); }

/* ---------- Cards / panels ----------------------------------------------- */
.tp-theme .card, .tp-theme .panel, .tp-theme .card-box, .tp-theme .portlet {
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  box-shadow: none;
  color: var(--tp-text);
  margin-bottom: 20px;
}
.tp-theme .shadow, .tp-theme .shadow-lg, .tp-theme .shadow-sm { box-shadow: none !important; }
.tp-theme .card-header, .tp-theme .panel-heading {
  background: transparent;
  border-bottom: 1px solid var(--tp-border);
  padding: 18px 22px;
  border-radius: var(--tp-radius) var(--tp-radius) 0 0 !important;
}
.tp-theme .card-header h1, .tp-theme .card-header h2, .tp-theme .card-header h3,
.tp-theme .card-header h4, .tp-theme .card-header h5, .tp-theme .card-header h6,
.tp-theme .header-title {
  font-family: var(--tp-font-display);
  font-size: 1rem !important;
  font-weight: 700 !important;
  color: var(--tp-text) !important;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}
.tp-theme .card-header .text-gray-400, .tp-theme .card-header i.fa-fw { color: var(--tp-accent) !important; }
.tp-theme .card-body, .tp-theme .panel-body { padding: 22px; }
.tp-theme .card-footer, .tp-theme .panel-footer { background: transparent; border-top: 1px solid var(--tp-border); }
.tp-theme .card-widgets > a { color: var(--tp-muted); }
.tp-theme .card-widgets > a:hover { color: var(--tp-accent-text); }
.tp-theme .widget-style-2 i { background: var(--tp-accent-soft) !important; color: var(--tp-accent) !important; }

/* ---------- Utility colours ---------------------------------------------- */
.tp-theme .text-primary { color: var(--tp-accent-text) !important; }
.tp-theme .text-success { color: var(--tp-success) !important; }
.tp-theme .text-danger, .tp-theme .text-red { color: #c53030 !important; }
.tp-theme .text-muted, .tp-theme .text-gray-400, .tp-theme .text-gray-500, .tp-theme .text-gray-600 { color: var(--tp-muted) !important; }
.tp-theme .text-dark, .tp-theme .text-gray-800, .tp-theme .text-gray-900 { color: var(--tp-text) !important; }
.tp-theme .bg-light { background-color: var(--tp-tint) !important; }
.tp-theme .peach-gradient { background: var(--tp-btn) !important; color: var(--tp-btn-ink) !important; border: 0 !important; }

/* ---------- Buttons ------------------------------------------------------- */
.tp-theme .btn {
  font-family: var(--tp-font);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--tp-radius-sm);
  border: 1px solid transparent;
  line-height: 1.35;
  box-shadow: none;
  transition: background .15s, border-color .15s, color .15s;
}
.tp-theme .btn-sm, .tp-theme .btn-xs, .tp-theme .btn-group-sm > .btn { font-size: 12.5px; padding: 6px 12px; border-radius: 8px; }
.tp-theme .btn-lg { font-size: 15px; padding: 12px 22px; }
.tp-theme .btn-primary, .tp-theme .btn-success {
  color: var(--tp-btn-ink) !important;
  background: var(--tp-btn);
  border-color: var(--tp-btn-edge);
}
.tp-theme .btn-primary:hover, .tp-theme .btn-success:hover,
.tp-theme .btn-primary:focus, .tp-theme .btn-success:focus {
  color: var(--tp-btn-ink) !important;
  background: var(--tp-btn-hover);
  border-color: var(--tp-btn-edge);
  box-shadow: none;
}
.tp-theme .btn-info { color: #fff !important; background: #1d6fb8; border-color: #1d6fb8; }
.tp-theme .btn-info:hover { background: #185f9e; border-color: #185f9e; }
.tp-theme .btn-warning { color: #3d2400 !important; background: #f6b445; border-color: #f6b445; }
.tp-theme .btn-warning:hover { background: #eda52e; border-color: #eda52e; }
.tp-theme .btn-danger { color: #fff !important; background: #c53030; border-color: #c53030; }
.tp-theme .btn-danger:hover { background: #a82828; border-color: #a82828; }
.tp-theme .btn-secondary, .tp-theme .btn-default, .tp-theme .btn-light {
  color: var(--tp-text) !important;
  background: var(--tp-surface);
  border-color: var(--tp-border-strong);
}
.tp-theme .btn-secondary:hover, .tp-theme .btn-default:hover, .tp-theme .btn-light:hover { background: var(--tp-tint); border-color: #b8c7be; }
.tp-theme .btn-dark { color: var(--tp-side-strong) !important; background: var(--tp-side); border-color: var(--tp-side); }
.tp-theme [class*="btn-outline-"] { background: var(--tp-surface); color: var(--tp-text) !important; border-color: var(--tp-border-strong); }
.tp-theme [class*="btn-outline-"]:hover { background: var(--tp-tint); }
.tp-theme .btn:disabled, .tp-theme .btn.disabled { opacity: .5; }

/* The template paints some table CELLS with btn-* classes (delivery status):
   show those as soft status badges instead of solid blocks. */
.tp-theme td[class^="btn-"], .tp-theme td[class*=" btn-"] {
  background: transparent !important;
  border-color: var(--tp-row) !important;
  white-space: nowrap;
}
.tp-theme td[class^="btn-"] > *, .tp-theme td[class*=" btn-"] > * {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.tp-theme td.btn-success > * { background: var(--tp-success-bg); color: var(--tp-success); }
.tp-theme td.btn-info > *, .tp-theme td.btn-primary > * { background: var(--tp-info-bg); color: var(--tp-info); }
.tp-theme td.btn-warning > * { background: var(--tp-warning-bg); color: var(--tp-warning); }
.tp-theme td.btn-danger > * { background: var(--tp-danger-bg); color: var(--tp-danger); }
/* Cells whose status is plain text (no inner tag): colour the text itself.
   Without this the button rule above paints it white on a white cell. */
.tp-theme td[class^="btn-"], .tp-theme td[class*=" btn-"] { font-weight: 600; }
.tp-theme td.btn-success { color: var(--tp-success) !important; }
.tp-theme td.btn-info, .tp-theme td.btn-primary { color: var(--tp-info) !important; }
.tp-theme td.btn-warning { color: var(--tp-warning) !important; }
.tp-theme td.btn-danger { color: var(--tp-danger) !important; }
.tp-theme td.btn-secondary, .tp-theme td.btn-default, .tp-theme td.btn-dark, .tp-theme td.btn-light { color: var(--tp-text-2) !important; }

/* ---------- Forms --------------------------------------------------------- */
.tp-theme label, .tp-theme .control-label { color: var(--tp-text); font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.tp-theme .form-control,
.tp-theme select, .tp-theme textarea,
.tp-theme input[type="text"], .tp-theme input[type="email"], .tp-theme input[type="number"],
.tp-theme input[type="password"], .tp-theme input[type="search"], .tp-theme input[type="tel"],
.tp-theme input[type="date"], .tp-theme input[type="url"] {
  background-color: var(--tp-surface);
  border: 1px solid var(--tp-border-strong);
  color: var(--tp-text);
  border-radius: var(--tp-radius-sm);
  font-size: 14px;
  min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
.tp-theme textarea.form-control { min-height: 110px; line-height: 1.5; padding: 12px; }
.tp-theme .form-control-user { border-radius: var(--tp-radius-sm) !important; height: 48px; padding: 0 14px; font-size: 15px; }
.tp-theme .form-control:focus, .tp-theme select:focus, .tp-theme textarea:focus, .tp-theme input:focus {
  border-color: var(--tp-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tp-accent) 18%, transparent);
  outline: none;
}
.tp-theme .form-control::placeholder, .tp-theme input::placeholder, .tp-theme textarea::placeholder { color: #8a9a91; opacity: 1; }
.tp-theme .form-control:disabled, .tp-theme .form-control[readonly] { background-color: var(--tp-surface-2); color: var(--tp-muted); }
.tp-theme .input-group-text, .tp-theme .input-group-addon { background: var(--tp-surface-2); border: 1px solid var(--tp-border-strong); color: var(--tp-muted); }
.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 > .btn,
.tp-theme .input-group > .input-group-append > .input-group-text { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tp-theme .help-block, .tp-theme .form-text { color: var(--tp-muted); font-size: 12px; }
.tp-theme .help-block-error, .tp-theme .invalid-feedback, .tp-theme .has-error .help-block { color: #c53030 !important; }
.tp-theme .has-error .form-control, .tp-theme .is-invalid { border-color: #c53030 !important; }
.tp-theme .custom-control-input:checked ~ .custom-control-label::before { background: var(--tp-accent); border-color: var(--tp-accent); }
.tp-theme input[type="checkbox"], .tp-theme input[type="radio"] { accent-color: var(--tp-accent); }
.tp-theme input[type="file"]::file-selector-button {
  margin-right: 12px; border: 1px solid var(--tp-border-strong); background: var(--tp-surface-2);
  color: var(--tp-text); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 600;
}

/* Select2 (kartik + default skins) */
.tp-theme .select2-container--krajee .select2-selection,
.tp-theme .select2-container--bootstrap .select2-selection,
.tp-theme .select2-container--default .select2-selection--single,
.tp-theme .select2-container--default .select2-selection--multiple {
  border: 1px solid var(--tp-border-strong) !important;
  border-radius: var(--tp-radius-sm) !important;
  min-height: 44px;
  box-shadow: none !important;
}
.tp-theme .select2-container .select2-selection__rendered { color: var(--tp-text) !important; line-height: 42px !important; }
.tp-theme .select2-container .select2-selection__arrow { height: 42px !important; }
.tp-theme .select2-container--focus .select2-selection,
.tp-theme .select2-container--open .select2-selection { border-color: var(--tp-accent) !important; }
.tp-theme .select2-selection__choice { background: var(--tp-accent-soft) !important; border: 0 !important; color: var(--tp-accent-text) !important; border-radius: 999px !important; }
.tp-theme .select2-dropdown { border: 1px solid var(--tp-border) !important; border-radius: var(--tp-radius-sm) !important; box-shadow: 0 16px 40px -12px rgba(15, 26, 20, .25); overflow: hidden; }
.tp-theme .select2-results__option--highlighted,
.tp-theme .select2-container--krajee .select2-results__option--highlighted[aria-selected] { background: var(--tp-accent-soft) !important; color: var(--tp-accent-text) !important; }

/* Date range picker / datepicker */
.tp-theme .daterangepicker, .tp-theme .datepicker.dropdown-menu { border: 1px solid var(--tp-border) !important; border-radius: 12px !important; box-shadow: 0 16px 40px -12px rgba(15, 26, 20, .25); }
.tp-theme .daterangepicker td.in-range { background: var(--tp-accent-soft) !important; }
.tp-theme .daterangepicker td.active, .tp-theme .daterangepicker td.active:hover,
.tp-theme .datepicker table tr td.active, .tp-theme .datepicker table tr td.active:hover,
.tp-theme .daterangepicker .ranges li.active { background: var(--tp-btn) !important; color: var(--tp-btn-ink) !important; }

/* ---------- Tables / GridView -------------------------------------------- */
.tp-theme .table { color: var(--tp-text-2); margin-bottom: 0; font-size: 13px !important; }
.tp-theme .table thead th, .tp-theme .table > thead > tr > th {
  background: var(--tp-surface-2);
  color: var(--tp-muted);
  font-size: 13px;
  font-weight: 600;
  border-top: 0;
  border-bottom: 1px solid var(--tp-border);
  padding: 12px 14px;
  white-space: nowrap;
  vertical-align: middle;
}
.tp-theme .table thead th a { color: var(--tp-muted); }
.tp-theme .table thead th a:hover, .tp-theme .table thead th a.asc, .tp-theme .table thead th a.desc { color: var(--tp-accent-text); }
.tp-theme .table td, .tp-theme .table th { border-top: 1px solid var(--tp-row); padding: 13px 14px; vertical-align: middle; }
.tp-theme .table-bordered, .tp-theme .table-bordered td, .tp-theme .table-bordered th { border-color: var(--tp-row) !important; }
.tp-theme .table-striped tbody tr:nth-of-type(odd) { background: transparent; }
.tp-theme .table-hover tbody tr:hover { background: var(--tp-surface-2); color: var(--tp-text); }
.tp-theme .table td b, .tp-theme .table td strong { color: var(--tp-text); }
.tp-theme .grid-view .summary { color: var(--tp-muted); font-size: 13px; margin-bottom: 12px; }
.tp-theme .grid-view .filters td { padding: 8px 10px; background: var(--tp-surface-2); }
.tp-theme .grid-view .filters .form-control { min-height: 36px; height: 36px; font-size: 13px; }
.tp-theme .grid-view .empty { color: var(--tp-muted); padding: 28px 0; display: block; text-align: center; }
.tp-theme table.detail-view th { color: var(--tp-muted); font-weight: 500; width: 42%; background: transparent; }
.tp-theme table.detail-view td { color: var(--tp-text); font-weight: 600; }

/* Pagination */
.tp-theme .pagination { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 0 0; list-style: none; margin: 0; }
.tp-theme .pagination > li > a, .tp-theme .pagination > li > span, .tp-theme .page-link {
  float: none; min-width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; margin: 0;
  border-radius: 8px !important;
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  color: var(--tp-text-2);
  font-weight: 500; line-height: 1;
}
.tp-theme .pagination > li > a:hover, .tp-theme .page-link:hover { background: var(--tp-tint); color: var(--tp-text); }
.tp-theme .pagination > .active > a, .tp-theme .pagination > .active > span,
.tp-theme .pagination > .active > a:hover, .tp-theme .pagination > .active > a:focus,
.tp-theme .page-item.active .page-link { background: var(--tp-side); border-color: var(--tp-side); color: var(--tp-side-strong); }
.tp-theme .pagination > .disabled > span, .tp-theme .pagination > .disabled > a { opacity: .45; }

/* ---------- Alerts, badges, labels --------------------------------------- */
.tp-theme .alert { border-radius: var(--tp-radius-sm); border: 1px solid transparent; padding: 14px 18px; font-weight: 500; }
.tp-theme .alert-success { background: var(--tp-success-bg); border-color: #bfe6cd; color: var(--tp-success); }
.tp-theme .alert-info { background: var(--tp-info-bg); border-color: #c5dbf7; color: var(--tp-info); }
.tp-theme .alert-warning { background: var(--tp-warning-bg); border-color: #f6d9ad; color: var(--tp-warning); }
.tp-theme .alert-danger { background: var(--tp-danger-bg); border-color: #f5c3be; color: var(--tp-danger); }
.tp-theme .badge, .tp-theme .label { border-radius: 999px; padding: 4px 10px; font-weight: 600; font-size: 12px; }
.tp-theme .badge-success, .tp-theme .label-success { background: var(--tp-success-bg); color: var(--tp-success); }
.tp-theme .badge-info, .tp-theme .label-info, .tp-theme .badge-primary, .tp-theme .label-primary { background: var(--tp-info-bg); color: var(--tp-info); }
.tp-theme .badge-warning, .tp-theme .label-warning { background: var(--tp-warning-bg); color: var(--tp-warning); }
.tp-theme .badge-danger, .tp-theme .label-danger { background: var(--tp-danger-bg); color: var(--tp-danger); }
.tp-theme .badge-secondary, .tp-theme .label-default, .tp-theme .badge-light { background: var(--tp-tint); color: var(--tp-text-2); }

/* ---------- Modals, tabs, lists, progress -------------------------------- */
.tp-theme .modal-content { border: 0; border-radius: var(--tp-radius); box-shadow: 0 30px 60px -20px rgba(15, 26, 20, .35); }
.tp-theme .modal-header, .tp-theme .modal-footer { border-color: var(--tp-border); }
.tp-theme .nav-tabs { border-bottom: 1px solid var(--tp-border); }
.tp-theme .nav-tabs .nav-link { color: var(--tp-muted); border: 0; border-bottom: 2px solid transparent; }
.tp-theme .nav-tabs .nav-link.active, .tp-theme .nav-tabs .nav-item.show .nav-link { color: var(--tp-text); background: transparent; border-bottom-color: var(--tp-accent); }
.tp-theme .nav-pills .nav-link { color: var(--tp-text-2); border-radius: 9px; }
.tp-theme .nav-pills .nav-link.active { background: var(--tp-surface); color: var(--tp-text); box-shadow: 0 1px 2px rgba(15, 26, 20, .08); }
.tp-theme .list-group-item { border-color: var(--tp-border); }
.tp-theme .progress { background: #e7ede9; border-radius: 99px; height: 8px; }
.tp-theme .progress-bar { background: var(--tp-accent); }


/* ==========================================================================
   Glass template components used by the views → plain Textpie cards
   ========================================================================== */
.tp-theme .glass-card {
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: none;
  color: var(--tp-text);
  position: relative;
}
.tp-theme .glass-card-3d { transform: none !important; }   /* no tilt effect */
.tp-theme .glass-card > .card-header { margin: -22px -22px 18px; }
.tp-theme .glass-card > .card-body { padding: 0; }
.tp-theme .glass-card .card-header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.tp-theme .glass-card .card-header > .row { flex: 1; }
.tp-theme .card-title { font-family: var(--tp-font-display); font-size: 1rem; font-weight: 700; color: var(--tp-text); margin: 0; }
.tp-theme .card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-theme .chart-card { min-height: 0; }
.tp-theme .table-wrapper { overflow-x: auto; margin: 0; padding: 0; }
.tp-theme .table-wrapper::-webkit-scrollbar { height: 8px; }
.tp-theme .table-wrapper::-webkit-scrollbar-thumb { background: var(--tp-border-strong); border-radius: 4px; }
/* GridView tables were set to 10px inline; keep them readable */
.tp-theme .table[style*="font-size"] { font-size: 13px !important; }
.tp-theme .data-table { width: 100%; border-collapse: collapse; }
.tp-theme .data-table th { background: var(--tp-surface-2); color: var(--tp-muted); font-size: 12px; font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--tp-border); text-align: left; }
.tp-theme .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--tp-row); color: var(--tp-text-2); font-size: 13px; }

/* Dashboard shortcut tiles (site/index) */
.tp-theme .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tp-theme .stats-grid .glass-card { margin: 0; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tp-theme .stats-grid .glass-card:hover { border-color: var(--tp-accent); box-shadow: 0 12px 30px -18px rgba(15, 26, 20, .45); }
.tp-theme .stat-card-inner { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tp-theme .stat-info h3 { font-family: var(--tp-font); font-size: 13px; font-weight: 500; color: var(--tp-muted); text-transform: none; letter-spacing: 0; margin: 0 0 6px; }
.tp-theme .stat-info .h2 { font-family: var(--tp-font-display); font-size: 1.25rem; font-weight: 800; color: var(--tp-text); margin: 0; }
.tp-theme .stat-card .icon {
  width: 44px; height: 44px; border-radius: 12px !important;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tp-accent-soft); color: var(--tp-accent-text); font-size: 18px;
}
.tp-theme .stat-card > p.text-sm { display: none; }   /* decorative icon row */
.tp-theme .stat-value { font-family: var(--tp-font-display); font-size: 1.9rem; font-weight: 800; color: var(--tp-text); -webkit-text-fill-color: currentColor; background: none; }

/* Template inputs (.form-input / .form-label) look like the other fields */
.tp-theme .form-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--tp-surface);
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-sm);
  color: var(--tp-text);
  font: inherit; font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.tp-theme .form-label { display: block; color: var(--tp-text); font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.tp-theme .form-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 20px; }
.tp-theme .checkbox-label { display: inline-flex; align-items: center; gap: 10px; margin: 0; color: var(--tp-text-2); font-weight: 400; font-size: 14px; cursor: pointer; }
.tp-theme .checkbox-label input { width: 18px; height: 18px; }
.tp-theme .forgot-link { font-size: 14px; font-weight: 500; color: var(--tp-accent-text); }
.tp-theme .divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--tp-muted); font-size: 13px; }
.tp-theme .divider::before, .tp-theme .divider::after { content: ''; flex: 1; height: 1px; background: var(--tp-border); }

/* Recent messages: filter chips + status pills */
.tp-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.tp-filter {
  padding: 6px 12px; border-radius: 99px; border: 0;
  background: var(--tp-tint); color: var(--tp-text-2);
  font: inherit; font-size: 13px; cursor: pointer; min-height: 32px;
}
.tp-filter:hover { background: #e7ede9; }
.tp-filter.is-active { background: var(--tp-side); color: var(--tp-side-strong); font-weight: 600; }
.tp-pill { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--tp-tint); color: var(--tp-text-2); }
.tp-pill--success { background: var(--tp-success-bg); color: var(--tp-success); }
.tp-pill--info, .tp-pill--primary { background: var(--tp-info-bg); color: var(--tp-info); }
.tp-pill--warning { background: var(--tp-warning-bg); color: var(--tp-warning); }
.tp-pill--danger { background: var(--tp-danger-bg); color: var(--tp-danger); }
.tp-msg { min-width: 200px; max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; color: var(--tp-text-2); }
.tp-mono { font-variant-numeric: tabular-nums; }


/* ==========================================================================
   Authentication pages (layouts/guest.php)
   ========================================================================== */
body.tp-theme.tp-guest { background: var(--tp-surface); min-height: 100vh; }
.tp-auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.tp-auth__visual {
  flex: 1 1 480px;
  background: var(--tp-side);
  color: var(--tp-side-strong);
  padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.tp-auth__logo img { background: #fff; border-radius: 12px; padding: 8px 14px; max-height: 60px; max-width: 240px; object-fit: contain; }
.tp-auth__headline { max-width: 480px; display: flex; flex-direction: column; gap: 20px; }
.tp-auth__headline h1 { color: var(--tp-side-strong); font-size: clamp(2rem, 3vw, 2.75rem); line-height: 1.1; font-weight: 800; margin: 0; }
.tp-auth__headline p { color: var(--tp-side-muted); font-size: 16px; line-height: 1.6; margin: 0; }
.tp-checks { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 12px; }
.tp-checks li { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--tp-side-text); }
.tp-checks li span {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--tp-side-active); color: var(--tp-side-accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
}
.tp-auth__foot { color: var(--tp-side-muted); font-size: 13px; }
.tp-auth__form { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; padding: 56px 24px; background: var(--tp-surface); }
.tp-auth__card { width: 100%; max-width: 400px; }
.tp-auth__card h2 { font-size: 1.75rem; font-weight: 800; margin: 0 0 6px; }
.tp-auth__card .tp-sub { color: var(--tp-muted); margin: 0 0 24px; font-size: 14px; }
.tp-auth__card .form-group { margin-bottom: 18px; }
.tp-auth__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 20px; font-size: 14px; }
.tp-auth__row label { margin: 0; display: inline-flex; align-items: center; gap: 10px; color: var(--tp-text-2); font-weight: 400; font-size: 14px; }
.tp-auth__row label input { width: 18px; height: 18px; }
.tp-auth__row a { font-weight: 500; }
.tp-auth__card .btn-block { height: 50px; font-size: 15px; font-weight: 700; }
.tp-auth__alt { text-align: center; color: var(--tp-muted); margin: 22px 0 0; font-size: 14px; }
.tp-auth__alt a { font-weight: 600; }
@media (max-width: 767.98px) {
  .tp-auth__visual { padding: 32px 24px; flex-basis: 100%; gap: 24px; }
  .tp-auth__visual .tp-checks, .tp-auth__visual .tp-auth__foot { display: none; }
}

.tp-theme .tp-auth__form { flex-direction: column; }
.tp-theme .login-container { width: 100%; max-width: 420px; }
.tp-theme .login-card { background: transparent; border: 0; padding: 0; box-shadow: none; }
.tp-theme .login-header { text-align: left; margin-bottom: 22px; }
.tp-theme .login-header .navbar-brand-img { display: none; }   /* logo is in the left panel */
.tp-theme .login-title { font-family: var(--tp-font-display); font-size: 1.75rem; font-weight: 800; color: var(--tp-text); margin: 0 0 6px; }
.tp-theme .login-subtitle { color: var(--tp-muted); font-size: 14px; margin: 0; }
.tp-theme .login-card .form-group { margin-bottom: 18px; }
.tp-theme .login-card .btn-primary {
  width: 100%; height: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 700;
}
.tp-theme .login-footer { text-align: center; color: var(--tp-muted); font-size: 14px; margin: 0; }
.tp-theme .login-footer a { font-weight: 600; color: var(--tp-accent-text); }
.tp-theme .tp-auth__form .site-footer { border: 0; text-align: center; padding: 28px 0 0; background: transparent; }
.tp-theme .theme-toggle-float { display: none !important; }   /* light theme only */

/* ---------- Small screens ------------------------------------------------- */
@media (max-width: 1199.98px) {
  .tp-theme .tp-hide-md { display: none !important; }
}
@media (max-width: 991.98px) {
  .tp-theme .sidebar { transform: translateX(-100%); }
  .tp-theme .sidebar.open { transform: translateX(0); box-shadow: 30px 0 60px rgba(0, 0, 0, .3); }
  .tp-theme .main-content { margin-left: 0; }
  .tp-theme .mobile-menu-toggle { display: flex; }
  .tp-theme .tp-topbar { padding: 10px 16px; }
  .tp-theme .tp-content { padding: 20px 16px 90px; }
  .tp-theme .site-footer { padding: 16px; }
}
@media (max-width: 767.98px) {
  .tp-theme .tp-hide-sm { display: none !important; }
  .tp-theme .tp-topbar__date { display: none; }
  .tp-theme .tp-topbar__title { flex: 1; }
  .tp-theme .tp-topbar__right { flex-wrap: nowrap; gap: 6px; }
  .tp-theme .tp-user-box { padding-left: 0; gap: 4px; }
  .tp-theme .tp-avatar { display: none; }
  .tp-theme .tp-chip { padding: 0 10px; font-size: 12px; }
  .tp-auth__visual { padding: 28px 24px; flex-basis: 100%; gap: 20px; }
  .tp-auth__visual .tp-checks, .tp-auth__visual .tp-auth__foot, .tp-auth__headline p { display: none; }
  .tp-auth__headline h1 { font-size: 1.5rem; }
  .tp-theme .tp-auth__form { padding: 32px 20px; }
}

/* Sub-menu items line up with the parent label */
.tp-theme #sidebar-menu .nav-second-level li a { padding: 7px 12px 7px 44px; display: block; }
.tp-theme #sidebar-menu .nav-second-level hr { margin: 6px 12px 6px 44px; }

/* Small uppercase labels in card headers (e.g. "Wallet Details") */
.tp-theme .card-header h6.text-uppercase { font-family: var(--tp-font) !important; font-size: 12px !important; font-weight: 600 !important; color: var(--tp-muted) !important; letter-spacing: .06em; margin-bottom: 10px; }
.tp-theme .card-header table td { padding: 3px 12px 3px 0; color: var(--tp-text-2); }

/* ==========================================================================
   Dashboard (views/site/index.php) — same components as the earlier Textpie portal
   ========================================================================== */
.tp-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 24px; }
.tp-hero h1 { color: var(--tp-on-bg); font-size: 1.75rem; font-weight: 800; margin: 0; line-height: 1.2; }
.tp-hero p { color: var(--tp-on-bg-muted); margin: 6px 0 0; font-size: 14px; }
.tp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tp-actions .btn { height: 44px; display: inline-flex; align-items: center; gap: 8px; }

.tp-grid { display: grid; gap: 16px; margin-bottom: 20px; }
.tp-grid--kpi { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tp-grid--main { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: stretch; }
.tp-grid--main > .tp-card { display: flex; flex-direction: column; }
@media (max-width: 1199.98px) { .tp-grid--main { grid-template-columns: minmax(0, 1fr); } }

.tp-kpi {
  background: var(--tp-surface);
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.tp-kpi__label { font-size: 13px; color: var(--tp-muted); font-weight: 500; }
.tp-kpi__value {
  font-family: var(--tp-font-display);
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--tp-text);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tp-kpi__value small { white-space: nowrap; display: inline-block; font-family: var(--tp-font); font-size: 13px; color: var(--tp-muted); font-weight: 500; margin-left: 4px; }
.tp-kpi__note { font-size: 12px; font-weight: 600; color: var(--tp-muted); }
.tp-kpi__note--good { color: var(--tp-accent-text); }
.tp-kpi__note--danger { color: #c53030; }

.tp-card { background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius); padding: 22px; }
.tp-card--flush { padding: 0; overflow: hidden; }
.tp-card__head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.tp-card--flush .tp-card__head { padding: 18px 22px; margin: 0; border-bottom: 1px solid var(--tp-border); }
.tp-card__head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.tp-card__head .tp-sub { color: var(--tp-muted); font-size: 12.5px; margin-top: 2px; }

/* Delivery overview: ring + legend */
.tp-ring-wrap { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; flex: 1; }
.tp-ring {
  --p: 0;
  width: 150px; height: 150px; border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--tp-surface) 74%, transparent 75% 100%),
    conic-gradient(var(--tp-accent) calc(var(--p) * 1%), #e7ede9 0);
  display: flex; align-items: center; justify-content: center; flex-direction: column; flex: none;
}
.tp-ring b { font-family: var(--tp-font-display); font-size: 1.75rem; font-weight: 800; color: var(--tp-text); line-height: 1; }
.tp-ring span { font-size: 12px; color: var(--tp-muted); margin-top: 4px; }
.tp-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 180px; }
.tp-legend li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--tp-text-2); }
.tp-legend li em { font-style: normal; margin-left: auto; color: var(--tp-text); font-weight: 700; font-variant-numeric: tabular-nums; }
.tp-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* Delivery by network bars */
.tp-bars { display: flex; flex-direction: column; gap: 16px; }
.tp-bar__row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.tp-bar__row b { font-weight: 600; color: var(--tp-text); }
.tp-bar__row span { color: var(--tp-muted); }
.tp-bar { height: 8px; background: #e7ede9; border-radius: 99px; overflow: hidden; }
.tp-bar > span { display: block; height: 100%; background: var(--tp-accent); border-radius: 99px; }

/* Dark M-PESA card */
.tp-mpesa {
  margin-top: 20px;
  background: var(--tp-side);
  color: var(--tp-side-strong);
  border: 1px solid var(--tp-side-line);
  border-radius: 12px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.tp-mpesa__title { font-size: 13px; color: var(--tp-side-muted); }
.tp-mpesa__line { font-size: 13.5px; line-height: 1.5; }
.tp-mpesa__line b { color: var(--tp-side-strong); }
.tp-mpesa .form-group { margin-bottom: 8px; }
.tp-mpesa .form-control {
  background: var(--tp-side-hover) !important;
  border-color: var(--tp-side-line) !important;
  color: var(--tp-side-strong) !important;
  min-height: 42px; height: 42px;
}
.tp-mpesa .form-control::placeholder { color: var(--tp-side-muted); }
.tp-mpesa .form-control:focus { border-color: var(--tp-side-accent) !important; box-shadow: 0 0 0 3px var(--tp-side-active) !important; }
.tp-mpesa .btn-success, .tp-mpesa .btn-primary {
  background: var(--tp-mpesa-btn) !important; border-color: var(--tp-mpesa-btn) !important; color: var(--tp-mpesa-ink) !important;
  font-weight: 700; height: 42px;
}
.tp-mpesa .btn-success:hover, .tp-mpesa .btn-primary:hover { filter: brightness(.92); }
.tp-mpesa .help-block, .tp-mpesa .help-block-error { color: #ffb4ab !important; }

.tp-mpesa .form-input {
  background: var(--tp-side-hover) !important;
  border-color: var(--tp-side-line) !important;
  color: var(--tp-side-strong) !important;
  min-height: 42px; height: 42px;
}
.tp-mpesa .form-input::placeholder { color: var(--tp-side-muted); }
.tp-mpesa .form-label { color: var(--tp-side-muted); font-weight: 500; }
.tp-mpesa .form-group { margin-bottom: 10px; }
.tp-mpesa .btn-block { width: 100%; }

/* Delivery matrix table */
.tp-matrix td, .tp-matrix th { white-space: nowrap; }
.tp-matrix tfoot th { background: var(--tp-surface-2); color: var(--tp-text); font-weight: 700; border-top: 1px solid var(--tp-border); }
.tp-rate { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.tp-rate .tp-bar { flex: 1; }
.tp-rate b { font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; color: var(--tp-text); }
.tp-theme .tp-card { margin-bottom: 20px; }
.tp-theme .tp-grid--main { margin-bottom: 0; }
@media (max-width: 767.98px) { .tp-hero h1 { font-size: 1.5rem; } }
.tp-theme .tp-grid--main .tp-ring-wrap { flex: 0 0 auto; margin: 6px 0 24px; }
.tp-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: auto; }
.tp-split__item { border: 1px solid var(--tp-border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--tp-border-strong); }
.tp-split__item span { font-size: 12.5px; color: var(--tp-muted); font-weight: 500; }
.tp-split__item b { font-family: var(--tp-font-display); font-size: 1.4rem; font-weight: 800; color: var(--tp-text); font-variant-numeric: tabular-nums; }
.tp-split__item small { font-size: 12px; font-weight: 600; color: var(--tp-muted); }
.tp-split__item--delivered { border-top-color: #13a04f; }
.tp-split__item--pending { border-top-color: #e0a030; }
.tp-split__item--failed { border-top-color: #d64545; }

/* ==========================================================================
   WhatsApp module (modules/wa)
   ========================================================================== */
:root { --tp-wa: #25d366; --tp-wa-dark: #075e54; --tp-wa-bubble: #d9fdd3; --tp-wa-bg: #efeae2; }
.tp-sticky { position: sticky; top: 92px; }

/* phone preview */
.tp-phone { max-width: 360px; margin: 0 auto 20px; border-radius: 28px; border: 8px solid var(--tp-side); background: var(--tp-wa-bg); overflow: hidden; box-shadow: 0 24px 50px -24px rgba(15, 26, 20, .45); }
.tp-phone__bar { background: var(--tp-wa-dark); color: #fff; padding: 12px 16px; font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.tp-phone__screen { min-height: 300px; padding: 18px 14px; background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px; }
.tp-bubble { background: #fff; border-radius: 10px; padding: 8px 10px 6px; max-width: 88%; box-shadow: 0 1px 1px rgba(0,0,0,.12); font-size: 14px; color: #111b21; margin-bottom: 8px; overflow-wrap: anywhere; }
.tp-bubble--out { background: var(--tp-wa-bubble); margin-left: auto; }
.tp-bubble__head { font-weight: 700; margin-bottom: 4px; }
.tp-bubble__head:empty, .tp-bubble__foot:empty { display: none; }
.tp-bubble__foot { color: #667781; font-size: 12.5px; margin-top: 6px; }
.tp-bubble__time { color: #667781; font-size: 11px; text-align: right; margin-top: 2px; }
.tp-bubble__status { margin-left: 4px; color: #53bdeb; font-weight: 600; }
.tp-bubble__status.is-failed { color: #d64545; }
.tp-bubble code { background: rgba(0,0,0,.06); padding: 0 4px; border-radius: 4px; }
.tp-checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; }
.tp-checks-grid label { font-weight: 400; display: flex; gap: 8px; align-items: center; }

/* chat inbox */
.tp-chat { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 190px); min-height: 520px; background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius); overflow: hidden; }
.tp-chat__list { border-right: 1px solid var(--tp-border); display: flex; flex-direction: column; min-width: 0; }
.tp-chat__tools { padding: 14px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--tp-border); }
.tp-chat__items { flex: 1; overflow-y: auto; }
.tp-chat__item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--tp-row); color: inherit !important; text-decoration: none !important; border-left: 3px solid transparent; }
.tp-chat__item:hover { background: var(--tp-surface-2); }
.tp-chat__item.is-active { background: var(--tp-accent-soft); border-left-color: var(--tp-accent); }
.tp-chat__item .tp-avatar, .tp-chat__head .tp-avatar { width: 40px; height: 40px; font-size: 13px; box-shadow: none; }
.tp-chat__meta { min-width: 0; display: flex; flex-direction: column; }
.tp-chat__meta b { color: var(--tp-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-chat__meta small { color: var(--tp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-chat__side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--tp-muted); }
.tp-chat__badge { background: var(--tp-wa); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.tp-chat__thread { display: flex; flex-direction: column; min-width: 0; background: var(--tp-wa-bg); }
.tp-chat__head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--tp-surface); border-bottom: 1px solid var(--tp-border); }
.tp-chat__who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tp-chat__who b { color: var(--tp-text); }
.tp-chat__who span { color: var(--tp-muted); font-size: 12.5px; }
.tp-chat__messages { flex: 1; overflow-y: auto; padding: 18px 6%; display: flex; flex-direction: column; }
.tp-chat__messages .tp-bubble { max-width: 70%; }
.tp-chat__empty { margin: auto; text-align: center; color: var(--tp-muted); padding: 30px; }
.tp-chat__empty .fa-whatsapp { font-size: 42px; color: var(--tp-wa); }
.tp-chat__compose { background: var(--tp-surface); border-top: 1px solid var(--tp-border); padding: 10px 14px; }
.tp-chat__notice { background: var(--tp-warning-bg); color: var(--tp-warning); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 8px; }
.tp-chat__form { display: flex; gap: 8px; align-items: flex-end; margin: 0; }
.tp-theme .tp-chat__form textarea { flex: 1; min-height: 44px; max-height: 160px; resize: vertical; }
.tp-theme .tp-chat__form .btn { height: 44px; }
.tp-theme [hidden] { display: none !important; }
@media (max-width: 991.98px) {
  .tp-chat { grid-template-columns: 1fr; height: auto; }
  .tp-chat__list { max-height: 320px; border-right: 0; border-bottom: 1px solid var(--tp-border); }
  .tp-chat__thread { min-height: 480px; }
  .tp-sticky { position: static; }
}

/* ---------- Developer documentation (views/dev) --------------------------- */
.tp-theme .tpd-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-theme .tpd-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.tp-theme .tpd-toc { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius); padding: 14px 10px; }
.tp-theme .tpd-toc a { display: block; padding: 6px 10px; border-radius: 8px; font-size: 13.5px; color: var(--tp-text-2); text-decoration: none; border-left: 2px solid transparent; }
.tp-theme .tpd-toc a:hover { background: var(--tp-tint); color: var(--tp-text); }
.tp-theme .tpd-toc a.is-active { background: var(--tp-accent-soft); color: var(--tp-accent-text); font-weight: 600; border-left-color: var(--tp-accent); border-radius: 0 8px 8px 0; }
.tp-theme .tpd-toc__group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tp-muted); padding: 14px 10px 6px; }
.tp-theme .tpd-toc__group:first-child { padding-top: 2px; }
.tp-theme .tpd-toc__group i { margin-right: 4px; }
.tp-theme .tpd-toc__group--wa i { color: #1fa855; }

.tp-theme .tpd-section { scroll-margin-top: 90px; padding: 26px 28px; }
.tp-theme .tpd-section h2 { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.tp-theme .tpd-section h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tp-muted); margin: 24px 0 10px; }
.tp-theme .tpd-section > p { color: var(--tp-text-2); font-size: 14.5px; line-height: 1.6; max-width: 72ch; margin-bottom: 14px; }
.tp-theme .tpd-section code, .tp-theme .tpd-key code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--tp-text); background: var(--tp-tint); border: 1px solid var(--tp-border); border-radius: 6px; padding: 1px 6px; word-break: break-word; }
.tp-theme .tpd-muted { color: var(--tp-muted); }

.tp-theme .tpd-divider { display: flex; align-items: center; gap: 12px; margin: 34px 0 18px; color: var(--tp-on-bg-muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tp-theme .tpd-divider::before, .tp-theme .tpd-divider::after { content: ""; flex: 1; height: 1px; background: var(--tp-on-bg-line); }
.tp-theme .tpd-divider--wa span i { color: #1fa855; }

.tp-theme .tpd-endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--tp-surface-2); border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); padding: 10px 12px; margin-bottom: 8px; }
.tp-theme .tpd-endpoint code { background: none !important; border: 0 !important; padding: 0 !important; font-size: 13px !important; flex: 1; min-width: 0; }
.tp-theme .tpd-endpoint__tag { font-size: 11.5px; color: var(--tp-muted); font-weight: 600; }
.tp-theme .tpd-method { font: 700 11px/1 ui-monospace, Menlo, Consolas, monospace; padding: 5px 8px; border-radius: 6px; letter-spacing: .04em; }
.tp-theme .tpd-method--post { background: var(--tp-success-bg); color: var(--tp-success); }
.tp-theme .tpd-method--get { background: var(--tp-info-bg); color: var(--tp-info); }

.tp-theme .tpd-table { overflow-x: auto; border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); }
.tp-theme .tpd-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tp-theme .tpd-table th { background: var(--tp-surface-2); color: var(--tp-muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--tp-border); white-space: nowrap; }
.tp-theme .tpd-table td { padding: 10px 14px; border-bottom: 1px solid var(--tp-row); vertical-align: top; color: var(--tp-text-2); }
.tp-theme .tpd-table tr:last-child td { border-bottom: 0; }
.tp-theme .tpd-table td:first-child { white-space: nowrap; }
.tp-theme .tpd-table td:last-child:not(:nth-child(2)) { white-space: nowrap; text-align: right; }

.tp-theme .tpd-code { background: #0f1a14; border-radius: var(--tp-radius-sm); overflow: hidden; margin-bottom: 12px; border: 1px solid #0f1a14; }
.tp-theme .tpd-code__bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: #16251d; border-bottom: 1px solid rgba(255,255,255,.08); }
.tp-theme .tpd-code__bar button { background: none; border: 0; color: #a9bbb1; font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
.tp-theme .tpd-code__bar button:hover { color: #fff; background: rgba(255,255,255,.06); }
.tp-theme .tpd-code__bar button.is-active { color: #fff; background: rgba(255,255,255,.1); }
.tp-theme .tpd-code__bar .tpd-copy { margin-left: auto; }
.tp-theme .tpd-code__title { color: #e6eee9; font-size: 12.5px; font-weight: 600; padding: 0 6px; margin-right: auto; }
.tp-theme .tpd-code__title + .tp-pill + .tpd-copy { margin-left: 6px; }
.tp-theme .tpd-code pre { margin: 0; padding: 14px 16px; color: #d7e5dc; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; overflow-x: auto; max-height: 460px; background: none; border: 0; }
.tp-theme .tpd-code--light { background: var(--tp-surface-2); border-color: var(--tp-border); }
.tp-theme .tpd-code--light .tpd-code__bar { background: var(--tp-surface); border-bottom-color: var(--tp-border); }
.tp-theme .tpd-code--light .tpd-code__bar button { color: var(--tp-muted); }
.tp-theme .tpd-code--light .tpd-code__bar button:hover { color: var(--tp-text); background: var(--tp-tint); }
.tp-theme .tpd-code--light .tpd-code__bar button.is-active { color: var(--tp-accent-text); background: var(--tp-accent-soft); }
.tp-theme .tpd-code--light .tpd-code__title { color: var(--tp-text); }
.tp-theme .tpd-code--light pre { color: var(--tp-text); }
.tp-theme .tpd-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.tp-theme .tpd-pair .tpd-code { margin: 0; }

.tp-theme .tpd-note { display: flex; gap: 10px; align-items: baseline; background: var(--tp-info-bg); color: var(--tp-info); border-radius: var(--tp-radius-sm); padding: 10px 14px; font-size: 13.5px; margin-top: 14px; }
.tp-theme .tpd-note code { background: rgba(255,255,255,.6); }

.tp-theme .tpd-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 6px 0 4px; }
.tp-theme .tpd-channel { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); text-decoration: none; color: var(--tp-text); transition: border-color .15s, box-shadow .15s; }
.tp-theme .tpd-channel:hover { border-color: var(--tp-accent); box-shadow: 0 4px 14px rgba(15,26,20,.06); text-decoration: none; }
.tp-theme .tpd-channel b { display: block; font-size: 15px; }
.tp-theme .tpd-channel small { display: block; color: var(--tp-muted); font-size: 13px; margin-top: 2px; line-height: 1.45; }
.tp-theme .tpd-channel__icon, .tp-theme .tpd-api__icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--tp-accent-soft); color: var(--tp-accent-text); font-size: 18px; }
.tp-theme .tpd-channel--wa .tpd-channel__icon, .tp-theme .tpd-api--wa .tpd-api__icon { background: #e1f7e9; color: #128c4a; font-size: 21px; }

.tp-theme .tpd-key { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; background: var(--tp-surface-2); border: 1px dashed var(--tp-border-strong); border-radius: var(--tp-radius-sm); padding: 14px 16px; margin-bottom: 16px; }
.tp-theme .tpd-key__label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--tp-muted); margin-bottom: 4px; }
.tp-theme .tpd-key code { font-size: 13.5px; word-break: break-all; }
.tp-theme .tpd-key__actions { display: flex; gap: 6px; flex-wrap: wrap; }

.tp-theme .tpd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 8px 0 4px; }
.tp-theme .tpd-fact { background: var(--tp-surface-2); border: 1px solid var(--tp-border); border-radius: var(--tp-radius-sm); padding: 16px; font-size: 13.5px; color: var(--tp-text-2); line-height: 1.5; }
.tp-theme .tpd-fact i { color: #128c4a; font-size: 18px; display: block; margin-bottom: 10px; }
.tp-theme .tpd-fact b { display: block; color: var(--tp-text); font-size: 14px; margin-bottom: 4px; }
.tp-theme .tpd-wa-text { color: #128c4a; font-weight: 600; white-space: nowrap; }
.tp-theme .tpd-status { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 16px; font-size: 13.5px; color: var(--tp-text-2); }
.tp-theme .tpd-status b { margin-right: 6px; }

.tp-theme .tpd-builder { max-width: 860px; }
.tp-theme .tpd-builder label { font-weight: 600; font-size: 13px; color: var(--tp-text); }
.tp-theme .tpd-textarea { font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--tp-surface-2); }
.tp-theme .tpd-b-error { color: var(--tp-danger); font-weight: 600; }
.tp-theme .tpd-builder__actions { display: flex; gap: 8px; margin-bottom: 16px; }

/* dev/index */
.tp-theme .tpd-apis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tp-theme .tpd-api { display: flex; flex-direction: column; gap: 4px; background: var(--tp-surface); border: 1px solid var(--tp-border); border-radius: var(--tp-radius); padding: 20px; color: var(--tp-text); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tp-theme .tpd-api:hover { border-color: var(--tp-accent); box-shadow: 0 6px 18px rgba(15,26,20,.07); transform: translateY(-1px); text-decoration: none; color: var(--tp-text); }
.tp-theme .tpd-api__icon { margin-bottom: 10px; }
.tp-theme .tpd-api__name { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--tp-font-display); font-size: 17px; font-weight: 800; }
.tp-theme .tpd-api__sub { font-size: 12.5px; color: var(--tp-muted); font-weight: 600; }
.tp-theme .tpd-api__text { font-size: 13.5px; color: var(--tp-text-2); line-height: 1.5; margin-top: 6px; flex: 1; }
.tp-theme .tpd-api__more { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--tp-accent-text); }
.tp-theme .tpd-steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.tp-theme .tpd-steps li { counter-increment: s; position: relative; padding: 0 0 18px 46px; font-size: 14px; color: var(--tp-text-2); line-height: 1.5; }
.tp-theme .tpd-steps li:last-child { padding-bottom: 0; }
.tp-theme .tpd-steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--tp-accent-soft); color: var(--tp-accent-text); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tp-theme .tpd-steps b { display: block; color: var(--tp-text); }
.tp-theme .tpd-links { list-style: none; padding: 0; margin: 0; }
.tp-theme .tpd-links li + li { border-top: 1px solid var(--tp-row); }
.tp-theme .tpd-links a { display: flex; align-items: center; gap: 12px; padding: 11px 2px; font-size: 14px; font-weight: 500; color: var(--tp-text); text-decoration: none; }
.tp-theme .tpd-links a:hover { color: var(--tp-accent-text); }
.tp-theme .tpd-links i { width: 18px; text-align: center; color: var(--tp-muted); }
.tp-theme .tpd-soon { text-align: center; padding: 48px 24px; }
.tp-theme .tpd-soon .tpd-api__icon { width: 56px; height: 56px; font-size: 24px; margin-bottom: 14px; }
.tp-theme .tpd-soon h2 { font-size: 20px; font-weight: 800; }
.tp-theme .tpd-soon p { color: var(--tp-muted); margin-bottom: 18px; }

@media (max-width: 991.98px) {
  .tp-theme .tpd-layout { grid-template-columns: minmax(0, 1fr); }
  .tp-theme .tpd-toc { position: static; max-height: none; display: flex; gap: 4px; overflow-x: auto; padding: 8px; white-space: nowrap; }
  .tp-theme .tpd-toc__group { display: none; }
  .tp-theme .tpd-toc a { flex: none; border-left: 0; }
  .tp-theme .tpd-toc a.is-active { border-radius: 8px; }
  .tp-theme .tpd-section { padding: 20px; }
}

/* Public docs layout (views/layouts/docs.php) */
.tp-docs-public { background: var(--tp-bg); min-height: 100vh; }
.tp-docsbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 32px; background: var(--tp-top); border-bottom: 1px solid var(--tp-top-border); }
.tp-docsbar__brand { display: flex; align-items: center; gap: 12px; text-decoration: none !important; color: var(--tp-top-strong) !important; font-family: var(--tp-font-display); font-weight: 800; }
.tp-docsbar__brand img { max-height: 36px; width: auto; }
.tp-docsbar__brand span { padding-left: 12px; border-left: 1px solid var(--tp-top-border); }
.tp-docsbar__nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tp-docsbar__nav > a:not(.btn) { color: var(--tp-top-text); font-size: 14px; font-weight: 500; }
.tp-docs-main { max-width: 1320px; margin: 0 auto; padding: 32px; }
.tp-docs-public .tpd-toc { top: 80px; }
.tp-docs-public .tpd-section { scroll-margin-top: 80px; }
.tp-docs-foot { text-align: center; color: var(--tp-on-bg-muted); font-size: 13px; padding: 24px; }
@media (max-width: 767.98px) {
  .tp-docsbar { padding: 10px 16px; }
  .tp-docsbar__nav > a:not(.btn) { display: none; }
  .tp-docs-main { padding: 20px 14px; }
}

/* ---------- Pages from the previous (Argon / Material) theme ----------------
   views/layouts/main.php puts pages without their own Textpie wrapper inside
   .tp-page-card. These rules make the older markup fit the theme. */
.tp-theme .tp-page-card { padding: 24px; }
.tp-theme .tp-page-card > :last-child { margin-bottom: 0; }
.tp-theme .tp-page-card .card { box-shadow: none; margin-bottom: 20px; }
.tp-theme .tp-page-card .row > [class*="col"] > .card { height: calc(100% - 20px); }
/* Material cards: card-header[data-background-color] + card-content */
.tp-theme .card-header[data-background-color] { background: transparent !important; box-shadow: none; padding: 16px 20px; }
.tp-theme .card-header .title, .tp-theme .card .title { font-family: var(--tp-font-display); font-size: 1rem; font-weight: 700; color: var(--tp-text); margin: 0; }
.tp-theme .card-header .category, .tp-theme .card .category { color: var(--tp-muted); font-size: 13px; margin: 4px 0 0; }
.tp-theme .card-header .category a { color: var(--tp-accent-text); }
.tp-theme .card-content { padding: 18px 20px; }
.tp-theme .card-content.table-responsive { padding: 0; }
.tp-theme .card-footer .stats { color: var(--tp-muted); font-size: 12.5px; }
.tp-theme .table thead.text-warning th { color: var(--tp-muted) !important; }
/* Argon stat tiles: .card.card-stats with .icon-shape */
.tp-theme .card-stats { border: 1px solid var(--tp-border); border-radius: var(--tp-radius); transition: border-color .15s, box-shadow .15s; height: calc(100% - 20px); }
.tp-theme .card-stats .card-body { padding: 18px 20px; }
.tp-theme .card-stats .card-title { font-family: var(--tp-font); font-size: 11.5px !important; font-weight: 700; letter-spacing: .05em; color: var(--tp-muted) !important; }
.tp-theme .card-stats .h2 { font-family: var(--tp-font-display); font-size: 1.15rem; font-weight: 800; color: var(--tp-text); display: block; margin-top: 4px; }
.tp-theme .card-stats .text-sm { font-size: 13px; color: var(--tp-muted); }
.tp-theme .card-stats .text-sm .text-success, .tp-theme .card-stats .text-sm .text-danger { color: var(--tp-accent-text) !important; }
.tp-theme .my_fade { opacity: 1 !important; }
.tp-theme .my_fade:hover { border-color: var(--tp-accent); box-shadow: 0 6px 18px rgba(15, 26, 20, .07); }
.tp-theme .icon-shape { width: 42px; height: 42px; border-radius: 12px !important; display: inline-flex; align-items: center; justify-content: center; box-shadow: none !important; font-size: 17px; }
.tp-theme .icon-shape[class*="bg-gradient-"], .tp-theme .icon-shape.bg-primary, .tp-theme .icon-shape.bg-success, .tp-theme .icon-shape.bg-info, .tp-theme .icon-shape.bg-warning, .tp-theme .icon-shape.bg-danger, .tp-theme .icon-shape.bg-default { background: var(--tp-accent-soft) !important; color: var(--tp-accent-text) !important; }
.tp-theme .icon-shape.bg-gradient-red, .tp-theme .icon-shape.bg-danger { background: var(--tp-danger-bg) !important; color: var(--tp-danger) !important; }
.tp-theme .icon-shape.bg-gradient-orange, .tp-theme .icon-shape.bg-gradient-yellow, .tp-theme .icon-shape.bg-warning { background: var(--tp-warning-bg) !important; color: var(--tp-warning) !important; }
.tp-theme .icon-shape.bg-gradient-info, .tp-theme .icon-shape.bg-gradient-primary, .tp-theme .icon-shape.bg-gradient-purple, .tp-theme .icon-shape.bg-info { background: var(--tp-info-bg) !important; color: var(--tp-info) !important; }
.tp-theme .icon-shape i { color: inherit !important; }
/* Argon colour helpers and gradients used on buttons and badges */
.tp-theme .peach-gradient, .tp-theme [class*="bg-gradient-"]:not(.icon-shape) { background: var(--tp-btn) !important; color: var(--tp-btn-ink) !important; }
.tp-theme .btn-floating { border-radius: var(--tp-radius-sm) !important; box-shadow: none !important; padding: 8px 14px; }
.tp-theme .file-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-theme .file-field input[type="file"] { font-size: 13px; }
.tp-theme .pull-right { float: right; }
.tp-theme .pull-left { float: left; }
.tp-theme .text-yellow { color: #b7791f !important; }
.tp-theme .text-indigo, .tp-theme .text-purple { color: #5a4fcf !important; }
.tp-theme .text-cyan, .tp-theme .text-blue { color: var(--tp-info) !important; }
.tp-theme .text-green { color: var(--tp-accent-text) !important; }
.tp-theme .text-red { color: var(--tp-danger) !important; }
.tp-theme .material-icons { font-size: 18px; vertical-align: middle; line-height: 1; }
.tp-theme .bg-secondary { background: var(--tp-surface-2) !important; }
.tp-theme .shadow { box-shadow: none !important; }
.tp-theme .detail-view th { width: 34%; color: var(--tp-muted); font-weight: 600; background: var(--tp-surface-2); }
.tp-theme .help-block, .tp-theme .hint-block { color: var(--tp-muted); font-size: 12.5px; }
.tp-theme .help-block-error, .tp-theme .invalid-feedback { color: var(--tp-danger); }
@media (max-width: 767.98px) { .tp-theme .tp-page-card { padding: 16px; } }
/* Nucleo (Argon) icons are not loaded any more: draw the few that are used with Font Awesome */
.tp-theme .ni { font-family: "Font Awesome 5 Free"; font-weight: 900; font-style: normal; display: inline-block; line-height: 1; }
.tp-theme .ni-fat-add::before { content: "\f067"; }
.tp-theme .ni-single-copy-04::before { content: "\f0c5"; }
.tp-theme .ni-circle-08::before { content: "\f007"; }
.tp-theme .ni-lock-circle-open::before { content: "\f023"; }
.tp-theme .ni-email-83::before { content: "\f0e0"; }
.tp-theme .ni-mobile-button::before { content: "\f3cd"; }
.tp-theme .ni-building::before { content: "\f1ad"; }
.tp-theme .ni-tablet-button::before { content: "\f3fa"; }
.tp-theme .ni-hat-3::before { content: "\f19d"; }
.tp-theme .ni-badge::before { content: "\f2c2"; }
.tp-theme .ni-tag::before { content: "\f02b"; }
