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

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #111118;
    --bg-card: rgba(31, 41, 55, 0.5);
    --border-color: rgba(55, 65, 81, 0.5);
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --blue: #3b82f6;
    --purple: #a855f7;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
    --cyan: #06b6d4;
    --banner-h: 32px;
    --navbar-h: 64px;
    --sidebar-w: 256px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Auth Pages */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    backdrop-filter: blur(20px);
}

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

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--blue);
}

.auth-form .btn-primary {
    width: 100%;
    margin-top: 1rem;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
}

.auth-footer button {
    background: none;
    border: none;
    color: var(--blue);
    cursor: pointer;
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(to right, var(--blue), #2563eb);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-danger {
    background: var(--red);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-logout {
    background: var(--red);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

/* Banner */
.banner {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--banner-h);
    background: #000;
    color: white;
    font-size: 14px;
    line-height: var(--banner-h);
    overflow: hidden;
    z-index: 100;
}

.marquee {
    display: flex;
    animation: scroll 30s linear infinite;
}

.marquee-content {
    flex-shrink: 0;
    padding: 0 3rem;
    white-space: nowrap;
}

@keyframes scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Navbar */
.navbar {
    position: fixed;
    top: var(--banner-h);
    width: 100%;
    height: var(--navbar-h);
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(17, 17, 24, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 99;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
}

.menu-toggle:hover {
    background: var(--bg-card);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, #ec4899, var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-badge {
    background: var(--bg-card);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: calc(var(--banner-h) + var(--navbar-h));
    width: var(--sidebar-w);
    height: calc(100vh - var(--banner-h) - var(--navbar-h));
    background: rgba(17, 17, 24, 0.5);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 98;
}

.sidebar-content {
    padding: 1.5rem;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
}

.logo-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sidebar-logo h2 {
    font-size: 1.125rem;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    width: 100%;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(to right, var(--blue), #2563eb);
    color: white;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-w);
    margin-top: calc(var(--banner-h) + var(--navbar-h));
    padding: 1.5rem;
    min-height: calc(100vh - var(--banner-h) - var(--navbar-h));
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

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

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

.bypass-info {
    color: var(--text-secondary);
}

.bypass-info code {
    background: var(--bg-card);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: monospace;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    backdrop-filter: blur(20px);
}

.stat-card.blue { background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), var(--bg-card)); }
.stat-card.purple { background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), var(--bg-card)); }
.stat-card.green { background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), var(--bg-card)); }
.stat-card.yellow { background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), var(--bg-card)); }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.green { background: var(--green); }
.status-dot.red { background: var(--red); }

.status-badge {
    font-weight: 600;
    color: var(--green);
}

.status-badge.off {
    color: var(--red);
}

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.text-muted {
    color: var(--text-secondary);
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    background: rgba(31, 41, 55, 0.5);
    color: var(--text-secondary);
    font-weight: 500;
}

.data-table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.data-table tr:hover {
    background: rgba(31, 41, 55, 0.3);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-green { background: rgba(34, 197, 94, 0.2); color: var(--green); }
.badge-red { background: rgba(239, 68, 68, 0.2); color: var(--red); }
.badge-yellow { background: rgba(234, 179, 8, 0.2); color: var(--yellow); }
.badge-blue { background: rgba(59, 130, 246, 0.2); color: var(--blue); }

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

.table-actions button {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.25rem;
    color: var(--text-secondary);
}

.table-actions button:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.table-actions .delete:hover {
    color: var(--red);
}

/* Settings */
.settings-grid {
    display: grid;
    gap: 1.5rem;
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.setting-item input,
.setting-item select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
}

.setting-item select {
    cursor: pointer;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    animation: slideIn 0.3s ease;
    min-width: 250px;
}

.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

.selected-template {
    background: var(--bg-secondary);
    border-left: 3px solid var(--blue);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

/* Crypto Selector */
.crypto-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crypto-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.crypto-btn:hover {
    border-color: var(--blue);
    color: var(--text-primary);
}

.crypto-btn.active {
    background: linear-gradient(to right, var(--blue), #2563eb);
    border-color: var(--blue);
    color: white;
}

.crypto-icon {
    font-size: 1rem;
    font-weight: 700;
}

/* Domain Availability */
.domain-availability {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 2rem;
}

.domain-availability.idle {
    display: none;
}

.domain-availability.checking {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.domain-availability.available {
    background: rgba(34, 197, 94, 0.1);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.domain-availability.taken {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.domain-availability.invalid {
    background: rgba(234, 179, 8, 0.1);
    color: var(--yellow);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.domain-availability.error {
    background: rgba(234, 179, 8, 0.1);
    color: var(--yellow);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.avail-icon {
    font-weight: 700;
}

.avail-text {
    flex: 1;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

/* Invoice Modal */
.invoice-modal {
    max-width: 450px;
}

.invoice-content {
    text-align: center;
}

.invoice-domain {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.invoice-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--green);
    margin-bottom: 1rem;
}

.invoice-address-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.invoice-qr {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    display: inline-block;
}

.invoice-qr canvas {
    display: block;
}

.invoice-address-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.invoice-address-box input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.875rem;
}

.copy-btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--blue);
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s;
}

.copy-btn:hover {
    opacity: 0.9;
}

.invoice-timer {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

#invoiceTimer {
    font-weight: 600;
    font-family: monospace;
    color: var(--yellow);
}

.invoice-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    color: var(--blue);
    font-weight: 500;
}

.invoice-status.confirmed {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: var(--green);
}

.invoice-status.expired {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--red);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-dot.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.invoice-warning {
    font-size: 0.75rem;
    color: var(--yellow);
    padding: 0.5rem;
    background: rgba(234, 179, 8, 0.1);
    border-radius: 0.375rem;
}

.invoice-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}
