/* ── Theme Variables ────────────────────────────────────── */
:root {
  --radius: 10px;
  --sidebar-width: 240px;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --blue: #3b82f6;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #242837;
  --border: #2e3348;
  --text: #e4e6ef;
  --text2: #8b8fa8;
  --accent: #6366f1;
  --accent2: #818cf8;
  /* 04A — Aliases for variables referenced by views but never defined */
  --primary: var(--accent);
  --text1: var(--text);
  --text-muted: var(--text2);
  --primary-bg: rgba(99, 102, 241, 0.1);
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --modal-overlay: rgba(0,0,0,0.7);
  --badge-pending-bg: #374151; --badge-pending-fg: #9ca3af;
  --badge-running-bg: #1e3a5f; --badge-running-fg: var(--blue);
  --badge-paused-bg: #422006;  --badge-paused-fg: var(--yellow);
  --badge-success-bg: #052e16; --badge-success-fg: var(--green);
  --badge-error-bg: #450a0a;   --badge-error-fg: var(--red);
  --toast-success: #166534;
  --toast-error: #991b1b;
  --toast-info: #1e3a5f;
}

[data-theme="light"] {
  --bg: #f5f6fa;
  --bg2: #ffffff;
  --bg3: #eef0f6;
  --border: #d5d8e3;
  --text: #1a1d27;
  --text2: #5f6380;
  --accent: #6366f1;
  --accent2: #4f46e5;
  /* 04A — Aliases for variables referenced by views but never defined */
  --primary: var(--accent);
  --text1: var(--text);
  --text-muted: var(--text2);
  --primary-bg: rgba(99, 102, 241, 0.08);
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --modal-overlay: rgba(0,0,0,0.4);
  --badge-pending-bg: #e5e7eb; --badge-pending-fg: #6b7280;
  --badge-running-bg: #dbeafe; --badge-running-fg: #2563eb;
  --badge-paused-bg: #fef3c7;  --badge-paused-fg: #d97706;
  --badge-success-bg: #dcfce7; --badge-success-fg: #16a34a;
  --badge-error-bg: #fee2e2;   --badge-error-fg: #dc2626;
  --toast-success: #16a34a;
  --toast-error: #dc2626;
  --toast-info: #2563eb;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; transition: background 0.2s, color 0.2s; }

/* ── Status Indicator (top tab bar) — 04B ─────────────── */
.status-indicator { position: relative; margin-left: auto; display: flex; align-items: center; padding: 0 12px; }
.status-trigger { background: none; border: none; cursor: pointer; padding: 6px; display: flex; align-items: center; border-radius: 6px; transition: background 0.15s; }
.status-trigger:hover { background: var(--bg3); }
.status-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--text2); /* loading default */
  transition: background 0.3s;
}
.status-dot[data-status="healthy"] { background: var(--green); animation: pulse 2.4s infinite; }
.status-dot[data-status="degraded"] { background: var(--yellow); }
.status-dot[data-status="down"] { background: var(--red); animation: pulse 1.2s infinite; }
.status-tooltip {
  position: absolute; top: 100%; right: 8px; margin-top: 8px; z-index: 30;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); min-width: 280px; max-width: 340px; overflow: hidden;
  animation: fadeIn 0.15s;
}
.status-tooltip[hidden] { display: none; }
.status-tooltip-header { padding: 10px 14px; background: var(--bg3); border-bottom: 1px solid var(--border); }
.status-tooltip-header strong { font-size: 13px; }
.status-tooltip-time { font-size: 11px; color: var(--text2); margin-top: 2px; }
.status-tooltip-rows { padding: 4px 0; }
.status-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 12px; }
.status-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.status-row-icon { display: inline-flex; flex-shrink: 0; }
.status-row-body { flex: 1; min-width: 0; }
.status-row-name { font-weight: 500; color: var(--text); }
.status-row-msg { font-size: 11px; color: var(--text2); margin-top: 2px; }
.status-row-latency { font-size: 11px; color: var(--text2); flex-shrink: 0; }

/* ── Icon (Lucide SVG) — 04C ────────────────────────────── */
/* .icon is a span wrapping an inline SVG; SVG uses currentColor so it respects theme + parent text colour */
.icon { display:inline-flex; align-items:center; justify-content:center; vertical-align:middle; line-height:1; }
.icon svg { display:block; stroke: currentColor; }
/* Note: the existing .empty-state .icon rule (font-size:40px) still applies to un-swept emoji fallbacks.
   New empty-state SVG icons should be rendered with size: 40 to match the existing visual weight. */

