/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
/* GenomeAI Агро — globals.css v2 (Connecterra-style, light theme) */

:root {
  /* Backgrounds */
  --bg: #ffffff;
  --bg-muted: #f7f9fa;
  --panel: #ffffff;
  --panel-subtle: #f7f9fa;

  /* Borders */
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* Sidebar */
  --sidebar-bg: #ffffff;
  --sidebar-logo-bg: #2dd4bf;
  --sidebar-active: #e6fff9;
  --sidebar-active-text: #0d9488;
  --sidebar-hover: #f7f9fa;

  /* Topbar */
  --topbar-bg: #2a3440;
  --topbar-text: #ffffff;
  --topbar-breadcrumb-active: #2dd4bf;

  /* Text */
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-on-teal: #0d5a52;

  /* Accent (teal) */
  --accent: #2dd4bf;
  --accent-hover: #14b8a6;
  --accent-soft: #ccfbf1;
  --accent-subtle: #f0fdfa;
  --accent-text: #0f766e;

  /* Semantic */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Semantic backgrounds */
  --success-bg: #dcfce7;
  --success-text: #16a34a;
  --danger-bg: #fee2e2;
  --danger-text: #dc2626;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;
  --info-bg: #bfdbfe;
  --info-text: #1d4ed8;
  --badge-beta-bg: #ede9fe;
  --badge-beta-text: #7c3aed;

  /* Dairy-specific */
  --withdrawal: #dc2626;
  --fresh-cow: #a855f7;
  --in-heat: #ec4899;
  --high-producer: #06b6d4;

  /* Radii */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 8px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);

  /* Motion */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0.38, 0.9);

  /* Typography */
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* Layout */
  --sidebar-width: 220px;
  --sidebar-collapsed: 60px;
  --topbar-height: 56px;
}

/* ── Reset ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ── App root ──────────────────────────────────── */
.app-root { min-height: 100vh; }

/* ── Shell layout ──────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  overflow: hidden;
  transition: grid-template-columns var(--duration-base) var(--ease-standard);
}
.shell.shell-collapsed {
  grid-template-columns: var(--sidebar-collapsed) 1fr;
}
.shell-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}
.shell-content {
  flex: 1 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* logo block */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}
.sidebar-logo-mark {
  width: 32px;
  height: 32px;
  min-width: 32px;
  background: var(--sidebar-logo-bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.sidebar-wordmark {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
}

/* nav */
.sidebar-nav {
  flex: 1 1;
  padding: 8px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}
.sidebar-section-heading {
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.nav-link:hover { background: var(--sidebar-hover); color: var(--text); }
.nav-link-active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
}
.nav-link-active:hover {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text);
}
.nav-link-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-link-label { overflow: hidden; }

/* Sidebar accordion (P1-3a) */
.nav-group {
  display: flex;
  flex-direction: column;
}
.nav-group-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.nav-group-chevron {
  margin-left: auto;
  display: inline-flex;
  opacity: 0.7;
}
.nav-group-children {
  display: flex;
  flex-direction: column;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
  margin-left: 1rem;
}
.nav-link-nested {
  padding-left: 0.5rem;
  font-size: 0.95em;
}

/* sidebar divider */
.sidebar-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 8px;
}

/* sidebar bottom section */
.sidebar-bottom {
  padding: 4px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* collapsed state — text hidden */
.shell-collapsed .sidebar-wordmark,
.shell-collapsed .nav-link-label,
.shell-collapsed .sidebar-session { display: none; }
.shell-collapsed .sidebar-logo { justify-content: center; padding: 12px 8px; }
.shell-collapsed .sidebar-nav { padding: 8px 6px 0; }
.shell-collapsed .sidebar-bottom { padding: 4px 6px 12px; }
.shell-collapsed .nav-link { justify-content: center; padding: 9px 8px; }

/* ── Topbar ────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
}
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
.topbar-breadcrumb-sep { color: rgba(255,255,255,0.35); }
.topbar-breadcrumb-current {
  color: var(--topbar-breadcrumb-active);
  font-weight: 500;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-btn-demo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
  white-space: nowrap;
}
.topbar-btn-demo:hover { background: rgba(45,212,191,0.1); }
.topbar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
}

/* ── FAB ───────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(45,212,191,0.4);
  z-index: 50;
  transition: background var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}
.fab:hover { background: var(--accent-hover); transform: scale(1.05); }
.fab:active { transform: scale(0.97); }

/* ── Toast ─────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 92px;
  right: 24px;
  background: #1e293b;
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--duration-base) var(--ease-standard);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Mobile tab bar ────────────────────────────── */
.mobile-tab-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border);
  z-index: 40;
}
.mobile-tab-bar-inner {
  display: flex;
  height: 100%;
}
.mobile-tab {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}
.mobile-tab:hover { color: var(--text); }
.mobile-tab-active { color: var(--sidebar-active-text); }

