:root {
  --bg: #f3efe6;
  --bg-2: #e8e1d3;
  --ink: #1b1a17;
  --muted: #6f6a5b;
  --accent: #2d6a4f;
  --accent-2: #b08933;
  --card: #fdfbf7;
  --shadow: rgba(26, 24, 20, 0.08);
  --border: rgba(43, 39, 32, 0.12);
  --pos-1: #d9f0e2;
  --pos-2: #bfe5cf;
  --pos-3: #93cfac;
  --pos-4: #5fb082;
  --neg-1: #f6d7d2;
  --neg-2: #f0b9ad;
  --neg-3: #e28373;
  --neg-4: #c85b48;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #fff9ec 0%, var(--bg) 45%, var(--bg-2) 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.4), transparent 40%),
    repeating-linear-gradient(135deg, rgba(120, 110, 90, 0.06), rgba(120, 110, 90, 0.06) 1px, transparent 1px, transparent 18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

.brand-mark {
  font-size: 22px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 12px;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.nav-link.active,
.nav-link:hover {
  color: var(--ink);
  background: rgba(45, 106, 79, 0.12);
}

.notify-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notify-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px var(--shadow);
}

.notify-toggle.active {
  background: var(--ink);
  color: var(--card);
  border-color: var(--ink);
}

.notify-toggle:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.notify-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.notify-status {
  font-size: 12px;
  color: var(--muted);
}

.signal-popup {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 24px;
}

.signal-popup.active {
  display: flex;
}

.signal-popup-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
  display: grid;
  gap: 14px;
  width: min(90vw, 640px);
  max-height: 80vh;
  overflow: auto;
}

.signal-popup-title {
  font-weight: 700;
  font-size: 20px;
}

.signal-popup-body {
  font-size: 14px;
  color: var(--muted);
}

.signal-popup-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.notify-test {
  border: 1px dashed var(--border);
  background: var(--card);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.notify-test:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.notify-test:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.content {
  flex: 1;
  padding: 30px 40px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  animation: rise 0.4s ease-out;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.title {
  margin: 0;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: 32px;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.month-label {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.chip {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 6px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  transition: all 0.2s ease;
}

.chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px var(--shadow);
}

.alert {
  background: #fff4e5;
  padding: 12px 16px;
  border-left: 4px solid var(--accent-2);
  border-radius: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.grid.two-col {
  grid-template-columns: minmax(240px, 1.2fr) minmax(240px, 0.8fr);
}

.card {
  background: var(--card);
  padding: 20px 24px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(26, 24, 20, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.stat {
  font-size: 26px;
  font-weight: 700;
}

.stat-sub {
  margin-top: 8px;
  color: var(--muted);
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(320px, 2.2fr) minmax(260px, 1fr);
  gap: 20px;
}

.calendar-panel {
  background: var(--card);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(26, 24, 20, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 0 4px 10px;
}

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.day-cell {
  border: 1px solid rgba(26, 24, 20, 0.08);
  background: #f8f6f1;
  border-radius: 12px;
  padding: 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.day-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px var(--shadow);
}

.day-cell.muted {
  opacity: 0.45;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.page-header h1 {
  margin: 0;
}

.filter-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  background: var(--border);
  border-color: var(--ink);
}

.filter-chip.active {
  background: var(--ink);
  color: var(--card);
  border-color: var(--ink);
}

.filter-chip.active:hover {
  background: var(--ink);
  opacity: 0.9;
}

.day-cell.selected {
  outline: 3px solid var(--accent);
  outline-offset: -2px;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--accent);
  transform: scale(1.02);
  z-index: 1;
  position: relative;
}

.day-number {
  font-weight: 700;
}

.day-pnl {
  font-size: 12px;
}

.day-count {
  font-size: 11px;
  color: var(--muted);
}

.pnl-zero {
  background: #f2eee6;
}

.pnl-pos-1 {
  background: var(--pos-1);
}

.pnl-pos-2 {
  background: var(--pos-2);
}

.pnl-pos-3 {
  background: var(--pos-3);
  color: #103922;
}

.pnl-pos-4 {
  background: var(--pos-4);
  color: #f8fff9;
}

.pnl-neg-1 {
  background: var(--neg-1);
}

.pnl-neg-2 {
  background: var(--neg-2);
}

.pnl-neg-3 {
  background: var(--neg-3);
  color: #2a0d08;
}

.pnl-neg-4 {
  background: var(--neg-4);
  color: #fff7f4;
}

.detail-panel {
  background: var(--card);
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(26, 24, 20, 0.05);
  box-shadow: 0 12px 24px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-summary {
  display: grid;
  gap: 10px;
}

.detail-summary .label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: block;
}

.detail-summary .value {
  font-weight: 600;
}

.detail-list {
  max-height: 360px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trade-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.trade-card .row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.trade-card .row strong {
  font-weight: 700;
}

.empty {
  color: var(--muted);
}

.month-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}

.month-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 4px;
  text-align: center;
}

.month-name {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.month-pnl {
  font-weight: 700;
}

.table-wrap {
  background: var(--card);
  border-radius: 18px;
  border: 1px solid rgba(26, 24, 20, 0.05);
  overflow: hidden;
  box-shadow: 0 12px 24px var(--shadow);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(26, 24, 20, 0.08);
  text-align: left;
}

.data-table th {
  background: rgba(45, 106, 79, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.data-table td.pos {
  color: var(--accent);
  font-weight: 600;
}

.data-table td.neg {
  color: #b00020;
  font-weight: 600;
}

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

.filter input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fffdf7;
}

.trade-settings {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--card);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.trade-settings-title {
  font-weight: 600;
}

.trade-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.trade-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

.trade-field input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fffdf7;
  min-width: 120px;
}

.api-badge {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(45, 106, 79, 0.15);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(45, 106, 79, 0.25);
}

.pager {
  display: flex;
  gap: 8px;
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.watch-card {
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(26, 24, 20, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  display: grid;
  gap: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.watch-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.watch-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.watch-title {
  font-weight: 700;
  font-size: 16px;
}

.watch-meta {
  font-size: 12px;
  color: var(--muted);
}

.watch-body {
  display: grid;
  gap: 6px;
  font-size: 13px;
}

.watch-line code {
  background: rgba(45, 106, 79, 0.12);
  padding: 2px 6px;
  border-radius: 8px;
  font-family: \"Courier New\", monospace;
  font-size: 12px;
}

.watch-chart {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(26, 24, 20, 0.08);
  background: #faf6ee;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.watch-chart img {
  width: 100%;
  height: auto;
  display: block;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.signal-card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(26, 24, 20, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  display: grid;
  gap: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.signal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.3s ease;
}

.signal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
}

.signal-card.signal-success {
  background: linear-gradient(135deg, rgba(217, 240, 226, 0.85) 0%, rgba(191, 229, 207, 0.75) 50%, rgba(147, 207, 172, 0.65) 100%);
  border-color: rgba(95, 176, 130, 0.5);
  border-width: 2px;
  box-shadow: 0 12px 24px rgba(95, 176, 130, 0.15), 0 0 0 1px rgba(95, 176, 130, 0.1);
}

.signal-card.signal-success:hover {
  box-shadow: 0 16px 32px rgba(95, 176, 130, 0.2), 0 0 0 1px rgba(95, 176, 130, 0.15);
}

.signal-card.signal-loss {
  background: linear-gradient(135deg, rgba(246, 215, 210, 0.85) 0%, rgba(240, 185, 173, 0.75) 50%, rgba(226, 131, 115, 0.65) 100%);
  border-color: rgba(200, 91, 72, 0.5);
  border-width: 2px;
  box-shadow: 0 12px 24px rgba(200, 91, 72, 0.15), 0 0 0 1px rgba(200, 91, 72, 0.1);
}

.signal-card.signal-loss:hover {
  box-shadow: 0 16px 32px rgba(200, 91, 72, 0.2), 0 0 0 1px rgba(200, 91, 72, 0.15);
}

.signal-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.signal-outcome {
  font-weight: 600;
  font-size: 0.95em;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.05);
  display: inline-block;
  width: fit-content;
}

.signal-title-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.signal-title {
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}

.signal-id {
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
  margin-left: 8px;
}

.signal-status {
  flex-shrink: 0;
  margin-top: 2px;
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.status-badge.status-open {
  background: rgba(176, 137, 51, 0.15);
  color: #8b6914;
  border: 1px solid rgba(176, 137, 51, 0.3);
}

.status-badge.status-closed {
  background: rgba(111, 106, 91, 0.15);
  color: #4a463d;
  border: 1px solid rgba(111, 106, 91, 0.3);
}

.signal-meta {
  font-size: 12px;
  color: var(--muted);
}

.signal-body {
  display: grid;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.signal-line {
  color: var(--ink);
}

.signal-line code {
  background: rgba(45, 106, 79, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  color: var(--ink);
}

.signal-tp {
  margin-left: 20px;
  font-size: 12px;
  color: var(--muted);
}

.signal-chart {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(26, 24, 20, 0.08);
  background: #faf6ee;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.signal-chart img {
  width: 100%;
  height: auto;
  display: block;
}

.signal-chart.empty {
  font-size: 12px;
}

.footer {
  padding: 20px 40px 30px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .dashboard {
    grid-template-columns: 1fr;
  }

  .grid.two-col {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

.chart-clickable {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.chart-clickable:hover {
  opacity: 0.9;
}

.chart-clickable img {
  cursor: pointer;
}

.chart-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  animation: fadeIn 0.2s ease;
}

.chart-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-modal-content img {
  max-width: 100%;
  max-height: 95vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.chart-modal-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  background: rgba(0, 0, 0, 0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.chart-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .content {
    padding: 20px;
  }

  .week {
    gap: 6px;
  }

  .day-cell {
    padding: 8px;
  }

  .chart-modal-close {
    top: 10px;
    right: 15px;
    font-size: 30px;
    width: 40px;
    height: 40px;
  }
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}

.overview-card {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  border: 1px solid rgba(26, 24, 20, 0.08);
  box-shadow: 0 12px 24px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.overview-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
}

.overview-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.overview-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.overview-section {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.calendar-header {
  margin: 24px 0;
  padding: 0;
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.month-select-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.month-label {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  min-width: 150px;
  text-align: center;
}

.month-select-form {
  display: inline-block;
}

.month-input {
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}

.month-input:hover {
  border-color: var(--accent);
}

.month-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
}

.stat-row.highlight {
  font-weight: 700;
  font-size: 16px;
  padding: 12px;
  background: rgba(45, 106, 79, 0.08);
  border-radius: 8px;
  margin-top: 8px;
}

.stat-row.positive .stat-value {
  color: var(--accent);
}

.stat-row.negative .stat-value {
  color: #c85b48;
}

.stat-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0 12px 0;
}

.stat-section-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.signal-line code.positive {
  color: var(--accent);
  font-weight: 600;
}

.signal-line code.negative {
  color: #c85b48;
  font-weight: 600;
}

.stat-label {
  color: var(--ink);
}

.stat-value {
  font-weight: 600;
  color: var(--ink);
}

.day-summary {
  padding: 12px 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-label {
  font-weight: 500;
  color: var(--ink);
}

.summary-value {
  font-weight: 600;
  color: var(--ink);
}

.signal-gate {
  margin-top: 14px;
  padding: 14px;
  background: rgba(45, 106, 79, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(45, 106, 79, 0.12);
}

.gate-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.gate-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.gate-title {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  flex-shrink: 0;
}

.gate-status {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  flex-shrink: 1;
  min-width: 0;
}

.gate-status.gate-allowed {
  background: rgba(45, 106, 79, 0.15);
  color: var(--accent);
  border: 1px solid rgba(45, 106, 79, 0.25);
}

.gate-status.gate-blocked {
  background: rgba(200, 91, 72, 0.15);
  color: #c85b48;
  border: 1px solid rgba(200, 91, 72, 0.25);
  flex-basis: 100%;
  margin-left: 0;
}

.gate-note {
  font-weight: 400;
  font-size: 11px;
  opacity: 0.8;
}

.gate-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(45, 106, 79, 0.1);
}

.gate-detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}

.gate-detail-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.gate-detail-label {
  color: var(--muted);
  font-weight: 500;
  min-width: 85px;
  flex-shrink: 0;
}

.gate-detail-value {
  color: var(--ink);
  font-weight: 600;
  flex-shrink: 0;
}

.gate-detail-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  margin-left: auto;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  font-size: 13px;
}

.user-email {
  color: var(--muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-logout {
  text-decoration: none;
  font-weight: 600;
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(45, 106, 79, 0.25);
  background: rgba(45, 106, 79, 0.06);
  transition: all 0.2s ease;
}

.user-logout:hover {
  background: rgba(45, 106, 79, 0.16);
}

/* Login layout */
.login-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 10% 10%, #fff9ec 0%, var(--bg) 45%, var(--bg-2) 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}

.login-shell {
  width: 100%;
  max-width: 520px;
  padding: 32px 20px 40px;
}

.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.login-wrapper {
  display: flex;
  justify-content: center;
}

.login-card {
  width: 100%;
  background: var(--card);
  border-radius: 20px;
  padding: 28px 26px 26px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16), 0 4px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(26, 24, 20, 0.12);
  backdrop-filter: blur(16px);
}

.login-header .title {
  font-size: 24px;
}

.login-header .subtitle {
  font-size: 14px;
}

.login-form {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fffdf7;
  font-size: 14px;
  font-family: inherit;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.14);
}

.alert-error {
  margin-bottom: 4px;
  background: #fce4e4;
  border-left-color: #c85b48;
  color: #7a2623;
}

.chip-primary {
  background: var(--ink);
  color: var(--card);
  border-color: var(--ink);
}

.chip-primary:hover {
  background: #000;
  border-color: #000;
}

.login-submit {
  width: 100%;
  justify-content: center;
  text-align: center;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .login-shell {
    max-width: 100%;
    padding: 20px 16px 24px;
  }

  .login-card {
    padding: 22px 18px 20px;
  }
}