/* ── Sidebar ────────────────────────────────────────────── */
/* ── Tab Bar ────────────────────────────────────────────── */
#tab-bar {
  display: flex; gap: 0; background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 0 16px; position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: 44px; align-items: stretch;
}
#tab-bar .tab {
  padding: 0 20px; font-size: 14px; font-weight: 600; cursor: pointer;
  background: none; border: none; color: var(--text2);
  border-bottom: 2px solid transparent; transition: all 0.15s;
}
#tab-bar .tab:hover { color: var(--text); }
#tab-bar .tab.active { color: var(--accent); border-bottom-color: var(--accent); }

#sidebar {
  width: var(--sidebar-width); background: var(--bg2); border-right: 1px solid var(--border);
  padding: 20px 0; display: flex; flex-direction: column; position: fixed;
  top: 44px; left: 0; bottom: 0; z-index: 10; transition: background 0.2s, border-color 0.2s;
}
#sidebar .logo { padding: 0 20px 20px; font-size: 18px; font-weight: 700; color: var(--accent2); border-bottom: 1px solid var(--border); margin-bottom: 8px; }
#sidebar .logo small { display: block; font-size: 11px; color: var(--text2); font-weight: 400; margin-top: 2px; }
/* ── Client Switcher ────────────────────────────────────── */
.client-switcher { padding: 0 12px 10px; position: relative; }
.client-current {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); font-size: 13px; font-weight: 500;
  transition: all 0.15s; text-align: left;
}
.client-current:hover { border-color: var(--accent); background: var(--bg); }
.client-current.open { border-color: var(--accent); }
.client-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
}
.client-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-chevron { font-size: 10px; color: var(--text2); transition: transform 0.2s; flex-shrink: 0; }
.client-current.open .client-chevron { transform: rotate(180deg); }
.client-dropdown {
  display: none; position: absolute; left: 12px; right: 12px; top: 100%;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); z-index: 20; margin-top: 4px; overflow: hidden;
}
.client-dropdown.show { display: block; animation: fadeIn 0.15s; }
.client-dropdown-header {
  padding: 8px 12px; font-size: 11px; font-weight: 600;
  color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.client-list { max-height: 200px; overflow-y: auto; }
.client-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; font-size: 13px; cursor: pointer;
  color: var(--text2); transition: all 0.1s; border: none;
  background: none; width: 100%; text-align: left;
}
.client-item:hover { background: var(--bg3); color: var(--text); }
.client-item.active { color: var(--accent); font-weight: 600; }
.client-item .check { width: 16px; font-size: 14px; flex-shrink: 0; }
.client-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

#sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: var(--text2);
  text-decoration: none; font-size: 14px; transition: all 0.15s;
}
#sidebar nav a:hover { background: var(--bg3); color: var(--text); }
#sidebar nav a.active { background: var(--accent); color: #fff; border-radius: 0; }
#sidebar nav a .icon { width: 20px; text-align: center; font-size: 16px; }
#sidebar .divider { height: 1px; background: var(--border); margin: 8px 16px; }
#sidebar .logout-link { color: var(--red); opacity: 0.7; }
#sidebar .logout-link:hover { opacity: 1; background: rgba(239, 68, 68, 0.1); }

/* ── Sidebar footer (version + theme toggle) ──────────── */
.sidebar-footer { margin-top: auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.sidebar-version { font-size: 11px; color: var(--text2); opacity: 0.5; }
.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  width: 32px; height: 32px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 16px; color: var(--text2); transition: all 0.2s;
  padding: 0; line-height: 1;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); background: var(--bg3); }

/* ── Main ───────────────────────────────────────────────── */
#main { margin-left: var(--sidebar-width); margin-top: 44px; flex: 1; padding: 28px 32px; min-height: calc(100vh - 44px); }