/* ── Cards ─────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card-title { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--text); }
.card-subtitle { margin: 0; color: var(--text-muted); font-size: 13px; }
.card-value { margin: 10px 0 0; font-size: 28px; font-weight: 700; color: var(--text); }

/* ── Grid ───────────────────────────────────────── */
.grid   { display: grid; grid-gap: 16px; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ── Typography helpers ─────────────────────────── */
.page-title    { margin: 0; font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { margin: 6px 0 0; color: var(--text-muted); font-size: 13px; }
.section-title { margin: 0 0 12px; font-size: 16px; font-weight: 600; color: var(--text); }

/* ── Buttons ────────────────────────────────────── */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard);
}
.button:hover { background: var(--bg-muted); }
.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-secondary { background: var(--bg-muted); border-color: var(--border); }
.button-secondary:hover { background: #eef0f2; }
.button-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}
.button-danger:hover { background: #fee2e2; }

/* ── Badges ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-muted);
  color: var(--text-secondary);
}
.badge-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.badge-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.badge-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.badge-info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.badge-teal    { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }

/* ── Form elements ─────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.input {
  min-width: 200px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  transition: border-color var(--duration-fast) var(--ease-standard);
}
.input:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: var(--text-muted); }

/* ── Table ──────────────────────────────────────── */
.table-wrap { overflow: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.table th { color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; background: var(--bg-muted); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-muted); }

/* ── Misc ───────────────────────────────────────── */
.explain { display: grid; grid-gap: 10px; gap: 10px; }
.explain-item { border-left: 3px solid var(--accent); padding-left: 12px; color: var(--text-secondary); font-size: 13px; }
.empty-state { text-align: center; padding: 42px 16px; color: var(--text-muted); }
.meta-list { display: grid; grid-gap: 8px; gap: 8px; }
.meta-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.error-text { color: var(--danger); font-size: 13px; }

/* ── Login ──────────────────────────────────────── */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 720px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero  { display: none; }
}

