/* Kairo Console layout. Builds on /css/base.css tokens. */
body { overflow-x: hidden; }

.con { position: relative; z-index: 1; display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

/* ---------- Sidebar ---------- */
.con-side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 14px 18px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(12, 11, 22, 0.86), rgba(8, 8, 15, 0.9)); backdrop-filter: blur(18px);
  overflow-y: auto; z-index: 40;
}
.con-scrim { display: none; }
.con-brand { padding: 4px 8px 6px; min-width: 0; }
.con-brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.con-nav { display: grid; gap: 3px; }
.con-link {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14.5px; transition: background 0.18s, color 0.18s;
}
.con-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.con-link.active { background: var(--grad-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.22); }
.con-link.active .i { color: var(--accent); }
.con-nav-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.con-side-social { padding: 0 8px; }
.con-side-foot { margin-top: auto; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel-2); }
.con-foot-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.con-meter { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; margin: 10px 0 8px; }
.con-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width 0.5s ease; }
.con-foot-text { font-size: 12.5px; color: var(--muted); }
.con-live { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--dim); }
.con-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(75, 227, 160, 0.6); animation: conPulse 2.4s infinite; }
@keyframes conPulse { 0% { box-shadow: 0 0 0 0 rgba(75, 227, 160, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(75, 227, 160, 0); } 100% { box-shadow: 0 0 0 0 rgba(75, 227, 160, 0); } }

/* ---------- Main ---------- */
.con-main { min-width: 0; padding: 0 32px 60px; }
.con-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  margin: 0 -32px 26px; padding: 14px 32px; border-bottom: 1px solid var(--line);
  background: rgba(7, 7, 13, 0.72); backdrop-filter: blur(16px);
}
.con-menu { display: none; }
.con-icon-btn { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--muted); }
.con-icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.con-search {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 40px;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.035); color: var(--dim);
  transition: border-color 0.2s, background 0.2s;
}
.con-search:focus-within { border-color: rgba(255, 181, 71, 0.45); background: rgba(255, 255, 255, 0.05); }
.con-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.con-search input::placeholder { color: var(--dim); }
.con-search input::-webkit-search-cancel-button { filter: invert(0.7); }
.con-top-cta { margin-left: auto; }

.con-view { display: none; animation: conIn 0.28s ease; }
.con-view.active { display: block; }
@keyframes conIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.con-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.con-head h1 { margin: 0; font: 600 clamp(26px, 3vw, 34px)/1.15 var(--display); letter-spacing: -0.025em; }
.con-sub { margin: 6px 0 0; color: var(--muted); max-width: 640px; }
.con-muted { color: var(--muted); margin: 6px 0 14px; font-size: 14px; }
.con-fine { font-size: 12.5px; color: var(--dim); margin: 14px 0 0; }

.con-card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; backdrop-filter: blur(14px); min-width: 0; }
.con-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.con-card-head h3 { margin: 0; font: 600 15px var(--display); letter-spacing: -0.01em; }
.con-note { font-size: 12.5px; color: var(--dim); }
.con-link-sm { color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.con-link-sm:hover { text-decoration: underline; }
.con-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }

/* Onboarding */
.con-onboard { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; background: linear-gradient(120deg, rgba(255, 181, 71, 0.1), rgba(143, 124, 255, 0.1)), var(--panel); border-color: rgba(255, 181, 71, 0.25); }
.con-onboard-ico { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 15px; background: var(--grad); color: var(--accent-ink); }
.con-onboard-text { flex: 1; min-width: 0; }
.con-onboard-text h3 { margin: 0 0 2px; font: 600 16px var(--display); }
.con-onboard-text p { margin: 0; color: var(--muted); font-size: 14px; }

