/* =========================================================================
   AM Hosting — custom.css (child theme of twenty-one)
   Source of truth: design system "AM Hosting".
   1. Fonts   2. Tokens   3. Base   4. Bootstrap/Twenty-One components
   ========================================================================= */

/* 1. FONTS — self-hosted (no Google Fonts: avoids sending visitor IPs to Google, GDPR) */
@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* 2. TOKENS — names match the design system */
:root {
  --bg: #0b0b0c;
  --surface-1: #121214;
  --surface-2: #18181b;
  --surface-console: #0e0e10;
  --surface-control: #1a1a1d;
  --border-subtle: #1d1d20;
  --border: #222226;
  --border-strong: #2a2a2e;
  --text-strong: #ffffff;
  --text: #e9e9ea;
  --text-muted: #a1a1a6;
  --text-subtle: #8a8a90;
  --text-faint: #5c5c62;
  --accent: #5B8CFF;
  --on-accent: #0b0b0c;
  --brand-light: #8FB0FF;
  --brand-deep: #3F6FEB;

  --font-sans: "Geist", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 56px; --space-section: 96px;
  --container: 1200px;
  --touch-min: 44px;

  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 14px; --radius-xl: 18px; --radius-full: 999px;
}

/* 3. BASE */
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  color: var(--text-strong);
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
}
h1, .h1 { letter-spacing: -0.035em; }
h2, .h2 { letter-spacing: -0.03em; }
p { color: var(--text-muted); }
a { color: var(--accent); }
a:hover, a:focus { color: var(--brand-light); text-decoration: none; }
code, kbd, pre, samp { font-family: var(--font-mono); }
hr { border-color: var(--border-subtle); }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.text-muted { color: var(--text-subtle) !important; }
.bg-white, .bg-light { background-color: var(--surface-1) !important; }
.border, .border-top, .border-bottom, .border-left, .border-right { border-color: var(--border) !important; }

/* Page area */
#main-body, .main-body { background: var(--bg); color: var(--text); }

/* 4. COMPONENTS */

/* Buttons */
.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-sm { min-height: 36px; border-radius: var(--radius-sm); }
.btn-primary, .btn-success, .btn-info {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus,
.btn-success:hover, .btn-success:focus,
.btn-info:hover, .btn-info:focus,
.btn-primary:not(:disabled):not(.disabled):active {
  background: var(--brand-light);
  border-color: var(--brand-light);
  color: var(--on-accent);
}
.btn-default, .btn-secondary, .btn-light, .btn-outline-primary, .btn-outline-secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-default:hover, .btn-secondary:hover, .btn-light:hover,
.btn-outline-primary:hover, .btn-outline-secondary:hover {
  background: var(--surface-control);
  border-color: var(--border-strong);
  color: var(--text-strong);
}
.btn-link { color: var(--accent); }

/* Cards, panels, lists */
.card, .panel, .list-group-item, .well, .jumbotron {
  background: var(--surface-1);
  border-color: var(--border);
  color: var(--text);
}
.card { border-radius: var(--radius-lg); }
.card-header, .card-footer, .panel-heading, .panel-footer {
  background: var(--surface-1);
  border-color: var(--border);
  color: var(--text-strong);
}
.card-title { color: var(--text-strong); }
.list-group-item.active {
  background: var(--surface-control);
  border-color: var(--border);
  color: var(--text-strong);
}
.list-group-item-action:hover, .list-group-item-action:focus {
  background: var(--surface-2);
  color: var(--text-strong);
}

/* Forms */
.form-control, .custom-select, select.form-control, textarea.form-control,
.input-group-text {
  background: var(--surface-console);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  min-height: var(--touch-min);
}
.form-control::placeholder { color: var(--text-faint); }
.form-control:focus, .custom-select:focus {
  background: var(--surface-console);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  color: var(--text-strong);
}
.form-control:disabled, .form-control[readonly] { background: var(--surface-2); color: var(--text-subtle); }
label, .col-form-label { color: var(--text-muted); }
.custom-control-input:checked ~ .custom-control-label::before {
  background: var(--accent);
  border-color: var(--accent);
}

/* Tables */
.table { color: var(--text); }
.table th, .table td, .table thead th { border-color: var(--border); }
.table thead th { color: var(--text-subtle); font-weight: 500; }
.table-striped tbody tr:nth-of-type(odd) { background: rgba(255, 255, 255, 0.02); }
.table-hover tbody tr:hover { background: var(--surface-2); color: var(--text-strong); }

/* Dropdowns, modals, popovers */
.dropdown-menu, .modal-content, .popover {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
}
.dropdown-item { color: var(--text-muted); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--surface-2); color: var(--text-strong); }
.dropdown-divider, .modal-header, .modal-footer { border-color: var(--border); }
.close { color: var(--text); text-shadow: none; }

