
/* =====================================================================
   LAYOUT-LEVEL CSS — GLOSSY CARTOON SKIN
   Same look as the New Order page: bright green panels, dark-green outline,
   glossy red / green / yellow buttons with a hard bottom edge, mint inputs.

   - Dark mode is NOT handled here. The nav template owns it:
       html[data-theme="dark"] + .dark-mode class, toggled by #bkThemeToggle,
       saved in localStorage key "theme".
     Never add `body.dark-mode ... { background/color !important }` rules here:
     they override every theme component (select2, cards, modals, badges).
   - The outline colour (--nk-ink) is a FIXED dark green so it also works in dark mode.
   ===================================================================== */

:root {
  --bk-font: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* cartoon tokens (same names the New Order page uses) */
  --nk-ink: #073e3b;
  --nk-ink-a: rgba(7, 62, 59, .35);
  --nk-g1: #45dc5d;            /* panel green, top    */
  --nk-g2: #14a032;            /* panel green, bottom */
  --nk-yel: #ffd93d;
  --nk-mint: #e6f8e8;          /* soft tile background  */
  --nk-mint-b: #8fd9a0;        /* soft tile border      */
  --nk-red1: #ff5648;
  --nk-red2: #e30a0a;

  /* old names still used by other templates */
  --no-ink: var(--nk-ink);
  --no-yel: var(--nk-yel);
}
[data-theme="dark"] {
  --nk-ink: #03211f;
  --nk-ink-a: rgba(0, 0, 0, .45);
  --nk-g1: #23a84b;
  --nk-g2: #0e7a30;
  --nk-mint: rgba(2, 227, 96, .10);
  --nk-mint-b: rgba(2, 227, 96, .40);
}

/* Font: no !important, and icon fonts are left alone */
html body,
html body input,
html body select,
html body textarea,
html body button {
  font-family: var(--bk-font);
}

/* ---------------------------------------------------------------------
   BADGES (counts, balance, status)
   --------------------------------------------------------------------- */
.badge {
  display: inline-block;
  min-width: 10px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  background: linear-gradient(var(--nk-red1), var(--nk-red2));
  border: 2px solid var(--nk-ink);
  border-radius: 999px;
}

