/* vhost.cz theme for PostfixAdmin 4 (Bootstrap 3); loaded via $CONF['theme_custom_css'] */

:root {
  --vh-brand: #3375a6;
  --vh-brand-2: #4b93bf;
  --vh-brand-dark: #245a82;
  --vh-bg: #f2f6f9;
  --vh-card: #ffffff;
  --vh-text: #1f2937;
  --vh-muted: #6b7280;
  --vh-line: #e5e7eb;
  --vh-surface-2: #f7fafc;
  --vh-hover: #f1f7fb;
  --vh-tint: #e9f2f8;
  --vh-row-line: #f0f1f5;
  --vh-input-bg: #ffffff;
  --vh-input-border: #d6d9e3;
  --vh-label: #374151;
  --vh-track: #eef0f5;
  --vh-link: var(--vh-brand);
  --vh-glass: rgba(255, 255, 255, .82);
  --vh-sidebar: linear-gradient(180deg, #3375a6 0%, #285f88 100%);
  --vh-radius: 14px;
  --vh-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --vh-gradient: linear-gradient(120deg, var(--vh-brand-dark) 0%, var(--vh-brand) 100%);
}

html, body {
  background: var(--vh-bg);
}
body {
  color: var(--vh-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--vh-link); }
a:hover, a:focus { color: var(--vh-brand-dark); }
h1, h2, h3, .h2 { font-weight: 650; letter-spacing: -.01em; }

/* Navbar */
.navbar-default {
  background: var(--vh-gradient);
  border: 0;
  border-radius: 0;
  box-shadow: 0 6px 20px rgba(51, 117, 166, .25);
  margin-bottom: 28px;
}
.navbar-default .navbar-brand img { height: 34px; margin-top: 8px; }
.navbar-default .navbar-nav > li > a,
.navbar-default .navbar-nav > li > a.navbar-btn,
.navbar-default .navbar-right a {
  color: rgba(255, 255, 255, .92);
  font-weight: 500;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus,
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border-radius: 10px;
}
.navbar-default .navbar-toggle { border-color: rgba(255, 255, 255, .5); }
.navbar-default .navbar-toggle .icon-bar { background: #fff; }
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus { background: rgba(255, 255, 255, .16); }
.navbar-default .navbar-collapse { border-color: rgba(255, 255, 255, .2); }

.dropdown-menu {
  border: 1px solid var(--vh-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
  padding: 6px;
}
.dropdown-menu > li > a { border-radius: 8px; padding: 7px 12px; }
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus { background: var(--vh-tint); color: var(--vh-brand-dark); }

/* Cards */
.panel, .well {
  background: var(--vh-card);
  border: 1px solid var(--vh-line);
  border-radius: var(--vh-radius);
  box-shadow: var(--vh-shadow);
}
/* clip, not hidden: hidden makes the panel a scroll container and breaks sticky table headers */
.panel { overflow: clip; }
.panel-default > .panel-heading {
  background: var(--vh-surface-2);
  border-bottom: 1px solid var(--vh-line);
  color: var(--vh-text);
  font-weight: 600;
  padding: 12px 18px;
}
.panel-footer { background: var(--vh-surface-2); border-top: 1px solid var(--vh-line); }

/* Tables */
.table { margin-bottom: 0; }
.table > thead > tr > th,
#admin_table th {
  background: var(--vh-surface-2);
  border-bottom: 1px solid var(--vh-line);
  color: var(--vh-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 10px 8px;
}
.table > tbody > tr > td {
  border-top: 1px solid var(--vh-row-line);
  padding: 9px 8px;
  vertical-align: middle;
}
.table-hover > tbody > tr:hover > td { background: var(--vh-hover); }

/* Buttons */
.btn { border-radius: 10px; font-weight: 500; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn-primary {
  background: var(--vh-gradient);
  border: 0;
  box-shadow: 0 4px 14px rgba(51, 117, 166, .3);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-primary:active:focus, .btn-primary.active {
  background: linear-gradient(120deg, #1c4767 0%, var(--vh-brand-dark) 100%);
  box-shadow: 0 6px 18px rgba(51, 117, 166, .38);
  transform: translateY(-1px);
}
.btn-default { border-color: var(--vh-line); color: var(--vh-text); }
.btn-default:hover { background: var(--vh-hover); border-color: #b5d0e3; }
.btn-danger { background: #ef4444; border-color: #ef4444; }

/* Forms */
.form-control, select, input[type="text"], input[type="password"] {
  border: 1px solid var(--vh-input-border);
  border-radius: 10px;
  box-shadow: none;
  height: 38px;
}
textarea.form-control { height: auto; }
.form-control:focus, select:focus, input:focus {
  border-color: var(--vh-brand);
  box-shadow: 0 0 0 4px rgba(51, 117, 166, .15);
  outline: 0;
}
label { color: var(--vh-label); font-weight: 600; }

/* Alerts */
.alert { border: 0; border-radius: 12px; box-shadow: var(--vh-shadow); }

/* Login */
body.page-login {
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(75, 147, 191, .35), transparent 60%),
    radial-gradient(800px 500px at 110% 10%, rgba(51, 117, 166, .35), transparent 60%),
    linear-gradient(180deg, var(--vh-tint) 0%, var(--vh-bg) 100%);
  min-height: 100vh;
}
body.page-login > .container,
div#login { max-width: 420px; padding-top: 120px; }
div#login > .h2 {
  font-size: 26px;
  margin-bottom: 18px;
  text-align: center;
}
div#login .well {
  background: var(--vh-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(23, 52, 73, .18);
  padding: 28px 28px 22px;
}
div#login .btn-lg { border-radius: 12px; padding: 10px 28px; width: 100%; }
div#login select { display: block; width: 100%; padding: 0 10px; background: var(--vh-input-bg); }

/* Quota bars */
.quota_bg { background: var(--vh-track); border: 0; border-radius: 99px; overflow: hidden; }
.quota { border-radius: 99px; }
.quota_low { background: #22c55e; }
.quota_mid { background: #f59e0b; }
.quota_high { background: #ef4444; }

/* Footer */
.footer { background: transparent; color: var(--vh-muted); }
.footer a { color: var(--vh-muted); }

/* Users menu hardcodes postbox.png instead of theme_logo */
img#login_header_logo[src$="postbox.png"] { content: url(../images/vhost-logo.svg); }

/* Left sidebar with expandable sections (Modoboa-like); only pages with the main menu have #navbar */
@media (min-width: 992px) {
  body:has(#navbar) { padding-left: 250px; }
  body:has(#navbar) > .container { width: auto; max-width: none; padding: 32px 32px 0; }
  body:has(#navbar) .footer { left: 250px; right: 0; width: auto; }
  body:has(#navbar) .footer > .container { width: auto; }

  nav.navbar:has(#navbar) {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 250px;
    margin: 0;
    background: var(--vh-sidebar);
    box-shadow: 4px 0 24px rgba(23, 52, 73, .18);
    overflow-y: auto;
    z-index: 1030;
  }
  nav.navbar:has(#navbar) > .container-fluid {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 0;
  }
  nav.navbar:has(#navbar) .navbar-header {
    float: none;
    margin: 0;
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }
  nav.navbar:has(#navbar) .navbar-brand { float: none; display: block; height: auto; margin: 0 !important; padding: 0 !important; }
  nav.navbar:has(#navbar) .navbar-brand img { height: 34px; margin: 0; }

  #navbar.navbar-collapse {
    display: flex !important;
    flex: 1;
    flex-direction: column;
    height: auto !important;
    padding: 14px 12px;
    border: 0;
  }
  #navbar > .navbar-nav { display: flex; flex: 1; flex-direction: column; float: none; margin: 0; }
  #navbar > .navbar-nav > li { float: none; }
  #navbar > .navbar-nav > li:last-child {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  #navbar > .navbar-nav > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 2px 0;
    padding: 10px 12px !important;
    background: transparent;
    border: 0;
    border-radius: 10px;
    box-shadow: none;
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    text-align: left;
    white-space: normal;
  }
  #navbar > .navbar-nav > li > a:hover,
  #navbar > .navbar-nav > li > a:focus,
  #navbar > .navbar-nav > .open > a,
  #navbar > .navbar-nav > .open > a:hover,
  #navbar > .navbar-nav > .open > a:focus {
    background: rgba(255, 255, 255, .10);
    color: #fff;
    transform: none;
  }
  #navbar .glyphicon { width: 16px; opacity: .85; }
  #navbar .caret { margin-left: auto; transition: transform .15s ease; }
  #navbar .open > a .caret { transform: rotate(180deg); }

  #navbar .dropdown-menu {
    position: static;
    float: none;
    display: none;
    min-width: 0;
    margin: 2px 0 6px;
    padding: 2px 0 2px 18px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  #navbar .open > .dropdown-menu { display: block; }
  #navbar .dropdown-menu > li > a {
    padding: 7px 12px;
    border-left: 2px solid rgba(255, 255, 255, .12);
    border-radius: 0 8px 8px 0;
    color: rgba(255, 255, 255, .65);
    font-size: 13px;
    white-space: normal;
  }
  #navbar .dropdown-menu > li > a:hover,
  #navbar .dropdown-menu > li > a:focus {
    background: rgba(255, 255, 255, .08);
    border-left-color: var(--vh-brand-2);
    color: #fff;
  }
  #navbar .dropdown-menu > li > a.vh-current {
    background: rgba(255, 255, 255, .14);
    border-left-color: #fff;
    color: #fff;
    font-weight: 600;
  }
  #navbar > .navbar-nav > li > a.vh-current { background: rgba(255, 255, 255, .16); color: #fff; }
}

/* Live filter above list tables (js/vhost.js) */
.vh-filter {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--vh-surface-2);
  border-bottom: 1px solid var(--vh-line);
}
.vh-filter-box {
  position: relative;
  flex: 1 1 260px;
  max-width: 420px;
}
.vh-filter-box > .glyphicon {
  position: absolute;
  top: 50%;
  left: 13px;
  transform: translateY(-50%);
  color: var(--vh-muted);
  pointer-events: none;
}
.vh-filter .form-control {
  width: 100%;
  height: 40px;
  padding-left: 38px;
  background: var(--vh-input-bg);
  font-size: 15px;
}
.vh-filter-count {
  color: var(--vh-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.vh-filter-empty .form-control { border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .12); }
.vh-filter-actions { display: flex; gap: 8px; margin-left: auto; }
.vh-filter-actions > .btn { float: none; margin-left: 0; border-radius: 10px !important; white-space: nowrap; }

/* Typeahead replacing the domain / admin <select> (js/vhost.js) */
/* .panel clips overflow for its rounded corners; the open list must reach past it */
.panel:has(.vh-combo) { overflow: visible; }
.panel:has(.vh-combo) > .panel-heading { border-radius: var(--vh-radius) var(--vh-radius) 0 0; }
.vh-combo { position: relative; max-width: 420px; }
.vh-combo .form-control { height: 40px; padding-right: 40px; background: var(--vh-input-bg); font-size: 15px; }
.vh-combo-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  color: var(--vh-muted);
}
.vh-combo-toggle .caret { transition: transform .15s ease; }
.vh-combo.open .vh-combo-toggle .caret { transform: rotate(180deg); }
.vh-combo-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1040;
  max-height: 340px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  background: var(--vh-card);
  border: 1px solid var(--vh-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
}
.vh-combo-list[hidden] { display: none; }
.vh-combo-list > li { padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.vh-combo-list > li.active { background: var(--vh-tint); color: var(--vh-brand-dark); }
.vh-combo-list > li[aria-selected="true"] { font-weight: 600; }
.vh-combo-list > li.vh-combo-none { color: var(--vh-muted); cursor: default; }
.vh-combo-list mark { padding: 0; background: transparent; color: var(--vh-brand); font-weight: 700; }

/* Rounded inputs and buttons must stay joined inside Bootstrap input groups */
.input-group > .form-control:first-child { border-radius: 10px 0 0 10px; }
.input-group-btn:last-child > .btn { height: 38px; border-radius: 0 10px 10px 0; }

/* Main page (main.tpl): sections sit directly in the panel without padding */
#main_menu > section { padding: 24px 28px; }
#main_menu > section + section { padding-top: 20px; border-top: 1px solid var(--vh-line); }
#main_menu > section > h2 { margin: 0 0 16px; font-size: 22px; }
#main_menu > section > h3 { margin: 20px 0 8px; font-size: 16px; }
#main_menu .input-group { max-width: 640px; }
#main_menu .input-group .form-control,
#main_menu .input-group-btn > .btn { height: 42px; }
#main_menu .table > tbody > tr > td { padding: 8px 12px; vertical-align: middle; }
#main_menu .table > tbody > tr > td:first-child { width: 240px; padding-left: 0; }
#main_menu .table > tbody > tr > td[style] { padding-top: 8px !important; color: var(--vh-muted); }
#main_menu .table > tbody > tr:first-child > td { border-top: 0; }

/* Signed-in user next to the logo and theme switch in the sidebar (js/vhost.js) */
.navbar-header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.navbar-header::before, .navbar-header::after { display: none; }
.navbar-header > .navbar-toggle { order: 3; margin-left: 8px; }
.vh-user {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
}
.vh-user:hover, .vh-user:focus { background: rgba(255, 255, 255, .3); color: #fff; text-decoration: none; }
.vh-user-name {
  flex-basis: 100%;
  margin-top: -2px;
  overflow: hidden;
  color: rgba(255, 255, 255, .7);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 991px) { .vh-user-name { display: none; } }
.navbar-nav > li:has(> .vh-theme) { display: flex; align-items: center; gap: 8px; }
.navbar-nav > li:has(> .vh-theme) > a { flex: 1; }
.vh-theme {
  flex: none;
  width: 34px;
  height: 34px;
  margin: 2px 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 10px;
  color: rgba(255, 255, 255, .85);
  font-size: 15px;
  line-height: 1;
}
.vh-theme:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* Toast notifications replacing the flash alerts */
.vh-toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
}
.vh-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--vh-card);
  border: 1px solid var(--vh-line);
  border-left: 4px solid var(--vh-brand);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .18);
  color: var(--vh-text);
  animation: vh-toast-in .18s ease-out;
}
.vh-toast-error { border-left-color: #ef4444; }
.vh-toast-ok { border-left-color: #22c55e; }
.vh-toast > .glyphicon { margin-top: 2px; color: var(--vh-brand); }
.vh-toast-error > .glyphicon { color: #ef4444; }
.vh-toast-ok > .glyphicon { color: #22c55e; }
.vh-toast-body { flex: 1; }
.vh-toast-body > div + div { margin-top: 4px; }
.vh-toast-close { padding: 0 2px; background: transparent; border: 0; color: var(--vh-muted); font-size: 20px; line-height: 1; }
.vh-toast-close:hover { color: var(--vh-text); }
.vh-toast.vh-toast-out { opacity: 0; transform: translateX(16px); transition: opacity .2s ease, transform .2s ease; }
@keyframes vh-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Password: show/hide, generator, strength meter */
.vh-pass { position: relative; display: block; }
.vh-pass > input { padding-right: 42px; }
.vh-pass-eye {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 38px;
  background: transparent;
  border: 0;
  color: var(--vh-muted);
}
.vh-pass-eye:hover { color: var(--vh-text); }
.vh-pass-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.vh-pass-tools .btn { padding: 4px 10px; font-size: 13px; }
.vh-meter { flex: 1 1 140px; display: flex; align-items: center; gap: 8px; min-width: 140px; }
.vh-meter[hidden] { display: none; }
.vh-meter-bar { flex: 1; height: 6px; overflow: hidden; background: var(--vh-track); border-radius: 99px; }
.vh-meter-bar > span { display: block; width: 0; height: 100%; border-radius: 99px; transition: width .2s ease, background .2s ease; }
.vh-meter-label { min-width: 90px; color: var(--vh-muted); font-size: 12px; }
.vh-meter-0 > span { width: 10%; background: #ef4444; }
.vh-meter-1 > span { width: 30%; background: #f97316; }
.vh-meter-2 > span { width: 55%; background: #f59e0b; }
.vh-meter-3 > span { width: 80%; background: #84cc16; }
.vh-meter-4 > span { width: 100%; background: #22c55e; }

/* Active / inactive badges instead of the yellow toggle buttons */
.vh-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid transparent;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.vh-badge:hover, .vh-badge:focus { text-decoration: none; filter: brightness(.95); }
.vh-badge > .vh-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.vh-badge-on { background: #dcfce7; border-color: #bbf7d0; color: #15803d; }
.vh-badge-off { background: var(--vh-track); border-color: var(--vh-line); color: var(--vh-muted); }

/* Sortable columns and sticky table headers */
th.vh-sortable { cursor: pointer; user-select: none; white-space: normal; line-height: 1.4; vertical-align: middle; }
th.vh-sortable:hover { color: var(--vh-text); }
th.vh-sortable::after { content: "\2195"; margin-left: 6px; opacity: .35; }
th.vh-sortable[aria-sort="ascending"]::after { content: "\2191"; opacity: 1; color: var(--vh-brand); }
th.vh-sortable[aria-sort="descending"]::after { content: "\2193"; opacity: 1; color: var(--vh-brand); }
.table > thead > tr.header > th { position: sticky; top: 0; z-index: 2; }

/* Copy address button in list cells */
.vh-copy {
  margin-left: 6px;
  padding: 2px 5px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--vh-muted);
  opacity: 0;
  transition: opacity .12s ease;
}
td:has(> .vh-copy) { white-space: nowrap; }
td:hover > .vh-copy, .vh-copy:focus-visible { opacity: 1; }
.vh-copy:hover { background: var(--vh-tint); color: var(--vh-brand); }

/* Confirmation dialog replacing window.confirm() */
.vh-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1070;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 32, .45);
  animation: vh-fade .15s ease-out;
}
.vh-modal {
  width: min(440px, 100%);
  padding: 22px 24px 18px;
  background: var(--vh-card);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .3);
  color: var(--vh-text);
}
.vh-modal h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 18px; font-weight: 650; }
.vh-modal h4 > .glyphicon { color: #ef4444; }
.vh-modal p { margin: 0 0 18px; color: var(--vh-muted); white-space: pre-line; word-break: break-word; }
.vh-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
@keyframes vh-fade { from { opacity: 0; } to { opacity: 1; } }

/* Dark theme (switch in the sidebar, stored per browser) */
html[data-theme="dark"] {
  color-scheme: dark;
  --vh-bg: #0f1720;
  --vh-card: #16212c;
  --vh-text: #e3eaf0;
  --vh-muted: #93a3b1;
  --vh-line: #263544;
  --vh-surface-2: #1a2733;
  --vh-hover: #1d2d3b;
  --vh-tint: #1f3446;
  --vh-row-line: #202e3b;
  --vh-input-bg: #101a23;
  --vh-input-border: #2e4152;
  --vh-label: #c9d4dd;
  --vh-track: #263544;
  --vh-link: #7fb3dc;
  --vh-glass: rgba(22, 33, 44, .86);
  --vh-sidebar: linear-gradient(180deg, #1f4c6e 0%, #173a55 100%);
  --vh-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}
html[data-theme="dark"] a:hover, html[data-theme="dark"] a:focus { color: #a9cdea; }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] select,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] textarea {
  background-color: var(--vh-input-bg);
  color: var(--vh-text);
}
html[data-theme="dark"] .form-control::placeholder { color: #6b7d8c; }
html[data-theme="dark"] .form-control[disabled],
html[data-theme="dark"] .form-control[readonly] { background-color: var(--vh-surface-2); }
html[data-theme="dark"] .btn-default { background: var(--vh-surface-2); border-color: var(--vh-line); color: var(--vh-text); }
html[data-theme="dark"] .btn-default:hover { background: var(--vh-hover); border-color: #3b5368; }
html[data-theme="dark"] .dropdown-menu { background: var(--vh-card); border-color: var(--vh-line); }
html[data-theme="dark"] .dropdown-menu > li > a { color: var(--vh-text); }
html[data-theme="dark"] .help-block,
html[data-theme="dark"] .text-muted { color: var(--vh-muted); }
html[data-theme="dark"] hr { border-top-color: var(--vh-line); }
html[data-theme="dark"] .table > thead > tr > th,
html[data-theme="dark"] .table > tbody > tr > td { border-color: var(--vh-row-line); }
html[data-theme="dark"] .panel-default { border-color: var(--vh-line); }
html[data-theme="dark"] .input-group-addon { background: var(--vh-surface-2); border-color: var(--vh-input-border); color: var(--vh-muted); }
html[data-theme="dark"] .alert-info { background: #13324a; color: #cfe6f7; }
html[data-theme="dark"] .alert-danger { background: #3b1a1d; color: #f6caca; }
html[data-theme="dark"] .alert-warning { background: #3a2d12; color: #f3dfb0; }
html[data-theme="dark"] .alert-success { background: #14331f; color: #c4ecd0; }
html[data-theme="dark"] .close { color: var(--vh-text); text-shadow: none; }
html[data-theme="dark"] code, html[data-theme="dark"] pre { background: var(--vh-surface-2); color: #f0b3c4; border-color: var(--vh-line); }
html[data-theme="dark"] .vh-badge-on { background: #123a24; border-color: #1d5534; color: #6ee7a0; }
html[data-theme="dark"] .searchresult { background: #5b4a12; }
html[data-theme="dark"] .quota_text { color: var(--vh-text); }
html[data-theme="dark"] body.page-login {
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(51, 117, 166, .28), transparent 60%),
    radial-gradient(800px 500px at 110% 10%, rgba(36, 90, 130, .3), transparent 60%),
    linear-gradient(180deg, #0f1a24 0%, var(--vh-bg) 100%);
}
html[data-theme="dark"] div#login .well { border-color: var(--vh-line); }

/* Read-only storage inventory; never rely on colour alone for status. */
.vh-storage-error { color: #b42318 !important; font-weight: 600; }
.vh-storage-cell { white-space: nowrap; }
.vh-storage-page { padding: 2rem; max-width: 1280px; }
@media (prefers-color-scheme: dark) { .vh-storage-error { color: #ff9b91 !important; } }
[data-theme="dark"] .vh-storage-error { color: #ff9b91 !important; }

/* Keep absolutely positioned PFA quota labels inside the scrolling content.
   A local stacking context also clips positioned icons/labels to this viewport. */
.vh-storage-table-scroll {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

/* Instance DB label beside the brand, rendered from server configuration. */
.navbar-header > .navbar-brand:has(.vh-db-badge) { display: inline-flex !important; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.navbar-brand:has(.vh-db-badge) img { width: 130px; max-width: calc(100% - 48px); height: auto !important; max-height: 34px; margin: 0 !important; }
.vh-db-badge { display: inline-block; flex: none; padding: 3px 5px; border: 1px solid rgba(255,255,255,.45); border-radius: 5px; background: rgba(255,255,255,.12); color: #fff; font-size: 10px; line-height: 1.2; font-weight: 700; letter-spacing: .3px; }

/* Transport: server name with the full LMTP value in a tooltip (hover and keyboard focus) */
.vh-transport {
  border-bottom: 1px dotted var(--vh-muted);
  cursor: help;
}
.vh-transport:focus {
  outline: 2px solid var(--vh-brand-2);
  outline-offset: 2px;
  border-radius: 2px;
}
.vh-tip {
  position: fixed;
  z-index: 2000;
  max-width: calc(100vw - 8px);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--vh-text);
  color: var(--vh-card);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--vh-shadow);
}
.vh-tip[hidden] { display: none; }
