/* ═══════════════════════════════════════════════════════════
   Mikoshi BidWriter — Dark Theme
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0a0808;
  --bg-sidebar: #0d0b0a;
  --bg-card: #14100e;
  --bg-card-hover: #1a1614;
  --bg-input: #1a1614;
  --bg-modal: #14100e;
  --border: #2a2420;
  --border-focus: #f59e0b;
  --text: #d4cdc6;
  --text-dim: #7a7268;
  --text-bright: #f5f0eb;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-glow: rgba(245, 158, 11, 0.15);
  --accent-subtle: rgba(245, 158, 11, 0.08);
  --green: #10b981;
  --red: #ef4444;
  --blue: #3b82f6;
  --purple: #a855f7;
  --orange: #f59e0b;
  --yellow: #eab308;
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-width: 260px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
}

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

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
}

body {
  display: flex;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ─── Sidebar ─────────────────────────────────────────────── */

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: width 0.25s ease, min-width 0.25s ease;
  overflow: hidden;
  z-index: 100;
}

.sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-provider .provider-name,
.sidebar.collapsed .nav-divider { display: none; }

.sidebar.collapsed .nav-item { justify-content: center; padding: 12px; }
.sidebar.collapsed .sidebar-header { justify-content: center; padding: 16px 8px; }
.sidebar.collapsed .sidebar-toggle { margin: 0; }

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

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 24px;
  line-height: 1;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-brand {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.logo-product {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.3px;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.sidebar-toggle:hover {
  color: var(--text-bright);
  background: var(--accent-subtle);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 12px 4px;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.nav-item:hover {
  color: var(--text);
  background: var(--accent-subtle);
}

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

.nav-item svg { flex-shrink: 0; }
.nav-item.active svg { stroke: var(--accent); }

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

.sidebar-provider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.provider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

/* ─── Main Content ────────────────────────────────────────── */

.main-content {
  flex: 1;
  overflow-y: auto;
  height: 100vh;
}

.app-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
  min-height: 100%;
}

/* ─── Loading ─────────────────────────────────────────────── */

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60vh;
  gap: 16px;
  color: var(--text-dim);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Page Header ─────────────────────────────────────────── */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.5px;
}

.page-header h1 .accent { color: var(--accent); }

/* ─── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { background: var(--bg-card-hover); border-color: var(--text-dim); }

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-danger {
  color: var(--red);
  border-color: rgba(239,68,68,0.3);
}

.btn-danger:hover {
  background: rgba(239,68,68,0.1);
  border-color: var(--red);
}

.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 4px 10px; font-size: 11px; }
.btn-icon { padding: 8px; }

.btn:disabled, .btn.loading {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ─── Cards ───────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}

.card:hover { border-color: rgba(245,158,11,0.2); }
.card-header { margin-bottom: 16px; }

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-dim);
}

/* ─── Proposal Cards (Dashboard) ──────────────────────────── */

.proposals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.proposal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.proposal-card:hover {
  border-color: rgba(245,158,11,0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.proposal-card .proposal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.proposal-card .proposal-meta {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.proposal-card .proposal-actions {
  display: flex;
  gap: 6px;
  position: absolute;
  top: 16px;
  right: 16px;
  opacity: 0;
  transition: opacity 0.15s;
}

.proposal-card:hover .proposal-actions { opacity: 1; }

/* ─── Status Badges ───────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid;
}

.badge-draft { color: var(--text-dim); border-color: var(--border); background: rgba(255,255,255,0.03); }
.badge-progress { color: var(--blue); border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.08); }
.badge-complete { color: var(--green); border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.08); }
.badge-submitted { color: var(--purple); border-color: rgba(168,85,247,0.3); background: rgba(168,85,247,0.08); }

/* ─── Forms ───────────────────────────────────────────────── */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7268' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ─── Tabs ────────────────────────────────────────────────── */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  gap: 0;
}

.tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: var(--font);
}

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

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Streaming Output ────────────────────────────────────── */

.stream-output {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  min-height: 200px;
  max-height: 600px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.stream-output h1, .stream-output h2, .stream-output h3 {
  color: var(--accent);
  margin: 16px 0 8px;
}

.stream-output .cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink { 50% { opacity: 0; } }

/* ─── Budget Table ────────────────────────────────────────── */

.budget-table {
  width: 100%;
  border-collapse: collapse;
}

.budget-table th, .budget-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.budget-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  background: var(--bg-input);
}

.budget-table td { color: var(--text); }

.budget-table .total-row {
  font-weight: 600;
  color: var(--text-bright);
  background: var(--accent-subtle);
}

.budget-table input {
  width: 100%;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.budget-table input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ─── Gantt Chart ─────────────────────────────────────────── */

.gantt-container {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.gantt-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.gantt-label-col { width: 200px; min-width: 200px; font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; }
.gantt-timeline { flex: 1; display: flex; }
.gantt-month { flex: 1; min-width: 40px; text-align: center; font-size: 10px; color: var(--text-dim); }

.gantt-row {
  display: flex;
  align-items: center;
  min-height: 36px;
  border-bottom: 1px solid rgba(42,36,32,0.5);
}

.gantt-row-label {
  width: 200px;
  min-width: 200px;
  font-size: 13px;
  color: var(--text);
  padding-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gantt-row-bars { flex: 1; position: relative; height: 24px; }

.gantt-bar {
  position: absolute;
  height: 20px;
  top: 2px;
  border-radius: 4px;
  font-size: 10px;
  color: #000;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s;
}

.gantt-bar:hover { opacity: 0.85; }

.gantt-bar.wp { background: var(--accent); }
.gantt-bar.milestone { background: var(--green); width: 20px !important; border-radius: 50%; }
.gantt-bar.deliverable { background: var(--blue); }

/* ─── Compliance ──────────────────────────────────────────── */

.compliance-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.compliance-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
}

.compliance-icon.pass { background: rgba(16,185,129,0.15); color: var(--green); }
.compliance-icon.warn { background: rgba(245,158,11,0.15); color: var(--orange); }
.compliance-icon.fail { background: rgba(239,68,68,0.15); color: var(--red); }

.compliance-content { flex: 1; }
.compliance-check { font-size: 13px; font-weight: 600; color: var(--text-bright); margin-bottom: 2px; }
.compliance-message { font-size: 12px; color: var(--text-dim); }
.compliance-advice { font-size: 12px; color: var(--accent); margin-top: 4px; font-style: italic; }

/* ─── Modal ───────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ─── Toast ───────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-bright);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 400px;
}

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

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

/* ─── Templates Page ──────────────────────────────────────── */

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: rgba(245,158,11,0.3);
  transform: translateY(-2px);
}

.template-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.template-full-name {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.template-schemes {
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
}

.template-priorities {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.template-priorities .tag {
  font-size: 10px;
  padding: 2px 8px;
  background: var(--accent-subtle);
  border-radius: 100px;
  color: var(--text-dim);
}

/* ─── Settings ────────────────────────────────────────────── */

.settings-section {
  margin-bottom: 32px;
}

.settings-section h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.provider-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.provider-option {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.provider-option:hover { border-color: var(--text-dim); }

.provider-option.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

.provider-option .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.provider-option .desc {
  font-size: 11px;
  color: var(--text-dim);
}

.provider-option .free-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(16,185,129,0.15);
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
  border-radius: 100px;
  margin-top: 8px;
}

/* ─── Empty State ─────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-dim);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* ─── Editor Layout ───────────────────────────────────────── */

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.editor-title-input {
  background: transparent;
  border: none;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-bright);
  width: 100%;
  max-width: 600px;
  padding: 4px 0;
  font-family: var(--font);
}

.editor-title-input:focus { outline: none; }
.editor-title-input::placeholder { color: var(--text-dim); }

.editor-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── Version History ─────────────────────────────────────── */

.version-list {
  max-height: 400px;
  overflow-y: auto;
}

.version-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.version-item:hover { background: var(--accent-subtle); }

.version-time {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.version-label {
  font-size: 13px;
  color: var(--text);
  margin-left: 12px;
  flex: 1;
}

/* ─── Progress Bar ────────────────────────────────────────── */

.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}

/* ─── Papers (Literature) ─────────────────────────────────── */

.paper-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.paper-item:hover { background: var(--accent-subtle); }
.paper-item.selected { background: var(--accent-subtle); border-left: 3px solid var(--accent); }

.paper-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 4px;
}

.paper-authors {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.paper-meta {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  gap: 12px;
}

/* ─── Notes & Comments ────────────────────────────────────── */

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

.note-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.note-item:last-child { border-bottom: none; }

.note-time {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--mono);
}

/* ─── Filter / Search Bar ─────────────────────────────────── */

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-select {
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7268' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ─── Responsive ──────────────────────────────────────────── */

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 150;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: background 0.2s;
}
.mobile-menu-btn:hover { background: var(--bg-hover); }

@media (max-width: 900px) {
  .mobile-menu-btn { display: block; }
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    width: 260px;
    min-width: 260px;
    z-index: 200;
    transition: left 0.3s ease;
    box-shadow: none;
  }
  .sidebar.collapsed {
    left: -280px;
    width: 260px;
    min-width: 260px;
  }
  .sidebar:not(.collapsed) {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
  }
  .sidebar-overlay.active { display: block; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .proposals-grid { grid-template-columns: 1fr; }
  .templates-grid { grid-template-columns: 1fr; }
  .provider-options { grid-template-columns: 1fr; }
  .app-container { padding: 16px; padding-top: 60px; margin-left: 0 !important; }
}

@media (max-width: 600px) {
  .tabs { gap: 0; flex-wrap: wrap; }
  .tab { padding: 10px 12px; font-size: 12px; }
  .page-header h1 { font-size: 20px; }
}
