@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root, [data-theme="light"] {
    --primary: #0EA5E9;
    --primary-dark: #0284C7;
    --primary-light: #E0F2FE;
    --primary-glow: rgba(14, 165, 233, 0.15);
    --secondary: #6366F1;
    --accent: #F59E0B;
    --success: #10B981;
    --success-bg: #D1FAE5;
    --error: #EF4444;
    --error-bg: #FEE2E2;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --info: #6B7280;
    --info-bg: #F3F4F6;
    --bg: #F8FAFC;
    --bg-secondary: #F1F5F9;
    --white: #FFFFFF;
    --text: #0F172A;
    --text-secondary: #475569;
    --text-light: #94A3B8;
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --sidebar-bg: #FFFFFF;
    --sidebar-width: 270px;
    --card-bg: #FFFFFF;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.1);
    --gradient: linear-gradient(135deg, #0EA5E9, #6366F1, #F59E0B);
    --gradient-subtle: linear-gradient(135deg, #E0F2FE, #EEF2FF, #FEF3C7);
}

[data-theme="dark"] {
    --bg: #0F172A;
    --bg-secondary: #1E293B;
    --white: #1E293B;
    --text: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-light: #64748B;
    --border: #334155;
    --border-light: #1E293B;
    --sidebar-bg: #1E293B;
    --card-bg: #1E293B;
    --primary-light: rgba(14, 165, 233, 0.15);
    --info-bg: #334155;
    --shadow: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
    --gradient-subtle: linear-gradient(135deg, rgba(14,165,233,0.1), rgba(99,102,241,0.1));
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

/* Sidebar */
.sidebar {
    position: fixed; top: 0; left: 0; width: var(--sidebar-width);
    height: 100vh; background: var(--sidebar-bg); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 20px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--gradient); display: flex; align-items: center;
    justify-content: center; color: white; font-size: 1.1rem;
    box-shadow: 0 4px 12px var(--primary-glow); flex-shrink: 0;
}

.brand-name { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.brand-badge {
    display: inline-block; padding: 1px 8px; font-size: 0.6rem;
    font-weight: 800; background: var(--gradient); color: white;
    border-radius: 20px; margin-left: 4px; letter-spacing: 1px;
    vertical-align: middle;
}

.sidebar-nav {
    list-style: none; padding: 12px; flex: 1; overflow-y: auto;
}

.nav-section {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--text-light); padding: 16px 14px 6px;
}

.sidebar-nav li a {
    display: flex; align-items: center; gap: 12px; padding: 9px 14px;
    border-radius: var(--radius-sm); color: var(--text-secondary);
    font-weight: 500; font-size: 0.88rem; transition: all 0.2s;
}

.sidebar-nav li a:hover {
    background: var(--primary-light); color: var(--primary); text-decoration: none;
    transform: translateX(2px);
}

.sidebar-nav li.active a {
    background: var(--primary); color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.sidebar-nav li a i { width: 20px; text-align: center; font-size: 0.95rem; }

.nav-badge {
    margin-left: auto; background: var(--primary-light); color: var(--primary);
    padding: 1px 8px; border-radius: 20px; font-size: 0.7rem; font-weight: 700;
}

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

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

.user-avatar {
    width: 36px; height: 36px; border-radius: 10px; background: var(--gradient);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}

.user-name { display: block; font-weight: 600; font-size: 0.85rem; color: var(--text); }
.user-email { display: block; font-size: 0.72rem; color: var(--text-light); }

.footer-actions { display: flex; gap: 8px; }
.footer-actions a, .theme-toggle {
    color: var(--text-light); background: none; border: none;
    cursor: pointer; padding: 6px; border-radius: 6px; font-size: 0.95rem;
    transition: all 0.2s;
}
.footer-actions a:hover, .theme-toggle:hover { color: var(--primary); background: var(--primary-light); }

.mobile-menu-btn {
    display: none; position: fixed; top: 16px; left: 16px; z-index: 200;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 10px 14px; font-size: 1.1rem; cursor: pointer; box-shadow: var(--shadow-md);
    color: var(--text);
}

.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 99; backdrop-filter: blur(4px);
}

/* Main Content */
.content {
    margin-left: var(--sidebar-width); padding: 28px 36px; min-height: 100vh;
}

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

.page-header h1 {
    font-size: 1.5rem; font-weight: 800; color: var(--text);
    background: var(--gradient); -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; background-clip: text;
}

.page-header .subtitle {
    font-size: 0.88rem; color: var(--text-light); font-weight: 400;
    -webkit-text-fill-color: var(--text-light); margin-top: 2px;
}

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

/* Stats */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; margin-bottom: 28px;
}

.stat-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; display: flex; align-items: center; gap: 16px;
    box-shadow: var(--shadow); transition: all 0.3s; position: relative; overflow: hidden;
}

