﻿:root {
  color-scheme: dark;
  --bg: #0c0d10;
  --panel: #121316;
  --panel-2: #18191d;
  --panel-3: #202226;
  --line: #2b2d33;
  --line-soft: #202227;
  --text: #f1f3f5;
  --muted: #8f949d;
  --dim: #656b76;
  --blue: #2f7df6;
  --blue-soft: rgba(47, 125, 246, 0.14);
  --green: #21c77a;
  --yellow: #f2c94c;
  --red: #ff5f57;
  --cyan: #4fc3f7;
  --shadow: 0 18px 55px rgba(0, 0, 0, 0.42);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1120px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  height: 100vh;
  min-height: 760px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: #0a0b0d;
  border-bottom: 1px solid var(--line);
}

.account-pill {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #6da5a8;
  color: white;
  font-weight: 800;
}

.symbol-pill {
  height: 38px;
  min-width: 156px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  text-align: left;
  background: #2b2d31;
  color: white;
  font-weight: 800;
  letter-spacing: 0;
}

.timeframes {
  display: flex;
  height: 38px;
  align-items: center;
  gap: 2px;
  padding-left: 4px;
  border-left: 1px solid var(--line);
}

.timeframes button,
.publish-button,
.icon-button,
.mini-button,
.text-button,
.primary-button,
.tab,
.rail-button {
  border: 0;
  cursor: pointer;
}

.timeframes button {
  height: 38px;
  min-width: 42px;
  background: transparent;
  border-radius: 6px;
  color: #dce3ee;
  font-weight: 750;
}

.timeframes button.active {
  background: #30343b;
}

.layout-title {
  margin-left: auto;
  color: #f5f7fb;
  font-weight: 800;
}

.publish-button {
  height: 36px;
  border-radius: 18px;
  padding: 0 18px;
  background: #ffffff;
  color: #0a0b0d;
  font-weight: 850;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 64px minmax(620px, 1fr) 430px;
  background: var(--bg);
}

.tool-rail {
  border-right: 1px solid var(--line);
  background: #111215;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-button {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  background: transparent;
  color: #c9ced6;
  font-size: 20px;
}

.rail-button.active,
.rail-button:hover {
  background: #2c2f36;
}

.chart-stage {
  min-width: 0;
  padding: 16px;
  background: #f7f8fa;
  color: #1f242c;
}

.chart-grid {
  height: 100%;
  min-height: 640px;
  border: 1px solid #d6dae2;
  background:
    repeating-linear-gradient(90deg, rgba(47, 125, 246, 0.10) 0 18px, transparent 18px 72px),
    repeating-linear-gradient(0deg, transparent 0 68px, rgba(44, 51, 61, 0.12) 68px 69px),
    #fbfcfe;
  display: flex;
  flex-direction: column;
}

.chart-header {
  height: 72px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #dfe3eb;
}

.small-muted {
  display: block;
  color: #7d8592;
  font-size: 12px;
  font-weight: 700;
}

.chart-header strong {
  font-size: 22px;
  letter-spacing: 0;
}

.market-chip {
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 5px;
  background: #101216;
  color: #f6f7f9;
  font-size: 12px;
  font-weight: 800;
}

.rule-board {
  flex: 1;
  min-height: 0;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  align-content: start;
  gap: 12px;
  overflow: auto;
}

.rule-tile {
  min-height: 142px;
  border: 1px solid #d4d9e2;
  border-radius: 6px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.rule-tile header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
  margin-bottom: 12px;
}

.rule-tile h3 {
  margin: 0;
  font-size: 15px;
}

.rule-tile .summary {
  min-height: 34px;
  color: #5f6875;
  font-size: 12px;
  line-height: 1.45;
}

.condition-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.condition-chip {
  border: 1px solid #ccd3df;
  border-radius: 4px;
  padding: 4px 7px;
  background: #ffffff;
  color: #394252;
  font-size: 12px;
  font-weight: 700;
}