/* Hero (left) */
.login-hero {
  position: relative;
  background: linear-gradient(155deg, #0d3d38 0%, #0f766e 55%, #115e59 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 48px 44px 0;
}
.login-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}
.login-hero-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-hero-wordmark {
  font-size: 18px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.3px;
}
.login-hero-title {
  font-size: 42px;
  font-weight: 800;
  color: white;
  line-height: 1.1;
  letter-spacing: -1px;
  margin: 0;
}
.login-hero-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.7);
  margin: 0;
  max-width: 300px;
  line-height: 1.5;
}
.login-hero-scene {
  align-self: flex-end;
  width: 100%;
  line-height: 0;
}
.login-hero-scene svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Form (right) */
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px 32px;
}
.login-card {
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.login-card-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-card-wordmark {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.login-card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.3px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 14px;
  gap: 14px;
}
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* ── Linked action cards ────────────────────────── */
.linked-actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); grid-gap: 12px; gap: 12px; }
.linked-action-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  transition: border-color var(--duration-fast) var(--ease-standard),
              background var(--duration-fast) var(--ease-standard);
}
.linked-action-card:hover { border-color: var(--accent); background: var(--accent-subtle); }
.linked-action-count { font-size: 26px; font-weight: 700; color: var(--text); min-width: 32px; }
.linked-action-title { font-weight: 600; font-size: 14px; color: var(--text); }
.linked-action-caption { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.linked-inline-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.linked-inline-actions a { color: var(--accent-text); font-size: 13px; }
.linked-inline-actions a:hover { text-decoration: underline; }
.bullet-list { margin: 10px 0 0; padding-left: 18px; color: var(--text-secondary); display: grid; grid-gap: 6px; gap: 6px; font-size: 13px; }
.bullet-list.compact { gap: 4px; margin-top: 12px; }
.brief-status { margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.small-muted { font-size: 12px; color: var(--text-muted); }

/* ── Main (legacy compat) ───────────────────────── */
.main { padding: 24px; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .shell {
    grid-template-columns: 1fr !important;
    height: auto;
    overflow: visible;
  }
  .sidebar { display: none; }
  .shell-body { height: auto; }
  .shell-content { overflow-y: visible; padding-bottom: 72px; }
  .mobile-tab-bar { display: block; }
  .fab { bottom: 80px; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 12px; }
  .topbar-btn-demo span { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── MorningBriefCard ───────────────────────────────────────────────────── */
.brief-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.brief-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brief-ai-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.brief-ai-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.brief-meta { font-size: 11px; color: var(--text-muted); }
.brief-headline { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1.4; margin: 0 0 6px; }
.brief-takeaway { font-size: 13px; color: var(--text-secondary); line-height: 1.65; margin: 0 0 16px; }

.brief-section { margin-bottom: 12px; }
.brief-section-hdr {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid #f1f5f9;
  padding: 0 0 7px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  text-align: left;
}
.brief-section-hdr:hover { color: var(--text-secondary); }
.brief-section-arrow { color: var(--accent); font-size: 10px; }
.brief-section-body { display: flex; flex-direction: column; gap: 0; }
.brief-section-hdr-hint { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }

.brief-change-row {
  font-size: 13px;
  color: var(--text);
  padding: 7px 10px;
  border: 1px solid #f1f5f9;
  border-radius: var(--radius);
  background: var(--bg-muted);
  margin-bottom: 5px;
  line-height: 1.4;
}

.brief-action-row {
  border: 1px solid #f1f5f9;
  border-radius: var(--radius);
  background: var(--bg-muted);
  margin-bottom: 5px;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.brief-action-row:hover,
.brief-action-row--editing {
  border-color: var(--accent);
  background: #f0fdfb;
}
.brief-action-view {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
}
.brief-action-view:hover .brief-action-controls { opacity: 1; }
.brief-action-text { flex: 1 1; font-size: 13px; color: var(--text); line-height: 1.45; }
.brief-action-due  { font-size: 11px; color: var(--text-muted); margin-left: 4px; }
.brief-action-role { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; margin-top: 2px; }
.brief-action-controls { display: flex; gap: 4px; opacity: 0; transition: opacity var(--duration-fast); flex-shrink: 0; }
.brief-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 13px;
}
.brief-icon-btn:hover { color: var(--accent-dark, #0d9488); background: var(--accent-soft); }
.brief-icon-btn--danger:hover { color: var(--danger); background: #fef2f2; }

.brief-edit-form { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.brief-edit-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: #fff;
  box-sizing: border-box;
}
.brief-edit-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brief-edit-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.brief-edit-select {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  background: #fff;
}
.brief-edit-actions { display: flex; gap: 6px; }

.brief-priority-picker { display: flex; gap: 5px; }
.brief-priority-pill {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--duration-fast);
  opacity: 0.5;
  background: none;
}
.brief-priority-pill:hover { opacity: 1; }
.brief-priority-pill--active { opacity: 1; }
.brief-priority-pill--high         { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.brief-priority-pill--high.brief-priority-pill--active  { background: #dc2626; color: #fff; border-color: #dc2626; }
.brief-priority-pill--medium       { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }
.brief-priority-pill--medium.brief-priority-pill--active { background: #ea580c; color: #fff; border-color: #ea580c; }
.brief-priority-pill--low          { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.brief-priority-pill--low.brief-priority-pill--active   { background: #16a34a; color: #fff; border-color: #16a34a; }

.brief-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius);
  border: 1px dashed var(--text-muted);
  background: none;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 4px;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
.brief-add-btn:hover { border-color: var(--accent); color: var(--accent-dark, #0d9488); }

.brief-note { font-size: 12px; color: var(--text-secondary); padding: 5px 10px; border-left: 2px solid var(--border); margin-bottom: 4px; }

.brief-footer-meta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  font-size: 11px;
  color: var(--text-muted);
}

.brief-approve-zone {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brief-approve-hint { font-size: 12px; color: var(--text-muted); line-height: 1.5; max-width: 300px; }
.brief-approve-hint strong { color: var(--text-secondary); }
.brief-approved-zone {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brief-approved-msg { font-size: 13px; color: #15803d; font-weight: 600; }

/* MorningBriefCard — additional utility classes (no inline styles) */
.brief-action-badge { flex-shrink: 0; margin-top: 2px; }
.brief-edit-time { width: 84px; }
.brief-edit-btn { font-size: 12px; padding: 5px 12px; }
.brief-edit-btn--cancel { font-size: 12px; padding: 5px 10px; }
.brief-empty-title { margin-top: 10px; }
.brief-empty-desc { font-size: 13px; color: var(--text-secondary); margin: 6px 0 12px; }
.brief-loading { margin-top: 10px; color: var(--text-muted); font-size: 13px; }
.brief-refresh-btn { font-size: 12px; padding: 4px 10px; }
.brief-error { margin-top: 8px; color: var(--danger); font-size: 12px; }
.brief-pdf-link {
  color: var(--accent-text);
  border-color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

/* entity-links badge classes */
.badge-animal-link {
  text-decoration: none;
  cursor: pointer;
  margin-inline: 2px;
}
.badge-task {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #ddd6fe;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  text-decoration: none;
  cursor: pointer;
  margin-inline: 2px;
}

/* ── Overview (MVP-N02) ─────────────────────────── */
.overview-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  background: var(--accent-subtle);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--accent-text);
  margin-bottom: 20px;
}

.overview-greeting {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 20px;
  font-family: var(--font);
  letter-spacing: -0.02em;
}

.attention-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  margin-bottom: 10px;
}

.attention-section { margin-bottom: 28px; }

.overview-section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}

.overview-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 16px;
  gap: 16px;
  align-items: start;
}

.col-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

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

.col-header-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.col-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.col-pagination-label {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
}

.col-pagination-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--duration-fast) var(--ease-standard);
}
.col-pagination-btn:hover:not(:disabled) { background: var(--bg-muted); }
.col-pagination-btn:disabled { opacity: 0.35; cursor: default; }

.col-content {
  flex: 1 1;
  padding: 16px;
}

.col-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Insight card */
.insight-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.4;
}

.insight-date {
  font-size: 11px;
  color: var(--text-muted);
  margin: 6px 0 10px;
}

.insight-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 14px;
}

.insight-action {
  font-size: 12px;
  color: var(--accent-text);
  font-weight: 500;
  padding: 6px 10px;
  background: var(--accent-subtle);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.comparison-bar-section { margin-top: 14px; }
.comparison-bar-title {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}
.comparison-bar-row { margin-bottom: 6px; }
.comparison-bar-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.comparison-bar-track {
  height: 7px;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.comparison-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width var(--duration-base) var(--ease-standard);
}

/* Timeline events */
.timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.timeline-select {
  flex: 1 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
}
.timeline-select:focus { outline: none; border-color: var(--accent); }

.timeline-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
  white-space: nowrap;
}
.timeline-add-btn:hover { background: var(--accent-hover); }

.timeline-month-group { margin-bottom: 16px; }
.timeline-month-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-event-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.timeline-event-item:hover { background: var(--bg-muted); margin: 0 -4px; padding: 8px 4px; border-radius: var(--radius-sm); }

.timeline-event-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 2px;
}

.timeline-event-body { flex: 1 1; min-width: 0; }
.timeline-event-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.timeline-event-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.timeline-event-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.timeline-event-date { font-size: 10px; color: var(--text-muted); }

/* Data column / mini chart */
.data-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.data-metric-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  line-height: 1.4;
}

.mini-chart-wrap {
  width: 100%;
  position: relative;
}

.mini-chart-svg {
  width: 100%;
  height: 110px;
  display: block;
}

.mini-chart-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  padding-right: 6px;
  height: 110px;
  text-align: right;
  min-width: 22px;
}

.mini-chart-xaxis {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-left: 28px;
}

/* ── Generic page header (h1 + subtitle on left, actions on right) ── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

/* ── Insights triage ─────────────────────────── */
.insights-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.triage-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.triage-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color var(--duration-fast);
  white-space: nowrap;
}
.triage-tab-btn:hover { color: var(--text); }
.triage-tab-btn-active {
  color: var(--accent-text);
  border-bottom-color: var(--accent);
}

.triage-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
}

.insight-unread-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  border-radius: 50%;
  background: #ef4444;
  margin-top: 1px;
}

