:root {
    --bg-dark: #0b0f17;
    --bg-card: #151e2c;
    --bg-panel: #111823;
    --border-color: #243247;
    --primary: #0088cc;
    --primary-hover: #0077b3;
    --purple: #8e44ad;
    --gold: #f39c12;
    --green: #2ecc71;
    --red: #e74c3c;
    --text-main: #f0f3f6;
    --text-muted: #8b9bb4;
    --card-bg-light: #f8f9fa;
    --card-text-dark: #212529;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #0e1724 0%, #152235 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

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

.logo-icon {
    font-size: 28px;
    background: rgba(255,255,255,0.05);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.brand-text h1 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #fff;
}

.brand-text p {
    font-size: 11px;
    color: var(--text-muted);
}

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

.stat-pill {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-label {
    color: var(--text-muted);
    font-weight: 700;
}

.stat-value {
    font-weight: 700;
    color: #fff;
}

.text-purple { color: #bb86fc !important; }
.text-green { color: #2ecc71 !important; }
.text-red { color: #e74c3c !important; }

.stat-badge.online {
    color: #2ecc71;
    font-weight: 700;
}

.stat-badge.offline {
    color: #e74c3c;
    font-weight: 700;
}

.header-network {
    font-size: 11px;
    background: rgba(0, 136, 204, 0.1);
    border: 1px solid rgba(0, 136, 204, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
}

.header-network code {
    font-family: 'JetBrains Mono', monospace;
    color: #38bdf8;
    font-weight: 600;
    margin-left: 4px;
}

/* Layout */
.main-container {
    display: grid;
    grid-template-columns: 460px 1fr;
    gap: 18px;
    padding: 16px;
    flex: 1;
    height: calc(100vh - 65px);
    overflow: hidden;
}

/* Left Fleet Panel */
.fleet-panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 700;
}

.badge {
    background: var(--primary);
    color: #fff;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* FILTER HUB */
.filter-hub {
    padding: 10px 12px;
    background: rgba(0,0,0,0.25);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.filter-title {
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    width: 75px;
    flex-shrink: 0;
}

.btn-filter {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-filter:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
    border-color: #3f5573;
}

.badge-ofc-filter { color: #93c5fd !important; }
.badge-con-filter { color: #6ee7b7 !important; }
.badge-ghost-filter { color: #d8b4fe !important; }

/* Visa Type Buttons */
.visa-b { color: #60a5fa !important; border-color: rgba(96, 165, 250, 0.4) !important; }
.visa-h { color: #fb923c !important; border-color: rgba(251, 146, 60, 0.4) !important; }
.visa-f { color: #4ade80 !important; border-color: rgba(74, 222, 128, 0.4) !important; }
.visa-l { color: #c084fc !important; border-color: rgba(192, 132, 252, 0.4) !important; }
.visa-j { color: #2dd4bf !important; border-color: rgba(45, 212, 191, 0.4) !important; }
.visa-m { color: #facc15 !important; border-color: rgba(250, 204, 21, 0.4) !important; }

.filter-select {
    background: #0d131d;
    color: #fff;
    border: 1px solid var(--border-color);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    outline: none;
    flex: 1;
}

.laptop-quick-chips, .letter-quick-chips {
    display: flex;
    gap: 3px;
}

.btn-chip {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: #94a3b8;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    cursor: pointer;
}

.btn-chip:hover {
    background: var(--primary);
    color: #fff;
}

/* Profiles List */
.profiles-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.profile-card:hover {
    border-color: #3f5573;
    transform: translateY(-1px);
}

.profile-card.selected {
    border-color: var(--primary);
    background: rgba(0, 136, 204, 0.1);
}

.profile-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.profile-id-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-id-title {
    font-weight: 700;
    font-size: 12px;
    color: #fff;
}

.profile-pills-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.profile-pill {
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
}

.pill-laptop { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.pill-visa { background: rgba(250, 204, 21, 0.15); color: #facc15; border: 1px solid rgba(250, 204, 21, 0.3); }
.pill-tag { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }

.profile-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-ofc { background: #1e3a8a; color: #93c5fd; }
.badge-con { background: #064e3b; color: #6ee7b7; }
.badge-ghost-on { background: #581c87; color: #d8b4fe; border: 1px solid #a855f7; animation: pulseGlow 1.5s infinite; }
.badge-ghost-off { background: #374151; color: #9ca3af; }

@keyframes pulseGlow {
    0% { box-shadow: 0 0 2px #a855f7; }
    50% { box-shadow: 0 0 8px #a855f7; }
    100% { box-shadow: 0 0 2px #a855f7; }
}

.profile-applicant {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.profile-applicant strong {
    color: #cbd5e1;
}

.profile-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 5px;
    margin-top: 5px;
}

.btn-load-config {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: #38bdf8;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    cursor: pointer;
}

.btn-load-config:hover {
    background: var(--primary);
    color: #fff;
}

/* Mini Console */
.mini-console-header {
    padding: 8px 14px;
    border-top: 1px solid var(--border-color);
    background: rgba(0,0,0,0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mini-console-header h3 {
    font-size: 11px;
    color: var(--text-muted);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
}

.mini-console {
    height: 110px;
    background: #080c12;
    padding: 8px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    overflow-y: auto;
    border-top: 1px solid var(--border-color);
}

.log-line {
    margin-bottom: 3px;
    word-break: break-all;
}

.log-line.text-muted { color: #64748b; }
.log-line.text-info { color: #38bdf8; }
.log-line.text-success { color: #4ade80; }
.log-line.text-warn { color: #facc15; }
.log-line.text-error { color: #f87171; }

/* Right Replica Panel */
.replica-panel {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-right: 4px;
}

/* Target Banner */
.target-banner {
    background: linear-gradient(90deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.15);
}

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

.target-icon {
    font-size: 24px;
}

.target-info strong {
    font-size: 13px;
    color: #38bdf8;
    display: block;
}

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

.target-actions {
    display: flex;
    gap: 8px;
}

/* Script UI Replica Container */
.script-ui-card {
    background-color: #2b3e50; /* Same as userscript background */
    border: 2px solid #4f8a8b;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.script-title-bar {
    text-align: center;
    margin-bottom: 12px;
}

.script-title-bar h4 {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
    background: rgba(0,0,0,0.25);
    padding: 5px;
    border-radius: 6px;
}

.sniper-badge {
    color: #00ff00;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

/* Master Action Buttons */
.master-action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.btn-lg {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-ghost-start {
    background: linear-gradient(135deg, #800080 0%, #a855f7 100%);
    color: #fff;
    box-shadow: 0 4px 10px rgba(128, 0, 128, 0.4);
}

.btn-ghost-start:hover {
    filter: brightness(1.15);
}

.btn-ghost-stop-btn {
    background: #000000;
    color: #fff;
    border: 1px solid #ef4444 !important;
}

.btn-ghost-stop-btn:hover {
    background: #1c1c1c;
}

.btn-regular-action {
    background-color: #dc3545;
    color: #fff;
}

.btn-regular-action:hover {
    background-color: #c82333;
}

.btn-regular-resume {
    background-color: #28a745 !important;
    color: #fff !important;
}

.btn-reload-action {
    background-color: #475569;
    color: #fff;
}

.btn-reload-action:hover {
    background-color: #334155;
}

/* Cards Grid */
.replica-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.replica-card {
    background-color: var(--card-bg-light);
    color: var(--card-text-dark);
    border-radius: 6px;
    padding: 10px 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.replica-card.card-burst {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
}

.replica-card.card-purple {
    background-color: #f8e6fa;
    border: 1px solid #800080;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 5px;
    margin-bottom: 6px;
}

.card-header strong {
    font-size: 12px;
}

.card-quick-actions a {
    font-size: 10px;
    color: #0088cc;
    text-decoration: none;
    font-weight: 600;
}

.card-quick-actions a:hover {
    text-decoration: underline;
}

/* Form Elements */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-size: 11px;
    user-select: none;
    gap: 8px;
}

.custom-checkbox input {
    width: 15px;
    height: 15px;
    cursor: pointer;
    accent-color: #0088cc;
}

.custom-checkbox .label-text {
    color: #212529;
}

.date-ranges-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.date-range-row {
    display: flex;
    gap: 5px;
    align-items: center;
}

.date-range-row input[type="date"] {
    flex: 1;
    padding: 3px 5px;
    font-size: 11px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.form-group label {
    font-size: 10px;
    font-weight: 700;
    color: #333;
}

.form-input, .form-select {
    padding: 4px 6px;
    font-size: 11px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
    color: #000;
    outline: none;
}

.form-input:focus, .form-select:focus {
    border-color: #0088cc;
}

.form-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.flex-1 { flex: 1; }
.mt-1 { margin-top: 3px; }
.mt-2 { margin-top: 6px; }
.font-bold { font-weight: 700; }
.text-bold { font-weight: 700; }

/* Buttons & Footer */
.footer-actions {
    margin-top: 14px;
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-primary {
    background: #0088cc;
    color: #fff;
}

.btn-primary:hover {
    background: #0077b3;
}

.btn-gold {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
}

.btn-gold:hover {
    filter: brightness(1.1);
}

.footer-actions .btn {
    flex: 1;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: #1e293b;
    border: 1px solid #38bdf8;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 1100px) {
    .main-container {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }
    .replica-grid {
        grid-template-columns: 1fr;
    }
}

/* Pending Access Requests Box */
.pending-approval-box {
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.1) 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0%, 100% { border-color: #f59e0b; }
    50% { border-color: #fbbf24; }
}

.pending-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pending-header strong {
    font-size: 13px;
    color: #f59e0b;
}

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

.pending-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pending-item {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.pending-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pending-id {
    font-weight: 700;
    font-size: 12px;
    color: #38bdf8;
}

.pending-meta {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
    align-items: center;
}

.pending-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-approve {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-approve:hover {
    background: #059669;
}

.btn-deny {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-deny:hover {
    background: #dc2626;
}

/* Master PIN Modal */
.pin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 23, 0.95);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-card {
    background: #151e2c;
    border: 1px solid #38bdf8;
    border-radius: 12px;
    padding: 30px;
    width: 360px;
    text-align: center;
    box-shadow: 0 12px 36px rgba(0,0,0,0.8);
}

.pin-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.pin-card h2 {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 6px;
}

.pin-card p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.pin-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.pin-input-group input {
    flex: 1;
    background: #0b0f17;
    border: 1px solid #243247;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 16px;
    color: #fff;
    text-align: center;
    letter-spacing: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.pin-input-group input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.pin-error {
    color: #ef4444;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

.pin-hint {
    font-size: 10px;
    color: #64748b;
    display: block;
    margin-top: 8px;
}

