/* ═══════════════════════════════════════════════════════════════════════════
   JetRDP v2 — Dashboard Dark-Mode Design System
   Marker: JETRDP-V2   (search this tag to locate all v2-related code)
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

/* ── CSS Variables ────────────────────────────────────────────────────────── */
:root {
    /* Surfaces */
    --v2-bg: #0b0e11;
    --v2-surface-0: #11151a;
    --v2-surface-1: #161b22;
    --v2-surface-2: #1c2128;
    --v2-surface-3: #252c35;

    /* Borders */
    --v2-border: rgba(255, 255, 255, .06);
    --v2-border-hover: rgba(255, 255, 255, .12);

    /* Text */
    --v2-text-primary: #e6edf3;
    --v2-text-secondary: #8b949e;
    --v2-text-muted: #484f58;
    --v2-text-dim: #3d444d;

    /* Accent */
    --v2-accent: #58a6ff;
    --v2-accent-soft: rgba(88, 166, 255, .12);
    --v2-cyan: #0ef0ff;
    --v2-cyan-soft: rgba(14, 240, 255, .08);

    /* Semantic */
    --v2-green: #3fb950;
    --v2-green-soft: rgba(63, 185, 80, .12);
    --v2-red: #f85149;
    --v2-red-soft: rgba(248, 81, 73, .12);
    --v2-yellow: #d29922;
    --v2-yellow-soft: rgba(210, 153, 34, .12);
    --v2-orange: #f0883e;
    --v2-orange-soft: rgba(240, 136, 62, .12);
    --v2-purple: #bc8cff;
    --v2-purple-soft: rgba(188, 140, 255, .12);

    /* Radius */
    --v2-radius-sm: 6px;
    --v2-radius-md: 10px;
    --v2-radius-lg: 14px;
    --v2-radius-xl: 18px;

    /* Shadows */
    --v2-shadow-sm: 0 1px 2px rgba(0, 0, 0, .24);
    --v2-shadow-md: 0 4px 12px rgba(0, 0, 0, .32);
    --v2-shadow-lg: 0 8px 24px rgba(0, 0, 0, .40);

    /* Transitions */
    --v2-ease: cubic-bezier(.4, 0, .2, 1);
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
    background: var(--v2-bg);
    color: var(--v2-text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
}

/* ── Public Navbar ─────────────────────────────────────────────────────────── */
.pub-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 20px;
}

.pub-nav__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    background: rgba(17, 21, 26, .7);
    backdrop-filter: blur(16px);
    border: 1px solid var(--v2-border);
    border-radius: 12px;
    padding: 10px 20px;
}

.pub-nav__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.pub-nav__name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--v2-text-primary);
}

.pub-nav__name em {
    font-style: normal;
    color: var(--v2-accent);
}

.pub-nav__links {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.pub-nav__links a {
    color: var(--v2-text-secondary);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    transition: color .15s, background .15s;
}

.pub-nav__links a:hover {
    color: var(--v2-text-primary);
    background: var(--v2-surface-1);
}

.pub-nav__cta {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pub-nav__toggle {
    display: none;
    background: none;
    border: 1px solid var(--v2-border);
    border-radius: 8px;
    color: var(--v2-text-primary);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pub-nav__mobile {
    display: none;
    flex-direction: column;
    gap: 4px;
    max-width: 1200px;
    margin: 8px auto 0;
    background: var(--v2-surface-1);
    border: 1px solid var(--v2-border);
    border-radius: 12px;
    padding: 16px 20px;
}

.pub-nav__mobile a {
    color: var(--v2-text-secondary);
    text-decoration: none;
    font-size: .9rem;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background .15s, color .15s;
}

.pub-nav__mobile a:hover {
    background: var(--v2-surface-2);
    color: var(--v2-text-primary);
}

.pub-nav__mobile-cta {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--v2-border);
}

.pub-nav__mobile-cta a { flex: 1; text-align: center; }

@media (max-width: 768px) {
    .pub-nav__links,
    .pub-nav__cta {
        display: none;
    }
    .pub-nav__toggle {
        display: flex;
        margin-left: auto;
    }
    .pub-nav__mobile.open {
        display: flex;
    }
}

/* ── Public Footer ─────────────────────────────────────────────────────────── */
.pub-footer {
    border-top: 1px solid var(--v2-border);
    padding: 60px 20px 32px;
    margin-top: 80px;
}

.pub-footer__grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.pub-footer__col h4 {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--v2-text-primary);
    margin-bottom: 14px;
}

.pub-footer__col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pub-footer__col ul li { margin-bottom: 8px; }

.pub-footer__col ul li a {
    color: var(--v2-text-secondary);
    text-decoration: none;
    font-size: .84rem;
    transition: color .15s;
}

.pub-footer__col ul li a:hover {
    color: var(--v2-accent);
}

.pub-footer__bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--v2-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pub-footer__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--v2-text-primary);
    font-weight: 700;
    font-size: 1rem;
}

