/* HighGround Cloud — Base Styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --hg-bg: #f5f6fa;
    --hg-surface: #ffffff;
    --hg-border: #e2e5f1;
    --hg-text: #1a1d2e;
    --hg-muted: #6b7194;
    --hg-primary: #4f6ef7;
    --hg-primary-hover: #3b57d9;
    --hg-success: #22c55e;
    --hg-warning: #f59e0b;
    --hg-danger: #ef4444;
    --hg-danger-hover: #dc2626;
    --hg-radius: 8px;
    --hg-radius-lg: 12px;
    --hg-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --hg-shadow-lg: 0 4px 24px rgba(0,0,0,.08);
    --hg-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
    font-family: var(--hg-font);
    background: var(--hg-bg);
    color: var(--hg-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
/* Nav */
.hg-nav {
    background: var(--hg-surface);
    border-bottom: 1px solid var(--hg-border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
}
.hg-nav-admin { background: #1a1d2e; border-bottom-color: #2d3154; }
.hg-nav-admin .hg-nav-brand,
.hg-nav-admin .hg-nav-user { color: #fff; }
.hg-nav-admin .hg-btn-ghost { color: #a0a4c0; }
.hg-nav-admin .hg-btn-outline { color: #a0a4c0; border-color: #3d4166; }
.hg-nav-inner {
    max-width: 1200px;
    width: 90%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.hg-nav-brand {
    font-weight: 700;
    font-size: 16px;
    color: var(--hg-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hg-logo-sm {
    background: var(--hg-primary);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hg-nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hg-nav-user { font-size: 14px; color: var(--hg-muted); }

/* Container */
.hg-container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 24px;
    flex: 1;
    width: 100%;
}

/* Cards */
.hg-card {
    background: var(--hg-surface);
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--hg-shadow);
}
.hg-card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}
.hg-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Buttons */
.hg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--hg-radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all .15s;
    font-family: var(--hg-font);
    line-height: 1.4;
}
.hg-btn:hover { opacity: .9; }
.hg-btn-primary { background: var(--hg-primary); color: #fff; }
.hg-btn-primary:hover { background: var(--hg-primary-hover); }
.hg-btn-danger { background: var(--hg-danger); color: #fff; }
.hg-btn-danger:hover { background: var(--hg-danger-hover); }
.hg-btn-outline { background: transparent; color: var(--hg-text); border-color: var(--hg-border); }
.hg-btn-outline:hover { background: var(--hg-bg); }
.hg-btn-ghost { background: transparent; color: var(--hg-muted); }
.hg-btn-ghost:hover { color: var(--hg-text); }
.hg-btn-full { width: 100%; }
.hg-btn-sm { padding: 5px 12px; font-size: 13px; }
.hg-btn-xs { padding: 3px 8px; font-size: 12px; }

/* Forms */
.hg-field { margin-bottom: 16px; }
.hg-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--hg-text);
    margin-bottom: 4px;
}
.hg-input-sm {
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid var(--hg-border);
    border-radius: 6px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.hg-input-sm:focus {
    outline: none;
    border-color: var(--hg-primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,.12);
}

.hg-field input,
.hg-field select,
.hg-field textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    background: var(--hg-surface);
    color: var(--hg-text);
    font-family: var(--hg-font);
    transition: border-color .15s;
}
.hg-field input:focus,
.hg-field select:focus,
.hg-field textarea:focus {
    outline: none;
    border-color: var(--hg-primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,.12);
}
.hg-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) {
    .hg-field-row { grid-template-columns: 1fr; }
}

/* Alerts */
.hg-alert {
    padding: 12px 16px;
    border-radius: var(--hg-radius);
    font-size: 14px;
    margin-bottom: 16px;
}
.hg-alert-error { background: #fef2f2; color: var(--hg-danger); border: 1px solid #fecaca; }
.hg-alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* Auth Pages */
.hg-auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.hg-auth-card {
    background: var(--hg-surface);
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--hg-shadow-lg);
}
.hg-auth-header {
    text-align: center;
    margin-bottom: 28px;
}
.hg-auth-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}
.hg-auth-header p {
    color: var(--hg-muted);
    font-size: 14px;
}
.hg-logo-mark {
    width: 48px;
    height: 48px;
    background: var(--hg-primary);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.hg-auth-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 14px;
    border-radius: 12px;
}
.hg-auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--hg-border);
    font-size: 14px;
    color: var(--hg-muted);
}
.hg-auth-footer a { color: var(--hg-primary); text-decoration: none; font-weight: 600; }
.hg-auth-footer a:hover { text-decoration: underline; }

/* Tables */
.hg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.hg-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--hg-muted);
    padding: 10px 12px;
    border-bottom: 2px solid var(--hg-border);
}
.hg-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--hg-border);
    vertical-align: middle;
}
.hg-table tbody tr:hover { background: #f8f9fd; }
.hg-actions-cell { white-space: nowrap; }
.hg-actions-cell form { margin-right: 4px; }

.hg-btn-archive {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--hg-muted);
    cursor: pointer;
    transition: all .15s;
}
.hg-btn-archive:hover {
    color: var(--hg-primary);
    background: var(--hg-bg);
    border-color: var(--hg-border);
}

