/* ═══════════════════════════════════════════════════════════════
   Cloudflare DDNS Manager - Premium Dark Theme
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── CSS Variables ───────────────────────────────────────────── */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --bg-input: rgba(15, 23, 42, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-modal-overlay: rgba(0, 0, 0, 0.7);

    --border-color: rgba(255, 255, 255, 0.06);
    --border-active: rgba(249, 115, 22, 0.4);
    --border-glass: rgba(255, 255, 255, 0.08);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #f97316;

    --cf-orange: #f97316;
    --cf-orange-glow: rgba(249, 115, 22, 0.15);
    --cf-orange-hover: #fb923c;
    --cf-gradient: linear-gradient(135deg, #f97316, #ea580c);

    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #eab308;
    --warning-bg: rgba(234, 179, 8, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(249, 115, 22, 0.1);

    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    --sidebar-width: 280px;
    --header-height: 72px;
}

/* ─── Reset & Base ────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── Animated Background ─────────────────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(249, 115, 22, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 40% 40% at 50% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* ─── Layout ──────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ─── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 14px;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    background: var(--cf-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.sidebar-brand h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--cf-orange-glow);
    color: var(--cf-orange);
    border-color: rgba(249, 115, 22, 0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--cf-orange);
    border-radius: 0 4px 4px 0;
}

.nav-item-icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item-badge {
    margin-left: auto;
    background: var(--cf-gradient);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.ip-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
}

.ip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.ip-info {
    flex: 1;
}

.ip-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ip-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ─── Main Content ────────────────────────────────────────────── */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-title h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

.page-title-icon {
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto;
}

/* ─── Cards ───────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-glass);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ─── Stat Cards Grid ─────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition-base);
    cursor: default;
}

.stat-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.orange {
    background: var(--cf-orange-glow);
}

.stat-icon.green {
    background: var(--success-bg);
}

.stat-icon.blue {
    background: var(--info-bg);
}

.stat-icon.yellow {
    background: var(--warning-bg);
}

.stat-info h4 {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    outline: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--cf-gradient);
    color: white;
    box-shadow: 0 2px 12px rgba(249, 115, 22, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-glass);
}

.btn-danger {
    background: var(--error-bg);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.2);
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.2);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.78rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ─── Form Elements ───────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus,
.form-select:focus {
    border-color: var(--cf-orange);
    box-shadow: 0 0 0 3px var(--cf-orange-glow);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2394a3b8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle {
    position: relative;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 13px;
    transition: all var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-base);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.toggle input:checked+.toggle-slider {
    background: var(--success);
    border-color: var(--success);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(22px);
    background: white;
}

/* ─── Tables ──────────────────────────────────────────────────── */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-error {
    background: var(--error-bg);
    color: var(--error);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-orange {
    background: var(--cf-orange-glow);
    color: var(--cf-orange);
}

.badge-muted {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.badge-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-weight: 500;
}

/* ─── Nameserver Display ──────────────────────────────────────── */
.ns-display {
    margin-top: 16px;
    padding: 20px;
    background: rgba(249, 115, 22, 0.05);
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-radius: var(--radius-md);
}

.ns-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cf-orange);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ns-list {
    list-style: none;
}

.ns-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all var(--transition-fast);
}

.ns-item:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(249, 115, 22, 0.2);
}

.ns-item .copy-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.ns-item .copy-btn:hover {
    color: var(--cf-orange);
    background: rgba(249, 115, 22, 0.1);
}

.ns-instructions {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    line-height: 1.7;
}

.ns-instructions strong {
    color: var(--text-secondary);
}

/* ─── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-modal-overlay);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 95%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-slow);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.show .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 24px 28px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--error-bg);
    color: var(--error);
}

.modal-body {
    padding: 0 28px 24px;
}

.modal-footer {
    padding: 18px 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ─── Toast Notifications ─────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 450px;
    font-size: 0.85rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.35s ease forwards;
    border: 1px solid transparent;
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

.toast-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
    color: var(--success);
}

.toast-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--error);
}

.toast-info {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
    color: var(--info);
}

.toast-warning {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.25);
    color: var(--warning);
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100px);
        opacity: 0;
    }
}

/* ─── Log List ────────────────────────────────────────────────── */
.log-list {
    max-height: 400px;
    overflow-y: auto;
}

.log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
    transition: background var(--transition-fast);
}

.log-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.log-item:last-child {
    border-bottom: none;
}

.log-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 1px;
}

