:root {
  --bg: #0e0e10;
  --page: #08090d;
  --panel: rgba(21, 21, 26, 0.85);
  --panel-2: rgba(26, 26, 31, 0.85);
  --insight-panel: rgba(26, 24, 40, 0.85);
  --border: #2a2a30;
  --border-strong: #3c3489;
  --text: #f5f3ed;
  --body: #e8e6e0;
  --muted: #b4b2a9;
  --soft: #6b6963;
  --dim: #888780;
  --green: #1d9e75;
  --green-soft: #5dcaa5;
  --blue: #378add;
  --violet: #7f77dd;
  --violet-soft: #afa9ec;
  --orange: #d85a30;
  --orange-soft: #f0997b;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  --radius-shell: 32px;
  --radius-lg: 24px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  padding: 24px;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

@keyframes echo-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.18; }
  50% { transform: translate(40px, -30px) scale(1.15); opacity: 0.28; }
}
@keyframes echo-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.15; }
  50% { transform: translate(-50px, 40px) scale(1.1); opacity: 0.22; }
}
@keyframes echo-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.12; }
  50% { transform: translate(30px, 50px) scale(1.2); opacity: 0.20; }
}
@keyframes echo-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--green); }
  50% { opacity: 0.6; box-shadow: 0 0 10px var(--green); }
}
@keyframes echo-glow {
  0%, 100% { box-shadow: 0 0 8px var(--violet); }
  50% { box-shadow: 0 0 14px var(--violet-soft); }
}