.pub-footer__bottom p {
    color: var(--v2-text-secondary);
    font-size: .8rem;
    margin: 0;
}

.pub-footer__social {
    display: flex;
    gap: 8px;
}

.pub-footer__social a {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--v2-surface-2);
    border: 1px solid var(--v2-border);
    color: var(--v2-accent);
    font-size: 14px;
    text-decoration: none;
    transition: background .15s;
}

.pub-footer__social a:hover {
    background: var(--v2-surface-3);
}

@media (max-width: 600px) {
    .pub-footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pub-footer__bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

/* ── Dashboard Navbar ──────────────────────────────────────────────────────── */
.v2-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(11, 14, 17, .82);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--v2-border);
}

.v2-nav__bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.v2-nav__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.v2-nav__brand img {
    height: 34px;
}

.v2-nav__brand span {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--v2-text-primary);
}

.v2-nav__brand span em {
    font-style: normal;
    color: var(--v2-cyan);
}

.v2-nav__links {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 0;
}

.v2-nav__links>a,
.v2-nav__dropdown>a {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: .8rem;
    font-weight: 500;
    color: var(--v2-text-secondary);
    text-decoration: none;
    border-radius: var(--v2-radius-sm);
    transition: color .15s, background .15s;
}

.v2-nav__links>a:hover,
.v2-nav__links>a.--active,
.v2-nav__dropdown>a:hover,
.v2-nav__dropdown.--open>a {
    color: var(--v2-text-primary);
    background: var(--v2-surface-2);
}

.v2-nav__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.v2-nav__bal,
.v2-nav__logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: .75rem;
    font-weight: 600;
    border: none;
    border-radius: var(--v2-radius-md);
    cursor: pointer;
    transition: background .18s var(--v2-ease);
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
}

.v2-nav__bal {
    background: var(--v2-surface-2);
    color: var(--v2-text-primary);
}

.v2-nav__bal:hover {
    background: var(--v2-surface-3);
    color: var(--v2-text-primary);
}

.v2-nav__logout {
    background: var(--v2-red-soft);
    color: var(--v2-red);
}

.v2-nav__logout:hover {
    background: rgba(248, 81, 73, .18);
    color: var(--v2-red);
}

/* Mobile hamburger */
.v2-nav__toggle {
    display: none;
    border: none;
    background: var(--v2-surface-2);
    color: var(--v2-text-primary);
    width: 38px;
    height: 38px;
    border-radius: var(--v2-radius-md);
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    margin-left: auto;
    transition: background .15s;
}

.v2-nav__toggle:hover {
    background: var(--v2-surface-3);
}

/* Admin dropdown (desktop) */
.v2-nav__dropdown {
    position: relative;
}

.v2-nav__dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    padding: 6px;
    background: var(--v2-surface-1);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-md);
    box-shadow: var(--v2-shadow-lg);
    z-index: 100;
    list-style: none;
    margin: 0;
}

.v2-nav__dropdown.--open .v2-nav__dropdown-menu {
    display: block;
}

.v2-nav__dropdown-menu a {
    display: block;
    padding: 7px 12px;
    font-size: .8rem;
    color: var(--v2-text-secondary);
    text-decoration: none;
    border-radius: var(--v2-radius-sm);
    transition: background .15s, color .15s;
}

.v2-nav__dropdown-menu a:hover {
    background: var(--v2-surface-2);
    color: var(--v2-text-primary);
}

/* ── Mobile overlay panel ─────────────────────────────────────────────────── */
.v2-nav__panel {
    display: none;
}