/* Badges */
.hg-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}
.hg-badge-pending { background: #fef3c7; color: #92400e; }
.hg-badge-processing { background: #dbeafe; color: #1e40af; }
.hg-badge-complete { background: #dcfce7; color: #166534; }
.hg-badge-error { background: #fef2f2; color: #991b1b; }
.hg-badge-cancelled { background: #f3f4f6; color: #6b7280; }

/* Progress */
.hg-progress-mini {
    height: 6px;
    background: var(--hg-border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 2px;
    min-width: 80px;
}
.hg-progress-mini-bar {
    height: 100%;
    background: var(--hg-primary);
    border-radius: 3px;
    transition: width .3s;
}

/* Stats Row */
.hg-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.hg-stat-card {
    background: var(--hg-surface);
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--hg-shadow);
}
.hg-stat-value { font-size: 24px; font-weight: 700; display: block; }
.hg-stat-label { font-size: 12px; color: var(--hg-muted); text-transform: uppercase; letter-spacing: .5px; }

/* Filter Tabs */
.hg-filter-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--hg-border);
    padding-bottom: 0;
}
.hg-filter-tab {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hg-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}
.hg-filter-tab:hover { color: var(--hg-text); }
.hg-filter-tab.active {
    color: var(--hg-primary);
    border-bottom-color: var(--hg-primary);
}

/* API Key */
.hg-api-key-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.hg-api-key {
    background: var(--hg-bg);
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    padding: 8px 14px;
    font-size: 13px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    word-break: break-all;
    flex: 1;
    min-width: 200px;
}

/* Misc */
.hg-muted { color: var(--hg-muted); font-size: 14px; margin-bottom: 12px; }
.hg-empty { color: var(--hg-muted); text-align: center; padding: 40px 20px; font-size: 14px; }
.hg-error-hint {
    font-size: 12px;
    color: var(--hg-danger);
    cursor: help;
    text-decoration: underline dotted;
}
.hg-pagination {
    display: flex;
    gap: 4px;
    margin-top: 16px;
    justify-content: center;
}

span.hg-nav-brand-label {
    font-size: 15px;
    position: relative;
    top: 0px;
    margin-left: -6px;
    color: #a3a3a3;
    font-weight: 400;
}

code {
    background: var(--hg-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* Site Selector */
.hg-site-select { width: 100%; }
.hg-add-site-form {
    border-top: 1px solid var(--hg-border);
    margin-top: 16px;
    padding-top: 4px;
}

/* Select2 overrides */
.select2-container--default .select2-selection--single {
    height: 40px;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    font-family: var(--hg-font);
    font-size: 14px;
    padding: 0;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    padding-left: 12px;
    color: var(--hg-text);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
    right: 6px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--hg-muted);
}
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--hg-primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,.12);
    outline: none;
}
.select2-dropdown {
    border-color: var(--hg-border);
    border-radius: var(--hg-radius);
    box-shadow: var(--hg-shadow-lg);
    font-family: var(--hg-font);
    font-size: 14px;
    overflow: hidden;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--hg-primary);
}
.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    padding: 6px 10px;
    font-family: var(--hg-font);
    font-size: 14px;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--hg-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79,110,247,.12);
}
.select2-container--default .select2-selection--single .select2-selection__clear {
    font-size: 18px;
    margin-right: 4px;
    color: var(--hg-muted);
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: var(--hg-danger);
}

