/* Inbox Agent UI — matches Solidify dark theme */
:root {
  --bg: #0D1117;
  --surface: #161B22;
  --surface-2: #1C2330;
  --teal: #00E5B4;
  --teal-dim: rgba(0, 229, 180, 0.12);
  --text: #F0EDE8;
  --text-muted: #8B949E;
  --border: #30363D;
  --green: #3FB950;
  --amber: #D29922;
  --red: #F85149;
  --radius: 8px;
}

body { margin: 0; background: var(--bg); color: var(--text); font-family: 'DM Sans', system-ui, sans-serif; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.nav-logo { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.1rem; }
.nav-tag { font-size: 0.7rem; font-weight: 600; color: var(--teal); background: var(--teal-dim); padding: 3px 10px; border-radius: 100px; letter-spacing: 0.05em; text-transform: uppercase; }
.btn-outline {
  background: transparent; border: 1px solid var(--teal); color: var(--teal);
  padding: 6px 16px; border-radius: var(--radius); font-size: 0.85rem; cursor: pointer; font-family: inherit;
  transition: background 0.15s;
}
.btn-outline:hover { background: var(--teal-dim); }
.btn-outline:disabled { opacity: 0.5; cursor: not-allowed; }

.inbox-layout { display: grid; grid-template-columns: 360px 1fr; min-height: calc(100vh - 57px); }

/* Email list */
.email-list { border-right: 1px solid var(--border); overflow-y: auto; }
.list-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.list-header h2 { font-size: 1rem; font-weight: 600; }
.badge {
  background: var(--teal); color: #000; font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 20px; min-width: 20px; text-align: center;
}
.email-item {
  padding: 14px 20px; border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background 0.1s;
}
.email-item:hover { background: var(--surface-2); }
.email-item.active { background: var(--surface); border-left: 3px solid var(--teal); }
.email-item-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.email-from { font-size: 0.85rem; font-weight: 600; }
.email-time { font-size: 0.72rem; color: var(--text-muted); }
.email-subject { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-category {
  display: inline-block; font-size: 0.65rem; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em;
}
.cat-refund { background: rgba(248,81,73,0.15); color: var(--red); }
.cat-scheduling { background: rgba(210,153,34,0.15); color: var(--amber); }
.cat-pricing { background: rgba(63,185,80,0.15); color: var(--green); }
.cat-other { background: var(--surface-2); color: var(--text-muted); }
.cat-escalated { background: rgba(210,153,34,0.15); color: var(--amber); }
.email-status-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-left: 6px; vertical-align: middle;
}
.dot-pending { background: var(--amber); }
.dot-drafted { background: var(--teal); }
.dot-sent { background: var(--green); }
.dot-escalated { background: var(--red); }

/* Detail panel */
.email-detail { padding: 32px; overflow-y: auto; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); gap: 12px; }
.empty-icon { font-size: 3rem; }

.detail-from { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.detail-meta { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 20px; }
.detail-subject { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.detail-body { font-size: 0.9rem; line-height: 1.7; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 28px; white-space: pre-wrap; }

.draft-card {
  background: var(--surface); border: 1px solid var(--teal); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}
.draft-label { font-size: 0.72rem; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.draft-text { font-size: 0.9rem; line-height: 1.6; margin-bottom: 16px; white-space: pre-wrap; }
.draft-actions { display: flex; gap: 10px; }
.btn-approve {
  background: var(--teal); color: #000; border: none; padding: 8px 20px;
  border-radius: var(--radius); font-size: 0.85rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn-approve:hover { opacity: 0.85; }
.btn-approve:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-reject {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  padding: 8px 16px; border-radius: var(--radius); font-size: 0.85rem; cursor: pointer; font-family: inherit;
}
.btn-reject:hover { border-color: var(--red); color: var(--red); }
.btn-edit {
  background: transparent; border: 1px solid var(--teal); color: var(--teal);
  padding: 8px 16px; border-radius: var(--radius); font-size: 0.85rem; cursor: pointer; font-family: inherit;
}

.escalated-banner {
  background: rgba(210,153,34,0.12); border: 1px solid var(--amber);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px;
  font-size: 0.85rem; color: var(--amber);
}

.edit-draft-area { margin-bottom: 12px; }
.edit-draft-area textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius); padding: 12px; font-size: 0.9rem;
  font-family: inherit; resize: vertical; min-height: 100px;
}
.edit-draft-area textarea:focus { outline: none; border-color: var(--teal); }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); padding: 12px 20px;
  border-radius: var(--radius); font-size: 0.85rem; z-index: 100;
  transition: opacity 0.2s;
}
.toast.hidden { opacity: 0; pointer-events: none; }
.toast.success { border-color: var(--green); }
.toast.error { border-color: var(--red); }

.loading { text-align: center; color: var(--text-muted); padding: 40px; font-size: 0.9rem; }
.loading::after { content: '...'; animation: dots 1.2s infinite; }
@keyframes dots { 0%,20%{content:'.'} 40%{content:'..'} 60%,100%{content:'...'} }

.sent-badge { display: inline-flex; align-items: center; gap: 4px; background: rgba(63,185,80,0.15); color: var(--green); padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; margin-bottom: 12px; }