/*!
 * HTTPID Console — DashLite override layer (loaded with id="skin-default", always wins the cascade)
 *
 * Contents:
 *   1. Brand tokens & logo sizing
 *   2. Bootstrap 3 → Bootstrap 5 compatibility shim (covers Perfex core helpers,
 *      unconverted views, and modules/hosting/views which still emit BS3 markup)
 *   3. HTTPID-specific components (auth split, 2FA banner, footer trace, noVNC)
 *   4. Dark-mode variants for the shimmed classes
 *
 * NOTE: We load the legacy Chart.js v2 AFTER dashlite bundle.js (which ships
 * Chart.js v4). window.Chart is therefore the v2 API for our own dashboard
 * charts; NioApp chart demos are not used. Do not add dashlite chart JS.
 *
 * Never edit dashlite.css — keep upgrades drop-in.
 */

/* ==========================================================================
   1. Brand tokens & logo
   ========================================================================== */

:root {
  --httpid-orange: #D67A16;
}

.nk-sidebar-brand .logo-link,
.nk-header-brand .logo-link {
  display: inline-flex;
  align-items: center;
}

.httpid-logo {
  height: 30px;
  width: auto;
  display: block;
}

.nk-sidebar-brand .httpid-logo {
  height: 34px;
}

/* Light (white) logo shown on the light sidebar uses dark text instead */
.httpid-logo-light path[fill="#FFFFFF"] { fill: #1c2b46; }
.nk-sidebar.is-dark .httpid-logo-light path[fill="#FFFFFF"],
.dark-mode .httpid-logo-light path[fill="#FFFFFF"] { fill: #ffffff; }

/* Auth brand block */
.httpid-auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding-bottom: 1.5rem;
  text-align: center;
}
.httpid-auth-brand .httpid-logo { height: 44px; }
.httpid-auth-brand .httpid-console-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: #364a63;
  margin: 0;
}
.dark-mode .httpid-auth-brand .httpid-console-title { color: #e5e9f2; }

/* Auth quote panel */
.httpid-auth-quote {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #526484;
}
.dark-mode .httpid-auth-quote { color: #b6c2e4; }
.httpid-auth-quote-author {
  display: block;
  margin-top: .75rem;
  font-size: .85rem;
  color: #8094ae;
}

/* ==========================================================================
   2. Bootstrap 3 → Bootstrap 5 compatibility shim
   ========================================================================== */

/* Panels (Perfex .panel_s > .panel-body, INSPINIA .ibox > .ibox-content) */
.panel_s {
  display: block;
  margin-bottom: 1.25rem;
}
.panel_s > .panel-body,
.ibox > .ibox-content,
.ibox-content {
  background: #fff;
  border: 1px solid #e5e9f2;
  border-radius: .5rem;
  padding: 1.25rem;
}
.ibox { margin-bottom: 1.25rem; }
.ibox > .ibox-content { display: block; }
.ibox-title {
  padding: 1rem 1.25rem 0;
  background: #fff;
  border: 1px solid #e5e9f2;
  border-bottom: 0;
  border-radius: .5rem .5rem 0;
}
.ibox-title + .ibox-content { border-radius: 0 0 .5rem .5rem; }

/* Floats */
.pull-right { float: right !important; }
.pull-left  { float: left !important; }
.pull-center { text-align: center; }

/* Labels → badges. Perfex core + admin "custom styles" inject span.label.label-*
   selectors (e.g. invoice statuses), so we match that specificity to guarantee a
   sane background while letting their custom color/border through. */
.label {
  display: inline-block;
  padding: .3em .6em;
  font-size: 75%;
  font-weight: 700;
  line-height: 1;
  border-radius: .25rem;
  color: #fff;
}
.label.label-default,
.label-default { background: #6c757d; }
.label.label-primary,
.label-primary { background: #6576ff; }
.label.label-success,
.label-success { background: #1ee0ac; }
.label.label-info,
.label-info    { background: #09c2de; }
.label.label-warning,
.label-warning { background: #f4bd0e; color: #3b2f0b; }
.label.label-danger,
.label-danger  { background: #e85347; }
.label.label-light-green,
.label-light-green { background: #1ee0ac; }

/* Buttons */
.btn-default {
  color: #364a63;
  background-color: #f5f6fa;
  border-color: #dbdfea;
}
.btn-default:hover, .btn-default:focus, .btn-default:active {
  color: #364a63;
  background-color: #e9ebf0;
  border-color: #d3d9e5;
}
.btn-xs { padding: .2rem .55rem; font-size: .72rem; line-height: 1.4; border-radius: .25rem; }

/* Modal close (BS3 .close → BS5 .btn-close visual) */
.modal-header .close,
button.close {
  background: transparent;
  border: 0;
  font-size: 1.4rem;
  line-height: 1;
  color: #526484;
  opacity: .6;
  padding: .5rem;
  margin: -.5rem -.5rem -.5rem auto;
}
.modal-header .close:hover, button.close:hover { opacity: 1; }

/* Images */
.img-responsive { max-width: 100%; height: auto; }
.img-circle { border-radius: 50%; }

/* Spacing utilities used across Perfex views */
.m-t-sm { margin-top: .75rem; }
.m-t-xs { margin-top: .25rem; }
.m-t-md { margin-top: 1.5rem; }
.m-t-25, .mtop25 { margin-top: 25px; }
.mtop5  { margin-top: 5px; }
.mtop10 { margin-top: 10px; }
.mtop15 { margin-top: 15px; }
.mtop20 { margin-top: 20px; }
.mtop30 { margin-top: 30px; }
.mbot5  { margin-bottom: 5px; }
.mbot10 { margin-bottom: 10px; }
.mbot15 { margin-bottom: 15px; }
.mbot20 { margin-bottom: 20px; }
.mbot30 { margin-bottom: 30px; }
.no-margin { margin: 0 !important; }
.p-w-md { padding: 1.5rem; }

/* Forms */
.help-block {
  display: block;
  margin-top: .25rem;
  font-size: .875em;
  color: #8094ae;
}
.has-error .form-control { border-color: #e85347; }
.has-error .help-block,
.has-error .control-label { color: #e85347; }
.checkbox, .radio { display: block; margin-top: .5rem; margin-bottom: .5rem; }
.checkbox label, .radio label { padding-left: 1.25rem; }

/* Text colors used by Perfex */
.text-green  { color: #1ee0ac !important; }
.text-navy   { color: #1c2b46 !important; }
.text-muted  { color: #8094ae !important; }

/* Horizontal rule / dividers inside BS3 content */
hr { border: 0; border-top: 1px solid #e5e9f2; opacity: 1; }

/* BS3 grid helpers occasionally present */
.row::after { content: ""; display: table; clear: both; }

/* bootstrap-select (BS3-era plugin) under BS5 */
.bootstrap-select {
  position: relative;
  display: block;
  width: 100% !important;
}
.bootstrap-select > .dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: .4375rem 1rem;
  font-size: .8125rem;
  color: #3c4d62;
  background-color: #fff;
  border: 1px solid #dbdfea;
  border-radius: .25rem;
  text-align: left;
}
.bootstrap-select > .dropdown-toggle:hover {
  background-color: #fff;
  border-color: #b6c6e3;
  color: #3c4d62;
}
.bootstrap-select > .dropdown-toggle:focus,
.bootstrap-select.open > .dropdown-toggle,
.bootstrap-select.show > .dropdown-toggle {
  outline: 0;
  border-color: #6576ff;
  box-shadow: 0 0 0 3px rgba(101,118,255,.1);
}
.bootstrap-select > .dropdown-toggle.bs-placeholder,
.bootstrap-select > .dropdown-toggle.bs-placeholder:hover,
.bootstrap-select > .dropdown-toggle.bs-placeholder:focus {
  color: #8094ae;
}
.bootstrap-select .filter-option {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}
.bootstrap-select .bs-caret::after,
.bootstrap-select .caret {
  display: inline-block;
  margin-left: .5rem;
  flex: 0 0 auto;
}

/* Outer dropdown container */
.bootstrap-select .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1050;
  display: none;
  min-width: 100%;
  padding: .375rem 0;
  margin-top: .125rem;
  border: 1px solid #e5e9f2;
  border-radius: .5rem;
  box-shadow: 0 3px 12px 1px rgba(11,16,25,.08);
  background-color: #fff;
}
.bootstrap-select.open > .dropdown-menu,
.bootstrap-select.show > .dropdown-menu,
.bootstrap-select > .dropdown-menu.show {
  display: block !important;
}

/* Inner list of options - reset BS5 display:none on nested .dropdown-menu */
.bootstrap-select .dropdown-menu.inner,
.bootstrap-select .dropdown-menu .inner {
  position: static !important;
  display: block !important;
  float: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  max-height: 260px;
  overflow-y: auto !important;
  min-width: 100% !important;
  list-style: none !important;
}
.bootstrap-select .dropdown-menu li {
  list-style: none !important;
  margin: 0;
  padding: 0;
}
.bootstrap-select .dropdown-menu li a {
  display: block;
  padding: .45rem 1rem;
  color: #526484;
  text-decoration: none;
  font-size: .8125rem;
  line-height: 1.4;
  white-space: nowrap;
}
.bootstrap-select .dropdown-menu li a:hover,
.bootstrap-select .dropdown-menu li a:focus {
  background: #f5f6fa;
  color: #364a63;
}
.bootstrap-select .dropdown-menu li.selected a,
.bootstrap-select .dropdown-menu li.active a {
  color: #6576ff;
  font-weight: 600;
}
.bootstrap-select .dropdown-menu li.disabled a {
  color: #8094ae;
  pointer-events: none;
}
.bootstrap-select .bs-searchbox {
  padding: .375rem .75rem;
}
.bootstrap-select .bs-searchbox .form-control {
  margin-bottom: 0;
  padding: .3125rem .75rem;
  font-size: .8125rem;
  border-radius: .25rem;
  border: 1px solid #dbdfea;
  background: #fff;
  color: #3c4d62;
  width: 100%;
}

/* DataTables wrapper spacing inside cards */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { padding: 0; margin-bottom: .75rem; }

/* ==========================================================================
   3. HTTPID-specific components
   ========================================================================== */

/* 2FA warning banner */
.httpid-2fa-banner { margin-top: 1.25rem; }
.httpid-2fa-banner .alert { margin-bottom: 0; }

/* Footer request-trace small block */
.httpid-trace {
  display: block;
  margin-top: .35rem;
  font-size: .68rem;
  letter-spacing: .03em;
  color: #8094ae;
  word-break: break-all;
}

/* noVNC embed container */
.vnc-embed {
  position: relative;
  height: 600px;
  background: #0b1019;
  border-radius: .5rem;
  overflow: hidden;
}
.vnc-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Invoice document: "From" block (DashLite only ships invoice-contact/desc) */
.invoice-from .invoice-contact-info .title { font-size: 1rem; margin-bottom: .5rem; }
.invoice-from ul,
.invoice-contact-info ul { list-style: none; padding: 0; margin: 0; }
.invoice-from ul li,
.invoice-contact-info ul li {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  color: #8094ae;
  font-size: .875rem;
  padding: .15rem 0;
}
.invoice-from ul li .icon,
.invoice-contact-info ul li .icon { color: #6576ff; margin-top: .15rem; flex-shrink: 0; }
.invoice-from { border-top: 1px solid #e5e9f2; padding-top: 1.25rem; }
.dark-mode .invoice-from { border-top-color: #203247; }
.invoice-notes .table { margin-bottom: 0; }
.fs-12px { font-size: 12px; }

/* alert-text (used by DashLite demo pages but not defined in dashlite.css) */
.alert-text { display: block; }
.alert-text h6 { font-size: .9375rem; font-weight: 700; margin: 0 0 .25rem; }
.alert-pro.alert-dismissible { position: relative; padding-right: 3rem; }

/* Stat tiles (billing overview + project status squares) */
.user-avatar.sq { height: 44px; width: 44px; font-size: 1.15rem; }
.user-avatar.sq .icon { line-height: 1; }
.amount {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: #364a63;
}
.dark-mode .amount { color: #e5e9f2; }
.card a .amount, a.card .amount { color: inherit; }
a.card:hover .amount, a.card:hover { text-decoration: none; }

/* Stripe Checkout button override (legacy checkout.js injects its own) */
.stripe-button-el { display: none; }

/* BS3 .hide utility (dropped with bootstrap.css; clients.js toggle-change-ticket-status
   and several template_parts still rely on it) */
.hide { display: none !important; }

/* Mobile logo inside header brand (hidden on xl+) */
.nk-header-brand .httpid-logo { height: 26px; }

/* Header page title */
.nk-header-page-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #364a63;
}
.dark-mode .nk-header-page-title { color: #e5e9f2; }

/* ==========================================================================
   5. Support ticket thread (single_ticket.php — DashLite nk-reply bubbles)
   ========================================================================== */

/* Thread container: remove the apps-messages fixed height/scroll behaviour —
   the client-area thread is a normal document flow inside a card. */
.card-inner.nk-reply { height: auto; overflow: visible; }

/* Bubble: customer = left / bg-lighter, staff = right-aligned accent border. */
.httpid-msg {
  padding: 1.25rem;
  border: 1px solid #e5e9f2;
  border-radius: .5rem;
  margin-bottom: 1rem;
  background: #f5f6fa;
}
.httpid-msg:last-child { margin-bottom: 0; }

.httpid-msg-staff {
  background: #fff;
  border-left: 3px solid #6576ff;
}
.httpid-msg-client {
  background: #f5f6fa;
  border-right: 3px solid #dbdfea;
}

/* Header row (avatar + name left, timestamp right) */
.httpid-msg .nk-reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.httpid-msg .user-card { display: flex; align-items: center; gap: .6rem; }
.httpid-msg .user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e5e9f2;
}
.httpid-msg .user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.httpid-msg .user-name { font-weight: 600; color: #364a63; }
.httpid-msg .date-time { font-size: .8125rem; color: #8094ae; white-space: nowrap; }

/* Body text + attachments */
.httpid-msg .nk-reply-entry img { max-width: 100%; height: auto; }
.httpid-msg .attach-files { margin-top: 1rem; }
.httpid-msg .attach-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.httpid-msg .attach-item > a.download {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .75rem;
  border: 1px solid #e5e9f2;
  border-radius: .375rem;
  background: #fff;
  color: #526484;
  font-size: .8125rem;
}
.httpid-msg .attach-item > a.download:hover { border-color: #6576ff; color: #6576ff; }

/* Sidebar meta list */
.httpid-ticket-meta {
  list-style: none;
  padding: 0;
  margin: 0;
}
.httpid-ticket-meta li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: .45rem 0;
  border-bottom: 1px solid #e5e9f2;
  font-size: .875rem;
}
.httpid-ticket-meta li:last-child { border-bottom: 0; }
.httpid-ticket-meta .meta-label { color: #8094ae; flex-shrink: 0; }
.httpid-ticket-meta .meta-value { color: #364a63; font-weight: 500; text-align: right; }

/* Dark-mode variants */
.dark-mode .httpid-msg {
  background: #18212d;
  border-color: #203247;
}
.dark-mode .httpid-msg-staff {
  background: #0d1a2b;
  border-left-color: #6576ff;
}
.dark-mode .httpid-msg-client {
  background: #18212d;
  border-right-color: #2c3f56;
}
.dark-mode .httpid-msg .user-name { color: #e5e9f2; }
.dark-mode .httpid-msg .date-time { color: #8094ae; }
.dark-mode .httpid-msg .attach-item > a.download {
  background: #0d1a2b;
  border-color: #203247;
  color: #b6c2e4;
}
.dark-mode .httpid-msg .attach-item > a.download:hover { border-color: #6576ff; color: #9dadee; }
.dark-mode .httpid-ticket-meta li { border-bottom-color: #203247; }
.dark-mode .httpid-ticket-meta .meta-value { color: #e5e9f2; }

/* ==========================================================================
   4. Dark-mode variants for shimmed classes
   ========================================================================== */

.dark-mode .panel_s > .panel-body,
.dark-mode .ibox > .ibox-content,
.dark-mode .ibox-content {
  background: #0d1a2b;
  border-color: #203247;
}
.dark-mode .ibox-title {
  background: #0d1a2b;
  border-color: #203247;
}
.dark-mode .btn-default {
  color: #e5e9f2;
  background-color: #18212d;
  border-color: #203247;
}
.dark-mode .btn-default:hover, .dark-mode .btn-default:focus {
  color: #fff;
  background-color: #203247;
  border-color: #2c3f56;
}
.dark-mode .bootstrap-select > .dropdown-toggle {
  color: #e5e9f2;
  background-color: #0d1a2b;
  border-color: #203247;
}
.dark-mode .bootstrap-select > .dropdown-toggle:hover {
  border-color: #2e4360;
  color: #b6c2e4;
}
.dark-mode .bootstrap-select > .dropdown-toggle:focus,
.dark-mode .bootstrap-select.open > .dropdown-toggle,
.dark-mode .bootstrap-select.show > .dropdown-toggle {
  border-color: #6576ff;
  box-shadow: 0 0 0 3px rgba(101,118,255,.2);
}
.dark-mode .bootstrap-select > .dropdown-toggle.bs-placeholder {
  color: #526484;
}
.dark-mode .bootstrap-select .dropdown-menu {
  background: #0d1a2b;
  border-color: #203247;
  box-shadow: 0 3px 12px 1px rgba(0,0,0,.3);
}
.dark-mode .bootstrap-select .dropdown-menu li a {
  color: #b6c2e4;
}
.dark-mode .bootstrap-select .dropdown-menu li a:hover,
.dark-mode .bootstrap-select .dropdown-menu li a:focus {
  background: #18212d;
  color: #fff;
}
.dark-mode .bootstrap-select .dropdown-menu li.selected a,
.dark-mode .bootstrap-select .dropdown-menu li.active a {
  background: #18212d;
  color: #6576ff;
}
.dark-mode .bootstrap-select .dropdown-menu li.disabled a {
  color: #526484;
}
.dark-mode .bootstrap-select .bs-searchbox .form-control {
  background: #111e2e;
  border-color: #203247;
  color: #b6c2e4;
}
.dark-mode hr { border-top-color: #203247; }
.dark-mode .help-block { color: #8094ae; }
.dark-mode .text-muted { color: #8094ae !important; }
