:root { --navy:#0b2545; --blue:#1a73b8; --green:#0f9d6e; --orange:#f08c1a; --red:#d32f3f; --ink:#1c2430; --muted:#6b7280; --bg:#f4f6fa; --card:#ffffff; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color:var(--ink); background:var(--bg); }
.topbar { background:var(--navy); color:#fff; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; padding:10px 16px; border-bottom:4px solid var(--orange); }
.brand img { height:56px; display:block; }
.topbar nav { display:flex; align-items:center; flex-wrap:wrap; }
.topbar nav a, .topbar nav button { color:#fff; margin-left:14px; text-decoration:none; background:none; border:0; font:inherit; cursor:pointer; padding:0; }
.topbar nav form { display:inline; margin:0; }
main { max-width:900px; margin:0 auto; padding:16px; }
footer { text-align:center; color:var(--muted); padding:16px; font-size:13px; }
h1 { font-size:1.5rem; margin:8px 0 12px; }
h2 { font-size:1.2rem; }
.muted { color:var(--muted); font-size:14px; }
.panel { background:var(--card); border-radius:12px; padding:16px; box-shadow:0 1px 3px rgba(0,0,0,.08); margin-bottom:16px; }
.panel.narrow { max-width:420px; }
label { display:block; margin:10px 0; font-size:14px; }
input, select, textarea { width:100%; padding:9px 10px; border:1px solid #cbd2dc; border-radius:8px; font:inherit; margin-top:4px; background:#fff; }
table input, table select { width:auto; min-width:120px; margin:0; }
button, .btn { background:var(--blue); color:#fff; border:0; border-radius:8px; padding:9px 14px; font:inherit; cursor:pointer; text-decoration:none; display:inline-block; }
table { width:100%; border-collapse:collapse; background:var(--card); border-radius:10px; overflow:hidden; font-size:14px; margin-bottom:16px; }
th, td { padding:8px 10px; border-bottom:1px solid #eef1f5; text-align:left; vertical-align:middle; }
.cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:12px; margin-bottom:16px; }
.card { background:var(--card); border-radius:12px; padding:16px; box-shadow:0 1px 3px rgba(0,0,0,.08); }
.card span { display:block; font-size:28px; font-weight:700; color:var(--navy); }
.ok { background:#e8f7f1; color:#0a6a4a; padding:10px; border-radius:8px; margin-bottom:12px; }
.error { background:#fdecec; color:#8a1f1f; padding:10px; border-radius:8px; margin-bottom:12px; }
.warn { background:#fff7e6; padding:10px; border-radius:8px; white-space:pre-wrap; font-size:13px; }
.inline-form { display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.inline-form input, .inline-form select { width:auto; min-width:220px; margin:0; }
.pager { display:flex; gap:12px; align-items:center; margin-top:12px; }
.reply { background:#f0f7ff; padding:8px; border-radius:8px; }
.chat-wrap { background:var(--card); border-radius:14px; box-shadow:0 1px 3px rgba(0,0,0,.08); display:flex; flex-direction:column; height:72vh; min-height:440px; }
.chat { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:10px; }
.msg { max-width:85%; padding:10px 14px; border-radius:14px; line-height:1.4; font-size:15px; white-space:normal; }
.msg.bot { background:#eef4fb; align-self:flex-start; border-bottom-left-radius:4px; }
.msg.me { background:var(--blue); color:#fff; align-self:flex-end; border-bottom-right-radius:4px; }
.map-msg { max-width:100%; width:100%; padding:6px; background:#fff; border:1px solid #eef1f5; }
.map { height:340px; border-radius:10px; }
.chips { display:flex; flex-wrap:wrap; gap:8px; align-self:flex-start; }
.chip { background:#fff; border:1px solid var(--blue); color:var(--blue); border-radius:20px; padding:6px 12px; cursor:pointer; font:inherit; font-size:14px; }
.composer { display:flex; gap:8px; padding:12px; border-top:1px solid #eef1f5; }
.composer input { margin:0; }
@media (max-width:600px) {
  .brand img { height:44px; }
  .msg { max-width:95%; }
  .map { height:280px; }
}

.layout { display:grid; grid-template-columns: minmax(0,1fr) 320px; gap:16px; align-items:start; }
.side { background:var(--card); border-radius:14px; box-shadow:0 1px 3px rgba(0,0,0,.08); padding:16px; position:sticky; top:12px; }
.side h2 { font-size:1.1rem; margin:0 0 4px; color:var(--navy); }
.side .muted { margin:0 0 12px; }
.topic-btn { display:block; width:100%; text-align:left; background:#fff; color:var(--blue); border:1px solid var(--blue); margin-bottom:8px; }
.topic-btn:hover:not(:disabled) { background:#eef4fb; }
.topic-btn:disabled { opacity:.45; cursor:not-allowed; border-color:#cbd2dc; color:var(--muted); }
.answer-box { margin-top:12px; border-top:1px solid #eef1f5; padding-top:12px; font-size:14px; line-height:1.5; }
.answer-box h3 { margin:0 0 6px; font-size:1rem; color:var(--navy); }
@media (max-width:800px) {
  .layout { grid-template-columns: 1fr; }
  .side { position:static; }
  .chat-wrap { height:60vh; }
}
.topbar nav .admin-login { background:var(--orange); color:#fff; padding:6px 12px; border-radius:8px; font-weight:600; }
.side h2.side-gap { margin-top:22px; }
.route-block { margin-bottom:10px; }
.route-block b { color:var(--navy); }
.file-list { margin:6px 0 10px; padding-left:18px; font-size:14px; }
.file-list li { margin-bottom:4px; }
.file-list-bot { margin-top:8px; font-size:14px; }
.inline { display:inline; }
.link-btn { background:none; color:#b00020; border:none; padding:0 6px; cursor:pointer; text-decoration:underline; }
.quote-docs { border-top:1px solid #eef1f5; padding-top:10px; margin-top:10px; }
.layout { grid-template-columns: 1fr; }
