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

:root {
    /* Dark purple neon theme */
    --bg-dark: #0d0d1a;
    --bg-card: #13132b;
    --bg-input: #1a1a3e;
    --bg-hover: #1f1f4a;
    
    /* Text */
    --text-primary: #e8e8f0;
    --text-secondary: #8888a8;
    --text-muted: #5a5a7a;
    
    /* Neon accents - subtle */
    --accent: #9d4edd;
    --accent-hover: #b366f0;
    --accent-glow: rgba(157, 78, 221, 0.3);
    --accent-soft: rgba(157, 78, 221, 0.15);
    
    /* Status colors */
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.15);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.15);
    --error: #f87171;
    --error-soft: rgba(248, 113, 113, 0.15);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.15);
    
    /* Borders */
    --border: #2a2a4a;
    --border-accent: rgba(157, 78, 221, 0.3);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(157, 78, 221, 0.2);
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, var(--bg-card) 0%, #0f0f24 100%);
    padding: 25px 20px;
    position: fixed;
    height: 100vh;
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 35px;
    padding: 0 5px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    filter: drop-shadow(0 0 10px rgba(157, 78, 221, 0.6));
    transition: filter 0.3s ease;
}

.logo:hover .logo-icon {
    filter: drop-shadow(0 0 15px rgba(157, 78, 221, 0.8));
}

