* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7fb;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

a {
  color: #155eef;
  text-decoration: none;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #172033;
  color: #fff;
  padding: 22px 16px;
  box-shadow: 6px 0 18px rgba(15, 23, 42, 0.08);
}

.brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 24px;
}

.nav a {
  display: block;
  color: #d7deea;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.nav a:hover {
  background: #26344f;
  color: #fff;
}

.nav a.active {
  background: #155eef;
  color: #fff;
}

.nav-group {
  margin-bottom: 4px;
}

.nav-group summary {
  color: #d7deea;
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  position: relative;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary::after {
  content: "▾";
  color: #8fa0bd;
  font-size: 12px;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) rotate(-90deg);
}

.nav-group[open] summary::after {
  transform: translateY(-50%) rotate(0);
}

.nav-group summary:hover {
  background: #26344f;
  color: #fff;
}

.nav-group summary.active {
  background: #155eef;
  color: #fff;
}

.nav-sub {
  margin: 2px 0 8px 12px;
  padding-left: 10px;
  border-left: 1px solid rgba(215, 222, 234, 0.18);
}

.nav-sub a {
  font-size: 13px;
  padding: 9px 10px;
}

.main {
  min-width: 0;
}

.topbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.content {
  padding: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 18px;
}

.panel,
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.panel {
  padding: 18px;
  margin-bottom: 18px;
}

.narrow-panel {
  max-width: 520px;
}

.info-list {
  display: grid;
  gap: 10px;
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 8px;
}

.info-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-list span {
  color: #6b7280;
}

.grid {
  display: grid;
  gap: 14px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.card {
  padding: 16px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 8px;
}

.work-stat {
  color: #1f2937;
}

.compact-stats .work-stat {
  min-height: 64px;
  padding: 10px 14px;
}

.compact-stats .stat-value {
  font-size: 22px;
  margin-top: 4px;
}

.report-periods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.report-card h2 {
  margin: 8px 0 14px;
  font-size: 22px;
}

.report-metrics {
  display: grid;
  gap: 10px;
}

.report-metrics div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #eef2f7;
  padding-bottom: 9px;
}

.report-metrics div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.report-metrics span {
  color: #6b7280;
}

.report-metrics strong {
  font-size: 18px;
}

.muted {
  color: #6b7280;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: block;
  color: #374151;
  font-weight: 600;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
  background: #fff;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.inline-logout {
  margin: 0;
}

.table-actions,
.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}

.btn.primary {
  background: #155eef;
  border-color: #155eef;
  color: #fff;
}

.btn.danger {
  border-color: #fda29b;
  background: #fff;
  color: #b42318;
}

.btn.danger:hover {
  background: #fff1f0;
}

.pwa-install {
  display: none;
}

.pwa-install.show {
  display: inline-flex;
}

.app-version {
  color: #94a3b8;
  font-size: 12px;
  padding: 0 24px 18px;
  text-align: right;
}

.link-danger {
  border: 0;
  background: transparent;
  color: #b42318;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}

th {
  color: #4b5563;
  font-size: 13px;
  background: #f9fafb;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 9px;
  background: #edf2ff;
  color: #155eef;
  font-weight: 700;
  font-size: 12px;
}

.danger-badge {
  background: #fee4e2;
  color: #b42318;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(21, 94, 239, 0.12), rgba(56, 189, 248, 0.08)),
    #eef4fb;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) 420px;
  width: min(1080px, 100%);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
}

.login-brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 44px;
  color: #fff;
  background: linear-gradient(145deg, #13233d 0%, #155eef 62%, #38bdf8 100%);
}

.login-brand-panel h1 {
  margin: 10px 0 14px;
  font-size: 34px;
  line-height: 1.22;
}

.login-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  font-size: 20px;
  font-weight: 800;
}

.login-eyebrow {
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.login-subtitle {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.8;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 150px));
  gap: 12px;
  margin-top: 18px;
}