/* Billing Menu */
.hg-billing-menu {
    position: relative;
}
.hg-billing-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.hg-billing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.hg-balance-healthy .hg-billing-dot { background: var(--hg-success); }
.hg-balance-low .hg-billing-dot { background: var(--hg-warning); }
.hg-balance-depleted .hg-billing-dot { background: var(--hg-danger); }

.hg-billing-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    background: var(--hg-surface);
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius-lg);
    box-shadow: var(--hg-shadow-lg);
    z-index: 1000;
    overflow: hidden;
}
.hg-billing-dropdown.hg-dropdown-open { display: block; }

.hg-billing-dropdown-section {
    padding: 16px;
    border-bottom: 1px solid var(--hg-border);
}
.hg-billing-dropdown-section:last-child { border-bottom: none; }

.hg-dropdown-balance {
    text-align: center;
}
.hg-dropdown-balance-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--hg-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.hg-dropdown-balance-amount {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
}
.hg-dropdown-balance-detail {
    font-size: 12px;
    color: var(--hg-muted);
    margin-top: 2px;
}
.hg-balance-healthy .hg-dropdown-balance-amount { color: var(--hg-success); }
.hg-balance-low .hg-dropdown-balance-amount { color: var(--hg-warning); }
.hg-balance-depleted .hg-dropdown-balance-amount { color: var(--hg-danger); }

.hg-badge-admin {
    background: #ede9fe;
    color: #6d28d9;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.hg-billing-dropdown-settings .hg-refill-form .hg-field-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}
.hg-billing-dropdown-settings .hg-refill-form .hg-field-inline label {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}
.hg-billing-dropdown-settings .hg-refill-form .hg-field-inline select {
    width: auto;
    min-width: 70px;
    padding: 4px 8px;
    font-size: 13px;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    background: var(--hg-surface);
    color: var(--hg-text);
    font-family: var(--hg-font);
}
.hg-billing-dropdown-settings .hg-refill-form .hg-field-inline input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--hg-primary);
}

.hg-dropdown-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--hg-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}
.hg-billing-dropdown-txns { padding: 12px 16px; }
.hg-table-compact td {
    padding: 4px 6px;
    font-size: 12px;
    border-bottom: 1px solid var(--hg-border);
}
.hg-table-compact tr:last-child td { border-bottom: none; }
.hg-dropdown-more {
    text-align: center;
    font-size: 11px;
    color: var(--hg-muted);
    padding-top: 6px;
}

.hg-billing-dropdown-footer {
    padding: 12px 16px;
}

.hg-transactions-table .hg-txn-credit { color: var(--hg-success); font-weight: 600; }
.hg-transactions-table .hg-txn-debit { color: var(--hg-danger); font-weight: 600; }

@media (max-width: 480px) {
    .hg-billing-dropdown { width: calc(100vw - 32px); right: -60px; }
}

/* Balance Link (nav) */
.hg-balance-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--hg-text);
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    transition: all .15s;
}
.hg-balance-link:hover {
    background: var(--hg-bg);
    border-color: var(--hg-primary);
}

