/* ============================================
   WhatsApp Bot Admin Panel - Dark Hacking Theme
   Colors: Dark Blue, Neon Green, Yellow/Gold
   NO PURPLE/ZAMBARAU
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS Variables ===== */
:root {
    --bg-primary: #050a1a;
    --bg-secondary: #0a0e27;
    --bg-card: rgba(10, 14, 39, 0.8);
    --bg-card-hover: rgba(15, 25, 55, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);
    --bg-input: rgba(5, 10, 26, 0.8);
    
    --green: #00ff41;
    --green-dim: rgba(0, 255, 65, 0.15);
    --green-glow: rgba(0, 255, 65, 0.3);
    --green-dark: #00cc33;
    
    --yellow: #ffd700;
    --yellow-dim: rgba(255, 215, 0, 0.15);
    --yellow-glow: rgba(255, 215, 0, 0.3);
    
    --blue: #0066ff;
    --blue-dim: rgba(0, 102, 255, 0.15);
    --blue-light: #4d94ff;

    --cyan: #00e5ff;
    --cyan-dim: rgba(0, 229, 255, 0.15);
    
    --red: #ff3b3b;
    --red-dim: rgba(255, 59, 59, 0.15);
    
    --text-primary: #e8e8e8;
    --text-secondary: #8899aa;
    --text-muted: #556677;
    
    --border: rgba(0, 255, 65, 0.1);
    --border-hover: rgba(0, 255, 65, 0.25);
    
    --sidebar-width: 260px;
    --header-height: 65px;
    --radius: 12px;
    --radius-sm: 8px;
    
    --shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    --shadow-green: 0 0 20px rgba(0, 255, 65, 0.1);
    --shadow-yellow: 0 0 20px rgba(255, 215, 0, 0.1);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

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

/* Animated background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(0, 255, 65, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 215, 0, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 102, 255, 0.02) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(0, 255, 65, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 255, 65, 0.4); }

/* ===== LOGIN PAGE ===== */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    padding: 20px;
}

.login-container {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow), var(--shadow-green);
    animation: fadeInUp 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--green), var(--yellow), var(--green));
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

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

.login-logo .icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: var(--green-dim);
    border: 1px solid var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(0,255,65,0.2); }
    50% { box-shadow: 0 0 25px rgba(0,255,65,0.4); }
}

.login-logo h1 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--green);
    letter-spacing: 1px;
}

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

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'JetBrains Mono', monospace;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-dim);
}

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

select.form-input {
    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='%2300ff41' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    color: #000;
    box-shadow: 0 2px 15px var(--green-dim);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px var(--green-glow);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
}

.btn-yellow {
    background: linear-gradient(135deg, #cc9900, var(--yellow));
    color: #000;
    box-shadow: 0 2px 15px var(--yellow-dim);
}

.btn-yellow:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px var(--yellow-glow);
}

.btn-danger {
    background: var(--red-dim);
    color: var(--red);
    border: 1px solid rgba(255, 59, 59, 0.2);
}

.btn-danger:hover {
    background: rgba(255, 59, 59, 0.25);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

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

/* ===== APP LAYOUT ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

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

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--green-dim);
    border: 1px solid var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-header .logo-text h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    color: var(--green);
    font-weight: 700;
    line-height: 1.2;
}

.sidebar-header .logo-text span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0 12px;
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid transparent;
    margin-bottom: 2px;
}

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

.nav-item.active {
    background: var(--green-dim);
    color: var(--green);
    border-color: rgba(0, 255, 65, 0.15);
}

.nav-item .nav-icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--green-dim);
    color: var(--green);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

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

.admin-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-glass);
}

.admin-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--yellow-dim);
    border: 1px solid var(--yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--yellow);
    flex-shrink: 0;
}

.admin-details {
    flex: 1;
    min-width: 0;
}

.admin-details .name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-details .role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 4px;
    transition: var(--transition);
}

.btn-logout:hover {
    color: var(--red);
}

/* Mobile menu toggle */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--green);
    font-size: 1.3rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.mobile-toggle:hover {
    background: var(--green-dim);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.main-header {
    height: var(--header-height);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(5, 10, 26, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-title .breadcrumb {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--green);
    opacity: 0.7;
}

/* Page content */
.page-content {
    flex: 1;
    padding: 28px;
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 20px;
    }
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100px;
}

.stat-trend {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    z-index: 2;
}
.stat-trend.up { background: var(--green-dim); color: var(--green); }
.stat-trend.down { background: var(--red-dim); color: var(--red); }

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-green);
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card.yellow::after { background: var(--yellow); }
.stat-card.yellow:hover { box-shadow: var(--shadow-yellow); }
.stat-card.cyan::after { background: var(--cyan); }
.stat-card.blue::after { background: var(--blue); }

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 14px;
}

.stat-icon.green { background: var(--green-dim); }
.stat-icon.yellow { background: var(--yellow-dim); }
.stat-icon.cyan { background: var(--cyan-dim); }
.stat-icon.blue { background: var(--blue-dim); }

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

