* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: #0b1220; color: #e5e7eb; }
a { color: #67e8f9; }
.dim { color: #94a3b8; }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* Header */
.topbar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; padding: 12px 20px; background: #0d1626; border-bottom: 1px solid #1e293b; }
.brand { display: flex; gap: 12px; align-items: center; }
.logo { font-size: 34px; font-weight: 800; color: #22d3ee; letter-spacing: -2px; }
.brand h1 { margin: 0; font-size: 20px; letter-spacing: 1px; }
.brand h1 span { color: #22d3ee; }
.brand p { margin: 2px 0 0; font-size: 13px; color: #94a3b8; }
.shop { text-align: right; font-size: 13px; }
.shop p { margin: 2px 0; }

/* Layout */
.layout { display: grid; grid-template-columns: 320px 1fr; min-height: calc(100vh - 130px); }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .shop { text-align: left; } }

/* Code panel */
.code-panel { background: #070d1a; border-right: 1px solid #1e293b; padding: 12px; }
.code-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 3px 8px; border-radius: 999px; background: #f59e0b; color: #111827; }
.badge.running { background: #22c55e; color: #052e16; }
.code-title { font-size: 12px; color: #64748b; font-family: ui-monospace, monospace; }
.code-panel pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.65; color: #c4b5fd; min-height: 430px; }
.code-panel pre .ln { color: #475569; user-select: none; }
.code-panel pre .kw { color: #f472b6; }
.code-panel pre .fn { color: #7dd3fc; }
.code-panel pre .cm { color: #64748b; font-style: italic; }
.caret { display: inline-block; width: 8px; height: 15px; background: #22d3ee; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.code-foot { font-size: 12px; color: #64748b; }

/* Banner */
.office-wrap { padding: 14px; }
.banner { background: linear-gradient(180deg, #16233f, #0f1c33); border: 1px solid #2dd4bf55; border-radius: 14px; text-align: center; padding: 18px 12px; margin-bottom: 14px; }
.banner h2 { margin: 0; font-size: 26px; letter-spacing: 3px; color: #2dd4bf; }
.banner.running h2 { color: #4ade80; }
.banner p { margin: 6px 0; }
.muse-note { font-size: 13px; color: #fbbf24; }
.progress { height: 10px; background: #1e293b; border-radius: 999px; overflow: hidden; max-width: 520px; margin: 12px auto 0; }
.bar { height: 100%; width: 0%; background: linear-gradient(90deg, #22d3ee, #4ade80); transition: width .6s; }

/* Office grid */
.office { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px; border-radius: 14px; background: linear-gradient(180deg, #8ea0b8, #7689a3); }
@media (max-width: 700px) { .office { grid-template-columns: 1fr; } }
.desk { background: #aebdd0; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 10px #00000033; }
.desk header { background: linear-gradient(90deg, #6d5bd0, #8b7cf6); color: #fff; font-weight: 700; text-align: center; padding: 6px; font-size: 15px; }
.desk .scene { position: relative; padding: 6px 6px 0; }
.desk .scene svg { width: 100%; height: auto; display: block; }
.desk .plate { background: #fef3c7; color: #78350f; text-align: center; font-size: 12px; font-weight: 600; padding: 3px; margin: 0 26px; border-radius: 4px; }
.agent-status { display: flex; gap: 6px; align-items: center; justify-content: center; font-size: 12px; color: #334155; padding: 6px 4px 8px; min-height: 30px; text-align: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #f59e0b; flex-shrink: 0; }
.st-working .dot { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.st-break .dot { background: #38bdf8; }
.st-done .dot { background: #94a3b8; }
.st-working .person { animation: bob 1.1s ease-in-out infinite; }
.st-working .screen-glow { animation: glow 1.1s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }
@keyframes glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.steam { animation: steam 2.4s ease-in-out infinite; opacity: .5; }
@keyframes steam { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: .7; } 100% { transform: translateY(-4px); opacity: 0; } }
.bubble { position: absolute; top: 2px; right: 8px; background: #fff; color: #1e293b; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 10px; box-shadow: 0 1px 4px #00000033; max-width: 46%; }
.bubble::after { content: ""; position: absolute; bottom: -5px; right: 18px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
/* Grid placement like the reference image */
.pos-dieu-hanh { grid-column: 2; }
.pos-tiep-nhan { grid-column: 1; }
.pos-nghiep-vu { grid-column: 3; }
.pos-van-thu { grid-column: 1; }
.pos-giai-lao { grid-column: 2; }
.pos-bao-mat { grid-column: 3; }
.pos-kiem-dinh { grid-column: 1; }
.pos-ky-thuat { grid-column: 2; }
.pos-thu-ky { grid-column: 3; }
@media (max-width: 700px) { .pos-dieu-hanh, .pos-tiep-nhan, .pos-nghiep-vu, .pos-van-thu, .pos-giai-lao, .pos-bao-mat, .pos-kiem-dinh, .pos-ky-thuat, .pos-thu-ky { grid-column: auto; } }

/* Panels */
.panels { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr; gap: 14px; margin-top: 14px; }
@media (max-width: 900px) { .panels { grid-template-columns: 1fr; } }
.panel { background: #101c33; border: 1px solid #1e293b; border-radius: 12px; padding: 12px 14px; }
.panel h3 { margin: 0 0 10px; font-size: 15px; color: #7dd3fc; }
.tasks, .queue, .log { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tasks li, .queue li, .log li { font-size: 13.5px; line-height: 1.45; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-right: 6px; }
.tag.run { background: #14532d; color: #4ade80; }
.tag.bg { background: #1e3a5f; color: #7dd3fc; }
.tag.wait { background: #451a03; color: #fbbf24; }
.tag.done { background: #1f2937; color: #9ca3af; }
.mini-progress { height: 6px; background: #1e293b; border-radius: 999px; overflow: hidden; margin-top: 5px; }
.mini-progress div { height: 100%; background: linear-gradient(90deg, #22d3ee, #4ade80); }
.log time { color: #64748b; margin-right: 6px; font-size: 12px; }

/* Bottom bar */
.bottombar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 20px; background: #0d1626; border-top: 1px solid #1e293b; }
.bottombar button { background: #1e293b; color: #e5e7eb; border: 1px solid #334155; border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 13px; }
.bottombar button.on { background: #14532d; border-color: #22c55e; color: #4ade80; }
.vol { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.fresh { font-size: 12px; color: #64748b; margin-left: auto; }
.admin { width: 100%; background: #101c33; border: 1px solid #1e293b; border-radius: 10px; padding: 10px 12px; }
.admin summary { cursor: pointer; font-size: 13px; color: #7dd3fc; }
.admin form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 13px; }
.admin label { display: flex; flex-direction: column; gap: 4px; }
.admin input, .admin select { background: #0b1220; color: #e5e7eb; border: 1px solid #334155; border-radius: 8px; padding: 7px 9px; }
.admin-msg { font-size: 12px; }