@media (max-width: 991px) {
    .v2-nav__toggle {
        display: flex;
    }

    .v2-nav__links,
    .v2-nav__right {
        display: none !important;
    }

    .v2-nav__panel {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--v2-surface-0);
        border-bottom: 1px solid var(--v2-border);
        box-shadow: var(--v2-shadow-lg);
        padding: 0 20px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height .35s var(--v2-ease),
                    opacity .25s var(--v2-ease),
                    padding .35s var(--v2-ease);
    }

    .v2-nav__panel.--open {
        max-height: 80vh;
        overflow-y: auto;
        opacity: 1;
        padding: 16px 20px 20px;
    }

    .v2-nav__panel-links {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .v2-nav__panel-links > a {
        display: flex;
        align-items: center;
        padding: 12px 14px;
        font-size: .9rem;
        font-weight: 500;
        color: var(--v2-text-secondary);
        text-decoration: none;
        border-radius: var(--v2-radius-md);
        transition: background .15s, color .15s;
    }

    .v2-nav__panel-links > a:hover,
    .v2-nav__panel-links > a.--active {
        background: var(--v2-surface-2);
        color: var(--v2-text-primary);
    }

    .v2-nav__panel-section {
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid var(--v2-border);
    }

    .v2-nav__panel-heading {
        padding: 8px 14px 4px;
        font-size: .68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .08em;
        color: var(--v2-text-muted);
    }

    .v2-nav__panel-section > a {
        display: flex;
        align-items: center;
        padding: 10px 14px;
        font-size: .84rem;
        font-weight: 500;
        color: var(--v2-text-secondary);
        text-decoration: none;
        border-radius: var(--v2-radius-md);
        transition: background .15s, color .15s;
    }

    .v2-nav__panel-section > a:hover {
        background: var(--v2-surface-2);
        color: var(--v2-text-primary);
    }

    .v2-nav__panel-bottom {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        padding-top: 16px;
        border-top: 1px solid var(--v2-border);
    }

    .v2-nav__panel-bottom .v2-nav__bal,
    .v2-nav__panel-bottom .v2-nav__logout {
        flex: 1;
        justify-content: center;
        padding: 10px 14px;
        font-size: .82rem;
    }
}

/* ── Base Reset ───────────────────────────────────────────────────────────── */
.v2-page {
    background: var(--v2-bg);
    color: var(--v2-text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

.v2-page *,
.v2-page *::before,
.v2-page *::after {
    box-sizing: border-box;
}

/* ── Layout Container ─────────────────────────────────────────────────────── */
.v2-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.v2-main {
    padding-top: 32px;
    padding-bottom: 64px;
}

/* ── Breadcrumb ───────────────────────────────────────────────────────────── */
.v2-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .8rem;
    color: var(--v2-text-muted);
    margin-bottom: 24px;
}

.v2-breadcrumb a {
    color: var(--v2-text-secondary);
    text-decoration: none;
    transition: color .2s var(--v2-ease);
}

.v2-breadcrumb a:hover {
    color: var(--v2-text-primary);
}

.v2-breadcrumb .sep {
    color: var(--v2-text-dim);
    user-select: none;
}

.v2-breadcrumb .current {
    color: var(--v2-text-primary);
    font-weight: 500;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.v2-card {
    background: var(--v2-surface-1);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-lg);
    padding: 24px;
    box-shadow: var(--v2-shadow-sm);
    transition: border-color .2s var(--v2-ease), box-shadow .2s var(--v2-ease);
}

.v2-card:hover {
    border-color: var(--v2-border-hover);
}

.v2-card--flush {
    padding: 0;
}

/* ── Section Title ────────────────────────────────────────────────────────── */
.v2-section-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--v2-text-primary);
    margin-bottom: 16px;
}

/* ── Hero Header ──────────────────────────────────────────────────────────── */
.v2-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.v2-hero__info {
    flex: 1;
    min-width: 220px;
}

.v2-hero__title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.v2-hero__name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--v2-text-primary);
    margin: 0;
    letter-spacing: -.01em;
}

.v2-hero__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.v2-hero__meta-pkg {
    font-size: .82rem;
    font-weight: 500;
    color: var(--v2-text-secondary);
}