/* ── Cards ──────────────────────────────────────────────── */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; transition: background 0.2s, border-color 0.2s; }
.card h3 { font-size: 16px; margin-bottom: 12px; color: var(--text); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px;
  cursor: pointer; font-weight: 500; transition: all 0.15s; display: inline-flex;
  align-items: center; gap: 6px;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Badges ─────────────────────────────────────────────── */
.badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-pending { background: var(--badge-pending-bg); color: var(--badge-pending-fg); }
.badge-running { background: var(--badge-running-bg); color: var(--badge-running-fg); animation: pulse 1.5s infinite; }
.badge-paused { background: var(--badge-paused-bg); color: var(--badge-paused-fg); }
.badge-approved, .badge-completed, .badge-publish, .badge-published, .badge-ready, .badge-client-approved { background: var(--badge-success-bg); color: var(--badge-success-fg); }
.badge-rejected, .badge-error, .badge-missing, .badge-failed { background: var(--badge-error-bg); color: var(--badge-error-fg); }
.badge-scheduled { background: #e8f0fe; color: #1a73e8; }
.badge-client-changes-requested { background: var(--badge-paused-bg); color: var(--badge-paused-fg); }
.badge-draft { background: var(--badge-paused-bg); color: var(--badge-paused-fg); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ── Password visibility toggle ────────────────────────── */
.input-password-wrap { position: relative; display: flex; align-items: center; }
.input-password-wrap input { padding-right: 40px; }
.btn-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 18px;
  color: var(--text2); padding: 4px 6px; border-radius: 4px; line-height: 1;
  transition: color 0.15s;
}
.btn-eye:hover { color: var(--accent); }

/* ── Forms ──────────────────────────────────────────────── */
input, textarea, select {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  padding: 8px 12px; border-radius: 6px; font-size: 14px; width: 100%;
  font-family: inherit; transition: border-color 0.15s, background 0.2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 4px; font-weight: 500; }
.form-group { margin-bottom: 16px; }

/* ── Toggle ─────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg3); border-radius: 24px; cursor: pointer; transition: 0.2s;
  border: 1px solid var(--border);
}
.toggle .slider:before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 2px; bottom: 2px;
  background: var(--text2); border-radius: 50%; transition: 0.2s;
}
.toggle input:checked + .slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .slider:before { transform: translateX(20px); background: #fff; }

/* ── Pipeline Steps ─────────────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: 4px; }
.step-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--bg3); border-radius: 8px; font-size: 14px;
}
.step-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); flex-shrink: 0; }
.step-dot.done { background: var(--green); }
.step-dot.active { background: var(--blue); animation: pulse 1.5s infinite; }
.step-dot.paused { background: var(--yellow); }
.step-dot.error { background: var(--red); }
.step-label { flex: 1; }
.step-action { margin-left: auto; }

/* ── Inline Approval Toggles ───────────────────────────── */
.step-row.auto-skip { opacity: 0.7; }
.step-toggle { flex-shrink: 0; }
.toggle-sm { width: 36px; height: 20px; }
.toggle-sm .slider:before { width: 14px; height: 14px; left: 2px; bottom: 2px; }
.toggle-sm input:checked + .slider:before { transform: translateX(16px); }
.auto-skip-label { font-size: 11px; color: var(--yellow); font-weight: 500; flex-shrink: 0; }

/* ── Content Items ──────────────────────────────────────── */
.item-card {
  background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 10px; transition: border-color 0.15s;
}
.item-card:hover { border-color: var(--accent); }
.item-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.item-meta { font-size: 12px; color: var(--text2); margin-bottom: 8px; }
.item-actions { display: flex; gap: 6px; margin-top: 10px; }
.item-content { font-size: 13px; color: var(--text2); line-height: 1.6; max-height: 120px; overflow: hidden; }
.item-content.expanded { max-height: none; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--modal-overlay); display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; width: 90%; max-width: 800px; max-height: 85vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ── Toast ──────────────────────────────────────────────── */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: 8px; font-size: 13px; color: #fff;
  animation: slideIn 0.3s; min-width: 250px; box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.toast-close {
  background: none; border: none; color: rgba(255,255,255,0.7); font-size: 18px;
  cursor: pointer; padding: 0 2px; line-height: 1; flex-shrink: 0;
}
.toast-close:hover { color: #fff; }
.toast-success { background: var(--toast-success); }
.toast-error { background: var(--toast-error); }
.toast-info { background: var(--toast-info); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Grid/Flex helpers ──────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text2); }
h2 { font-size: 22px; margin-bottom: 20px; }

/* ── Progress bar ───────────────────────────────────────── */
.progress-bar { width: 100%; height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.progress-bar .fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }

/* ── Empty state ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px; color: var(--text2); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }

/* ── WP Drafts ──────────────────────────────────────────── */
.draft-card { display: flex; justify-content: space-between; align-items: center; }
.draft-info { flex: 1; }
.draft-title { font-weight: 600; }
.draft-date { font-size: 12px; color: var(--text2); }

/* ── Image grid ─────────────────────────────────────────── */
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.image-card { text-align: center; }
.image-card img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.image-card .placeholder { width: 100%; height: 150px; background: var(--bg3); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--text2); border: 2px dashed var(--border); }

/* ── Character Counter ──────────────────────────────────── */
.char-counter { font-size: 12px; font-weight: 500; }
.char-ok { color: var(--text2); }
.char-warning { color: var(--yellow); }
.char-danger { color: var(--red); }

/* ── LinkedIn Post Preview ─────────────────────────────── */
.post-preview {
  white-space: pre-wrap; word-break: break-word; font-family: inherit;
  font-size: 13px; line-height: 1.6; color: var(--text);
  background: var(--bg3); border-radius: 8px; padding: 12px;
  max-height: 200px; overflow-y: auto;
}

/* ── Poll Preview ──────────────────────────────────────── */
.poll-preview { background: var(--bg3); border-radius: 8px; padding: 14px; }
.poll-question { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.poll-options { display: flex; flex-direction: column; gap: 6px; }
.poll-option {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; font-size: 13px; color: var(--text); cursor: default;
}

/* ── Article Preview ──────────────────────────────────── */
.article-preview .article-title { font-size: 16px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }

/* ── Client Feedback ───────────────────────────────────── */
.client-feedback {
  background: var(--badge-paused-bg); color: var(--badge-paused-fg);
  border-radius: 6px; padding: 8px 12px; font-size: 13px; line-height: 1.5;
}

/* ── Content Mix Config ────────────────────────────────── */
.content-mix-config { min-width: 340px; }
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.preset-btn { transition: all 0.15s; }
.preset-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.mix-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mix-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--bg3); border-radius: 8px; }
.mix-item label { font-size: 14px; font-weight: 500; color: var(--text); }
.mix-stepper { display: flex; align-items: center; gap: 8px; }
.mix-stepper .btn { min-width: 30px; padding: 2px 0; font-size: 16px; font-weight: 700; }
.mix-value { font-size: 20px; font-weight: 700; color: var(--accent); min-width: 24px; text-align: center; }
.mix-total { text-align: center; font-size: 14px; color: var(--text2); padding: 8px; background: var(--bg3); border-radius: 8px; }
.mix-total strong { color: var(--accent); font-size: 18px; }

