@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ==========================================================================
   Obsidian VPS — Blesta client theme
   app/views/client/obsidianvps/css/custom.css

   Visual layer only. No markup contracts, no JS hooks, no functional CSS
   (nothing here hides or repositions form controls, buttons, or payment UI).

   LOAD ORDER (see structure.pdt <head>):
     1. css/application.min.css   — Bootstrap 4 + Blesta shell
     2. $theme_css                — admin Look & Feel theme, token-substituted
     3. THIS FILE                 — brand layer
     4. $custom_css               — admin Custom CSS field (still last word)

   Because this loads after $theme_css, equal-specificity rules win on order.
   !important is used ONLY where Blesta's generated theme.css itself uses
   !important — that is the navbar link colors. Those rules are marked below.

   Selectors target Blesta's real shell classes (.header, .nav-content,
   .title, .footer, .card-blesta, .panel-blesta). Custom DOM added by
   structure.pdt is namespaced `obvps-`, matching the convention used by the
   Guacamole branding extension.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */

:root {
    /* Surfaces */
    --obvps-bg:            #0b0812;
    --obvps-surface:       #150f1e;
    --obvps-glass:         rgba(32, 22, 48, 0.55);
    --obvps-glass-strong:  rgba(32, 22, 48, 0.78);
    --obvps-glass-subtle:  rgba(32, 22, 48, 0.30);

    /* Accent */
    --obvps-accent:        #9d5cff;
    --obvps-accent-deep:   #5a34a8;
    --obvps-accent-grad:   linear-gradient(135deg, #9d5cff 0%, #5a34a8 100%);
    --obvps-accent-wash:   rgba(157, 92, 255, 0.12);
    --obvps-accent-glow:   rgba(157, 92, 255, 0.35);

    /* Lines */
    --obvps-border:        rgba(157, 92, 255, 0.18);
    --obvps-border-strong: rgba(157, 92, 255, 0.32);

    /* Text */
    --obvps-text:          #f1edf7;
    --obvps-text-muted:    #a79bc2;

    /* Semantic — status pills, alerts, validation */
    --obvps-success:       #3ddc97;
    --obvps-warning:       #ffb454;
    --obvps-danger:        #ff5c7a;
    --obvps-info:          #5cc8ff;

    /* Type */
    --obvps-font-head:     'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --obvps-font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --obvps-font-mono:     'IBM Plex Mono', SFMono-Regular, Menlo, Consolas, monospace;

    /* Geometry */
    --obvps-radius:        14px;
    --obvps-radius-sm:     9px;
    --obvps-blur:          16px;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

html {
    background: var(--obvps-bg);
}

body {
    /* !important is load-bearing here. The admin Custom CSS field ($custom_css)
       renders as an inline <style> AFTER this file, so it wins any plain
       load-order tie. An !important declaration beats every non-important one
       regardless of selector specificity — so this single rule also beats
       higher-specificity page-scoped selectors in that block such as
       body[class^="plugin-order"] and body.client-client_login-index, PROVIDED
       none of those carry !important themselves. If any of them do, this rule
       loses on specificity and needs a matching higher-specificity companion.
       Root fix is to delete the stale light-theme rules from that admin field. */
    background: var(--obvps-bg) !important;
    background-color: var(--obvps-bg) !important;
    color: var(--obvps-text);
    font-family: var(--obvps-font-body);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
}

/* Ambient purple depth. Fixed, behind content, never interactive. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(900px 520px at 12% -8%,   rgba(157, 92, 255, 0.13), transparent 62%),
        radial-gradient(760px 460px at 92% 4%,    rgba(90,  52, 168, 0.16), transparent 60%),
        radial-gradient(1000px 620px at 50% 108%, rgba(157, 92, 255, 0.07), transparent 68%);
}

body > * {
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--obvps-font-head);
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--obvps-text);
}

p, li, dt, dd, td, th, label, span, div {
    /* inherit rather than force — avoids stomping semantic colors */
    font-family: inherit;
}

small, .small, .text-muted, .form-text, .help-block, .description {
    color: var(--obvps-text-muted) !important;
}

a, a:hover {
    /* theme.css sets `a, a:hover { color: theme_link_color }` — no !important,
       so matching specificity + later load order is enough. */
    color: var(--obvps-accent);
}

a {
    text-decoration: none;
    transition: color .18s ease;
}

a:hover, a:focus {
    color: #b98cff;
    text-decoration: none;
}

hr {
    border: 0;
    border-top: 1px solid var(--obvps-border);
    opacity: 1;
}

/* Technical labels: service IDs, hostnames, IPs, invoice numbers.
   Add class="obvps-mono" in a view to opt an element in. */
code, pre, kbd, samp, .obvps-mono {
    font-family: var(--obvps-font-mono);
    font-size: 0.88em;
    letter-spacing: -0.01em;
}

code, kbd {
    background: var(--obvps-accent-wash);
    color: #c9a8ff;
    border: 1px solid var(--obvps-border);
    border-radius: 6px;
    padding: 0.12em 0.42em;
}

pre {
    background: var(--obvps-glass);
    border: 1px solid var(--obvps-border);
    border-radius: var(--obvps-radius-sm);
    color: var(--obvps-text);
    padding: 1rem 1.1rem;
    overflow-x: auto;
}

/* --------------------------------------------------------------------------
   4. Header  (.header > .container-md > .logo | .top-nav)
   -------------------------------------------------------------------------- */

.header {
    /* theme.css paints a vendor-prefixed linear-gradient stack here; every
       one of those declarations must be overridden, hence `background`
       shorthand last-in-cascade. */
    background: var(--obvps-glass);
    background-color: var(--obvps-glass);
    backdrop-filter: blur(var(--obvps-blur));
    -webkit-backdrop-filter: blur(var(--obvps-blur));
    border-bottom: 1px solid var(--obvps-border);
    box-shadow: 0 1px 0 rgba(157, 92, 255, 0.06), 0 8px 32px rgba(0, 0, 0, 0.42);
    padding-bottom: 13px;
}

/* Blesta pins .logo to width:123px, which clips a wider wordmark. */
.header .logo {
    width: auto;
    max-width: 240px;
    margin: 14px 0 4px 15px;
    vertical-align: middle;
}

.header .logo img {
    max-width: 100%;
    height: auto;
}

/* Brand sub-label added by structure.pdt next to the logo. */
.obvps-brand__sub {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.85rem;
    padding-left: 0.85rem;
    border-left: 1px solid var(--obvps-border);
    font-family: var(--obvps-font-mono);
    font-size: 0.68rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--obvps-text-muted);
}

