/* ═══════════════════════════════════════════
   Forward Bot — Admin Panel Styles
   Dark glassmorphism theme with vibrant accents
   ═══════════════════════════════════════════ */

:root {
    --bg-dark: #0a0e1a;
    --bg-card: rgba(15, 20, 40, 0.65);
    --bg-card-hover: rgba(20, 28, 55, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

    --text-primary: #e8eaf6;
    --text-secondary: #9ba4b8;
    --text-muted: #5a6278;

    --accent-purple: #6C63FF;
    --accent-purple-glow: rgba(108, 99, 255, 0.25);
    --accent-teal: #00C9A7;
    --accent-red: #FF6B6B;
    --accent-yellow: #FFC75F;
    --accent-blue: #4da6ff;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --sidebar-width: 240px;
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 3px;
}

/* ── Glass Effect ── */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

/* ── Screen Management ── */
.screen {
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* ════════════════════════════════
   LOGIN SCREEN
   ════════════════════════════════ */

.login-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: float 8s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    top: -10%;
    left: -5%;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-teal) 0%, transparent 70%);
    bottom: -10%;
    right: -5%;
    animation-delay: -3s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--accent-red) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -5s;
    opacity: 0.4;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
    box-shadow: 0 4px 20px var(--accent-purple-glow);
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px var(--accent-purple-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple), #8B7DFF);
    color: white;
    box-shadow: 0 4px 12px var(--accent-purple-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-purple-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.7rem;
}

.btn-full {
    width: 100%;
}

.btn-danger {
    background: rgba(255, 107, 107, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 107, 107, 0.25);
}

.btn-success {
    background: rgba(0, 201, 167, 0.15);
    color: var(--accent-teal);
    border: 1px solid rgba(0, 201, 167, 0.2);
}

.btn-success:hover {
    background: rgba(0, 201, 167, 0.25);
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-message {
    color: var(--accent-red);
    font-size: 0.8rem;
    text-align: center;
    margin-top: 12px;
}

/* ════════════════════════════════
   DASHBOARD LAYOUT
   ════════════════════════════════ */

#dashboard-screen {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-right: 1px solid var(--glass-border);
    border-left: 0;
    border-top: 0;
    border-bottom: 0;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.logo-mini {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-purple-glow);
    color: var(--accent-purple);
}

.nav-item.active svg {
    stroke: var(--accent-purple);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(108, 99, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-purple);
}

/* ── Main Content ── */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 24px 32px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    min-width: 200px;
}

.search-input:focus {
    border-color: var(--accent-purple);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.filter-select {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.filter-select option {
    background: #1a1f35;
    color: var(--text-primary);
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    animation: fadeIn 0.5s ease-out;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent, var(--accent-purple));
    flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon {
    background: rgba(108, 99, 255, 0.15);
    color: #6C63FF;
}

.stat-card:nth-child(2) .stat-icon {
    background: rgba(0, 201, 167, 0.15);
    color: #00C9A7;
}

.stat-card:nth-child(3) .stat-icon {
    background: rgba(255, 107, 107, 0.15);
    color: #FF6B6B;
}

.stat-card:nth-child(4) .stat-icon {
    background: rgba(255, 199, 95, 0.15);
    color: #FFC75F;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Cards & Grid ── */
.card {
    padding: 24px;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
}

/* ── Tables ── */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(0, 201, 167, 0.12);
    color: var(--accent-teal);
}

.badge-danger {
    background: rgba(255, 107, 107, 0.12);
    color: var(--accent-red);
}

.badge-warning {
    background: rgba(255, 199, 95, 0.12);
    color: var(--accent-yellow);
}

.badge-info {
    background: rgba(77, 166, 255, 0.12);
    color: var(--accent-blue);
}

/* ── Pagination ── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    transition: var(--transition);
}

.pagination button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.pagination button.active {
    background: var(--accent-purple);
    color: white;
    border-color: var(--accent-purple);
}

/* ── Toggle Switch ── */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    width: 42px;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.toggle-label input:checked+.toggle-switch {
    background: var(--accent-purple);
}

.toggle-label input:checked+.toggle-switch::after {
    left: 22px;
}

/* ── Giveaway Prize Grid ── */
.gw-prize-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.gw-prize-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
    min-height: 48px;
}

.gw-prize-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
}

.gw-prize-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 1;
}

.gw-prize-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.gw-prize-info div {
    min-width: 0;
}

.gw-prize-info strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.gw-prize-info small {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 1px;
    line-height: 1.2;
}

.gw-prize-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.gw-days-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s ease;
}

.gw-days-inline input {
    width: 48px;
    padding: 4px 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.78rem;
    text-align: center;
    font-family: inherit;
    outline: none;
}

.gw-days-inline input:focus {
    border-color: var(--accent-purple);
}