.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--gradient); opacity: 0; transition: opacity 0.3s;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card:hover::before { opacity: 1; }

.stat-icon {
    width: 48px; height: 48px; border-radius: 12px; display: flex;
    align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}

.stat-number { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.stat-label { color: var(--text-light); font-size: 0.8rem; font-weight: 500; }
.stat-change { font-size: 0.75rem; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--error); }

/* Cards */
.card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow);
    transition: box-shadow 0.3s;
}

.card:hover { box-shadow: var(--shadow-md); }

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

.card-header h2 { font-size: 0.95rem; font-weight: 700; }
.card-body { padding: 20px; }
.card-body.no-pad { padding: 0; }

.card-gradient {
    background: var(--gradient-subtle); border: 1px solid var(--border);
}

/* Grids */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dashboard-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.settings-grid .card:last-child { grid-column: 1 / -1; }

/* Empty State */
.empty-state {
    text-align: center; padding: 48px 24px; color: var(--text-light);
}
.empty-state-icon {
    width: 72px; height: 72px; border-radius: 20px; background: var(--gradient-subtle);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.empty-state-icon i { font-size: 1.8rem; color: var(--primary); }
.empty-state h3 { margin-bottom: 8px; color: var(--text); font-weight: 700; }
.empty-state p { margin-bottom: 20px; font-size: 0.9rem; }

/* Platform Lists */
.platform-list { display: flex; flex-direction: column; gap: 8px; }

.platform-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: var(--radius-sm); transition: background 0.2s;
}
.platform-item:hover { background: var(--bg-secondary); }
.platform-item i { font-size: 1.2rem; width: 28px; text-align: center; }
.platform-info { flex: 1; }
.platform-info strong { display: block; font-size: 0.88rem; font-weight: 600; }
.platform-info small { color: var(--text-light); font-size: 0.78rem; }

/* Post List */
.post-list { display: flex; flex-direction: column; }

.post-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid var(--border-light); color: var(--text);
    transition: all 0.2s;
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { text-decoration: none; padding-left: 4px; }
.post-item-content strong { display: block; font-size: 0.88rem; font-weight: 600; }
.post-item-content small { color: var(--text-light); font-size: 0.78rem; }