.insight-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.insight-row-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Insight detail page */
.insight-detail-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 16px;
}

.insight-detail-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 12px;
}

.insight-detail-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* SVG sparkline chart in detail */
.insight-chart-wrap {
  width: 100%;
}

.insight-chart-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.insight-chart-svg {
  width: 100%;
  height: 140px;
  display: block;
}

/* Comparison scale */
.comparison-scale-wrap { margin-top: 4px; }

.comparison-scale-gradient {
  position: relative;
  height: 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(to right, #ef4444, #f59e0b, #10b981);
  margin-bottom: 6px;
}

.comparison-scale-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--topbar-bg);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.comparison-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.comparison-scale-farm-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 8px;
}

/* Action checklist */
.action-checklist { list-style: none; padding: 0; margin: 0; }

.action-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.action-checklist-item:last-child { border-bottom: none; }

.action-checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

.action-checklist-text {
  flex: 1 1;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
}

.action-checklist-deadline {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.action-checklist-done .action-checklist-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Insight detail action buttons */
.insight-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 20px;
}

.btn-primary-teal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: var(--text-on-teal);
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.btn-primary-teal:hover { background: var(--accent-hover); }

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

@media (max-width: 768px) {
  .overview-columns { grid-template-columns: 1fr; }
  .col-card { min-height: auto; }
}

/* ── Evidence chips (insight detail) ───────────── */
.evidence-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-muted);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
  letter-spacing: 0.02em;
}
.evidence-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}
.evidence-chip:active {
  background: var(--accent);
  color: white;
}

/* ── Analytics BI Dashboard ─────────────────────── */

.an-tab-bar {
  display: flex;
  align-items: center;
  gap: 1px;
  overflow-x: auto;
  border-bottom: 2px solid var(--border);
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.an-tab-bar::-webkit-scrollbar { display: none; }

.an-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--duration-fast);
}
.an-tab-btn:hover { color: var(--text); }
.an-tab-btn-active { color: var(--accent-text); border-bottom-color: var(--accent); }

.an-tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background var(--duration-fast), color var(--duration-fast);
  cursor: pointer;
}
.an-tab-close:hover { background: var(--border); color: var(--text); }

.an-tab-add {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
}
.an-tab-add:hover { color: var(--accent-text); }

.an-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 2px;
}

/* Chart card */
.an-chart-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.an-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 13px 13px 0;
  gap: 6px;
}

.an-chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.an-chart-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.an-chart-action-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background var(--duration-fast), color var(--duration-fast);
}
.an-chart-action-btn:hover { background: var(--bg-muted); color: var(--text); }

.an-chart-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  flex-wrap: wrap;
}

.an-chart-body {
  padding: 0 13px 13px;
}