.logo h2 {
    background: linear-gradient(135deg, var(--accent) 0%, #c77dff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

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

.logo-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.nav-links {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
}

.nav-links li {
    margin-bottom: 4px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:hover {
    background: var(--accent-soft);
    color: var(--text-primary);
}

.nav-links a.active {
    background: linear-gradient(135deg, var(--accent-soft) 0%, rgba(157, 78, 221, 0.25) 100%);
    color: var(--accent-hover);
    border: 1px solid var(--border-accent);
}

/* User info in sidebar */
.user-info {
    padding: 15px;
    background: var(--bg-input);
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-top: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-info .username {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info .user-action {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-info .nav-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.user-info .nav-icon img {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.user-info .user-action:hover {
    color: var(--accent-hover);
}

.user-info .logout-link:hover {
    color: var(--error);
}

.user-info .logout {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.user-info .logout:hover {
    color: var(--error);
}

/* Main content */
.content {
    margin-left: 240px;
    padding: 30px 40px;
    flex: 1;
    min-height: 100vh;
    background: var(--bg-dark);
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    animation: slideIn 0.3s ease;
}

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

.alert-success { background: var(--success-soft); border: 1px solid var(--success); color: var(--success); }
.alert-error { background: var(--error-soft); border: 1px solid var(--error); color: var(--error); }
.alert-warning { background: var(--warning-soft); border: 1px solid var(--warning); color: var(--warning); }
.alert-info {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--primary);
    color: var(--text-primary);
    display: block;
}
.alert-info strong {
    color: var(--primary);
}
.alert-info ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
    color: var(--text-secondary);
}
.alert-info li {
    margin-bottom: 5px;
}

.close-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 1;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 22px;
    border: 1px solid var(--border);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.stat-card .number {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, #c77dff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 6px;
    font-weight: 500;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 10px;
}

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

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-input);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr {
    transition: background 0.2s;
}

tr:hover {
    background: var(--bg-hover);
}

td a {
    color: var(--accent-hover);
    text-decoration: none;
    font-weight: 500;
}

td a:hover {
    text-decoration: underline;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-error { background: var(--error-soft); color: var(--error); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-secondary { background: rgba(136, 136, 168, 0.15); color: var(--text-secondary); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #7b2cbf 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(157, 78, 221, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
    box-shadow: 0 6px 20px rgba(157, 78, 221, 0.4);
    transform: translateY(-1px);
}

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

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

.btn-danger {
    background: var(--error-soft);
    color: var(--error);
    border: 1px solid var(--error);
}

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

.btn-sm {
    padding: 7px 14px;
    font-size: 0.8rem;
}

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

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

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

.form-control {
    width: 100%;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

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

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

select.form-control {
    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='%238888a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

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

.form-hint a {
    color: var(--accent);
}

/* Grid layout */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

/* ===== MOBILE NAVIGATION ===== */

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border-accent);
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: all 0.3s ease;
}

.mobile-menu-toggle span::before,
.mobile-menu-toggle span::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

.mobile-menu-toggle span::before {
    top: -7px;
}

.mobile-menu-toggle span::after {
    top: 7px;
}

.mobile-menu-toggle.active span {
    background: transparent;
}

.mobile-menu-toggle.active span::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-toggle.active span::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-overlay.active {
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        padding: 80px 20px 20px;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .sidebar.active {
        left: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

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

    .user-info {
        margin-top: 20px;
    }

    /* Hide logo in mobile sidebar to save space */
    .sidebar .logo {
        margin-bottom: 25px;
    }
}

/* Progress bar */
.progress {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #c77dff 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Logs */
.log-entry {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.82rem;
    line-height: 1.5;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry:hover {
    background: var(--bg-hover);
}

.log-time {
    color: var(--text-muted);
}

.log-action {
    color: var(--accent);
    font-weight: 600;
}

.log-success { color: var(--success); }
.log-error { color: var(--error); }
.log-warning { color: var(--warning); }

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

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 25px;
}

.pagination a,
.pagination span {
    padding: 9px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--bg-hover);
    border-color: var(--border-accent);
}

.pagination .current {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Code block */
.code-block {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: var(--text-secondary);
}

/* Login page - styles moved to inline in login.html */

.login-box {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-glow);
}

.login-box .logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.login-box .logo h2 {
    font-size: 1.8rem;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.4rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.login-box .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 1rem;
}

/* API Key display */
.api-key-display {
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-key-display input {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
}

.api-key-display .btn {
    flex-shrink: 0;
}

/* Sensitive info blur */
.sensitive {
    filter: blur(4px);
    transition: filter 0.2s;
}

.sensitive:hover {
    filter: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Animation for numbers */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.stat-card .number {
    animation: countUp 0.5s ease-out;
}

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

/* Header actions group */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Table styling improvements */
.table-container {
    overflow-x: auto;
}

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

.table th {
    background: var(--bg-input);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 25px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.page-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.page-dots {
    display: inline-flex;
    align-items: center;
    padding: 0 5px;
    color: var(--text-muted);
}

/* ===== ADDITIONAL UTILITIES ===== */

/* Helper variables */
:root {
    --bg: var(--bg-dark);
    --primary: var(--accent);
    --primary-dark: #7b2cbf;
    --text: var(--text-primary);
    --border-light: rgba(42, 42, 74, 0.5);
}

/* Text utilities */
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-primary { color: var(--accent); }
.text-center { text-align: center; }

/* Spacing */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

/* Flex utilities */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* Custom neon icons in navigation */
.nav-icon, .emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    transition: all 0.3s ease;
}

.nav-icon img, .emoji img {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 4px rgba(167, 139, 250, 0.4));
    transition: all 0.3s ease;
}

/* Hover effect for icons */
.nav-links a:hover .nav-icon img,
.nav-links a:hover .emoji img {
    filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.8)) drop-shadow(0 0 12px rgba(167, 139, 250, 0.5));
    transform: scale(1.1);
}

/* Active link icon glow */
.nav-links a.active .nav-icon img,
.nav-links a.active .emoji img {
    filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.6)) drop-shadow(0 0 10px rgba(167, 139, 250, 0.4));
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Tab navigation */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

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

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Accordion */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.accordion-header {
    padding: 1rem 1.25rem;
    background: var(--bg-input);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: var(--bg-hover);
}

.accordion-content {
    padding: 1rem 1.25rem;
    display: none;
}

.accordion-item.open .accordion-content {
    display: block;
}

/* Copy button */
.copy-btn {
    padding: 6px 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.copy-btn.copied {
    background: var(--success-soft);
    border-color: var(--success);
    color: var(--success);
}

/* Project color dot */
.project-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

/* Search box */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
}

.search-box::before {
    content: "🔍";
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
}

/* Status indicator dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.active { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.warmup { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.status-dot.banned { background: var(--error); }
.status-dot.inactive { background: var(--text-muted); }

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-bar .form-control {
    max-width: 200px;
}

/* Quick stats row */
.quick-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}

.quick-stat {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.quick-stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

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

/* ===== MOBILE RESPONSIVE IMPROVEMENTS ===== */
@media (max-width: 768px) {
    /* Typography adjustments */
    .page-header h1 {
        font-size: 1.5rem;
    }

    .card-header h3 {
        font-size: 1rem;
    }

    /* Filter bar */
    .filter-bar {
        flex-direction: column;
    }

    .filter-bar .form-control {
        max-width: 100%;
    }

    /* Stats grid - single column on mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card .number {
        font-size: 1.8rem;
    }

    /* Quick stats */
    .quick-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* Page header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 20px;
    }

    /* Header actions */
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .header-actions .btn {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }

    /* Button groups */
    .btn-group {
        flex-wrap: wrap;
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
        min-width: 120px;
    }

    /* Cards */
    .card {
        padding: 18px;
        margin-bottom: 18px;
    }

    /* Tables - horizontal scroll with better touch */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -18px;
        padding: 0 18px;
    }

    table {
        min-width: 600px;
    }

    th, td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }

    /* Forms - larger touch targets */
    .form-control {
        padding: 15px 16px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .btn {
        padding: 13px 20px;
        font-size: 0.95rem;
        min-height: 44px; /* iOS recommended touch target */
    }

    .btn-sm {
        padding: 10px 16px;
        min-height: 38px;
    }

    /* Login box */
    .login-box {
        max-width: 100%;
        margin: 0 20px;
        padding: 30px 24px;
    }

    /* Badges - slightly larger */
    .badge {
        padding: 6px 13px;
        font-size: 0.8rem;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        gap: 4px;
    }

    .page-btn {
        min-width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }

    /* Alert positioning */
    .alert {
        margin: 0 0 15px;
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    /* API key display */
    .api-key-display {
        flex-direction: column;
    }

    .api-key-display .btn {
        width: 100%;
    }

    /* Tabs */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
    }

    .tab {
        white-space: nowrap;
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Code blocks */
    .code-block {
        font-size: 0.75rem;
        padding: 12px;
    }

    /* Empty state */
    .empty-state {
        padding: 40px 20px;
    }
}

/* Extra small devices (phones in portrait, less than 480px) */
@media (max-width: 480px) {
    .content {
        padding: 70px 15px 15px;
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .stat-card .number {
        font-size: 1.6rem;
    }

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

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

    .header-actions .btn {
        width: 100%;
    }

    /* Stack grid-2 items */
    .grid-2 {
        gap: 15px;
    }

    /* Smaller cards */
    .card {
        padding: 15px;
    }

    /* Compact table on very small screens */
    th, td {
        padding: 10px 8px;
        font-size: 0.8rem;
    }
}

/* Medium devices (tablets, 769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .content {
        margin-left: 220px;
        padding: 25px 30px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

/* Landscape mobile improvements */
@media (max-width: 896px) and (orientation: landscape) {
    .sidebar {
        width: 240px;
        padding: 15px;
    }

    .sidebar.active {
        left: 0;
    }

    .content {
        padding: 20px;
    }

    .nav-links {
        margin-bottom: 10px;
    }

    .nav-links li {
        margin-bottom: 2px;
    }

    .nav-links a {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .btn,
    .filter-bar,
    .pagination {
        display: none !important;
    }
    
    .content {
        margin-left: 0 !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Nav divider and section */
.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 15px 20px;
    list-style: none;
}

.nav-section {
    padding: 10px 20px 5px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--primary);
    text-transform: uppercase;
    list-style: none;
}

/* Gradient text utility */
.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