.condition-chip.hit {
  border-color: rgba(33, 199, 122, 0.45);
  color: #087847;
  background: rgba(33, 199, 122, 0.12);
}

.alerts-panel {
  border-left: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-tabs {
  height: 56px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  border-bottom: 1px solid var(--line);
}

.tab {
  border-radius: 6px;
  background: #27292e;
  color: #c8cdd5;
  font-weight: 850;
}

.tab.active {
  background: #4a4a4a;
  color: #ffffff;
}

.tab span {
  min-width: 24px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  border-radius: 9px;
  background: #ec3445;
  color: white;
  font-size: 11px;
}

.status-filter {
  height: 44px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #101114;
}

.filter-button {
  border: 0;
  border-radius: 5px;
  background: #1b1d22;
  color: #aeb5bf;
  cursor: pointer;
  font-weight: 850;
}

.filter-button.active,
.filter-button:hover {
  background: #30333a;
  color: #ffffff;
}

.filter-button span {
  margin-left: 4px;
  color: #7f8792;
  font-size: 12px;
}

.filter-button.active span {
  color: #dce3ee;
}
.symbol-filter {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #0f1014;
  overflow-x: auto;
}

.symbol-button {
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 5px;
  padding: 0 10px;
  background: #191b20;
  color: #aeb5bf;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.symbol-button.active,
.symbol-button:hover {
  background: #30333a;
  color: #ffffff;
}

.symbol-button span {
  margin-left: 5px;
  color: #77808d;
  font-size: 11px;
}

.symbol-button.active span {
  color: #dce3ee;
}
.panel-actions {
  height: 64px;
  flex: 0 0 64px;
  display: grid;
  grid-template-columns: 44px 1fr 44px 44px;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

.sync-strip {
  min-height: 114px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #101114;
}

.sync-strip span {
  grid-column: 1 / -1;
  min-height: 24px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.sync-strip .mini-button {
  width: 100%;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 5px;
  background: transparent;
  color: #d6dbe3;
  font-size: 24px;
}

.icon-button:hover {
  background: var(--panel-3);
}

.search-box {
  height: 38px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: #0e0f12;
  overflow: hidden;
}

.search-box span::before {
  content: "";
  width: 13px;
  height: 13px;
  display: block;
  margin-left: 11px;
  border: 2px solid var(--muted);
  border-radius: 50%;
  box-shadow: 8px 8px 0 -6px var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.list-shell {
  flex: 1;
  min-height: 0;
  position: relative;
}

.alerts-list,
.incidents-list,
.logs-list {
  height: 100%;
  overflow: auto;
}

.hidden {
  display: none !important;
}

.alert-row {
  min-height: 82px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}

.alert-row:hover,
.alert-row.selected {
  background: #191b20;
}

.alert-row.selected {
  box-shadow: inset 3px 0 0 var(--blue);
}

.alert-row.incident-pending {
  box-shadow: inset 3px 0 0 var(--red);
}

.alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.alert-title strong {
  min-width: 0;
  color: #d7dbe2;
  font-size: 16px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-dot {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.type-dot.composite {
  background: #7c57ff;
}

.alert-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.meta-piece {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.alert-detail {
  margin-top: 8px;
  color: #7d838d;
  font-size: 12px;
  line-height: 1.4;
}

.row-actions {
  width: 70px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-content: center;
}

.row-actions button {
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #aeb5bf;
  cursor: pointer;
}

.row-actions button:hover {
  background: #2a2d33;
  color: #fff;
}

.row-actions button.danger-icon {
  color: #ff8b84;
}

.row-actions button.danger-icon:hover {
  background: rgba(255, 95, 87, 0.16);
  color: #ffb0aa;
}

.status-pill {
  height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 11px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 850;
}

.status-active {
  background: rgba(33, 199, 122, 0.13);
  color: #40df96;
}

.status-paused {
  background: rgba(242, 201, 76, 0.13);
  color: #f2c94c;
}

.status-cancelled {
  background: rgba(255, 95, 87, 0.13);
  color: #ff8b84;
}

.status-triggered {
  background: rgba(47, 125, 246, 0.16);
  color: #77a8ff;
}

.status-pending {
  background: rgba(255, 95, 87, 0.14);
  color: #ff8b84;
}

.status-acknowledged {
  background: rgba(33, 199, 122, 0.13);
  color: #40df96;
}

.incident-row {
  min-height: 112px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--panel);
}

.incident-row:hover {
  background: #191b20;
}

.incident-row.pending {
  box-shadow: inset 3px 0 0 var(--red);
}

.incident-main strong {
  display: block;
  margin-bottom: 8px;
  color: #e9edf3;
  font-size: 15px;
  line-height: 1.25;
}

.incident-meta,
.incident-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.incident-detail {
  margin-top: 8px;
  color: #7d838d;
}

.incident-actions {
  width: 86px;
  display: grid;
  align-content: center;
}

.editor-drawer {
  width: 420px;
  max-width: calc(100vw - 40px);
  height: calc(100vh - 56px);
  position: fixed;
  top: 52px;
  right: 430px;
  z-index: 10;
  display: none;
  flex-direction: column;
  border: 1px solid var(--line);
  background: #111216;
  box-shadow: var(--shadow);
}

.editor-drawer.open {
  display: flex;
}

.drawer-header {
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-kicker {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.name-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #ffffff;
  font-size: 22px;
  font-weight: 850;
}

.drawer-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.drawer-grid label,
.condition-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.drawer-grid input,
.drawer-grid select,
.condition-row input,
.condition-row select {
  height: 36px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 10px;
  background: #0c0d10;
  color: var(--text);
  outline: 0;
}

.drawer-grid input:focus,
.drawer-grid select:focus,
.condition-row input:focus,
.condition-row select:focus {
  border-color: var(--blue);
}

.conditions-section,
.preview-card {
  padding: 0 14px 14px;
}

.section-title {
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title strong {
  font-size: 14px;
}

.mini-button {
  height: 28px;
  border-radius: 4px;
  padding: 0 10px;
  background: #272a31;
  color: #e7ebf1;
  font-size: 12px;
  font-weight: 800;
}

.mini-button:hover {
  background: #343841;
}

.conditions-list {
  display: grid;
  gap: 10px;
}

.condition-row {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #15171b;
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 10px;
}

.condition-main {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
}

.condition-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.condition-side {
  display: grid;
  gap: 8px;
  align-content: end;
}

.condition-side button {
  height: 32px;
  border: 0;
  border-radius: 4px;
  background: #252830;
  color: #d8dde5;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.condition-side button.hit {
  background: rgba(33, 199, 122, 0.20);
  color: #40df96;
}

.condition-side button.remove {
  background: rgba(255, 95, 87, 0.12);
  color: #ff8b84;
}

.preview-card {
  margin-top: auto;
}

.status-line {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #15171b;
  color: #cdd3dc;
  font-size: 13px;
  line-height: 1.55;
}

.drawer-footer {
  flex: 0 0 64px;
  display: grid;
  grid-template-columns: 70px 70px 70px 1fr;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.text-button,
.primary-button {
  height: 38px;
  border-radius: 5px;
  font-weight: 850;
}

.text-button {
  background: #22252c;
  color: #dce1e8;
}

.text-button.danger {
  color: #ff8b84;
}

.text-button.danger:hover {
  background: rgba(255, 95, 87, 0.16);
}

.primary-button {
  background: var(--blue);
  color: white;
}

.log-row {
  min-height: 72px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.log-row strong {
  display: block;
  color: #e8ecf2;
  font-size: 14px;
  margin-bottom: 5px;
}

.log-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.empty-state {
  padding: 28px 18px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1260px) {
  body {
    min-width: 980px;
  }

  .workspace {
    grid-template-columns: 52px minmax(460px, 1fr) 390px;
  }

  .editor-drawer {
    right: 390px;
  }

  .rule-board {
    grid-template-columns: 1fr;
  }
}


.row-actions-wide {
  width: 88px;
  grid-template-columns: repeat(2, 1fr);
}