.gw-days-inline span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Self-contained giveaway toggle — fully independent from .toggle-label */
.gw-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.gw-toggle input {
    display: none;
}

.gw-toggle-track {
    width: 40px;
    height: 22px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    position: relative;
    transition: background 0.25s ease, border-color 0.25s ease;
    flex-shrink: 0;
    display: block;
}

.gw-toggle-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: left 0.25s ease, background 0.25s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.gw-toggle input:checked+.gw-toggle-track {
    background: rgba(0, 201, 167, 0.2);
    border-color: #00C9A7;
}

.gw-toggle input:checked+.gw-toggle-track .gw-toggle-thumb {
    left: 20px;
    background: #00C9A7;
}

/* ── Activity List ── */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-dot.success {
    background: var(--accent-teal);
}

.activity-dot.failed {
    background: var(--accent-red);
}

.activity-info {
    flex: 1;
    min-width: 0;
}

.activity-info span {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-info .activity-title {
    color: var(--text-primary);
    font-weight: 500;
}

.activity-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── Captions ── */
.captions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.caption-item {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.caption-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.caption-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
}

.caption-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.caption-actions {
    display: flex;
    gap: 6px;
}

/* ── Commands ── */
.commands-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.command-item {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.command-meta {
    flex: 1;
}

.command-meta h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-purple);
}

.command-meta p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.command-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.command-controls .rate-limit-input {
    width: 60px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.8rem;
    text-align: center;
}

/* ── Modal ── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ── Toast ── */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(20px);
    animation: toastIn 0.3s ease-out;
    pointer-events: auto;
    max-width: 360px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-success {
    background: rgba(0, 201, 167, 0.15);
    border: 1px solid rgba(0, 201, 167, 0.3);
    color: var(--accent-teal);
}

.toast-error {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--accent-red);
}

.toast-info {
    background: rgba(77, 166, 255, 0.15);
    border: 1px solid rgba(77, 166, 255, 0.3);
    color: var(--accent-blue);
}

/* ── Chart placeholder ── */
canvas {
    width: 100% !important;
    max-height: 220px;
}

/* ════════════════════════════════
   TELEGRAM MANAGEMENT UI
   ════════════════════════════════ */

.tg-manager {
    display: grid;
    grid-template-columns: 220px 280px 1fr;
    gap: 12px;
    height: calc(100vh - 160px);
    min-height: 500px;
}

.tg-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tg-panel-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    flex-shrink: 0;
}

.tg-items {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.tg-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.tg-item:hover {
    background: rgba(108, 99, 255, 0.08);
}

.tg-item-avatar {
    font-size: 1.2rem;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.tg-item-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.tg-item-info strong {
    display: block;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tg-item-info small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tg-unread {
    background: var(--accent-purple);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.tg-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 40px 16px;
}

/* ── Messages ── */
.tg-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: #0f0f0f;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.tg-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.45;
    position: relative;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.tg-msg-in {
    align-self: flex-start;
    background: #212121;
    border-bottom-left-radius: 4px;
    color: #fff;
}

.tg-msg-out {
    align-self: flex-end;
    background: #8774e1;
    border-bottom-right-radius: 4px;
    color: #fff;
}

.tg-media-photo,
.tg-media-video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-bottom: 6px;
    display: block;
    background: rgba(0, 0, 0, 0.2);
}

.tg-msg-caption {
    margin-top: 4px;
}

.tg-msg-sender {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #8774e1;
    margin-bottom: 3px;
}

.tg-msg-text {
    color: inherit;
}

.tg-msg-time {
    display: block;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
    margin-top: 4px;
    float: right;
    margin-left: 12px;
}

/* Clearfix for time float */
.tg-msg::after {
    content: "";
    display: table;
    clear: both;
}

/* ── Message Actions ── */
.tg-msg-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.tg-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.tg-action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ── Input Bar ── */
.tg-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #212121;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.tg-input-bar input {
    flex: 1;
    padding: 12px 16px;
    background: #181818;
    border: 1px solid transparent;
    border-radius: 20px;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.tg-input-bar input:focus {
    border-color: #8774e1;
}

.tg-input-bar input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.tg-input-bar .btn {
    border-radius: 50%;
    width: 42px;
    height: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #8774e1;
    color: white;
    border: none;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        overflow: hidden;
    }

    .sidebar .sidebar-header h2,
    .sidebar .nav-item span,
    .sidebar .sidebar-footer .user-info span,
    .sidebar .sidebar-footer .btn {
        display: none;
    }

    .sidebar .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .main-content {
        margin-left: 60px;
        padding: 16px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        width: 100%;
    }

    .search-input {
        min-width: 0;
        flex: 1;
    }

    .tg-manager {
        grid-template-columns: 1fr;
        height: auto;
    }

    .tg-panel {
        max-height: 300px;
    }

    .tg-chat-panel {
        max-height: 400px;
    }
}