/* ============================================================
   Content Management Preview — Apple-leaning design system
   ============================================================ */

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

:root {
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 980px;
  --shadow-1: 0 1px 2px rgba(0,0,0,0.04), 0 1px 1px rgba(0,0,0,0.02);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-3: 0 12px 32px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-modal: 0 24px 64px rgba(0,0,0,0.18), 0 8px 24px rgba(0,0,0,0.10);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
}

[data-theme="light"] {
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --bg-subtle: #f5f5f7;
  --bg-hover: rgba(0,0,0,0.04);
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.14);
  --divider: rgba(0,0,0,0.06);
  --text: #1d1d1f;
  --text-secondary: #424245;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: rgba(0,113,227,0.08);
  --success: #34c759;
  --warning: #ff9500;
  --danger: #ff3b30;
  --info: #5ac8fa;
  --purple: #af52de;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --bg-subtle: #2c2c2e;
  --bg-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.1);
  --border-strong: rgba(255,255,255,0.18);
  --divider: rgba(255,255,255,0.08);
  --text: #f5f5f7;
  --text-secondary: rgba(245,245,247,0.78);
  --text-tertiary: rgba(245,245,247,0.5);
  --accent: #0a84ff;
  --accent-hover: #2997ff;
  --accent-soft: rgba(10,132,255,0.18);
  --success: #30d158;
  --warning: #ff9f0a;
  --danger: #ff453a;
  --info: #64d2ff;
  --purple: #bf5af2;
  --shadow-2: 0 4px 12px rgba(0,0,0,0.45), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-3: 0 12px 32px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.4);
  --shadow-modal: 0 24px 64px rgba(0,0,0,0.7), 0 8px 24px rgba(0,0,0,0.5);
  color-scheme: dark;
}

html, body { height: 100%; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-text);
  background: var(--bg);
  color: var(--text);
  line-height: 1.47;
  letter-spacing: -0.003em;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ===== App shell ===== */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--divider);
}
.app-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.brand-text {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.brand-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s var(--ease);
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-link svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }

.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 16px 10px 6px;
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--divider);
  display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--text-secondary);
}
.who { font-size: 13px; font-weight: 500; }
.who-sub { font-size: 11px; color: var(--text-tertiary); }

.main { padding: 28px 36px 48px; min-width: 0; }
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
.page-sub { color: var(--text-tertiary); font-size: 14px; margin-top: 4px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
  background: transparent;
  color: var(--text);
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-elevated); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }

.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: 8px; }

/* ===== Cards / list ===== */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: 18px 20px; }

.list-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-1); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-tertiary); letter-spacing: 0.02em; text-transform: uppercase; padding: 12px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border); }
td { padding: 14px 16px; border-bottom: 1px solid var(--divider); vertical-align: middle; font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.12s var(--ease); cursor: pointer; }
tbody tr:hover { background: var(--bg-hover); }

