:root {
    --bg-color: #f8fafc;
    --sidebar-bg: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #334155;
    --sidebar-active-text: #ffffff;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --font: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg-color); color: var(--text-main); height: 100vh; overflow: hidden; }

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

/* Sidebar */
.sidebar { width: 260px; background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; }
.sidebar .logo { font-size: 1.25rem; font-weight: 700; color: white; padding: 2rem 1.5rem; display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid var(--sidebar-active); }
.nav-links { list-style: none; padding: 1rem 0; flex: 1; }
.nav-links li { padding: 1rem 1.5rem; cursor: pointer; display: flex; align-items: center; gap: 1rem; font-weight: 500; transition: all 0.2s; position: relative; }
.nav-links li:hover { background: var(--sidebar-active); color: var(--sidebar-active-text); }
.nav-links li.active { background: var(--sidebar-active); color: var(--sidebar-active-text); border-left: 4px solid var(--primary); }
.badge { background: var(--danger); color: white; font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 99px; margin-left: auto; font-weight: 700; }

/* Main Content */
.content-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-color); }
.workspace { display: none; flex-direction: column; height: 100%; padding: 2rem; overflow-y: auto; }
.workspace.active { display: flex; animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.workspace-header { margin-bottom: 2rem; }
.workspace-header h2 { font-size: 1.8rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.5rem; }
.workspace-header p { color: var(--text-muted); font-size: 1rem; }

/* Buttons & Inputs */
.btn-primary { background: var(--primary); color: white; border: none; padding: 0.75rem 1.5rem; border-radius: var(--radius); font-weight: 600; cursor: pointer; transition: background 0.2s; font-family: var(--font); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: var(--text-muted); cursor: not-allowed; opacity: 0.7; }
.btn-outline { background: transparent; border: 1px solid var(--border); padding: 0.5rem 1rem; border-radius: var(--radius); cursor: pointer; font-weight: 600; color: var(--text-main); transition: all 0.2s; }
.btn-outline:hover { background: #f1f5f9; }

/* Dashboard Channels */
.channels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.channel-card { background: var(--card-bg); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 1rem; transition: transform 0.2s, box-shadow 0.2s; }
.channel-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.channel-header { display: flex; align-items: center; justify-content: space-between; }
.platform-icon { font-size: 1.5rem; }
.platform-icon.google { color: #DB4437; }
.platform-icon.facebook { color: #1877F2; }
.platform-icon.instagram { color: #E4405F; }
.platform-icon.yelp { color: #D32323; }
.status-badge { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.5rem; border-radius: 4px; display: inline-flex; align-items: center; gap: 0.25rem; }
.status-badge.connected { background: #dcfce7; color: #166534; }
.status-badge.action { background: #fef3c7; color: #92400e; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.green { background: var(--success); }
.dot.yellow { background: var(--warning); }
.channel-info { display: flex; align-items: center; gap: 1rem; margin-top: 0.5rem; }
.channel-avatar { width: 40px; height: 40px; border-radius: 50%; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-weight: bold; color: var(--text-muted); }
.channel-name { font-weight: 600; font-size: 1rem; }
.channel-handle { color: var(--text-muted); font-size: 0.85rem; }

/* Inbox */
.filter-group { display: flex; gap: 1.5rem; align-items: center; margin-top: 1rem; }
.filter-group select { padding: 0.5rem; border-radius: var(--radius); border: 1px solid var(--border); font-family: var(--font); }
.inbox-container { display: flex; flex: 1; gap: 1.5rem; overflow: hidden; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.inbox-list { width: 40%; border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; }
.inbox-item { padding: 1.25rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.2s; }
.inbox-item:hover { background: #f8fafc; }
.inbox-item.selected { background: #eff6ff; border-left: 3px solid var(--primary); }
.inbox-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.inbox-item-author { font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 0.5rem; }
.inbox-item-time { font-size: 0.8rem; color: var(--text-muted); }
.stars { color: #fbbf24; font-size: 0.8rem; margin-bottom: 0.5rem; }
.inbox-item-text { font-size: 0.9rem; color: var(--text-main); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inbox-item.replied { opacity: 0.6; }

.inbox-detail { flex: 1; padding: 2rem; overflow-y: auto; display: flex; flex-direction: column; }
.empty-state { color: var(--text-muted); text-align: center; margin-top: 4rem; font-style: italic; }
.detail-header { margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); padding-bottom: 1rem; }
.detail-author { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.75rem; }
.detail-text { font-size: 1rem; line-height: 1.6; margin-bottom: 2rem; color: var(--text-main); }
.reply-section { background: #f8fafc; padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); }
.reply-section h4 { margin-bottom: 1rem; color: var(--text-main); }
.reply-section textarea { width: 100%; height: 120px; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border); resize: none; font-family: var(--font); margin-bottom: 1rem; }
.reply-section textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2); }
.success-banner { background: #dcfce7; color: #166534; padding: 1rem; border-radius: var(--radius); margin-top: 1rem; display: none; font-weight: 500; }

/* Queue/Composer */
.composer-card { background: var(--card-bg); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); margin-bottom: 2rem; }
.composer-card h3 { margin-bottom: 1rem; font-size: 1.2rem; }
.channel-selector { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.channel-toggle { width: 48px; height: 48px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; cursor: pointer; border: 2px solid var(--border); background: white; transition: all 0.2s; color: var(--text-muted); opacity: 0.5; }
.channel-toggle.selected { opacity: 1; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); }
.channel-toggle.google.selected { color: #DB4437; }
.channel-toggle.facebook.selected { color: #1877F2; }
.channel-toggle.instagram.selected { color: #E4405F; }
.channel-toggle.yelp.selected { color: #D32323; }

.composer-body { position: relative; margin-bottom: 1.5rem; }
.composer-body textarea { width: 100%; height: 150px; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border); resize: none; font-family: var(--font); font-size: 1rem; }
.composer-body textarea:focus { outline: none; border-color: var(--primary); }
.char-count { position: absolute; bottom: 1rem; right: 1rem; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.char-count.over { color: var(--danger); }

.media-dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; color: var(--text-muted); cursor: pointer; transition: background 0.2s; margin-bottom: 1.5rem; position: relative; }
.media-dropzone:hover { background: #f8fafc; }
.media-dropzone i { font-size: 2rem; margin-bottom: 0.5rem; }
#media-preview { margin-top: 1rem; display: none; }
#media-preview img { max-height: 150px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.post-actions { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.schedule-toggle { display: flex; gap: 1.5rem; }
.schedule-toggle label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 500; }
.schedule-picker { margin-left: 1rem; }
.schedule-picker input { padding: 0.5rem; border-radius: var(--radius); border: 1px solid var(--border); font-family: var(--font); }
.hidden { display: none !important; }

.queue-section h3 { margin-bottom: 1rem; font-size: 1.2rem; }
.queue-feed { display: flex; flex-direction: column; gap: 1rem; }
.queue-item { background: var(--card-bg); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; }
.queue-item-content { flex: 1; }
.queue-platforms { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.queue-platforms i { font-size: 1rem; }
.queue-time { font-size: 0.85rem; color: var(--primary); font-weight: 600; margin-bottom: 0.5rem; }
.queue-text { font-size: 0.95rem; color: var(--text-main); }
.queue-actions { margin-left: 1.5rem; }
.btn-delete { color: var(--danger); background: transparent; border: none; cursor: pointer; font-size: 1rem; padding: 0.5rem; opacity: 0.7; transition: opacity 0.2s; }
.btn-delete:hover { opacity: 1; }