/* Breadcrumb, pagination, nav tabs */
.breadcrumb { background: transparent; padding-left: 0; }
.breadcrumb-item, .breadcrumb-item a { color: var(--text-subtle); }
.breadcrumb-item.active { color: var(--text); }
.page-link { background: var(--surface-1); border-color: var(--border); color: var(--text); }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.nav-tabs { border-color: var(--border); }
.nav-tabs .nav-link { color: var(--text-muted); }
.nav-tabs .nav-link.active { background: var(--surface-1); border-color: var(--border) var(--border) var(--surface-1); color: var(--text-strong); }

/* Alerts — dark tints, readable text */
.alert { border-radius: var(--radius-md); border-width: 1px; }
.alert-info    { background: #0f1a33; border-color: #1e3466; color: #c9d8ff; }
.alert-success { background: #0e2219; border-color: #1c4a35; color: #b8ecd2; }
.alert-warning { background: #2a210d; border-color: #5a4518; color: #f5dca6; }
.alert-danger  { background: #2a1013; border-color: #5c1f26; color: #f8c4c9; }

/* Badges / labels */
.badge, .label { border-radius: var(--radius-full); font-family: var(--font-mono); font-weight: 500; }
.badge-primary { background: var(--accent); color: var(--on-accent); }

/* =========================================================================
   5. LAYOUT — header, client subnav, breadcrumb, footer
   ========================================================================= */
body.primary-bg-color { background: var(--bg); }
.amh-container { max-width: var(--container); margin: 0 auto; padding-left: var(--space-5); padding-right: var(--space-5); }

/* Header */
.amh-header { background: var(--bg); border-bottom: 1px solid var(--border-subtle); position: relative; z-index: 100; }
.amh-header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding-top: 20px; padding-bottom: 20px; }
.amh-brand { display: flex; align-items: center; gap: 14px; color: var(--text); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.amh-brand:hover, .amh-brand:focus { color: var(--text-strong); }
.amh-brand-logo { height: 44px; width: auto; display: block; }

.amh-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: var(--touch-min); height: var(--touch-min); background: transparent; border: 1px solid var(--border-strong); border-radius: var(--radius-md); color: var(--text); }
.amh-nav { width: 100%; }
.amh-nav-links { list-style: none; margin: 0; padding: var(--space-3) 0; display: flex; flex-direction: column; gap: var(--space-2); }
.amh-nav-links a { color: var(--text-muted); font-size: 15px; display: inline-flex; align-items: center; min-height: var(--touch-min); }
.amh-nav-links a:hover, .amh-nav-links a:focus { color: var(--text-strong); }
.amh-nav-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding-bottom: var(--space-3); }

@media (min-width: 992px) {
  .amh-menu-toggle { display: none; }
  .amh-nav.collapse { display: flex !important; width: auto; align-items: center; gap: 28px; }
  .amh-nav-links { flex-direction: row; gap: 28px; padding: 0; }
  .amh-nav-links a { font-size: 14px; }
  .amh-nav-actions { padding: 0; }
}

.amh-btn-outline { display: inline-flex; align-items: center; min-height: var(--touch-min); padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); color: var(--text); font-size: 14px; background: transparent; }
.amh-btn-outline:hover, .amh-btn-outline:focus { background: var(--surface-control); color: var(--text-strong); }
.amh-btn-sm { min-height: 36px; font-size: 13px; }

.amh-icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--touch-min); height: var(--touch-min); border: 1px solid var(--border-strong); border-radius: var(--radius-md); color: var(--text); }
.amh-icon-btn:hover, .amh-icon-btn:focus { background: var(--surface-control); color: var(--text-strong); }
.amh-cart-count { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent); font-family: var(--font-mono); font-size: 11px; line-height: 20px; text-align: center; }

/* Account dropdown (logged in) — reuses WHMCS secondary navbar */
.amh-account { flex-direction: row; margin: 0; }
.amh-account > li > a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--touch-min); padding: 0 16px !important; border: 1px solid var(--border-strong); border-radius: var(--radius-md); color: var(--text); font-size: 14px; }
.amh-account > li > a:hover { background: var(--surface-control); color: var(--text-strong); }
.amh-account .dropdown-menu { position: absolute; right: 0; left: auto; margin-top: var(--space-2); min-width: 220px; }

/* Client area sub-navigation */
.amh-subnav { border-top: 1px solid var(--border-subtle); background: var(--surface-1); }
.amh-subnav-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding-top: 4px; padding-bottom: 4px; }
.amh-subnav-row.navbar { padding-left: var(--space-5); padding-right: var(--space-5); }
.amh-subnav-links { flex-wrap: wrap; gap: 4px 20px; }
.amh-subnav-links > li > a { display: inline-flex; align-items: center; min-height: 40px; color: var(--text-muted); font-size: 14px; padding-right: 0 !important; }
.amh-subnav-links > li > a:hover, .amh-subnav-links > li.active > a { color: var(--text-strong); }
.amh-subnav-right { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); font-size: 13px; }
.amh-notify { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; color: var(--text-muted); background: transparent; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 13px; }
.amh-client-name { color: var(--text); }
.amh-subnav-link { color: var(--text-subtle); }
.amh-subnav-link:hover, .amh-client-name:hover { color: var(--text-strong); }
.popover .client-alerts a { color: var(--text); }
.popover-body { color: var(--text); }