.v2-hero__meta-sep {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--v2-text-muted);
    flex-shrink: 0;
}

.v2-hero__meta-id {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: .78rem;
    color: var(--v2-text-secondary);
}

.v2-hero__meta-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: var(--v2-radius-sm);
    background: var(--v2-surface-2);
    color: var(--v2-text-secondary);
    font-size: .68rem;
    cursor: pointer;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}

.v2-hero__meta-copy-btn:hover {
    background: var(--v2-cyan-soft);
    color: var(--v2-cyan);
}

.v2-hero__meta-copy-btn.copied {
    background: var(--v2-green-soft);
    color: var(--v2-green);
}

/* ── Status Badge ─────────────────────────────────────────────────────────── */
.v2-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
    padding: 4px 12px;
    border-radius: 999px;
}
.v2-status--running  { background: var(--v2-green-soft);  color: var(--v2-green); }
.v2-status--stopped  { background: var(--v2-red-soft);    color: var(--v2-red); }
.v2-status--stopping { background: var(--v2-yellow-soft); color: var(--v2-yellow); }
.v2-status--starting,
.v2-status--creating,
.v2-status--installing { background: var(--v2-accent-soft); color: var(--v2-accent); }
.v2-status--preorder,
.v2-status--deleted,
.v2-status--shutdown { background: var(--v2-surface-3); color: var(--v2-text-secondary); }
.v2-status--error    { background: var(--v2-red-soft);  color: var(--v2-red); }
.v2-status--suspended { background: var(--v2-orange-soft); color: var(--v2-orange); }

.v2-status .v2-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: v2pulse 2s ease-in-out infinite;
}

@keyframes v2pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .35;
    }
}

/* ── Power Action Buttons ─────────────────────────────────────────────────── */
.v2-hero__actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.v2-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: .8rem;
    font-weight: 600;
    border: none;
    border-radius: var(--v2-radius-md);
    cursor: pointer;
    transition: filter .18s var(--v2-ease), transform .1s;
    line-height: 1.4;
    white-space: nowrap;
    font-family: inherit;
    text-decoration: none;
}

.v2-btn:active {
    transform: scale(.97);
}

.v2-btn i {
    font-size: .78rem;
}

.v2-btn--start {
    background: var(--v2-green);
    color: #fff;
}

.v2-btn--start:hover {
    filter: brightness(1.15);
    color: #fff;
}

.v2-btn--stop {
    background: var(--v2-red);
    color: #fff;
}

.v2-btn--stop:hover {
    filter: brightness(1.15);
    color: #fff;
}

.v2-btn--restart {
    background: linear-gradient(135deg, var(--v2-accent), var(--v2-cyan));
    color: #fff;
}

.v2-btn--restart:hover {
    filter: brightness(1.1);
    color: #fff;
}

.v2-btn--primary {
    background: var(--v2-accent);
    color: #fff;
}

.v2-btn--primary:hover {
    filter: brightness(1.12);
    color: #fff;
}

.v2-btn--secondary {
    background: var(--v2-surface-3);
    color: var(--v2-text-secondary);
    border: 1px solid var(--v2-border);
}

.v2-btn--secondary:hover {
    background: var(--v2-surface-2);
    color: var(--v2-text-primary);
    border-color: var(--v2-border-hover);
}

.v2-btn--danger {
    background: var(--v2-red-soft);
    color: var(--v2-red);
    border: 1px solid rgba(248, 81, 73, .2);
}

.v2-btn--danger:hover {
    background: rgba(248, 81, 73, .18);
}

.v2-btn--sm {
    padding: 6px 14px;
    font-size: .75rem;
}

.v2-btn--block {
    width: 100%;
    justify-content: center;
}

/* ── Grid ─────────────────────────────────────────────────────────────────── */
.v2-grid {
    display: grid;
    gap: 16px;
}

.v2-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.v2-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 992px) {
    .v2-grid--3 {
        grid-template-columns: 1fr;
    }

    .v2-grid--2 {
        grid-template-columns: 1fr;
    }
}

/* ── Config Grid ──────────────────────────────────────────────────────────── */
.v2-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}

.v2-config-cell__label {
    font-size: .7rem;
    color: var(--v2-text-secondary);
    margin-bottom: 2px;
}

