:root {
    --clr-bg: #0A0A0C;
    --clr-bg-alt: #121217;
    --clr-primary: #E01919;
    --clr-text: #F3F4F6;
    --clr-text-muted: #9CA3AF;
    --clr-surface: rgba(255, 255, 255, 0.03);
    --clr-surface-border: rgba(255, 255, 255, 0.08);
    --font-primary: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--clr-bg);
    color: var(--clr-text);
}

.dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--clr-bg-alt);
    border-right: 1px solid var(--clr-surface-border);
    display: flex;
    flex-direction: column;
    transition: 0.3s;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    border-bottom: 1px solid var(--clr-surface-border);
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--clr-text-muted);
    text-decoration: none;
    transition: 0.2s;
}

.nav-menu li a:hover, .nav-menu li.active a {
    background-color: var(--clr-surface);
    color: var(--clr-text);
    border-right: 3px solid var(--clr-primary);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--clr-surface-border);
}

.logout {
    color: var(--clr-text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.logout:hover { color: var(--clr-text); }

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-header {
    height: 70px;
    background-color: var(--clr-bg-alt);
    border-bottom: 1px solid var(--clr-surface-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--clr-surface);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    width: 300px;
    border: 1px solid var(--clr-surface-border);
}
.search-bar input {
    background: transparent;
    border: none;
    color: var(--clr-text);
    outline: none;
    width: 100%;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notifications {
    position: relative;
    cursor: pointer;
    color: var(--clr-text-muted);
    font-size: 1.25rem;
}
.notifications .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--clr-primary);
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: bold;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--clr-surface);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--clr-surface-border);
}

.content-wrapper {
    padding: 2rem;
}
.content-wrapper h2 {
    margin-bottom: 1.5rem;
}

/* View Sections */
.view-section {
    display: none;
    animation: fadeIn 0.4s ease;
}
.view-section.active {
    display: block;
}

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

.chart-container {
    padding: 1.5rem;
    background: var(--clr-bg-alt);
    border: 1px solid var(--clr-surface-border);
    border-radius: 12px;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--clr-bg-alt);
    border: 1px solid var(--clr-surface-border);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(224, 25, 25, 0.1);
    color: var(--clr-primary);
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}
.stat-icon.alert { background: rgba(255, 165, 0, 0.1); color: orange; }

