:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-primary-hover: #2563eb;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;
    
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
    
    --font-main: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.2) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.2) 0, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

/* Login Page Styles */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: fadeIn 0.6s ease-out forwards;
}

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

.login-panel {
    padding: 40px 30px;
    text-align: center;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 30px;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    transition: all 0.3s ease;
}

.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    margin: 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 16px;
    height: calc(100vh - 32px);
    z-index: 10;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: white;
}

.logo ion-icon {
    font-size: 28px;
    color: var(--accent-primary);
}

.sidebar-nav {
    padding: 24px 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border-right: 3px solid var(--accent-primary);
}

.nav-item ion-icon {
    font-size: 20px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--glass-border);
}

.logout-btn:hover {
    color: var(--accent-danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 16px 32px 32px 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-top: 16px;
}

.top-header h1 {
    font-size: 28px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    margin-top: 4px;
}

.user-profile .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
}

/* Tabs */
.tab-content {
    display: none;
    animation: fadeInTab 0.4s ease forwards;
}

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

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

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

.stat-card {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
}

.income-icon { background: rgba(16, 185, 129, 0.1); color: var(--accent-success); }
.users-icon { background: rgba(59, 130, 246, 0.1); color: var(--accent-primary); }
.level-icon { background: rgba(245, 158, 11, 0.1); color: var(--accent-warning); }
.average-icon { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.stat-details h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Content Grid & Tables */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.section-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.highlight-text {
    color: var(--accent-primary);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s;
}

.btn-icon:hover {
    color: var(--text-primary);
    transform: rotate(180deg);
}

.table-container {
    padding: 0 24px 24px 24px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.data-table th, .data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table th {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.data-table tbody tr {
    transition: background 0.3s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-online {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}
.status-online::before { background: var(--accent-success); }


/* TG Bot Panel specific */
.tg-bot-panel {
    padding: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    padding: 8px 16px;
    background: rgba(0,0,0,0.2);
    border-radius: 20px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.status-indicator.online { background: var(--accent-success); color: var(--accent-success); }
.status-indicator.offline { background: var(--accent-danger); color: var(--accent-danger); }

.bot-controls {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--glass-border);
}

button[class^="btn-"], button[class*=" btn-"] {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-success { background: var(--accent-success); color: white; }
.btn-success:hover:not(:disabled) { background: #059669; transform: translateY(-2px); }

.btn-danger { background: var(--accent-danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #dc2626; transform: translateY(-2px); }

.btn-warning { background: var(--accent-warning); color: #fff; }
.btn-warning:hover:not(:disabled) { background: #d97706; transform: translateY(-2px); }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 24px; }

.send-nick-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

@media (max-width: 768px) {
    .send-nick-form {
        grid-template-columns: 1fr;
    }
}

.input-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.input-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-group select option {
    background: #1e293b;
    color: var(--text-primary);
}

.bot-settings h3, .bot-logs h3 {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
}

.terminal-mockup {
    background: #000;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    height: 200px;
    overflow-y: auto;
    border: 1px solid #333;
}

.log-entry { margin-bottom: 6px; }
.log-entry.system { color: #888; }
.log-entry.info { color: #3b82f6; }
.log-entry.success { color: #10b981; }
.log-entry.error { color: #ef4444; }

/* Responsive */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: auto;
        height: auto;
        position: static;
        margin-bottom: 0;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 12px;
    }
    
    .main-content {
        padding: 16px;
    }
}
