/* KeywordRadar - Styles */

:root {
    --primary: #007AFF;
    --primary-dark: #0056CC;
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
    --sidebar-width: 260px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.5;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--gray-100);
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #5856D6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-600);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.snapshot-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    color: var(--gray-600);
    border: 1px dashed var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.snapshot-btn:hover {
    background: var(--gray-50);
    border-color: var(--primary);
    color: var(--primary);
}

.snapshot-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.snapshot-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.snapshot-btn:hover svg {
    opacity: 1;
}

.snapshot-btn .animate-spin {
    animation: spin 1s linear infinite;
}

.snapshot-btn.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

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

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

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

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #5856D6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
}

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

.logout-btn {
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--gray-500);
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--gray-100);
    color: var(--danger);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: calc(100vw - var(--sidebar-width));
    min-width: 0;
}

/* Alerts - Highly Visible */
.alert {
    padding: 18px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    animation: alertSlideIn 0.4s ease;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    border-left: 5px solid;
}

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

.alert-success {
    background: #052e16;
    color: #4ade80;
    border-left-color: #22c55e;
}

.alert-error {
    background: #450a0a;
    color: #fca5a5;
    border-left-color: #ef4444;
}

.alert-warning {
    background: #451a03;
    color: #fcd34d;
    border-left-color: #f59e0b;
}

.alert-info {
    background: #172554;
    color: #93c5fd;
    border-left-color: #3b82f6;
}

.alert-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

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

/* Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px;
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 8px;
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

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

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.stat-icon.blue { background: rgba(0, 122, 255, 0.15); color: var(--primary); }
.stat-icon.green { background: rgba(52, 199, 89, 0.15); color: var(--success); }
.stat-icon.orange { background: rgba(255, 149, 0, 0.15); color: var(--warning); }
.stat-icon.purple { background: rgba(88, 86, 214, 0.15); color: #5856D6; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

.btn-success {
    background: var(--success);
    color: white;
}

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

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

.btn-icon {
    padding: 8px 10px;
    position: relative;
}

.btn-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--gray-200);
    color: var(--gray-700);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 8px;
    min-width: 18px;
    text-align: center;
}

.count-badge {
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 2px;
}

/* Header actions responsive */
.header-actions {
    flex-wrap: wrap;
}

.header-actions .btn {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
}

.header-actions .btn-text {
    display: inline;
}

/* En pantallas medianas, ocultar texto de algunos botones */
@media (max-width: 1100px) {
    .header-actions .btn-text {
        display: none;
    }

    .header-actions .btn {
        padding: 8px 10px;
    }

    .header-actions .count-badge {
        margin-left: 0;
    }
}

/* En móvil, ocultar botones secundarios */
@media (max-width: 768px) {
    .header-actions .btn.btn-secondary {
        display: none;
    }

    .header-actions .btn.btn-success .btn-text {
        display: none;
    }
}

.btn-block {
    width: 100%;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    background: white;
    transition: all 0.2s;
}

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