/* Empty chart slot */
.an-empty-slot {
  background: var(--panel);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  min-height: 260px;
  transition: border-color var(--duration-base), background var(--duration-base);
  outline: none;
}
.an-empty-slot:hover, .an-empty-slot:focus-visible {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.an-empty-pictogram {
  position: relative;
  width: 96px;
  height: 68px;
  margin-bottom: 18px;
}

.an-empty-card-mock {
  position: absolute;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
}

.an-empty-card-back {
  width: 80px;
  height: 58px;
  top: 5px;
  left: 10px;
}

.an-empty-card-front {
  width: 80px;
  height: 58px;
  top: 0;
  left: 8px;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Dialog */
.an-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px 32px;
  overflow-y: auto;
}

.an-dialog {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(780px, 100%);
  max-height: 82vh;
  overflow-y: auto;
}

.an-dialog-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  z-index: 1;
}

.an-dialog-close {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--duration-fast);
}
.an-dialog-close:hover { background: var(--bg-muted); color: var(--text); }

.an-dialog-body { padding: 16px 20px 28px; }

.an-group-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 18px 0 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.an-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-gap: 10px;
  gap: 10px;
}

.an-metric-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px;
  cursor: pointer;
  text-align: left;
  background: var(--panel);
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.an-metric-card:hover { border-color: var(--accent); background: var(--accent-subtle); }