/* ── Card List ─────────────────────────────────────────── */
.card-list { display: flex; flex-direction: column; gap: 12px; }

/* ── LinkedIn Image Preview ────────────────────────────── */
.li-image-preview { border-radius: 8px; overflow: hidden; }
.li-image-preview img { display: block; width: 100%; max-height: 400px; object-fit: contain; background: var(--bg2); border-radius: 8px; }

/* ── LinkedIn Images Grid ─────────────────────────────── */
.li-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.li-img-card img { aspect-ratio: 1; object-fit: cover; }

/* ── Status Filter Bar ────────────────────────────────── */
.status-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 20px;
  background: var(--bg2); color: var(--text); cursor: pointer; font-size: 13px;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.filter-count { font-size: 11px; opacity: 0.7; margin-left: 4px; }
.filter-btn.active .filter-count { opacity: 0.9; }

/* ── Content Calendar ────────────────────────────────── */
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.cal-header {
  padding: 8px; text-align: center; font-weight: 600; font-size: 12px;
  background: var(--bg2); color: var(--text-muted); text-transform: uppercase;
}
.cal-cell {
  min-height: 100px; padding: 6px; background: var(--bg); vertical-align: top;
}
.cal-cell.cal-empty { background: var(--bg2); opacity: 0.5; }
.cal-cell.cal-today { background: color-mix(in srgb, var(--primary) 8%, var(--bg)); }
.cal-day-num {
  font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text-muted);
}
.cal-today .cal-day-num { color: var(--primary); font-weight: 700; }
.cal-event {
  padding: 2px 6px; margin-bottom: 3px; border-radius: 4px;
  background: var(--bg2); font-size: 11px; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis; cursor: default;
}
.cal-event-icon { margin-right: 3px; }
.cal-event-text { color: var(--text); }
.cal-more { font-size: 11px; color: var(--text-muted); padding: 2px 6px; cursor: pointer; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  #tab-bar { padding: 0 8px; }
  #tab-bar .tab { padding: 0 12px; font-size: 13px; }
  #sidebar { width: 60px; top: 44px; }
  #sidebar .logo, #sidebar nav a span { display: none; }
  #sidebar nav a { justify-content: center; padding: 12px; }
  #main { margin-left: 60px; margin-top: 44px; padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .sidebar-footer { flex-direction: column; gap: 8px; padding: 8px; }
  .sidebar-version { display: none; }
  .client-switcher { padding: 0 6px 8px; }
  .client-current .client-name, .client-current .client-chevron { display: none; }
  .client-current { justify-content: center; padding: 8px; }
  .client-dropdown { left: 6px; right: auto; width: 200px; }
}

/* ── Tweak quick action buttons ── */
.tweak-quick-btn { font-size: 12px; padding: 4px 10px; border-radius: 16px; }
.tweak-quick-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Image Lightbox ── */
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.lightbox-content {
  max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column;
  cursor: default;
}
.lightbox-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 4px; color: #fff;
}
.lightbox-title { font-size: 14px; font-weight: 600; opacity: 0.8; }
.lightbox-close {
  background: none; border: none; color: #fff; font-size: 32px;
  cursor: pointer; line-height: 1; padding: 0 8px; opacity: 0.7;
}
.lightbox-close:hover { opacity: 1; }
.lightbox-content img {
  max-width: 90vw; max-height: calc(90vh - 48px);
  object-fit: contain; border-radius: 8px;
}

/* Toggle switch */
.toggle-switch {
  position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border); border-radius: 24px; transition: 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--green); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.4; cursor: not-allowed; }