/* Breadcrumb bar */
.master-breadcrumb, .amh-breadcrumb { background: transparent; border-bottom: 1px solid var(--border-subtle); }
.master-breadcrumb .breadcrumb { margin: 0; padding: 14px 0; background: transparent; font-size: 13px; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-faint); }

/* Main area spacing */
#main-body { padding-top: var(--space-7); padding-bottom: var(--space-section); }

/* Footer */
.amh-footer { border-top: 1px solid var(--border-subtle); background: var(--bg); color: var(--text-subtle); font-size: 14px; }
.amh-footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-6); padding-top: var(--space-7); padding-bottom: var(--space-6); }
.amh-footer-brand { display: flex; flex-direction: column; gap: var(--space-2); }
.amh-footer-name { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.amh-footer-logo { height: 20px; width: auto; display: block; }
.amh-copyright { margin-top: var(--space-2); color: var(--text-subtle); }
.amh-footer-cols { display: flex; flex-wrap: wrap; gap: var(--space-7); }
.amh-footer-col { display: flex; flex-direction: column; gap: 10px; }
.amh-footer-title { color: var(--text); font-weight: 500; }
.amh-footer-col a { color: var(--text-subtle); }
.amh-footer-col a:hover, .amh-footer-col a:focus { color: var(--text-strong); }
.amh-footer-locale { padding-bottom: var(--space-6); }

/* =========================================================================
   6. CLIENT AREA — alignment + Twenty-One leftovers (tiles, home cards, lists)
   ========================================================================= */
/* Align page content with header/footer */
#main-body > .container, .master-breadcrumb > .container {
  max-width: var(--container);
  padding-left: var(--space-5);
  padding-right: var(--space-5);
}

/* Stat tiles (Services / Quotes / Tickets / Invoices) */
.tiles, .tiles .row { background: transparent; }
.tiles .tile {
  background: var(--surface-1) !important;
  border: 1px solid var(--border) !important;
  color: var(--text);
}
.tiles .tile:hover { background: var(--surface-2) !important; }
.tiles .tile i { color: var(--border-strong) !important; }
.tiles .tile .stat { color: var(--text-strong) !important; font-weight: 600; }
.tiles .tile .title { color: var(--text-subtle) !important; }
.tiles .tile .highlight { background: var(--accent) !important; }

/* Home cards: no white headers, no rainbow accents */
.card-header, .client-home-cards .card .card-header,
.client-home-cards .card-header, .card .card-header.bg-white {
  background: var(--surface-1) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-strong) !important;
}
.card-header .card-title, .card-header h3, .card-header a { color: var(--text-strong); }
[class*="card-accent-"] { border-top: 1px solid var(--border) !important; }
.card-footer { background: var(--surface-1) !important; border-top: 1px solid var(--border) !important; }

/* Lists inside cards and sidebar: dark separators instead of white */
.card .list-group-item, .sidebar .list-group-item, .card-sidebar .list-group-item,
.list-group-flush > .list-group-item {
  background: var(--surface-1) !important;
  border-color: var(--border) !important;
  color: var(--text);
}
.card .list-group-item:hover, .sidebar .list-group-item:hover { background: var(--surface-2) !important; }
.sidebar .list-group-item.active { background: var(--surface-control) !important; color: var(--text-strong) !important; }
/* White lines around lists in home cards (Recent tickets / Recent news) */
.card .list-group, .client-home-cards .list-group, .client-home-cards .card .list-group {
  border-color: var(--border) !important;
}

/* =========================================================================
   7. CONTENT — quotes, announcements, knowledge base
   ========================================================================= */
blockquote, .primary-content blockquote {
  background: transparent !important;
  border-left: 2px solid var(--border-strong) !important;
  color: var(--text-muted) !important;
  padding: 4px 0 4px 18px !important;
  margin: 16px 0 20px !important;
  font-size: 15px;
  line-height: 1.7;
}
blockquote p, .primary-content blockquote p { color: var(--text-muted) !important; margin: 0; }
.primary-content .card-title a, .primary-content h1 a, .primary-content h2 a, .primary-content h3 a {
  color: var(--text-strong) !important;
  letter-spacing: -0.02em;
}
.primary-content .card-title a:hover, .primary-content h1 a:hover, .primary-content h2 a:hover, .primary-content h3 a:hover {
  color: var(--accent) !important;
}
.primary-content .card .text-muted .fa, .primary-content .card .text-muted .far, .primary-content .card .text-muted .fas { color: var(--text-faint); }

/* =========================================================================
   8. NEWS (announcements) + long-form text
   ========================================================================= */