/* Account Menu */
.hg-account-menu {
    position: relative;
}
.hg-account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.hg-account-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--hg-surface);
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius-lg);
    box-shadow: var(--hg-shadow-lg);
    z-index: 1000;
    overflow: hidden;
    padding: 6px 0;
}
.hg-account-dropdown.hg-dropdown-open { display: block; }
.hg-account-dropdown-item {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hg-text);
    text-decoration: none;
    transition: background .1s;
}
.hg-account-dropdown-item:hover {
    background: var(--hg-bg);
}
.hg-account-dropdown-item.hg-account-active {
    color: var(--hg-primary);
    font-weight: 600;
}
.hg-account-dropdown-item.hg-account-disabled {
    color: var(--hg-muted);
    pointer-events: none;
    opacity: .5;
}
.hg-account-dropdown-item.hg-account-logout {
    color: var(--hg-danger);
}
.hg-account-dropdown-divider {
    height: 1px;
    background: var(--hg-border);
    margin: 4px 0;
}
/* ===== Downloads Page ===== */
.hg-download-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.hg-download-info {
    min-width: 0;
    flex: 1;
}
.hg-download-thumb {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    vertical-align: middle;
    position: relative;
    top: -2px;
    margin-right: 2px;
}
.hg-btn-download {
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}
.hg-btn-download-icon {
    width: 14px;
    height: 14px;
}
.hg-install-steps,
.hg-requirements-list {
    margin: 0;
    padding-left: 20px;
    color: var(--hg-text);
    line-height: 2;
}
.hg-install-steps li::marker {
    color: var(--hg-primary);
    font-weight: 600;
}
@media (max-width: 600px) {
    .hg-download-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ===== Billing Page ===== */
.hg-billing-page-header {
    margin-bottom: 24px;
}
.hg-billing-page-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.01em;
    margin-bottom: 4px;
}
.hg-billing-page-header p {
    color: var(--hg-muted);
    font-size: 15px;
}

/* Overview Cards */
.hg-billing-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.hg-billing-card {
    background: var(--hg-surface);
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius-lg);
    padding: 20px 24px;
    box-shadow: var(--hg-shadow);
}
.hg-billing-card-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--hg-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}
.hg-billing-card-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
}
.hg-billing-card-value.hg-balance-healthy { color: var(--hg-success); }
.hg-billing-card-value.hg-balance-low { color: var(--hg-warning); }
.hg-billing-card-value.hg-balance-depleted { color: var(--hg-danger); }
.hg-billing-card-sub {
    font-size: 13px;
    color: var(--hg-muted);
}

/* Charts */
.hg-billing-charts {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 20px;
    margin-bottom: 24px;
}
.hg-billing-chart-card {
    margin-bottom: 0;
}
.hg-chart-wrap {
    height: 260px;
    margin-top: 16px;
}
.hg-chart-wrap-doughnut {
    height: 280px;
}

/* Payment & Auto-Refill Settings Row */
.hg-billing-settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.hg-billing-settings-row .hg-card {
    margin-bottom: 0;
}
.hg-payment-card-display {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--hg-bg);
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    margin: 12px 0;
}
.hg-payment-card-brand {
    font-size: 14px;
    font-weight: 600;
}
.hg-payment-card-exp {
    font-size: 13px;
    color: var(--hg-muted);
}
.hg-payment-actions {
    display: flex;
    gap: 8px;
}

/* Auto-Refill Form (billing page) */
.hg-refill-form-page .hg-refill-row {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}
.hg-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.hg-toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--hg-primary);
}
.hg-refill-amount-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.hg-refill-amount-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--hg-text);
}
.hg-refill-amount-group select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    background: var(--hg-surface);
    color: var(--hg-text);
    font-family: var(--hg-font);
    max-width: 160px;
}

/* Responsive billing page */
@media (max-width: 900px) {
    .hg-billing-cards { grid-template-columns: repeat(2, 1fr); }
    .hg-billing-charts { grid-template-columns: 1fr; }
    .hg-billing-settings-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .hg-billing-cards { grid-template-columns: 1fr; }
    .hg-balance-link span.hg-badge { display: none; }
}