.form-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
}

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

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-blue { background: rgba(0, 122, 255, 0.15); color: var(--primary); }
.badge-green { background: rgba(52, 199, 89, 0.15); color: #1B7F37; }
.badge-orange { background: rgba(255, 149, 0, 0.15); color: #995700; }
.badge-red { background: rgba(255, 59, 48, 0.15); color: #CC2F26; }
.badge-purple { background: rgba(88, 86, 214, 0.15); color: #5856D6; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* Score Bar */
.score-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.score-fill.high { background: var(--success); }
.score-fill.medium { background: var(--warning); }
.score-fill.low { background: var(--danger); }

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-600);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab:hover {
    color: var(--gray-800);
}

.tab.active {
    background: white;
    color: var(--gray-800);
    box-shadow: var(--shadow-sm);
}

/* Grid */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Project Card */
.project-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.2s;
}

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

.project-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.project-keyword {
    color: var(--gray-500);
    font-size: 14px;
    margin-bottom: 16px;
}

.project-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.project-stat {
    text-align: center;
}

.project-stat-value {
    font-size: 18px;
    font-weight: 600;
}

.project-stat-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
}

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

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

.empty-state h3 {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

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

.pagination a, .pagination span {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-decoration: none;
    color: var(--gray-600);
    background: white;
    border: 1px solid var(--gray-200);
    min-width: 36px;
    text-align: center;
}

.pagination a:hover {
    background: var(--gray-100);
}

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

.pagination-ellipsis {
    border: none !important;
    background: transparent !important;
    padding: 8px 4px !important;
    min-width: auto !important;
}

.pagination-info {
    border: none !important;
    background: transparent !important;
    color: var(--gray-500) !important;
    font-size: 13px !important;
    margin-left: 12px;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.auth-title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 32px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--gray-500);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* Responsive */
@media (max-width: 1024px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Sortable table headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.sort-link:hover {
    color: var(--primary);
}

.sort-icon {
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.sort-icon.inactive {
    opacity: 0.3;
}

.sort-icon.active {
    opacity: 1;
    color: var(--primary);
}

.sortable-header:hover .sort-icon.inactive {
    opacity: 0.6;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   RESPONSIVE STYLES - COMPLETE
   ============================================ */

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--gray-700);
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

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

/* TABLET STYLES (768px - 1024px) */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 220px;
    }
    
    .main-content {
        padding: 24px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    /* Tables */
    .table th, .table td {
        padding: 12px 10px;
        font-size: 13px;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Action Cards */
    .action-panel {
        grid-template-columns: 1fr !important;
    }
}

/* MOBILE STYLES (max-width: 768px) */
@media (max-width: 768px) {
    /* Show mobile menu button */
    .mobile-menu-toggle {
        display: flex;
    }
    
    /* Sidebar - Hidden by default, slides in */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Main content - Full width */
    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 70px; /* Space for mobile menu button */
    }
    
    /* Page Header */
    .page-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 16px;
    }
    
    .page-header .flex {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .page-title {
        font-size: 22px;
    }
    
    .page-subtitle {
        font-size: 13px;
    }
    
    /* Buttons in header */
    .page-header .btn,
    .page-header button,
    .page-header a.btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    /* Filter Pills - Horizontal scroll */
    .filter-pills {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .filter-pills::-webkit-scrollbar {
        display: none;
    }
    
    .filter-pill {
        flex-shrink: 0;
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
    
    /* Stats Grid - Stack on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .stat-card {
        padding: 12px !important;
    }
    
    .stat-value {
        font-size: 18px !important;
    }
    
    .stat-label {
        font-size: 11px !important;
    }
    
    /* Action Cards */
    .action-panel {
        grid-template-columns: 1fr !important;
    }
    
    /* Cards */
    .card {
        padding: 16px;
        border-radius: 12px;
    }
    
    /* Tables - Responsive */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    .table {
        min-width: 600px;
    }
    
    .table th, .table td {
        padding: 10px 8px;
        font-size: 12px;
        white-space: nowrap;
    }
    
    .table th:first-child, 
    .table td:first-child {
        position: sticky;
        left: 0;
        background: white;
        z-index: 1;
        box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    }
    
    /* Hide less important columns on mobile */
    .table .hide-mobile {
        display: none;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr !important;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-label {
        font-size: 13px;
    }
    
    .form-input, .form-select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px;
    }
    
    /* Search Box */
    .search-box {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-box input {
        width: 100%;
    }
    
    /* Grids */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    
    /* Modals */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 16px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Dropdown Menus */
    .dropdown-menu {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    /* Progress Banner */
    #job-progress-banner {
        padding: 12px 16px;
        border-radius: 12px;
    }
    
    #job-progress-banner .flex {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Alerts */
    .alert {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    /* Briefing Wizard */
    .wizard-steps {
        overflow-x: auto;
        padding-bottom: 8px;
        gap: 0;
    }
    
    .wizard-step {
        min-width: 60px;
        flex: 0 0 auto;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .step-label {
        font-size: 10px;
        max-width: 60px;
    }
    
    .wizard-content {
        padding: 16px;
    }
    
    .keyword-input-group {
        flex-direction: column;
    }
    
    .keyword-input-group input {
        width: 100%;
    }
    
    .keyword-input-group button {
        width: 100%;
    }
    
    /* Kanban */
    .kanban-board {
        flex-direction: column;
    }
    
    .kanban-column {
        width: 100%;
        min-width: auto;
    }
}

/* SMALL MOBILE (max-width: 480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 12px;
        padding-top: 65px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    /* Stats - 2 columns tight */
    .stats-grid {
        gap: 6px !important;
    }
    
    .stat-card {
        padding: 10px !important;
    }
    
    .stat-value {
        font-size: 16px !important;
    }
    
    /* Buttons */
    .btn {
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .btn-sm {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    /* Action buttons in table */
    .table .action-buttons {
        flex-direction: column;
        gap: 4px;
    }
    
    .table .action-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Wizard on very small screens */
    .wizard-steps::before {
        display: none;
    }
    
    .wizard-step {
        min-width: 50px;
    }
    
    .step-label {
        display: none;
    }
}

/* LANDSCAPE MOBILE */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        padding-top: 16px;
    }
    
    .mobile-menu-toggle {
        top: 8px;
        left: 8px;
        width: 36px;
        height: 36px;
    }
    
    .modal-content {
        max-height: 80vh;
    }
}

/* PRINT STYLES */
@media print {
    .sidebar,
    .mobile-menu-toggle,
    .btn,
    .filter-pills,
    #job-progress-banner {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 0;
    }
    
    .table {
        min-width: auto;
    }
}

/* UTILITY CLASSES FOR RESPONSIVE */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
    
    .show-mobile {
        display: block !important;
    }
}

/* Touch-friendly styles */
@media (hover: none) and (pointer: coarse) {
    .btn, button, a {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-item {
        padding: 14px 16px;
    }
    
    .table td, .table th {
        padding: 12px 10px;
    }
    
    .dropdown-item {
        padding: 14px 16px;
    }
}
