:root {
  --red: #365cf5;
  --red2: #294ad4;
  --red-dark: #172f9d;
  --gold: #ffcf3f;
  --gold-light: #fff3b6;
  --ink: #111827;
  --ink2: #536078;
  --ink3: #7c8799;
  --line: #172033;
  --bg: #f7f2e8;
  --ok: #148455;
  --danger: #d63f33;
}

html { background: var(--bg); }
body {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(23, 32, 51, .065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 51, .065) 1px, transparent 1px);
  background-size: 34px 34px;
  color: var(--ink);
}

.app { display: block; min-height: 100vh; }
aside {
  position: sticky;
  top: 0;
  z-index: 100;
  height: auto;
  overflow: visible;
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr) 112px;
  align-items: stretch;
  border: 0;
  border-bottom: 2px solid var(--line);
  background: #fffdf8;
  box-shadow: 0 4px 0 rgba(23, 32, 51, .08);
}
.brand {
  height: 68px;
  padding: 0 24px;
  color: var(--ink);
  background: transparent;
  font-size: 17px;
  gap: 12px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border: 2px solid var(--line);
  border-radius: 0;
  color: #fff;
  background: var(--red);
  box-shadow: 4px 4px 0 var(--line);
  font-size: 22px;
}
.brand small { color: var(--red); font-weight: 800; letter-spacing: 1.8px; }
nav {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  overflow-x: auto;
}
.nav-group { display: none; }
.nav-item {
  width: auto;
  flex: 0 0 auto;
  border: 0;
  border-left: 1px solid rgba(23, 32, 51, .08);
  padding: 0 14px;
  text-align: center;
  color: var(--ink2);
  background: transparent;
  border-radius: 0;
  font-size: 13px;
  font-weight: 700;
}
.nav-item:hover { color: var(--red-dark); background: #eef1ff; }
.nav-item.active {
  color: var(--ink);
  background: var(--gold-light);
  border-left-color: var(--line);
  box-shadow: inset 0 -5px 0 var(--red);
}
.nav-icon { width: auto; margin-right: 5px; color: var(--red); }
.aside-footer { position: static; display: grid; place-items: center; padding: 0 14px; }
.aside-footer button { width: 100%; }

main { max-width: 1420px; margin: 0 auto; padding: 0 26px 56px; }
.topbar {
  height: 66px;
  margin: 0 -26px 22px;
  padding: 0 28px;
  top: 68px;
  color: var(--ink);
  background: rgba(247, 242, 232, .92);
  border-bottom: 2px solid var(--line);
  backdrop-filter: blur(8px);
}
.topbar h1 { font-size: 20px; letter-spacing: .02em; }
.status { color: var(--ink2); font-weight: 700; }
.status.ok { color: var(--ok); }
.status.failed { color: var(--danger); }

.dashboard-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 155px;
  padding: 25px 30px;
  margin: 0 0 22px;
  border: 2px solid var(--line);
  background: #fffdf8;
  box-shadow: 7px 7px 0 var(--line);
  position: relative;
  overflow: hidden;
}
.dashboard-hero::after {
  content: "↗";
  position: absolute;
  right: 270px;
  bottom: -32px;
  color: #dbe2ff;
  font-size: 145px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}
.hero-copy, .hero-actions { position: relative; z-index: 1; }
.eyebrow { color: var(--red); font: 800 11px/1.2 ui-monospace, monospace; letter-spacing: 2px; }
.dashboard-hero h2 { margin: 7px 0 4px; font-size: clamp(24px, 3vw, 36px); line-height: 1.2; }
.dashboard-hero p { margin: 0; color: var(--ink2); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

.card, .panel, .period-card {
  border: 2px solid var(--line);
  border-radius: 0;
  background: #fffdf8;
  box-shadow: 5px 5px 0 rgba(23, 32, 51, .18);
}
.card { padding: 17px; position: relative; overflow: hidden; }
.card::before { width: 32px; height: 7px; border-radius: 0; background: var(--red); }
.card:nth-child(2)::before { background: #58d2e4; }
.card:nth-child(3)::before { background: #a982f0; }
.card:nth-child(4)::before { background: var(--gold); }
.card .label { color: var(--ink2); font-weight: 800; letter-spacing: .04em; }
.card .value { font-size: 30px; }
.panel { padding: 18px; margin-bottom: 18px; }
.panel-head { padding-bottom: 12px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.panel-head h2 { font-size: 18px; }
.period-card { padding: 14px 16px; }
.period-value, .timing-box, .target-preview, .groups label, .permission-list label {
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

input, textarea, select, button { border-radius: 0; }
input, textarea, select { border: 1.5px solid var(--line); background: #fff; }
input:focus, textarea:focus, select:focus { border-color: var(--red); box-shadow: 3px 3px 0 #cfd7ff; }
button {
  border: 1.5px solid var(--line);
  color: #fff;
  background: var(--red);
  box-shadow: 3px 3px 0 var(--line);
  transition: transform .12s, box-shadow .12s, background .12s;
}
button:hover { background: var(--red2); transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--line); }
button:active { transform: translate(3px, 3px); box-shadow: none; }
.gray, .aside-footer button { color: var(--ink); background: #fff; border-color: var(--line); }
.gray:hover, .aside-footer button:hover { color: var(--red-dark); background: var(--gold-light); border-color: var(--line); }
.danger { color: var(--danger); border-color: var(--line); }
.more-menu, .filter-checks-menu, .confirm-dialog, .notice, .schedule-date-picker {
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 6px 6px 0 var(--line);
}
.badge, .task-status, .stat { border-radius: 0; border: 1px solid rgba(23, 32, 51, .35); }
th { color: var(--ink); background: #edf0ff; border-color: var(--line); text-transform: uppercase; letter-spacing: .03em; }
td { border-color: rgba(23, 32, 51, .24); }
tbody tr:hover { background: #fff8d7; }
.help-node, .help-step, .help-gate, .help-result, .help-monitor-item, .log-group { border-radius: 0; }

@media (max-width: 1180px) {
  aside { grid-template-columns: 210px minmax(0, 1fr) 90px; }
  .nav-item { padding: 0 10px; font-size: 12px; }
  .nav-icon { display: none; }
}
@media (max-width: 820px) {
  aside { position: relative; display: block; }
  .brand { height: 58px; padding-right: 112px; }
  nav { justify-content: flex-start; border-top: 1px solid var(--line); height: 48px; }
  .nav-item { height: 48px; }
  .aside-footer { position: absolute; left: auto; right: 10px; top: 10px; width: 92px; height: 38px; padding: 0; }
  .topbar { top: 0; margin: 0 -14px 16px; }
  main { padding-left: 14px; padding-right: 14px; }
  .dashboard-hero { display: block; padding: 22px; }
  .hero-actions { justify-content: flex-start; margin-top: 18px; }
  .dashboard-hero::after { right: 5px; opacity: .5; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .cards, .period-grid, .overview-grid { grid-template-columns: 1fr; }
  .dashboard-hero h2 { font-size: 25px; }
}
