/* AI Data Hub - Webhook Dashboard Styles */
/* Navy Blue Theme - All White Text - Responsive (No Mobile) */

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

/* Force ALL text to be white */
*,
*::before,
*::after,
html, body, div, span, p, a, h1, h2, h3, h4, h5, h6,
table, thead, tbody, tr, th, td,
input, button, select, textarea, label,
li, ul, ol, nav, header, footer, section, article,
.job-title, .hospital-name, .parent-client, .location-cell,
.stat-value, .stat-label, .section-title, .section-badge,
.modal-header, .modal-body, .modal-description,
.empty-state h3, .empty-state p,
.nav-btn, .action-btn, .btn-view, .btn-open, .btn-delete,
.webhook-url, .copy-btn, .search-input, .timestamp {
    color: #ffffff !important;
}

:root {
    --bg-primary: #0a1628;
    --bg-secondary: #0f2240;
    --bg-tertiary: #152a4a;
    --border-color: rgba(255, 255, 255, 0.15);
    --accent-primary: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.4);
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
}

html {
    min-width: 320px;
}

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

/* ========== ANIMATED BACKGROUND ========== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #0a1628 0%, #1e3a5f 50%, #0a1628 100%);
}

.bg-animation::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
    animation: floatOrb1 40s ease-in-out infinite;
    filter: blur(80px);
}

.bg-animation::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 60%);
    animation: floatOrb2 50s ease-in-out infinite;
    filter: blur(80px);
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0); opacity: 0.5; }
    50% { transform: translate(15%, 20%); opacity: 0.8; }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0); opacity: 0.4; }
    50% { transform: translate(-15%, -15%); opacity: 0.7; }
}

/* ========== LAYOUT ========== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

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

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px var(--accent-glow);
}

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

.logo-text h1 {
    font-size: 18px;
    font-weight: 700;
}

.logo-text span {
    font-size: 10px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Sidebar Sections */
.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section h3 {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

/* Stats Cards */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

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

.stat-icon.purple {
    background: rgba(59, 130, 246, 0.2);
}

.stat-icon.green {
    background: rgba(34, 197, 94, 0.2);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.2);
}

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

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Environment Badge */
.env-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.env-dev {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.env-prod {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Webhook URL Box */
.webhook-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.webhook-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.webhook-box-header span {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.8;
}

.webhook-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
}

.webhook-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

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

.webhook-url {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    word-break: break-all;
    margin-bottom: 12px;
    line-height: 1.5;
}

.copy-btn {
    width: 100%;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

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

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-left p {
    font-size: 14px;
    opacity: 0.7;
}

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

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

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    pointer-events: none;
}

.search-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px 12px 44px;
    font-family: inherit;
    font-size: 14px;
    color: #ffffff !important;
    width: 260px;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

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

/* Refresh Button */
.refresh-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.refresh-btn.spinning svg {
    animation: spin 1s linear infinite;
}

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

/* ========== TABLES ========== */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

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

thead {
    background: var(--bg-tertiary);
}

th {
    padding: 16px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    opacity: 0.7;
}

td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    vertical-align: middle;
}

