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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --background: #f1f5f9;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--text-primary);
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 20px;
    font-weight: 600;
}

.logo i {
    font-size: 24px;
    color: var(--primary);
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
    flex: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.nav-item a:hover,
.nav-item.active a {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-item.active a {
    border-left: 3px solid var(--primary);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.user-info {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.user-info span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
}

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

.content-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

.btn-secondary:hover {
    background: #475569;
}

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

.view {
    display: none;
}

.view.active {
    display: block;
}

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

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(37,99,235,0.1);
    color: var(--primary);
}

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

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

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 14px;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

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

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

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
}

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

.alert-item {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid;
}

.alert-item.critical {
    background: #fef2f2;
    border-color: var(--danger);
}

.alert-item.high {
    background: #fff7ed;
    border-color: var(--warning);
}

.alert-item.medium {
    background: #fefce8;
    border-color: #eab308;
}

.alert-item.low {
    background: #f0fdf4;
    border-color: var(--success);
}

.alert-item.unread {
    font-weight: 500;
}

.alert-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.alert-type {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.alert-time {
    font-size: 12px;
    color: var(--text-secondary);
}

.alert-content {
    font-size: 14px;
    color: var(--text-primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

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

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-content form {
    padding: 20px;
}

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

.detail-stat {
    background: var(--background);
    padding: 16px;
    border-radius: 8px;
}

.detail-stat .label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.detail-stat .value {
    font-size: 24px;
    font-weight: 700;
}

.detail-stat .value.positive {
    color: var(--success);
}

.detail-stat .value.negative {
    color: var(--danger);
}

.mention-card {
    background: var(--background);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

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

.mention-source {
    font-weight: 600;
    color: var(--primary);
}

.mention-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.mention-content {
    font-size: 14px;
    line-height: 1.5;
}

.mention-sentiment {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-top: 8px;
}

.mention-sentiment.positive {
    background: #dcfce7;
    color: #166534;
}

.mention-sentiment.negative {
    background: #fee2e2;
    color: #991b1b;
}

.mention-sentiment.neutral {
    background: #e5e7eb;
    color: #374151;
}

/* ===== Quick Start Wizard ===== */
.quickstart-content {
    max-width: 560px;
}

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

.quickstart-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.quickstart-logo i {
    color: var(--primary);
    font-size: 22px;
}

.quickstart-body {
    padding: 32px 24px;
    min-height: 320px;
}

.quickstart-step {
    display: none;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.quickstart-step.active {
    display: block;
}

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

.quickstart-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
}

.quickstart-step h2 {
    font-size: 22px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.quickstart-step p {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.quickstart-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    max-width: 320px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--background);
    border-radius: 8px;
    font-size: 14px;
}

.feature-item i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.quickstart-tips {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    max-width: 360px;
    margin: 0 auto;
}

.tip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fefce8;
    border-radius: 8px;
    font-size: 13px;
    color: #854d0e;
}

.tip i {
    color: #eab308;
}

.quickstart-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.source-tag {
    padding: 6px 14px;
    background: var(--background);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.quickstart-dashboard-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
}

.preview-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.preview-stat i {
    font-size: 20px;
    color: var(--primary);
}

.preview-stat.warning i { color: var(--warning); }
.preview-stat.danger i { color: var(--danger); }

.quickstart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.quickstart-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.dot.active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

.quickstart-actions {
    display: flex;
    gap: 12px;
}

/* ===== Help FAB ===== */
.help-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    z-index: 900;
    transition: all 0.2s;
}

.help-fab:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

/* ===== Help Panel ===== */
.help-panel {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 380px;
    max-height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 901;
    display: none;
    overflow: hidden;
}

.help-panel.active {
    display: block;
    animation: slideUp 0.3s ease;
}

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

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

.help-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.help-body {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: 400px;
}

.help-section {
    margin-bottom: 20px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.help-section h4 i {
    color: var(--primary);
    width: 16px;
    text-align: center;
}

.help-section p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.help-shortcuts {
    list-style: none;
    font-size: 13px;
}

.help-shortcuts li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    color: var(--text-secondary);
}

.help-shortcuts kbd {
    display: inline-block;
    padding: 2px 8px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    color: var(--text-primary);
    min-width: 28px;
    text-align: center;
}

/* ===== Tooltip ===== */
.tooltip {
    position: absolute;
    background: var(--text-primary);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    max-width: 280px;
    z-index: 1100;
    pointer-events: none;
    animation: tooltipFade 0.2s ease;
}

@keyframes tooltipFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-top-color: var(--text-primary);
}

.tooltip[data-position="bottom"]::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--text-primary);
}

/* ===== Onboarding Highlight ===== */
.onboarding-highlight {
    position: relative;
    z-index: 100;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
}

/* ===== Tooltip Icons ===== */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border);
    color: var(--text-secondary);
    font-size: 10px;
    cursor: help;
    margin-left: 6px;
    transition: all 0.2s;
}

.tooltip-icon:hover {
    background: var(--primary);
    color: white;
}

/* ===== Context Help ===== */
.context-help {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: help;
    margin-top: 4px;
}

.context-help i {
    color: var(--primary);
}

/* ===== Quick Actions Bar ===== */
.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--background);
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.quick-action:hover {
    background: var(--primary);
    color: white;
}

.quick-action i {
    font-size: 16px;
}

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

.empty-state i {
    font-size: 48px;
    color: var(--border);
    margin-bottom: 16px;
}

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

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

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