.announcements .announcement article { background: transparent !important; border-left: 0 !important; padding: 0 !important; }
.amh-news { max-width: 820px; margin: 0 auto; }
.amh-page-head { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-7); }
.amh-page-head h1 { margin: 0; font-size: 40px; line-height: 1.1; letter-spacing: -0.03em; }
.amh-page-head p { margin: 0; font-size: 16px; color: var(--text-muted); }
.amh-news-list { display: flex; flex-direction: column; }
.amh-news-item { display: flex; flex-direction: column; gap: 10px; padding: var(--space-6) 0; border-top: 1px solid var(--border-subtle); }
.amh-news-item:last-child { border-bottom: 1px solid var(--border-subtle); }
.amh-news-date { font-family: var(--font-mono); font-size: 13px; color: var(--text-subtle); }
.amh-news-item h2 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -0.02em; }
.amh-news-item h2 a { color: var(--text-strong); }
.amh-news-item h2 a:hover { color: var(--accent); }
.amh-news-edit { margin-left: 10px; font-size: 13px; font-weight: 400; color: var(--text-subtle) !important; }
.amh-news-excerpt, .amh-news-excerpt p { color: var(--text-muted); font-size: 15px; line-height: 1.7; margin: 0; }
.amh-news-more { font-size: 14px; font-weight: 500; }
.amh-news-pagination { margin-top: var(--space-6); }
.amh-back { display: inline-block; margin-bottom: var(--space-5); font-size: 14px; color: var(--text-subtle); }
.amh-back:hover { color: var(--text-strong); }
.amh-news-single .amh-page-head { margin-bottom: var(--space-6); padding-bottom: var(--space-6); border-bottom: 1px solid var(--border-subtle); }
.amh-news-single .amh-page-head h1 { font-size: 44px; }
.amh-news-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-7); }
.amh-news-comments { margin-top: var(--space-6); }

.amh-prose { font-size: 16px; line-height: 1.75; color: var(--text); }
.amh-prose p { color: var(--text); margin: 0 0 1.1em; }
.amh-prose h2, .amh-prose h3, .amh-prose h4 { margin: 1.8em 0 0.6em; letter-spacing: -0.02em; }
.amh-prose h2 { font-size: 26px; } .amh-prose h3 { font-size: 21px; } .amh-prose h4 { font-size: 18px; }
.amh-prose ul, .amh-prose ol { margin: 0 0 1.1em; padding-left: 1.3em; color: var(--text); }
.amh-prose li { margin-bottom: 0.4em; }
.amh-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.amh-prose img { max-width: 100%; height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.amh-prose code { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1px 6px; font-size: 0.9em; color: var(--brand-light); }
.amh-prose pre { background: var(--surface-console); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); color: var(--text); overflow-x: auto; }
.amh-prose table { width: 100%; border-collapse: collapse; margin-bottom: 1.1em; }
.amh-prose th, .amh-prose td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; }
@media (max-width: 767px) {
  .amh-page-head h1, .amh-news-single .amh-page-head h1 { font-size: 30px; }
  .amh-news-item h2 { font-size: 22px; }
}

/* =========================================================================
   9. FORMS — markdown editor (tickets/replies) + file upload
   ========================================================================= */
.md-editor { background: var(--surface-console) !important; border: 1px solid var(--border-strong) !important; border-radius: var(--radius-md) !important; overflow: hidden; }
.md-editor > .md-header, .md-editor .md-header { background: var(--surface-1) !important; border-bottom: 1px solid var(--border) !important; padding: 8px !important; }
.md-editor .btn-group .btn, .md-editor .btn-default, .md-editor .md-header .btn {
  background: transparent !important; border: 1px solid var(--border-strong) !important; color: var(--text-muted) !important;
  min-height: 34px; box-shadow: none !important;
}
.md-editor .btn-group .btn:hover, .md-editor .md-header .btn:hover { background: var(--surface-control) !important; color: var(--text-strong) !important; }
.md-editor .btn-primary, .md-editor .md-header .btn-primary { background: var(--accent) !important; border-color: var(--accent) !important; color: var(--on-accent) !important; }
.md-editor > textarea, .md-editor .md-input, .md-editor .md-preview {
  background: var(--surface-console) !important; color: var(--text) !important; border: 0 !important;
  font-family: var(--font-sans); font-size: 15px; line-height: 1.6; padding: 14px 16px !important;
}
.md-editor > textarea:focus, .md-editor .md-input:focus { box-shadow: none !important; outline: none; }
.md-editor.active { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent) !important; }
.md-editor .md-footer, .md-editor > .md-footer, .markdown-editor-status, .md-editor .md-footer * {
  background: var(--surface-1) !important; color: var(--text-subtle) !important; border-top: 1px solid var(--border) !important;
}
.md-fullscreen-mode { background: var(--bg) !important; }

