:root {
    --bg-dark: #09090b;
    --bg-surface: #18181b;
    --bg-surface-glass: rgba(24, 24, 27, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary-color: #ec4899;
    --accent-color: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

:root[data-theme="light"] {
    --bg-dark: #f0f4f8;
    --bg-surface: #ffffff;
    --bg-surface-glass: rgba(255, 255, 255, 0.85);
    --border-glass: rgba(0, 0, 0, 0.1);
    --text-main: #0f172a;
    --text-muted: #475569;
    --primary-color: #4f46e5;
    --primary-glow: rgba(79, 70, 229, 0.3);
    /* Colors usually remain same, maybe slightly tweaked for light bg */
    --secondary-color: #db2777;
    --accent-color: #0891b2;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #2563eb;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-image: radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
                      radial-gradient(circle at 85% 30%, rgba(236, 72, 153, 0.15) 0%, transparent 50%);
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Typography Enhancements */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.gradient-text-alt {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Utility Glasses */
.glass-panel {
    background: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: calc(100vh - 32px);
    margin: 16px;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.logo-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-glass);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15), transparent);
    border-left: 3px solid var(--primary-color);
}

.power-ups-link {
    margin-top: auto;
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.1);
}

.power-ups-link:hover {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
    border-color: var(--accent-color);
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-glass);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-info strong {
    display: block;
    font-size: 14px;
    color: var(--text-main);
}

.user-info small {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 24px 16px 8px;
    overflow: hidden;
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    margin-bottom: 24px;
}

.header-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.2);
    padding: 10px 20px;
    border-radius: 12px;
    width: 300px;
    border: 1px solid var(--border-glass);
    transition: all 0.3s;
}

.header-search:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.header-search input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    width: 100%;
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}

.btn-primary-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-glass);
    padding: 10px 20px;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

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

.icon-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    position: relative;
    transition: all 0.3s;
}

.icon-btn:hover {
    background: rgba(255,255,255,0.1);
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pulse-glow {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Views Controller */
.views-wrapper {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.view.active {
    display: block;
}

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

.section-header {
    margin-bottom: 32px;
}

.section-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 16px;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.stat-icon.calls { background: rgba(99, 102, 241, 0.1); color: var(--primary-color); }
.stat-icon.missed { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-icon.rev { background: rgba(236, 72, 153, 0.1); color: var(--secondary-color); }

.stat-content h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    margin: 8px 0;
}

.stat-trend {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.highlight-card {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(6, 182, 212, 0.05));
    border-color: rgba(16, 185, 129, 0.2);
}

.dashboard-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Activity List */
.live-feed { padding: 24px; }
.live-feed h2 { font-size: 20px; margin-bottom: 20px; }

.activity-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.activity-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    border: 1px solid var(--border-glass);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.activity-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.activity-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.activity-icon.info { background: rgba(6, 182, 212, 0.1); color: var(--accent-color); }

.activity-details { flex: 1; }
.activity-details strong { display: block; font-size: 14px; }
.activity-details span { font-size: 13px; color: var(--text-muted); }
.activity-time { font-size: 12px; color: var(--text-muted); }

/* Integrations Panel */
.leadsdock-integration { padding: 24px; }
.integration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.status-indicator {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-indicator.live {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.system-flow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.2);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    margin-bottom: 16px;
}

.flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.flow-step i {
    font-size: 32px;
    color: var(--primary-color);
}

.flow-step.pulse i {
    color: var(--secondary-color);
    animation: flowPulse 2s infinite;
}

@keyframes flowPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(236,72,153,0.5)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 10px rgba(236,72,153,0.8)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(236,72,153,0.5)); }
}

.flow-arrow {
    color: var(--text-muted);
    font-size: 24px;
    opacity: 0.5;
}

.flow-desc {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

/* IVR Builder */
.ivr-builder { padding: 24px; }
.ivr-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 16px;
}