/* ===== Register Page — Two-Column Layout ===== */
html:has(.hg-register-page) {
    background: linear-gradient(to right, #0E0E0E 44%, var(--hg-surface) 44%);
}
.hg-register-page {
    display: grid;
    grid-template-columns: 44% 56%;
    min-height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
}

.hg-register-panel {
    background: #0E0E0E;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
}

.hg-register-panel-inner {
    position: relative;
    z-index: 1;
    max-width: 420px;
    width: 100%;
    margin-top: -77px;
}

.hg-register-brand {
    text-align: center;
    margin-bottom: 32px;
}
.hg-register-logo {
    width: 200px;
    height: auto;
    object-fit: contain;
    border-radius: 0px;
    box-shadow: none;
}

/* Unified pricing card */
.hg-register-plan-card {
    background: #181818;
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 36px 32px 28px;
    background-clip: padding-box;
    position: relative;
}
.hg-register-plan-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 17px;
    background: linear-gradient(160deg, #ffffff29 0%, rgb(171 171 171 / 20%) 40%, rgba(56, 189, 248, .05) 70%, rgb(224 224 224 / 18%) 100%);
    z-index: -1;
}
.hg-register-plan-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.01em;
    margin-bottom: 6px;
    color: #fff;
}
.hg-register-plan-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,.55);
    line-height: 1.5;
    margin-bottom: 28px;
}

.hg-register-price-row {
    display: flex;
    align-items: baseline;
    gap: 2px;
    margin-bottom: 8px;
}
.hg-register-price-dollar {
    font-size: 22px;
    font-weight: 500;
    color: rgba(255,255,255,.6);
    align-self: flex-start;
    margin-top: 8px;
}
.hg-register-price {
    font-size: 64px;
    font-weight: 600;
    letter-spacing: -.04em;
    line-height: 1;
}
.hg-register-price-period {
    font-size: 16px;
    opacity: .5;
    font-weight: 400;
    margin-left: 4px;
}

.hg-register-credits-note {
    font-size: 13px;
    color: rgba(255,255,255,.6);
    line-height: 1.5;
    margin-bottom: 35px;
    background: #2b2b2b;
    padding: 11px 16px;
    border-radius: 6px;
    margin-top: 28px;
}
.hg-register-credits-note strong {
    color: #38bdf8;
    font-weight: 600;
}

.hg-register-features {
    list-style: none;
    margin-bottom: 0;
}
.hg-register-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    line-height: 1.4;
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,.07);
}
.hg-register-features li:last-child {
    border-bottom: none;
}
.hg-register-features svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: #38bdf8;
}
.hg-register-features strong {
    font-weight: 700;
}

.hg-register-guarantee {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin-bottom: 0;
    background: none;
    border: none;
    border-radius: 0;
}
.hg-register-guarantee svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #38bdf8;
}
.hg-register-guarantee span {
    font-size: 13px;
    color: rgba(255,255,255,.5);
    line-height: 1.4;
}
.hg-register-guarantee strong {
    font-weight: 700;
    color: rgba(255,255,255,.7);
}

.hg-register-footnote {
    font-size: 11px;
    color: rgba(255,255,255,.3);
    line-height: 1.5;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.hg-register-demo {
    text-align: center;
    margin-top: 24px;
}
.hg-register-demo p {
    font-size: 13px;
    color: rgba(255,255,255,.4);
    margin: 0;
}
.hg-register-demo-link {
    color: rgba(255,255,255,.7);
    font-weight: 600;
    text-decoration: none;
    transition: color .15s;
}
.hg-register-demo-link:hover {
    color: #fff;
    text-decoration: underline;
}

/* Right column — form */
.hg-register-form-col {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--hg-surface);
    overflow-y: auto;
}
.hg-register-form-inner {
    width: 100%;
    max-width: 520px;
}
.hg-register-form-header {
    margin-bottom: 28px;
}
.hg-register-form-header h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.01em;
    margin-bottom: 6px;
    color: var(--hg-text);
}
.hg-register-form-header p {
    font-size: 15px;
    color: var(--hg-muted);
    line-height: 1.5;
}

.hg-stripe-card {
    padding: 12px 14px;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    background: var(--hg-surface);
    transition: border-color .15s, box-shadow .15s;
}
.hg-stripe-card.StripeElement--focus {
    border-color: var(--hg-primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,.12);
}
.hg-stripe-card.StripeElement--invalid {
    border-color: var(--hg-danger);
}
.hg-stripe-errors {
    color: var(--hg-danger);
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
}

.hg-btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.hg-register-terms {
    text-align: center;
    font-size: 12px;
    color: var(--hg-muted);
    margin-top: 14px;
    line-height: 1.6;
}
.hg-register-stripe-badge {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}
.hg-register-stripe-badge img {
    height: 24px;
    opacity: .45;
    display: block;
}

