﻿:root {
  --bg: #0b0c10;
  --surface: #13151c;
  --surface-2: #1b1e28;
  --border: #262a36;
  --text: #e6e8ef;
  --muted: #8b92a5;
  --accent: #f38020;
  --success: #22c55e;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.brand h1 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.clock-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 8px;
}

.clock-box .divider { margin: 0 8px; color: var(--border); }

.tab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.tab-btn:hover { color: var(--text); border-color: #3a4052; }
.tab-btn.active {
  background: var(--accent);
  color: #0b0c10;
  border-color: var(--accent);
  font-weight: 600;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.bento-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.risk-grid { grid-template-columns: 1.1fr 1fr; }
.sessions-grid { grid-template-columns: repeat(4, 1fr); }
.journal-top { grid-template-columns: repeat(4, 1fr); }
.journal-main { grid-template-columns: 340px 1fr; }
.span-full { grid-column: 1 / -1; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 0.78rem; color: var(--muted); }
.field input, .field select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.kpi, .kpi-mini {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-mini { background: var(--surface); }
.kpi-label { font-size: 0.76rem; color: var(--muted); }
.kpi strong, .kpi-mini strong { font-size: 1.25rem; font-weight: 600; }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.rr-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.rr-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.rr-bar {
  display: flex;
  height: 10px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 8px;
}

.rr-risk { background: var(--danger); transition: width 0.2s; }
.rr-reward { background: var(--success); transition: width 0.2s; }
.muted-note { font-size: 0.8rem; color: var(--muted); }

.session-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.session-head h3 { font-size: 1rem; }
.session-time { font-size: 0.85rem; color: var(--text); font-family: monospace; }
.session-wib { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.badge.open {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
  border-color: rgba(34, 197, 94, 0.4);
}

.timeline-head, .card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
}
.card-head-row h2, .timeline-head h2 { margin-bottom: 0; }

.timeline-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 0;
}

.timeline-row {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 10px;
}

.t-label { font-size: 0.8rem; color: var(--muted); }
.t-track {
  position: relative;
  height: 16px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}

.t-bar { position: absolute; top: 0; bottom: 0; border-radius: 4px; opacity: 0.85; }
.bar-sydney { background: #a855f7; }
.bar-tokyo { background: #3b82f6; }
.bar-london { background: #f38020; }
.bar-ny { background: #22c55e; }

.now-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
  pointer-events: none;
}

.timeline-axis {
  display: flex;
  justify-content: space-between;
  padding-left: 86px;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: monospace;
}

.btn-primary {
  background: var(--accent);
  color: #0b0c10;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }

.btn-group { display: flex; gap: 8px; }
.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
}
.btn-ghost.danger:hover { border-color: var(--danger); color: var(--danger); }

canvas { width: 100%; display: block; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
th { color: var(--muted); font-weight: 500; font-size: 0.78rem; }

.btn-del {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
}
.btn-del:hover { color: var(--danger); border-color: var(--danger); }

@media (max-width: 860px) {
  .risk-grid, .sessions-grid, .journal-top, .journal-main {
    grid-template-columns: 1fr;
  }
}