.v2-config-cell__value {
    font-size: .88rem;
    font-weight: 600;
    color: var(--v2-text-primary);
}

/* ── Access Rows ──────────────────────────────────────────────────────────── */
.v2-access-list {
    display: flex;
    flex-direction: column;
}

.v2-access-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--v2-border);
}

.v2-access-row:last-child {
    border-bottom: none;
}

.v2-access-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--v2-text-dim);
    margin-bottom: 2px;
}

.v2-access-value {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: .85rem;
    color: var(--v2-text-primary);
    word-break: break-all;
}

.v2-access-value .masked {
    color: var(--v2-text-dim);
}

.v2-access-value .plain {
    display: none;
}

.v2-access-value .plain.visible {
    display: inline;
}

.v2-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: var(--v2-radius-sm);
    background: var(--v2-surface-2);
    color: var(--v2-text-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}

.v2-icon-btn:hover {
    background: var(--v2-cyan-soft);
    color: var(--v2-cyan);
}

.v2-icon-btn.copied {
    background: var(--v2-green-soft);
    color: var(--v2-green);
}

/* ── Billing Rows ─────────────────────────────────────────────────────────── */
.v2-billing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--v2-border);
    font-size: .85rem;
}

.v2-billing-row:last-of-type {
    border-bottom: none;
}

.v2-billing-label {
    color: var(--v2-text-secondary);
}

.v2-billing-value {
    color: var(--v2-text-primary);
    font-weight: 600;
}

.v2-billing-value.--danger {
    color: var(--v2-red);
}

/* ── Live Metrics ─────────────────────────────────────────────────────────── */
.v2-metric {
    margin-bottom: 20px;
}

.v2-metric:last-child {
    margin-bottom: 0;
}

.v2-metric__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.v2-metric__name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--v2-text-primary);
}

.v2-metric__name .ic {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .62rem;
}

.v2-metric__val {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: .75rem;
    color: var(--v2-text-secondary);
}

.v2-metric__track {
    height: 6px;
    border-radius: 99px;
    background: var(--v2-surface-3);
    overflow: hidden;
}

.v2-metric__fill {
    height: 100%;
    border-radius: 99px;
    transition: width .8s var(--v2-ease);
    width: 0%;
}

.v2-metric__timestamp {
    font-size: .68rem;
    color: var(--v2-text-dim);
}

/* ── Warning Banner ───────────────────────────────────────────────────────── */
.v2-warn {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--v2-radius-md);
    font-size: .82rem;
    line-height: 1.5;
}

.v2-warn i {
    margin-top: 2px;
    flex-shrink: 0;
}

.v2-warn--danger {
    background: var(--v2-red-soft);
    border: 1px solid rgba(248, 81, 73, .16);
    color: #fca5a5;
}

.v2-warn--danger i {
    color: var(--v2-red);
}

/* ── Input ─────────────────────────────────────────────────────────────── */
.v2-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: .84rem;
    font-family: inherit;
    color: var(--v2-text-primary);
    background: var(--v2-surface-0);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-md);
    transition: border-color .2s, box-shadow .2s;
}

.v2-input:focus {
    outline: none;
    border-color: var(--v2-accent);
    box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

/* ── Select ───────────────────────────────────────────────────────────────── */
.v2-select {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: .84rem;
    font-family: inherit;
    color: var(--v2-text-primary);
    background: var(--v2-surface-0);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-md);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' fill='%238b949e'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.v2-select:focus {
    outline: none;
    border-color: var(--v2-accent);
    box-shadow: 0 0 0 3px var(--v2-accent-soft);
}

.v2-select option {
    background: var(--v2-surface-0);
}

/* ── Table ────────────────────────────────────────────────────────────────── */
.v2-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.v2-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .84rem;
}

.v2-table thead th {
    padding: 10px 16px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--v2-text-muted);
    border-bottom: 1px solid var(--v2-border);
    text-align: left;
    white-space: nowrap;
}

.v2-table tbody td {
    padding: 12px 16px;
    color: var(--v2-text-secondary);
    border-bottom: 1px solid var(--v2-border);
    vertical-align: middle;
}

.v2-table tbody tr:last-child td {
    border-bottom: none;
}

.v2-table tbody tr {
    transition: background .15s;
}

