* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-card: #1e1e1e;
    --bg-card-hover: #252525;
    --gold: #d4a84b;
    --gold-light: #e8c36d;
    --gold-dark: #b8922f;
    --orange: #d97e2d;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #ef4444;
    --info: #3b82f6;
    --frozen: #00bfff;
    --border: #2a2a2a;
    --border-gold: rgba(212, 168, 75, 0.3);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--gold-light);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.navbar-brand img {
    width: 45px;
    height: 45px;
    border-radius: 10px;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 25px;
    list-style: none;
}

.navbar-nav a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    color: var(--gold);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gold);
}

.user-name {
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
    color: #000;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 168, 75, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--gold);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: #000;
}

.btn-info {
    background: var(--frozen);
    color: #000;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: var(--border-gold);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stat-card.active .stat-value { color: var(--success); }
.stat-card.frozen .stat-value { color: var(--frozen); }
.stat-card.expired .stat-value { color: var(--danger); }
.stat-card.warning .stat-value { color: var(--warning); }

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-badge.active {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
}

.status-badge.frozen {
    background: rgba(0, 191, 255, 0.15);
    color: var(--frozen);
}

.status-badge.expired {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.status-badge.none {
    background: rgba(102, 102, 102, 0.15);
    color: var(--text-muted);
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

tr:hover {
    background: var(--bg-card-hover);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 100px 20px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.hero-logo {
    width: 150px;
    height: 150px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(212, 168, 75, 0.3);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Dashboard */
.dashboard-header {
    padding: 40px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 30px;
}

.welcome-text {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.welcome-text span {
    color: var(--gold);
}

.subtitle {
    color: var(--text-secondary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Subscription Card */
.sub-card {
    position: relative;
    overflow: hidden;
}

.sub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--orange) 100%);
}

.sub-card.frozen::before {
    background: var(--frozen);
}

.sub-card.expired::before {
    background: var(--danger);
}

.sub-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sub-time {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold);
}

.sub-card.frozen .sub-time {
    color: var(--frozen);
}

.sub-card.expired .sub-time {
    color: var(--danger);
}

.sub-detail {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.sub-detail:last-child {
    border-bottom: none;
}

.sub-detail-label {
    color: var(--text-secondary);
}

/* Keys List */
.key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 10px;
}

.key-code {
    font-family: monospace;
    color: var(--gold);
}

.key-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Generated Keys Display */
.generated-keys {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.generated-key {
    font-family: monospace;
    padding: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copy-btn {
    background: var(--gold);
    color: #000;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Alert */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid var(--warning);
    color: var(--warning);
}

/* Admin Sidebar Layout */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 76px);
}

.admin-sidebar {
    width: 250px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 25px 0;
}

.admin-sidebar-nav {
    list-style: none;
}

.admin-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 25px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.admin-sidebar-nav a:hover,
.admin-sidebar-nav a.active {
    background: var(--bg-card);
    color: var(--gold);
    border-right: 3px solid var(--gold);
}

.admin-content {
    flex: 1;
    padding: 30px;
}

.admin-header {
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.admin-header p {
    color: var(--text-secondary);
}

/* Actions Row */
.actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 900px) {
    .admin-sidebar {
        display: none;
    }

    .admin-layout {
        flex-direction: column;
    }
}

/* Subscribers Cards */
.subscribers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.subscriber-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s;
}

.subscriber-card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
}

.subscriber-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--gold);
    margin-bottom: 15px;
}

.subscriber-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.subscriber-slot {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.subscriber-time {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 5px;
}

.subscriber-card.frozen .subscriber-time {
    color: var(--frozen);
}

/* Top-up Page Styles */
.topup-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    max-width: 600px;
    margin: 0 auto;
}

.topup-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.crypto-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.crypto-option {
    display: block;
    cursor: pointer;
}

.crypto-option input {
    display: none;
}

.crypto-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 15px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 10px;
    transition: all 0.2s;
}

.crypto-option input:checked + .crypto-label {
    border-color: var(--gold);
    background: rgba(212, 168, 75, 0.1);
}

.crypto-icon {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.price-summary {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.price-row:last-child {
    border-bottom: none;
}

.price-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold);
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid var(--gold);
    border-bottom: none;
}

.form-hint {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1rem;
}

/* Payment Details Styles */
.payment-info {
    text-align: center;
}

.payment-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 5px;
}

.payment-usd {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.payment-address-container {
    text-align: left;
    margin-bottom: 20px;
}

.payment-address {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    margin-top: 8px;
}

.payment-address code {
    flex: 1;
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--gold);
}

.qr-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.qr-code {
    max-width: 200px;
    border-radius: 10px;
    background: white;
    padding: 10px;
}

.payment-timer {
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-bottom: 15px;
}

.payment-note {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 10px;
}

.status-badge.pending {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}
