@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #0b0f19;
  --bg-surface: #131b2e;
  --bg-card: #1c2742;
  --bg-input: #172138;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-light: #fef3c7;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: #293859;
  --border-focus: #f59e0b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Outfit", sans-serif;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}

/* Nav Header */
.app-header {
  background-color: rgba(19, 27, 46, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.brand-title {
  font-family: var(--font-heading);
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 0.75rem;
}

.nav-link {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background-color: var(--bg-card);
  border-color: var(--border);
}

/* Hero & Chat Container */
.customer-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.hero-box {
  text-align: center;
  margin-bottom: 2rem;
}

.hero-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
}

/* Chat Canvas */
.chat-window {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  height: 520px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-bubble {
  max-width: 82%;
  padding: 0.9rem 1.2rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: fadeIn 0.25s ease-out;
  word-break: break-word;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.bubble-dml {
  align-self: flex-start;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.bubble-dml.dml-highlight {
  border-left: 4px solid var(--accent);
}

.bubble-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.bubble-action-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn-bubble-confirm {
  background-color: var(--success);
  color: white;
  border: none;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-bubble-decline {
  background-color: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
}

/* Chat Input Bar */
.chat-input-bar {
  padding: 1rem;
  background-color: rgba(19, 27, 46, 0.95);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.6rem;
}

.chat-input {
  flex: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: var(--border-focus);
}

.btn-send {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.4rem;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}

.btn-send:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

/* Example Prompts */
.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
  justify-content: center;
}

.chip-btn {
  background-color: rgba(28, 39, 66, 0.6);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.chip-btn:hover {
  background-color: var(--bg-card);
  color: var(--accent);
  border-color: var(--accent);
}

/* Admin Dashboard Grid */
.admin-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.metric-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.metric-card.highlight {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-surface), rgba(245, 158, 11, 0.08));
}

.metric-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text-main);
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.admin-columns {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

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

.panel-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Kanban / Request list */
.request-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.request-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.status-NEW { background: #334155; color: #cbd5e1; }
.status-WAITING_PROVIDER { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.status-WAITING_CUSTOMER { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.status-CONNECTED { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.status-NO_PROVIDER, .status-CUSTOMER_DECLINED { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.status-EXTERNAL_FALLBACK_OFFERED { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.request-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  gap: 1rem;
}

.request-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.btn-small {
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-small:hover {
  background-color: var(--bg-input);
  color: var(--text-main);
  border-color: var(--accent);
}

/* Provider Simulator Screen */
.provider-sim-layout {
  max-width: 480px;
  margin: 2rem auto;
  width: 100%;
}

.phone-frame {
  background-color: #000;
  border: 10px solid #27272a;
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  height: 680px;
}

.phone-header {
  background-color: #075e54;
  color: white;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.phone-avatar {
  width: 38px;
  height: 38px;
  background-color: #128c7e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.phone-body {
  flex: 1;
  background-color: #0b141a;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wa-bubble-incoming {
  align-self: flex-start;
  background-color: #202c33;
  color: #e9edef;
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  font-size: 0.88rem;
  max-width: 88%;
}

.wa-bubble-outgoing {
  align-self: flex-end;
  background-color: #005c4b;
  color: #e9edef;
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  font-size: 0.88rem;
  max-width: 88%;
}

.phone-quick-replies {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  background-color: #111b21;
  border-top: 1px solid #222e35;
}

.btn-quick-reply {
  background-color: #202c33;
  border: 1px solid #2a3942;
  color: #00a884;
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-quick-reply:hover {
  background-color: #2a3942;
}

.phone-input-bar {
  background-color: #202c33;
  padding: 0.6rem;
  display: flex;
  gap: 0.4rem;
}

.phone-input {
  flex: 1;
  background-color: #2a3942;
  border: none;
  border-radius: 8px;
  color: white;
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  outline: none;
}
