:root {
  --accent: #d97706;
  --accent-light: #fbbf24;
  --accent-bg: rgba(217, 119, 6, 0.08);
  --bg: #09090b;
  --surface: #111114;
  --surface2: #18181c;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f4f5;
  --text-muted: #71717a;
  --text-dim: #52525b;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* SSO Banner */
.sso-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.sso-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.sso-name { font-weight: 500; color: var(--text); }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.topbar .eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 2px;
}
.topbar h1 { font-size: 20px; font-weight: 700; color: var(--text); }
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Status bar */
.status-bar {
  padding: 8px 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.status-bar.error { color: var(--danger); }
.status-bar.success { color: var(--success); }

/* Layout */
.workspace { height: calc(100vh - 110px); overflow: hidden; }
.layout { display: flex; height: 100%; }

/* Offering list */
.offering-list {
  width: 300px;
  min-width: 260px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  background: var(--surface);
}
.list-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.list-item:hover { background: var(--surface2); }
.list-item.active { background: var(--accent-bg); border-left: 2px solid var(--accent); }
.list-item-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 3px; }
.list-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.list-item-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.list-item-meta { font-size: 11px; color: var(--text-dim); }
.list-item-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 9999px;
}
.status-active   { background: rgba(34,197,94,0.12);   color: #4ade80; border: 1px solid rgba(34,197,94,0.25); }
.status-inactive { background: rgba(113,113,122,0.12); color: #a1a1aa; border: 1px solid rgba(113,113,122,0.25); }
.status-draft    { background: rgba(245,158,11,0.12);  color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }

/* Editor */
.offering-editor {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}
.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.editor-header h2 { font-size: 18px; font-weight: 700; }
.editor-header-actions { display: flex; align-items: center; gap: 8px; }
#editorStatus {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.editor-body { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }

/* Fields */
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
input[type="search"] { background: var(--surface2); }

/* Buttons */
button {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
button:hover { background: var(--surface); border-color: rgba(255,255,255,0.15); }
#newOfferingButton {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
#newOfferingButton:hover { background: #b45309; border-color: #b45309; }
#saveOfferingButton {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
#saveOfferingButton:hover { background: #b45309; border-color: #b45309; }
.btn-danger { color: var(--danger); border-color: rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.1); border-color: var(--danger); }

#emptyOfferings {
  padding: 24px 16px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

@media (max-width: 640px) {
  .layout { flex-direction: column; height: auto; overflow: visible; }
  .offering-list { width: 100%; min-width: unset; border-right: none; border-bottom: 1px solid var(--border); max-height: 40vh; }
  .field-grid, .field-grid-3 { grid-template-columns: 1fr; }
}