/* Badges */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 0.72rem; font-weight: 600;
}
.badge-success { background: var(--success-bg); color: #065F46; }
.badge-error { background: var(--error-bg); color: #991B1B; }
.badge-warning { background: var(--warning-bg); color: #92400E; }
.badge-info { background: var(--info-bg); color: var(--text-secondary); }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-lg { padding: 6px 16px; font-size: 0.82rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--card-bg); color: var(--text); font-size: 0.88rem;
    font-weight: 500; cursor: pointer; transition: all 0.2s; font-family: inherit;
}

.btn:hover { background: var(--bg-secondary); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--primary); color: white; border-color: var(--primary);
    box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 16px var(--primary-glow); }

.btn-gradient {
    background: var(--gradient); color: white; border: none;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-gradient:hover { opacity: 0.9; box-shadow: 0 6px 24px var(--primary-glow); }

.btn-danger { background: var(--error); color: white; border-color: var(--error); }
.btn-danger:hover { background: #DC2626; }
.btn-outline { background: transparent; border: 1px solid var(--border); }
.btn-ghost { background: transparent; border: none; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--primary); background: var(--primary-light); }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; font-weight: 600; }
.btn-full { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 4px; }

/* Alerts */
.alert {
    padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px; font-size: 0.88rem;
    animation: fadeInDown 0.3s ease;
}
.alert-success { background: var(--success-bg); color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: var(--error-bg); color: #991B1B; border: 1px solid #FCA5A5; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #C7D2FE; }

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

.form-group label {
    display: block; margin-bottom: 6px; font-weight: 600;
    font-size: 0.85rem; color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="datetime-local"],
.form-group textarea,
.form-group select {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 0.9rem; font-family: inherit;
    background: var(--card-bg); color: var(--text); transition: all 0.2s;
}

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

.form-group input:disabled { background: var(--bg-secondary); color: var(--text-light); }
.form-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 4px; }
.required { color: var(--error); }

.license-tabs {
    display: flex; gap: 0; margin-bottom: 20px;
    border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.license-tab {
    flex: 1; padding: 10px 16px; background: var(--bg-secondary);
    border: none; cursor: pointer; font-family: inherit;
    font-size: 0.85rem; font-weight: 600; color: var(--text-light);
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: all 0.2s;
}
.license-tab:not(:last-child) { border-right: 1px solid var(--border); }
.license-tab:hover { background: var(--bg-primary); color: var(--text-primary); }
.license-tab.active {
    background: var(--primary); color: white;
}
.license-panel { animation: fadeIn 0.3s; }

.char-count {
    text-align: right; font-size: 0.78rem; color: var(--text-light);
    margin-top: 4px; font-variant-numeric: tabular-nums;
}

.form-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 36px 20px; text-align: center; cursor: pointer;
    transition: all 0.3s; position: relative; background: var(--bg-secondary);
}
.upload-area:hover, .upload-area.drag-active {
    border-color: var(--primary); background: var(--primary-light);
}
.upload-area i { font-size: 2rem; color: var(--text-light); margin-bottom: 8px; display: block; }
.upload-area p { font-weight: 600; font-size: 0.9rem; }
.upload-area small { color: var(--text-light); font-size: 0.8rem; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.image-preview-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px; margin-top: 12px;
}

.preview-item {
    position: relative; border-radius: var(--radius-sm); overflow: hidden;
    border: 1px solid var(--border);
}
.preview-item img { width: 100%; height: 90px; object-fit: cover; display: block; }
.preview-name {
    display: block; padding: 4px 6px; font-size: 0.68rem; color: var(--text-light);
    text-overflow: ellipsis; overflow: hidden; white-space: nowrap; background: var(--card-bg);
}

/* Platform Checklist */
.platform-checklist { display: flex; flex-direction: column; gap: 6px; }

.platform-check {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: all 0.2s;
}
.platform-check:hover { border-color: var(--primary); background: var(--primary-light); }
.platform-check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.platform-check i { font-size: 1.1rem; }
.platform-check span { flex: 1; font-size: 0.85rem; font-weight: 500; }
.platform-check span small { display: block; font-size: 0.72rem; color: var(--text-light); font-weight: 400; }
.platform-select-actions { display: flex; gap: 8px; margin-bottom: 10px; }

/* Connections Grid */
.connections-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px;
}