/* Language switcher / staff-as-client badge */
.top-nav .dropdown a.dropdown-toggle,
.top-nav .dropdown a.dropdown-toggle:hover,
.top-nav .dropdown a.dropdown-toggle:focus {
    color: var(--obvps-text-muted);
    font-family: var(--obvps-font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.top-nav .dropdown a.dropdown-toggle:hover {
    color: var(--obvps-text);
}

.header .badge, .header .label {
    background: var(--obvps-accent-wash);
    border: 1px solid var(--obvps-border-strong);
    border-top: 0;
    color: #c9a8ff;
}

.header .badge a, .header .label a {
    color: #c9a8ff;
}

/* --------------------------------------------------------------------------
   5. Primary navigation  (.nav-content > nav.navbar)

   theme.css declares navbar link colors with !important:
     .nav-content nav.navbar .navbar-nav > li > a          { color: … !important }
     .nav-content nav.navbar .navbar-nav > .active > a     { color: … !important }
     .nav-content nav.navbar .navbar-nav > li > a:hover    { color: … !important }
   The rules below mirror those selectors exactly and re-assert !important.
   This is the ONLY place in this file where !important is load-bearing.
   -------------------------------------------------------------------------- */

.nav-content nav.navbar,
.nav-content div.navbar.pagination {
    background: rgba(17, 12, 26, 0.72);
    background-color: rgba(17, 12, 26, 0.72);
    backdrop-filter: blur(var(--obvps-blur));
    -webkit-backdrop-filter: blur(var(--obvps-blur));
    border-bottom: 1px solid var(--obvps-border);
}

.nav-content .navbar {
    min-height: 42px;
    font-family: var(--obvps-font-body);
    font-size: 0.9rem;
}

.nav-content .navbar-nav > li > a.nav-link {
    padding: 10px 14px;
    border-radius: var(--obvps-radius-sm);
    font-weight: 500;
    transition: color .18s ease, background .18s ease;
}

/* Resting state — mirrors theme.css !important rule */
.nav-content nav.navbar .navbar-nav > li > a {
    color: var(--obvps-text-muted) !important;
}

/* Hover — mirrors theme.css !important rule */
.nav-content nav.navbar .navbar-nav > li > a:hover {
    color: var(--obvps-text) !important;
    background: var(--obvps-accent-wash);
}

/* Active item — mirrors theme.css !important rule */
.nav-content nav.navbar .navbar-nav > .active > a,
.nav-content nav.navbar .navbar-nav > .active > a:hover,
.nav-content nav.navbar .navbar-nav > .active > a:focus,
.nav-content nav.navbar .navbar-nav > .show > a {
    color: var(--obvps-text) !important;
    background: var(--obvps-accent-wash);
    position: relative;
}

.nav-content nav.navbar .navbar-nav > .active > a::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--obvps-accent-grad);
    box-shadow: 0 0 12px var(--obvps-accent-glow);
}