/* File input (Attachments) */
.custom-file-label {
  background: var(--surface-console) !important; border: 1px solid var(--border-strong) !important;
  color: var(--text-muted) !important; border-radius: var(--radius-md) !important;
  height: var(--touch-min) !important; line-height: 30px;
}
.custom-file-label::after {
  background: var(--surface-control) !important; color: var(--text) !important;
  border-left: 1px solid var(--border-strong) !important; height: calc(var(--touch-min) - 2px) !important; line-height: 30px;
}
.custom-file, .custom-file-input { height: var(--touch-min); }
.custom-file-input:focus ~ .custom-file-label { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent) !important; }
.form-text, small.text-muted { color: var(--text-subtle) !important; }
/* Editor text area: beat Twenty-One's ".md-editor > textarea.markdown-editor" (#fff !important) */
.md-editor > textarea.markdown-editor.md-input, .md-editor > .md-preview.md-preview {
  background-color: var(--surface-console) !important;
  color: var(--text) !important;
  border-top: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
}
.md-editor > textarea.markdown-editor.md-input::placeholder { color: var(--text-faint); }
/* Editor full-screen mode */
.md-editor.md-fullscreen-mode, .md-editor.md-fullscreen-mode > .md-header { background: var(--bg) !important; border: 0 !important; }
.md-editor.md-fullscreen-mode > textarea.markdown-editor.md-input,
.md-editor.md-fullscreen-mode > textarea.markdown-editor.md-input:hover,
.md-editor.md-fullscreen-mode > textarea.markdown-editor.md-input:focus,
.md-editor.md-fullscreen-mode > .md-preview.md-preview {
  background-color: var(--bg) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.md-editor .md-fullscreen-controls a { color: var(--text-subtle) !important; }
.md-editor .md-fullscreen-controls a:hover { color: var(--text-strong) !important; }

/* =========================================================================
   10. SMALL BITS — sidebar counters, pagination states
   ========================================================================= */
.sidebar .badge, .list-group-item .badge, .card .list-group-item .badge {
  background: var(--surface-control) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border-strong);
  font-weight: 500;
}
.list-group-item.active .badge { background: var(--accent) !important; color: var(--on-accent) !important; border-color: var(--accent); }
.page-link { min-height: 36px; display: inline-flex; align-items: center; }
.page-link:hover, .page-link:focus { background: var(--surface-control) !important; border-color: var(--border-strong) !important; color: var(--text-strong) !important; box-shadow: none; }
.page-item.disabled .page-link {
  background: var(--surface-1) !important;
  border-color: var(--border) !important;
  color: var(--text-faint) !important;
}
.page-item:first-child .page-link { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.page-item:last-child .page-link { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* =========================================================================
   11. DATA TABLES — lists in the client area (emails, invoices, services, tickets)
   ========================================================================= */
.table-container, .dataTables_wrapper .table-container {
  background: var(--surface-1) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
}
table.table-list, .table-list, table.dataTable { background: transparent !important; border-collapse: collapse !important; }
.table-list > thead > tr > th, table.dataTable thead th, table.dataTable thead td {
  background: var(--surface-1) !important;
  color: var(--text-subtle) !important;
  font-weight: 500;
  border-bottom: 1px solid var(--border) !important;
  border-top: 0 !important;
}
.table-list > thead > tr > th:hover { color: var(--text-strong) !important; }
.table-list > tbody > tr > td, table.dataTable tbody td {
  background: var(--surface-1) !important;
  color: var(--text) !important;
  border-top: 1px solid var(--border) !important;
}
.table-list > tbody > tr:hover > td, table.dataTable tbody tr:hover td { background: var(--surface-2) !important; }
.table-list > tbody > tr > td .text-muted, .table-list > tbody > tr > td small { color: var(--text-subtle) !important; }
.dataTables_wrapper .dataTables_filter input, .dataTables_filter input {
  background-color: var(--surface-console) !important;
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text) !important;
  min-height: var(--touch-min);
}
.dataTables_filter input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent) !important; }
.dataTables_info, .dataTables_length, .dataTables_length label { color: var(--text-muted) !important; }
/* Data tables — spacing, borders, search icon */
.table-container { padding: var(--space-4) var(--space-5) !important; }
table.table-list, table.dataTable { border: 0 !important; margin: var(--space-3) 0 !important; }
.table-list > thead > tr > th:first-child, .table-list > tbody > tr > td:first-child { border-left: 0 !important; }
.table-list > thead > tr > th:last-child, .table-list > tbody > tr > td:last-child { border-right: 0 !important; }
.dataTables_filter label, .dataTables_filter label span, .dataTables_filter label i, .dataTables_filter .input-group-text {
  background-color: transparent !important;
  border: 0 !important;
  color: var(--text-subtle) !important;
}
/* Data tables — replace Twenty-One's white search icon with our own */
.dataTables_wrapper .dataTables_filter input, .dataTables_filter input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238a8a90' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 14px center !important;
  background-size: 18px 18px !important;
  padding-left: 42px !important;
}