.login-feature-grid span {
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  padding: 10px 12px;
  font-weight: 700;
}

.login-illustration {
  position: relative;
  height: 168px;
}

.login-crane {
  position: absolute;
  left: 16px;
  bottom: 72px;
  width: 250px;
  height: 4px;
  background: rgba(255, 255, 255, 0.55);
}

.login-crane::before {
  content: "";
  position: absolute;
  left: 34px;
  top: -82px;
  width: 4px;
  height: 112px;
  background: rgba(255, 255, 255, 0.55);
}

.login-containers {
  position: absolute;
  right: 48px;
  bottom: 52px;
  display: grid;
  grid-template-columns: repeat(3, 74px);
  gap: 8px;
}

.login-containers span {
  height: 34px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.86);
}

.login-containers span:nth-child(2),
.login-containers span:nth-child(5) {
  background: #f59e0b;
}

.login-containers span:nth-child(3),
.login-containers span:nth-child(4) {
  background: #93c5fd;
}

.login-ship {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 330px;
  height: 28px;
  border-radius: 0 0 34px 34px;
  background: #0f172a;
}

.login-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  background: #fff;
  padding: 48px;
}

.login-form-head {
  margin-bottom: 24px;
}

.login-form-head h2 {
  margin: 14px 0 8px;
  font-size: 28px;
}

.login-field {
  margin-top: 16px;
}

.login-field input {
  min-height: 48px;
  border-radius: 8px;
  background: #f8fbff;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-weight: 600;
  margin-top: 14px;
}

.login-remember input {
  width: 16px;
  height: 16px;
}

.login-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border-radius: 8px;
  font-size: 16px;
}

.login-install.show {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  border-radius: 8px;
}

.login-version {
  margin-top: 16px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}

.login-default {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fbff;
  color: #6b7280;
  padding: 10px 12px;
}

.login-default strong {
  color: #334155;
}

.error {
  padding: 10px;
  border-radius: 6px;
  background: #fee4e2;
  color: #b42318;
  margin-bottom: 12px;
}

.success {
  padding: 10px;
  border-radius: 6px;
  background: #dcfce7;
  color: #166534;
  margin-bottom: 12px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.portal-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  overflow: hidden;
  min-height: 190px;
  margin-bottom: 18px;
  border: 1px solid #dbe7ff;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff 0%, #eef5ff 62%, #dceaff 100%);
  box-shadow: 0 12px 28px rgba(21, 94, 239, 0.08);
}

.portal-hero-content {
  padding: 30px;
}

.portal-hero h1 {
  margin: 8px 0 16px;
  font-size: 30px;
  line-height: 1.2;
}

.portal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  padding: 4px 12px;
  font-weight: 600;
}

.portal-visual {
  position: relative;
  min-height: 190px;
}

.logistics-sky {
  position: absolute;
  right: 28px;
  top: 24px;
  width: 220px;
  height: 116px;
  border-radius: 8px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  border: 1px solid rgba(21, 94, 239, 0.12);
}

.container-stack {
  position: absolute;
  right: 86px;
  bottom: 54px;
  display: grid;
  grid-template-columns: repeat(2, 58px);
  gap: 6px;
}

.container-stack span {
  height: 26px;
  border-radius: 4px;
  background: #155eef;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.container-stack span:nth-child(2),
.container-stack span:nth-child(3) {
  background: #38bdf8;
}

.ship-line {
  position: absolute;
  right: 42px;
  bottom: 40px;
  width: 238px;
  height: 18px;
  border-radius: 0 0 24px 24px;
  background: #172033;
}

.truck-box {
  position: absolute;
  right: 238px;
  bottom: 74px;
  width: 48px;
  height: 30px;
  border-radius: 5px;
  background: #f59e0b;
  box-shadow: 66px 0 0 #93c5fd;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  display: grid;
  gap: 8px;
  min-height: 126px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  color: #1f2937;
}

.quick-card:hover {
  border-color: #a9c6ff;
  box-shadow: 0 10px 24px rgba(21, 94, 239, 0.1);
}

.quick-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #edf2ff;
  color: #155eef;
  font-weight: 800;
}

