:root {
    --bg-main: #0b0f19;
    --bg-card: #151d30;
    --bg-input: #1e293b;
    --accent-primary: #6366f1;
    --accent-hover: #4f46e5;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #263352;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Transitions & Utility */
[v-cloak] {
    display: none !important;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--accent-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s;
    background: var(--accent-primary);
    color: #fff;
    gap: 8px;
}

.btn:hover {
    background: var(--accent-hover);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: #334155;
}

.btn-warning {
    background: #d97706;
    color: #fff;
}
.btn-warning:hover {
    background: #b45309;
}

.btn-danger {
    background: #dc2626;
    color: #fff;
}
.btn-danger:hover {
    background: #b91c1c;
}

.btn-success {
    background: #059669;
    color: #fff;
}
.btn-success:hover {
    background: #047857;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Dashboard UI */
header {
    height: 64px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

.brand-title {
    font-weight: 600;
    font-size: 16px;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 16px;
}

main {
    flex: 1;
    padding: 32px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-muted);
}

/* Section Cards */
.section-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 28px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Quick Action Bar */
.actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

th {
    background: rgba(11, 15, 25, 0.6);
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}
.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}
.badge-secondary {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}
.badge-wifi {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}
.badge-mobile {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
}
.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

/* Interactive Web Terminal */
.terminal-container {
    background: #030712;
    border: 1px solid #1f293d;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.terminal-topbar {
    background: #111827;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #1f293d;
}

.terminal-target-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #38bdf8;
    font-family: 'JetBrains Mono', monospace;
}

.terminal-body {
    height: 440px;
    background: #030712;
    padding: 16px;
    overflow-y: auto;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    color: #e2e8f0;
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
    tab-size: 4;
}

.terminal-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.terminal-body::-webkit-scrollbar-track {
    background: #080d1a;
}
.terminal-body::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}
.terminal-body::-webkit-scrollbar-thumb:hover {
    background: #334155;
}

.terminal-input-bar {
    background: #0f172a;
    border-top: 1px solid #1f293d;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.terminal-prompt {
    color: #10b981;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f8fafc;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.terminal-quick-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 16px;
    background: #0b1324;
    border-top: 1px solid #1f293d;
}

.btn-chip {
    padding: 4px 10px;
    font-size: 12px;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s;
}
.btn-chip:hover {
    background: #334155;
    color: #f8fafc;
    border-color: #6366f1;
}

/* Terminal Logs Console */
.terminal-window {
    background: #030712;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    padding: 16px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: auto;
    font-size: 12px;
    color: #38bdf8;
    line-height: 1.5;
}

.terminal-window::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.terminal-window::-webkit-scrollbar-track {
    background: #080d1a;
}
.terminal-window::-webkit-scrollbar-thumb {
    background: #1e293b;
    border-radius: 4px;
}

.terminal-line {
    margin-bottom: 4px;
    word-break: break-all;
}
.terminal-line.err {
    color: #f87171;
}
.terminal-line.succ {
    color: #4ade80;
}

/* Modal Dialogs */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}
.modal-card, .modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 100%;
    max-width: 740px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}
.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(11, 15, 25, 0.4);
}
.modal-title {
    font-size: 17px;
    font-weight: 600;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-body {
    padding: 24px;
    overflow-y: auto;
}
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(11, 15, 25, 0.5);
}
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 640px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.search-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    align-items: center;
    background: rgba(11, 15, 25, 0.4);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.search-filter-bar .form-control {
    padding: 8px 12px;
    font-size: 13px;
}

.copy-proxy-btn {
    cursor: pointer;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    margin-top: 4px;
}
.copy-proxy-btn:hover {
    background: var(--accent-primary);
    color: #fff;
}
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: #1e1b4b;
    border: 1px solid var(--accent-primary);
    color: #c7d2fe;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.2s ease-out;
}

.code-box {
    background: #030712;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #38bdf8;
    white-space: pre-wrap;
    line-height: 1.5;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