@media (max-width: 768px) {
    .hg-register-page {
        grid-template-columns: 1fr;
    }
    .hg-register-panel {
        padding: 32px 20px;
    }
    .hg-register-logo {
        width: 140px;
    }
    .hg-register-plan-card {
        padding: 28px 24px 24px;
    }
    .hg-register-price { font-size: 48px; }
    .hg-register-form-col {
        padding: 32px 20px;
    }
}

/* ===== Team Page ===== */
.hg-team-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: block;
}
.hg-team-avatar-cell {
    width: 40px;
    padding-right: 0 !important;
}
.hg-invite-form {
    margin-top: 12px;
}
.hg-invite-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.hg-invite-row .hg-field select,
.hg-invite-row .hg-field input {
    height: 38px;
}
@media (max-width: 600px) {
    .hg-invite-row {
        flex-direction: column;
        align-items: stretch;
    }
    .hg-invite-row .hg-field {
        flex: none !important;
    }
}

.hg-badge-role-owner { background: #ede9fe; color: #6d28d9; }
.hg-badge-role-admin { background: #dbeafe; color: #1e40af; }
.hg-badge-role-manager { background: #fef3c7; color: #92400e; }
.hg-badge-role-analyst { background: #f3f4f6; color: #374151; }
.hg-badge-active { background: #dcfce7; color: #166534; }

/* DataTables overrides */
.dataTables_wrapper {
    font-family: var(--hg-font);
}
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 12px;
}
.dataTables_wrapper .dataTables_filter input {
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--hg-border);
    border-radius: var(--hg-radius);
    font-family: var(--hg-font);
    outline: none;
    transition: border-color .15s;
    margin-left: 6px;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--hg-primary);
    box-shadow: 0 0 0 3px rgba(79,110,247,.12);
}
table.dataTable thead th {
    border-bottom: 2px solid var(--hg-border) !important;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--hg-muted);
    padding: 10px 12px !important;
}
table.dataTable tbody td {
    padding: 10px 12px !important;
    border-bottom: 1px solid var(--hg-border) !important;
    vertical-align: middle;
}
table.dataTable tbody tr:hover {
    background: #f8f9fd !important;
}
table.dataTable.no-footer {
    border-bottom: none !important;
}
.dataTables_wrapper .dataTables_length {
    display: none;
}
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-image: none !important;
}

/* ===== Profile Page ===== */
.hg-profile-page-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}
.hg-profile-page-header h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -.01em;
    margin-bottom: 2px;
}
.hg-profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--hg-border);
}

/* Rating group */
.hg-rating-group {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}
.hg-rating-option {
    position: relative;
    cursor: pointer;
}
.hg-rating-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.hg-rating-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--hg-radius);
    border: 2px solid var(--hg-border);
    font-size: 16px;
    font-weight: 700;
    color: var(--hg-muted);
    background: var(--hg-surface);
    transition: all .15s;
}
.hg-rating-text {
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--hg-muted);
    margin-top: 4px;
}
.hg-rating-option input:checked + .hg-rating-label {
    border-color: var(--hg-primary);
    background: var(--hg-primary);
    color: #fff;
}
.hg-rating-option:hover .hg-rating-label {
    border-color: var(--hg-primary);
}
@media (max-width: 600px) {
    .hg-profile-page-header {
        flex-direction: column;
        text-align: center;
    }
    .hg-rating-group {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* ===== Footer ===== */
.hg-footer {
    padding: 32px 24px 24px;
    text-align: center;
    font-size: 13px;
    color: var(--hg-muted);
}
.hg-footer-divider {
    border: none;
    border-top: 1px solid var(--hg-border);
    max-width: 90%;
    margin: 0 auto 20px;
}
.hg-footer-inner {
    max-width: 90%;
    margin: 0 auto;
}
.hg-footer a {
    color: var(--hg-muted);
    text-decoration: none;
    transition: color .15s;
}
.hg-footer a:hover {
    color: var(--hg-text);
}
.hg-footer-sep {
    margin: 0 6px;
}