.ivr-canvas {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
}

.ivr-node {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    padding: 16px 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 400px;
    justify-content: center;
}

.start-node {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.action-node {
    flex-direction: column;
    text-align: center;
}

.highlight-action {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
    position: relative;
}

.highlight-badge {
    position: absolute;
    top: -12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 600;
}

.ivr-line {
    width: 2px;
    height: 30px;
    background: var(--border-glass);
}

.ivr-branch {
    border: 1px dashed var(--border-glass);
    border-radius: 12px;
    padding: 20px;
    width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.branch-logic {
    position: absolute;
    top: -10px;
    background: var(--bg-dark);
    padding: 0 12px;
    font-size: 12px;
    color: var(--text-muted);
    border-radius: 10px;
    border: 1px solid var(--border-glass);
}

.ivr-option {
    background: rgba(0,0,0,0.2);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    width: 100%;
    text-align: center;
}

/* Social AI */
.ai-generator-panel { padding: 32px; }
.ai-input-wrapper h3 { margin-bottom: 24px; }

.mad-libs-sentence {
    font-size: 24px;
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 32px;
}

.mad-libs-sentence select,
.mad-libs-sentence input {
    font-size: 20px;
    font-family: inherit;
    background: rgba(255,255,255,0.05);
    border: 1px dashed var(--primary-color);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 8px;
    outline: none;
    margin: 0 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.mad-libs-sentence input:focus {
    background: rgba(99, 102, 241, 0.1);
    border-style: solid;
}

.sparkles { position: relative; overflow: hidden; }
.sparkles::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    animation: sparkleAnim 3s infinite linear;
}

@keyframes sparkleAnim {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.hidden { display: none !important; }

.ai-results {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border-glass);
    animation: fadeIn 0.5s ease;
}

.generation-loader {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-color);
    font-weight: 600;
}

.spinner {
    width: 24px; height: 24px;
    border: 3px solid rgba(99,102,241,0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.results-content { margin-top: 24px; }
.results-content.hidden { display: none; }
.post-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.day-badge {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
}

.ai-image-prompt {
    margin: 16px 0;
    padding: 12px;
    background: rgba(236, 72, 153, 0.1);
    border-left: 3px solid var(--secondary-color);
    border-radius: 0 8px 8px 0;
    font-size: 13px;
    color: #fce7f3;
}

.post-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

/* Finance Section */
.finance-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 24px;
}

.finance-actions, .finance-list { padding: 24px; }
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.finance-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    color: white;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    font-size: 16px;
    font-weight: 600;
}

.finance-btn i { font-size: 32px; color: var(--primary-color); }
.finance-btn span { font-size: 12px; color: var(--text-muted); font-weight: 400; }

.finance-btn.hero-btn {
    background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(236,72,153,0.1));
    border-color: rgba(99,102,241,0.3);
}

.finance-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-3px); }

/* Table */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.modern-table th {
    text-align: left;
    padding: 16px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-glass);
}

.modern-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.success { background: rgba(16,185,129,0.1); color: var(--success); }
.status-badge.pending { background: rgba(6,182,212,0.1); color: var(--accent-color); }
.status-badge.waiting { background: rgba(245,158,11,0.1); color: var(--warning); }

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    width: 400px;
    padding: 24px;
}

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

.close-btn {
    background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer;
}
.close-btn:hover { color: white; }

.modal-body label {
    display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 14px;
}
.modal-body input {
    width: 100%; padding: 12px; background: rgba(0,0,0,0.2); border: 1px solid var(--border-glass);
    border-radius: 8px; color: white; margin-bottom: 20px; outline: none;
}
.modal-body input:focus { border-color: var(--primary-color); }
.fill-width { width: 100%; justify-content: center; }