/* Stats */
.con-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.con-stat { position: relative; overflow: hidden; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); }
.con-stat::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 181, 71, 0.14), transparent 70%); }
.con-stat:nth-child(2)::after { background: radial-gradient(circle, rgba(143, 124, 255, 0.18), transparent 70%); }
.con-stat:nth-child(3)::after { background: radial-gradient(circle, rgba(75, 227, 160, 0.15), transparent 70%); }
.con-stat:nth-child(4)::after { background: radial-gradient(circle, rgba(63, 214, 198, 0.15), transparent 70%); }
.con-stat-l { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.con-stat-v { font: 600 30px/1.2 var(--display); letter-spacing: -0.03em; margin: 6px 0 4px; }
.con-stat-v small { font-size: 16px; color: var(--dim); font-weight: 500; }
.con-stat-d { font-size: 12.5px; color: var(--dim); }
.con-stat-d.up { color: var(--ok); }

/* Chart */
.con-chart { height: 190px; display: flex; align-items: stretch; gap: 6px; }
.con-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.con-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.con-bar {
  position: relative; width: 100%; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #ffb547, rgba(143, 124, 255, 0.75));
  transform-origin: bottom; animation: conGrow 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.con-bar.zero { background: rgba(255, 255, 255, 0.08); animation: none; }
.con-bar.today { box-shadow: 0 0 18px -4px rgba(255, 181, 71, 0.7); }
.con-bar::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translate(-50%, 4px);
  padding: 4px 8px; border-radius: 8px; white-space: nowrap; font-size: 11.5px; background: #1d1b30; border: 1px solid var(--line-2);
  color: var(--text); opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; z-index: 2;
}
.con-col:hover .con-bar::after { opacity: 1; transform: translate(-50%, 0); }
.con-col-l { height: 16px; font-size: 10.5px; color: var(--dim); white-space: nowrap; }
@keyframes conGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Usage */
.con-usage { display: grid; gap: 6px; }
.con-urow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border-radius: 12px; border: 0; background: transparent; text-align: left; transition: background 0.18s; }
.con-urow:hover { background: rgba(255, 255, 255, 0.04); }
.con-umain { flex: 1; min-width: 0; }
.con-utop { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.con-utop span { color: var(--dim); font-variant-numeric: tabular-nums; }
.con-ubar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin-top: 6px; }
.con-ubar i { display: block; height: 100%; border-radius: inherit; transition: width 0.5s ease; }

/* Avatars */
.con-av { flex: none; display: grid; place-items: center; border-radius: 11px; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.con-av .i { width: 56%; height: 56%; }
.con-av.you { background: rgba(255, 255, 255, 0.08); color: var(--muted); }

/* Agent mini grid */
.con-agent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.con-acard { padding: 12px; border-radius: 15px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); cursor: pointer; transition: border-color 0.2s, transform 0.2s, background 0.2s; min-width: 0; }
.con-acard:hover { border-color: rgba(255, 181, 71, 0.35); background: rgba(255, 181, 71, 0.04); transform: translateY(-1px); }
.con-acard-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.con-acard-top > div { min-width: 0; }
.con-aname { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; min-width: 0; }
.con-aname span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con-arole { margin: 8px 0; font-size: 12.5px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.9em; }
.con-ameta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--dim); }

/* Badges + chips */
.con-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.con-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.con-badge.active { color: var(--ok); background: rgba(75, 227, 160, 0.1); border-color: rgba(75, 227, 160, 0.25); }
.con-badge.active::before { box-shadow: 0 0 8px currentColor; }
.con-badge.idle { color: var(--muted); background: rgba(255, 255, 255, 0.05); border-color: var(--line); }
.con-badge.paused { color: var(--warn); background: rgba(255, 207, 92, 0.1); border-color: rgba(255, 207, 92, 0.25); }
.con-custom { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 6px; border-radius: 6px; background: rgba(143, 124, 255, 0.16); color: #c3b8ff; flex: none; }
.con-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.con-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--muted); font-size: 13px; font-weight: 500; transition: all 0.18s; }
.con-chip:hover { color: var(--text); border-color: var(--line-2); }
.con-chip.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.con-chip .con-dot-c { width: 8px; height: 8px; border-radius: 50%; }

/* Feed */
.con-feed { list-style: none; margin: 0; padding: 0; display: grid; }
.con-feed li { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); min-width: 0; }
.con-feed li:last-child { border-bottom: 0; }
.con-fdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.con-ftext { flex: 1; min-width: 0; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con-ftext b { color: var(--text); font-weight: 600; }
.con-ftime { font-size: 11.5px; color: var(--dim); white-space: nowrap; flex: none; }
.con-feed .con-empty-li { justify-content: center; color: var(--dim); font-size: 14px; padding: 22px 8px; border: 0; white-space: normal; text-align: center; display: block; }
.con-feed .con-empty-li a, .con-tasks .con-empty-li a { color: var(--accent); }

/* Table */
.con-table-card { padding: 0; overflow: hidden; }
.con-table-scroll { overflow-x: auto; }
.con-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.con-table th { text-align: left; padding: 13px 16px; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.con-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.con-table tbody tr { cursor: pointer; transition: background 0.15s; }
.con-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.con-table tbody tr:last-child td { border-bottom: 0; }
.con-cell { display: flex; align-items: center; gap: 11px; }
.con-cell b { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.con-cell small { display: block; color: var(--dim); font-size: 12px; }
.con-acts { display: flex; gap: 6px; justify-content: flex-end; }
.con-empty { padding: 28px; text-align: center; color: var(--dim); }

/* Tasks */
.con-tasks-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.con-add { display: flex; gap: 8px; flex: 1; max-width: 460px; min-width: 240px; margin-bottom: 14px; }
.con-add input, .con-field input {
  flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035); color: var(--text); outline: 0; transition: border-color 0.2s;
}
.con-add input:focus, .con-field input:focus { border-color: rgba(255, 181, 71, 0.5); }
.con-tasks { list-style: none; margin: 0; padding: 0; }
.con-task { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.con-task:last-child { border-bottom: 0; }
.con-task label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.con-task input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex: none; margin: 0; border-radius: 7px; border: 1.6px solid var(--line-2);
  background: transparent; display: grid; place-items: center; cursor: pointer; transition: all 0.18s;
}
.con-task input[type="checkbox"]:checked { background: var(--ok); border-color: var(--ok); }
.con-task input[type="checkbox"]:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid #06150e; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.con-task-text { min-width: 0; overflow-wrap: anywhere; }
.con-task.done .con-task-text { color: var(--dim); text-decoration: line-through; }
.con-task-src { font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.05); color: var(--muted); white-space: nowrap; }
.con-task .con-ftime { min-width: 62px; text-align: right; }
.con-del { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; border: 0; background: transparent; color: var(--dim); }
.con-del:hover { background: rgba(255, 107, 129, 0.1); color: var(--danger); }
.con-tasks .con-empty-li { list-style: none; padding: 26px 8px; text-align: center; color: var(--dim); }
.con-task-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--dim); }
.con-task-foot:not(:empty) { padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--line); }
.con-textbtn { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13px; padding: 4px; }
.con-textbtn:hover { text-decoration: underline; }

