:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --blue: #246bfe;
  --cyan: #0f9bb7;
  --green: #198754;
  --red: #d92d20;
  --amber: #b7791f;
  --navy: #162235;
  --shadow: 0 18px 50px rgba(29, 41, 57, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--ink);
  background: var(--bg);
  font-family:
    "Segoe UI",
    "Malgun Gothic",
    system-ui,
    sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(900px, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 22px;
  color: #edf4ff;
  background: var(--navy);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  color: #08111f;
  background: #8fd5ff;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  margin-top: 3px;
  color: #aab7c8;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #b9c7d8;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-panel {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-panel strong,
.sidebar-panel small {
  display: block;
}

.sidebar-panel strong {
  margin: 8px 0 14px;
  line-height: 1.35;
}

.sidebar-panel small {
  color: #c4d0dd;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.progress-bar {
  width: 71%;
  height: 100%;
  border-radius: inherit;
  background: #73d3ff;
  transition: width 360ms ease;
}

.workspace {
  padding: 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
  line-height: 1.3;
}

.topbar-actions,
.panel-header,
.segmented-control {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 10px;
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 38px;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button {
  padding: 0 18px;
  border: 1px solid var(--blue);
  color: white;
  background: var(--blue);
}

.ghost-button {
  padding: 0 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.icon-button {
  width: 38px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-soft);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  position: relative;
  min-height: 128px;
  padding: 20px;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--blue);
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 9px 0 10px;
  font-size: 32px;
}

.accent-red::before {
  background: var(--red);
}

.accent-green::before {
  background: var(--green);
}

.accent-amber::before {
  background: var(--amber);
}

.main-grid {
  display: grid;
  grid-template-columns: 1.25fr 1.25fr 0.9fr;
  gap: 18px;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.panel {
  min-height: 240px;
  padding: 20px;
}

.panel-header {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-header.compact {
  align-items: flex-start;
}

.segmented-control {
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented-control button {
  min-width: 58px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.segmented-control .selected {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(29, 41, 57, 0.1);
}

.table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.danger {
  color: #8f130b;
  background: #ffdad6;
}

.warning {
  color: #7a4b00;
  background: #ffedbf;
}

.success {
  color: #0b5d36;
  background: #d9f5e6;
}

.timeline {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.timeline time {
  color: var(--muted);
  font-weight: 800;
}

.timeline strong,
.timeline span {
  display: block;
}

.timeline span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.mall-summary {
  display: grid;
  gap: 18px;
}

.ring {
  display: grid;
  place-items: center;
  width: 170px;
  height: 170px;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle, white 58%, transparent 60%),
    conic-gradient(var(--green) 0 88%, #e2e8f0 88% 100%);
}

.ring span {
  font-size: 42px;
  font-weight: 900;
}

.ring small {
  margin-top: -52px;
  color: var(--muted);
}

.mall-summary ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mall-summary li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.schedule-card {
  min-height: 116px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.schedule-card strong,
.schedule-card span,
.schedule-card small {
  display: block;
}

.schedule-card span {
  margin: 8px 0;
  font-size: 22px;
  font-weight: 900;
}

.schedule-card small {
  color: var(--muted);
  line-height: 1.45;
}

.log-console {
  display: grid;
  max-height: 250px;
  overflow: auto;
  border: 1px solid #273142;
  border-radius: 8px;
  background: #111827;
}

.log-line {
  display: grid;
  grid-template-columns: 90px 84px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #d1d5db;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
}

.log-line:last-child {
  border-bottom: 0;
}

.log-level {
  font-weight: 800;
}

.log-info {
  color: #93c5fd;
}

.log-ok {
  color: #86efac;
}

.log-warn {
  color: #fcd34d;
}

.log-error {
  color: #fca5a5;
}

.toast {
  position: fixed;
  right: 26px;
  bottom: 26px;
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .status-grid,
  .main-grid,
  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3 {
    grid-column: span 1;
  }

  .topbar,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-wrap {
    overflow-x: auto;
  }
}