/* ===== DATA TABLE ===== */
.table-wrapper {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.table-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.table-header h3 {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.table-filters .form-input {
    padding: 8px 12px;
    font-size: 0.82rem;
    min-width: 140px;
}

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

.data-table thead th {
    text-align: left;
    padding: 13px 18px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: var(--transition);
}

.data-table tbody tr:hover {
    background: var(--bg-glass-hover);
}

.data-table tbody td {
    padding: 13px 18px;
    font-size: 0.88rem;
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table .mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
}

.table-actions {
    display: flex;
    gap: 6px;
}

.table-actions .btn-sm {
    padding: 5px 10px;
    font-size: 0.75rem;
}

.table-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.table-empty .icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.3;
}

/* ===== STATUS BADGES ===== */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-status.completed, .badge-status.active, .badge-status.success {
    background: var(--green-dim);
    color: var(--green);
}

.badge-status.pending, .badge-status.inprogress {
    background: var(--yellow-dim);
    color: var(--yellow);
}

.badge-status.failed, .badge-status.cancelled, .badge-status.rejected, .badge-status.inactive, .badge-status.usercancelled {
    background: var(--red-dim);
    color: var(--red);
}

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

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.modal-close:hover {
    background: var(--red-dim);
    color: var(--red);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== TOAST NOTIFICATION ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 300px;
    max-width: 450px;
    animation: slideInRight 0.3s ease;
    box-shadow: var(--shadow);
}

.toast-success {
    background: var(--bg-secondary);
    border: 1px solid var(--green);
    color: var(--green);
}

.toast-error {
    background: var(--bg-secondary);
    border: 1px solid var(--red);
    color: var(--red);
}

.toast-info {
    background: var(--bg-secondary);
    border: 1px solid var(--cyan);
    color: var(--cyan);
}

/* ===== SETTINGS PAGE ===== */
.settings-section {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.settings-section-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-section-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.settings-section-header .icon {
    font-size: 1.2rem;
}

.settings-grid {
    padding: 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.settings-grid .form-group {
    margin-bottom: 0;
}

/* Gateway selector */
.gateway-selector {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.gateway-option {
    flex: 1;
    min-width: 160px;
    padding: 18px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--bg-glass);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.gateway-option:hover {
    border-color: var(--border-hover);
}

.gateway-option.selected {
    border-color: var(--green);
    background: var(--green-dim);
}

.gateway-option .name {
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 8px;
}

.gateway-option .desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== CONVERSATION CHAT ===== */
.chat-list {
    list-style: none;
}

.chat-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    cursor: pointer;
    transition: var(--transition);
}

.chat-list-item:hover {
    background: var(--bg-glass-hover);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--cyan-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-info .phone {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    font-weight: 600;
}

.chat-info .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: 500px;
}

.chat-bubble {
    max-width: 80%;
    padding: 10px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 0.88rem;
    line-height: 1.5;
    animation: fadeIn 0.2s ease;
}

.chat-bubble.incoming {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
    margin-right: auto;
}

.chat-bubble.outgoing {
    background: var(--green-dim);
    border: 1px solid rgba(0,255,65,0.15);
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.chat-bubble .time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: 'JetBrains Mono', monospace;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px;
}

.pagination button {
    padding: 8px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    transition: var(--transition);
}

.pagination button:hover {
    background: var(--green-dim);
    border-color: var(--green);
    color: var(--green);
}

.pagination button.active {
    background: var(--green);
    color: #000;
    border-color: var(--green);
}

.pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

.animate-in {
    animation: fadeSlide 0.4s ease forwards;
}

/* ===== LOADING SPINNER ===== */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 20px auto;
}

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

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 26, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .main-header {
        padding: 0 16px 0 68px;
    }

    .page-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        padding: 5px !important;
    }

    .stat-card {
        padding: 10px 8px;
        min-height: 85px;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .stat-value {
        font-size: 1.0rem;
        word-break: break-all;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    .stat-trend {
        top: 8px;
        right: 8px;
        font-size: 0.65rem;
        padding: 1px 4px;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .modal {
        max-width: 100%;
        margin: 10px;
    }

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

    .header-time {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 32px 24px;
    }

    .gateway-selector {
        flex-direction: column;
    }

    .table-filters {
        width: 100%;
    }

    .table-filters .form-input {
        width: 100%;
        min-width: unset;
    }

    .toast {
        min-width: unset;
        max-width: 90vw;
    }
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.text-green { color: var(--green); }
.text-yellow { color: var(--yellow); }
.text-cyan { color: var(--cyan); }
.text-red { color: var(--red); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.gap-1 { gap: 8px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

@media (max-width: 768px) {
    .grid-2 { grid-template-columns: 1fr; }
}
/* ===== ALERT BANNER ===== */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
}

.alert-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--blue);
}

.alert-banner.info { border-color: rgba(0, 102, 255, 0.2); }
.alert-banner.info::before { background: var(--blue); }

.alert-banner.error { border-color: rgba(255, 59, 59, 0.2); }
.alert-banner.error::before { background: var(--red); }

.alert-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass-hover);
    border-radius: 50%;
}

.alert-body h4 {
    margin-bottom: 5px;
    font-size: 1.1rem;
    font-weight: 700;
}

.alert-body p {
    color: var(--text-secondary);
    margin: 0;
}