/* Settings */
.con-settings { max-width: 640px; margin-bottom: 16px; }
.con-settings h3 { margin: 0; font: 600 16px var(--display); }
.con-field { display: grid; gap: 8px; }
.con-field span { font-size: 13px; color: var(--muted); font-weight: 500; }
.con-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* Drawer */
.con-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(3, 3, 8, 0.6); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.con-overlay.show { opacity: 1; pointer-events: auto; }
.con-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(440px, 100vw); display: flex; flex-direction: column;
  background: var(--panel-solid); border-left: 1px solid var(--line-2); box-shadow: -30px 0 80px -30px rgba(0, 0, 0, 0.8);
  transform: translateX(105%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); visibility: hidden;
}
.con-drawer.open { transform: none; visibility: visible; }
.con-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.con-drawer-head h2 { margin: 0; font: 600 20px var(--display); letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con-drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.con-dtop { display: flex; align-items: center; gap: 14px; }
.con-dtop p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.con-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 20px 0 6px; }
.con-kv div { padding: 11px 12px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); }
.con-kv span { display: block; font-size: 11.5px; color: var(--dim); }
.con-kv b { font: 600 18px var(--display); }
.con-sec { margin: 22px 0 10px; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.con-prompts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.con-prompts li { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); font-size: 13.5px; overflow-wrap: anywhere; }
.con-prompts small { display: block; margin-top: 4px; color: var(--dim); font-size: 11.5px; }
.con-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.con-tag { padding: 4px 10px; border-radius: 99px; font-size: 12px; background: rgba(255, 181, 71, 0.1); color: #ffd394; border: 1px solid rgba(255, 181, 71, 0.2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.con-dacts { display: flex; flex-wrap: wrap; gap: 8px; }
.con-dacts .btn { flex: 1 1 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .con-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .con-grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .con { grid-template-columns: minmax(0, 1fr); }
  .con-side {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(282px, 86vw); height: auto;
    transform: translateX(-102%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: 30px 0 80px -30px rgba(0, 0, 0, 0.85);
    z-index: 80;
  }
  .con.side-open .con-side { transform: none; }
  .con-scrim { display: block; position: fixed; inset: 0; z-index: 75; background: rgba(3, 3, 8, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  .con.side-open .con-scrim { opacity: 1; pointer-events: auto; }
  .con-menu { display: grid; }
  .con-main { padding: 0 16px 48px; }
  .con-top { margin: 0 -16px 20px; padding: 12px 16px; }
}
@media (max-width: 560px) {
  .con-top-cta span { display: none; }
  .con-top-cta { padding: 9px 11px; }
  .con-stats { gap: 10px; }
  .con-stat { padding: 13px 14px; }
  .con-stat-v { font-size: 24px; }
  .con-agent-grid { grid-template-columns: minmax(0, 1fr); }
  .con-onboard { flex-wrap: wrap; }
  .con-card { padding: 16px; border-radius: 18px; }
  .con-chart { height: 160px; gap: 4px; }
  .con-task .con-ftime { display: none; }
  .con-add { min-width: 0; max-width: none; width: 100%; }
  .con-tasks-bar { display: block; }
  .con-kv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .con-view, .con-bar { animation: none; }
  .con-live-dot { animation: none; }
}
