/* ── Reset & Base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #0C0E13;
  --bg-card:      #13161D;
  --bg-hover:     #191C25;
  --bg-input:     #0F1219;
  --border:       #252A3A;
  --border-hover: #363D55;
  --accent:       #5B8FF8;
  --accent-dim:   rgba(91, 143, 248, 0.14);
  --accent-glow:  rgba(91, 143, 248, 0.28);
  --fg:           #E8EDF8;
  --fg-muted:     #8B95B0;
  --fg-sub:       #555F7A;
  --green:        #3ECFA0;
  --yellow:       #E8B84B;
  --red:          #F05B6A;
  --green-dim:    rgba(62, 207, 160, 0.12);
  --yellow-dim:   rgba(232, 184, 75, 0.12);
  --red-dim:      rgba(240, 91, 106, 0.12);
  --sidebar-w:    220px;
  --radius:       8px;
  --radius-sm:    5px;
  --font:         'Outfit', sans-serif;
  --mono:         'JetBrains Mono', monospace;
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── App Layout ───────────────────────────────── */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
}

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

.brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
}

.nav {
  flex: 1;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: #7A84A0;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--fg);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.nav-item svg { flex-shrink: 0; opacity: 0.8; }
.nav-item.active svg { opacity: 1; }

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  transition: background 0.3s;
}

.status-dot.loading { background: var(--yellow); animation: pulse 1s infinite; }
.status-dot.error   { background: var(--red); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.status-label {
  font-size: 12px;
  color: var(--fg-muted);
  font-family: var(--mono);
}

/* ── Main ─────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Custom scrollbar */
.main::-webkit-scrollbar { width: 5px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9px; }

/* ── Page Header ──────────────────────────────── */
.page-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--border);
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--fg-muted);
  margin-top: 3px;
}

/* ── Content Area ─────────────────────────────── */
.page-content {
  padding: 24px 32px;
  flex: 1;
}

/* ── Cards ────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--border-hover); }

/* ── Today View ───────────────────────────────── */
.today-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 300;
  color: var(--fg);
  font-family: var(--mono);
  line-height: 1;
}

.stat-value.urgent { color: var(--red); }
.stat-value.doing  { color: var(--accent); }

.section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #7A84A0;
  margin-bottom: 12px;
}

.task-list { display: flex; flex-direction: column; gap: 6px; }

/* ── Task Card ────────────────────────────────── */
.task-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}

.task-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.task-card.done { opacity: 0.45; }

.task-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.task-status-btn {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--border-hover);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-status-btn:hover { border-color: var(--accent); }
.task-status-btn.doing { border-color: var(--accent); background: var(--accent-dim); }
.task-status-btn.done  { border-color: var(--green); background: var(--green); }
.task-status-btn.done::after { content: '✓'; font-size: 9px; color: var(--bg); font-weight: 700; }

.task-main { flex: 1; min-width: 0; }

.task-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.35;
  margin-bottom: 5px;
}

.task-card.done .task-title { text-decoration: line-through; color: var(--fg-muted); }

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 99px;
  font-family: var(--mono);
}

.badge-project { background: var(--accent-dim); color: var(--accent); }
.badge-person  { background: rgba(255,255,255,0.05); color: var(--fg-muted); }
.badge-deadline.overdue { background: var(--red-dim); color: var(--red); }
.badge-deadline.today   { background: var(--yellow-dim); color: var(--yellow); }
.badge-deadline.soon    { background: var(--accent-dim); color: var(--accent); }
.badge-deadline.future  { background: transparent; color: var(--fg-sub); border: 1px solid var(--border); }

.priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}

.priority-dot.alta  { background: var(--red); }
.priority-dot.media { background: var(--yellow); }
.priority-dot.bassa { background: var(--fg-sub); }

.task-description {
  font-size: 12.5px;
  color: var(--fg-muted);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  line-height: 1.5;
  display: none;
}

.task-card.expanded .task-description { display: block; }