.an-metric-preview {
  height: 38px;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.an-metric-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.an-metric-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Soon state */
.an-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* ── Chart tooltip ──────────────────────────────── */
.insight-chart-tooltip {
  position: absolute;
  top: 2px;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ── Farm Timeline Page ─────────────────────────── */
.tl-page {
  display: grid;
  grid-template-columns: 2fr 3fr;
  grid-gap: 20px;
  gap: 20px;
  align-items: start;
  min-height: 0;
}

.tl-page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* Left column */
.tl-left {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 500px;
}
.tl-left-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.tl-left-body {
  padding: 12px 16px;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

/* Event item selected state */
.timeline-event-item--selected {
  background: var(--accent-subtle);
  margin: 0 -4px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  padding-left: 6px;
}
.timeline-event-item--selected .timeline-event-icon {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
}
.timeline-event-item--selected .timeline-event-title {
  color: var(--accent-text);
}

/* Right column — impact panel */
.tl-right {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.impact-panel-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.impact-panel-event-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.impact-panel-event-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  margin-top: 2px;
}
.impact-panel-event-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
  line-height: 1.3;
}
.impact-panel-event-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.impact-panel-source {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.impact-panel-body {
  padding: 16px 20px;
}

/* Potentially impacted metrics section */
.impact-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.impact-section-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.impact-beta-badge {
  font-size: 10px;
  font-weight: 600;
  background: var(--badge-beta-bg);
  color: var(--badge-beta-text);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  letter-spacing: 0.02em;
}

/* Statistical significance badges on MetricCompareCard */
.stat-sig-badge {
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  border: 1px solid;
  letter-spacing: 0.02em;
  cursor: default;
}
.stat-sig-badge--significant    { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.stat-sig-badge--not-significant { background: var(--bg-muted); border-color: var(--border); color: var(--text-muted); }
.stat-sig-badge--inconclusive   { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.impact-explain-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 12px;
}

/* Period range row */
.impact-period-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.impact-period-label {
  font-size: 11px;
  color: var(--text-muted);
}
.impact-period-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Window tabs */
.window-tabs {
  display: inline-flex;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
  margin-bottom: 14px;
}
.window-tab {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border: none;
  background: transparent;
  border-radius: 3px;
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
  white-space: nowrap;
}
.window-tab:hover { background: var(--panel); color: var(--text); }
.window-tab--active {
  background: var(--panel);
  color: var(--accent-text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Metrics grid */
.impact-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 10px;
  gap: 10px;
  margin-bottom: 16px;
}

/* Metric compare card */
.metric-card {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.metric-card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.metric-card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.metric-card-row-label {
  font-size: 11px;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
}
.metric-card-bar-wrap {
  flex: 1 1;
  position: relative;
  height: 22px;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 6px;
}
.metric-card-bar-bg-before {
  position: absolute;
  inset: 0;
  background: var(--info-bg);
  border-radius: 3px;
}
.metric-card-bar-bg-after {
  position: absolute;
  inset: 0;
  background: var(--accent);
  border-radius: 3px;
  opacity: 0.75;
}
.metric-card-bar-value {
  position: relative;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  z-index: 1;
}
.metric-card-delta-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 56px;
}
.metric-card-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.metric-card-delta--bad {
  background: var(--danger-bg);
  color: var(--danger-text);
}
.metric-card-delta--good {
  background: var(--success-bg);
  color: var(--success-text);
}
.metric-card-delta--neutral {
  background: var(--bg-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Add chart row */
.impact-add-chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.impact-add-chart-select {
  flex: 1 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
}
.impact-add-chart-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-fast);
  white-space: nowrap;
}
.impact-add-chart-btn:hover { background: var(--bg-muted); }

/* Other changes section */
.impact-other-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.impact-other-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.impact-other-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.other-changes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.other-changes-table th {
  text-align: left;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.other-changes-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.other-changes-table tr:last-child td { border-bottom: none; }
.other-changes-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}
.other-changes-delta--up { color: var(--success); }
.other-changes-delta--down { color: var(--danger); }
.other-changes-delta--neutral { color: var(--text-muted); }

/* Empty impact panel */
.impact-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px 24px;
}
.impact-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.impact-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 4px;
}
.impact-empty-sub {
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .tl-page { grid-template-columns: 1fr; }
  .impact-metrics-grid { grid-template-columns: 1fr; }
}

/* ── PWA / iOS / Touch / Safe area ──────────────── */

/* Remove iOS blue tap highlight everywhere */
* { -webkit-tap-highlight-color: transparent; }

/* Prevent overscroll bounce on chrome of the shell */
.topbar,
.sidebar,
.mobile-tab-bar { overscroll-behavior: none; }

/* Safe-area padding for notch / home bar */
.mobile-tab-bar {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(56px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 768px) {
  .shell-content {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  /* Compact FAB: 48×48 on mobile */
  .fab {
    width: 48px;
    height: 48px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
  /* Push toast above FAB safe area */
  .toast {
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── Touch target minimums (44×44px) ────────────── */
.nav-link,
.mobile-tab,
.button,
.triage-tab-btn,
.timeline-add-btn,
.topbar-btn-demo { min-height: 44px; }

.topbar-avatar {
  min-width: 44px;
  min-height: 44px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Remove hover effects on touch-only devices ─── */
@media (hover: none) and (pointer: coarse) {
  .nav-link:hover { background: transparent; color: var(--text-secondary); }
  .nav-link-active:hover { background: var(--sidebar-active); color: var(--sidebar-active-text); }
  .button:hover { background: var(--panel); }
  .button-primary:hover { background: var(--accent); border-color: var(--accent); }
  .button-secondary:hover { background: var(--bg-muted); }
  .fab:hover { background: var(--accent); transform: none; }
  .table tbody tr:hover { background: transparent; }
  .linked-action-card:hover { border-color: var(--border); background: var(--panel); }
  .mobile-tab:hover { color: var(--text-muted); }
  .mobile-tab-active:hover { color: var(--sidebar-active-text); }
  .topbar-btn-demo:hover { background: transparent; }
}

/* ── Mobile topbar: compact (logo + avatar only) ─── */
.topbar-mobile-logo {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.topbar-mobile-logo-mark {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

@media (max-width: 768px) {
  .topbar-breadcrumb { display: none; }
  .topbar-btn-demo { display: none; }
  .topbar-mobile-logo { display: flex; }
  .topbar { padding: 0 16px; }
}

/* ── Tablet: icon-only sidebar auto-collapse ─────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .shell:not(.shell-collapsed) {
    grid-template-columns: var(--sidebar-collapsed) 1fr;
  }
  .shell:not(.shell-collapsed) .sidebar-wordmark,
  .shell:not(.shell-collapsed) .nav-link-label { display: none; }
  .shell:not(.shell-collapsed) .sidebar-logo { justify-content: center; padding: 12px 8px; }
  .shell:not(.shell-collapsed) .sidebar-nav { padding: 8px 6px 0; }
  .shell:not(.shell-collapsed) .sidebar-bottom { padding: 4px 6px 12px; }
  .shell:not(.shell-collapsed) .nav-link { justify-content: center; padding: 9px 8px; }
}

/* ── Large screen: constrain content width ───────── */
@media (min-width: 1441px) {
  .shell-content { max-width: 1440px; margin: 0 auto; }
}

/* ── PWA: update-available banner ────────────────── */
.pwa-update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--topbar-bg);
  color: white;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.pwa-update-btn {
  margin-left: auto;
  padding: 5px 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  transition: background var(--duration-fast);
}
.pwa-update-btn:hover { background: var(--accent-hover); }

.pwa-update-dismiss {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  min-height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--duration-fast);
}
.pwa-update-dismiss:hover { color: white; }

/* ── PWA: install-prompt banner ──────────────────── */
.pwa-install-banner {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  left: 12px;
  right: 12px;
  z-index: 90;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-lg);
  gap: 12px;
}
@media (max-width: 768px) {
  .pwa-install-banner {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 8px);
  }
}
.pwa-install-content { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pwa-install-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.pwa-install-title { font-size: 13px; font-weight: 700; color: var(--text); }
.pwa-install-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pwa-install-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pwa-install-btn {
  padding: 7px 16px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--duration-fast);
  white-space: nowrap;
}
.pwa-install-btn:hover { background: var(--accent-hover); }

/* ── Add Event FAB + Dialog (MVP-N07) ───────────── */

/* FAB pulse on click */
@keyframes fab-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.fab--pulse { animation: fab-pulse 350ms var(--ease-standard) forwards; }

/* Dialog overlay */
.ae-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 24px 32px;
  overflow-y: auto;
}

/* Dialog container */
@keyframes ae-slide-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ae-dialog {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  animation: ae-slide-in 200ms var(--ease-standard);
}

.ae-dialog-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
}

.ae-dialog-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.ae-dialog-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ae-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* Form fields */
.ae-field { display: flex; flex-direction: column; gap: 5px; }
.ae-field--half { max-width: 200px; }
.ae-row { display: flex; gap: 12px; flex-wrap: wrap; }
.ae-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.ae-required { color: var(--danger); }
.ae-textarea { resize: vertical; min-height: 72px; }
.ae-error { font-size: 13px; color: var(--danger); margin: 0; }

/* Event type grid */
.ae-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  grid-gap: 6px;
  gap: 6px;
}

.ae-type-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  transition: border-color var(--duration-fast), background var(--duration-fast), color var(--duration-fast);
  text-align: left;
}
.ae-type-btn:hover { border-color: var(--accent); background: var(--accent-subtle); }
.ae-type-btn--active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent-text);
  font-weight: 600;
}
.ae-type-emoji { font-size: 15px; line-height: 1; flex-shrink: 0; }
.ae-type-label { line-height: 1.3; }

/* Affected groups chips */
.ae-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.ae-group-chip {
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--duration-fast), background var(--duration-fast);
}
.ae-group-chip:hover { border-color: var(--accent); background: var(--accent-subtle); }
.ae-group-chip--active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

