/* ===== DASHBOARD LAYOUT ===== */
.dash-body {
  display: flex;
  min-height: 100vh;
  background: #f5f4fb;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 0.5px solid rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  font-size: 18px;
  font-weight: 700;
  padding: 0 20px 24px;
  border-bottom: 0.5px solid rgba(0,0,0,0.07);
  margin-bottom: 12px;
}
.sidebar-logo span { color: var(--purple); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--bg2); color: var(--text); }
.nav-item.active { background: var(--purple-light); color: var(--purple-dark); }
.nav-icon { font-size: 15px; width: 20px; text-align: center; }

.sidebar-plan {
  padding: 16px 16px;
  margin: 12px 10px 0;
  background: var(--bg2);
  border-radius: 10px;
  border: 0.5px solid rgba(0,0,0,0.07);
}
.plan-badge { font-size: 11px; font-weight: 600; color: var(--purple); margin-bottom: 6px; }
.plan-usage { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.plan-bar { height: 4px; background: rgba(0,0,0,0.08); border-radius: 99px; margin-bottom: 12px; }
.plan-fill { height: 100%; background: var(--purple); border-radius: 99px; }
.btn-upgrade {
  display: block;
  text-align: center;
  background: var(--purple);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px;
  border-radius: 7px;
  transition: background 0.15s;
}
.btn-upgrade:hover { background: var(--purple-dark); }

/* ===== MAIN ===== */
.dash-main { flex: 1; padding: 28px 32px; overflow-y: auto; max-width: 1100px; }

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}
.dash-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.dash-header p { font-size: 13px; color: var(--text-muted); }

.dash-tabs { display: flex; gap: 4px; background: #fff; border: 0.5px solid rgba(0,0,0,0.1); border-radius: 10px; padding: 4px; }

.dash-tab {
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
}
.dash-tab.active { background: var(--purple); color: #fff; }
.dash-tab:not(.active):hover { background: var(--bg2); color: var(--text); }

/* ===== GRID ===== */
.dash-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }

/* ===== PANEL CARD ===== */
.panel-card {
  background: #fff;
  border: 0.5px solid rgba(0,0,0,0.09);
  border-radius: 14px;
  padding: 22px;
}

/* ===== FORM ELEMENTS ===== */
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}
.required { color: #E24B4A; }

textarea, select, input[type="text"] {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: #f8f7fc;
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: 9px;
  padding: 10px 12px;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  resize: vertical;
}
textarea:focus, select:focus, input:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(83,74,183,0.08);
  background: #fff;
}
select { resize: none; cursor: pointer; }

/* ===== TONE BUTTONS ===== */
.tone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tone-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 10px;
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  background: #f8f7fc;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
}
.tone-btn:hover { background: var(--purple-light); color: var(--purple-dark); border-color: var(--purple); }
.tone-btn.active { background: var(--purple); color: #fff; border-color: var(--purple); }

/* ===== GENERATE BUTTON ===== */
.btn-generate {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-generate:hover { background: var(--purple-dark); transform: translateY(-1px); }
.btn-generate:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ===== OUTPUT PANEL ===== */
.placeholder-content { text-align: center; padding: 48px 24px; }
.placeholder-icon { font-size: 36px; margin-bottom: 16px; }
.placeholder-content h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.placeholder-content p { font-size: 13px; color: var(--text-muted); }

.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.output-meta { display: flex; align-items: center; gap: 10px; }
.output-badge {
  background: var(--purple-light);
  color: var(--purple-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
}
.word-counter { font-size: 12px; color: var(--text-muted); }

.output-actions { display: flex; gap: 8px; }
.action-btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border: 0.5px solid rgba(0,0,0,0.12);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s;
}
.action-btn:hover { background: var(--bg2); }

.proposal-output {
  width: 100%;
  font-size: 13px;
  line-height: 1.8;
  border: 0.5px solid var(--purple);
  border-radius: 9px;
  padding: 14px;
  background: #fafbff;
  resize: vertical;
}

.output-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}
.footer-tip { font-size: 11px; color: var(--text-muted); }

.btn-primary-sm {
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.12s;
}
.btn-primary-sm:hover { background: var(--purple-dark); }

/* ===== PDF PREVIEW ===== */
.pdf-doc {
  background: #fff;
  border: 0.5px solid rgba(0,0,0,0.1);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
}

.pdf-top {
  background: var(--purple);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.pdf-logo-area { font-size: 18px; font-weight: 700; color: #fff; }
.pdf-logo-area span { color: #AFA9EC; }

.pdf-meta { display: flex; gap: 20px; }
.pdf-meta-item { text-align: right; }
.pdf-meta-item span { display: block; font-size: 10px; color: rgba(255,255,255,0.6); margin-bottom: 2px; }
.pdf-meta-item strong { font-size: 12px; color: #fff; }

.pdf-title-area { padding: 20px 24px 0; }
.pdf-doc-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.pdf-doc-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.pdf-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0 24px 20px;
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
}
.pdf-stat { background: #f5f4fb; border-radius: 10px; padding: 12px; }
.pdf-stat-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.pdf-stat-val { font-size: 16px; font-weight: 700; color: var(--text); }
.pdf-stat-val.green { color: var(--teal); }
.pdf-stat-val.purple { color: var(--purple); }

.pdf-section { padding: 16px 24px; border-bottom: 0.5px solid rgba(0,0,0,0.07); }
.pdf-section:last-of-type { border-bottom: none; }
.pdf-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 10px; }

.pdf-scope-list { display: flex; flex-direction: column; gap: 6px; }
.pdf-scope-item { font-size: 13px; display: flex; align-items: flex-start; gap: 8px; }
.pdf-scope-item::before { content: '✓'; color: var(--teal); font-weight: 700; flex-shrink: 0; }

.pdf-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pdf-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 99px;
  background: #f1effe;
  color: var(--purple-dark);
}
.pdf-tag.purple { background: var(--purple-light); color: var(--purple-dark); }
.pdf-tag.teal { background: var(--teal-light); color: var(--teal); }
.pdf-tag.amber { background: var(--amber-light); color: var(--amber); }

.pdf-footer-area {
  padding: 14px 24px;
  background: #f8f7fc;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pdf-footer-email { font-size: 12px; font-weight: 500; color: var(--purple); }
.pdf-footer-brand { font-size: 11px; color: var(--text-muted); }

.pdf-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== PRINT STYLES ===== */
@media print {
  .sidebar, .dash-header, .dash-tabs, .pdf-actions, .input-panel { display: none !important; }
  .dash-main { padding: 0; }
  .dash-grid { grid-template-columns: 1fr; }
  .pdf-doc { border: none; box-shadow: none; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .dash-main { padding: 20px; }
  .dash-header { flex-direction: column; gap: 16px; }
}

/* ===== PROPOSAL RICH OUTPUT ===== */
.proposal-rich {
  width: 100%;
  min-height: 280px;
  font-size: 13px;
  line-height: 1.9;
  border: 0.5px solid var(--purple);
  border-radius: 9px;
  padding: 14px;
  background: #fafbff;
  outline: none;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto;
  font-family: inherit;
}
.proposal-rich strong { color: #1a1a1a; font-weight: 700; }
.proposal-rich:focus { box-shadow: 0 0 0 3px rgba(83,74,183,0.08); }
