
:root {
  font-family: Inter, system-ui, sans-serif;
  color: #eaf0f8;
  background: #0a1220;
  --surface: #111e30;
  --surface2: #17263b;
  --border: #293b53;
  --muted: #93a4ba;
  --blue: #638ff2;
  --green: #35c995;
  --orange: #efb45e;
  --red: #ee7d8a;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #0a1220; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 5;
  width: 248px; padding: 22px 16px; display: flex; flex-direction: column;
  background: #101b2c; border-right: 1px solid var(--border);
  overflow-y: auto;
}
.brand, .owner-card, .connection-indicator { display: flex; align-items: center; gap: 11px; }
.brand { padding: 0 5px 25px; }
.brand-icon, .avatar {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 12px; font-weight: 900;
  background: linear-gradient(135deg,#5c91f5,#8b69dc);
}
.brand strong, .owner-card strong { display: block; font-size: 13px; }
.brand small, .owner-card small, .sidebar-bottom small {
  display: block; color: var(--muted); font-size: 11px; margin-top: 4px;
}
.owner-card { padding: 14px 9px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; }
.navigation { display: flex; flex-direction: column; gap: 5px; }
.nav-label { color: #71849d; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; margin: 16px 8px 6px; }
.nav-item { text-align: left; border: 0; border-radius: 8px; padding: 11px 12px; color: #aebdd0; background: transparent; font-size: 13px; }
.nav-item:hover, .nav-item.active { background: #203756; color: white; }
.nav-item.active { box-shadow: inset 3px 0 var(--blue); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--border); padding: 18px 5px 0; }
.status-dot, .live-indicator { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.main-area { margin-left: 248px; min-height: 100vh; }
.topbar { min-height: 88px; padding: 18px 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); background: #0e1929; }
.topbar h1 { font-size: 21px; margin: 0 0 5px; }
.topbar p, .section-heading p, .panel-heading p, .office-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.content-area { max-width: 1600px; margin: auto; padding: 28px 32px 60px; }
.view { display: none; }
.view.active { display: block; }

.primary-button, .secondary-button {
  border: 0; border-radius: 8px; padding: 11px 16px;
  font-size: 12px; font-weight: 750;
}
.primary-button { color: white; background: var(--blue); }
.primary-button:hover { background: #4778dc; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { color: #dce6f4; background: #263951; border: 1px solid #3a506c; }
.text-button { color: #8eb0ff; background: none; border: 0; font-size: 12px; }

.welcome-panel {
  min-height: 160px; padding: 28px; border-radius: 16px;
  border: 1px solid #344f76;
  background: linear-gradient(110deg,#1c3658,#17243a 72%);
  display: flex; align-items: center; justify-content: space-between;
}
.eyebrow { color: #91b5ff; font-size: 10px; letter-spacing: 1.5px; font-weight: 800; }
.welcome-panel h2 { margin: 12px 0 7px; font-size: 25px; }
.welcome-panel p { color: #bdcce0; font-size: 13px; margin: 0; }
.welcome-mark { font-size: 76px; font-weight: 900; color: #ffffff16; }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin: 20px 0; }
.stat-card, .panel { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; }
.stat-card { padding: 18px; }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; font-size: 24px; margin: 10px 0 6px; }
.dashboard-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
.panel { padding: 20px; }
.panel-heading, .heading-with-action, .office-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading { margin-bottom: 17px; }
.panel-heading h3, .panel h3 { margin: 0 0 6px; font-size: 14px; }
.panel-heading p { font-size: 11px; }
.section-heading { margin-bottom: 20px; }
.section-heading h2, .office-toolbar h2 { margin: 0 0 6px; font-size: 19px; }

.agent-mini-list, .activity-list, .panel-list, .progress-list { display: grid; gap: 10px; }
.agent-mini, .activity-row, .task-row, .content-row, .progress-row {
  padding: 13px; background: #152439; border: 1px solid var(--border); border-radius: 9px;
}
.agent-mini { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.agent-mini strong, .agent-mini small { display: block; }
.agent-mini small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.activity-row p { margin: 0 0 6px; font-size: 12px; }
.activity-row small { color: var(--muted); font-size: 10px; }
.progress-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.timeline-panel { margin-top: 16px; }

.agent-grid, .card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.agent-card { padding: 18px; }
.agent-symbol { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #263f61; font-size: 21px; margin-bottom: 14px; }
.agent-card h3 { margin: 0 0 5px; font-size: 14px; }
.agent-card p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.agent-card small { color: #9aadc5; }

.status-pill { display: inline-block; padding: 5px 9px; border-radius: 20px; font-size: 10px; font-weight: 750; background: #29384d; color: #c5d2e2; }
.status-pill.working { background: #173d35; color: #70e1b8; }
.status-pill.walking { background: #1d3c59; color: #8fc7ff; }
.status-pill.meeting { background: #40331e; color: #f2c477; }
.status-pill.idle { background: #29384d; color: #c5d2e2; }
.status-pill.pending { background: #40351f; color: #efc778; }
.status-pill.completed, .status-pill.approved { background: #173d35; color: #70e1b8; }
.status-pill.failed, .status-pill.rejected { background: #472832; color: #f18d9c; }

.task-row, .content-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.task-row h3, .content-row h3 { margin: 0 0 6px; font-size: 13px; }
.task-row p, .content-row p { margin: 4px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.task-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.small-button { padding: 7px 10px; font-size: 10px; }

.form-panel { max-width: 740px; margin-bottom: 20px; }
label { display: block; color: #bac9db; font-size: 11px; margin: 14px 0 7px; }
input, textarea, select {
  width: 100%; padding: 11px 12px; color: #edf3fb;
  border: 1px solid #354962; border-radius: 8px;
  background: #0e1929; outline: none; font-size: 12px;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); }
textarea { resize: vertical; }
.form-actions, .toolbar-actions { display: flex; gap: 9px; margin-top: 16px; }
.toolbar-actions { margin-top: 0; }
.hidden { display: none !important; }
.full-width { width: 100%; margin-top: 14px; }
.warning-text, .helper-text { color: #e9bd70; font-size: 11px; line-height: 1.6; }

.office-stage { position: relative; margin-top: 18px; border: 1px solid #344963; border-radius: 15px; overflow: hidden; background: #101c2e; box-shadow: 0 18px 50px #0003; }
.office-scene { height: min(72vh,690px); min-height: 440px; }
.office-scene canvas { display: block; width: 100%; height: 100%; }
.scene-overlay { position: absolute; top: 14px; left: 14px; padding: 9px 12px; border: 1px solid #52677d; border-radius: 7px; background: #101c2ddd; color: #dce9f8; font-size: 10px; letter-spacing: 1px; pointer-events: none; }
.scene-overlay .live-indicator { margin-right: 7px; box-shadow: 0 0 10px var(--green); }
.scene-hint { position: absolute; right: 14px; bottom: 13px; padding: 8px 10px; background: #101c2ddd; border-radius: 7px; color: #b6c5d8; font-size: 10px; pointer-events: none; }
.office-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 14px 0; color: var(--muted); font-size: 11px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; }
.legend-dot.working { background: var(--green); }
.legend-dot.walking { background: #62b6ff; }
.legend-dot.meeting { background: var(--orange); }
.legend-dot.idle { background: #9aa9bb; }
.selected-agent-panel { color: #c7d5e7; font-size: 12px; line-height: 1.8; }

.product-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: #152439; }
.product-card h3 { margin: 0; font-size: 13px; }
.product-card p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.product-price { color: #70d9ae; font-weight: 800; }
.product-card a { color: #8fb1ff; font-size: 11px; }

.modal { position: fixed; inset: 0; z-index: 20; padding: 20px; display: grid; place-items: center; background: #050a12d9; }
.modal-card { position: relative; width: min(530px,100%); padding: 28px; background: #142137; border: 1px solid #354963; border-radius: 15px; }
.modal-card h2 { font-size: 20px; margin: 12px 0 8px; }
.modal-card p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.modal-close { position: absolute; right: 15px; top: 10px; color: white; border: 0; background: none; font-size: 25px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; padding: 13px 18px; border-radius: 9px; color: white; background: #244c43; border: 1px solid #367968; font-size: 12px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media(max-width:1100px) {
  .sidebar { width: 215px; }
  .main-area { margin-left: 215px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .agent-grid, .card-grid { grid-template-columns: repeat(2,1fr); }
}
@media(max-width:720px) {
  .sidebar { position: static; width: 100%; height: auto; }
  .navigation { display: grid; grid-template-columns: repeat(2,1fr); }
  .nav-label { grid-column: 1/-1; }
  .sidebar-bottom { display: none; }
  .main-area { margin-left: 0; }
  .topbar { padding: 16px; }
  .content-area { padding: 18px 14px 40px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 13px; }
  .stat-card strong { font-size: 19px; }
  .agent-grid, .card-grid { grid-template-columns: 1fr; }
  .task-row, .content-row { align-items: flex-start; flex-direction: column; }
  .welcome-mark { display: none; }
  .office-toolbar { align-items: flex-start; flex-direction: column; }
  .office-scene { height: 55vh; min-height: 360px; }
  .scene-hint { left: 10px; right: auto; }
}