.connection-card {
    background: var(--card-bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; text-align: center;
    box-shadow: var(--shadow); transition: all 0.3s; position: relative;
}
.connection-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.connection-icon {
    width: 56px; height: 56px; border-radius: 14px; display: flex;
    align-items: center; justify-content: center; margin: 0 auto 12px;
    transition: transform 0.3s;
}
.connection-card:hover .connection-icon { transform: scale(1.1); }
.connection-card h3 { font-size: 0.95rem; margin-bottom: 4px; font-weight: 700; }
.connection-card .platform-category { font-size: 0.75rem; color: var(--text-light); margin-bottom: 12px; }
.connection-status { color: var(--text-light); margin-bottom: 12px; font-size: 0.85rem; }
.connection-detail { margin-bottom: 10px; }
.connection-name { font-weight: 600; margin: 4px 0; font-size: 0.88rem; }
.connection-detail small { color: var(--text-light); font-size: 0.78rem; }
.disconnect-form { margin-top: 8px; }

.platform-supports {
    display: flex; gap: 6px; justify-content: center; margin-top: 8px;
}
.platform-supports .support-tag {
    padding: 2px 8px; border-radius: 4px; font-size: 0.68rem; font-weight: 600;
    background: var(--bg-secondary); color: var(--text-light);
}

.filter-bar {
    display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap;
}

.filter-bar input[type="text"] {
    padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.88rem; background: var(--card-bg); color: var(--text);
    min-width: 250px; font-family: inherit;
}
.filter-bar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.cat-filter-btn {
    padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border);
    background: var(--card-bg); font-size: 0.78rem; font-weight: 500;
    cursor: pointer; transition: all 0.2s; color: var(--text-secondary); font-family: inherit;
}
.cat-filter-btn.active, .cat-filter-btn:hover {
    background: var(--primary); color: white; border-color: var(--primary);
}

/* Data Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    text-align: left; padding: 12px 20px; border-bottom: 1px solid var(--border-light);
}
.data-table th {
    font-weight: 700; font-size: 0.72rem; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-light); background: var(--bg-secondary);
}
.data-table tr { transition: background 0.2s; }
.data-table tbody tr:hover { background: var(--bg-secondary); }
.text-truncate { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-muted { color: var(--text-light); }

/* Post Detail */
.post-detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }

.post-content-text {
    font-size: 0.95rem; line-height: 1.8; margin-bottom: 20px; white-space: pre-wrap;
}

.post-images-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px; margin-bottom: 20px;
}
.post-image img {
    width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius-sm);
    border: 1px solid var(--border); transition: transform 0.3s;
}
.post-image img:hover { transform: scale(1.03); }
.post-meta { color: var(--text-light); font-size: 0.82rem; display: flex; gap: 16px; flex-wrap: wrap; }

.platform-results { display: flex; flex-direction: column; gap: 10px; }
.platform-result {
    padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.platform-result:hover { border-color: var(--primary-light); }
.platform-result-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.platform-result-header i { font-size: 1.2rem; }
.platform-result-header strong { flex: 1; font-size: 0.88rem; }
.error-message { color: var(--error); font-size: 0.82rem; margin-top: 4px; }

/* Login */
.login-page {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: var(--bg); position: relative; overflow: hidden;
}
.login-page::before {
    content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%;
    background: var(--gradient); opacity: 0.08; top: -200px; right: -200px;
}
.login-page::after {
    content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%;
    background: var(--gradient); opacity: 0.06; bottom: -100px; left: -100px;
}

.login-container {
    background: var(--card-bg); border-radius: var(--radius-lg); padding: 40px;
    width: 100%; max-width: 440px; box-shadow: var(--shadow-xl);
    border: 1px solid var(--border); position: relative; z-index: 1;
    animation: fadeInUp 0.5s ease;
}

.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .brand-logo { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 12px; font-size: 1.4rem; }
.login-brand h1 { font-size: 1.4rem; margin-top: 8px; font-weight: 800; }
.login-brand p { color: var(--text-light); font-size: 0.88rem; }

.login-tabs {
    display: flex; margin-bottom: 24px; background: var(--bg-secondary);
    border-radius: var(--radius-sm); padding: 4px;
}
.tab-btn {
    flex: 1; padding: 10px; border: none; background: transparent;
    font-weight: 600; font-size: 0.88rem; cursor: pointer;
    border-radius: 6px; transition: all 0.2s; color: var(--text-light); font-family: inherit;
}
.tab-btn.active { background: var(--card-bg); color: var(--primary); box-shadow: var(--shadow); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }

/* Templates & Hashtags */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.template-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; transition: all 0.3s; position: relative;
}
.template-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.template-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }
.template-card .template-preview { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.6; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.template-card .template-meta { display: flex; justify-content: space-between; align-items: center; }
.template-card .template-actions { display: flex; gap: 6px; }

.hashtag-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; transition: all 0.3s;
}
.hashtag-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
.hashtag-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }
.hashtag-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.hashtag-tag { padding: 3px 10px; background: var(--primary-light); color: var(--primary); border-radius: 20px; font-size: 0.75rem; font-weight: 600; }