/* Agenda */
.calendar-panel { padding: 24px; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.time-slots { display: flex; flex-direction: column; gap: 16px; }
.time-slot { display: flex; gap: 16px; align-items: center; }
.time-label { width: 60px; color: var(--text-muted); font-size: 14px; font-weight: 500; }
.event-card {
    flex: 1;
    background: rgba(255,255,255,0.05);
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid var(--text-muted);
}
.event-line { flex: 1; height: 1px; border-bottom: 1px dashed var(--border-glass); }

.highlight-event {
    background: rgba(99,102,241,0.1);
    border-left-color: var(--primary-color);
}
.event-alert {
    font-size: 12px; color: var(--primary-color); font-weight: bold; margin-bottom: 4px;
    display: flex; align-items: center; gap: 6px;
}
.reminder-sent {
    background: rgba(16,185,129,0.05);
    border-left-color: var(--success);
}

/* Powerups */
.tabs-container {
    display: flex; gap: 12px; margin-top: 24px; margin-bottom: 32px;
}
.power-tab {
    background: rgba(255,255,255,0.05); border: 1px solid var(--border-glass); color: var(--text-muted);
    padding: 10px 20px; border-radius: 20px; cursor: pointer; transition: all 0.3s;
}
.power-tab.active {
    background: var(--accent-color); color: var(--bg-dark); border-color: var(--accent-color); font-weight: 600;
}
.powerup-content { display: none; animation: fadeIn 0.4s ease; }
.powerup-content.active { display: block; }

.powerup-card {
    display: flex; gap: 24px; background: rgba(0,0,0,0.2); padding: 32px; border-radius: 16px;
    border: 1px solid var(--border-glass);
}
.pu-icon {
    width: 64px; height: 64px; border-radius: 16px; background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    display: flex; align-items: center; justify-content: center; font-size: 32px; color: white; flex-shrink: 0;
}
.powerup-card h3 { font-size: 24px; margin-bottom: 12px; }
.powerup-card p { color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; }

/* Theme Overrides for Inline Styles */
[data-theme="light"] [style*="color:white"],
[data-theme="light"] [style*="color: white"] {
    color: var(--text-main) !important;
}

[data-theme="light"] [style*="border-color:white"],
[data-theme="light"] [style*="border-color: white"] {
    border-color: var(--primary-color) !important;
}

[data-theme="light"] [style*="background:rgba(0,0,0,"],
[data-theme="light"] [style*="background: rgba(0,0,0,"] {
    background: var(--bg-surface-glass) !important;
}

[data-theme="light"] [style*="border:1px solid rgba(255,255,255,0.2)"] {
    border: 1px solid var(--border-glass) !important;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    color: var(--text-main) !important;
    background: var(--bg-surface) !important;
    color-scheme: light !important;
}

/* Responsive Design (Tablet & Mobile) */
@media (max-width: 1024px) {
    .dashboard-split, .finance-grid {
        grid-template-columns: 1fr;
    }
    [style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .ivr-canvas {
        transform: scale(0.9);
    }
}

@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }
    .app-container {
        flex-direction: column;
        height: auto;
    }
    .sidebar {
        width: auto !important;
        height: auto !important;
        margin: 16px;
        padding: 16px;
    }
    .sidebar-header {
        margin-bottom: 16px;
    }
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 8px;
    }
    .nav-item {
        padding: 10px;
        flex-shrink: 0;
    }
    .nav-item span {
        display: none;
    }
    .main-content {
        padding: 16px;
        overflow: visible;
    }
    .top-header {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
        align-items: stretch;
    }
    .header-search {
        width: 100%;
    }
    .stats-grid, [style*="grid-template-columns: repeat(4, 1fr)"], [style*="grid-template-columns: repeat(3, 1fr)"], [style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
    .views-wrapper {
        overflow: visible;
    }
    .ivr-node, .ivr-branch {
        width: 100% !important;
    }
    .ivr-canvas {
        transform: scale(1);
    }
    .modal {
        width: 90% !important;
    }
    .powerup-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
