/* Dazpy app shell — Step 1. Warm cream canvas + ember accent per
   DESIGN-DIRECTION.md; deliberately simple, this is a skeleton shell. */

:root {
  --canvas: #faf5ee;
  --ink: #2d2018;
  --ember: #e8622c;
  --line: #e5d9cb;
  --muted: #8a7663;
  --card: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.85em; }

.brand { font-family: Georgia, "Times New Roman", serif; font-size: 2rem; letter-spacing: 0.02em; }
.brand.small { font-size: 1.3rem; padding: 0.75rem 1rem 0.25rem; }
.tagline { color: var(--muted); margin-top: 0.25rem; }

/* sign-in */
.signin-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.signin-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 2rem; width: 100%; max-width: 380px;
  box-shadow: 0 12px 32px rgba(45, 32, 24, 0.08);
}
.signin-card form { display: grid; gap: 0.75rem; margin-top: 1rem; }
.signin-card label { display: grid; gap: 0.3rem; font-size: 0.9rem; }
input, select {
  padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff;
}
button {
  font: inherit; cursor: pointer; border: 1px solid var(--line);
  background: #fff; border-radius: 8px; padding: 0.5rem 0.9rem;
}
button.primary { background: var(--ember); border-color: var(--ember); color: #fff; font-weight: 600; }
.linklike { border: none; background: none; color: var(--ember); padding: 0.5rem 0; text-align: left; }
.state {
  border: 1px solid var(--line); background: #fdf8f1; border-radius: 8px;
  padding: 0.6rem 0.8rem; font-size: 0.9rem; margin-top: 0.75rem;
}
.state.error { border-color: #d66; background: #fdf1f1; }

/* app frame */
.app-frame { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar {
  border-right: 1px solid var(--line); background: #fffdf9;
  display: flex; flex-direction: column;
}
#agent-list { display: flex; flex-direction: column; gap: 2px; padding: 0.5rem; overflow-y: auto; }
.side-heading {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); padding: 0.8rem 0.6rem 0.3rem;
}
.agent-item {
  display: flex; align-items: center; gap: 0.6rem; text-align: left;
  border: none; background: none; border-radius: 10px; padding: 0.5rem 0.6rem; width: 100%;
}
.agent-item:hover { background: #f6ecdf; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--ember); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.agent-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.agent-name { font-weight: 600; }
.agent-role-small { font-size: 0.78rem; color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #c9bba7; flex: none; }
.status-dot.online { background: #3da35d; }
.sidebar-foot { margin-top: auto; padding: 0.75rem 1rem; border-top: 1px solid var(--line); }
.account-chip { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }

.main-pane { display: flex; flex-direction: column; min-width: 0; }
.chat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.25rem; border-bottom: 1px solid var(--line); background: #fffdf9;
}
.agent-title { font-size: 1.15rem; font-weight: 700; }
.agent-role { color: var(--muted); font-size: 0.85rem; }
.model-box { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.cost-label { color: var(--ember); font-weight: 600; }
.chat-placeholder { padding: 2rem 1.25rem; color: var(--ink); }

.admin-panel { border-top: 1px solid var(--line); padding: 1rem 1.25rem 2rem; background: #fffdf9; }
.admin-panel table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.admin-panel th, .admin-panel td { border-bottom: 1px solid var(--line); padding: 0.4rem 0.5rem; text-align: left; }
.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.inline-form code { font-size: 1rem; color: var(--ember); }

@media (max-width: 720px) {
  .app-frame { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); }
}
