/* ── App Shell ─────────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  padding: 28px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--fg);
  padding: 0 24px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 20px;
}

.sidebar-brand span {
  color: var(--accent);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--fg);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid rgba(245,158,11,0.2);
}

.nav-icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 24px 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}

.sidebar-footer a {
  font-size: 13px;
  color: var(--fg-dim);
  text-decoration: none;
}

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

/* ── Main Content ───────────────────────────────────────────────────────────── */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  max-width: 900px;
}

.page-header {
  margin-bottom: 36px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--fg-muted);
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-icon { font-size: 20px; }

/* ── Form Elements ──────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

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

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent);
}

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

.form-select option { background: var(--bg-card); }

.form-hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--fg-dim);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #0a0e1a;
}

.btn-primary:hover { background: var(--accent-soft); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-ghost:hover { background: var(--bg-elevated); color: var(--fg); }

.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ── Status Badges ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green  { background: rgba(34,197,94,0.12);  color: var(--green); }
.badge-amber  { background: rgba(245,158,11,0.12); color: var(--accent); }
.badge-red    { background: rgba(239,68,68,0.12);  color: var(--red); }
.badge-muted  { background: rgba(255,255,255,0.06); color: var(--fg-muted); }

/* ── Toast / Alerts ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.25s;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: var(--green); }
.toast-error   { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.3);  color: var(--red); }

/* ── Stats Row ──────────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 24px 20px;
}

.stat-card-number {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card-label {
  font-size: 13px;
  color: var(--fg-muted);
}

/* ── Table ──────────────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--fg-dim);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.data-table td {
  padding: 16px;
  font-size: 15px;
  color: var(--fg);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--fg-dim);
}

.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-text { font-size: 16px; }

/* ── Chat UI ────────────────────────────────────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 480px;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

.chat-header {
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 2px solid rgba(245,158,11,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.agent-info .agent-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}

.agent-info .agent-status {
  font-size: 12px;
  color: var(--green);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  max-width: 78%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg.agent { align-self: flex-start; }
.msg.customer { align-self: flex-end; }

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.55;
}

.msg.agent .msg-bubble {
  background: var(--bg-card);
  color: var(--fg);
  border-bottom-left-radius: 4px;
}

.msg.customer .msg-bubble {
  background: var(--accent);
  color: #0a0e1a;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.msg-time {
  font-size: 11px;
  color: var(--fg-dim);
  padding: 0 4px;
}

.msg.customer .msg-time { text-align: right; }

.chat-input-row {
  padding: 16px 20px;
  background: var(--bg-card);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 12px;
}

.chat-input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 12px 20px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
}

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

.chat-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0e1a;
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.chat-send-btn:hover { background: var(--accent-soft); transform: scale(1.05); }
.chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.typing-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--fg-muted);
  animation: typingBounce 1.4s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

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

.booked-banner {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 10px;
  padding: 16px 20px;
  color: var(--green);
  font-weight: 500;
  margin-top: 16px;
  display: none;
}

.booked-banner.show { display: block; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .app-sidebar { display: none; }
  .app-main { padding: 24px 16px; max-width: 100%; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
