:root {
  --ink: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --soft: #f5f7fb;
  --panel: #ffffff;
  --brand: #176b87;
  --brand-dark: #0f4c64;
  --accent: #2f8f6f;
  --warn: #b7791f;
  --danger: #b42318;
  --shadow: 0 10px 24px rgba(23, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 1200px;
  color: var(--ink);
  background: #eef2f7;
  font-family: "Segoe UI", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 440px;
  background:
    linear-gradient(115deg, rgba(23, 107, 135, 0.9), rgba(47, 143, 111, 0.72)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='900' viewBox='0 0 1400 900'%3E%3Crect width='1400' height='900' fill='%23e9eef5'/%3E%3Cpath d='M80 170h410v250H80zM560 130h760v92H560zM560 258h310v238H560zM910 258h410v238H910zM90 500h1230v255H90z' fill='%23ffffff' opacity='.62'/%3E%3Cpath d='M132 238h300M132 286h230M132 334h270M600 180h560M600 326h220M600 382h170M950 326h280M950 382h220M150 574h1030M150 638h910M150 702h990' stroke='%23176b87' stroke-width='16' stroke-linecap='round' opacity='.2'/%3E%3C/svg%3E");
  background-size: cover;
}

.login-copy {
  align-self: end;
  padding: 72px;
  color: #fff;
}

.login-copy h1 {
  margin: 0 0 18px;
  font-size: 46px;
  line-height: 1.12;
  letter-spacing: 0;
}

.login-copy p {
  max-width: 680px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  line-height: 1.8;
}

.login-panel {
  align-self: center;
  margin-right: 70px;
  padding: 32px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-panel h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-panel .caption {
  margin: 0 0 28px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field label {
  color: #344054;
  font-weight: 600;
}

.field input,
.field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #c9d2df;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

.primary-button,
.secondary-button,
.plain-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.primary-button {
  color: #fff;
  background: var(--brand);
}

.primary-button:hover {
  background: var(--brand-dark);
}

.secondary-button {
  color: var(--brand-dark);
  background: #e8f3f6;
  border: 1px solid #bbd9e2;
}

.plain-button {
  color: #344054;
  background: #fff;
  border: 1px solid #c9d2df;
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.login-button {
  width: 100%;
  height: 44px;
  margin-top: 8px;
}

.reset-link {
  display: block;
  margin-top: 18px;
  color: var(--brand);
  font-weight: 700;
  text-align: center;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #172033;
  color: #eef4f7;
}

.brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.nav {
  padding: 12px 10px;
  overflow: auto;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 650;
}

.nav a:hover,
.nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-section-title {
  margin: 10px 8px 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 850;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.content-shell {
  min-width: 0;
  background: var(--soft);
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.tenant-name {
  font-weight: 800;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 18px;
  background: #eef4f7;
  color: #344054;
  font-weight: 700;
}

.main {
  min-width: 0;
  padding: 22px 26px 36px;
}

.breadcrumb {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.page-head h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.24;
}

.page-head p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.metric-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card,
.panel,
.table-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(23, 32, 51, 0.03);
}

.metric-card {
  padding: 14px 15px;
}

.metric-label {
  color: var(--muted);
  font-weight: 700;
}

.metric-value {
  margin-top: 6px;
  font-size: 25px;
  font-weight: 850;
}

.metric-note {
  margin-top: 6px;
  padding-right: 58px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.two-column {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 14px;
  align-items: start;
}

.two-column.wide-left {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.7fr);
}

.three-column {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  padding: 16px;
}

.panel h2,
.table-panel h2 {
  margin: 0;
  font-size: 17px;
}

.panel h3 {
  margin: 18px 0 10px;
  font-size: 15px;
}

.table-panel {
  overflow: hidden;
  overflow-x: auto;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f5;
  text-align: left;
  vertical-align: middle;
  line-height: 1.45;
}

th {
  color: #475467;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

td {
  color: #263244;
  font-size: 13px;
}

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

.status,
.priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 68px;
  padding: 0 9px;
  border-radius: 13px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.status.good {
  color: #146c43;
  background: #e6f4ed;
}

.status.info {
  color: #175cd3;
  background: #eaf1ff;
}

.status.warn {
  color: #92400e;
  background: #fff3d6;
}

.status.stop {
  color: #b42318;
  background: #fde7e9;
}

.priority.high {
  color: #b42318;
  background: #fde7e9;
}

.priority.middle {
  color: #92400e;
  background: #fff3d6;
}

.priority.low {
  color: #146c43;
  background: #e6f4ed;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
}

.check-item input {
  width: 16px;
  height: 16px;
}

.storage-panel {
  margin-bottom: 14px;
}

.storage-panel h2 {
  margin-bottom: 14px;
}

.storage-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.storage-message {
  min-height: 22px;
  color: var(--accent);
  font-weight: 800;
}

.flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.flow-box {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow-box h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

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

.flow-list li {
  padding: 9px 11px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #edf0f5;
  line-height: 1.5;
}

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

.timeline li {
  display: grid;
  gap: 4px;
  padding: 0 0 9px 14px;
  border-left: 2px solid #c8d7df;
}

.timeline strong {
  font-size: 13px;
}

.timeline span {
  color: var(--muted);
  font-size: 12px;
}

.business-menu {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.business-menu a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  color: #344054;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 850;
}

.business-menu a:hover,
.business-menu a.active {
  color: var(--brand-dark);
  border-color: #9fc6d2;
  background: #f7fbfc;
}

.saved-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.saved-summary-item {
  min-height: 68px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.saved-summary-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.saved-summary-item span {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dashboard-state-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.dashboard-state-badge.high {
  color: #912018;
  background: #ffd8d3;
}

.dashboard-state-badge.middle {
  color: #7a3f00;
  background: #ffe6a3;
}

.dashboard-state-badge.low {
  color: #0f5f39;
  background: #d8f3e5;
}

.dashboard-link:hover {
  border-color: #9fc6d2;
  background: #f7fbfc;
}

.dashboard-link,
.dashboard-inline-link {
  color: var(--brand);
  font-weight: 850;
  text-decoration: none;
}

.dashboard-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #c9d2df;
  border-radius: 6px;
  background: #fff;
}

.dashboard-hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dashboard-hub-hero h2 {
  margin: 3px 0 6px;
  font-size: 20px;
  line-height: 1.35;
}

.dashboard-hub-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.module-eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
}

.dashboard-hub-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-hub-kpis {
  margin-bottom: 14px;
}

.dashboard-hub-metric {
  min-height: 104px;
}

.dashboard-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.module-hub-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 13px;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.module-hub-card:hover {
  border-color: #9fc6d2;
  background: #f7fbfc;
}

.module-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-card-head strong {
  font-size: 14px;
}

.module-hub-card span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.module-hub-card em {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.hub-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hub-summary-item {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.hub-summary-item strong {
  font-size: 13px;
}

.hub-summary-item span {
  color: var(--accent);
  font-size: 18px;
  font-weight: 850;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  padding: 4px;
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.feature-strip div {
  min-height: 58px;
  padding: 11px 13px;
  border: 1px solid #c9dce4;
  border-radius: 8px;
  background: #f7fbfc;
}

.feature-strip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-dark);
  font-size: 12px;
}

.feature-strip span {
  display: block;
  color: #475467;
  font-size: 12px;
  line-height: 1.45;
}

.section-space {
  margin-top: 14px;
}

.tab {
  min-width: 72px;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  color: #475467;
  background: transparent;
  font-weight: 850;
}

.tab.active {
  color: #fff;
  background: var(--brand);
}

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

.log-list li {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf0f5;
}

.log-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

.right {
  text-align: right;
}

.wide {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  body {
    min-width: 0;
    overflow-x: hidden;
  }

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

  .login-copy {
    padding: 44px 24px 18px;
  }

  .login-panel {
    margin: 24px;
  }

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

  .main {
    padding: 16px 12px 28px;
    overflow-x: hidden;
  }

  .topbar {
    padding: 0 16px;
  }

  .page-head {
    display: grid;
  }

  .actions {
    justify-content: flex-start;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

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

  .metric-grid,
  .two-column,
  .two-column.wide-left,
  .three-column,
  .form-grid,
  .flow-grid,
  .business-menu,
  .saved-summary-grid,
  .dashboard-hub-hero,
  .dashboard-hub-grid,
  .hub-summary-grid,
  .feature-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-hub-status {
    justify-content: space-between;
    white-space: normal;
  }

  .metric-note {
    padding-right: 0;
  }
}
