/* ================================================
   WiFi Billing Management System - Modern UI
   ================================================ */

/* CSS Variables */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: rgba(99, 102, 241, 0.1);
    
    --success: #10b981;
    --success-dark: #059669;
    --success-light: #34d399;
    --success-bg: rgba(16, 185, 129, 0.1);
    
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --danger-light: #f87171;
    --danger-bg: rgba(239, 68, 68, 0.1);
    
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --warning-bg: rgba(245, 158, 11, 0.1);
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --sidebar-active: rgba(99, 102, 241, 0.2);
    --sidebar-width: 260px;
    
    /* Layout */
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;
}

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

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ================================================
   Sidebar Styles
   ================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

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

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.logo-subtitle {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 500;
}

.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;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    position: relative;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-item.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 20px;
}

.nav-badge.online {
    background: var(--success);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-role {
    color: var(--gray-500);
    font-size: 0.75rem;
}

/* ================================================
   Main Content
   ================================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Content Header */
.content-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    color: var(--gray-600);
}

.menu-toggle svg {
    width: 20px;
    height: 20px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.wa-status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--gray-100);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--success);
}

.status-dot.disconnected {
    background: var(--danger);
}

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

.current-time {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn var(--transition-slow);
}

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

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

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

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.gradient-blue .stat-icon {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.gradient-green .stat-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.gradient-orange .stat-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.gradient-purple .stat-icon {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ================================================
   Cards
   ================================================ */
.card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.card-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

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

.card-body {
    padding: 24px;
}

/* ================================================
   Tables
   ================================================ */
.table-container {
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 16px 24px;
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}

.data-table td {
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
    color: var(--gray-700);
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.empty-state {
    text-align: center;
    padding: 48px 24px !important;
    color: var(--gray-500);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-lunas {
    background: var(--success-bg);
    color: var(--success-dark);
}

.status-belum {
    background: var(--danger-bg);
    color: var(--danger-dark);
}

/* Action Buttons in Table */
.action-buttons {
    display: flex;
    gap: 8px;
}

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

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: white;
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    color: white;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    padding: 10px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.btn-icon:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

/* ================================================
   Search Box
   ================================================ */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--gray-400);
    pointer-events: none;
}

.search-box input {
    padding: 10px 16px 10px 44px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    width: 280px;
    transition: all var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ================================================
   WhatsApp Section
   ================================================ */
.wa-container {
    max-width: 600px;
    margin: 0 auto;
}

.wa-card {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.wa-header {
    background: linear-gradient(135deg, #25d366, #128c7e);
    padding: 32px;
    text-align: center;
    color: white;
}

.wa-icon {
    width: 64px;
    height: 64px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.wa-icon svg {
    width: 36px;
    height: 36px;
    color: #25d366;
}

.wa-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.wa-header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.wa-status-card {
    padding: 20px 32px;
    border-bottom: 1px solid var(--gray-200);
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.status-indicator .status-dot {
    width: 12px;
    height: 12px;
}

.qr-section {
    padding: 32px;
    text-align: center;
}

.qr-container {
    width: 260px;
    height: 260px;
    margin: 0 auto 20px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--gray-300);
    overflow: hidden;
}

.qr-container img {
    max-width: 100%;
    max-height: 100%;
}

.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--gray-400);
    padding: 20px;
}

.qr-placeholder svg {
    width: 48px;
    height: 48px;
}

.qr-placeholder span {
    font-size: 0.875rem;
    text-align: center;
    line-height: 1.5;
}

.qr-hint {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.connected-section {
    padding: 48px 32px;
    text-align: center;
}

.connected-icon {
    width: 80px;
    height: 80px;
    background: var(--success-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--success);
}

.connected-icon svg {
    width: 40px;
    height: 40px;
}

.connected-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success);
    margin-bottom: 8px;
}

.connected-section p {
    color: var(--gray-500);
}

.wa-actions {
    padding: 0 32px 32px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.wa-commands {
    padding: 24px 32px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
}

.wa-commands h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.command-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.command-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
}

.command-item code {
    background: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--primary);
    border: 1px solid var(--gray-200);
}

.command-item span {
    color: var(--gray-600);
}

/* ================================================
   Settings
   ================================================ */
.settings-grid {
    display: grid;
    gap: 24px;
}

.action-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.action-warning {
    font-size: 0.8rem;
    color: var(--warning-dark);
    text-align: center;
}

/* Admin Numbers */
.admin-numbers-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.admin-number-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
}

.admin-number-item .number {
    flex: 1;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.admin-number-item .remove-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.admin-number-item .remove-btn:hover {
    background: var(--danger);
    color: white;
}

.admin-number-item .remove-btn svg {
    width: 14px;
    height: 14px;
}

.add-admin-row {
    display: flex;
    gap: 10px;
}

.add-admin-row .form-input {
    flex: 1;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 8px;
}

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

.empty-admin {
    padding: 20px;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.9rem;
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    border: 2px dashed var(--gray-200);
}

/* Group Settings */
.main-group-display {
    padding: 14px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
}

.main-group-display .group-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.main-group-display .group-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.main-group-display .group-icon svg {
    width: 20px;
    height: 20px;
}

.main-group-display .group-details {
    flex: 1;
}

.main-group-display .group-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.95rem;
}

.main-group-display .group-id {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-family: 'Monaco', 'Consolas', monospace;
}

.main-group-display .no-group {
    color: var(--gray-400);
    font-size: 0.9rem;
}

.group-select-row {
    display: flex;
    gap: 10px;
}

.group-select-row .form-input {
    flex: 1;
}

.group-actions {
    display: flex;
    gap: 10px;
}

/* ================================================
   Modals
   ================================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn var(--transition);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: slideUp var(--transition-slow);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

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

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 24px;
}

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

/* ================================================
   Toast Notifications
   ================================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 420px;
    animation: toastIn var(--transition-slow);
    border-left: 4px solid var(--primary);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.toast-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all var(--transition);
}

.toast-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

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

/* ================================================
   Loading
   ================================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-spinner.large {
    width: 48px;
    height: 48px;
    border-width: 4px;
    margin: 0 auto 16px;
}

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

/* ================================================
   Responsive Design
   ================================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

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

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .content-area {
        padding: 24px;
    }
}

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

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

    .header-actions {
        width: 100%;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .action-buttons-grid {
        grid-template-columns: 1fr;
    }

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

    .toast {
        min-width: auto;
        max-width: calc(100vw - 48px);
    }

    .content-header {
        padding: 0 16px;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .wa-status-pill {
        display: none;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 16px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .data-table th,
    .data-table td {
        padding: 12px 16px;
    }

    .modal-content {
        width: 95%;
    }

    .action-buttons {
        flex-direction: column;
    }
}