.quick-card small {
  color: #6b7280;
  line-height: 1.5;
}

.portal-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 18px;
}

.todo-list,
.notice-list {
  display: grid;
  gap: 10px;
}

.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fbfdff;
  padding: 12px 14px;
  color: #1f2937;
}

.todo-item strong {
  min-width: 42px;
  color: #155eef;
  font-size: 22px;
  text-align: right;
}

.notice-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  border-bottom: 1px solid #eef2f7;
}

.notice-item:last-child {
  border-bottom: 0;
}

.notice-item span {
  color: #6b7280;
  white-space: nowrap;
}

.notice-content {
  max-width: 520px;
  white-space: pre-wrap;
}

.common-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.common-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid #dbe4f0;
  border-radius: 8px;
  background: #f8fbff;
  color: #334155;
  font-weight: 700;
}

.common-link:hover {
  border-color: #a9c6ff;
  color: #155eef;
  background: #fff;
}

.placeholder-panel {
  max-width: 760px;
}

.backup-info p {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.log-user-agent {
  max-width: 360px;
  overflow-wrap: anywhere;
  color: #6b7280;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-left: 3px solid #d6e0ff;
  padding: 4px 0 8px 12px;
}

.finance-board {
  border: 1px solid #d7deea;
  border-radius: 8px;
  padding: 18px;
  background: #f8fbff;
}

.finance-header {
  display: grid;
  grid-template-columns: auto 220px minmax(420px, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.finance-header h2,
.fee-column-title h3 {
  margin: 0;
}

.rate-box label {
  font-size: 12px;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.finance-summary div {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
}

.finance-summary span {
  display: block;
  color: #6b7280;
  font-size: 12px;
}

.finance-summary strong {
  display: block;
  margin-top: 4px;
}

.fee-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.fee-columns-single {
  grid-template-columns: 1fr;
}

.fee-column {
  min-width: 0;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.fee-column-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.fee-rows {
  display: grid;
  gap: 6px;
}

.fee-row {
  display: grid;
  grid-template-columns: minmax(104px, 1.2fr) minmax(108px, 1.1fr) 68px minmax(72px, 0.9fr) 58px minmax(78px, 0.9fr) minmax(70px, 0.9fr) minmax(70px, 0.9fr) 58px;
  gap: 8px;
  align-items: center;
}

.fee-row-head {
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  background: #f3f6fb;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
}

.fee-row input[readonly] {
  background: #f9fafb;
  color: #4b5563;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(17, 24, 39, 0.45);
  padding: 24px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(620px, 100%);
  max-height: 80vh;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d1d5db;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
  margin: 0;
}

.modal-search {
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-results {
  max-height: 420px;
  overflow: auto;
  padding: 8px;
}

.modal-result {
  width: 100%;
  display: block;
  border: 0;
  border-radius: 6px;
  background: #fff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.modal-result:hover {
  background: #f3f6fb;
}

.modal-result span {
  display: block;
  color: #6b7280;
  margin-top: 3px;
}

.modal-empty {
  color: #6b7280;
  padding: 18px 12px;
}

@media (max-width: 1200px) {
  .quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .common-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .login-page {
    padding: 18px;
  }

  .login-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .login-brand-panel {
    min-height: 360px;
    padding: 30px;
  }

  .login-box {
    padding: 30px;
  }

  .sidebar {
    position: static;
  }

  .stats,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .finance-header,
  .finance-summary,
  .fee-columns,
  .fee-row,
  .portal-hero,
  .portal-columns,
  .report-periods {
    grid-template-columns: 1fr;
  }

  .quick-grid,
  .common-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-visual {
    display: none;
  }

  .span-2,
  .span-3 {
    grid-column: span 1;
  }
}