tbody tr {
    transition: all 0.3s ease;
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

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

.job-title {
    font-weight: 600;
}

.location-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.state-badge {
    background: rgba(59, 130, 246, 0.2);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.timestamp {
    font-size: 12px;
    opacity: 0.6;
    font-family: 'JetBrains Mono', monospace;
}

/* Action Buttons */
.action-btn {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border: none;
}

.btn-view {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.btn-view:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.btn-open {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.btn-open:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-pending {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    cursor: default;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Section Headers */
.section-header {
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.section-title h2 {
    font-size: 20px;
    font-weight: 700;
}

.section-badge {
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 700;
}

.section-actions p {
    font-size: 14px;
    opacity: 0.7;
}

/* Section Styles */
.existing-section .section-badge {
    background: rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.existing-row {
    border-left: 4px solid #3b82f6;
}

.new-section .section-badge {
    background: rgba(34, 197, 94, 0.3);
    border: 1px solid rgba(34, 197, 94, 0.4);
}

.new-row {
    border-left: 4px solid #22c55e;
}

.stale-section .section-badge {
    background: rgba(239, 68, 68, 0.3);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.stale-row {
    border-left: 4px solid #ef4444;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    opacity: 0.6;
    max-width: 400px;
    margin: 0 auto;
}

/* Dashboard Category Sections */
.dashboard-category-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
}

.dashboard-category-section h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-category-section .table-wrapper {
    margin-bottom: 16px;
}

.dashboard-category-section table {
    width: 100%;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    transition: all 0.3s ease;
}

.view-all-link:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateX(4px);
}

/* Dashboard Empty State Message */
.dashboard-category-section > p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    padding: 40px 20px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin-bottom: 16px;
}

/* Color-coded sections */
.dashboard-new {
    border-left: 4px solid #22c55e;
}

.dashboard-new h3 {
    color: #22c55e;
}

.dashboard-existing {
    border-left: 4px solid #3b82f6;
}

.dashboard-existing h3 {
    color: #3b82f6;
}

.dashboard-stale {
    border-left: 4px solid #ef4444;
}

.dashboard-stale h3 {
    color: #ef4444;
}

/* Bulk Actions */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
}

.bulk-actions span {
    font-size: 14px;
}

/* Checkbox */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.meta-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-description {
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    opacity: 0.9;
}

/* Nav Buttons */
.nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: 1px solid transparent;
}

/* Navigation Link Active State */
.nav-link.active {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-btn-existing {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.nav-btn-new {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

.nav-btn-stale {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.nav-btn:hover {
    transform: translateX(4px);
}

.nav-btn .count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== RESPONSIVE - ALL SCREENS ========== */

/* Under 1920px - 5% smaller */
@media (max-width: 1919px) {
    .sidebar { width: 266px; padding: 23px; }
    .main-content { margin-left: 266px; padding: 27px; gap: 27px; }
    .logo-icon { width: 42px; height: 42px; }
    .logo-text h1 { font-size: 17px; }
    .logo-text span { font-size: 9.5px; }
    .sidebar-section { margin-bottom: 27px; }
    .sidebar-section h3 { font-size: 10.5px; margin-bottom: 13px; }
    .stat-card { padding: 13px; gap: 11px; border-radius: 11px; }
    .stat-icon { width: 38px; height: 38px; border-radius: 9.5px; }
    .stat-value { font-size: 23px; }
    .stat-label { font-size: 10.5px; }
    .nav-btn { padding: 11px 13px; font-size: 13px; border-radius: 9.5px; }
    .nav-btn .count { font-size: 11px; padding: 3px 7.5px; }
    .webhook-box { padding: 15px; border-radius: 11px; }
    .webhook-url { font-size: 9.5px; padding: 9.5px 11px; }
    .copy-btn { padding: 9.5px 15px; font-size: 12px; }
    .header-left h2 { font-size: 27px; }
    .header-left p { font-size: 13px; }
    .search-input { width: 247px; padding: 11px 15px 11px 42px; font-size: 13px; border-radius: 9.5px; }
    .refresh-btn { padding: 11px; border-radius: 9.5px; }
    .section-title h2 { font-size: 19px; }
    .section-badge { padding: 4.75px 11px; font-size: 11px; border-radius: 15px; }
    .table-container { border-radius: 15px; }
    td, th { padding: 15px 19px; font-size: 13px; }
    th { font-size: 10.5px; }
    .action-btn { padding: 7.5px 13px; font-size: 11px; border-radius: 7.5px; }
    .state-badge { padding: 4.75px 9.5px; font-size: 11px; }
    .timestamp { font-size: 11px; }
    .empty-state { padding: 76px 38px; }
    .empty-icon { width: 76px; height: 76px; }
    .empty-state h3 { font-size: 19px; }
    .empty-state p { font-size: 13px; }
    .modal { border-radius: 19px; max-width: 665px; }
    .modal-header { padding: 19px 23px; }
    .modal-header h3 { font-size: 17px; }
    .modal-close { width: 34px; height: 34px; }
    .modal-body { padding: 23px; }
    .meta-item { padding: 9.5px 13px; border-radius: 7.5px; }
    .modal-description { font-size: 13px; }
}

/* 4K Screens (3840px+) */
@media (min-width: 3840px) {
    .sidebar { width: 480px; padding: 44px; }
    .main-content { margin-left: 480px; padding: 64px; }
    .header-left h2 { font-size: 52px; }
    .stat-value { font-size: 42px; }
    .stat-card { padding: 28px; }
    .stat-icon { width: 56px; height: 56px; }
    .search-input { width: 500px; font-size: 18px; padding: 18px 22px 18px 56px; }
    td, th { padding: 28px 36px; font-size: 18px; }
    .logo-icon { width: 60px; height: 60px; }
    .logo-text h1 { font-size: 28px; }
    .table-container { border-radius: 24px; }
    .action-btn { padding: 14px 20px; font-size: 15px; }
}

/* 2K Screens (2560px+) */
@media (min-width: 2560px) and (max-width: 3839px) {
    .sidebar { width: 380px; padding: 32px; }
    .main-content { margin-left: 380px; padding: 48px; }
    .header-left h2 { font-size: 40px; }
    .stat-value { font-size: 32px; }
    .search-input { width: 400px; font-size: 16px; }
    td, th { padding: 22px 28px; font-size: 16px; }
    .logo-text h1 { font-size: 22px; }
}

/* Extra Large (1600px - 2559px) */
@media (min-width: 1600px) and (max-width: 2559px) {
    .sidebar { width: 320px; padding: 28px; }
    .main-content { margin-left: 320px; padding: 36px; }
    .header-left h2 { font-size: 34px; }
    .stat-value { font-size: 28px; }
    .search-input { width: 320px; }
    td, th { padding: 18px 24px; }
}

/* Large (1400px - 1599px) */
@media (min-width: 1400px) and (max-width: 1599px) {
    .sidebar { width: 300px; }
    .main-content { margin-left: 300px; padding: 32px; }
    .header-left h2 { font-size: 32px; }
    .search-input { width: 300px; }
}

/* Medium (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .sidebar { width: 280px; }
    .main-content { margin-left: 280px; padding: 28px; }
    .search-input { width: 280px; }
}

/* Small Desktop (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .sidebar { width: 260px; padding: 20px; }
    .main-content { margin-left: 260px; padding: 24px; }
    .header-left h2 { font-size: 26px; }
    .search-input { width: 240px; font-size: 13px; }
    .stat-value { font-size: 22px; }
    td, th { padding: 14px 16px; font-size: 13px; }
    .logo-text h1 { font-size: 16px; }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .sidebar { width: 220px; padding: 16px; }
    .main-content { margin-left: 220px; padding: 20px; gap: 20px; }
    .header-left h2 { font-size: 24px; }
    .header-right { gap: 8px; }
    .search-input { width: 180px; padding: 10px 12px 10px 38px; font-size: 12px; }
    .search-box svg { left: 12px; width: 16px; height: 16px; }
    .refresh-btn { padding: 10px; }
    .logo-section { gap: 8px; padding-bottom: 16px; margin-bottom: 16px; }
    .logo-icon { width: 36px; height: 36px; }
    .logo-text h1 { font-size: 14px; }
    .logo-text span { font-size: 9px; }
    .sidebar-section { margin-bottom: 20px; }
    .sidebar-section h3 { font-size: 10px; margin-bottom: 10px; }
    .stat-card { padding: 12px; gap: 10px; }
    .stat-icon { width: 34px; height: 34px; }
    .stat-value { font-size: 20px; }
    .stat-label { font-size: 10px; }
    .webhook-box { padding: 12px; }
    .webhook-url { font-size: 9px; padding: 8px 10px; }
    .copy-btn { padding: 8px 12px; font-size: 11px; }
    .section-title h2 { font-size: 18px; }
    .section-badge { padding: 4px 10px; font-size: 11px; }
    .table-container { border-radius: 12px; }
    td, th { padding: 12px 14px; font-size: 12px; }
    th { font-size: 10px; }
    .action-btn { padding: 6px 10px; font-size: 11px; }
    .nav-btn { padding: 10px 12px; font-size: 12px; }
    .modal { max-width: 95%; }
}

/* Small Tablet (600px - 767px) */
@media (min-width: 600px) and (max-width: 767px) {
    .app-container { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .main-content { margin-left: 0; padding: 20px; }
    .logo-section { justify-content: center; }
    .stats-grid { flex-direction: row; flex-wrap: wrap; }
    .stat-card { flex: 1; min-width: 140px; }
    .nav-buttons { flex-direction: row; flex-wrap: wrap; }
    .nav-btn { flex: 1; min-width: 120px; justify-content: center; }
    .webhook-box { display: none; }
    .content-header { flex-direction: column; align-items: stretch; }
    .header-right { justify-content: space-between; }
    .search-input { width: 100%; flex: 1; }
    .header-left h2 { font-size: 24px; }
    td, th { padding: 12px 14px; font-size: 12px; }
    .section-title { flex-wrap: wrap; }
}

/* Large Mobile (480px - 599px) */
@media (min-width: 480px) and (max-width: 599px) {
    .app-container { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .main-content { margin-left: 0; padding: 16px; gap: 20px; }
    .logo-section { justify-content: center; }
    .logo-icon { width: 40px; height: 40px; }
    .logo-text h1 { font-size: 16px; }
    .stats-grid { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    .stat-card { flex: 1; min-width: 45%; padding: 12px; }
    .stat-value { font-size: 20px; }
    .stat-icon { width: 36px; height: 36px; }
    .nav-buttons { flex-direction: column; }
    .nav-btn { padding: 12px; }
    .webhook-box { display: none; }
    .sidebar-section h3 { font-size: 10px; }
    .content-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .header-left h2 { font-size: 22px; }
    .header-right { flex-direction: column; gap: 10px; }
    .search-box { width: 100%; }
    .search-input { width: 100%; }
    .refresh-btn { align-self: flex-end; }
    .section-title h2 { font-size: 18px; }
    .section-badge { font-size: 10px; padding: 4px 8px; }
    .table-container { border-radius: 10px; }
    td, th { padding: 10px 12px; font-size: 11px; }
    th { font-size: 9px; }
    .action-btn { padding: 6px 8px; font-size: 10px; }
    .modal { max-width: 98%; border-radius: 16px; }
    .modal-header { padding: 16px; }
    .modal-header h3 { font-size: 16px; }
    .modal-body { padding: 16px; }
}

/* Small Mobile (320px - 479px) */
@media (max-width: 479px) {
    .app-container { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 14px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .main-content { margin-left: 0; padding: 14px; gap: 16px; }
    .logo-section { justify-content: center; gap: 10px; padding-bottom: 14px; margin-bottom: 14px; }
    .logo-icon { width: 36px; height: 36px; }
    .logo-text h1 { font-size: 14px; }
    .logo-text span { font-size: 8px; }
    .sidebar-section { margin-bottom: 16px; }
    .sidebar-section h3 { font-size: 9px; margin-bottom: 10px; }
    .stats-grid { gap: 8px; }
    .stat-card { padding: 10px; gap: 8px; }
    .stat-icon { width: 32px; height: 32px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 9px; }
    .nav-buttons { gap: 6px; }
    .nav-btn { padding: 10px 12px; font-size: 12px; }
    .nav-btn .count { font-size: 11px; padding: 2px 6px; }
    .webhook-box { display: none; }
    .env-badge { padding: 8px 12px; font-size: 11px; }
    .content-header { flex-direction: column; align-items: stretch; gap: 12px; }
    .header-left h2 { font-size: 20px; }
    .header-left p { font-size: 12px; }
    .header-right { flex-direction: column; gap: 8px; }
    .search-box { width: 100%; }
    .search-input { width: 100%; padding: 10px 12px 10px 38px; font-size: 13px; }
    .search-box svg { left: 12px; width: 16px; height: 16px; }
    .refresh-btn { padding: 10px; align-self: flex-end; }
    .section-header { margin-bottom: 14px; }
    .section-title { flex-wrap: wrap; gap: 8px; }
    .section-title h2 { font-size: 16px; }
    .section-badge { font-size: 10px; padding: 3px 8px; }
    .section-actions p { font-size: 12px; }
    .table-container { border-radius: 10px; }
    .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 500px; }
    td, th { padding: 10px; font-size: 11px; white-space: nowrap; }
    th { font-size: 9px; }
    .job-title { font-size: 12px; }
    .timestamp { font-size: 10px; }
    .action-btn { padding: 5px 8px; font-size: 10px; gap: 4px; }
    .bulk-actions { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
    .bulk-actions span { font-size: 12px; }
    .btn-delete { padding: 6px 10px; font-size: 11px; }
    .empty-state { padding: 50px 20px; }
    .empty-icon { width: 60px; height: 60px; }
    .empty-state h3 { font-size: 16px; }
    .empty-state p { font-size: 12px; }
    .modal { max-width: 100%; margin: 10px; border-radius: 14px; }
    .modal-header { padding: 14px 16px; }
    .modal-header h3 { font-size: 15px; }
    .modal-close { width: 32px; height: 32px; }
    .modal-body { padding: 14px; }
    .modal-meta { gap: 8px; }
    .meta-item { padding: 8px 10px; font-size: 12px; }
    .modal-description { font-size: 13px; line-height: 1.7; }
    input[type="checkbox"] { width: 16px; height: 16px; }
}

/* ========== DASHBOARD TABLE RESPONSIVE STYLES ========== */

/* 4K Screens */
@media (min-width: 3840px) {
    #jobsTable th { font-size: 20px; padding: 24px 32px; }
    #jobsTable td { font-size: 20px; padding: 24px 32px; }
    .category-badge { font-size: 18px; padding: 8px 20px; }
    .view-desc-btn { font-size: 16px; }
}

/* 2K Screens */
@media (min-width: 2560px) and (max-width: 3839px) {
    #jobsTable th { font-size: 16px; padding: 18px 24px; }
    #jobsTable td { font-size: 16px; padding: 18px 24px; }
    .category-badge { font-size: 14px; padding: 6px 16px; }
    .view-desc-btn { font-size: 14px; }
}

/* Large Screens (1600px - 2559px) */
@media (min-width: 1600px) and (max-width: 2559px) {
    #jobsTable th { font-size: 14px; padding: 14px 18px; }
    #jobsTable td { font-size: 14px; padding: 14px 18px; }
    .category-badge { font-size: 13px; }
}

/* Medium-Large Screens (1400px - 1599px) */
@media (min-width: 1400px) and (max-width: 1599px) {
    #jobsTable th { font-size: 13px; }
    #jobsTable td { font-size: 13px; }
}

/* Standard Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    #jobsTable th { min-width: 120px; font-size: 12px; }
    #jobsTable td { font-size: 13px; }
    .table-container { overflow-x: auto; }
}

/* Small Desktop (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    #jobsTable { min-width: 1400px; }
    #jobsTable th { min-width: 100px; font-size: 11px; padding: 10px 12px; }
    #jobsTable td { font-size: 12px; padding: 10px 12px; }
    .category-badge { font-size: 11px; padding: 3px 10px; }
    .view-desc-btn { font-size: 10px; }
    .table-container { overflow-x: auto; }

    /* Stats grid on smaller desktops */
    .main-content > div[style*="grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Laptop Screens (1366px) - Most common laptop resolution */
@media (min-width: 1300px) and (max-width: 1400px) {
    #jobsTable th[style*="min-width: 200px"] { min-width: 160px !important; }
    #jobsTable th[style*="min-width: 150px"] { min-width: 130px !important; }
    #jobsTable th[style*="min-width: 120px"] { min-width: 100px !important; }
    #jobsTable td { font-size: 12px; }
    .content-header { gap: 12px; }
}

/* Ultra-wide Screens (2560px+) */
@media (min-width: 2560px) {
    .main-content { max-width: 2400px; }
    #jobsTable th { white-space: normal; }
}

/* ========== AI SETTINGS PAGE RESPONSIVE STYLES ========== */

/* Small Desktop and Below (1199px and down) */
@media (max-width: 1199px) {
    .form-group input[type="text"],
    .form-group input[type="password"],
    .form-group textarea {
        font-size: 13px !important;
    }

    /* Make API keys grid single column on smaller screens */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* Tablet Size (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .settings-section h3 {
        font-size: 16px !important;
    }

    .form-group label {
        font-size: 13px !important;
    }

    .form-group input[type="text"],
    .form-group input[type="password"],
    .form-group textarea {
        font-size: 12px !important;
        padding: 10px 14px !important;
    }
}

/* Small Screens (below 768px) */
@media (max-width: 767px) {
    .content-header {
        margin-bottom: 20px !important;
    }

    .settings-section {
        padding-bottom: 20px !important;
    }

    .settings-section h3 {
        font-size: 15px !important;
        margin-bottom: 12px !important;
    }

    .form-group {
        margin-bottom: 16px !important;
    }

    .form-group label {
        font-size: 12px !important;
    }

    .form-group input[type="text"],
    .form-group input[type="password"],
    .form-group textarea {
        font-size: 12px !important;
        padding: 10px 12px !important;
    }

    div[style*="text-align: right"] button {
        width: 100% !important;
    }
}

/* ========== STATS CARDS RESPONSIVE ADJUSTMENTS ========== */

/* Small Desktop (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .stats-section {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Tablet and Below (below 1024px) */
@media (max-width: 1023px) {
    .stats-section {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Small Screens (below 600px) */
@media (max-width: 599px) {
    .stats-section {
        grid-template-columns: 1fr !important;
    }
}

/* ========== CONTENT HEADER RESPONSIVE IMPROVEMENTS ========== */

/* Medium Laptop (1200px - 1366px) */
@media (min-width: 1200px) and (max-width: 1366px) {
    .content-header {
        gap: 12px;
    }

    .header-left h2 {
        font-size: 26px;
    }

    .header-left p {
        font-size: 13px;
    }

    .header-right {
        gap: 10px;
    }
}

/* Small Desktop (1024px - 1199px) */
@media (min-width: 1024px) and (max-width: 1199px) {
    .content-header {
        flex-wrap: wrap;
    }

    .header-right {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ========== BUTTON RESPONSIVE STYLES ========== */

/* Ensure buttons don't overflow on smaller screens */
@media (max-width: 1199px) {
    .action-btn {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #analyzeSelectedBtn {
        font-size: 12px !important;
        padding: 10px 14px !important;
    }
}

/* ========== TABLE HORIZONTAL SCROLL IMPROVEMENTS ========== */

/* Enable smooth scrolling for tables on all PC screens */
@media (min-width: 1024px) {
    .table-wrapper {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    }

    .table-wrapper::-webkit-scrollbar {
        height: 8px;
    }

    .table-wrapper::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.1);
        border-radius: 4px;
    }

    .table-wrapper::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 4px;
    }

    .table-wrapper::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.4);
    }
}

/* ========== MODAL RESPONSIVE IMPROVEMENTS ========== */

/* Large Screens */
@media (min-width: 1600px) {
    .modal {
        max-width: 900px;
    }

    .modal-header h3 {
        font-size: 20px;
    }

    .modal-description {
        font-size: 15px;
    }
}

/* Standard Desktop */
@media (min-width: 1200px) and (max-width: 1599px) {
    .modal {
        max-width: 750px;
    }
}

/* Small Desktop */
@media (min-width: 1024px) and (max-width: 1199px) {
    .modal {
        max-width: 90%;
    }

    .modal-body {
        padding: 20px;
    }
}

/* ========== SIDEBAR SCROLL IMPROVEMENTS ========== */

/* Ensure sidebar scrolls smoothly on all screens */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
