:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --panel: #ffffff;
  --bg: #f4f6f9;
  --primary: #1f6feb;
  --danger: #d92d20;
  --warn: #b7791f;
  --green: #177245;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

.login-body {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(31, 111, 235, 0.88), rgba(20, 83, 45, 0.82)),
    url("/logo/dsmark_trans.png") center 22% / 520px auto no-repeat,
    #0f172a;
}

a { text-decoration: none; }

.app-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.navbar-brand img {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.nav-user {
  display: grid;
  line-height: 1.15;
  margin-right: 12px;
  text-align: right;
}

.nav-user small {
  color: var(--muted);
}

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

.page-head h1 {
  font-size: 24px;
  margin: 0;
  font-weight: 750;
}

.page-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-head h2,
.section-title {
  font-size: 16px;
  margin: 0;
  font-weight: 750;
}

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

.metric {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 14px;
}

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

.metric strong {
  display: block;
  font-size: 28px;
  line-height: 1.15;
}

.metric.warning { border-left-color: var(--warn); }
.metric.danger { border-left-color: var(--danger); }

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

.forecast-month {
  border: 3px solid #9bbcf2;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 0 rgba(31, 111, 235, 0.08);
}

.forecast-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-bottom: 3px solid #1f6feb;
  background: #eaf2ff;
}

.forecast-head strong,
.forecast-head span {
  display: block;
}

.forecast-head strong {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  background: #1f6feb;
  color: #fff;
  font-size: 17px;
}

.forecast-head span {
  color: #24476f;
  font-size: 12px;
  margin-top: 5px;
}

.month-total {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 2px solid #b8cdf0;
  background: #f7fbff;
}

.month-total span {
  color: var(--muted);
}

.spec-popover {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: #000;
  font: inherit;
  font-weight: 750;
  text-align: left;
  text-decoration: underline dotted #8a95a5;
  text-underline-offset: 3px;
  cursor: help;
}

.is-received {
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
  background: #fff176;
  color: #374151;
  text-decoration: line-through;
  text-decoration-thickness: 2.5px;
  text-decoration-color: #d92d20;
}

.lc-open {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: #dff7ea;
  border: 1px solid #78c79a;
  color: #10613a;
  font-weight: 800;
}

.is-received.lc-open {
  background: #fff176;
  border-color: #e0c341;
  color: #374151;
}

.popover-received {
  text-decoration: line-through;
  text-decoration-thickness: 2.5px;
  text-decoration-color: #d92d20;
}

.partial-remaining {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  background: #ede7ff;
  border: 1px solid #8b5cf6;
  color: #4c1d95;
  font-weight: 800;
}

.partial-remaining.lc-open {
  background: #ede7ff;
  border-color: #8b5cf6;
  color: #4c1d95;
}

.popover {
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.popover-body {
  min-width: 170px;
}

tfoot th {
  background: #f7f9fc;
  border-top: 2px solid var(--line);
}

.table {
  margin: 0;
  --bs-table-bg: transparent;
}

.table thead th {
  background: #eef2f7;
  border-bottom: 1px solid var(--line);
  color: #344054;
  font-weight: 700;
  white-space: nowrap;
}

.excel-table td,
.excel-table th {
  border: 1px solid var(--line);
}

.row-done td { background: #eceff3 !important; color: #667085; }
.row-delayed td { background: #fff1f0 !important; }
.row-progress td { background: #fff8df !important; }
.row-green td { background: #edfdf3 !important; }

.status {
  display: inline-block;
  min-width: 64px;
  padding: 2px 7px;
  border: 1px solid #cfd6e1;
  border-radius: 999px;
  background: #fff;
  text-align: center;
  font-size: 12px;
}

.progress {
  min-width: 92px;
  height: 18px;
  background: #e9edf3;
}

.progress-bar {
  background: var(--primary);
  font-size: 11px;
}

.memo-cell {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.memo-cell [data-bs-toggle="popover"] {
  cursor: help;
}

.vendor-round-cell {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.9;
}

.vendor-round-cell span {
  margin: 2px 3px 2px 0;
  white-space: nowrap;
}

.vendor-round-cell [data-bs-toggle="popover"] {
  cursor: help;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 22px !important;
}

.form-label {
  font-weight: 650;
  color: #344054;
  margin-bottom: 4px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.login-hero {
  min-height: calc(100vh - 32px);
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 30px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.login-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.login-brand img {
  width: 104px;
  max-height: 58px;
  object-fit: contain;
}

.login-brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-brand h1 {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 800;
}

.login-copy {
  margin: 20px 0;
}

.login-copy strong {
  display: block;
  font-size: 18px;
}

.login-copy p {
  margin: 4px 0 0;
  color: var(--muted);
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline div {
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

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

.timeline p {
  margin: 2px 0 0;
}

.file-link {
  display: block;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .forecast-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body { font-size: 13px; }
  .metric-grid { grid-template-columns: 1fr; }
  .panel { padding: 10px; }
  .page-head h1 { font-size: 20px; }
  .table { min-width: 760px; }
}
