:root {
  --da-bg: #f4f7fa;
  --da-sidebar: #3e4f70;
  --da-sidebar-deep: #35425c;
  --da-sidebar-muted: #b5bfce;
  --da-sidebar-link: #d5dced;
  --da-sidebar-hover: rgba(29, 196, 233, 0.15);
  --da-primary: #1dc4e9;
  --da-primary-dark: #04a9f5;
  --da-card: #ffffff;
  --da-border: #e8edf3;
  --da-ink: #37474f;
  --da-shadow: 0 2px 12px rgba(42, 53, 71, 0.08);
}

body {
  background: var(--da-bg);
  color: var(--da-ink);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--da-sidebar);
  padding-top: 1.35rem !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 0.25rem 0.1rem 0.95rem;
}

.brand-badge {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
  background: linear-gradient(135deg, #1dc4e9, #1de9b6);
  color: #fff;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 300;
  letter-spacing: 0.01em;
}

.sidebar-nav {
  margin-top: 1.55rem;
}

.sidebar .nav-item {
  margin-bottom: 0;
}

.sidebar .nav-link {
  color: var(--da-sidebar-link);
  border-radius: 0;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  transition: background-color 0.2s ease, color 0.2s ease;
  padding: 1rem 1rem;
  min-height: 58px;
}

.menu-section {
  list-style: none;
  color: #d7dfeb;
  font-size: 0.82rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 1.15rem 0.15rem 0.7rem;
  margin-top: 0.9rem;
}

.link-icon {
  width: 1.55rem;
  height: 1.55rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  opacity: 0.9;
}

.link-icon svg {
  width: 1.08rem;
  height: 1.08rem;
}

.sidebar .top-link {
  background: var(--da-sidebar-deep);
  border-left: 3px solid transparent;
}

.sidebar .nav-link:hover {
  color: #fff;
  background: #3a4761;
}

.sidebar .nav-link.active {
  background: var(--da-sidebar-deep);
  border-left: 3px solid var(--da-primary);
  color: #fff;
  box-shadow: none;
}

.sidebar .menu-group {
  background: var(--da-sidebar-deep);
}

.sidebar .top-link,
.sidebar .menu-group {
  margin-bottom: 0.15rem;
}

.collapse-chevron {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
  opacity: 0.9;
}

.collapse-chevron svg {
  width: 1rem;
  height: 1rem;
}

.sidebar .nav-link.expanded .collapse-chevron {
  transform: rotate(90deg);
}

.report-sublist {
  display: none;
  opacity: 0;
  padding-left: 0;
  background: #3a4761;
  margin: 0;
}

.report-sublist.show {
  display: block;
  opacity: 0;
  animation: reportFadeIn 0.18s ease forwards;
}

@keyframes reportFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-head {
  border-left: 4px solid var(--da-primary);
  padding-left: 0.85rem;
}

.page-head .h4 {
  color: #2f3e59;
  font-weight: 700;
}

.page-crumb {
  color: #8392a5;
  font-size: 0.82rem;
}

.content-area {
  flex: 1;
  min-width: 0;
}

.report-subitem .nav-link {
  font-size: 0.9rem;
  font-weight: 400;
  color: #aeb9cc;
  padding-left: 3.45rem;
  background: transparent;
}

.report-subitem .nav-link.active,
.report-subitem .nav-link:hover {
  color: #fff;
  background: rgba(29, 196, 233, 0.18);
  border-left: none;
}

.table-wrap {
  background: var(--da-card);
  border-radius: 0.75rem;
  box-shadow: var(--da-shadow);
  border: 1px solid var(--da-border);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table-wrap:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.table-wrap table th,
.table-wrap table td {
  font-size: 0.9rem;
}

.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-completed {
  background: #d4edda;
  color: #155724;
}

.status-failed {
  background: #f8d7da;
  color: #721c24;
}

.status-partial {
  background: #fff3cd;
  color: #856404;
}

.status-pending {
  background: #e2e3e5;
  color: #495057;
}

.engine-bar {
  background: var(--da-card);
  border: 1px solid var(--da-border);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--da-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.engine-bar:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #6b7280;
  display: inline-block;
  margin-right: 0.35rem;
}

.dot.running { background: #16a34a; }
.dot.starting,
.dot.stopping { background: #d97706; }

.worker-card {
  background: var(--da-card);
  border: 1px solid var(--da-border);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: var(--da-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.worker-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.worker-head {
  background: #f9fafb;
  border-bottom: 1px solid var(--da-border);
  padding: 0.85rem 1rem;
}

.mailbox {
  color: #6b7280;
  font-size: 0.82rem;
}

.fail-list { padding: 1rem; }

.fail-item {
  border: 1px solid #fee2e2;
  background: #fff7f7;
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
}

.fail-item:last-child { margin-bottom: 0; }

@media (max-width: 991.98px) {
  .app-shell { display: block !important; }
  .sidebar { width: 100%; }
  .brand-logo { width: 170px; }
}