.dashboard-shell {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 48px);
  background: var(--bg);
  border-radius: var(--radius-shell);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow);
  padding: 32px;
}
.content {
  position: relative;
  z-index: 1;
  transition: transform 240ms ease;
}
.content.chat-focus {
  transform: translateY(-2px);
}
.top-line {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #534ab7, transparent);
}
.orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
}
.orb-1 {
  top: -100px; left: -80px; width: 400px; height: 400px;
  background: radial-gradient(circle, #534ab7 0%, transparent 70%);
  animation: echo-drift-1 18s ease-in-out infinite;
}
.orb-2 {
  right: -100px; bottom: -120px; width: 450px; height: 450px;
  background: radial-gradient(circle, #1d9e75 0%, transparent 70%);
  animation: echo-drift-2 22s ease-in-out infinite;
}
.orb-3 {
  top: 30%; right: 20%; width: 300px; height: 300px;
  background: radial-gradient(circle, #378add 0%, transparent 70%);
  animation: echo-drift-3 26s ease-in-out infinite;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 24px;
}
.eyebrow {
  font-size: 11px;
  color: var(--soft);
  margin: 0 0 4px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.header h1 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.header-controls {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.header-clock { text-align: right; min-width: 160px; padding-top: 4px; }
.logout-button {
  border: 0.5px solid var(--border);
  background: rgba(21, 21, 26, 0.85);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
}
.logout-button:hover,
.logout-button:focus-visible {
  border-color: var(--violet);
  outline: none;
}
.date {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.time {
  font-size: 22px;
  font-weight: 500;
  margin: 2px 0 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.time span {
  font-size: 13px;
  color: var(--soft);
  margin-left: 4px;
}
.intro {
  margin: 0 0 28px;
  max-width: 580px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  font-family: var(--font-serif);
  font-style: italic;
}

.stat-grid,
.main-grid,
.bottom-grid {
  display: grid;
  gap: 14px;
}
.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}
.main-grid {
  grid-template-columns: 1.3fr 1fr;
  margin-bottom: 14px;
}
.bottom-grid {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
  max-height: 520px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition: max-height 320ms ease, opacity 220ms ease, transform 220ms ease, margin 220ms ease;
}
.content.chat-focus .bottom-grid {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  transform: translateY(18px);
  pointer-events: none;
}
.span-7,
.span-5,
.span-6 { min-width: 0; }

.card {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
}
.stat-card { background: var(--panel-2); }
.insight-panel {
  background: var(--insight-panel);
  border-color: var(--border-strong);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.card-header.compact {
  align-items: center;
  margin-bottom: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
  color: var(--text);
}
.metric-label {
  font-size: 11px;
  color: var(--dim);
  margin: 0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.metric-hint,
.small-note,
.panel-footer-note {
  font-size: 11px;
  color: var(--soft);
  margin: 0;
}
.metric-hint.plain {
  padding: 0;
  border: none;
  background: transparent;
}
.metric-value {
  font-size: 32px;
  font-weight: 500;
  margin: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.metric-sub {
  font-size: 11px;
  margin: 8px 0 0;
}
.good { color: var(--green-soft); }
.warn { color: var(--orange-soft); }
.row-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-gap { margin-top: 12px; }
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.status-dot.green { background: var(--green); }
.status-dot.blue { background: var(--blue); }
.live-pulse { animation: echo-pulse 2.5s ease-in-out infinite; }
.insight-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet-soft);
  animation: echo-glow 3s ease-in-out infinite;
}
.bar-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 2px;
  width: 0;
}
.bar-fill.green { background: var(--green); }
.bar-fill.orange { background: var(--orange); }
.stack-bar {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  min-height: 3px;
}
.stack-bar-segment {
  height: 3px;
  border-radius: 2px;
}
.stack-bar-segment.priority { background: var(--orange); }
.stack-bar-segment.rest { background: var(--border); }

.tiny-badge {
  font-size: 10px;
  color: var(--soft);
  background: rgba(26, 26, 31, 0.6);
  padding: 2px 8px;
  border-radius: 10px;
  border: 0.5px solid var(--border);
}

.timeline {
  position: relative;
  padding-left: 8px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 70px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}
.schedule-item {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}
.schedule-time {
  min-width: 56px;
}
.schedule-time .time-main {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.schedule-time .time-meta {
  display: block;
  font-size: 10px;
  color: var(--soft);
  margin: 0;
}
.schedule-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  box-shadow: 0 0 0 3px #15151a, 0 0 0 4px currentColor;
  background: currentColor;
  flex: 0 0 auto;
}
.schedule-marker.blue { color: var(--blue); }
.schedule-marker.green { color: var(--green); }
.schedule-marker.violet { color: var(--violet); }
.schedule-marker.gray { color: #444441; }
.schedule-body {
  flex: 1;
  padding-left: 4px;
}
.schedule-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}
.schedule-detail {
  font-size: 12px;
  color: var(--dim);
  margin: 3px 0 0;
}
.schedule-item.dimmed { opacity: 0.55; }

.mail-item {
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
}
.mail-item:last-child { border-bottom: none; }
.mail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.mail-sender {
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  color: var(--text);
}
.mail-preview {
  font-size: 12px;
  color: var(--dim);
  margin: 0;
  line-height: 1.4;
}
.mail-badge {
  font-size: 10px;
  border-radius: 10px;
  padding: 2px 8px;
}
.mail-badge.urgent {
  color: var(--orange-soft);
  background: #2a1812;
  letter-spacing: 0.05em;
}
.mail-badge.time {
  color: var(--soft);
}

.section-spacer { margin-bottom: 16px; }
.task-item {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 0.5px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-item.done { opacity: 0.72; }
.task-item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.task-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.task-badge {
  font-size: 10px;
  border-radius: 999px;
  padding: 4px 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 0.5px solid var(--border);
  color: var(--soft);
}
.task-badge.open { color: var(--green-soft); }
.task-badge.done { color: var(--muted); }
.task-badge.priority-low { color: var(--soft); }
.task-badge.priority-medium { color: var(--blue); }
.task-badge.priority-high { color: var(--orange-soft); }
.task-badge.priority-urgent { color: #ffb3a0; }
.task-badge.project,
.task-badge.neutral { text-transform: none; }
.task-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 2px;
  border: 1.5px solid #444441;
  flex: 0 0 auto;
}
.task-circle.overdue { border-color: var(--orange); }
.task-main {
  font-size: 13px;
  margin: 0;
  color: var(--text);
}
.task-meta {
  font-size: 11px;
  margin: 3px 0 0;
  letter-spacing: 0.03em;
  color: var(--soft);
}
.task-meta.overdue { color: var(--orange-soft); }
.task-meta.done { color: var(--muted); }
.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.task-action-button {
  border: 0.5px solid var(--border);
  background: rgba(21, 21, 26, 0.85);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.task-action-button:hover,
.task-action-button:focus-visible {
  border-color: var(--violet);
  outline: none;
}
.task-edit-form {
  display: grid;
  gap: 10px;
}
.task-edit-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 120px 1fr 1fr;
}
.task-edit-input,
.task-edit-select {
  width: 100%;
  border: 0.5px solid var(--border);
  border-radius: 12px;
  background: rgba(8, 9, 13, 0.96);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}
.task-edit-input:focus-visible,
.task-edit-select:focus-visible {
  outline: none;
  border-color: var(--violet);
}
.task-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.insight-item {
  padding: 8px 0;
  border-bottom: 0.5px solid var(--border);
}
.insight-item:last-child { border-bottom: none; }
.insight-item p {
  font-size: 12px;
  color: var(--body);
  margin: 0;
  line-height: 1.5;
}

.echo-console {
  display: grid;
  gap: 8px;
}
.chat-stage {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(12px);
  transition: max-height 240ms ease, opacity 220ms ease, transform 220ms ease, padding 220ms ease, border-color 220ms ease;
  background: rgba(17, 18, 24, 0.94);
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 0 14px;
}
.chat-stage-controls {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.chat-minimize {
  border: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-bright);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.chat-minimize:hover {
  background: rgba(127, 119, 221, 0.18);
  color: var(--text);
}
.echo-console.expanded .chat-stage {

  max-height: 380px;
  opacity: 1;
  transform: translateY(0);
  padding: 14px;
  border-color: rgba(127, 119, 221, 0.2);
}
.chat-transcript {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.chat-message {
  border-radius: 16px;
  padding: 11px 13px;
  border: 0.5px solid var(--border);
  background: rgba(10, 10, 14, 0.72);
}
.chat-message.user {
  background: rgba(30, 39, 58, 0.72);
  border-color: rgba(55, 138, 221, 0.25);
}
.chat-message.assistant {
  background: rgba(21, 21, 26, 0.92);
  border-color: rgba(127, 119, 221, 0.25);
}
.chat-message-label {
  margin: 0 0 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft);
}
.chat-message-body {
  margin: 0;
  color: var(--body);
  line-height: 1.55;
  font-size: 13px;
}
.chatbar {
  background: rgba(21, 21, 26, 0.85);
  backdrop-filter: blur(10px);
  border: 0.5px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.echo-console.expanded .chatbar {
  border-color: rgba(127, 119, 221, 0.22);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}
.live {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  flex: 0 0 12px;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: echo-pulse 2.5s ease-in-out infinite;
}
.command-form {
  flex: 1;
}
.command-form.busy {
  opacity: 0.7;
}
.chat-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-sans);
}
.chat-input::placeholder { color: var(--muted); }
.chatbar-right {
  display: flex;
  align-items: center;
}
.chat-orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chat-orb:disabled,
.chat-orb.busy {
  opacity: 0.7;
  cursor: wait;
}
.chat-orb span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--violet-soft);
  display: block;
}

.status-bar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(16px);
  background: rgba(10, 10, 14, 0.92);
  color: var(--body);
  border: 1px solid rgba(127, 119, 221, 0.28);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.status-bar.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hidden { display: none !important; }

.login-shell {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 48px);
  background: var(--bg);
  border-radius: var(--radius-shell);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow);
  padding: 32px;
  display: grid;
  place-items: center;
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  background: rgba(21, 21, 26, 0.9);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(14px);
}
.login-card h1 {
  margin: 0 0 10px;
  font-size: 30px;
  font-weight: 500;
}
.login-copy,
.login-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.login-note {
  font-size: 12px;
  color: var(--soft);
}
.login-form {
  display: grid;
  gap: 12px;
  margin: 22px 0 16px;
}
.login-label {
  font-size: 12px;
  color: var(--soft);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.login-input {
  width: 100%;
  border: 0.5px solid var(--border);
  border-radius: 14px;
  background: rgba(8, 9, 13, 0.96);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
}
.login-input:focus-visible {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 2px rgba(127, 119, 221, 0.15);
}
.login-button {
  margin-top: 8px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--violet), #5f57c8);
  color: var(--text);
  padding: 14px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.login-error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(216, 90, 48, 0.14);
  border: 1px solid rgba(216, 90, 48, 0.35);
  color: var(--orange-soft);
}

@media (max-width: 1100px) {
  .stat-grid,
  .main-grid,
  .bottom-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  body { padding: 12px; }
  .dashboard-shell { padding: 20px; min-height: calc(100vh - 24px); }
  .header,
  .chatbar,
  .chat-stage-header {
    flex-direction: column;
    align-items: stretch;
  }
  .header-clock { text-align: left; }
  .task-edit-grid {
    grid-template-columns: 1fr;
  }
  .task-item-top {
    flex-direction: column;
  }
  .task-badges {
    justify-content: flex-start;
  }
  .chat-transcript {
    max-height: 280px;
  }
  .stat-grid,
  .main-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}