@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    
    .logo span,
    .nav-item a span,
    .user-info span {
        display: none;
    }
    
    .main-content {
        margin-left: 70px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .help-panel {
        width: calc(100vw - 48px);
        right: 24px;
    }
}

.demo-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    margin: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
    font-size: 13px;
}

.demo-banner i {
    font-size: 16px;
}

.demo-banner .btn {
    margin-left: auto;
    padding: 6px 12px;
    font-size: 12px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
}

.demo-banner .btn:hover {
    background: #f0f0f0;
}

.registration-cta {
    margin: 20px;
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    text-align: center;
}

.cta-content i {
    font-size: 48px;
    color: #667eea;
    margin-bottom: 16px;
}

.cta-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    color: #1a1a1a;
}

.cta-content p {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 14px;
}

.cta-content .btn {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.cta-content .btn:hover {
    background: #5a6fd6;
}

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

.demo-limits-banner {
    margin: 12px 24px;
    padding: 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 10px;
}

.demo-limits-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.demo-limit-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #0c4a6e;
}

.demo-limit-item i {
    color: var(--primary);
}

.demo-limit-item strong {
    color: #0369a1;
}

.demo-limits-content .btn {
    margin-left: auto;
}

/* ===== MOBILE RESPONSIVE ===== */

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 20px;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}
.hamburger-btn:hover {
    background: var(--background);
}

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

/* Bottom Navigation Bar (Mobile) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.08);
    z-index: 100;
    padding: 6px 0;
    padding-bottom: env(safe-area-inset-bottom, 6px);
}
.bottom-nav-list {
    display: flex;
    list-style: none;
    justify-content: space-around;
    padding: 0;
    margin: 0;
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: none;
    background: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    min-width: 56px;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item.active {
    color: var(--primary);
}
.bottom-nav-item:active {
    background: rgba(37, 99, 235, 0.1);
}
.bottom-nav-item i {
    font-size: 18px;
}
.bottom-nav-item span {
    font-size: 10px;
    font-weight: 500;
}
.bottom-nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: var(--danger);
    color: white;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Tablet (max-width: 768px) ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        width: 260px;
        z-index: 100;
        transition: left 0.3s ease;
    }
    .sidebar.open {
        left: 0;
    }
    .sidebar-overlay.active {
        display: block;
    }
    .sidebar .logo span,
    .sidebar .nav-item a span,
    .sidebar .user-info span {
        display: inline;
    }

    .hamburger-btn {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-bottom: 80px;
    }

    .mobile-bottom-nav {
        display: block;
    }

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

    .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .stat-info h3 {
        font-size: 22px;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
        white-space: nowrap;
    }

    .btn {
        min-height: 44px;
        padding: 12px 16px;
    }

    .form-control {
        min-height: 48px;
        font-size: 16px;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        animation: slideUp 0.3s ease;
    }

    @keyframes slideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .quickstart-content {
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }

    .help-panel {
        width: 100%;
        right: 0;
        border-radius: 16px 16px 0 0;
        max-height: 85vh;
    }

    .content-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .content-header h1 {
        font-size: 20px;
    }

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

    #scan-all-btn span {
        display: none;
    }
}

/* ===== Phone (max-width: 480px) ===== */
@media (max-width: 480px) {
    .main-content {
        padding: 12px;
        padding-bottom: 80px;
    }

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

    .stat-card {
        padding: 12px;
        gap: 10px;
        border-radius: 10px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        font-size: 18px;
    }

    .stat-info h3 {
        font-size: 20px;
    }

    .stat-info p {
        font-size: 12px;
    }

    .card {
        border-radius: 10px;
    }

    .card-header {
        padding: 12px 16px;
    }

    .card-body {
        padding: 16px;
    }

    .card-header h2 {
        font-size: 14px;
    }

    .alert-item {
        padding: 10px;
    }

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

    .form-actions {
        flex-direction: column;
        gap: 8px;
    }

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

    .context-help {
        font-size: 11px;
    }

    .empty-state {
        padding: 32px 16px;
    }

    .empty-state i {
        font-size: 36px;
    }

    .empty-state h3 {
        font-size: 16px;
    }

    .demo-limits-banner {
        margin: 8px 12px;
        padding: 12px;
    }

    .demo-limits-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .demo-limits-content .btn {
        margin-left: 0;
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .detail-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .registration-cta {
        margin: 8px 12px;
        padding: 20px 16px;
    }

    .cta-content h3 {
        font-size: 18px;
    }

    .help-fab {
        bottom: 76px !important;
    }

    .tooltip-icon {
        display: none;
    }
}

/* ===== Safe Area (notched phones) ===== */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .main-content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* ===== Dark mode enhancements for standalone/PWA ===== */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
    .mobile-bottom-nav {
        border-top: 1px solid rgba(255,255,255,0.05);
    }
}

/* ===== Pull-to-refresh indicator ===== */
.ptr-indicator {
    display: none;
    text-align: center;
    padding: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}
.ptr-indicator.visible {
    display: block;
}
.ptr-indicator i {
    animation: spin 1s linear infinite;
    margin-right: 8px;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Touch feedback ===== */
@media (hover: none) and (pointer: coarse) {
    .nav-item a:active,
    .btn:active,
    .bottom-nav-item:active {
        transform: scale(0.97);
        transition: transform 0.1s;
    }
    .card:active {
        box-shadow: 0 0 0 2px var(--primary);
    }
    .data-table tbody tr:active {
        background: var(--background);
    }
}

/* ===== Print ===== */
@media print {
    .sidebar, .mobile-bottom-nav, .hamburger-btn, .help-fab {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
}