.nav-content .navbar-nav .nav-link i,
.nav-content .navbar-nav .dropdown-item i {
    opacity: 0.65;
}

.nav-content .navbar .navbar-toggler {
    border: 1px solid var(--obvps-border);
    border-radius: var(--obvps-radius-sm);
    margin: 8px 15px;
    padding: 0.35rem 0.6rem;
}

.nav-content .navbar .navbar-toggler:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--obvps-accent-wash);
}

/* Collapsed mobile menu — theme.css also !important's these. */
@media (max-width: 767.98px) {
    .nav-content nav.navbar .navbar-nav .show .dropdown-menu > a {
        color: var(--obvps-text-muted) !important;
    }

    .nav-content nav.navbar .navbar-nav .show .dropdown-menu > a:hover,
    .nav-content nav.navbar .navbar-nav .show .dropdown-menu > a:focus {
        color: var(--obvps-text) !important;
    }
}

/* --------------------------------------------------------------------------
   6. Page title strip  (.title > .container-md > h3)
   -------------------------------------------------------------------------- */

.title {
    background: transparent;
    background-color: transparent;
    height: auto;
    padding: 1.9rem 0 1.3rem;
    margin-bottom: 1.8rem;
    border-bottom: 1px solid var(--obvps-border);
}

.title h3 {
    color: var(--obvps-text);
    font-family: var(--obvps-font-head);
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 0 0 0 15px;
}

/* --------------------------------------------------------------------------
   7. Cards & panels — glass surfaces
      Blesta uses `.card.card-blesta` and legacy `.panel.panel-blesta`.
   -------------------------------------------------------------------------- */

.card,
.panel,
.well {
    background: var(--obvps-glass);
    background-color: var(--obvps-glass);
    backdrop-filter: blur(var(--obvps-blur));
    -webkit-backdrop-filter: blur(var(--obvps-blur));
    border: 1px solid var(--obvps-border);
    border-radius: var(--obvps-radius);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
    color: var(--obvps-text);
}

/* Blesta CMS plugin portal boxes — body prefix needed for specificity;
   plugins/cms's own stylesheet loads after this file, so equal-specificity
   .portal-box .card would lose the cascade tie by source order. */
body .portal-box .card {
    background-color: var(--obvps-glass);
}

body .portal-box .card:hover {
    background-color: var(--obvps-glass-strong);
}

.card-blesta > .card-header,
.panel .card-blesta > .panel-heading,
.card-header,
.panel-heading {
    background: var(--obvps-glass-subtle);
    background-color: var(--obvps-glass-subtle);
    border-bottom: 1px solid var(--obvps-border);
    color: var(--obvps-text);
    font-family: var(--obvps-font-head);
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: -0.01em;
    border-radius: var(--obvps-radius) var(--obvps-radius) 0 0;
    padding: 0.95rem 1.15rem;
}