/* =========================================================================
   12. TICKETS — replies, attachments, status badges
   ========================================================================= */
.ticket-reply .posted-by, .ticket-reply [class*="posted-by"] {
  background: var(--surface-2) !important;
  color: var(--text-muted) !important;
  border-top: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
}
.ticket-reply .posted-by strong, .ticket-reply .posted-by a, .ticket-reply [class*="posted-by"] strong { color: var(--text-strong) !important; }
.ticket-reply.staff .posted-by, .ticket-reply.staff [class*="posted-by"] { box-shadow: inset 2px 0 0 var(--accent); }
.ticket-reply .message, .ticket-reply .message p { color: var(--text) !important; }
.ticket-reply hr, .ticket-reply .message hr { border-color: var(--border) !important; }

.ticket-reply .attachments { border-top: 1px dashed var(--border-strong) !important; background: transparent !important; }
.ticket-reply .attachments * { background-color: transparent !important; }
.ticket-reply .attachments li, .ticket-reply .attachments a,
.ticket-reply .attachments [class*="thumb"], .ticket-reply .attachments [class*="preview"] {
  border-color: var(--border-strong) !important;
  border-radius: var(--radius-md);
}
.ticket-reply .attachments [class*="thumb"], .ticket-reply .attachments [class*="preview"] { background-color: var(--surface-2) !important; }

