/* hio.zone dashboard — Claude-inspired warm light theme */
/* Palette: bg #EDE8E0, surface #FFFFFF, border #DDD6CC, text #1A1715 / #6F6961 / #9C958C, accent #C96442 */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Söhne", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; background: #EDE8E0; color: #1A1715; min-height: 100vh; }
header { padding: 16px 24px 0; display: flex; align-items: center; gap: 24px; }
h1 { font-size: 18px; font-weight: 700; color: #1A1715; white-space: nowrap; }
main { padding: 16px 24px 24px; }

/* tabs */
.tabs { display: flex; gap: 4px; }
.tab { background: none; border: none; color: #9C958C; font-size: 13px; padding: 6px 14px; cursor: pointer; border-radius: 6px; font-weight: 500; transition: all .15s; }
.tab:hover { color: #1A1715; background: #DDD6CC; }
.tab.active { color: #1A1715; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* grid layouts */
.grid-2x2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* panels */
.panel { border: 1px solid #DDD6CC; border-radius: 10px; background: #FFFFFF; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.panel-title { font-size: 12px; font-weight: 600; color: #9C958C; padding: 10px 14px; border-bottom: 1px solid #EDE8E0; text-transform: uppercase; letter-spacing: 0.5px; }
.panel-body { padding: 6px 14px 10px; }
.panel-body.loading { color: #9C958C; font-size: 13px; padding: 14px; }

/* rows */
.row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid #F0EBE3; font-size: 13px; }
.row:last-child { border-bottom: none; }

/* dot */
.dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot.online { background: #16A34A; }
.dot.stopped { background: #DC2626; }
.dot.unknown { background: #9C958C; }

/* badges */
.badge { font-size: 10px; padding: 1px 6px; border-radius: 4px; white-space: nowrap; }
.badge-blue { background: #DBEAFE; color: #2563EB; }
.badge-green { background: #DCFCE7; color: #16A34A; }
.badge-yellow { background: #FEF3C7; color: #B45309; }
.badge-red { background: #FEE2E2; color: #DC2626; }
.badge-gray { background: #F0EBE3; color: #6F6961; }

/* text */
.name { font-weight: 500; min-width: 70px; flex-shrink: 0; color: #1A1715; }
.meta { color: #6F6961; font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: "SF Mono", "Fira Code", Consolas, monospace; font-size: 12px; }
.dim { color: #9C958C; }
.strike { text-decoration: line-through; color: #9C958C; }
.link { color: #C96442; text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }
.warn { color: #B45309; }
.danger { color: #DC2626; }
.detail { font-size: 12px; color: #6F6961; padding-left: 16px; margin-top: 1px; }
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #9C958C; padding: 6px 0 2px; }
.ssh-keys { font-size: 12px; font-family: "SF Mono", "Fira Code", Consolas, monospace; color: #6F6961; padding: 4px 0; }

/* collapsible */
.clickable { cursor: pointer; user-select: none; }
.clickable:hover { color: #C96442; }
.chevron { font-size: 10px; width: 12px; flex-shrink: 0; color: #9C958C; }
.collapse-body.collapsed { display: none; }
.group { margin-bottom: 4px; }
.group-title { font-size: 12px; font-weight: 600; color: #1A1715; padding: 4px 0 2px; display: flex; align-items: center; gap: 6px; }

/* ── TODO section ── */
.todo-section { background: #FFFFFF; border: 1px solid #DDD6CC; border-left: 3px solid #d97757; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.todo-header { font-size: 11px; font-weight: 600; color: #9C958C; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.todo-item { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 13px; }
.todo-check { color: #9C958C; flex-shrink: 0; }
.todo-track { font-weight: 500; color: #6F6961; flex-shrink: 0; }
.todo-track::after { content: ':'; }
.todo-text { color: #1A1715; }

/* ── Kanban ── */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.kanban-col { background: #F5F0E8; border: 1px solid #DDD6CC; border-radius: 10px; min-height: 120px; }
.kanban-header { padding: 10px 12px; border-bottom: 1px solid #E8E0D4; display: flex; align-items: center; gap: 8px; }
.kanban-header .col-title { font-size: 12px; font-weight: 600; color: #6F6961; text-transform: uppercase; letter-spacing: 0.5px; }
.kanban-header .count { font-size: 11px; color: #9C958C; }
.kanban-cards { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.kanban-card { background: #FFFFFF; border: 1px solid #DDD6CC; border-radius: 8px; padding: 8px 10px; cursor: pointer; transition: all .15s; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-color: #C9C1B6; }
.kanban-card.origin-human { background: #FDF5EF; border-color: #E8D5C4; }
.kanban-card.origin-human:hover { background: #FBF0E7; border-color: #d9775740; box-shadow: 0 2px 8px rgba(217,119,87,0.1); }
.kanban-card.origin-agent { background: #F0F5FA; border-color: #C8D8E8; }
.kanban-card.origin-agent:hover { background: #EBF1F8; border-color: #4682B440; box-shadow: 0 2px 8px rgba(70,130,180,0.1); }
.kanban-card .card-name { font-size: 13px; font-weight: 500; color: #1A1715; margin-bottom: 3px; }
.kanban-card .card-scope { font-size: 11px; color: #6F6961; }
.kanban-card .card-desc { font-size: 11px; color: #9C958C; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card.shelved { opacity: 0.5; }
.kanban-card.shelved:hover { opacity: 0.8; }

/* ── Memory ── */
.memory-group { background: #FFFFFF; border: 1px solid #DDD6CC; border-radius: 10px; margin-bottom: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.memory-group-header { padding: 10px 14px; border-bottom: 1px solid #EDE8E0; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.memory-group-header:hover { background: #FAF7F2; }
.memory-group-header .mg-title { font-size: 13px; font-weight: 600; color: #1A1715; }
.memory-group-body { padding: 4px 14px 8px; }
.memory-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid #F0EBE3; cursor: pointer; }
.memory-row:last-child { border-bottom: none; }
.memory-row:hover .mono { color: #C96442; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 100; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal { background: #FFFFFF; border: 1px solid #DDD6CC; border-radius: 12px; width: 480px; max-width: 90vw; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #EDE8E0; }
.modal-title { font-size: 15px; font-weight: 600; color: #1A1715; }
.modal-close { cursor: pointer; color: #9C958C; font-size: 16px; padding: 2px 6px; border-radius: 4px; }
.modal-close:hover { background: #F0EBE3; color: #1A1715; }
.modal-body { padding: 14px 18px; }

/* track detail */
.detail-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; font-size: 13px; }
.detail-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #9C958C; min-width: 60px; flex-shrink: 0; }
.detail-index-ref { font-size: 12px; padding-left: 12px; margin: 2px 0; }
.detail-design-card { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 3px 0 3px 12px; background: #F5F0E8; border: 1px solid #DDD6CC; border-radius: 6px; font-size: 12px; cursor: pointer; transition: all .15s; }
.detail-design-card:hover { background: #EDE8E0; border-color: #C9C1B6; text-decoration: none; }
.detail-blocked { font-size: 13px; color: #B45309; padding-left: 12px; margin: 2px 0; }
.detail-notes { font-size: 13px; color: #6F6961; padding-left: 12px; margin: 2px 0; white-space: pre-wrap; }

/* orphan highlight */
.memory-row.orphan { background: #FEF2F2; }

/* ── Demos ── */
.demos-tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.demo-tab { background: #FFFFFF; border: 1px solid #DDD6CC; border-radius: 8px; padding: 6px 14px; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 500; color: #6F6961; transition: all .15s; }
.demo-tab:hover { border-color: #C9C1B6; color: #1A1715; }
.demo-tab.active { background: #1A1715; color: #FAF7F2; border-color: #1A1715; }
.demos-frame-wrap { border: 1px solid #DDD6CC; border-radius: 10px; overflow: hidden; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.demo-iframe { width: 100%; height: calc(100vh - 180px); border: none; display: block; }

/* ── Auth overlay ── */
#auth-overlay { position: fixed; inset: 0; background: #EDE8E0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.auth-box { background: #FFFFFF; border: 1px solid #DDD6CC; border-radius: 12px; padding: 32px; width: 320px; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.auth-box h2 { font-size: 20px; font-weight: 700; color: #1A1715; margin-bottom: 4px; }
.auth-box p { font-size: 13px; color: #9C958C; margin-bottom: 20px; }
.auth-box input { width: 100%; padding: 10px 12px; border: 1px solid #DDD6CC; border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; margin-bottom: 12px; }
.auth-box input:focus { border-color: #C96442; box-shadow: 0 0 0 2px rgba(201,100,66,0.15); }
.auth-box button { width: 100%; padding: 10px; background: #1A1715; color: #FAF7F2; border: none; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; }
.auth-box button:hover { background: #2A2520; }
#auth-error { color: #DC2626; font-size: 12px; margin-top: 8px; }

footer { padding: 8px 24px 16px; font-size: 11px; color: #9C958C; text-align: center; }

@media (max-width: 900px) {
  header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .grid-2x2 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr 1fr; }
  main { padding: 12px; }
}
@media (max-width: 500px) {
  .kanban { grid-template-columns: 1fr; }
}