.card-header a,
.panel-heading a {
    color: var(--obvps-text);
}

.card-footer,
.panel-footer {
    background: var(--obvps-glass-subtle);
    background-color: var(--obvps-glass-subtle);
    border-top: 1px solid var(--obvps-border);
    color: var(--obvps-text-muted);
    border-radius: 0 0 var(--obvps-radius) var(--obvps-radius);
}

.card-body,
.panel-body {
    color: var(--obvps-text);
}

/* Utility variant used inline by some views: `card bg-light` */
.card.bg-light,
.bg-light {
    background: var(--obvps-glass-subtle) !important;
    color: var(--obvps-text);
}

/* Opt-in opaque surface for dense data where blur hurts legibility. */
.obvps-solid,
.card.obvps-solid {
    background: var(--obvps-surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* Dashboard summary cards (.cards > .card-content/.card-value/.card-label) */
.cards a {
    text-decoration: none;
}

.card-value {
    font-family: var(--obvps-font-head);
    font-weight: 700;
    color: var(--obvps-text);
}

.card-label {
    font-family: var(--obvps-font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--obvps-text-muted);
}

/* --------------------------------------------------------------------------
   8. Login page  (structure.pdt renders .row.login when show_header is false)
   -------------------------------------------------------------------------- */

.row.login {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
}

.row.login h2 {
    font-family: var(--obvps-font-head);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--obvps-text);
}

.row.login h2 i {
    color: var(--obvps-accent);
    margin-right: 0.4rem;
}

.row.login h4 {
    color: var(--obvps-text-muted);
    font-family: var(--obvps-font-body);
    font-weight: 400;
    font-size: 0.95rem;
}

.row.login .panel-blesta,
.row.login .card-blesta {
    background: var(--obvps-glass-strong);
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--obvps-border);
}

/* --------------------------------------------------------------------------
   9. Buttons
   -------------------------------------------------------------------------- */

.btn {
    font-family: var(--obvps-font-body);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--obvps-radius-sm);
    padding: 0.5rem 1.15rem;
    transition: transform .12s ease, box-shadow .2s ease,
                background .2s ease, border-color .2s ease;
}

.btn:focus, .btn.focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--obvps-accent-wash);
}

.btn:active {
    transform: translateY(1px);
}

/* Primary / success / info all read as "the affirmative action" in Blesta —
   success is used for the login submit, primary for most others. */
.btn-primary,
.btn-success,
.btn-info {
    background: var(--obvps-accent-grad);
    background-color: var(--obvps-accent);
    border: 1px solid var(--obvps-border-strong);
    color: #ffffff;
}

.btn-primary:hover,
.btn-success:hover,
.btn-info:hover,
.btn-primary:focus,
.btn-success:focus,
.btn-info:focus {
    background: var(--obvps-accent-grad);
    background-color: var(--obvps-accent);
    border-color: var(--obvps-accent);
    box-shadow: 0 0 22px var(--obvps-accent-glow);
    color: #ffffff;
}

.btn-primary:disabled, .btn-primary.disabled,
.btn-success:disabled, .btn-success.disabled,
.btn-info:disabled,    .btn-info.disabled {
    background: var(--obvps-accent-deep);
    border-color: var(--obvps-border);
    opacity: 0.5;
}

.btn-secondary,
.btn-default,
.btn-light {
    background: var(--obvps-glass);
    background-color: var(--obvps-glass);
    border: 1px solid var(--obvps-border);
    color: var(--obvps-text);
}

.btn-secondary:hover,
.btn-default:hover,
.btn-light:hover {
    background: var(--obvps-accent-wash);
    border-color: var(--obvps-border-strong);
    color: var(--obvps-text);
}

.btn-outline-primary,
.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--obvps-border-strong);
    color: var(--obvps-accent);
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover {
    background: var(--obvps-accent-wash);
    border-color: var(--obvps-accent);
    color: var(--obvps-text);
}