/* Status badges */
.badge-success { background: #e0f8e9; color: #218838; }
.badge-pending { background: #fff4d6; color: #c08800; }
.badge-failed  { background: #fbe3e4; color: #c82333; }
[data-theme="dark"] .badge-success { background: #14532d; color: #22c55e; }
[data-theme="dark"] .badge-pending { background: #78350f; color: #facc15; }
[data-theme="dark"] .badge-failed  { background: #7f1d1d; color: #f87171; }

/* ---------------------------------------------------------------------
   BUTTONS — glossy, outlined, with a hard bottom edge that "presses in"
   red = default / primary / danger, green = success, yellow = warning
   --------------------------------------------------------------------- */
.btn-default,
.btn-primary {
  font-weight: 800;
  font-size: 15px;
  padding: 9px 18px;
  color: #fff;
  background: linear-gradient(var(--nk-red1), var(--nk-red2));
  --btn-sh: #8d0707;
  text-shadow: 0 2px 0 rgba(7, 62, 59, .5);
}
.btn-success {
  font-weight: 800; font-size: 15px; padding: 9px 18px; color: #fff;
  background: linear-gradient(#4be267, #12a82f);
  --btn-sh: #0a6a20;
  text-shadow: 0 2px 0 rgba(7, 62, 59, .5);
}
.btn-warning {
  font-weight: 800; font-size: 15px; padding: 9px 18px; color: #3a2a00;
  background: linear-gradient(#ffe561, #ffc21a);
  --btn-sh: #a06a00;
}
.btn-danger {
  font-weight: 800; font-size: 15px; padding: 9px 18px; color: #fff;
  background: linear-gradient(#ff5648, #b80a0a);
  --btn-sh: #6e0505;
  text-shadow: 0 2px 0 rgba(7, 62, 59, .5);
}
.btn-default:hover, .btn-default:focus,
.btn-primary:hover, .btn-primary:focus,
.btn-success:hover, .btn-success:focus,
.btn-warning:hover, .btn-warning:focus,
.btn-danger:hover, .btn-danger:focus {
  filter: brightness(1.06);
  text-decoration: none;
  outline: none;
}
.btn-default, .btn-primary { color: #fff; }
.btn-success:hover, .btn-success:focus, .btn-danger:hover, .btn-danger:focus { color: #fff; }
.btn-warning:hover, .btn-warning:focus { color: #3a2a00; }
.btn-default:disabled, .btn-primary:disabled,
.btn-default[disabled], .btn-primary[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

/* the nav template also paints .btn-primary flat red; make the glossy gradient win */
html body .btn-default, html body .btn-primary { background: linear-gradient(var(--nk-red1), var(--nk-red2)) !important; color: #fff !important; }
html body .btn-success { background: linear-gradient(#4be267, #12a82f) !important; }
html body .btn-warning { background: linear-gradient(#ffe561, #ffc21a) !important; }
html body .btn-danger  { background: linear-gradient(#ff5648, #b80a0a) !important; }

/* sticker structure on every button (select toggles + link buttons are left alone) */
html body .btn:not(.btn-link):not(.dropdown-toggle) {
  border: 3px solid var(--nk-ink) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 0 var(--btn-sh, #8d0707), inset 0 2px 0 rgba(255, 255, 255, .35) !important;
  font-weight: 800;
  transition: transform .1s ease, box-shadow .1s ease, filter .15s ease;
}
html body .btn:not(.btn-link):not(.dropdown-toggle):hover,
html body .btn:not(.btn-link):not(.dropdown-toggle):focus {
  transform: translateY(2px) !important;
  box-shadow: 0 2px 0 var(--btn-sh, #8d0707), inset 0 2px 0 rgba(255, 255, 255, .35) !important;
}
html body .btn:not(.btn-link):not(.dropdown-toggle):active {
  transform: translateY(4px) !important;
  box-shadow: 0 0 0 var(--btn-sh, #8d0707) !important;
}
html body .btn-xs:not(.btn-link),
html body .btn-sm:not(.btn-link) {
  border-width: 2.5px !important;
  border-radius: 11px !important;
  box-shadow: 0 3px 0 var(--btn-sh, #8d0707), inset 0 2px 0 rgba(255, 255, 255, .35) !important;
}
html body .btn.disabled,
html body .btn[disabled] {
  box-shadow: none !important;
  transform: none !important;
}

/* ---------------------------------------------------------------------
   CARDS (.well) — white cards with a thick green outline and a hard bottom edge
   .nk-panel (+ .nk-head / .nk-body) is the full green panel used on New Order
   --------------------------------------------------------------------- */
html body .well {
  border: 3px solid var(--nk-ink) !important;
  border-radius: 22px !important;
  box-shadow: 0 5px 0 var(--nk-ink-a), inset 0 3px 0 rgba(255, 255, 255, .6) !important;
}
html[data-theme="dark"] body .well { box-shadow: 0 5px 0 var(--nk-ink-a) !important; }
html body .well:hover { border-color: var(--nk-ink) !important; }
html body .well .well {
  border: 2.5px solid var(--nk-mint-b) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
  background: var(--nk-mint);
}
.well form { padding: 15px 0; }

/* ---------------------------------------------------------------------
   PAGE BACKGROUND — the engine puts class "pricing" on <body> of the Services page and
   the old .pricing rule paints it with a green gradient. Keep every page on the theme bg.
   --------------------------------------------------------------------- */
html body.pricing, html body#services {
  background: var(--bg) !important;
  background-image: none !important;
}

/* ---------------------------------------------------------------------
   TABLES — green header strip, rounded outline (transactions, services, API docs, payments, updates...)
   Card-list tables (.rf-list / .oh-list / .payment-history-table) style themselves.
   --------------------------------------------------------------------- */
:root { --tbl-hover: rgba(255, 217, 61, .22); --tx-add: #0b7f46; --tx-sub: #c80000; }

html body table.table:not(.rf-list):not(.oh-list):not(.payment-history-table):not(.svc-ins-table) {
  width: 100%;
  margin: 0 !important;
  background: var(--surface);
  border: 3px solid var(--nk-ink) !important;
  border-radius: 18px !important;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
html body table.table:not(.rf-list):not(.oh-list):not(.payment-history-table):not(.svc-ins-table) > thead > tr > th {
  background: linear-gradient(180deg, var(--nk-g1), var(--nk-g2)) !important;
  color: #fff !important;
  text-shadow: 0 1px 0 var(--nk-ink);
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 13px 16px !important;
  border: 0 !important;
  border-bottom: 3px solid var(--nk-ink) !important;
}
html body table.table:not(.rf-list):not(.oh-list):not(.payment-history-table):not(.svc-ins-table) > thead > tr > th i { color: #fff !important; }
html body table.table:not(.rf-list):not(.oh-list):not(.payment-history-table):not(.svc-ins-table) > tbody > tr > td {
  padding: 13px 16px !important;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  border: 0 !important;
  border-bottom: 2px solid var(--border) !important;
  transition: background-color .12s ease;
}
html body table.table:not(.rf-list):not(.oh-list):not(.payment-history-table):not(.svc-ins-table) > tbody > tr:last-child > td { border-bottom: 0 !important; }
html body table.table:not(.rf-list):not(.oh-list):not(.payment-history-table):not(.svc-ins-table) > tbody > tr:hover > td { background: var(--tbl-hover) !important; }
html body table.table:not(.rf-list):not(.oh-list):not(.payment-history-table):not(.svc-ins-table) > tbody > tr > td a { color: var(--brand); font-weight: 800; }
/* key / value tables (API docs): first column is a label cell */
html body table.table:not(.rf-list):not(.oh-list):not(.payment-history-table):not(.svc-ins-table) > tbody > tr > td.width-40 {
  background: var(--nk-mint); font-weight: 800; border-right: 2px solid var(--border) !important;
}
/* service list: category rows are yellow sticker strips */
html body table.table tr.service_cat_header > td {
  background: linear-gradient(#ffe561, #ffc21a) !important; color: #3a2a00 !important;
  font-size: 15px !important; font-weight: 900 !important; padding: 11px 16px !important;
  border-top: 2.5px solid var(--nk-ink) !important; border-bottom: 2.5px solid var(--nk-ink) !important;
}
html body table.table tr.service_cat_header:first-child > td { border-top: 0 !important; }
html body table.table tr.service_cat_header > td * { color: #3a2a00 !important; }

/* transactions: type pill + coloured amount (classes come from template.transactions.table.item) */
.tx-type {
  display: inline-block; padding: 3px 11px; font-size: 12px; font-weight: 900; letter-spacing: .4px; text-transform: uppercase;
  color: var(--text); background: var(--nk-mint); border: 2px solid var(--nk-ink); border-radius: 999px;
}
.tx-type[data-t="addition" i]  { background: linear-gradient(#5be86f, #1fb83c); color: #fff; text-shadow: 0 1px 0 rgba(7,62,59,.5); }
.tx-type[data-t="deduction" i] { background: linear-gradient(#ff8a8a, #ff4d4d); color: #fff; text-shadow: 0 1px 0 rgba(7,62,59,.5); }
html body tr.tx-row[data-type="addition" i]  > td.tx-amt { color: var(--tx-add) !important; font-weight: 900; }
html body tr.tx-row[data-type="deduction" i] > td.tx-amt { color: var(--tx-sub) !important; font-weight: 900; }

@media (max-width: 575px) {
  html body table.table:not(.rf-list):not(.oh-list):not(.payment-history-table):not(.svc-ins-table) > thead > tr > th {
    padding: 10px 8px !important; font-size: 11px; letter-spacing: .3px; white-space: normal !important;
  }
  html body table.table:not(.rf-list):not(.oh-list):not(.payment-history-table):not(.svc-ins-table) > tbody > tr > td { padding: 10px 8px !important; font-size: 13px; }
  html body .sk-card.table-responsive { padding: 8px !important; }
  html body .service-row .btn-primary { padding: 6px 9px; font-size: 12px; }
}

/* ---------------------------------------------------------------------
   FORM FIELDS — mint outline, soft inner shadow, green glow on focus
   --------------------------------------------------------------------- */
html body .form-control {
  border: 2px solid var(--nk-mint-b) !important;
  border-radius: 15px !important;
  background: var(--surface);
  box-shadow: inset 0 2px 0 rgba(7, 62, 59, .06) !important;
  font-weight: 600;
}
html body .form-control:focus {
  border-color: var(--accent-dark, #0e9b56) !important;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb, 2, 227, 96), .22) !important;
}
html body .control-label,
html body .form-group > label { font-weight: 800; }

/* ---------------------------------------------------------------------
   ALERTS
   --------------------------------------------------------------------- */
html body .alert {
  border: 3px solid var(--nk-ink) !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 0 var(--nk-ink-a);
  font-weight: 600;
}

/* Success alert (order placed box) */
.alert-success {
  background: #b9f6ca;
  color: #053b3e;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.alert-success hr { border-top: 2px solid var(--nk-ink); margin: 10px 0; }
.alert-success .alert-link { color: #065f46; font-weight: 800; text-decoration: underline; }
[data-theme="dark"] .alert-success {
  background: #14532d;
  color: #d1fae5;
}
[data-theme="dark"] .alert-success .alert-link { color: #6ee7b7; }

/* ---------------------------------------------------------------------
   DROPDOWN MENUS (Bootstrap)
   --------------------------------------------------------------------- */
.dropdown-menu > li > a { padding: 7px 14px; line-height: 1.5; white-space: nowrap; font-weight: 700; }
html body .dropdown-menu {
  border: 3px solid var(--nk-ink) !important;
  border-radius: 16px !important;
  box-shadow: 0 6px 0 var(--nk-ink-a), 0 14px 30px rgba(0, 0, 0, .16) !important;
}

/* ---------------------------------------------------------------------
   TABS / PILLS + PAGINATION — yellow glossy pill when active
   --------------------------------------------------------------------- */
html body .nav-pills > li > a {
  border: 2.5px solid var(--nk-ink) !important;
  border-radius: 999px !important;
  box-shadow: 0 3px 0 var(--nk-ink-a);
  font-weight: 800;
  transition: transform .1s ease, box-shadow .1s ease;
}
html body .nav-pills > li > a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--nk-ink-a);
}
html body .nav-pills > li.active > a,
html body .nav-pills > li.active > a:hover,
html body .nav-pills > li.active > a:focus {
  background: linear-gradient(#ffe561, #ffc21a) !important;
  color: #3a2a00 !important;
  border: 2.5px solid var(--nk-ink) !important;
  border-radius: 999px !important;
  box-shadow: 0 1px 0 var(--nk-ink-a), inset 0 2px 0 rgba(255, 255, 255, .5) !important;
  transform: translateY(2px);
}

html body .pagination > li > a,
html body .pagination > li > span {
  border: 2.5px solid var(--nk-ink) !important;
  border-radius: 11px !important;
  box-shadow: 0 3px 0 var(--nk-ink-a);
  font-weight: 800;
}
html body .pagination > li.active > a,
html body .pagination > .active > span {
  background: linear-gradient(#ffe561, #ffc21a) !important;
  color: #3a2a00 !important;
  border-color: var(--nk-ink) !important;
}

/* ---------------------------------------------------------------------
   MODALS — green header strip with a white outlined title
   --------------------------------------------------------------------- */
html body .modal-content {
  border: 3px solid var(--nk-ink) !important;
  border-radius: 24px !important;
  box-shadow: 0 8px 0 var(--nk-ink-a), 0 24px 70px rgba(0, 0, 0, .35) !important;
  overflow: hidden;
}
html body .modal-header {
  background: linear-gradient(180deg, var(--nk-g1), var(--nk-g2));
  border-bottom: 3px solid var(--nk-ink) !important;
}
html body .modal-header .modal-title,
html body .modal-header h4,
html body .modal-header h5 { color: #fff; font-weight: 800; text-shadow: 0 2px 0 var(--nk-ink); }
html body .modal-header .close { color: #fff; opacity: 1; text-shadow: 0 2px 0 var(--nk-ink); }
html body .modal-footer { border-top: 2.5px solid var(--nk-mint-b) !important; }

/* ---------------------------------------------------------------------
   PHONES — slightly smaller edges so nothing gets cramped
   --------------------------------------------------------------------- */
@media (max-width: 575px) {
  html body .well { box-shadow: 0 4px 0 var(--nk-ink-a) !important; border-radius: 18px !important; }
  html body .modal-content { box-shadow: 0 5px 0 var(--nk-ink-a) !important; }
  html body .dropdown-menu { box-shadow: 0 4px 0 var(--nk-ink-a) !important; }
}
