/* ═══════════════════════════════════════════════════════════════════
   Content Ops Dashboard — Design System
   ═══════════════════════════════════════════════════════════════════ */

/* ── CDN Font ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ── Variables ────────────────────────────────────────────────────── */
:root {
    /* Sidebar */
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #e2e8f0;
    --sidebar-active-bg: rgba(99,91,255,.15);
    --sidebar-active-text: #818cf8;
    --sidebar-width: 250px;

    /* Content */
    --page-bg: #f8fafc;
    --content-bg: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Accent */
    --accent: #635bff;
    --accent-hover: #5046e5;
    --accent-light: #eef2ff;

    /* Status */
    --status-draft-bg: #f1f5f9;    --status-draft: #475569;
    --status-scheduled-bg: #fef3c7; --status-scheduled: #92400e;
    --status-approved-bg: #d1fae5;  --status-approved: #065f46;
    --status-ready-bg: #ccfbf1;     --status-ready: #134e4a;
    --status-published-bg: #dbeafe; --status-published: #1e40af;
    --status-failed-bg: #fecaca;    --status-failed: #991b1b;
    --status-skipped-bg: #f1f5f9;   --status-skipped: #64748b;
    --status-posting-bg: #e0e7ff;   --status-posting: #3730a3;

    /* Semantic */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-pill: 100px;
}

/* ── Reset ────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--page-bg);
    color: var(--text-primary);
    height: 100%;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ═══════════════════════════════════════════════════════════════════
   Layout: Sidebar + Main
   ═══════════════════════════════════════════════════════════════════ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.sidebar-brand h1 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.02em;
}

.sidebar-brand span {
    font-size: 11px;
    color: var(--sidebar-text);
    font-weight: 400;
    margin-top: 2px;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: rgba(148,163,184,.5);
    padding: 16px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 500;
    transition: all .15s ease;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255,255,255,.06);
    color: var(--sidebar-text-hover);
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: .7;
}

.nav-item.active svg { opacity: 1; }

.nav-badge {
    margin-left: auto;
    background: rgba(239,68,68,.2);
    color: #fca5a5;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,.06);
}

/* ── Main Area ────────────────────────────────────────────────────── */

.main-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Top Bar ──────────────────────────────────────────────────────── */

