/* ══════════════════════════════════════════════════════════════════
   NODE ACCESS — GLOBAL DESIGN SYSTEM
   Self-hosted, no external CSS framework. Provides design tokens,
   shared components (navbar, cards, forms, tables, alerts, badges)
   and a small utility layer covering the grid/spacing/flex classes
   used across the templates.
   ══════════════════════════════════════════════════════════════════ */

:root {
    /* Colors */
    --ph-bg-base: #0B1220;
    --ph-bg-surface: #111A2C;
    --ph-bg-surface-hover: #16213A;
    --ph-bg-surface-2: #0E1626; /* mockup's --panel-2, for banded sections */
    --ph-border: #1E2A40;
    --ph-border-hover: #2C3B56;

    --ph-accent-1: #FFB020; /* Amber */
    --ph-accent-2: #FFCB66; /* Light amber */
    --ph-accent-gradient: linear-gradient(135deg, var(--ph-accent-1), var(--ph-accent-2));

    --ph-text-main: #E8EDF5;
    --ph-text-secondary: #8B98AC;
    --ph-text-muted: rgba(139, 152, 172, 0.6);

    --ph-success: #35D07F;
    --ph-success-bg: rgba(53, 208, 127, 0.1);
    --ph-danger: #FF5C5C;
    --ph-danger-bg: rgba(255, 92, 92, 0.1);
    --ph-warning: #F0A93A;
    --ph-warning-bg: rgba(240, 169, 58, 0.1);
    --ph-info: #4EA1FF;
    --ph-info-bg: rgba(78, 161, 255, 0.1);

    /* Shadows & Effects */
    --ph-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --ph-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --ph-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
    --ph-glow: 0 0 20px rgba(255, 176, 32, 0.2);
    --ph-glass-blur: blur(12px);

    /* Typography */
    --ph-font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --ph-font-heading: 'Chakra Petch', sans-serif;
    --ph-font-mono: 'IBM Plex Mono', monospace;
}

/* ── GLOBAL STYLES ── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    background: var(--ph-bg-base);
    color: var(--ph-text-main);
    font-family: var(--ph-font-family);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main { flex: 1; }

a {
    color: var(--ph-accent-1);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover { color: var(--ph-text-main); }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 {
    color: var(--ph-text-main);
    font-family: var(--ph-font-heading);
    font-weight: 600;
    line-height: 1.15;
    margin: 0;
}

/* Templates space headings/paragraphs with explicit margin utility classes
   (matches the mockup zero-margin reset) - no implicit gaps. */
p { margin: 0; }

.text-dim { color: var(--ph-text-secondary) !important; }
.text-muted { color: var(--ph-text-muted) !important; }
.text-white { color: var(--ph-text-main) !important; }
.text-dark { color: #0B1220 !important; }
.text-light { color: var(--ph-text-main) !important; }
.text-primary { color: var(--ph-accent-1) !important; }
.text-info { color: var(--ph-info) !important; }
.text-success { color: var(--ph-success) !important; }
.text-danger { color: var(--ph-danger) !important; }

.text-gradient {
    background: var(--ph-accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lead { font-size: 1.2rem; color: var(--ph-text-secondary); }
.display-1 { font-size: 4.5rem; }
.display-4 { font-size: clamp(2rem, 5vw, 2.9rem); }
.fw-bold { font-weight: 700 !important; }
small, .small { font-size: 0.85em; }
.text-uppercase { text-transform: uppercase; }
.text-decoration-none { text-decoration: none !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── LAYOUT / GRID (self-hosted, replaces Bootstrap grid) ── */
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; width: 100%; }
/* Same box the mockup uses for nav/hero/sections/footer — nav and footer
   (shared across every page via base.html) use this, not .container, so
   they line up edge-to-edge with the landing page's own content. */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Gutters use Bootstrap's padding model (padding inside columns, negative
   margin on the row) instead of flex `gap`: with `gap`, two exact-50% columns
   plus the gap exceed the row width and the second column wraps. */
.row { --gutter-x: 0rem; --gutter-y: 0rem; display: flex; flex-wrap: wrap; margin-left: calc(var(--gutter-x) / -2); margin-right: calc(var(--gutter-x) / -2); row-gap: var(--gutter-y); }
.row > * { padding-left: calc(var(--gutter-x) / 2); padding-right: calc(var(--gutter-x) / 2); }
.row.g-2 { --gutter-x: 0.5rem; --gutter-y: 0.5rem; }
.row.g-3 { --gutter-x: 1rem; --gutter-y: 1rem; }
.row.g-4 { --gutter-x: 1.5rem; --gutter-y: 1.5rem; }
.row.gy-2 { --gutter-y: 0.5rem; }

.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

/* Mobile-first: full width by default, split at md/lg breakpoints */
.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-10, .col-md-12 { flex: 0 0 100%; max-width: 100%; }
.col-lg-3, .col-lg-4, .col-lg-8, .col-lg-10 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 8.3333%; max-width: 8.3333%; }
    .col-md-2 { flex: 0 0 16.6667%; max-width: 16.6667%; }
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
    .col-md-10 { flex: 0 0 83.3333%; max-width: 83.3333%; }
    .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .col-lg-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
    .col-lg-10 { flex: 0 0 83.3333%; max-width: 83.3333%; }
}

