/* AccuNums - Modern Dashboard Styles */

:root {
    /* AccuNums Color Palette */
    --bg-dark: #050505;
    --bg-primary: #050505;
    --bg-surface: #0f1115;
    --bg-secondary: #0f1115;
    --bg-tertiary: #161920;
    --bg-card: #0f1115;
    --bg-card-hover: #161920;
    --bg-glass: rgba(20, 22, 28, 0.7);

    /* Primary Colors */
    --primary: #3b82f6;
    --primary-glow: #60a5fa;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --accent-primary: #3b82f6;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(90deg, #3b82f6, #8b5cf6);

    /* Text Colors */
    --text-main: #f8fafc;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Borders */
    --border: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.08);

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'Fira Code', monospace;
    --font-main: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;

    /* Spacing */
    --container: 1200px;
    --sidebar-width: 260px;
    --header-height: 80px;

    /* Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.3);
    --shadow-glow-hover: 0 0 30px rgba(139, 92, 246, 0.5);

    /* Border Radius */
    --radius: 16px;
    --radius-sm: 4px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 50px;

    --transition: all 0.3s ease;
}

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

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-pill);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 20px;
    font-size: 0.9rem;
}

.btn-icon {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--primary);
    border-color: var(--border-color);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: var(--font-code);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===========================================
   AUTH SECTION 
   =========================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
}

.auth-card {
    background: linear-gradient(145deg, #0f1115, #161920);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: auto;
    height: auto;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo svg {
    width: 260px;
    height: 60px;
    max-width: 100%;
}

.auth-header h1 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.auth-form .btn {
    width: 100%;
    padding: 16px;
    margin-top: 8px;
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-top: 20px;
    font-size: 0.9rem;
    display: none;
}

.error-message.show {
    display: block;
}

.auth-features {
    display: none;
}

@media (min-width: 1024px) {
    .auth-container {
        gap: 80px;
    }

    .auth-features {
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    .feature {
        display: flex;
        align-items: flex-start;
        gap: 16px;
    }

    .feature-icon {
        font-size: 2rem;
        line-height: 1;
    }

    .feature h3 {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 4px;
    }

    .feature p {
        color: var(--text-secondary);
        font-size: 0.9rem;
    }
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

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

.logo-small {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.logo-small svg {
    width: 200px;
    height: 46px;
}

.sidebar-header span {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
}

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

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

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

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

.user-details span:first-child {
    font-weight: 500;
    font-size: 0.9rem;
}

.user-email {
    color: var(--text-muted);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.logout-btn:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.05), transparent 30%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.05), transparent 30%);
    min-height: 100vh;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.section-header h1 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
}

.credit-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--primary);
    font-weight: 600;
}

.credit-badge svg {
    width: 20px;
    height: 20px;
}

/* Health Pulse Animation */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 0;
}

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

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

.stat-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 40px -10px rgba(59, 130, 246, 0.15);
    transform: translateY(-5px);
}

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

.stat-icon svg {
    width: 26px;
    height: 26px;
}

.stat-icon.credits {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.stat-icon.queries {
    background: rgba(139, 92, 246, 0.1);
    color: var(--secondary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.stat-icon.keys {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    margin-top: 32px;
}

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

/* Usage Chart Card */
.usage-chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    overflow: hidden;
}

.usage-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.usage-chart-header h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.usage-chart-header h2 svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.usage-summary {
    display: flex;
    gap: 20px;
}

.usage-summary span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.usage-summary strong {
    color: var(--text-primary);
    font-weight: 600;
}

.usage-success-rate strong {
    color: var(--success);
}

/* Usage Chart - Bar Chart */
.usage-chart-container {
    margin-bottom: 24px;
    padding: 16px 0;
}

.usage-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 160px;
    gap: 8px;
    padding: 0 8px;
}

.usage-chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 80px;
}

.usage-bar-wrapper {
    width: 100%;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}

.usage-bar {
    width: 100%;
    max-width: 40px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--primary) 0%, rgba(59, 130, 246, 0.6) 100%);
    transition: all 0.3s ease;
    position: relative;
    min-height: 4px;
}