/* ===== Stats grid ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; }
.stat-label { font-size: 11px; color: var(--text-tertiary); font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 6px; }
.stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.stat-meta { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }
.stat-meta.up { color: var(--success); }
.stat-meta.down { color: var(--danger); }

/* ===== Toolbar ===== */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-search { position: relative; flex: 1; min-width: 240px; }
.toolbar-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-tertiary); stroke: currentColor; stroke-width: 2; fill: none; }
.toolbar-search input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); color: var(--text); font: inherit; font-size: 14px; }
.toolbar-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.select-pill { height: 36px; padding: 0 30px 0 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.select-pill:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ===== Status badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 10px;
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-NOT_STARTED  { background: rgba(134,134,139,0.12); color: #6e6e73; }
.badge-BEING_EDITED { background: rgba(255,149,0,0.14); color: #b35900; }
.badge-READY_TO_POST{ background: rgba(0,113,227,0.12); color: #0058b0; }
.badge-SCHEDULED    { background: rgba(175,82,222,0.12); color: #7d3aab; }
.badge-POSTED       { background: rgba(52,199,89,0.14); color: #1e7a35; }

[data-theme="dark"] .badge-NOT_STARTED  { background: rgba(174,174,178,0.18); color: #c7c7cc; }
[data-theme="dark"] .badge-BEING_EDITED { background: rgba(255,159,10,0.20); color: #ffb84a; }
[data-theme="dark"] .badge-READY_TO_POST{ background: rgba(10,132,255,0.20); color: #58a8ff; }
[data-theme="dark"] .badge-SCHEDULED    { background: rgba(191,90,242,0.20); color: #d18cf7; }
[data-theme="dark"] .badge-POSTED       { background: rgba(48,209,88,0.20); color: #5fdf85; }

.badge-platform { background: var(--bg-subtle); color: var(--text-secondary); }

/* ===== Drawer (Notion-like task editor) ===== */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease);
  z-index: 90;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(720px, 100%);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-modal);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s var(--ease);
  display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.drawer-header-left { display: flex; align-items: center; gap: 8px; color: var(--text-tertiary); font-size: 13px; }
.drawer-body {
  padding: 24px 56px;
  overflow-y: auto;
  flex: 1;
}
@media (max-width: 720px) { .drawer-body { padding: 20px 24px; } }

.drawer-title-input {
  width: 100%;
  border: 0; outline: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  padding: 8px 0;
  margin-bottom: 16px;
}
.drawer-title-input::placeholder { color: var(--text-tertiary); font-weight: 700; }

.props {
  display: grid; gap: 4px;
  padding: 4px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 18px;
}
.prop-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.prop-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--text-tertiary);
}
.prop-label svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.prop-value { font-size: 14px; }
.prop-value input,
.prop-value select {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 8px;
  font: inherit; font-size: 14px;
  color: var(--text);
  appearance: none;
}
.prop-value input:hover,
.prop-value select:hover { background: var(--bg-hover); }
.prop-value input:focus,
.prop-value select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--bg-elevated); }
.prop-value select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 28px; }

.content-editor {
  width: 100%;
  min-height: 240px;
  border: 0; outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.65;
  resize: none;
  font-family: var(--font-text);
}
.content-editor::placeholder { color: var(--text-tertiary); }

.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--divider);
  display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0;
}
.drawer-saved { font-size: 12px; color: var(--text-tertiary); }
.drawer-saved.show-saved { color: var(--success); }

/* ===== Modal ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; padding: 24px; opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease); z-index: 110; }
.modal-backdrop.show { opacity: 1; pointer-events: auto; }
.modal-card { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--bg-elevated); border-radius: var(--radius-lg); box-shadow: var(--shadow-modal); border: 1px solid var(--border); transform: scale(0.96); transition: transform 0.25s var(--ease); }
.modal-backdrop.show .modal-card { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 14px; border-bottom: 1px solid var(--divider); }
.modal-header h2 { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.modal-close { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-subtle); border: 0; display: grid; place-items: center; cursor: pointer; color: var(--text-tertiary); }
.modal-close:hover { background: var(--bg-hover); color: var(--text); }
.modal-close svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2.5; fill: none; }
.modal-form { padding: 18px 22px; display: grid; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--divider); background: var(--bg-subtle); }

/* ===== Form ===== */
.form-group { display: grid; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-tertiary); }

/* Screenshot dropzone */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  background: var(--bg-subtle);
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 28px; height: 28px; stroke: var(--text-tertiary); stroke-width: 1.5; fill: none; margin-bottom: 8px; }
.dropzone-title { font-weight: 500; font-size: 14px; color: var(--text); }
.dropzone-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.dropzone.has-file { border-style: solid; border-color: var(--success); background: transparent; padding: 12px; text-align: left; }
.dropzone.has-file .dropzone-icon-ok { color: var(--success); }
.dropzone-preview { display: flex; align-items: center; gap: 12px; }
.dropzone-preview img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }

/* ===== Account grid (admin) ===== */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.acc-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.acc-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.acc-card.has-alert { box-shadow: 0 0 0 1px var(--danger); border-color: var(--danger); }
.acc-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.platform-dot { width: 10px; height: 10px; border-radius: 50%; }
.acc-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.acc-handle { font-size: 12px; color: var(--text-tertiary); }
.acc-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.acc-stat-label { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.acc-stat-value { font-size: 16px; font-weight: 600; font-family: var(--font-display); letter-spacing: -0.02em; }
.acc-card-employee { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--divider); font-size: 12px; color: var(--text-secondary); }
.acc-card-employee .avatar { width: 22px; height: 22px; font-size: 9px; }