.btn-danger {
    background: linear-gradient(135deg, #ff5c7a 0%, #a82446 100%);
    background-color: #d13a5c;
    border: 1px solid rgba(255, 92, 122, 0.35);
    color: #ffffff;
}

.btn-danger:hover {
    box-shadow: 0 0 22px rgba(255, 92, 122, 0.32);
    color: #ffffff;
}

.btn-link {
    color: var(--obvps-accent);
}

.btn-sm { font-size: 0.8rem; padding: 0.34rem 0.8rem; }
.btn-lg { font-size: 1rem;   padding: 0.7rem 1.6rem; }

/* --------------------------------------------------------------------------
   10. Forms
   -------------------------------------------------------------------------- */

label, .col-form-label {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--obvps-text-muted);
    margin-bottom: 0.35rem;
}

.form-control,
.custom-select,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="date"] {
    background: rgba(11, 8, 18, 0.62);
    background-color: rgba(11, 8, 18, 0.62);
    border: 1px solid var(--obvps-border);
    border-radius: var(--obvps-radius-sm);
    color: var(--obvps-text);
    font-family: var(--obvps-font-body);
    font-size: 0.92rem;
    padding: 0.55rem 0.85rem;
    height: auto;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.form-control:focus,
.custom-select:focus,
select:focus,
textarea:focus,
input:focus {
    background-color: rgba(11, 8, 18, 0.8);
    border-color: var(--obvps-accent);
    box-shadow: 0 0 0 3px var(--obvps-accent-wash);
    color: var(--obvps-text);
    outline: none;
}

.form-control::placeholder,
textarea::placeholder {
    color: rgba(167, 155, 194, 0.5);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: rgba(11, 8, 18, 0.38);
    color: var(--obvps-text-muted);
}

/* Native dropdown list is OS-rendered; needs explicit dark colors. */
select option {
    background: var(--obvps-surface);
    color: var(--obvps-text);
}

.input-group-text,
.input-group-addon {
    background: var(--obvps-glass);
    background-color: var(--obvps-glass);
    border: 1px solid var(--obvps-border);
    color: var(--obvps-text-muted);
    font-family: var(--obvps-font-mono);
    font-size: 0.82rem;
}

.custom-control-label::before {
    background-color: rgba(11, 8, 18, 0.62);
    border-color: var(--obvps-border);
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--obvps-accent);
    border-color: var(--obvps-accent);
}

.checkbox label,
.radio label {
    color: var(--obvps-text);
}

.invalid-feedback,
.text-danger,
.error {
    color: var(--obvps-danger) !important;
}

.is-invalid,
.form-control.error {
    border-color: var(--obvps-danger);
}

/* --------------------------------------------------------------------------
   11. Tables
   -------------------------------------------------------------------------- */

.table {
    color: var(--obvps-text);
    border-color: var(--obvps-border);
}

.table thead th {
    font-family: var(--obvps-font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--obvps-text-muted);
    background: var(--obvps-glass-subtle);
    border-bottom: 1px solid var(--obvps-border);
    border-top: 0;
    padding: 0.75rem 0.9rem;
    white-space: nowrap;
}

.table td,
.table th {
    border-top: 1px solid rgba(157, 92, 255, 0.09);
    padding: 0.8rem 0.9rem;
    vertical-align: middle;
    color: var(--obvps-text);
}

.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th,
.table-hover tbody tr:hover {
    background-color: var(--obvps-accent-wash);
    color: var(--obvps-text);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(32, 22, 48, 0.24);
}

.table-bordered,
.table-bordered td,
.table-bordered th {
    border-color: var(--obvps-border);
}

.table-responsive {
    border-radius: var(--obvps-radius);
}

/* --------------------------------------------------------------------------
   12. Badges / status pills
       Blesta service statuses: active, pending, suspended, canceled, in_review
       Invoice statuses:        paid, unpaid, past_due, draft, voided
   -------------------------------------------------------------------------- */

