/* MOEE Anti-Detect Cloud Admin — Premium Dark Cyberpunk / AI SaaS Theme */
:root {
    --bg-main: #09090b;
    --bg-surface: #121215;
    --bg-surface-elevated: #18181b;
    --bg-sidebar: #060608;
    --bg-input: #0e0e11;
    --border: #27272a;
    --border-hover: #3f3f46;
    --text-primary: #f4f4f5;
    --text-muted: #a1a1aa;
    --text-dim: #71717a;
    --primary: #ffffff;
    --primary-hover: #e4e4e7;
    --primary-text: #000000;
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.12);
    --warning: #eab308;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.6);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.brand-logo-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.brand-title {
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.brand-sub {
    font-size: 0.68rem;
    color: var(--text-dim);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-btn .nav-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    transition: color 0.2s;
}

.nav-btn:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border);
}

.nav-btn:hover .nav-icon-svg {
    color: #ffffff;
}

.nav-btn.active {
    background: var(--bg-surface);
    color: #ffffff;
    border-color: var(--border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.nav-btn.active .nav-icon-svg {
    color: #ffffff;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 32px;
    height: 32px;
    background: var(--bg-surface-elevated);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.8rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
}

.user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
}

.user-role {
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.logout-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    background: var(--bg-main);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.btn-primary:hover {
    background: #e4e4e7;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.15);
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    border-color: var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--border-hover);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
}

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

/* STATUS PILLS */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.status-pill.online {
    background: var(--success-bg);
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.25);
}

/* METRICS GRID */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 1.4rem;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.metric-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.metric-icon-box {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.metric-value {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.3rem;
    color: #ffffff;
}

.metric-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* SECTION CARDS & TABLES */
.section-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 2rem;
}

.section-header {
    margin-bottom: 1.25rem;
}

.section-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.text-muted {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.data-table th {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem 1rem;
    border-bottom: 1px solid #1a1a20;
    color: var(--text-primary);
}

.data-table tr:hover td {
    background: var(--bg-surface-elevated);
}

.data-table code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: #000000;
    border: 1px solid var(--border);
    padding: 0.2rem 0.45rem;
    border-radius: 4px;
    color: #d4d4d8;
}

/* TAB PANES */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* FORMS */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.form-control,
input[type="text"],
input[type="password"],
input[type="email"],
select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 0.75rem 0.95rem;
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.88rem;
    outline: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
select:focus {
    border-color: #ffffff;
    background: #141418;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.08);
}

/* LOGIN SCREEN */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 20%, #18181f 0%, #09090b 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    width: 420px;
    max-width: 90vw;
    padding: 2.75rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.login-logo-img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border-radius: 16px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.25));
}

.login-brand h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin-bottom: 0.3rem;
}

.login-brand p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.alert-box.error {
    background: var(--danger-bg);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    text-align: left;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    width: 480px;
    max-width: 90vw;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close:hover {
    color: #ffffff;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

/* SYNC GRID */
.sync-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.sync-box {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.sync-box h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 1rem;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.feature-list strong {
    color: #ffffff;
    font-family: var(--font-mono);
}

/* IMPERSONATION BANNER & SAAS TIERS */
.impersonation-bar {
    background: linear-gradient(90deg, #7c3aed, #4f46e5);
    color: #ffffff;
    padding: 0.6rem 1.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    z-index: 100;
}

.impersonation-bar .imp-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.impersonation-bar .imp-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-exit-imp {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-exit-imp:hover {
    background: #ffffff;
    color: #000000;
}

.badge-root {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-manager {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.35);
    color: #60a5fa;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}

.badge-operator {
    background: rgba(161, 161, 170, 0.15);
    border: 1px solid rgba(161, 161, 170, 0.3);
    color: #e4e4e7;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}

.badge-quota {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-primary);
    background: var(--bg-surface);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.btn-impersonate {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(124, 58, 237, 0.4);
    font-weight: 600;
}

.btn-impersonate:hover {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
}

.table-header-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}

.tag-system {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.tag-tenant {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

