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

/* ============================================
   Design System - Color Palette
   ============================================
   Background: #F4F3EF
   Card Body: #FEFEFE
   Header/Section: #F8F7F7
   Hover: #E6E3DA
   Selected: #EBEBE4
   Primary Dark (Brand): #292524 (Stone 900)
   Action Purple: #5C5CFF
   ============================================ */

:root {
  --bg-page: #F4F3EF;
  --bg-card: #FEFEFE;
  --bg-section: #F8F7F7;
  --bg-hover: #E6E3DA;
  --bg-selected: #EBEBE4;
  --primary: #292524;
  --primary-hover: #1C1917;
  --action: #5C5CFF;
  --action-hover: #4B4BEE;
  --accent-blue: #58B7F7;
  --border: #E6E3DA;
  --border-light: #E4E4E7;
  --text-primary: #292524;
  --text-secondary: #57534E;
  --text-muted: #78716C;
  --text-light: #A8A29E;
  --success: #7A960C;
  --success-bg: #E4F69D;
  --warning: #B59226;
  --warning-bg: #FCF5C2;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', 'Roobert', Arial, system-ui, sans-serif;
  background: var(--bg-page);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--bg-selected);
  color: var(--primary);
}

/* ============================================
   App Header - Sticky Full-width
   ============================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.02em;
}

.header-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 8px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--action), #7B7BFF);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(92, 92, 255, 0.25);
  border: 2px solid var(--bg-card);
}

.header-avatar-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.header-avatar-btn:hover {
  transform: scale(1.05);
}

.header-avatar-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--action);
}

.header-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* User menu dropdown */
.header-user-menu {
  position: relative;
}

.header-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  z-index: 100;
  animation: dropdownFadeIn 0.15s ease;
  overflow: hidden;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-dropdown-user {
  padding: 14px 16px;
  background: var(--bg-section);
}

.header-dropdown-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.header-dropdown-user-email {
  font-size: 12px;
  color: var(--text-muted);
}

.header-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.header-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: left;
}

.header-dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header-dropdown-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.header-dropdown-item:hover svg {
  opacity: 1;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.main-layout {
  display: flex;
  gap: 24px;
}

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

/* ============================================
   Typography
   ============================================ */
h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px 0;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.form-row .form-group { margin-bottom: 0; flex: 1; }

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(41, 37, 36, 0.1);
}

input::placeholder {
  color: var(--text-light);
}

textarea {
  width: 100%;
  height: 150px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text-primary);
  resize: vertical;
  transition: all 0.2s ease;
  line-height: 1.5;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(41, 37, 36, 0.1);
}

textarea::placeholder {
  color: var(--text-light);
}

select {
  width: 100%;
  padding: 10px 40px 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.2s ease;
}

select:hover {
  border-color: var(--text-light);
  background-color: var(--bg-section);
}

select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(41, 37, 36, 0.1);
  background-color: var(--bg-card);
}

select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--bg-section);
}

/* ============================================
   Buttons
   ============================================ */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-right: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:active {
  transform: translateY(0);
}

button.secondary,
.btn.btn-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

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

.btn.btn-primary {
  background: var(--primary);
  color: white;
}

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

.btn.btn-primary:disabled {
  background: var(--bg-hover);
  color: var(--text-light);
  cursor: not-allowed;
}

button.action {
  background: var(--action);
  color: white;
}

button.action:hover {
  background: var(--action-hover);
}

button.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #FECACA;
}

button.danger:hover {
  background: #FEE2E2;
}

button.ghost,
.btn.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

button.ghost:hover,
.btn.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: none;
  box-shadow: none;
}

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

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   Badges
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
}

.badge-blue {
  background: #C7E4F2;
  color: #2A86C5;
  border-color: rgba(88, 183, 247, 0.3);
}

.badge-purple {
  background: #CECEFF;
  color: #4A4ADD;
  border-color: rgba(92, 92, 255, 0.3);
}

.badge-green {
  background: var(--success-bg);
  color: var(--success);
  border-color: rgba(164, 194, 43, 0.3);
}

.badge-yellow {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: rgba(255, 205, 86, 0.3);
}

.badge-orange {
  background: #FFE9D3;
  color: #D9791A;
  border-color: rgba(255, 159, 64, 0.3);
}

.badge-slate {
  background: #F3F5F7;
  color: var(--text-secondary);
  border-color: var(--border);
}

/* ============================================
   Cards & Sections
   ============================================ */
.section {
  margin-bottom: 24px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.section-header {
  padding: 16px 20px;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}

.card-body {
  padding: 20px;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
  width: 280px;
  flex-shrink: 0;
}

.sidebar-section {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
}

.sidebar-header {
  padding: 14px 16px;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
}

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

.sidebar-item:hover {
  background: var(--bg-hover);
}

.sidebar-item.active {
  background: var(--bg-selected);
}

.sidebar-item-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.sidebar-item-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ============================================
   Pills / Tabs
   ============================================ */
.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  padding: 10px 18px;
  font-size: 14px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  margin: 0;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(41, 37, 36, 0.2);
  transform: scale(1.02);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--text-light);
}

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