.task-actions {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.task-card.expanded .task-actions { display: flex; }

.btn-sm {
  font-size: 11px;
  font-family: var(--mono);
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sm:hover { border-color: var(--border-hover); color: var(--fg); }
.btn-sm.danger:hover { border-color: var(--red); color: var(--red); }
.btn-sm.accent:hover { border-color: var(--accent); color: var(--accent); }

/* ── Filters ──────────────────────────────────── */
.filters {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-btn {
  font-size: 12px;
  font-family: var(--mono);
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: transparent;
  color: #8B95B0;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover { border-color: var(--border-hover); color: var(--fg); }
.filter-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ── Capture View ─────────────────────────────── */
.capture-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.capture-textarea {
  width: 100%;
  min-height: 220px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.capture-textarea:focus { border-color: var(--accent); }
.capture-textarea.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.capture-textarea::placeholder { color: var(--fg-sub); }

.capture-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.char-hint {
  font-size: 12px;
  color: var(--fg-sub);
  font-family: var(--mono);
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Extraction Result ────────────────────────── */
.extraction-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.extraction-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(75,130,245,0.05);
}

.extraction-summary {
  font-size: 13px;
  color: var(--fg);
}

.extraction-counts {
  display: flex;
  gap: 12px;
}

.count-badge {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--fg-muted);
}

.count-badge span { color: var(--accent); font-weight: 600; }

.extracted-items {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.extracted-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.item-type-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  margin-top: 1px;
}

.item-type-icon.task    { background: var(--accent-dim); color: var(--accent); }
.item-type-icon.context { background: rgba(255,255,255,0.05); color: var(--fg-muted); }

.item-content { flex: 1; }
.item-title { color: var(--fg); font-weight: 500; }
.item-detail { color: var(--fg-muted); font-size: 12px; margin-top: 2px; }

/* ── Archive View ─────────────────────────────── */
.archive-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.context-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.15s;
}

.context-card:hover { border-color: var(--border-hover); }

.context-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.type-chip {
  font-size: 10px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 500;
}

.type-chip.nota      { background: rgba(255,255,255,0.06); color: var(--fg-muted); }
.type-chip.progetto  { background: var(--accent-dim); color: var(--accent); }
.type-chip.persona   { background: rgba(62,207,160,0.1); color: var(--green); }
.type-chip.decisione { background: var(--yellow-dim); color: var(--yellow); }

.context-date {
  font-size: 11px;
  color: var(--fg-sub);
  font-family: var(--mono);
  margin-left: auto;
}

.context-content {
  font-size: 13.5px;
  color: var(--fg);
  line-height: 1.55;
}

.context-related {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

/* ── Chat View ────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 100px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9px; }

.msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono);
}

.msg.user .msg-avatar { background: var(--accent-dim); color: var(--accent); margin-left: auto; }
.msg.ai   .msg-avatar { background: var(--bg-card); color: var(--fg-muted); border: 1px solid var(--border); }

.msg.user { flex-direction: row-reverse; }

.msg-body {
  max-width: 80%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg);
}

.msg.user .msg-body {
  background: var(--accent-dim);
  border-color: rgba(75,130,245,0.2);
}

.msg-body p + p { margin-top: 8px; }

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s;
}

.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--fg-sub); }

/* ── Empty State ──────────────────────────────── */
.empty-state {
  padding: 48px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.empty-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-sub);
  margin-bottom: 4px;
}

.empty-title { font-size: 14px; color: var(--fg-muted); font-weight: 500; }
.empty-sub   { font-size: 12.5px; color: var(--fg-sub); }

/* ── Toast ────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideUp 0.2s ease;
  max-width: 320px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--accent); }

@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Loading ──────────────────────────────────── */
.loading-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--fg-muted);
  font-size: 13px;
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.inline-loader {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  font-size: 12px;
}

.inline-loader .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.2s ease-in-out infinite;
}

.inline-loader .dot:nth-child(2) { animation-delay: 0.2s; }
.inline-loader .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink { 0%,80%,100% { opacity: 0.2; } 40% { opacity: 1; } }

/* ── Divider ──────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── Scrollable area ──────────────────────────── */
textarea::-webkit-scrollbar { width: 4px; }
textarea::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9px; }

/* ── No tasks in section ──────────────────────── */
.no-items {
  padding: 20px 0;
  text-align: center;
  color: var(--fg-sub);
  font-size: 13px;
}

/* ── File Attachments ─────────────────────────── */
.capture-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.capture-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-attach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-family: var(--font);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: #8B95B0;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.btn-attach:hover { border-color: var(--border-hover); color: var(--fg); }

.attachments-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-thumb {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  max-width: 200px;
}

.attachment-thumb img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.att-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.att-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg);
  font-size: 12px;
}

.att-type {
  font-size: 10px;
  color: var(--fg-muted);
  font-family: var(--mono);
}

.att-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.att-remove:hover { background: var(--red); border-color: var(--red); color: white; }

.pdf-icon {
  width: 38px;
  height: 38px;
  background: var(--red-dim);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--red);
  font-family: var(--mono);
  flex-shrink: 0;
}

/* ── Page header top row ──────────────────────── */
.page-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.header-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding-top: 2px;
}

/* ── Task sections ────────────────────────────── */
.task-section {
  margin-bottom: 24px;
}

/* ── Done section collapsible ─────────────────── */
.done-section {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.done-summary {
  padding: 11px 15px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.done-summary::-webkit-details-marker { display: none; }
.done-summary:hover { color: var(--fg); }
.done-section[open] .done-summary { border-bottom: 1px solid var(--border); }
.done-section > .task-list { padding: 8px; }

/* ── Urgent badge in sidebar ──────────────────── */
.nav-item { position: relative; }

.urgent-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  border-radius: 99px;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* ── Task overlay ─────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.overlay.open {
  pointer-events: all;
  opacity: 1;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.overlay-panel {
  position: relative;
  width: 420px;
  max-width: 92vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 24px;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}

.overlay.open .overlay-panel {
  transform: translateX(0);
}

.overlay-panel::-webkit-scrollbar { width: 4px; }
.overlay-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9px; }

.overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.overlay-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
}

.overlay-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.35;
  margin: 0;
}

.overlay-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.overlay-close:hover { border-color: var(--border-hover); color: var(--fg); }

.overlay-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.overlay-section {
  margin-bottom: 20px;
}

.overlay-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin-bottom: 8px;
}

.overlay-section-body {
  font-size: 13.5px;
  color: var(--fg);
  line-height: 1.6;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.overlay-notes {
  width: 100%;
  min-height: 100px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.overlay-notes:focus { border-color: var(--accent); }
.overlay-notes::placeholder { color: var(--fg-sub); }

.overlay-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 4px;
}

/* ── Chat page layout ─────────────────────────── */
.chat-page-content {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 97px);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}

/* ── Overlay editable fields ──────────────────── */
.overlay-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.field-row { display: flex; flex-direction: column; gap: 5px; }

.field-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.field-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.field-input:focus { border-color: var(--accent); }
.field-input::placeholder { color: var(--fg-sub); }

/* date input */
.field-input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.5);
  cursor: pointer;
}

select.field-input { cursor: pointer; }

.field-textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  color: var(--fg);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  min-height: 72px;
  width: 100%;
  transition: border-color 0.15s;
}

.field-textarea:focus { border-color: var(--accent); }
.field-textarea::placeholder { color: var(--fg-sub); }

.field-static {
  font-size: 13px;
  color: var(--fg-muted);
  padding: 8px 0;
  font-family: var(--mono);
}