.stat-details h3 { font-size: 1rem; color: var(--clr-text-muted); font-weight: 500; margin-bottom: 0.25rem; }
.stat-details .value { font-size: 2rem; font-weight: 700; color: var(--clr-text); margin-bottom: 0.25rem; }
.stat-details .trend { font-size: 0.875rem; }
.trend.positive { color: #10B981; }
.trend.negative { color: #EF4444; }

/* Table Section */
.data-section {
    background: var(--clr-bg-alt);
    border: 1px solid var(--clr-surface-border);
    border-radius: 12px;
    padding: 1.5rem;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--clr-surface-border);
    color: var(--clr-text);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
}
.btn-outline:hover { background: var(--clr-surface); }

table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--clr-surface-border);
}
th { color: var(--clr-text-muted); font-weight: 500; }
.status { padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.8rem; font-weight: bold; }
.status.success, .status.completed { background: rgba(16, 185, 129, 0.15); color: #10B981; }
.status.pending { background: rgba(245, 158, 11, 0.15); color: #F59E0B; }
.status.failed { background: rgba(239, 68, 68, 0.15); color: #EF4444; }

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 0.5rem;
}
.filter-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--clr-surface-border);
    color: var(--clr-text-muted);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.filter-pill:hover, .filter-pill.active {
    background: var(--clr-primary);
    color: white;
    border-color: var(--clr-primary);
}

/* Payment Gateway Method Tags */
.method-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
}
.method-tag.stripe i { color: #635bff; }
.method-tag.paypal i { color: #00457c; }
.method-tag.crypto i { color: #f7931a; }

/* Threat Severity Badges */
.severity {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.severity.critical {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
}
.severity.high {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.severity.medium {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Settings Components */
.settings-card {
    background: var(--clr-bg-alt);
    border: 1px solid var(--clr-surface-border);
    border-radius: 12px;
}

/* License Keys Management Styles */
.key-code-pill {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.88rem;
    font-weight: 600;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    letter-spacing: 0.5px;
}
.key-code-pill .copy-key-btn {
    background: none;
    border: none;
    color: var(--clr-text-muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: 0.2s;
}
.key-code-pill .copy-key-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}
.key-plan-tag {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--clr-text);
    border: 1px solid var(--clr-surface-border);
}
.key-plan-tag.premium {
    border-color: rgba(224, 25, 25, 0.4);
    background: rgba(224, 25, 25, 0.1);
    color: #ff6b6b;
}
.key-plan-tag.advanced {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.1);
    color: #c084fc;
}
.key-plan-tag.basic {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
}
.key-plan-tag.all {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
}
.btn-table-action {
    background: transparent;
    border: 1px solid var(--clr-surface-border);
    color: var(--clr-text-muted);
    padding: 0.35rem 0.6rem;
    border-radius: 5px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.btn-table-action:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--clr-text);
}
.btn-table-action.danger:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   ADMIN LOGIN GATE & AUTHENTICATION OVERLAY
   ========================================================================== */
#admin-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 20%, #1c1518 0%, #0c0d12 70%, #06070a 100%);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.admin-login-card {
    width: 100%;
    max-width: 440px;
    background: rgba(18, 20, 29, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(224, 25, 25, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.admin-login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #E01919, #ff5252, #E01919);
}

.admin-login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.admin-login-shield {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    background: rgba(224, 25, 25, 0.12);
    border: 2px solid rgba(224, 25, 25, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff3838;
    font-size: 1.8rem;
    box-shadow: 0 0 25px rgba(224, 25, 25, 0.3);
}

.admin-login-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.admin-login-sub {
    font-size: 0.82rem;
    color: var(--clr-text-muted);
}

.admin-input-group {
    margin-bottom: 1.25rem;
}

.admin-input-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #d1d5db;
    margin-bottom: 0.4rem;
}

.admin-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.admin-input-icon {
    position: absolute;
    left: 1rem;
    color: #6b7280;
    font-size: 0.95rem;
    pointer-events: none;
}

.admin-input-field {
    width: 100%;
    height: 46px;
    background: rgba(10, 12, 18, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 0 1rem 0 2.6rem;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.admin-input-field:focus {
    border-color: #E01919;
    box-shadow: 0 0 0 3px rgba(224, 25, 25, 0.2);
    background: rgba(10, 12, 18, 0.95);
}

.btn-toggle-pw {
    position: absolute;
    right: 0.85rem;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.25rem;
}

.btn-toggle-pw:hover {
    color: #e5e7eb;
}

.admin-login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
}

.admin-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9ca3af;
    cursor: pointer;
}

.admin-checkbox-label input {
    accent-color: #E01919;
    cursor: pointer;
}

.btn-admin-submit {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #E01919 0%, #b81414 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(224, 25, 25, 0.35);
}

.btn-admin-submit:hover {
    background: linear-gradient(135deg, #ff2424 0%, #c81616 100%);
    box-shadow: 0 6px 20px rgba(224, 25, 25, 0.5);
    transform: translateY(-1px);
}

.btn-admin-submit:active {
    transform: translateY(0);
}

.admin-login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #fca5a5;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    display: none;
}

.admin-login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.admin-login-footer a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s;
}

.admin-login-footer a:hover {
    color: #ffffff;
}

.shake-anim {
    animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.btn-admin-logout-top {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ff6b6b;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: 0.2s ease;
}

.btn-admin-logout-top:hover {
    background: #E01919;
    color: white;
}

/* ==========================================================================
   ADMIN MODALS (USER MODAL & PLAN MODAL)
   ========================================================================== */
.admin-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 1.5rem;
}

.admin-modal-backdrop.open {
    display: flex;
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.admin-modal-card {
    background: #151821;
    border: 1px solid var(--clr-surface-border);
    border-radius: 16px;
    width: 100%;
    max-width: 580px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--clr-surface-border);
    background: rgba(255, 255, 255, 0.02);
}

.admin-modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--clr-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: 0.2s;
}

.btn-close-modal:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.admin-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--clr-surface-border);
    background: rgba(255, 255, 255, 0.02);
}

.admin-form-row {
    margin-bottom: 1rem;
}

.admin-form-row.double {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.admin-form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 0.35rem;
}

.admin-form-input, .admin-form-select, .admin-form-textarea {
    width: 100%;
    background: #0d0f17;
    border: 1px solid var(--clr-surface-border);
    border-radius: 8px;
    padding: 0.65rem 0.9rem;
    color: #ffffff;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.admin-form-input:focus, .admin-form-select:focus, .admin-form-textarea:focus {
    border-color: #E01919;
    box-shadow: 0 0 0 2px rgba(224, 25, 25, 0.2);
}

/* ==========================================================================
   PACKS & PRICING CARDS
   ========================================================================== */
.admin-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-plan-card {
    background: var(--clr-bg-alt);
    border: 1px solid var(--clr-surface-border);
    border-radius: 14px;
    padding: 1.75rem;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.admin-plan-card:hover {
    border-color: rgba(224, 25, 25, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.admin-plan-card.featured {
    border-color: #E01919;
    box-shadow: 0 0 25px rgba(224, 25, 25, 0.15);
}

.admin-plan-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #E01919;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    text-transform: uppercase;
}

.admin-plan-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.35rem;
}

.admin-plan-devices {
    font-size: 0.85rem;
    color: #38bdf8;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.admin-plan-pricing-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.admin-plan-price-main {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
}

.admin-plan-price-orig {
    font-size: 0.9rem;
    color: var(--clr-text-muted);
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.admin-plan-save-pill {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.admin-plan-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    flex: 1;
}

.admin-plan-features-list li {
    font-size: 0.85rem;
    color: #d1d5db;
    padding: 0.35rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-plan-features-list li i {
    color: #10b981;
    font-size: 0.8rem;
}

.admin-plan-actions {
    display: flex;
    gap: 0.5rem;
}

.status.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status.suspended {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status.expired {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.user-avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    border: 1px solid rgba(59, 130, 246, 0.3);
}