/* File attach stub */
.ae-attach-stub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12px;
  cursor: not-allowed;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

/* Success toast override */
.ae-toast-success { background: #0f766e; }

/* ── Toggle switch (MVP-N09) ─────────────────────── */
.toggle-track {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--border-strong);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--duration-fast) var(--ease-standard);
  padding: 0;
}
.toggle-track.toggle-on { background: var(--accent); }
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform var(--duration-fast) var(--ease-standard);
  pointer-events: none;
}
.toggle-on .toggle-thumb { transform: translateX(16px); }

/* ── Settings page (MVP-N09) ─────────────────────── */
.settings-section { margin-bottom: 28px; }
.settings-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.settings-section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.5;
}
.settings-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.settings-field-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.settings-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 4px;
}
.settings-field-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.settings-field-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: default;
}
.settings-notif-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.settings-notif-table th {
  padding: 9px 18px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.settings-notif-table th:last-child { text-align: right; }
.settings-notif-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.settings-notif-table td:last-child { text-align: right; }
.settings-notif-table tr:last-child td { border-bottom: none; }
.settings-briefing-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px;
}
.settings-briefing-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.settings-briefing-badge {
  font-size: 11px;
  font-weight: 500;
  background: var(--badge-beta-bg);
  color: var(--badge-beta-text);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  vertical-align: middle;
}
.settings-briefing-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.settings-integrations-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.settings-integrations-table th {
  padding: 9px 18px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.settings-integrations-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.settings-integrations-table tr:last-child td { border-bottom: none; }
.settings-soon-pictogram {
  opacity: 0.3;
  margin-bottom: 16px;
  color: var(--text-muted);
}

/* ── Connections page (MVP-N09) ──────────────────── */
.connections-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.btn-outline-teal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-standard);
  min-height: 36px;
}
.btn-outline-teal:hover { background: var(--accent-subtle); }

/* Mobile: bottom drawer */
@media (max-width: 768px) {
  .ae-overlay {
    align-items: flex-end;
    padding: 0;
    overflow-y: hidden;
  }

  @keyframes ae-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  .ae-dialog {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-height: 90vh;
    animation: ae-slide-up 280ms var(--ease-standard);
  }

  .ae-type-grid { grid-template-columns: repeat(2, 1fr); }
  .ae-field--half { max-width: 100%; }
}

/* ── Animal Profile ──────────────────────────────── */
.profile-hero {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 0;
}

.profile-hero-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.profile-hero-name {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.profile-hero-id {
  opacity: 0.75;
  font-weight: 600;
}

.profile-hero-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.profile-hero-badges {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.profile-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: none;
}
.profile-badge--danger  { background: #fecaca; color: #b91c1c; }
.profile-badge--warning { background: #fef3c7; color: #92400e; }
.profile-badge--success { background: #d1fae5; color: #065f46; }

.profile-tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
  gap: 0;
}

.profile-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.profile-tab:hover { color: var(--text-secondary); }

.profile-tab--active {
  color: #0d9488;
  border-bottom-color: #0d9488;
}

.profile-metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 12px;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-metric-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid #0d9488;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.profile-metric-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 4px;
}

.profile-metric-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1;
}
.profile-metric-value--bad  { color: var(--danger); }
.profile-metric-value--warn { color: var(--warning); }
.profile-metric-value--ok   { color: var(--success); }

.profile-metric-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.profile-alert-card {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.profile-alert-title {
  font-size: 13px;
  font-weight: 600;
  color: #991b1b;
  margin: 0 0 4px;
}

.profile-alert-meta {
  font-size: 11px;
  color: #b91c1c;
  margin: 0;
}

.profile-kv-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.profile-kv-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}

.profile-kv-title--spaced { margin-top: 12px; }

.profile-kv-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
.profile-kv-row:last-child { border-bottom: none; }
.profile-kv-key { color: var(--text-muted); }

.profile-task-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
.profile-task-row:last-child { border-bottom: none; }

.profile-task-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.profile-task-dot--high   { background: var(--danger); }
.profile-task-dot--medium { background: var(--warning); }
.profile-task-dot--low    { background: var(--success); }

.profile-task-title { font-weight: 500; color: var(--text); margin-bottom: 2px; }
.profile-task-meta  { font-size: 11px; color: var(--text-muted); }
.profile-task-overdue { color: var(--danger); font-weight: 600; }

.profile-history-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
}
.profile-history-row:last-child { border-bottom: none; }

