:root {
  --app-bg: #f4f7f9;
  --app-ink: #1d2733;
  --app-muted: #6f7d8a;
  --app-line: #dfe6ec;
  --app-primary: #0f766e;
  --app-primary-dark: #115e59;
  --app-sidebar: #17324d;
}

body {
  min-height: 100vh;
  color: var(--app-ink);
  background: var(--app-bg);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

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

.sidebar {
  background: var(--app-sidebar);
  color: #fff;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
  margin-bottom: 18px;
}

.brand-login {
  color: #fff;
  background: var(--app-sidebar);
  border-radius: 8px;
  padding: 16px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8fbf7;
  color: var(--app-primary-dark);
  font-size: 20px;
  flex: 0 0 auto;
}

.brand-title {
  font-weight: 700;
  line-height: 1.15;
}

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

.nav-link {
  color: rgba(255, 255, 255, .78);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  min-height: 42px;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, .13);
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--app-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  gap: 18px;
}

.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.page-subtitle {
  margin: 2px 0 0;
  color: var(--app-muted);
  font-size: 13px;
}

.content {
  padding: 24px 28px 32px;
}

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

.metric-card,
.panel {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 8px;
}

.metric-card {
  padding: 16px;
  min-height: 116px;
}

.metric-label {
  color: var(--app-muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.metric-note {
  color: var(--app-muted);
  font-size: 12px;
  margin-top: 8px;
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--app-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.filter-bar {
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(220px, 360px) 150px 150px minmax(140px, 1fr);
  gap: 12px;
  align-items: center;
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: #e9eef2;
}

.progress-bar {
  background: var(--app-primary);
}

.work-table {
  margin: 0;
  table-layout: fixed;
  vertical-align: middle;
}

.assessment-table {
  min-width: 1280px;
  border: 1px solid var(--app-line);
}

.assessment-table th {
  background: #30363c;
  color: #fff;
  font-size: 14px;
  text-align: center;
  border-color: #454b52;
  padding: 12px 10px;
}

.assessment-table td {
  border-color: #d9e0e6;
  padding: 12px 10px;
  vertical-align: top;
  line-height: 1.45;
}

.assessment-table tbody tr:nth-child(odd) td {
  background: #f2f2f2;
}

.table-number,
.table-action {
  text-align: center;
  white-space: nowrap;
}

.standard-code {
  font-weight: 700;
  color: #203040;
}

.ep-code {
  font-weight: 700;
  color: var(--app-primary-dark);
}

.status-badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.btn-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 8px;
}

.comment-box {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
  padding: 10px 12px;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  color: #62460b;
}

.comment-cell {
  min-width: 210px;
  font-size: 13px;
  color: #4b5563;
}

.file-name {
  display: block;
  margin-top: 6px;
  color: var(--app-muted);
  font-size: 12px;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-inline {
  margin: 0;
}

.pdf-preview {
  height: 430px;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}

.pdf-toolbar {
  height: 48px;
  border-bottom: 1px solid var(--app-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: #fff;
}

.pdf-canvas {
  height: calc(100% - 48px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.pdf-page {
  width: min(320px, 86%);
  height: 300px;
  background: #fff;
  border: 1px solid #d7dee5;
  box-shadow: 0 14px 26px rgba(29, 39, 51, .12);
  padding: 24px;
}

.pdf-line {
  height: 9px;
  border-radius: 999px;
  background: #dbe3ea;
  margin-bottom: 12px;
}

.pdf-line.short {
  width: 58%;
}

.pdf-line.mid {
  width: 78%;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(430px, 100%);
  background: #fff;
  border: 1px solid var(--app-line);
  border-radius: 8px;
  padding: 22px;
}

.login-help {
  margin-top: 16px;
  color: var(--app-muted);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 1100px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .content {
    padding: 18px 16px 24px;
  }

  .summary-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }
}