/* Status badges: tinted, readable on dark */
.badge-info, .label-info { background: rgba(91, 140, 255, 0.16) !important; color: var(--brand-light) !important; border: 1px solid rgba(91, 140, 255, 0.35); }
.badge-success, .label-success { background: rgba(61, 220, 151, 0.12) !important; color: #8ee8bf !important; border: 1px solid rgba(61, 220, 151, 0.3); }
.badge-warning, .label-warning { background: rgba(245, 184, 61, 0.12) !important; color: #f5d08a !important; border: 1px solid rgba(245, 184, 61, 0.3); }
.badge-danger, .label-danger { background: rgba(255, 90, 90, 0.12) !important; color: #f8b4b4 !important; border: 1px solid rgba(255, 90, 90, 0.3); }
.badge-secondary, .badge-default, .label-default { background: var(--surface-control) !important; color: var(--text-muted) !important; border: 1px solid var(--border-strong); }

/* Danger button (e.g. "Closed", "Cancel service"): dark red, not a red block */
.btn-danger { background: #2a1013 !important; border: 1px solid #5c1f26 !important; color: #f8c4c9 !important; }
.btn-danger:hover, .btn-danger:focus { background: #3a1519 !important; color: #ffffff !important; }
/* Tickets — remaining white borders + requestor badges (Operator / Owner / User…) */
.ticket-reply, .ticket-reply * { border-color: var(--border) !important; }
.ticket-reply .attachments { border-top: 1px dashed var(--border-strong) !important; }
[class*="requestor-type"] {
  background: var(--surface-control) !important; color: var(--text-muted) !important;
  border: 1px solid var(--border-strong) !important; font-family: var(--font-mono); font-weight: 500;
}
.requestor-type-operator { background: rgba(91, 140, 255, 0.16) !important; color: var(--brand-light) !important; border-color: rgba(91, 140, 255, 0.35) !important; }
.requestor-type-owner { background: rgba(61, 220, 151, 0.12) !important; color: #8ee8bf !important; border-color: rgba(61, 220, 151, 0.3) !important; }

/* =========================================================================
   13. LANGUAGE / CURRENCY MODAL
   ========================================================================= */
.modal-localisation .modal-content {
  background: var(--surface-1) !important;
  background-image: none !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  overflow: hidden;
}
.modal-localisation .modal-body { background: none !important; padding: var(--space-6) !important; }
.modal-localisation .close { color: var(--text-subtle) !important; opacity: 1; font-size: 26px; }
.modal-localisation .close:hover { color: var(--text-strong) !important; }
.amh-modal-title { margin: 0 0 var(--space-3); padding: 0; font-size: 13px; font-family: var(--font-mono); font-weight: 400; color: var(--accent); }
.modal-localisation .item-selector + .amh-modal-title, .modal-localisation .row + .amh-modal-title { margin-top: var(--space-5); }
.modal-localisation .item-selector > div { margin-bottom: var(--space-3); }
.modal-localisation .item-selector .item {
  display: flex; align-items: center; justify-content: center;
  min-height: var(--touch-min); padding: 0 12px;
  background: var(--surface-console); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  color: var(--text-muted); font-size: 14px; text-align: center; text-decoration: none;
}
.modal-localisation .item-selector .item:hover { border-color: var(--text-subtle); color: var(--text-strong); }
.modal-localisation .item-selector .item.active { border-color: var(--accent); background: rgba(91, 140, 255, 0.12); color: var(--text-strong); }
.modal-localisation .modal-footer { background: var(--surface-1) !important; border-top: 1px solid var(--border) !important; padding: var(--space-4) var(--space-6) !important; gap: var(--space-2); }
.modal-backdrop.show { opacity: 0.7; }

/* =========================================================================
   14. NETWORK STATUS
   ========================================================================= */
.amh-eyebrow { font-family: var(--font-mono); font-size: 13px; color: var(--accent); }
.amh-status-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface-1); color: var(--text); font-size: 15px; text-decoration: none !important;
}
a.amh-status-banner:hover { border-color: var(--border-strong); color: var(--text-strong); }
.amh-status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.amh-status-banner.is-ok { border-color: rgba(61, 220, 151, 0.3); background: rgba(61, 220, 151, 0.06); }
.amh-status-banner.is-ok .amh-status-dot { background: #3ddc97; box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.15); }
.amh-status-banner.is-issue { border-color: rgba(255, 90, 90, 0.35); background: rgba(255, 90, 90, 0.07); }
.amh-status-banner.is-issue .amh-status-dot { background: #ff5a5a; box-shadow: 0 0 0 4px rgba(255, 90, 90, 0.15); }
.amh-status-banner.is-info .amh-status-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.15); }
.amh-status-more { margin-left: auto; font-size: 14px; color: var(--accent); }

.amh-tabs { display: flex; gap: 4px; margin: var(--space-6) 0 0; box-shadow: inset 0 -1px 0 var(--border-subtle); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.amh-tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--touch-min);
  padding: 0 14px; border-bottom: 2px solid transparent;
  color: var(--text-subtle); font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none !important;
}
.amh-tab:hover { color: var(--text-strong); }
.amh-tab.active { color: var(--text-strong); border-bottom-color: var(--accent); }
.amh-tab-count {
  font-family: var(--font-mono); font-size: 12px; line-height: 1; padding: 3px 7px;
  border: 1px solid var(--border); border-radius: var(--radius-full); color: var(--text-subtle);
}
.amh-tab.active .amh-tab-count { border-color: rgba(91, 140, 255, 0.35); color: var(--brand-light); }

.amh-issue-list { display: flex; flex-direction: column; }
.amh-issue { display: flex; flex-direction: column; gap: 10px; padding: var(--space-6) 0; border-bottom: 1px solid var(--border-subtle); }
.amh-issue-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.amh-issue-head h2 { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; color: var(--text-strong); }
.amh-issue-head .badge { flex: none; margin-top: 3px; }
.amh-issue-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--font-mono); font-size: 13px; color: var(--text-subtle); }
.amh-issue-affecting { margin: 0; font-size: 14px; color: var(--text-muted); }
.amh-issue-affecting strong { color: var(--text-strong); font-weight: 500; }
.amh-issue-you {
  align-self: flex-start; padding: 6px 12px; border-radius: var(--radius-md); font-size: 13px;
  background: rgba(245, 184, 61, 0.1); border: 1px solid rgba(245, 184, 61, 0.3); color: #f5d08a;
}
.amh-issue-body { font-size: 15px; }
.amh-issue-body > :last-child { margin-bottom: 0; }
.amh-status-empty { margin: 0; padding: var(--space-7) 0; text-align: center; color: var(--text-subtle); border-bottom: 1px solid var(--border-subtle); }
.amh-status-servers { margin-top: var(--space-7); }
@media (max-width: 575px) {
  .amh-issue-head { flex-direction: column; gap: 8px; }
  .amh-status-more { margin-left: 0; }
}

/* =========================================================================
   15. CLIENT AREA — PRODUCT DETAILS (clientareaproductdetails)
   ========================================================================= */
/* Status card (left) */
.product-details .product-status {
  overflow: hidden; border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border) !important; background: var(--surface-control) !important;
}
.product-details .product-icon {
  padding: 36px 24px !important; border-radius: 0 !important;
  background: radial-gradient(120% 90% at 50% 0%, rgba(91, 140, 255, 0.14), transparent 60%), var(--surface-1) !important;
}
.product-details .product-icon .fa-circle { color: rgba(91, 140, 255, 0.12) !important; }
.product-details .product-icon .fa-inverse { color: var(--brand-light) !important; }
.product-details .product-icon h3 { margin: 18px 0 4px; font-size: 26px !important; letter-spacing: -0.02em; color: var(--text-strong) !important; }
.product-details .product-icon h4 { margin: 0; font-size: 14px !important; font-weight: 400 !important; color: var(--text-subtle) !important; }
.product-details .product-status-text {
  padding: 10px !important; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  border-top: 1px solid var(--border); color: var(--text-muted) !important; background: transparent !important;
}
.product-details .product-status-active    { background: rgba(61, 220, 151, 0.10) !important; }
.product-details .product-status-active .product-status-text    { color: #8ee8bf !important; border-top-color: rgba(61, 220, 151, 0.3); }
.product-details .product-status-pending   { background: rgba(91, 140, 255, 0.10) !important; }
.product-details .product-status-pending .product-status-text   { color: var(--brand-light) !important; }
.product-details .product-status-suspended { background: rgba(245, 184, 61, 0.10) !important; }
.product-details .product-status-suspended .product-status-text { color: #f5d08a !important; }
.product-details .product-status-terminated,
.product-details .product-status-cancelled,
.product-details .product-status-fraud     { background: rgba(255, 90, 90, 0.08) !important; }
.product-details .product-status-terminated .product-status-text,
.product-details .product-status-cancelled .product-status-text,
.product-details .product-status-fraud .product-status-text     { color: #f8b4b4 !important; }

/* Key facts (right column): small mono labels, readable values */
.product-details .row > [class*="col-"]:last-child h4 {
  margin: 18px 0 4px !important; font-family: var(--font-mono); font-size: 12px !important; font-weight: 400 !important;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-subtle) !important;
}
.product-details .row > [class*="col-"]:last-child h4:first-child { margin-top: 4px !important; }
.product-details .row > [class*="col-"]:last-child { color: var(--text-strong); font-size: 16px; }

/* Tabs under the card (Manage / Configurable Options …) */
.nav-tabs { border-bottom: 1px solid var(--border) !important; }
.nav-tabs .nav-link { border: 1px solid transparent !important; color: var(--text-subtle) !important; border-radius: var(--radius-md) var(--radius-md) 0 0; }
.nav-tabs .nav-link:hover { color: var(--text-strong) !important; }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link {
  background: var(--surface-1) !important; color: var(--text-strong) !important;
  border-color: var(--border) var(--border) var(--surface-1) !important;
}
.product-details-tab-container, .tab-content.bg-white {
  background: var(--surface-1) !important; color: var(--text);
  border: 1px solid var(--border) !important; border-top: 0 !important;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding: var(--space-5) !important;
}

/* Alerts that carry a button (e.g. overdue invoice → Pay Invoice) */
.alert .float-right .btn, .alert .float-right.btn { margin: -6px 0 -6px var(--space-3); }

/* 15b. Fix: alert button alignment + more legible labels */
.alert:has(> .float-right) { display: flex; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: var(--space-4); }
.alert > .float-right { float: none !important; flex: none; }
.alert .float-right .btn { margin: 0 !important; display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; font-size: 13px; }
.product-details .row > [class*="col-"]:last-child h4 { font-size: 13px !important; letter-spacing: 0 !important; text-transform: none !important; }
.product-details .product-status-text { font-size: 14px; letter-spacing: 0.04em; }

/* 15c. Product details — game cover instead of icon */
.product-details .product-icon.amh-product-cover {
  position: relative; overflow: hidden; min-height: 300px;
  display: flex; flex-direction: column; justify-content: flex-end; text-align: left !important;
  padding: 24px !important;
}
.product-details .amh-product-cover-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%;
}
.product-details .amh-product-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 11, 12, 0) 35%, rgba(11, 11, 12, 0.92) 100%);
}
.product-details .amh-product-cover h3,
.product-details .amh-product-cover h4 { position: relative; z-index: 1; }
.product-details .amh-product-cover h3 { margin: 0 0 2px !important; font-size: 28px !important; }
.product-details .amh-product-cover h4 { color: var(--text-muted) !important; }