.log-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.log-dot.success {
    background: var(--success);
}

.log-dot.error {
    background: var(--error);
}

.log-dot.info {
    background: var(--info);
}

.log-dot.warning {
    background: var(--warning);
}

.log-message {
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

/* ─── Empty State ─────────────────────────────────────────────── */
.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 0.82rem;
}

/* ─── Section Pages ───────────────────────────────────────────── */
.page-section {
    display: none;
}

.page-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── DDNS Status Bar ─────────────────────────────────────────── */
.ddns-status-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.running {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

.status-dot.stopped {
    background: var(--error);
}

.status-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

/* ─── Zone Card ───────────────────────────────────────────────── */
.zone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.zone-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.zone-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cf-gradient);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.zone-card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.zone-card:hover::before {
    opacity: 1;
}

.zone-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.zone-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.zone-card-status {
    margin-bottom: 12px;
}

.zone-card-ns {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.zone-card-ns span {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    padding: 2px 0;
}

.zone-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

/* ─── Token Setup (Welcome) ───────────────────────────────────── */
.setup-container {
    max-width: 520px;
    margin: 60px auto;
    text-align: center;
}

.setup-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.setup-container h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.setup-container p {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.9rem;
}

.setup-form {
    text-align: left;
}

/* ─── Record Proxied Indicator ────────────────────────────────── */
.proxied-on {
    color: var(--cf-orange);
}

.proxied-off {
    color: var(--text-muted);
}

.record-content {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ─── Loading Spinner ─────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--cf-orange);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 26, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .zone-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .mobile-toggle {
        display: flex !important;
    }
}

.mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
}