.top-bar {
    height: 56px;
    background: var(--content-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb span { color: var(--text-primary); font-weight: 600; }

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.alert-bell {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all .15s;
}

.alert-bell:hover { background: var(--border-light); color: var(--text-primary); }

.alert-bell svg { width: 20px; height: 20px; }

.alert-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.alert-count:empty, .alert-count[data-count="0"] { display: none; }

/* Alert Dropdown */
.alert-dropdown {
    position: absolute;
    top: 44px;
    right: 0;
    width: 360px;
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.alert-dropdown.open { display: block; }

.alert-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.alert-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
}

.alert-item:last-child { border-bottom: none; }

.alert-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.alert-dot.danger { background: var(--danger); }
.alert-dot.warning { background: var(--warning); }
.alert-dot.info { background: var(--info); }

.alert-item-text { color: var(--text-secondary); line-height: 1.4; }

/* ── Page Content ─────────────────────────────────────────────────── */

.page-content {
    flex: 1;
    padding: 28px;
    max-width: 1320px;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text-primary);
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   Components: Cards
   ═══════════════════════════════════════════════════════════════════ */

.card {
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.card-body { padding: 20px; }

/* Stat Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.amber { background: #fef3c7; color: #d97706; }
.stat-icon.green { background: #d1fae5; color: #059669; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-icon.rose { background: #fecaca; color: #dc2626; }

.stat-info { flex: 1; }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.02em;
    color: var(--text-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   Components: Badges
   ═══════════════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
}

.badge-platform {
    background: #f0f0ff;
    color: #4338ca;
}

.badge-status-draft      { background: var(--status-draft-bg);     color: var(--status-draft); }
.badge-status-scheduled  { background: var(--status-scheduled-bg); color: var(--status-scheduled); }
.badge-status-approved   { background: var(--status-approved-bg);  color: var(--status-approved); }
.badge-status-ready      { background: var(--status-ready-bg);     color: var(--status-ready); }
.badge-status-published  { background: var(--status-published-bg); color: var(--status-published); }
.badge-status-failed     { background: var(--status-failed-bg);    color: var(--status-failed); }
.badge-status-skipped    { background: var(--status-skipped-bg);   color: var(--status-skipped); }
.badge-status-posting    { background: var(--status-posting-bg);   color: var(--status-posting); }

.badge-tag {
    background: #f5f3ff;
    color: #6d28d9;
    font-size: 11px;
    padding: 2px 8px;
}

.badge-client {
    background: var(--border-light);
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════
   Components: Buttons
   ═══════════════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    background: var(--content-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all .15s ease;
    white-space: nowrap;
}

.btn:hover { background: var(--border-light); border-color: #cbd5e1; }

.btn svg { width: 15px; height: 15px; }

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover { background: #059669; border-color: #059669; }

.btn-danger {
    background: #fff;
    color: var(--danger);
    border-color: #fecaca;
}

.btn-danger:hover {
    background: #fef2f2;
    border-color: var(--danger);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn-ghost {
    border: none;
    background: none;
    color: var(--text-secondary);
    padding: 6px 8px;
}

.btn-ghost:hover { background: var(--border-light); color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════════
   Components: Forms
   ═══════════════════════════════════════════════════════════════════ */

.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--content-bg);
    transition: border-color .15s, box-shadow .15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,91,255,.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════════
   Queue: Filter Bar
   ═══════════════════════════════════════════════════════════════════ */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 14px 20px;
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.filter-bar .form-select {
    width: auto;
    min-width: 160px;
}

.filter-bar .filter-spacer { flex: 1; }

/* ═══════════════════════════════════════════════════════════════════
   Queue: Bulk Actions Toolbar
   ═══════════════════════════════════════════════════════════════════ */

.bulk-toolbar {
    position: sticky;
    top: 56px;
    z-index: 40;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-md);
    font-size: 13px;
    font-weight: 500;
}

.bulk-toolbar.visible { display: flex; }

.bulk-toolbar .bulk-count { margin-right: 8px; }

.bulk-toolbar .btn {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    font-size: 12px;
}

.bulk-toolbar .btn:hover {
    background: rgba(255,255,255,.25);
}

.bulk-toolbar .btn-bulk-cancel {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,.7);
}

.bulk-toolbar .btn-bulk-cancel:hover { color: #fff; }

/* ═══════════════════════════════════════════════════════════════════
   Queue: Post Cards
   ═══════════════════════════════════════════════════════════════════ */

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.post-card {
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    transition: box-shadow .15s, border-color .15s;
    position: relative;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
}

.post-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99,91,255,.12);
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.post-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.post-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.post-time {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.post-body {
    background: var(--border-light);
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin-bottom: 12px;
    color: var(--text-primary);
    border: 1px solid transparent;
    transition: border-color .15s;
    max-height: 200px;
    overflow-y: auto;
}

.post-body.editable:hover {
    border-color: var(--border);
    cursor: text;
}

.post-body.editing {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,91,255,.08);
    background: #fff;
    outline: none;
    max-height: none;
}

.post-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* Star Rating */
.star-rating {
    display: inline-flex;
    gap: 1px;
    align-items: center;
}

.star-rating button {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    color: #d1d5db;
    padding: 0 1px;
    transition: color .1s;
    line-height: 1;
}

.star-rating button.filled { color: #f59e0b; }
.star-rating button:hover { color: #f59e0b; }

/* Media */
.post-media-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.media-thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: opacity .15s;
}

.media-thumb:hover { opacity: .8; }

.media-thumb-video {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #000;
}

/* Actions Row */
.post-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.post-actions form { display: inline; }

/* ═══════════════════════════════════════════════════════════════════
   Modal (Slide Panel)
   ═══════════════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.4);
    z-index: 300;
    display: none;
    backdrop-filter: blur(2px);
}

.modal-overlay.open { display: block; }

.modal-panel {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    max-width: 90vw;
    height: 100vh;
    background: var(--content-bg);
    box-shadow: var(--shadow-lg);
    z-index: 301;
    display: flex;
    flex-direction: column;
    transition: right .25s ease;
}

.modal-panel.open { right: 0; }

.modal-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all .15s;
}

.modal-close:hover { background: var(--border-light); color: var(--text-primary); }

.modal-panel-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.modal-panel-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════════════
   Home: Overview
   ═══════════════════════════════════════════════════════════════════ */

.section { margin-bottom: 28px; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Alerts List on Home */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alert-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.alert-card.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-card.alert-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #92400e;
}

.alert-card.alert-info {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #1e40af;
}

.alert-card.alert-success {
    background: #f0fdf4;
    border: 1px solid #dcfce7;
    color: #166534;
}

/* Activity Table */
.activity-table {
    width: 100%;
    border-collapse: collapse;
}

.activity-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--border);
    background: var(--border-light);
}