/* =========================================================================
   16. FORMS — dark inputs everywhere (register, profile, contact…)
   ========================================================================= */
input.form-control, select.form-control, textarea.form-control,
.prepend-icon .field, .custom-select {
  background-color: var(--surface-console) !important; border: 1px solid var(--border-strong) !important;
  color: var(--text-strong) !important; box-shadow: none !important;
}
input.form-control::placeholder, textarea.form-control::placeholder, .prepend-icon .field::placeholder { color: var(--text-faint) !important; }
input.form-control:focus, select.form-control:focus, textarea.form-control:focus, .prepend-icon .field:focus {
  border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.2) !important;
}
select.form-control option { background: var(--surface-1); color: var(--text); }
.prepend-icon .field-icon { color: var(--text-faint) !important; }
input.form-control:disabled, input.form-control[readonly] { opacity: .6; }

/* Browser autofill (Chrome/Edge/Safari) */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus,
select:-webkit-autofill, textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--surface-console) inset !important;
  -webkit-text-fill-color: var(--text-strong) !important; caret-color: var(--text-strong);
  transition: background-color 9999s ease-out 0s;
}

/* Phone country picker */
.iti__selected-flag, .intl-tel-input .selected-flag { background: var(--surface-control) !important; }
.iti__country-list, .intl-tel-input .country-list { background: var(--surface-1) !important; border: 1px solid var(--border) !important; color: var(--text) !important; }
.iti__country.iti__highlight, .intl-tel-input .country-list .country.highlight { background: var(--surface-control) !important; }
.iti__dial-code, .intl-tel-input .country-list .dial-code, .iti__selected-dial-code { color: var(--text-subtle) !important; }

/* Password strength bar */
.progress { background: var(--surface-control) !important; border-radius: 999px; }
