:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --background: #F3F4F6;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --success: #10B981;
    --danger: #EF4444;
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.panel-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 2rem;
}

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

h1, h2, h3 {
    font-weight: 600;
    color: var(--text-main);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    text-decoration: none;
}

.btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
}
.btn-danger:hover {
    background: #DC2626;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    color: var(--text-muted);
    background: #F9FAFB;
}

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

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }

.login-container {
    max-width: 400px;
    margin: 5rem auto;
}

.text-center { text-align: center; }
.mb-4 { margin-bottom: 1rem; }

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    .panel-card {
        padding: 1.5rem;
    }
    table {
        display: block;
        overflow-x: auto;
    }
}

.btn-secondary {
    background: #E5E7EB;
    color: var(--text-main);
}
.btn-secondary:hover {
    background: #D1D5DB;
}

.toggle-register-box {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.toggle-register-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

/* Telegram Preview Styles */
.tg-preview-container {
    background: #E4EFE9; /* Telegram chat background */
    background-image: url('data:image/svg+xml,%3Csvg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M0 0h100v100H0z" fill="none"/%3E%3Cpath d="M50 0C22.386 0 0 22.386 0 50s22.386 50 50 50 50-22.386 50-50S77.614 0 50 0zm0 90c-22.091 0-40-17.909-40-40S27.909 10 50 10s40 17.909 40 40-17.909 40-40 40z" fill="rgba(0,0,0,0.02)"/%3E%3C/svg%3E');
    border-radius: 8px;
    padding: 1rem;
    max-width: 400px;
    margin: 1rem auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    border: 1px solid #D1D5DB;
}

.tg-bubble {
    background: #FFFFFF;
    border-radius: 12px 12px 12px 0;
    padding: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    position: relative;
    max-width: 90%;
    margin-bottom: 0.5rem;
}

.tg-bubble::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 0 0, transparent 16px, #FFFFFF 17px);
}

.tg-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: none; /* hidden if no image */
}

.tg-text {
    font-size: 15px;
    line-height: 1.4;
    color: #000000;
    white-space: pre-wrap;
    padding: 0.25rem;
}

.tg-meta {
    text-align: right;
    font-size: 11px;
    color: #A0ACB6;
    margin-top: 2px;
    padding-right: 4px;
}

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

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    border: 1px solid transparent;
}
.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #F87171;
}
.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border-color: #34D399;
}
.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FBBF24;
}
}

/* Professional Header & Navigation */
.header {
    background: var(--surface);
    padding: 1rem 2rem;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: #F3F4F6;
    color: var(--primary);
}

.nav-item.active {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.nav-item.logout {
    color: var(--danger);
}

.nav-item.logout:hover {
    background: #FEE2E2;
}

.header h1 {
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}
