/* ============================================
   CONVERTER BOT ADMIN — PREMIUM DARK THEME
   ============================================ */

:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1a2744;
    --bg-input: #0a0a1a;
    --bg-sidebar: #0d1117;

    --text-primary: #e6e6fa;
    --text-secondary: #8892b0;
    --text-muted: #5e6687;

    --accent-blue: #4f8cff;
    --accent-purple: #a855f7;
    --accent-green: #34d399;
    --accent-red: #ef4444;
    --accent-orange: #f59e0b;

    --gradient-blue: linear-gradient(135deg, #4f8cff 0%, #3b5bdb 100%);
    --gradient-purple: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    --gradient-green: linear-gradient(135deg, #34d399 0%, #059669 100%);

    --border-color: rgba(255, 255, 255, 0.06);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.5);
    --shadow-glow-blue: 0 0 20px rgba(79, 140, 255, 0.15);
    --shadow-glow-purple: 0 0 20px rgba(168, 85, 247, 0.15);
    --shadow-glow-green: 0 0 20px rgba(52, 211, 153, 0.15);

    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 260px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* ============ LOGIN ============ */
#login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(79, 140, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 50%);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 48px 40px;
    width: 420px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
}

.login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.logo-icon {
    font-size: 48px;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 12px rgba(79, 140, 255, 0.4));
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #4f8cff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ============ FORM ELEMENTS ============ */
.input-group {
    margin-bottom: 18px;
}

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

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

.input-group input::placeholder,
.input-group textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-blue);
    color: #fff;
    box-shadow: var(--shadow-glow-blue);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(79, 140, 255, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-success {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.btn-success:hover {
    background: rgba(52, 211, 153, 0.25);
}

.btn-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.btn-warning:hover {
    background: rgba(245, 158, 11, 0.25);
}

.btn-full { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.error-text {
    color: var(--accent-red);
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
    min-height: 20px;
}

/* ============ DASHBOARD LAYOUT ============ */
#dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
}

.sidebar-logo {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #4f8cff, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon-sm {
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(79, 140, 255, 0.4));
    -webkit-text-fill-color: initial;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

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

.nav-item.active {
    background: rgba(79, 140, 255, 0.1);
    color: var(--accent-blue);
    box-shadow: inset 3px 0 0 var(--accent-blue);
}

.nav-icon {
    font-size: 18px;
}

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

/* ============ TOP BAR ============ */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

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

.admin-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    transition: var(--transition);
    cursor: default;
}

.admin-profile-badge:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(79, 140, 255, 0.3);
}

.admin-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: var(--shadow-glow-blue);
}

.admin-info {
    display: flex;
    flex-direction: column;
}

.admin-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.admin-role-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px 40px;
    min-height: 100vh;
    background-image:
        radial-gradient(ellipse at 70% 10%, rgba(79, 140, 255, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 50%);
}

.section {
    display: none;
}

.section.active-section {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

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

.section-header h2 {
    font-size: 26px;
    font-weight: 700;
}

/* ============ STAT CARS ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.stat-card {
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.stat-card:hover {
    transform: translateY(-2px);
}

.card-gradient-blue {
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.12) 0%, rgba(59, 91, 219, 0.06) 100%);
    box-shadow: var(--shadow-glow-blue);
}

.card-gradient-purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.12) 0%, rgba(124, 58, 237, 0.06) 100%);
    box-shadow: var(--shadow-glow-purple);
}

.card-gradient-green {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.12) 0%, rgba(5, 150, 105, 0.06) 100%);
    box-shadow: var(--shadow-glow-green);
}

.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
}

/* ============ CARDS ============ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
}

.card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-secondary);
}

.mt-24 { margin-top: 24px; }

/* ============ FEATURE LIST ============ */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.feature-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
}

.feature-name {
    font-size: 14px;
    font-weight: 500;
}

.feature-count {
    font-size: 14px;
    color: var(--accent-blue);
    font-weight: 600;
    background: rgba(79, 140, 255, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============ CHANNEL LIST ============ */
.channel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.channel-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.channel-item:hover {
    background: rgba(255,255,255,0.04);
}

.channel-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.channel-name {
    font-size: 14px;
    font-weight: 500;
}

.channel-id-text {
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'SF Mono', monospace;
}

.channel-actions {
    display: flex;
    gap: 8px;
}

.badge-active {
    color: var(--accent-green);
    font-size: 12px;
    font-weight: 600;
}

.badge-inactive {
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 600;
}

/* ============ FORM ROW ============ */
.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.form-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.form-row .btn {
    height: 44px;
    margin-bottom: 0;
}

.form-actions {
    margin-top: 8px;
}

/* ============ STATUS BADGE ============ */
.status-badge {
    margin-top: 16px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: rgba(79, 140, 255, 0.1);
    border: 1px solid rgba(79, 140, 255, 0.2);
    color: var(--accent-blue);
}

.status-badge.success {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.2);
    color: var(--accent-green);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

/* ============ SEARCH & HEADER ACTIONS ============ */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    width: 240px;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* ============ DATA TABLE ============ */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table tbody tr {
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody td {
    padding: 12px 14px;
    color: var(--text-primary);
}

/* Activity Modal Specifics */
#activity-tbody td {
    white-space: nowrap;
}

#activity-tbody td:last-child {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-truncate {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

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

.user-status-active {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(52, 211, 153, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.user-status-blocked {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
}

/* ============ MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 480px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.modal-body {
    padding: 20px 24px;
}

.modal-user-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding: 10px 14px;
    background: rgba(79, 140, 255, 0.06);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(79, 140, 255, 0.1);
}

.modal-body .form-actions {
    display: flex;
    gap: 10px;
}

/* ============ USER TABLE ENHANCEMENTS ============ */
.user-cell, .name-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.u-username {
    font-weight: 600;
    color: var(--text-primary);
}

.u-premium {
    font-size: 10px;
    color: var(--accent-orange);
    font-weight: 700;
    text-transform: uppercase;
}

.u-lang {
    font-size: 10px;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 1px 4px;
    border-radius: 4px;
    align-self: flex-start;
}

.action-buttons {
    display: flex;
    gap: 6px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: hidden;
    }

    .sidebar-logo span,
    .nav-item span:last-child,
    .sidebar-footer button span:last-child {
        display: none;
    }

    .sidebar-logo {
        justify-content: center;
        padding: 16px;
    }

    .main-content {
        margin-left: 60px;
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        flex-direction: column;
    }

    .search-input {
        width: 100%;
    }
}

/* Capabilities Grid */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.cap-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.cap-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
    border-color: rgba(67, 97, 238, 0.3);
}

.cap-item span {
    color: var(--text-secondary);
}