/* ─── Utility Classes ─────────────────────────────────────────── */
.mb-0 {
    margin-bottom: 0;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.gap-8 {
    gap: 8px;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.text-sm {
    font-size: 0.8rem;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.w-full {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT MODE THEME
   ═══════════════════════════════════════════════════════════════ */
[data-theme="light"] {
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-card-hover: rgba(248, 250, 252, 1);
    --bg-input: rgba(241, 245, 249, 0.9);
    --bg-glass: rgba(0, 0, 0, 0.02);
    --bg-modal-overlay: rgba(0, 0, 0, 0.4);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-active: rgba(249, 115, 22, 0.3);
    --border-glass: rgba(0, 0, 0, 0.12);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-accent: #ea580c;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(249, 115, 22, 0.08);
}

[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(249, 115, 22, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
}

[data-theme="light"] .sidebar {
    background: #ffffff;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .main-header {
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .nav-item.active {
    background: rgba(249, 115, 22, 0.08);
}

[data-theme="light"] .data-table th {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .data-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .form-select option {
    background: #ffffff;
    color: var(--text-primary);
}

[data-theme="light"] .ns-item {
    background: rgba(249, 115, 22, 0.04);
    border-color: rgba(249, 115, 22, 0.1);
}

[data-theme="light"] .modal {
    background: #ffffff;
}

[data-theme="light"] .toast {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .ip-display {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

/* ─── Theme Toggle Button ────────────────────────────────────── */
.theme-toggle-btn {
    width: 38px;
    height: 38px;
    padding: 0 !important;
    font-size: 1.1rem;
    border-radius: 50% !important;
    transition: all var(--transition-base);
}

.theme-toggle-btn:hover {
    transform: rotate(20deg);
}

/* ─── Theme Selector ─────────────────────────────────────────── */
.theme-selector {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.theme-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition-base);
}

.theme-option:hover {
    border-color: var(--border-active);
    background: var(--cf-orange-glow);
}

.theme-option.active {
    border-color: var(--cf-orange);
    background: var(--cf-orange-glow);
    color: var(--cf-orange);
}

.theme-option-icon {
    font-size: 1.5rem;
}

/* Lang selector reuses theme-option styles */
.lang-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all var(--transition-base);
}

.lang-option:hover {
    border-color: var(--border-active);
    background: var(--cf-orange-glow);
}

.lang-option.active {
    border-color: var(--cf-orange);
    background: var(--cf-orange-glow);
    color: var(--cf-orange);
}

/* ─── Guide Steps ────────────────────────────────────────────── */
.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.guide-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.guide-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cf-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.guide-step-content {
    flex: 1;
    padding-top: 4px;
}

.guide-step-content strong {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.guide-step-content p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

.link-accent {
    color: var(--cf-orange);
    text-decoration: none;
    font-weight: 500;
}

.link-accent:hover {
    text-decoration: underline;
}

/* ─── Permissions Grid ───────────────────────────────────────── */
.permissions-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.perm-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.perm-icon {
    font-size: 1rem;
}

/* ─── Author Card ────────────────────────────────────────────── */
.author-card {
    display: flex;
    align-items: center;
    gap: 20px;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--cf-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.author-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.author-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.author-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all var(--transition-fast);
}

.author-link:hover {
    color: var(--cf-orange);
    border-color: var(--cf-orange);
    background: var(--cf-orange-glow);
}

/* ─── App Info Grid ──────────────────────────────────────────── */
.app-info-grid {
    display: grid;
    gap: 0;
}

.app-info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.app-info-item:last-child {
    border-bottom: none;
}

.app-info-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.app-info-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════ */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse 80% 50% at 30% 20%, rgba(249, 115, 22, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 70% 80%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 48px 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(249, 115, 22, 0.06);
    backdrop-filter: blur(16px);
    animation: loginSlideUp 0.5s ease-out;
}

@keyframes loginSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    font-size: 3rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(249, 115, 22, 0.3));
}

.login-title {
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--cf-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-input {
    padding: 14px 16px;
    font-size: 0.92rem;
}

.login-error {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 0.82rem;
    margin-bottom: 16px;
    text-align: center;
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    margin-top: 4px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ─── Sidebar User ───────────────────────────────────────────── */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user-icon {
    font-size: 1rem;
}

.sidebar-user-name {
    flex: 1;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* ─── Tunnel Styles ───────────────────────────────────────────── */
.tunnel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
    gap: 20px;
}

.tunnel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.tunnel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    transition: all var(--transition-base);
}

.tunnel-card:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-md);
}

.tunnel-card.tunnel-active::before {
    background: var(--cf-gradient);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
}

.tunnel-card.tunnel-active {
    border-color: rgba(249, 115, 22, 0.2);
}

.tunnel-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.tunnel-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.tunnel-icon {
    font-size: 1.1rem;
}

/* Two-panel body: left=status, right=routes */
.tunnel-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.tunnel-panel {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
}

.tunnel-panel:first-child {
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.tunnel-panel-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.tunnel-card-info {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
}

.tunnel-id {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tunnel-id-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 4px;
}

.copy-btn-mini {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 2px 4px;
    border-radius: 3px;
    transition: all var(--transition-fast);
}

.copy-btn-mini:hover {
    color: var(--cf-orange);
    background: var(--cf-orange-glow);
}

.tunnel-conn-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--success);
    background: var(--success-bg);
    padding: 2px 10px;
    border-radius: 10px;
}

.tunnel-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* Tunnel Config Modal */
.tunnel-config-section {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.ingress-rule-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.ingress-rule-row:hover {
    border-color: var(--border-active);
}

.ingress-arrow {
    color: var(--cf-orange);
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Connector Status Bar */
.tunnel-connector-status {
    margin-bottom: 4px;
}

.connector-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.connector-bar.connector-running {
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.04);
}

.connector-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.connector-dot-ok {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
    animation: connectorPulse 2s ease-in-out infinite;
}

.connector-dot-off {
    background: rgba(239, 68, 68, 0.7);
}

.connector-dot-warn {
    background: rgba(234, 179, 8, 0.7);
}

@keyframes connectorPulse {

    0%,
    100% {
        box-shadow: 0 0 4px var(--success);
    }

    50% {
        box-shadow: 0 0 12px var(--success);
    }
}

.btn-success {
    background: var(--success);
    color: white;
    border: none;
}

.btn-success:hover {
    background: #16a34a;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

/* Tunnel Token Display */
.tunnel-token-display {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.tunnel-token-code {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.73rem;
    color: var(--cf-orange);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    word-break: break-all;
    line-height: 1.5;
    flex: 1;
    max-height: 120px;
    overflow-y: auto;
}

.tunnel-install-cmd {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.tunnel-install-cmd h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Responsive tunnel grid */
@media (max-width: 768px) {
    .tunnel-grid {
        grid-template-columns: 1fr;
    }

    .ingress-rule-row {
        flex-direction: column;
        gap: 6px;
    }

    .ingress-arrow {
        transform: rotate(90deg);
    }

    .tunnel-token-display {
        flex-direction: column;
    }
}

/* ─── Wizard Steps ────────────────────────────────────────────── */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 16px 0;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition-base);
    padding: 6px 12px;
    border-radius: 20px;
}

.wizard-step.active {
    color: var(--cf-orange);
    background: var(--cf-orange-glow);
    font-weight: 600;
}

.wizard-step.done {
    color: var(--success);
}

.wizard-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    transition: all var(--transition-base);
}

.wizard-step.active .wizard-step-num {
    background: var(--cf-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.3);
}

.wizard-step.done .wizard-step-num {
    background: var(--success);
    color: white;
    border-color: transparent;
}

.wizard-step-line {
    width: 32px;
    height: 2px;
    background: var(--border-color);
    margin: 0 4px;
}

.wizard-page {
    min-height: 120px;
}

/* Wizard Route Cards */
.wizard-route-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: all var(--transition-fast);
}

.wizard-route-card:hover {
    border-color: rgba(249, 115, 22, 0.2);
}

.wizard-route-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Tunnel Route Items (on cards) */
.tunnel-route-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 0.75rem;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
}

.tunnel-route-item:hover {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(239, 68, 68, 0.15);
}

.tunnel-route-item:hover .route-delete-btn {
    opacity: 1;
}

.route-delete-btn {
    opacity: 0;
    margin-left: auto;
    flex-shrink: 0;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.4;
}

.route-delete-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
}

.tunnel-route-host {
    font-family: 'JetBrains Mono', monospace;
    color: var(--cf-orange);
    font-size: 0.73rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.tunnel-route-item .ingress-arrow {
    font-size: 0.8rem;
    flex-shrink: 0;
}

.tunnel-route-service {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* Responsive: 1 column on small screens */
@media (max-width: 640px) {
    .tunnel-grid {
        grid-template-columns: 1fr;
    }

    .tunnel-card-body {
        grid-template-columns: 1fr;
    }

    .tunnel-panel:first-child {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* Wizard Result Steps */
.wizard-result-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.wizard-result-step.ok {
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.05);
}

.wizard-result-step.error {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.05);
}

.wizard-result-step.warning {
    border-color: rgba(234, 179, 8, 0.2);
    background: rgba(234, 179, 8, 0.05);
}

/* ─── Donate Modal ────────────────────────────────────────────── */
.donate-nav {
    margin-top: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px !important;
}

.donate-nav:hover {
    background: rgba(234, 179, 8, 0.08) !important;
    color: #eab308 !important;
}

.donate-modal-header {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(249, 115, 22, 0.1));
    border-bottom: 1px solid rgba(234, 179, 8, 0.2);
}

.donate-modal-body {
    text-align: center;
    padding: 24px !important;
}

.donate-coffee-icon {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.donate-cup {
    font-size: 3.5rem;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(234, 179, 8, 0.3));
    animation: donateFloat 3s ease-in-out infinite;
}

.donate-steam {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.6rem;
    color: rgba(234, 179, 8, 0.5);
    animation: donateSteam 2s ease-in-out infinite;
}

@keyframes donateFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes donateSteam {

    0%,
    100% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(0) scale(1);
    }

    50% {
        opacity: 0.7;
        transform: translateX(-50%) translateY(-8px) scale(1.2);
    }
}

.donate-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.donate-qr-container {
    position: relative;
    display: inline-block;
    padding: 12px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(234, 179, 8, 0.1);
    margin-bottom: 20px;
    transition: transform var(--transition-base);
}

.donate-qr-container:hover {
    transform: scale(1.02);
}

.donate-qr-img {
    display: block;
    width: 260px;
    height: auto;
    border-radius: var(--radius-sm);
}

.donate-info {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 16px;
}

.donate-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.donate-info-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.donate-info-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 90px;
}

.donate-info-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.donate-thanks {
    font-size: 0.88rem;
    color: var(--cf-orange);
    font-weight: 600;
    margin: 0;
}

/* ─── Guide / Manual Instructions ─────────────────────────────── */
.guide-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85rem;
    line-height: 1.6;
}

.guide-alert-info {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--text-secondary);
}

.guide-alert-info strong {
    color: #60a5fa;
}

.guide-alert-info code {
    background: rgba(59, 130, 246, 0.15);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.guide-method {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--cf-orange);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 14px;
}

.guide-method h5 {
    margin: 0 0 10px 0;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.guide-steps {
    margin-bottom: 10px;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 5px 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.guide-step code {
    background: rgba(249, 115, 22, 0.1);
    color: var(--cf-orange);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.78rem;
}

.guide-step-num {
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--cf-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}