.profile-history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  background: var(--success);
}
.profile-history-dot--resolved { background: var(--text-muted); }

.profile-history-title { font-weight: 500; color: var(--text); margin-bottom: 2px; }
.profile-history-meta  { font-size: 11px; color: var(--text-muted); }

.profile-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 0;
}

/* ── Skeleton loading ────────────────────────────── */
@keyframes shimmer {
  from { background-position: -400px 0; }
  to   { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--border) 50%, var(--bg-muted) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text {
  height: 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.skeleton-text--sm { height: 11px; }
.skeleton-text--lg { height: 18px; }
.skeleton-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.skeleton-row:last-child { border-bottom: none; }
.skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}
.skeleton-lines { flex: 1 1; display: flex; flex-direction: column; gap: 6px; }

/* ── Informative empty state ─────────────────────── */
.empty-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 0;
}
.empty-illustration-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  margin-bottom: 16px;
}
.empty-illustration-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}
.empty-illustration-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 0 20px;
}

/* ── Analytics mobile ────────────────────────────── */
@media (max-width: 768px) {
  .an-tab-bar {
    max-width: 100%;
  }
  .an-toolbar {
    gap: 4px;
  }
  .an-toolbar .button,
  .an-toolbar button {
    font-size: 11px;
    padding: 4px 8px;
  }
}

@media (max-width: 640px) {
  .an-tab-bar { padding-bottom: 2px; }
  .an-tab-btn { padding: 6px 10px; font-size: 12px; }
  .an-metric-grid { grid-template-columns: 1fr; }
  .an-dialog { max-height: 92vh; }
  .an-dialog-overlay { padding: 32px 12px 16px; }
}

/* ── Connections / Import page ───────────────────── */
.import-page {
  max-width: 640px;
}
.import-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}
.import-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.import-step--active { color: var(--accent-text); font-weight: 600; }
.import-step--done   { color: var(--success); }
.import-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-muted);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}
.import-step--active .import-step-num {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.import-step--done .import-step-num {
  background: var(--success);
  border-color: var(--success);
  color: white;
}
.import-step-divider {
  flex: 1 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
  max-width: 40px;
}
.import-provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-gap: 10px;
  gap: 10px;
  margin-bottom: 20px;
}
.import-provider-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  text-align: center;
  background: var(--panel);
  transition: border-color var(--duration-fast), background var(--duration-fast), box-shadow var(--duration-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.import-provider-card:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: var(--shadow);
}
.import-provider-card--active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.import-provider-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.import-provider-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.import-provider-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.import-form-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}
.import-field { display: flex; flex-direction: column; gap: 5px; }
.import-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.import-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .import-provider-grid { grid-template-columns: repeat(2, 1fr); }
  .import-footer { flex-direction: column-reverse; }
  .import-footer .button,
  .import-footer .btn-outline-teal,
  .import-footer .button-primary { width: 100%; justify-content: center; }
}

/* === AI Observability (P0-1) === */
.period-tabs { display: flex; gap: 4px; }
.period-tab { padding: 6px 12px; border: 1px solid #ddd; background: #fff; cursor: pointer; }
.period-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.action-row { display: flex; gap: 12px; flex-wrap: wrap; }
.action-row button { padding: 8px 16px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
.action-row button:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.action-row button:disabled { opacity: 0.6; cursor: wait; }
.big-number { font-size: 48px; font-weight: 600; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(640px, 90vw); background: #fff; overflow-y: auto; box-shadow: -2px 0 16px rgba(0,0,0,0.2); }
.drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid #eee; }
.drawer-body { padding: 16px; }
.trace-pre { background: #f5f5f5; padding: 12px; border-radius: 4px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.mono { font-family: ui-monospace, monospace; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover { background: rgba(26, 115, 232, 0.08); }

/* /feeding page (P1-3b) — minimal scaffold styles */
.page-head { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.breadcrumbs { display: flex; gap: 0.25rem; font-size: 0.85em; color: var(--text-secondary); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); grid-gap: 0.75rem; gap: 0.75rem; }
.card-dl { margin: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.card-dl > div { display: flex; justify-content: space-between; font-size: 0.9rem; }
.card-dl dt { color: var(--text-secondary); }

