:root {
  --bg: #f8f2e8;
  --bg-2: #f1e8dc;
  --bg-3: #e9decf;
  --panel: rgba(255, 250, 244, 0.72);
  --panel-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(67, 55, 44, 0.09);
  --line-strong: rgba(67, 55, 44, 0.15);
  --text: #1f2933;
  --muted: #6b7280;
  --accent: #0f766e;
  --accent-2: #b7791f;
  --accent-3: #4f6f52;
  --accent-soft: rgba(15, 118, 110, 0.1);
  --green: #15803d;
  --red: #b91c1c;
  --amber: #b45309;
  --grey: #94a3b8;
  --shadow: 0 24px 60px rgba(44, 30, 18, 0.12);
  --shadow-soft: 0 12px 30px rgba(44, 30, 18, 0.08);
  --radius: 24px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(217, 119, 6, 0.13), transparent 22%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 56%, var(--bg-3) 100%);
}
a { color: inherit; }
button, a.button { border: 0; cursor: pointer; text-decoration: none; font: inherit; }
.app-shell { width: min(1500px, calc(100% - 24px)); margin: 14px auto 28px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.58)),
    linear-gradient(135deg, rgba(217, 119, 6, 0.1), rgba(15, 118, 110, 0.08));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%);
}
.brand-block h1 {
  margin: 0;
  font-size: clamp(1.12rem, 1.8vw, 1.48rem);
  letter-spacing: -0.04em;
  font-weight: 680;
}
.profile-card {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.88), rgba(255,255,255,0.68)),
    linear-gradient(135deg, rgba(217, 119, 6, 0.08), rgba(15, 118, 110, 0.08));
  border: 1px solid rgba(255,255,255,0.78);
  box-shadow: var(--shadow-soft);
  width: fit-content;
  margin-left: auto;
  flex: 0 0 auto;
}
.profile-card.minimalist {
  min-width: unset;
  max-width: unset;
}
.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  order: 2;
}
.avatar-live {
  background: linear-gradient(135deg, #16a34a, #0f766e);
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.1);
}
.avatar-idle {
  background: linear-gradient(135deg, #64748b, #94a3b8);
  box-shadow: 0 0 0 5px rgba(148, 163, 184, 0.16);
}
.profile-copy {
  min-width: 0;
  order: 1;
  flex: 0 1 auto;
}
.centered-profile {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.profile-name { font-size: 0.95rem; font-weight: 680; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-line { margin-top: 2px; color: var(--muted); font-size: 0.78rem; line-height: 1.34; white-space: nowrap; }
.workspace-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; }
.side-rail { display: grid; gap: 12px; align-content: start; }
.rail-card, .main-panel, .surface-card, .stat-card, .table-shell, .empty-state {
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.66));
  border: 1px solid rgba(255,255,255,0.76);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(145%);
}
.rail-card { padding: 14px; }
.rail-card-actions { position: static; }
.rail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rail-title { margin-bottom: 10px; font-size: 0.76rem; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.collapse-button { min-height: 28px; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(88, 103, 128, 0.12); background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(246,239,229,0.88)); color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.detail-list { display: grid; gap: 8px; }
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.detail-row:last-child { padding-bottom: 0; border-bottom: 0; }
.detail-row span { color: var(--muted); font-size: 0.84rem; }
.detail-row strong { text-align: right; font-size: 0.9rem; font-weight: 600; }
.rail-actions { display: grid; gap: 8px; }
.ribbon-actions .button { justify-content: flex-start; min-height: 38px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(44, 30, 18, 0.1); }
.button.full { width: 100%; }
.button-primary {
  color: #fff;
  background: linear-gradient(135deg, #23443b, #0f766e 58%, #8f6a2a);
  box-shadow: 0 12px 22px rgba(35, 68, 59, 0.18);
}
.button-secondary {
  color: #2f3b36;
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(246,239,229,0.88));
  border-color: rgba(90, 78, 64, 0.1);
}
.button-muted {
  color: #6f6a62;
  background: linear-gradient(135deg, rgba(250,245,238,0.88), rgba(238,228,215,0.78));
  border-color: rgba(111, 106, 98, 0.08);
}
.table-copy-btn {
  min-height: 30px;
  padding: 6px 10px;
  font-size: 0.76rem;
}
.main-panel { padding: 16px; }
.main-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tab-strip, .subtab-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.tab-button, .subtab-button {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  background: linear-gradient(135deg, rgba(255,255,255,0.84), rgba(255,247,239,0.76));
  border: 1px solid rgba(88, 103, 128, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.tab-button.active, .subtab-button.active {
  color: #fff;
  background: linear-gradient(135deg, #2a3b34, #0f766e 58%, #9a7330);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(35, 68, 59, 0.16);
}
.subtab-button { min-height: 32px; font-size: 0.84rem; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card {
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,252,248,0.76));
}
.stat-card .label { color: var(--muted); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; }
.stat-card .value { margin-top: 8px; font-size: clamp(1.28rem, 2vw, 1.9rem); font-weight: 750; letter-spacing: -0.03em; }
.stat-card .foot { margin-top: 6px; color: var(--muted); font-size: 0.82rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.surface-card { padding: 16px; }
.surface-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.surface-head h3 { margin: 0; font-size: 0.98rem; font-weight: 650; }
.micro { color: var(--muted); font-size: 0.76rem; }
.mini-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mini-metrics div {
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,249,243,0.78));
  border: 1px solid rgba(255,255,255,0.78);
}
.mini-metrics span { display: block; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.mini-metrics strong { display: block; margin-top: 6px; font-size: 1.08rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(217, 119, 6, 0.08));
  color: #1f2937;
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid rgba(15, 118, 110, 0.08);
}
.mini-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: 0.73rem; font-weight: 700; }
.mini-pill-green { color: #166534; background: rgba(22, 163, 74, 0.12); }
.mini-pill-red { color: #991b1b; background: rgba(239, 68, 68, 0.12); }
.table-shell {
  overflow: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,251,247,0.74));
}
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid rgba(45,58,58,0.08); font-size: 0.9rem; }
th {
  position: sticky;
  top: 0;
  background: rgba(250, 245, 238, 0.96);
  color: var(--muted);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
tbody tr:hover { background: rgba(15, 118, 110, 0.04); }
.log-box {
  max-height: 560px;
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(217, 119, 6, 0.14), transparent 18%),
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 18%),
    linear-gradient(180deg, #151922, #10141b 100%);
  color: #e6f4f1;
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.control-form { display: grid; gap: 10px; }
.control-label { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.control-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
}
.control-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.9rem;
}
.control-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.empty-state {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border-style: dashed;
  border-color: rgba(88, 103, 128, 0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(250,245,238,0.7));
}
.positive { color: var(--green); }
.negative { color: var(--red); }
.warning { color: var(--amber); }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
@media (max-width: 1180px) {
  .workspace-grid, .grid-2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { flex-direction: column; align-items: stretch; }
  .brand-block { width: 100%; text-align: center; }
  .profile-card { margin-left: 0; width: 100%; justify-content: space-between; }
  .workspace-grid > .main-panel { order: 1; }
  .workspace-grid > .side-rail { order: 2; }
}
@media (max-width: 760px) {
  .app-shell { width: min(100% - 12px, 100%); margin: 8px auto 20px; }
  .topbar, .main-panel, .rail-card, .surface-card, .stat-card { padding: 14px; }
  .topbar { align-items: stretch; }
  .brand-block { text-align: center; }
  .profile-card.minimalist { max-width: 100%; width: 100%; }
  .centered-profile { text-align: left; align-items: flex-start; }
  .profile-line { white-space: normal; }
  .cards, .mini-metrics { grid-template-columns: 1fr; }
  .main-head { flex-direction: column; align-items: stretch; }
  .tab-strip, .subtab-strip { flex-wrap: nowrap; overflow: auto; padding-bottom: 4px; }
  .tab-button, .subtab-button { flex: 0 0 auto; }
}