/* Analytics */
.analytics-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }

.chart-container {
    padding: 20px; min-height: 200px; display: flex; align-items: flex-end; gap: 4px;
}
.chart-bar {
    flex: 1; background: var(--primary); border-radius: 4px 4px 0 0;
    min-height: 4px; transition: height 0.5s ease; position: relative;
}
.chart-bar:hover { opacity: 0.8; }
.chart-bar .chart-tooltip {
    display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    padding: 4px 8px; background: var(--text); color: var(--card-bg);
    border-radius: 4px; font-size: 0.7rem; white-space: nowrap; margin-bottom: 4px;
}
.chart-bar:hover .chart-tooltip { display: block; }

.progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress-label { width: 100px; font-size: 0.82rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.progress-bar { flex: 1; height: 8px; background: var(--bg-secondary); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 10px; transition: width 1s ease; }
.progress-value { width: 40px; text-align: right; font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); }

/* Activity Feed */
.activity-feed { display: flex; flex-direction: column; }
.activity-item {
    display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    width: 32px; height: 32px; border-radius: 8px; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.8rem;
}
.activity-text { font-size: 0.85rem; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 0.75rem; color: var(--text-light); margin-top: 2px; }

/* Toast Notifications */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; }
.toast {
    padding: 14px 20px; border-radius: var(--radius); background: var(--card-bg);
    border: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex;
    align-items: center; gap: 10px; font-size: 0.88rem; font-weight: 500;
    transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 280px;
}
.toast.show { transform: translateX(0); }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--error); }
.toast-info { border-left: 4px solid var(--primary); }

/* Spinner */
.spinner {
    display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite;
}

.form-sidebar .btn { margin-top: 12px; }

/* Scheduled posts */
.schedule-card {
    display: flex; align-items: center; gap: 16px; padding: 16px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin-bottom: 10px; transition: all 0.2s; background: var(--card-bg);
}
.schedule-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow); }
.schedule-date {
    width: 56px; height: 56px; border-radius: 12px; background: var(--gradient-subtle);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.schedule-date .day { font-size: 1.2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.schedule-date .month { font-size: 0.65rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; }
.schedule-info { flex: 1; }
.schedule-info strong { display: block; font-size: 0.88rem; }
.schedule-info small { color: var(--text-light); font-size: 0.78rem; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.animate-in { animation: fadeInUp 0.4s ease both; }
.animate-in-1 { animation-delay: 0.05s; }
.animate-in-2 { animation-delay: 0.1s; }
.animate-in-3 { animation-delay: 0.15s; }
.animate-in-4 { animation-delay: 0.2s; }

/* Responsive */
@media (max-width: 1100px) {
    .dashboard-grid, .settings-grid, .analytics-grid { grid-template-columns: 1fr; }
    .dashboard-grid-3 { grid-template-columns: 1fr 1fr; }
    .post-detail-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.show { display: block; }
    .mobile-menu-btn { display: block; }
    .content { margin-left: 0; padding: 20px; padding-top: 60px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .connections-grid { grid-template-columns: 1fr; }
    .dashboard-grid-3 { grid-template-columns: 1fr; }
    .template-grid { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar input[type="text"] { min-width: auto; }
}