.usage-chart-bar.today .usage-bar {
    background: linear-gradient(180deg, var(--secondary) 0%, rgba(139, 92, 246, 0.6) 100%);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.usage-chart-bar.today .usage-bar-label {
    color: var(--secondary);
    font-weight: 600;
}

.usage-bar:hover {
    transform: scaleY(1.02);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.usage-bar-count {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.usage-bar-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}

/* Usage Table */
.usage-table-container {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

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

.usage-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.usage-table td {
    padding: 14px 16px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.usage-table tbody tr:last-child td {
    border-bottom: none;
}

.usage-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.usage-table .date-cell {
    font-weight: 500;
}

.usage-table .today-row {
    background: rgba(59, 130, 246, 0.05);
}

.usage-table .today-row .date-cell {
    color: var(--primary);
}

.usage-table .success-rate-cell {
    font-weight: 600;
}

.usage-table .success-rate-cell.high {
    color: var(--success);
}

.usage-table .success-rate-cell.medium {
    color: var(--warning);
}

.usage-table .success-rate-cell.low {
    color: var(--error);
}

/* System Status Card */
.system-status-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    height: fit-content;
    transition: var(--transition);
}

.system-status-card.healthy {
    border-color: rgba(16, 185, 129, 0.3);
}

.system-status-card.degraded {
    border-color: rgba(245, 158, 11, 0.3);
}

.system-status-card.unhealthy {
    border-color: rgba(239, 68, 68, 0.3);
}

.status-card-header {
    margin-bottom: 20px;
}

.status-card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.status-card-header h2 svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.status-indicator-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.status-main-indicator {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(107, 114, 128, 0.2);
    flex-shrink: 0;
}

.system-status-card.healthy .status-main-indicator {
    background: rgba(16, 185, 129, 0.2);
}

.system-status-card.degraded .status-main-indicator {
    background: rgba(245, 158, 11, 0.2);
}

.system-status-card.unhealthy .status-main-indicator {
    background: rgba(239, 68, 68, 0.2);
}

.status-main-indicator .health-pulse {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: pulse 2s ease-in-out infinite;
}

.system-status-card.healthy .health-pulse {
    background: var(--success);
}

.system-status-card.degraded .health-pulse {
    background: var(--warning);
}

.system-status-card.unhealthy .health-pulse {
    background: var(--error);
}

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

.status-main-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.system-status-card.healthy .status-main-value {
    color: var(--success);
}

.system-status-card.degraded .status-main-value {
    color: var(--warning);
}

.system-status-card.unhealthy .status-main-value {
    color: var(--error);
}

.status-main-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-details-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-detail-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

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

.status-detail-icon svg {
    width: 18px;
    height: 18px;
}

.status-detail-icon.api {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.status-detail-icon.database {
    background: rgba(139, 92, 246, 0.1);
    color: var(--secondary);
}

.status-detail-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.status-detail-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-detail-value.online {
    color: var(--success);
}

.status-detail-value.offline {
    color: var(--error);
}

@media (max-width: 768px) {
    .usage-chart-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .usage-summary {
        flex-direction: column;
        gap: 8px;
    }

    .usage-chart {
        height: 120px;
        gap: 4px;
    }

    .usage-bar-wrapper {
        height: 90px;
    }

    .usage-bar-label {
        font-size: 0.65rem;
    }
}

/* API Keys Section */
.api-keys-info {
    margin-bottom: 24px;
}

.info-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
    color: var(--primary);
}

.info-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-box p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.api-keys-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.api-key-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    transition: var(--transition);
}

.api-key-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 40px -10px rgba(59, 130, 246, 0.15);
}

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

.api-key-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.key-status.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.key-status.inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.api-key-prefix {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.api-key-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

/* Credits Section */
.credits-overview {
    margin-bottom: 40px;
}

.balance-card {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
    color: white;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
}

.balance-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.balance-value {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 8px;
}

.balance-note {
    font-size: 0.9rem;
    opacity: 0.8;
}

.pricing-section h2,
.transactions-section h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.pricing-card {
    background: linear-gradient(145deg, #0f1115, #161920);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.pricing-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px -10px rgba(59, 130, 246, 0.15);
}

.pricing-card.popular {
    border-color: var(--primary);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.1);
}

.pricing-card.popular::before {
    content: 'Best value';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.pricing-credits {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.pricing-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.pricing-price {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.transactions-list {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.transaction-item:last-child {
    border-bottom: none;
}

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

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.transaction-icon.topup {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.transaction-icon.deduction {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.transaction-icon svg {
    width: 20px;
    height: 20px;
}

.transaction-details h4 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.transaction-details span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.transaction-amount {
    font-weight: 600;
    font-size: 1rem;
}

.transaction-amount.positive {
    color: var(--success);
}

.transaction-amount.negative {
    color: var(--error);
}

/* Test API Section */
.test-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.test-form-card,
.test-result-card,
.test-curl-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.test-form-card h2,
.test-result-card h2,
.test-curl-card h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.test-form-card p,
.test-curl-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.result-content {
    background: #1e1e1e;
    border-radius: var(--radius-md);
    padding: 20px;
    font-family: var(--font-code);
    font-size: 0.9rem;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* Curl Command Section */
.curl-command-wrapper {
    position: relative;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.curl-command-wrapper pre {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    padding-right: 50px;
}

.curl-command-wrapper .copy-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #2d2d2d;
    border: 1px solid #333;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.curl-command-wrapper .copy-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.curl-command-wrapper .copy-btn svg {
    width: 14px;
    height: 14px;
}

/* Lookup Results Styling */
.lookup-success,
.lookup-no-results,
.lookup-error {
    text-align: center;
    padding: 20px;
}

.lookup-success .success-header,
.lookup-no-results,
.lookup-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lookup-success .success-header svg,
.lookup-no-results svg,
.lookup-error svg {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.lookup-success .success-header svg {
    color: var(--success);
}

.lookup-no-results svg {
    color: var(--text-muted);
}

.lookup-error svg {
    color: var(--error);
}

.lookup-success .success-header h3,
.lookup-no-results h3,
.lookup-error h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.lookup-info {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 20px 0;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.lookup-info span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lookup-info strong {
    color: var(--text-primary);
}

.lookup-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.result-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: left;
}

.result-item h4 {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 8px 0;
    word-break: break-word;
}

.result-item p strong {
    color: var(--text-primary);
    font-weight: 500;
}

.lookup-no-results p,
.lookup-error p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 8px 0;
}

.credits-note {
    color: var(--success) !important;
    font-weight: 500;
}

.result-content .loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Documentation Section */
.docs-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.docs-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.docs-card h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--primary);
}

.docs-card h3 {
    font-size: 1rem;
    font-weight: 500;
    margin: 20px 0 12px;
    color: var(--text-secondary);
}

.docs-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.docs-card pre {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    overflow-x: auto;
    margin: 12px 0;
}

.docs-card code {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--primary);
}

.docs-card pre code {
    color: var(--text-primary);
}

.endpoint {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: var(--radius-md);
}

.method {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-code);
}

.method.get {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.method.post {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.docs-card ul {
    list-style: none;
    padding: 0;
}

.docs-card ul li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--text-secondary);
}

.docs-card ul li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
}

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

.docs-table th,
.docs-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.docs-table th {
    background: var(--bg-tertiary);
    font-weight: 500;
    color: var(--text-secondary);
}

.docs-table td:first-child {
    font-family: var(--font-code);
    color: var(--primary);
}

/* Documentation Code Tabs */
.code-tabs {
    margin: 16px 0;
}

.code-tab-buttons {
    display: flex;
    gap: 4px;
    background: #1a1a1a;
    padding: 4px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid #333;
    border-bottom: none;
}

.code-tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.code-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.code-tab-btn.active {
    background: #2d2d2d;
    color: var(--primary);
}

.code-tab-content {
    position: relative;
}

.code-panel {
    display: none;
}

.code-panel.active {
    display: block;
}

.code-panel .code-wrapper {
    position: relative;
    background: #1e1e1e;
    border: 1px solid #333;
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
}

.code-panel .code-wrapper pre {
    margin: 0;
    padding: 20px;
    padding-right: 100px;
    overflow-x: auto;
    border: none;
    border-radius: 0;
}

.code-panel .code-wrapper code {
    font-family: var(--font-code);
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.code-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.code-copy-btn:hover {
    background: #3d3d3d;
    color: var(--text-primary);
    border-color: var(--primary);
}

.code-copy-btn.copied {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--success);
    color: var(--success);
}

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

@media (max-width: 768px) {
    .code-tab-buttons {
        flex-wrap: wrap;
    }

    .code-tab-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .code-panel .code-wrapper pre {
        padding-right: 20px;
    }

    .code-copy-btn {
        position: static;
        margin: 12px;
        width: calc(100% - 24px);
        justify-content: center;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(145deg, #0f1115, #161920);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.warning-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    color: var(--warning);
    margin-bottom: 20px;
}

.warning-box svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.warning-box p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.key-value {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.key-value code {
    flex: 1;
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--primary);
    word-break: break-all;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.copy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.copy-btn svg {
    width: 16px;
    height: 16px;
}

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

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    min-width: 280px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

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

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

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

.toast.error .toast-icon {
    color: var(--error);
}

.toast.info .toast-icon {
    color: var(--info);
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ==================== Lookup History Section ==================== */

.history-filters {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.filter-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-group select {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 160px;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.history-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-stat-card .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-stat-card .stat-icon svg {
    width: 20px;
    height: 20px;
}

.history-stat-card .stat-icon.total {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.history-stat-card .stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.history-stat-card .stat-icon.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.history-stat-card .stat-info {
    flex: 1;
}

.history-stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.history-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.history-table-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

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

.history-table th {
    text-align: left;
    padding: 16px 20px;
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.history-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover td {
    background: var(--bg-secondary);
}

.history-table .phone-number {
    font-family: var(--font-code);
    font-weight: 500;
    color: var(--primary);
}

.history-table .results-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

.history-table .results-count.has-results {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.history-table .results-count.no-results {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
}

.history-table .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.history-table .status-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.history-table .status-badge.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.history-table .status-badge svg {
    width: 14px;
    height: 14px;
}

.history-table .api-key-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-table .date-time {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-right: 16px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

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

.pagination-ellipsis {
    color: var(--text-secondary);
    padding: 0 8px;
}

/* Empty history state */
.history-empty {
    text-align: center;
    padding: 60px 20px;
}

.history-empty svg {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    margin-bottom: 20px;
    opacity: 0.5;
}

.history-empty h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.history-empty p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* History expand button and details row */
.expand-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
}

.expand-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.expand-btn.expanded {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

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

.history-details-row td {
    padding: 0 !important;
    background: var(--bg-tertiary);
}

.history-details-content {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    border-left: 3px solid var(--primary);
    margin-left: 14px;
}

.history-details-content .detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-details-content .detail-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-details-content .detail-label svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.history-details-content .detail-value {
    font-family: var(--font-code);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    word-break: break-all;
}

.history-details-content .detail-value.user-agent-value {
    font-size: 0.8rem;
    max-height: 80px;
    overflow-y: auto;
}

.history-row:hover+.history-details-row td {
    background: var(--bg-tertiary);
}

/* ===========================================
   SETTINGS SECTION 
   =========================================== */
.settings-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.settings-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.settings-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.settings-icon {
    width: 48px;
    height: 48px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

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

.settings-header h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.settings-form {
    max-width: 400px;
}

.settings-form .btn {
    margin-top: 8px;
}

/* Danger Zone Styles */
.settings-card.danger-zone {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, var(--bg-surface) 100%);
}

.settings-card.danger-zone:hover {
    border-color: rgba(239, 68, 68, 0.5);
}

.settings-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.danger-warning {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.danger-warning svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--danger);
}

.danger-warning strong {
    color: var(--danger);
}

/* Gradient Text Utility */
.gradient-text {
    background: linear-gradient(135deg, #60a5fa, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

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

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

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

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

    .api-key-actions {
        width: 100%;
        margin-top: 16px;
    }

    .api-key-actions .btn {
        flex: 1;
    }

    .filter-group {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .filter-group select {
        width: 100%;
    }

    .history-table-container {
        overflow-x: auto;
    }

    .history-table {
        min-width: 700px;
    }

    .pagination {
        gap: 4px;
    }

    .pagination-btn {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 0.85rem;
    }
}

/* ==================== Notification Styles ==================== */

.notification-banner {
    margin-bottom: 24px;
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-banner.info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.notification-banner.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.notification-banner.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.05) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.notification-banner.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.notification-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
}

.notification-banner-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: currentColor;
}

.notification-banner-icon svg {
    width: 100%;
    height: 100%;
}

.notification-banner.info .notification-banner-icon {
    color: var(--info);
}

.notification-banner.success .notification-banner-icon {
    color: var(--success);
}

.notification-banner.warning .notification-banner-icon {
    color: var(--warning);
}

.notification-banner.error .notification-banner-icon {
    color: var(--error);
}

.notification-banner-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.notification-banner-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.notification-banner-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.notifications-container,
.notifications-admin-container {
    margin-top: 24px;
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;
}

.notification-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
}

.notification-item.unread {
    border-left: 3px solid var(--primary);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4),
        0 0 24px rgba(59, 130, 246, 0.2),
        inset 0 0 12px rgba(59, 130, 246, 0.08);
    animation: unreadGlow 1.5s ease-in-out infinite alternate;
}

@keyframes unreadGlow {
    from {
        box-shadow: 0 0 8px rgba(59, 130, 246, 0.3),
            0 0 16px rgba(59, 130, 246, 0.15),
            inset 0 0 8px rgba(59, 130, 246, 0.05);
    }

    to {
        box-shadow: 0 0 16px rgba(59, 130, 246, 0.5),
            0 0 32px rgba(59, 130, 246, 0.25),
            inset 0 0 16px rgba(59, 130, 246, 0.1);
    }
}

.notification-item.unread.info {
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4),
        0 0 24px rgba(59, 130, 246, 0.2),
        inset 0 0 12px rgba(59, 130, 246, 0.08);
    animation: unreadGlow 1.5s ease-in-out infinite alternate;
}

.notification-item.unread.success {
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4),
        0 0 24px rgba(16, 185, 129, 0.2),
        inset 0 0 12px rgba(16, 185, 129, 0.08);
    animation: unreadGlowSuccess 1.5s ease-in-out infinite alternate;
}

@keyframes unreadGlowSuccess {
    from {
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.3),
            0 0 16px rgba(16, 185, 129, 0.15),
            inset 0 0 8px rgba(16, 185, 129, 0.05);
    }

    to {
        box-shadow: 0 0 16px rgba(16, 185, 129, 0.5),
            0 0 32px rgba(16, 185, 129, 0.25),
            inset 0 0 16px rgba(16, 185, 129, 0.1);
    }
}

.notification-item.unread.error {
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4),
        0 0 24px rgba(239, 68, 68, 0.2),
        inset 0 0 12px rgba(239, 68, 68, 0.08);
    animation: unreadGlowError 1.5s ease-in-out infinite alternate;
}

@keyframes unreadGlowError {
    from {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.3),
            0 0 16px rgba(239, 68, 68, 0.15),
            inset 0 0 8px rgba(239, 68, 68, 0.05);
    }

    to {
        box-shadow: 0 0 16px rgba(239, 68, 68, 0.5),
            0 0 32px rgba(239, 68, 68, 0.25),
            inset 0 0 16px rgba(239, 68, 68, 0.1);
    }
}

.notification-item.unread.warning {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4),
        0 0 24px rgba(245, 158, 11, 0.2),
        inset 0 0 12px rgba(245, 158, 11, 0.08);
    animation: unreadGlowWarning 1.5s ease-in-out infinite alternate;
}

@keyframes unreadGlowWarning {
    from {
        box-shadow: 0 0 8px rgba(245, 158, 11, 0.3),
            0 0 16px rgba(245, 158, 11, 0.15),
            inset 0 0 8px rgba(245, 158, 11, 0.05);
    }

    to {
        box-shadow: 0 0 16px rgba(245, 158, 11, 0.5),
            0 0 32px rgba(245, 158, 11, 0.25),
            inset 0 0 16px rgba(245, 158, 11, 0.1);
    }
}

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

.notification-item.error {
    border-left-color: var(--error);
}

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

.notification-item.info {
    border-left-color: var(--info);
}

.notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    margin-top: 2px;
}

.notification-icon svg {
    width: 100%;
    height: 100%;
}

.notification-item.success .notification-icon {
    color: var(--success);
}

.notification-item.error .notification-icon {
    color: var(--error);
}

.notification-item.warning .notification-icon {
    color: var(--warning);
}

.notification-item.info .notification-icon {
    color: var(--info);
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-message {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.notification-date {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.notification-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.notification-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-actions {
    margin-top: 12px;
}

.notification-delete-btn {
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.notification-delete-btn:hover {
    border-color: rgba(239, 68, 68, 0.8);
    background: rgba(239, 68, 68, 0.15);
}

.notification-unread-dot {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
}

.nav-badge {
    display: inline-block;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    background: var(--error);
    color: white;
    border-radius: 9px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    margin-left: 8px;
}

/* User Search for Notifications */
.user-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow-lg);
}

.user-search-result {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-color);
}

.user-search-result:last-child {
    border-bottom: none;
}

.user-search-result:hover {
    background: var(--bg-card-hover);
}

.user-search-result-name {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 2px;
}

.user-search-result-email {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.user-search-result-empty {
    padding: 12px 16px;
    color: var(--text-secondary);
    text-align: center;
}

.selected-user {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.selected-user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-primary);
}

.btn-remove-user {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
    transition: var(--transition);
}

.btn-remove-user:hover {
    color: var(--error);
}

#notification-user-select-group {
    position: relative;
}