.badge {
    font-family: var(--obvps-font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 0.34em 0.75em;
    border: 1px solid transparent;
}

.badge-success, .bg-success {
    background-color: rgba(61, 220, 151, 0.13) !important;
    border-color: rgba(61, 220, 151, 0.32);
    color: var(--obvps-success) !important;
}

.badge-warning, .bg-warning {
    background-color: rgba(255, 180, 84, 0.13) !important;
    border-color: rgba(255, 180, 84, 0.32);
    color: var(--obvps-warning) !important;
}

.badge-danger, .bg-danger {
    background-color: rgba(255, 92, 122, 0.13) !important;
    border-color: rgba(255, 92, 122, 0.32);
    color: var(--obvps-danger) !important;
}

.badge-info, .bg-info {
    background-color: rgba(92, 200, 255, 0.13) !important;
    border-color: rgba(92, 200, 255, 0.32);
    color: var(--obvps-info) !important;
}

.badge-secondary, .bg-secondary {
    background-color: var(--obvps-glass) !important;
    border-color: var(--obvps-border);
    color: var(--obvps-text-muted) !important;
}

.badge-primary, .bg-primary {
    background-color: var(--obvps-accent-wash) !important;
    border-color: var(--obvps-border-strong);
    color: #c9a8ff !important;
}

.text-primary { color: var(--obvps-accent) !important; }
.text-success { color: var(--obvps-success) !important; }
.text-warning { color: var(--obvps-warning) !important; }
.text-info    { color: var(--obvps-info)    !important; }

.border-primary { border-color: var(--obvps-border-strong) !important; }

/* --------------------------------------------------------------------------
   13. Alerts
   -------------------------------------------------------------------------- */

.alert {
    border-radius: var(--obvps-radius-sm);
    border: 1px solid var(--obvps-border);
    background: var(--obvps-glass);
    background-color: var(--obvps-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--obvps-text);
    font-size: 0.9rem;
    padding: 0.85rem 1.05rem;
}

.alert-success {
    border-color: rgba(61, 220, 151, 0.3);
    background-color: rgba(61, 220, 151, 0.09);
    color: var(--obvps-success);
}

.alert-warning {
    border-color: rgba(255, 180, 84, 0.3);
    background-color: rgba(255, 180, 84, 0.09);
    color: var(--obvps-warning);
}

.alert-danger, .alert-error {
    border-color: rgba(255, 92, 122, 0.3);
    background-color: rgba(255, 92, 122, 0.09);
    color: var(--obvps-danger);
}

.alert-info {
    border-color: rgba(92, 200, 255, 0.3);
    background-color: rgba(92, 200, 255, 0.09);
    color: var(--obvps-info);
}

.alert-primary, .alert-secondary {
    border-color: var(--obvps-border-strong);
    background-color: var(--obvps-accent-wash);
    color: #c9a8ff;
}

.alert a {
    color: inherit;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   14. Tabs, dropdowns, list groups, pagination
   -------------------------------------------------------------------------- */

.nav-tabs {
    border-bottom: 1px solid var(--obvps-border);
}

.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--obvps-text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--obvps-text);
    border-bottom-color: var(--obvps-border-strong);
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    background: transparent;
    color: var(--obvps-text);
    border-bottom-color: var(--obvps-accent);
}

.dropdown-menu {
    background: var(--obvps-surface);
    background-color: var(--obvps-surface);
    border: 1px solid var(--obvps-border);
    border-radius: var(--obvps-radius-sm);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
    padding: 0.35rem;
}

.dropdown-item {
    color: var(--obvps-text);
    border-radius: 6px;
    font-size: 0.89rem;
    padding: 0.5rem 0.75rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--obvps-accent-wash);
    color: var(--obvps-text);
}

.dropdown-divider {
    border-top-color: var(--obvps-border);
}

/* Secondary nav column (structure.pdt .col-md-3 > .list-group) */
.list-group-item {
    background: transparent;
    background-color: transparent;
    border-color: var(--obvps-border);
    color: var(--obvps-text);
}

.list-group-item-action:hover,
a.list-group-item:hover,
a.list-group-item:focus {
    background-color: var(--obvps-accent-wash);
    color: var(--obvps-text);
}

.list-group-item.active,
a.list-group-item.active,
a.list-group-item.active:focus {
    background-color: var(--obvps-accent-wash);
    border-color: var(--obvps-border-strong);
    color: var(--obvps-text);
}

.card-blesta > .list-group .list-group-item {
    border-color: var(--obvps-border);
}