@media (min-width: 768px) {
    .text-md-end { text-align: right; }
    .text-md-start { text-align: left; }
    .mb-lg-0 { margin-bottom: 0; }
    .mt-lg-0 { margin-top: 0; }
}

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-none { display: none; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex-grow: 1; }
.gap-1 { gap: 0.4rem; }
.gap-2 { gap: 0.6rem; }
.gap-3 { gap: 1rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }
.position-relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.rounded { border-radius: 8px; }
.rounded-pill { border-radius: 999px; }
.rounded-top { border-radius: 12px 12px 0 0; }
.shadow-sm { box-shadow: var(--ph-shadow-sm); }
.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid var(--ph-border) !important; }
.border-secondary { border-color: var(--ph-border) !important; }
.bg-transparent { background: transparent !important; }
.bg-dark { background: var(--ph-bg-surface) !important; }
.bg-white { background: var(--ph-text-main) !important; }
.img-fluid { max-width: 100%; height: auto; }
.list-unstyled { list-style: none; margin: 0; padding: 0; }

/* Spacing (Bootstrap-compatible scale: 0=.25rem steps up to 5=3rem) */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mt-auto { margin-top: auto !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-auto { margin-left: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.pb-0 { padding-bottom: 0 !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.pt-0 { padding-top: 0 !important; }
.pt-3 { padding-top: 1rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-1 { padding-top: 0.25rem !important; padding-bottom: 0.25rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
@media (min-width: 768px) { .p-md-5 { padding: 3rem !important; } }

.text-center { text-align: center; }
.text-end { text-align: right; }
.text-start { text-align: left; }

/* ── NAVBAR ── */
.ph-navbar {
    background: rgba(11, 18, 32, 0.85) !important;
    backdrop-filter: var(--ph-glass-blur);
    -webkit-backdrop-filter: var(--ph-glass-blur);
    border-bottom: 1px solid var(--ph-border);
    padding: 1rem 0;
}
.sticky-top { position: sticky; top: 0; z-index: 50; }
.navbar { display: block; }
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    font-family: var(--ph-font-heading);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    color: var(--ph-text-main) !important;
}
.navbar-brand .bars { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.navbar-brand .bars span { width: 3px; background: var(--ph-accent-1); border-radius: 1px; }
.navbar-brand .bars span:nth-child(1) { height: 6px; }
.navbar-brand .bars span:nth-child(2) { height: 10px; }
.navbar-brand .bars span:nth-child(3) { height: 13px; }
.navbar-brand .bars span:nth-child(4) { height: 16px; }
.navbar-nav { display: flex; list-style: none; margin: 0; padding: 0; gap: 28px; }
.nav-item { display: flex; align-items: center; }
.nav-link { color: var(--ph-text-secondary) !important; font-weight: 500; transition: color 0.2s; }
.nav-link:hover { color: var(--ph-text-main) !important; }
.navbar-toggler {
    display: none;
    background: transparent;
    border: 1px solid var(--ph-border);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
}
.navbar-toggler-icon {
    display: block;
    width: 20px; height: 2px;
    background: var(--ph-text-main);
    position: relative;
}
.navbar-toggler-icon::before, .navbar-toggler-icon::after {
    content: ''; position: absolute; left: 0; width: 20px; height: 2px; background: var(--ph-text-main);
}
.navbar-toggler-icon::before { top: -6px; }
.navbar-toggler-icon::after { top: 6px; }
.navbar-collapse { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
@media (max-width: 820px) {
    /* The template pins the bar to an inline height:64px, which is right for
       the closed bar but must not clip the expanded menu — hence !important. */
    .ph-navbar .wrap { flex-wrap: wrap; height: auto !important; min-height: 64px; }
    .navbar-toggler { display: inline-flex; }
    .navbar-collapse { display: none; width: 100%; flex-direction: column; align-items: stretch; margin-top: 14px; }
    .navbar-collapse.show { display: flex; }
    .navbar-nav { flex-direction: column; gap: 0; }
    .nav-link { display: block; width: 100%; padding: 10px 0; }
    .navbar-collapse .ms-auto { margin-left: 0 !important; }
}

/* ── BUTTONS ── */
.btn {
    display: inline-block;
    font-family: var(--ph-font-heading);
    font-weight: 600;
    font-size: 15px;
    padding: 13px 26px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    background: transparent;
    color: var(--ph-text-main);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
    line-height: 1.4;
}
.btn:focus-visible { outline: 2px solid var(--ph-accent-1); outline-offset: 3px; }
.btn-sm { font-size: 0.85rem; padding: 0.4rem 0.9rem; }
.btn-lg { font-size: 1.05rem; padding: 0.85rem 1.75rem; }

.btn-ph, .btn-primary, .ph-btn-primary {
    background: var(--ph-accent-1);
    color: #0B1220;
    border: none;
    font-weight: 600;
    box-shadow: var(--ph-shadow-sm);
}
.btn-ph:hover, .btn-primary:hover, .ph-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(255, 176, 32, .35);
    color: #0B1220;
}
.btn-ph:active { transform: translateY(0); }

.btn-outline-light, .btn-outline-info, .btn-outline-danger {
    border: 1px solid var(--ph-border);
    color: var(--ph-text-main);
    background: rgba(255, 255, 255, 0.03);
}
.btn-outline-light:hover, .btn-outline-info:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--ph-border-hover); color: var(--ph-text-main); }
.btn-outline-info { color: var(--ph-info); }
.btn-outline-danger { color: var(--ph-danger); }
.btn-outline-danger:hover { background: var(--ph-danger-bg); border-color: var(--ph-danger); }

.btn-success-soft { background: var(--ph-success-bg); color: var(--ph-success); border: 1px solid rgba(53, 208, 127, 0.25); }
.btn-success-soft:hover { background: rgba(53, 208, 127, 0.2); color: var(--ph-text-main); }
.btn-danger-soft { background: var(--ph-danger-bg); color: var(--ph-danger); border: 1px solid rgba(255, 92, 92, 0.25); }
.btn-danger-soft:hover { background: rgba(255, 92, 92, 0.2); color: var(--ph-text-main); }
.btn-warning-soft { background: var(--ph-warning-bg); color: var(--ph-warning); border: 1px solid rgba(240, 169, 58, 0.25); }
.btn-warning-soft:hover { background: rgba(240, 169, 58, 0.2); color: var(--ph-text-main); }
.btn-info-soft { background: var(--ph-info-bg); color: var(--ph-info); border: 1px solid rgba(78, 161, 255, 0.25); }
.btn-info-soft:hover { background: rgba(78, 161, 255, 0.2); color: var(--ph-text-main); }
.btn-ghost { border: 1px solid var(--ph-border); color: var(--ph-text-main); background: transparent; }
.btn-ghost:hover { border-color: var(--ph-border-hover); }
.btn-dark-outline { background: transparent; border: 1px solid var(--ph-border); color: var(--ph-text-secondary); }
.btn-dark-outline:hover { border-color: var(--ph-border-hover); color: var(--ph-text-main); background: rgba(255, 255, 255, 0.05); }

.btn-close {
    background: transparent;
    border: none;
    color: var(--ph-text-secondary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.btn-close:hover { color: var(--ph-text-main); }

/* ── CARDS & PANELS ── */
.card, .ph-card, .dash-card {
    background: var(--ph-bg-surface);
    border: 1px solid var(--ph-border);
    border-radius: 16px;
    box-shadow: var(--ph-shadow-sm);
    color: var(--ph-text-main);
    overflow: hidden;
}
.ph-card:hover, .proxy-card:hover { border-color: var(--ph-border-hover); }
.card-body { padding: 1.25rem; }
.card-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--ph-border); }
.card-title { font-size: 1.1rem; margin-bottom: 0.5rem; }
.card-text { color: var(--ph-text-secondary); }
.card-img-top { width: 100%; display: block; }

.dash-card-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--ph-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--ph-text-main);
}
.dash-card-body { padding: 1.25rem; }

.dark-panel {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--ph-border);
    border-radius: 12px;
    padding: 1rem;
}