/* ===== Alerts ===== */
.alert-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.alert-card.severity-medium { border-left-color: var(--warning); }
.alert-card.severity-low { border-left-color: var(--info); }
.alert-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,59,48,0.12);
  color: var(--danger);
  flex-shrink: 0;
}
.alert-card.severity-medium .alert-icon { background: rgba(255,149,0,0.14); color: var(--warning); }
.alert-icon svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }
.alert-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.alert-title { font-weight: 600; font-size: 14px; }
.alert-msg { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ===== Chart container ===== */
.chart-card { padding: 18px 20px 8px; }
.chart-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.chart-card-title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.chart-wrap { position: relative; height: 320px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.chip.active { background: var(--accent); color: #fff; }

/* ===== Login switcher ===== */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 460px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 32px; box-shadow: var(--shadow-3); }
.login-card h1 { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 6px; }
.login-card p { color: var(--text-tertiary); font-size: 14px; margin-bottom: 22px; }
.login-options { display: grid; gap: 8px; }
.login-options button { width: 100%; justify-content: flex-start; height: 48px; padding: 0 16px; border-radius: var(--radius-md); }
.login-options .btn-secondary { border-color: var(--border); }
.login-help { font-size: 12px; color: var(--text-tertiary); margin-top: 18px; text-align: center; }

/* ===== Theme toggle ===== */
.theme-toggle { display: inline-flex; background: var(--bg-subtle); border-radius: var(--radius-pill); padding: 3px; border: 1px solid var(--border); }
.theme-toggle-option { background: transparent; border: 0; padding: 5px 9px; border-radius: var(--radius-pill); cursor: pointer; color: var(--text-tertiary); display: grid; place-items: center; }
.theme-toggle-option svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.theme-toggle-option.active { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-1); }

/* ===== Source tags (auto-scrape vs OCR indicator) ===== */
.src-tag-ok, .src-tag-fail, .src-tag-pending {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 500;
}
.src-tag-ok svg, .src-tag-fail svg, .src-tag-pending svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2; fill: none; }
.src-tag-ok      { background: rgba(52,199,89,0.10); color: #1e7a35; }
.src-tag-fail    { background: rgba(255,59,48,0.10); color: #c41e3a; }
.src-tag-pending { background: var(--bg-subtle); color: var(--text-tertiary); }
[data-theme="dark"] .src-tag-ok      { background: rgba(48,209,88,0.18); color: #5fdf85; }
[data-theme="dark"] .src-tag-fail    { background: rgba(255,69,58,0.18); color: #ff857a; }

/* ===== Productivity table ===== */
.prod-bar { display: flex; align-items: center; gap: 8px; }
.prod-bar-track { flex: 1; height: 6px; background: var(--bg-subtle); border-radius: 3px; overflow: hidden; }
.prod-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.prod-bar-fill.low { background: var(--warning); }
.prod-bar-fill.zero { background: var(--danger); }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 64px 24px; color: var(--text-tertiary); }
.empty-state svg { width: 36px; height: 36px; stroke: currentColor; stroke-width: 1.5; fill: none; margin-bottom: 12px; opacity: 0.4; }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-pill); padding: 12px 18px 12px 14px; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-3); opacity: 0; pointer-events: none; transition: all 0.25s var(--ease); z-index: 200; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; }
.toast-icon svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 3; fill: none; }

/* Banner */
.preview-banner { background: var(--accent); color: #fff; padding: 8px 16px; text-align: center; font-size: 13px; font-weight: 500; }
.preview-banner a { color: #fff; text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; gap: 8px; padding: 12px; overflow-x: auto; }
  .sidebar-brand, .nav-section-label, .sidebar-footer { display: none; }
  .nav-link { white-space: nowrap; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 20px 16px 40px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