.v2-table tbody tr:hover {
    background: var(--v2-surface-2);
}

.v2-table tbody tr:hover td {
    color: var(--v2-text-primary);
}

/* ── Badge (table inline) ─────────────────────────────────────────────────── */
.v2-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
}

.v2-badge--green {
    background: var(--v2-green-soft);
    color: var(--v2-green);
}

.v2-badge--yellow {
    background: var(--v2-yellow-soft);
    color: var(--v2-yellow);
}

.v2-badge--red {
    background: var(--v2-red-soft);
    color: var(--v2-red);
}

/* ── Modal (v2) ───────────────────────────────────────────────────────────── */
.v2-modal .modal-content {
    background: var(--v2-surface-1);
    border: 1px solid var(--v2-border);
    border-radius: var(--v2-radius-xl);
    color: var(--v2-text-primary);
}

.v2-modal .modal-header {
    border-bottom: 1px solid var(--v2-border);
    padding: 20px 24px 16px;
}

.v2-modal .modal-footer {
    border-top: 1px solid var(--v2-border);
    padding: 16px 24px 20px;
}

.v2-modal .modal-title {
    font-weight: 700;
    font-size: 1rem;
}

.v2-modal .btn-close {
    filter: invert(1) grayscale(1) brightness(.6);
}

.v2-modal .v2-modal__warn-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--v2-radius-lg);
    background: var(--v2-red-soft);
    color: var(--v2-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 16px;
}

/* ── Alert (flash messages) ───────────────────────────────────────────────── */
.v2-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--v2-radius-md);
    font-size: .84rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.v2-alert--error {
    background: var(--v2-red-soft);
    border: 1px solid rgba(248, 81, 73, .18);
    color: #fca5a5;
}

.v2-alert--success {
    background: var(--v2-green-soft);
    border: 1px solid rgba(63, 185, 80, .18);
    color: #7ee787;
}

.v2-alert i {
    font-size: .9rem;
    flex-shrink: 0;
}

/* ── Divider ──────────────────────────────────────────────────────────────── */
.v2-divider {
    border: none;
    border-top: 1px solid var(--v2-border);
    margin: 24px 0;
}

/* ── Utilities ────────────────────────────────────────────────────────────── */
.v2-mt-0 {
    margin-top: 0 !important;
}

.v2-mt-1 {
    margin-top: 8px !important;
}

.v2-mt-2 {
    margin-top: 16px !important;
}

.v2-mt-3 {
    margin-top: 24px !important;
}

.v2-mt-4 {
    margin-top: 32px !important;
}

.v2-mb-0 {
    margin-bottom: 0 !important;
}

.v2-mb-1 {
    margin-bottom: 8px !important;
}

.v2-mb-2 {
    margin-bottom: 16px !important;
}

.v2-mb-3 {
    margin-bottom: 24px !important;
}

.v2-mb-4 {
    margin-bottom: 32px !important;
}

.v2-gap-1 {
    gap: 8px;
}

.v2-gap-2 {
    gap: 16px;
}

.v2-text-muted {
    color: var(--v2-text-muted) !important;
}

.v2-text-dim {
    color: var(--v2-text-dim) !important;
}

.v2-text-sm {
    font-size: .78rem !important;
}

.v2-mono {
    font-family: 'SF Mono', 'Fira Code', monospace !important;
}

.v2-flex {
    display: flex !important;
}

.v2-flex-wrap {
    flex-wrap: wrap !important;
}

.v2-items-center {
    align-items: center !important;
}

.v2-justify-between {
    justify-content: space-between !important;
}

.v2-w-full {
    width: 100% !important;
}

.v2-h-full {
    height: 100% !important;
}

/* ── Smooth scrolling for hash links ──────────────────────────────────────── */
.v2-page {
    scroll-behavior: smooth;
}

/* ── Responsive tweaks ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .v2-hero {
        flex-direction: column;
    }

    .v2-hero__actions {
        width: 100%;
    }

    .v2-hero__actions form {
        flex: 1;
    }

    .v2-hero__actions .v2-btn {
        width: 100%;
        justify-content: center;
    }

    .v2-container {
        padding: 0 16px;
    }

    .v2-card {
        padding: 18px;
    }
}