/* ── DASHBOARD: stat strip ── */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
}
.stat-tile {
    background: var(--ph-bg-surface);
    border: 1px solid var(--ph-border);
    border-radius: 16px;
    box-shadow: var(--ph-shadow-sm);
    padding: 1rem 1.25rem;
}
.stat-label {
    color: var(--ph-text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.stat-value {
    color: var(--ph-text-main);
    font-weight: 600;
    font-size: 1.45rem;
    line-height: 1.2;
}
.stat-value .stat-unit { color: var(--ph-text-secondary); font-size: 0.9rem; font-weight: 500; }
.stat-sub { color: var(--ph-text-muted); font-size: 0.8rem; margin-top: 0.15rem; }

/* ── DASHBOARD: tab bar (admin tools) ── */
.dash-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.35rem 1rem 0;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--ph-border);
}
.dash-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ph-text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.65rem 0.9rem;
    cursor: pointer;
}
.dash-tab:hover { color: var(--ph-text-main); }
.dash-tab.active { color: var(--ph-accent-1); border-bottom-color: var(--ph-accent-1); }
.dash-tab-panel { display: none; }
.dash-tab-panel.show { display: block; }

.proxy-card-title {
    font-family: var(--ph-font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--ph-text-main);
}

/* ── FORMS ── */
.form-control, .form-select, .dark-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--ph-border);
    color: var(--ph-text-main);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    width: 100%;
    transition: all 0.2s ease;
}
.form-control-sm, .form-select-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
.form-control::placeholder { color: var(--ph-text-muted); }
.form-control:focus, .form-select:focus, .dark-input:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--ph-accent-1);
    box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.15);
    outline: none;
}
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%28139,152,172,0.8%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 14px 10px;
    padding-right: 2.2rem;
}
.form-select option { background: var(--ph-bg-surface); color: var(--ph-text-main); }
.form-label { display: block; color: var(--ph-text-secondary); font-weight: 500; margin-bottom: 0.4rem; font-size: 0.9rem; }
.form-text { color: var(--ph-text-muted); font-size: 0.82rem; margin-top: 0.3rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check-input { width: 16px; height: 16px; accent-color: var(--ph-accent-1); }
.form-check-label { color: var(--ph-text-secondary); font-size: 0.9rem; }

.input-group { display: flex; align-items: stretch; }
.input-group-sm .form-control, .input-group-sm .form-select { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
.input-group .form-control, .input-group .dark-input, .input-group .form-select { border-radius: 8px 0 0 8px; flex: 1 1 auto; min-width: 0; }
.input-group > .btn:last-child { border-radius: 0 8px 8px 0; flex-shrink: 0; }
.input-group-text {
    display: flex; align-items: center; padding: 0 0.9rem;
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--ph-border); border-right: none;
    color: var(--ph-text-secondary); font-size: 0.85rem; border-radius: 8px 0 0 8px;
}
.dark-ig { }

/* ── TABLES ── */
.table { width: 100%; border-collapse: collapse; color: var(--ph-text-main); }
.table-responsive { overflow-x: auto; }
.dark-table thead th, .table-light th {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--ph-border);
    color: var(--ph-text-secondary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    padding: 0.9rem 1rem;
    text-align: left;
}
.dark-table tbody tr { border-bottom: 1px solid var(--ph-border); }
.dark-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.dark-table td, .table td, .table-bordered td, .table-bordered th {
    padding: 0.9rem 1rem;
    vertical-align: middle;
    border: none;
    color: var(--ph-text-main);
}
.table-bordered td, .table-bordered th { border: 1px solid var(--ph-border); }

/* ── BADGES ── */
.badge { display: inline-block; padding: 0.35em 0.75em; border-radius: 6px; font-weight: 600; font-size: 0.78em; letter-spacing: 0.3px; }
.badge.bg-success { background: var(--ph-success-bg); color: var(--ph-success); border: 1px solid rgba(53, 208, 127, 0.25); }
.badge.bg-danger { background: var(--ph-danger-bg); color: var(--ph-danger); border: 1px solid rgba(255, 92, 92, 0.25); }
.badge.bg-warning { background: var(--ph-warning-bg); color: var(--ph-warning); border: 1px solid rgba(240, 169, 58, 0.25); }
.badge.bg-secondary { background: rgba(255, 255, 255, 0.08); color: var(--ph-text-secondary); border: 1px solid var(--ph-border); }

/* ── PROXY-SPECIFIC ── */
.proxy-label { color: var(--ph-text-secondary); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; font-weight: 600; }
.proxy-value { color: var(--ph-text-main); font-weight: 500; font-size: 1rem; font-family: var(--ph-font-mono); }

code {
    color: var(--ph-accent-1);
    background: rgba(255, 176, 32, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: var(--ph-font-mono);
}

/* ── ALERTS ── */
.alert-dark-info, .alert-info { background: var(--ph-info-bg); border: 1px solid rgba(78, 161, 255, 0.25); color: var(--ph-info); border-radius: 12px; padding: 0.75rem 1rem; }
.alert-dark-info a { color: var(--ph-info); font-weight: 700; }
.alert-dark-danger, .alert-danger { background: var(--ph-danger-bg); border: 1px solid rgba(255, 92, 92, 0.25); color: var(--ph-danger); border-radius: 12px; padding: 0.75rem 1rem; }
.alert-dark-success { background: var(--ph-success-bg); border: 1px solid rgba(53, 208, 127, 0.25); color: var(--ph-success); border-radius: 12px; padding: 0.75rem 1rem; }

/* ── BREADCRUMB ── */
.breadcrumb { display: flex; list-style: none; margin: 0; padding: 0; gap: 0.4rem; font-size: 0.9rem; }
.breadcrumb-item { color: var(--ph-text-secondary); }
.breadcrumb-item + .breadcrumb-item::before { content: '/'; margin-right: 0.4rem; color: var(--ph-text-muted); }
.breadcrumb-item.active { color: var(--ph-text-main); }

/* ── SPINNER ── */
.spinner-border {
    display: inline-block; width: 2rem; height: 2rem;
    border: 0.25em solid rgba(78, 161, 255, 0.25);
    border-right-color: var(--ph-info);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── MODAL (vanilla replacement for Bootstrap modal) ── */
.modal { position: fixed; inset: 0; z-index: 1050; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.show { display: flex; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 1049; }
.modal-dialog { position: relative; z-index: 1051; width: 100%; max-width: 520px; }
.modal-content { display: flex; flex-direction: column; max-height: 85vh; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--ph-border); }
.modal-title { font-size: 1.1rem; margin: 0; }
.modal-body { padding: 1.4rem; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 1.1rem 1.4rem; border-top: 1px solid var(--ph-border); }

/* ── COLLAPSE (vanilla replacement for Bootstrap collapse) ── */
.collapse { display: none; }
.collapse.show { display: block; }

/* ── FOOTER ── */
.ph-footer { background: var(--ph-bg-base); border-top: 1px solid var(--ph-border); color: var(--ph-text-secondary); padding: 2.5rem 0; font-size: 0.9rem; }
.ph-footer a { color: var(--ph-text-secondary); }
.ph-footer a:hover { color: var(--ph-text-main); }

/* ── HELPERS ── */
hr { border: none; border-top: 1px solid var(--ph-border); opacity: 1; margin: 1rem 0; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in-up { animation: fadeInUp 0.5s ease forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ── SEARCHABLE SELECT (vanilla replacement for Tom Select) ── */
.ss-wrap { position: relative; }
.ss-wrap select { position: absolute; opacity: 0; pointer-events: none; height: 1px; width: 1px; }
.ss-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--ph-border);
    color: var(--ph-text-main);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
}
.ss-input:focus { background: rgba(0, 0, 0, 0.4); border-color: var(--ph-accent-1); box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.15); outline: none; }
.ss-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40;
    background: var(--ph-bg-surface); border: 1px solid var(--ph-border); border-radius: 8px;
    box-shadow: var(--ph-shadow-md); max-height: 220px; overflow-y: auto; display: none;
}
.ss-dropdown.show { display: block; }
.ss-option { padding: 0.5rem 1rem; cursor: pointer; font-size: 0.9rem; }
.ss-option:hover, .ss-option.active { background: rgba(255, 176, 32, 0.1); }
.ss-option.disabled { opacity: 0.4; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
    *, .animate-fade-in-up { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}