.activity-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    color: var(--text-secondary);
}

.activity-table tr:hover td {
    background: rgba(248,250,252,.8);
}

.activity-table .post-preview {
    max-width: 350px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

/* Client Cards on Home */
.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.client-card {
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.client-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.client-card-header h4 {
    font-size: 15px;
    font-weight: 600;
}

.client-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.client-stat {
    text-align: center;
}

.client-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.client-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════
   Calendar
   ═══════════════════════════════════════════════════════════════════ */

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.calendar-nav h3 {
    font-size: 18px;
    font-weight: 600;
    min-width: 180px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--content-bg);
    min-width: 700px;
}
.calendar-grid-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.calendar-day-header {
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--border-light);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.calendar-day {
    min-height: 100px;
    padding: 8px;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    background: var(--content-bg);
    position: relative;
    cursor: pointer;
    transition: background .1s;
    overflow: hidden;
    min-width: 0;
}

.calendar-day:nth-child(7n) { border-right: none; }
.calendar-day:hover { background: var(--border-light); }

.calendar-day.other-month {
    background: var(--page-bg);
    color: var(--text-muted);
}

.calendar-day.today {
    background: rgba(99,91,255,.04);
}

.calendar-day-number {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.calendar-day.today .calendar-day-number {
    background: var(--accent);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.calendar-dots {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.calendar-event {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    max-width: 100%;
    display: block;
}

.calendar-event.platform-x         { background: #e8e8e8; color: #1a1a1a; }
.calendar-event.platform-threads   { background: #f3e8ff; color: #6b21a8; }
.calendar-event.platform-linkedin  { background: #dbeafe; color: #1d4ed8; }
.calendar-event.platform-reddit    { background: #fee2e2; color: #dc2626; }
.calendar-event.platform-instagram { background: #fce7f3; color: #be185d; }
.calendar-event.platform-youtube   { background: #fee2e2; color: #dc2626; }

/* ═══════════════════════════════════════════════════════════════════
   Analytics
   ═══════════════════════════════════════════════════════════════════ */

.analytics-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.analytics-tab {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all .15s;
}

.analytics-tab:hover { color: var(--text-primary); }

.analytics-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.chart-card {
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.chart-card h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.chart-card canvas {
    width: 100% !important;
    max-height: 260px;
}

.top-posts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-post-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.top-post-rank {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
    width: 30px;
    text-align: center;
}

.top-post-content {
    flex: 1;
    min-width: 0;
}

.top-post-text {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.top-post-metrics {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.top-post-metrics span { font-weight: 500; color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════════
   Health
   ═══════════════════════════════════════════════════════════════════ */

.health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.health-card {
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.health-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.health-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
}

.health-row:last-child { border-bottom: none; }

.health-label { color: var(--text-secondary); }

.health-value { font-weight: 600; color: var(--text-primary); }

.health-ok { color: var(--success); }
.health-missing { color: var(--danger); }
.health-stale { color: var(--warning); }

.pending-tasks-table {
    width: 100%;
    border-collapse: collapse;
}

.pending-tasks-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--border);
}

.pending-tasks-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.priority-1 { background: var(--danger); }
.priority-2 { background: var(--warning); }
.priority-3 { background: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════════
   Login
   ═══════════════════════════════════════════════════════════════════ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--sidebar-bg);
}

.login-card {
    background: var(--content-bg);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-card .login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 28px;
}

.login-card .form-input {
    padding: 10px 14px;
}

.login-error {
    color: var(--danger);
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════════
   Toast Notifications
   ═══════════════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    box-shadow: var(--shadow-lg);
    animation: toastIn .25s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 360px;
}

.toast-success { background: #059669; }
.toast-error   { background: #dc2626; }
.toast-info    { background: #2563eb; }

.toast.hiding { animation: toastOut .2s ease forwards; }

@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(12px); } }

/* ═══════════════════════════════════════════════════════════════════
   Empty States
   ═══════════════════════════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: .4;
}

.empty-state p {
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════
   Duplicate Menu
   ═══════════════════════════════════════════════════════════════════ */

.duplicate-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--content-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    min-width: 140px;
    padding: 4px;
}

.duplicate-menu.open { display: block; }

.duplicate-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 7px 12px;
    border: none;
    background: none;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all .1s;
}

.duplicate-menu-item:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════════
   Create Post Panel
   ═══════════════════════════════════════════════════════════════════ */

.modal-panel.wide {
    width: 560px;
    right: -560px;
}

.modal-panel.wide.open { right: 0; }

.type-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.type-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    background: var(--content-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .15s ease;
}

.type-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.type-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.type-btn svg {
    width: 14px;
    height: 14px;
}

.caption-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.caption-option {
    background: var(--border-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.6;
    cursor: pointer;
    transition: all .15s;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.caption-option:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.caption-option.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99,91,255,.15);
    background: var(--accent-light);
}

.media-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
    background: var(--page-bg);
}

.media-dropzone:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.media-dropzone svg {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    opacity: .5;
}

.media-dropzone p {
    font-size: 13px;
    margin-top: 4px;
}

.media-preview-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.media-preview-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.media-preview-item img,
.media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.suggest-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    background: var(--accent-light);
    color: var(--accent);
    cursor: pointer;
    transition: all .15s;
}

.suggest-btn:hover {
    background: var(--accent);
    color: #fff;
}

.suggest-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.suggest-btn .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-area { margin-left: 0; }
    .page-content { padding: 16px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .chart-grid { grid-template-columns: 1fr; }
    .health-grid { grid-template-columns: 1fr; }
    .calendar-day { min-height: 60px; }
    .calendar-event { display: none; }
    .top-bar { padding: 0 16px; }
    .filter-bar { flex-direction: column; }
    .filter-bar .form-select { width: 100%; }
    .modal-panel { width: 100%; max-width: 100vw; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .client-grid { grid-template-columns: 1fr; }
}

/* Product badge */
.badge-product {
    background: rgba(16, 185, 129, .12);
    color: #059669;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}

/* Confidence row */
.confidence-row {
    display: flex;
    gap: 8px;
    margin: 4px 0 8px;
    flex-wrap: wrap;
}

.confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    cursor: help;
}

.confidence-label {
    color: var(--text-muted, #6b7280);
    font-weight: 500;
}

.confidence-score {
    font-weight: 700;
}

.confidence-high {
    background: rgba(16, 185, 129, .1);
    color: #059669;
}

.confidence-medium {
    background: rgba(245, 158, 11, .1);
    color: #d97706;
}

.confidence-low {
    background: rgba(239, 68, 68, .1);
    color: #dc2626;
}

.confidence-unknown {
    background: rgba(107, 114, 128, .08);
    color: #6b7280;
}

/* Approval tier badges on post cards */
.badge-tier {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge-tier-high {
    background: rgba(16, 185, 129, .15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, .3);
}
.badge-tier-medium {
    background: rgba(245, 158, 11, .15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, .3);
}
.badge-tier-low {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, .25);
}

/* Fact-check warning badge */
.badge-factcheck {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, .35);
    letter-spacing: 0.02em;
}

/* Carousel template picker */
.template-card {
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-secondary, #f8fafc);
}
.template-card:hover {
    border-color: var(--accent, #635bff);
}
.template-card.selected {
    border-color: var(--accent, #635bff);
    box-shadow: 0 0 0 2px rgba(99, 91, 255, 0.2);
}
.carousel-count-btn.active {
    background: var(--accent, #635bff);
    color: #fff;
}