.list-group-item h4 {
    color: var(--obvps-text);
}

.list-group-item.credits {
    background-color: var(--obvps-accent-wash);
}

.pagination .page-link,
div.pagination ul.pagination li a {
    background-color: var(--obvps-glass);
    border: 1px solid var(--obvps-border);
    color: var(--obvps-text-muted);
}

.pagination .page-link:hover {
    background-color: var(--obvps-accent-wash);
    color: var(--obvps-text);
    border-color: var(--obvps-border-strong);
}

.pagination .page-item.active .page-link,
div.pagination ul.pagination li.active .page-link,
div.pagination ul.pagination li.active a {
    background-color: var(--obvps-accent);
    border-color: var(--obvps-accent);
    color: #ffffff;
}

.pagination .page-item.disabled .page-link {
    background-color: var(--obvps-glass-subtle);
    color: rgba(167, 155, 194, 0.4);
}

/* --------------------------------------------------------------------------
   15. Modals  (#global_modal and per-view modals)
   -------------------------------------------------------------------------- */

.modal-content {
    background: var(--obvps-surface);
    background-color: var(--obvps-surface);
    border: 1px solid var(--obvps-border);
    border-radius: var(--obvps-radius);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
    color: var(--obvps-text);
}

.modal-header,
.modal-footer {
    border-color: var(--obvps-border);
}

.modal-header h5,
.modal-title,
.global_modal_title {
    font-family: var(--obvps-font-head);
    font-weight: 600;
    color: var(--obvps-text);
}

.modal-backdrop.show {
    background-color: #05030a;
    opacity: 0.72;
}

.close,
.close:hover {
    color: var(--obvps-text-muted);
    text-shadow: none;
    opacity: 0.8;
}

.close:hover {
    color: var(--obvps-text);
    opacity: 1;
}

/* --------------------------------------------------------------------------
   16. Footer  (.row.footer, restyled by structure.pdt)
   -------------------------------------------------------------------------- */

.footer {
    min-height: 60px;
    font-size: 12px;
    color: var(--obvps-text-muted);
}

.footer hr {
    border-top: 1px solid var(--obvps-border);
    margin-bottom: 1.4rem;
}

.obvps-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0 0 1.6rem;
}

.obvps-footer__legal {
    font-family: var(--obvps-font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    color: var(--obvps-text-muted);
}

.obvps-footer__links a {
    color: var(--obvps-text-muted);
    font-size: 0.78rem;
}

.obvps-footer__links a:hover {
    color: var(--obvps-accent);
}

.obvps-footer__sep {
    color: var(--obvps-border-strong);
    margin: 0 0.5rem;
}

/* --------------------------------------------------------------------------
   17. Scrollbar
   -------------------------------------------------------------------------- */

* {
    scrollbar-color: rgba(157, 92, 255, 0.35) transparent;
    scrollbar-width: thin;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
    background: rgba(157, 92, 255, 0.28);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(157, 92, 255, 0.45);
    background-clip: content-box;
}

/* --------------------------------------------------------------------------
   18. Responsive, motion, capability fallbacks
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    .obvps-brand__sub { display: none; }
    .title { padding: 1.4rem 0 1rem; margin-bottom: 1.3rem; }
    .title h3 { font-size: 1.25rem; }
    .obvps-footer__inner { flex-direction: column; align-items: flex-start; }
    .row.login { min-height: auto; padding: 2rem 0; }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* No backdrop-filter (older Firefox, some mobile): fall back to opaque. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .card, .panel, .well, .alert, .header { background-color: var(--obvps-surface); }
    .nav-content nav.navbar { background-color: #110c1a; }
}

/* Invoices and quotes get printed. Drop the dark theme entirely. */
@media print {
    body { background: #ffffff; color: #000000; }
    body::before { display: none; }
    .header, .nav-content, .title, .footer, .btn, .top-nav { display: none !important; }
    .card, .panel {
        background: #ffffff;
        border: 1px solid #cccccc;
        box-shadow: none;
        color: #000000;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .table, .table td, .table th { color: #000000; border-color: #cccccc; }
    a { color: #000000; }
}