.empty-state-description {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ============================================
   Loading State
   ============================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-muted);
}

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

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

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(41, 37, 36, 0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
  animation: fadeIn 0.2s ease;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  z-index: 51;
  animation: zoomIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-section);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 16px 16px 0 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  padding: 8px;
  margin: -8px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 8px;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================
   Utilities
   ============================================ */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* ============================================
   Editor Layout (Chat + Content)
   ============================================ */
.editor-layout {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 24px;
  margin-top: 24px;
}

/* ============================================
   Chat Panel
   ============================================ */
.chat-panel {
  display: flex;
  flex-direction: column;
  height: 700px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.chat-header {
  padding: 16px 20px;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.chat-header-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-hover);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: rgba(248, 247, 247, 0.5);
}

.chat-message-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 16px;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar-inner {
  width: 12px;
  height: 12px;
  border: 2px solid white;
  border-radius: 3px;
}

.chat-message {
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  position: relative;
  max-width: 90%;
}

.chat-message.user {
  background: var(--primary);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chat-message.assistant {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.chat-input-wrapper {
  position: relative;
}

.chat-textarea {
  width: 100%;
  height: 100px;
  resize: none;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  padding: 12px;
  padding-right: 48px;
  transition: all 0.2s ease;
}

.chat-textarea:focus {
  outline: none;
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(41, 37, 36, 0.1);
}

.chat-textarea::placeholder {
  color: var(--text-light);
}

.chat-input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.chat-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
}

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

.chat-send-btn.active {
  background: var(--primary);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-right: auto;
  width: fit-content;
  border-bottom-left-radius: 4px;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-light);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ============================================
   CMS Panel (Right Side)
   ============================================ */
.cms-panel {
  max-height: 700px;
  overflow-y: auto;
  padding-right: 4px;
}

.cms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  align-items: center;
  justify-content: space-between;
}

.cms-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    height: 500px;
  }
}

@media (max-width: 768px) {
  .header-content {
    padding: 0 16px;
  }

  .main-content {
    padding: 24px 16px;
  }

  .main-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .modal {
    width: 95%;
    max-height: 90vh;
  }

  .pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }

  .pill {
    flex-shrink: 0;
  }
}

/* ============================================
   Transcript Analyzer
   ============================================ */
.transcript-analyzer {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 24px;
  margin-top: 24px;
}

.analyzer-input-panel {
  display: flex;
  flex-direction: column;
  height: 700px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

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

.analyzer-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.analyzer-header-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-hover);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}

.analyzer-input-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.analyzer-textarea {
  flex: 1;
  width: 100%;
  resize: none;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  padding: 16px;
  transition: all 0.2s ease;
  line-height: 1.6;
}

.analyzer-textarea:focus {
  outline: none;
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(41, 37, 36, 0.1);
}

.analyzer-textarea::placeholder {
  color: var(--text-light);
}

.analyzer-input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.analyzer-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
}

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

.analyzer-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.analyzer-results-panel {
  max-height: 700px;
  overflow-y: auto;
  padding-right: 4px;
}

.analyzer-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 400px;
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.analyzer-empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  color: var(--text-light);
  opacity: 0.5;
}

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

.analyzer-empty-state p {
  max-width: 300px;
}

/* Business Objectives Section */
.objectives-section {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 20px;
}

.objectives-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 20px 0;
  letter-spacing: -0.01em;
}

.objectives-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.objective-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--bg-section);
  border-radius: 10px;
  border: 1px solid var(--border-light);
  transition: all 0.15s ease;
}

.objective-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.objective-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.objective-content {
  flex: 1;
  min-width: 0;
}

.objective-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* State Comparison Section */
.state-comparison-section {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.comparison-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  padding: 20px 24px;
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

.comparison-table-wrapper {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.comparison-table th {
  text-align: left;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-section);
  border-bottom: 1px solid var(--border);
}

.comparison-header-category {
  width: 20%;
}

.comparison-header-current,
.comparison-header-future {
  width: 40%;
}

.comparison-table td {
  padding: 16px 20px;
  vertical-align: top;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.6;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover td {
  background: rgba(248, 247, 247, 0.5);
}

.comparison-category {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-section);
}

.comparison-current {
  color: var(--text-secondary);
  background: rgba(220, 38, 38, 0.03);
}

.comparison-future {
  color: var(--text-secondary);
  background: rgba(34, 197, 94, 0.03);
}

@media (max-width: 1024px) {
  .transcript-analyzer {
    grid-template-columns: 1fr;
  }

  .analyzer-input-panel {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .comparison-table {
    font-size: 13px;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 12px 14px;
  }
}
