:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-hover: #1a1a1a;
  --border: #222222;
  --border-light: #333333;
  --text: #f0f0f0;
  --text-muted: #888888;
  --text-dim: #555555;
  --accent: #e0e0e0;
  --accent-hover: #ffffff;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius: 8px;
  --radius-lg: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  margin-bottom: 48px;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-logo span {
  color: var(--text);
}

.nav-links {
  display: flex;
  gap: 24px;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

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

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

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

.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

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

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

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

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--text-dim);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

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

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

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

.module-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.module-toggle:hover {
  border-color: var(--border-light);
}

.module-toggle.active {
  border-color: var(--text-dim);
  background: var(--surface-hover);
}

.module-toggle-info {
  flex: 1;
}

.module-toggle-label {
  font-size: 14px;
  font-weight: 500;
}

.module-toggle-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-switch {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
  margin-left: 16px;
}

.toggle-switch.active {
  background: var(--text);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--bg);
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch.active::after {
  transform: translateX(18px);
}

.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 100px;
  border: 1px solid;
}

.status-draft {
  color: var(--warning);
  border-color: var(--warning);
  background: rgba(251, 191, 36, 0.08);
}

.status-sent {
  color: var(--success);
  border-color: var(--success);
  background: rgba(74, 222, 128, 0.08);
}

.proposal-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.proposal-list-item:hover {
  border-color: var(--border-light);
}

.proposal-meta {
  display: flex;
  gap: 16px;
  align-items: center;
}

.proposal-meta-item {
  font-size: 12px;
  color: var(--text-muted);
}

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

.builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
}

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

.empty-state h2 {
  color: var(--text-dim);
  margin-bottom: 12px;
}

.empty-state p {
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.timeline-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-option {
  padding: 8px 16px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-family: var(--font);
}

.timeline-option:hover {
  border-color: var(--border-light);
}

.timeline-option.active {
  border-color: var(--text);
  color: var(--text);
  background: var(--surface-hover);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

.toolbar-btn {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.15s;
}

.toolbar-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-light);
}

.toolbar-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
}

.editor-toolbar + .form-textarea {
  border-radius: 0 0 var(--radius) var(--radius);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 24px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}
