:root {
  --bg: #eef3f7;
  --panel: #ffffff;
  --panel-soft: #f7fafc;
  --text: #142033;
  --muted: #65758b;
  --line: #d9e2ec;
  --brand: #0f766e;
  --brand-strong: #115e59;
  --blue: #2563eb;
  --red: #dc2626;
  --amber: #d97706;
  --green: #16a34a;
  --shadow: 0 16px 38px rgba(21, 35, 55, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.is-busy {
  transform: translateY(0);
  filter: saturate(0.9);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 520px) 1fr;
  position: relative;
  background:
    radial-gradient(circle at 14% 18%, rgba(5, 116, 183, 0.28), transparent 28%),
    radial-gradient(circle at 34% 82%, rgba(230, 0, 45, 0.16), transparent 24%),
    linear-gradient(110deg, #061c31 0%, #0a304a 38%, #eef4f8 38.2%, #f7fafc 100%);
  padding-bottom: 58px;
}

.login-brand {
  padding: 78px 58px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 34%),
    linear-gradient(135deg, rgba(8, 116, 185, 0.16), rgba(6, 28, 49, 0));
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 1px) 0 0 / 42px 42px,
    linear-gradient(0deg, rgba(255, 255, 255, 0.045), transparent 1px) 0 0 / 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.62), transparent 72%);
}

.login-brand > * {
  position: relative;
  z-index: 1;
}

.login-logo-card {
  width: min(346px, 86vw);
  min-height: 96px;
  margin-bottom: 40px;
  padding: 18px 22px 22px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 249, 252, 0.94));
  border: 1px solid rgba(206, 224, 235, 0.9);
  border-radius: 10px;
  box-shadow:
    0 18px 34px rgba(1, 12, 22, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.login-logo-card::after {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 12px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e6002d 0 38%, #0874b9 38% 100%);
  box-shadow: 0 1px 4px rgba(6, 48, 74, 0.18);
}

.login-logo-card img {
  display: block;
  width: 100%;
  max-height: 62px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 6px 8px rgba(4, 20, 32, 0.12));
}

.login-brand h1 {
  margin: 0 0 18px;
  font-size: 40px;
  line-height: 1.18;
  letter-spacing: 0;
  max-width: 440px;
  text-wrap: balance;
}

.login-brand p {
  margin: 0;
  max-width: 420px;
  color: #dff7f3;
  font-size: 18px;
  line-height: 1.8;
}

.login-eyebrow {
  margin-bottom: 16px;
  color: #8fd1ec;
  font-size: 14px;
  font-weight: 760;
  letter-spacing: 0;
}

.login-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.login-capabilities span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(143, 209, 236, 0.34);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dff7ff;
  font-size: 13px;
  font-weight: 760;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-brand-note {
  padding-top: 24px;
  border-top: 1px solid rgba(218, 240, 247, 0.18);
}

.login-panel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-panel {
  width: min(440px, 100%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 252, 254, 0.96));
  border: 1px solid rgba(205, 221, 233, 0.95);
  box-shadow: 0 24px 54px rgba(18, 37, 61, 0.16);
  border-radius: 12px;
  padding: 34px;
  position: relative;
}

.login-panel::before {
  content: "";
  position: absolute;
  left: 34px;
  right: 34px;
  top: 0;
  height: 4px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, #e6002d 0 34%, #0874b9 34% 100%);
}

.login-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.login-panel-head span {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e7f2fc;
  color: #075985;
  font-size: 12px;
  font-weight: 850;
}

.login-panel h2 {
  margin: 0 0 6px;
  font-size: 28px;
}

.login-panel .hint {
  color: var(--muted);
  margin: 0;
}

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

.field label {
  color: #334155;
  font-weight: 650;
  font-size: 14px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 6px;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 92px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.captcha-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
}

.captcha {
  border: 1px dashed #89a4b8;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0f766e;
  background: #effaf7;
  letter-spacing: 4px;
}

.check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 22px;
}

.check-row label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  padding: 0;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.ghost-btn,
.icon-btn {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 38px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

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

.primary-btn:hover {
  background: var(--brand-strong);
}

.secondary-btn {
  background: #e8f1ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.danger-btn {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.ghost-btn,
.icon-btn {
  background: #fff;
  border-color: var(--line);
  color: #334155;
}

.login-panel .primary-btn {
  width: 100%;
  min-height: 46px;
}

.site-footer {
  padding: 20px;
  text-align: center;
  color: #666;
  font-size: 14px;
  background: #ffffff;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: #0f766e;
  text-decoration: underline;
}

body:has(.login-page) .site-footer {
  margin-top: -58px;
  padding: 18px 20px 20px;
  position: relative;
  z-index: 2;
  background: transparent;
  color: rgba(15, 23, 42, 0.72);
}

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

.sidebar {
  background: #0d2233;
  color: #cfe1f2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.side-brand strong {
  display: block;
  color: #fff;
  font-size: 18px;
  line-height: 1.45;
}

.side-brand span {
  display: block;
  color: #93a9bd;
  font-size: 13px;
  margin-top: 8px;
}

.nav {
  padding: 12px;
  display: grid;
  gap: 4px;
}

.nav button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #cfe1f2;
  border-radius: 8px;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.08s ease, color 0.08s ease, transform 0.06s ease;
}

.nav button:hover,
.nav button.active,
.nav button.pressed {
  background: #14344d;
  color: #fff;
}

.nav button:active {
  transform: scale(0.985);
}

.nav button:focus-visible {
  outline: 2px solid rgba(139, 209, 199, 0.75);
  outline-offset: 2px;
}

.nav .nav-icon {
  width: 24px;
  text-align: center;
  color: #8bd1c7;
  pointer-events: none;
}

.nav .nav-label {
  pointer-events: none;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

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

.page-title {
  display: grid;
  gap: 3px;
}

.page-title strong {
  font-size: 19px;
}

.page-title span,
.user-meta {
  color: var(--muted);
  font-size: 13px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  display: grid;
  place-items: center;
  font-weight: 800;
}

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

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

.list-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search {
  min-width: 260px;
  border: 1px solid var(--line);
  background: #fff;
  height: 38px;
  border-radius: 6px;
  padding: 8px 12px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}

.metric {
  display: grid;
  gap: 8px;
  min-height: 126px;
}

.metric span {
  color: var(--muted);
  font-size: 14px;
}

.metric strong {
  font-size: 32px;
}

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

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 19px;
}

.table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  font-size: 14px;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: #475569;
  font-weight: 750;
  position: sticky;
  top: 0;
}

tr:hover td {
  background: #fbfdff;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  border: 1px solid transparent;
}

.tag.green {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.tag.blue {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.tag.amber {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.tag.red {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.tag.gray {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

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

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.inline-actions button {
  padding: 6px 8px;
}

.progress {
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--brand);
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 64px;
  gap: 10px;
  align-items: center;
  color: #334155;
  font-size: 14px;
}

.dashboard-quick {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-quick > div:first-child {
  display: grid;
  gap: 4px;
}

.dashboard-warning-list {
  display: grid;
  gap: 10px;
}

.dashboard-warning-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  background: #fff;
}

.dashboard-warning-item.danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.dashboard-warning-item.warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.dashboard-warning-item div {
  display: grid;
  gap: 4px;
}

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

.compact-table table {
  min-width: 0;
}

.compact-table th,
.compact-table td {
  padding: 9px 10px;
}

.well-board-head {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
  box-shadow: 0 10px 28px rgba(20, 32, 51, 0.06);
}

.well-board-title {
  display: grid;
  gap: 5px;
}

.well-board-title .eyebrow {
  color: #0f766e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.well-board-title h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.well-board-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.well-board-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.well-overview-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.well-overview-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.well-overview-card span {
  color: var(--muted);
  font-size: 13px;
}

.well-overview-card strong {
  font-size: 22px;
  line-height: 1;
}

.well-overview-card.green {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.well-overview-card.blue {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.well-overview-card.amber {
  border-color: #fde68a;
  background: #fffbeb;
}

.well-overview-card.gray,
.well-overview-card.slate {
  background: #f8fafc;
}

.well-searchbar {
  grid-column: 1 / -1;
}

.well-searchbar .search {
  width: min(560px, 100%);
}

.operation-wells-wrap {
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20, 32, 51, 0.06);
}

.operation-wells-table {
  min-width: 1180px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.operation-wells-table th,
.operation-wells-table td {
  padding: 14px 14px;
  vertical-align: middle;
}

.operation-wells-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.operation-wells-table tbody td {
  background: #fff;
  border-bottom: 1px solid #edf2f7;
}

.operation-wells-table tbody tr:hover td {
  background: #f8fbff;
}

.well-col-main {
  width: 220px;
}

.well-col-status {
  width: 104px;
}

.well-col-type {
  width: 170px;
}

.well-col-date {
  width: 126px;
}

.well-col-crew {
  width: 164px;
}

.well-col-phone {
  width: 180px;
}

.well-col-source {
  width: 150px;
}

.well-col-actions {
  width: 166px;
}

.well-identity {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.well-status-rail {
  width: 4px;
  height: 42px;
  border-radius: 999px;
  background: #94a3b8;
}

.well-row-green .well-status-rail {
  background: #16a34a;
}

.well-row-blue .well-status-rail {
  background: #2563eb;
}

.well-row-amber .well-status-rail {
  background: #d97706;
}

.well-row-gray .well-status-rail {
  background: #94a3b8;
}

.well-identity strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.well-identity span:not(.well-status-rail),
.well-type-cell small,
.well-date-cell small,
.well-source-cell > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.well-type-cell,
.well-date-cell,
.well-crew-cell,
.well-source-cell,
.well-status-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.well-status-cell .tag,
.well-source-cell .tag {
  justify-self: start;
  max-width: 100%;
}

.well-type-cell span,
.well-date-cell span,
.well-crew-cell span,
.well-phone {
  line-height: 1.35;
}

.well-type-cell span,
.well-date-cell span {
  white-space: nowrap;
}

.well-type-cell small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.well-crew-cell span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.well-phone {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.table-actions {
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.table-actions .ghost-btn,
.table-actions .secondary-btn {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 7px;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.timeline-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.muted {
  color: var(--muted);
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal {
  width: min(860px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.wide-modal {
  width: min(1480px, 100%);
}

.modal-head,
.modal-foot {
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.modal-body {
  padding: 20px 22px;
}

.modal-foot {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

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

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

.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  gap: 4px;
}

.detail-tabs button {
  border: 0;
  background: transparent;
  padding: 10px 12px;
  color: var(--muted);
}

.detail-tabs button.active {
  color: var(--brand-strong);
  border-bottom: 3px solid var(--brand);
}

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

.report-sections {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.report-card {
  padding-bottom: 14px;
}

.import-center-flow {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.import-center-flow strong {
  margin-right: 4px;
}

.import-center-flow span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
}

.import-center-card {
  display: grid;
  gap: 8px;
}

.import-center-card > span {
  color: var(--muted);
  font-size: 13px;
}

.import-center-card > strong {
  font-size: 18px;
}

.import-center-card > small {
  color: var(--muted);
  min-height: 36px;
}

.import-center-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

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

.system-param {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.system-param span {
  color: var(--muted);
  font-size: 13px;
}

.system-param strong {
  font-size: 16px;
}

.permission-grid span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.formula-panel {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.airport-strip span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.airport-strip strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 4px;
}

.formula-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  min-height: 88px;
  display: grid;
  gap: 5px;
}

.formula-cell span {
  color: var(--muted);
  font-size: 13px;
}

.formula-cell strong {
  font-size: 24px;
}

.formula-cell small {
  color: #64748b;
}

.locked-cell {
  background: #f1f5f9;
  border-style: dashed;
}

.plan-section {
  margin-top: 18px;
}

.plan-table-wrap {
  max-height: 380px;
}

.plan-table {
  min-width: 1320px;
}

.plan-table th,
.plan-table td {
  padding: 8px;
}

.plan-table th {
  white-space: nowrap;
}

.row-no {
  width: 56px;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
}

.plan-input {
  width: 100%;
  min-width: 118px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 8px;
  background: #fff;
}

.table-input {
  width: 100%;
  min-width: 118px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 5px 8px;
  background: #fff;
  margin-bottom: 6px;
}

.plan-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.12);
}

.formula-input {
  background: #f1f5f9;
  color: #1d4ed8;
  font-weight: 700;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #102033;
  color: #fff;
  padding: 12px 16px;
  border-radius: 6px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.file-input {
  display: none;
}

.import-errors,
.success-note,
.warning-note {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  line-height: 1.7;
}

.import-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.import-errors strong {
  display: block;
  margin-bottom: 6px;
}

.success-note {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.warning-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.warning-note strong {
  display: block;
  margin-bottom: 6px;
}

.coverage-box {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  color: #1e3a8a;
}

.coverage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.coverage-head span {
  color: #1d4ed8;
  font-size: 13px;
}

.coverage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.coverage-summary span {
  border: 1px solid #bfdbfe;
  background: #fff;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 13px;
}

.coverage-replace {
  border-top: 1px solid #bfdbfe;
  padding-top: 10px;
  line-height: 1.7;
}

.coverage-replace strong {
  display: block;
  color: #b45309;
  margin-bottom: 4px;
}

.coverage-new {
  border-top: 1px solid #bfdbfe;
  padding-top: 10px;
  color: #166534;
}

.quality-panel {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

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

.quality-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.quality-head span {
  color: var(--muted);
  font-size: 13px;
}

.quality-score {
  border-radius: 999px;
  padding: 6px 11px;
  font-weight: 700;
  white-space: nowrap;
}

.quality-score.ok {
  background: #dcfce7;
  color: #166534;
}

.quality-score.warn {
  background: #fef3c7;
  color: #92400e;
}

.quality-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.quality-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.quality-filter {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}

.quality-filter.active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.quality-filter.export {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 700;
}

.quality-filter.repair {
  border-color: #7c3aed;
  background: #f5f3ff;
  color: #6d28d9;
  font-weight: 700;
}

.quality-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  display: grid;
  gap: 8px;
  min-height: 132px;
}

.quality-card strong {
  font-size: 15px;
}

.quality-card p {
  margin: 0;
  color: var(--text);
}

.quality-card span {
  color: var(--muted);
  font-size: 13px;
}

.quality-card.ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.quality-card.warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.quality-card.danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.vessel-map {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #eaf7fb;
}

.vessel-map svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 280px;
}

.map-title {
  font-size: 18px;
  font-weight: 800;
  fill: #134e4a;
}

.map-mini-label {
  font-size: 12px;
  fill: #164e63;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.map-mini-label.vessel {
  fill: #115e59;
}

.progress-cell {
  position: relative;
  width: 112px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #f8fafc;
}

.progress-cell span {
  display: block;
  height: 100%;
  opacity: 0.18;
}

.progress-cell strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.acceptance-panel {
  margin-bottom: 16px;
}

.acceptance-metrics {
  margin: 12px 0;
}

.readiness-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 12px;
  background: #f8fafc;
}

.readiness-strip strong {
  font-size: 14px;
}

.readiness-strip span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
  flex: 1 1 320px;
}

.readiness-strip.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.readiness-strip.warning {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.readiness-strip.info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.readiness-strip.ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.trial-gate {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  border-left: 4px solid var(--line);
}

.trial-gate > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.trial-gate strong,
.trial-gate span {
  display: block;
}

.trial-gate > div:first-child span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.trial-gate-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trial-gate-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.trial-gate.danger {
  border-left-color: var(--red);
}

.trial-gate.warning {
  border-left-color: var(--amber);
}

.trial-gate.ready {
  border-left-color: var(--green);
}

.trial-gate-rows {
  display: grid;
  gap: 8px;
}

.trial-gate-rows-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.trial-gate-rows-head > .actions {
  align-items: center;
}

.trial-gate-rows-head span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.table-wrap.compact table {
  min-width: 760px;
}

.table-wrap.compact th,
.table-wrap.compact td {
  padding: 9px 10px;
  font-size: 13px;
}

.acceptance-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.acceptance-groups span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
}

.acceptance-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.acceptance-batch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.acceptance-batch strong {
  display: block;
  margin-bottom: 2px;
}

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

.acceptance-batch .actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.acceptance-batch button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.acceptance-history {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.acceptance-history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.acceptance-history-head span,
.acceptance-history-list span {
  color: var(--muted);
  font-size: 12px;
}

.acceptance-history-list {
  display: grid;
  gap: 6px;
}

.acceptance-history-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding-top: 6px;
  cursor: pointer;
}

.acceptance-history-list button:hover strong {
  color: var(--primary);
}

.quality-list {
  display: grid;
  gap: 8px;
}

.quality-item {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
}

.quality-item-main {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.quality-item span,
.quality-item-main span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 3px;
}

.quality-item strong,
.quality-item-main strong {
  color: var(--text);
}

.quality-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.quality-actions .secondary-btn,
.quality-actions .ghost-btn {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 12px;
}

.quality-item.danger {
  border-color: #fecaca;
  background: #fef2f2;
}

.quality-item.warning {
  border-color: #fde68a;
  background: #fffbeb;
}

.quality-item.info {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.result-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 11px 12px;
  display: grid;
  gap: 5px;
}

.result-item span {
  color: var(--muted);
  font-size: 13px;
}

.result-item strong {
  font-size: 18px;
}

.mapping-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
  display: grid;
  gap: 5px;
}

.mapping-item span {
  color: var(--muted);
  font-size: 13px;
}

.mapping-item strong {
  font-size: 14px;
}

.mapping-item.ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.mapping-item.missing {
  border-color: #fecaca;
  background: #fef2f2;
}

.import-preview-table {
  max-height: 420px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 88px 1fr;
  }

  .side-brand strong,
  .side-brand span,
  .nav-label {
    display: none;
  }

  .nav button {
    justify-content: center;
  }

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

@media (max-width: 760px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-brand {
    padding: 42px 28px 20px;
  }

  .login-brand h1 {
    font-size: 32px;
  }

  .login-logo-card {
    width: min(300px, 100%);
    min-height: 86px;
    margin-bottom: 28px;
  }

  .login-capabilities {
    margin-top: 22px;
  }

  .login-panel-wrap {
    padding: 26px 20px 76px;
  }

  .login-panel {
    padding: 30px 24px 26px;
  }

  .login-panel::before {
    left: 24px;
    right: 24px;
  }

  .login-panel-head {
    display: grid;
    gap: 10px;
  }

  .app-shell {
    grid-template-columns: 1fr;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: auto;
    max-width: 100vw;
    overflow: hidden;
  }

  .side-brand {
    padding: 12px 14px 8px;
  }

  .side-brand strong,
  .side-brand span,
  .nav-label {
    display: block;
  }

  .side-brand strong {
    font-size: 15px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .side-brand span {
    margin-top: 4px;
    font-size: 11px;
    overflow-wrap: anywhere;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow: auto;
    padding: 8px 12px 12px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav button {
    width: auto;
    min-width: max-content;
    min-height: 42px;
    justify-content: flex-start;
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
  }

  .nav .nav-icon {
    width: auto;
  }

  .main {
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .topbar {
    height: auto;
    padding: 12px 14px;
    align-items: flex-start;
    gap: 12px;
    position: static;
    max-width: 100vw;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .page-title {
    min-width: 0;
  }

  .page-title strong {
    font-size: 17px;
  }

  .page-title span {
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .content {
    padding: 12px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .toolbar,
  .dashboard-quick,
  .well-board-actions,
  .user-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-box {
    gap: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: stretch;
    min-width: 110px;
  }

  .user-box .avatar {
    display: none;
  }

  .user-box > div {
    grid-column: 1 / -1;
    text-align: right;
    font-size: 13px;
  }

  .user-meta {
    display: none;
  }

  .user-box .ghost-btn {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
  }

  .well-board-head {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
    border-radius: 9px;
    max-width: 100%;
    overflow: hidden;
  }

  .well-board-title .eyebrow {
    font-size: 10px;
  }

  .well-board-title h2 {
    font-size: 20px;
  }

  .well-board-title p {
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .well-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .well-overview-card {
    min-height: 50px;
    padding: 10px 12px;
    min-width: 0;
  }

  .well-overview-card span {
    font-size: 12px;
  }

  .well-overview-card strong {
    font-size: 20px;
  }

  .well-board-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .well-board-actions button {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    padding: 7px 8px;
    font-size: 13px;
    gap: 4px;
  }

  .well-searchbar .search {
    width: 100%;
    height: 40px;
  }

  .operation-wells-wrap {
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .operation-wells-table,
  .operation-wells-table tbody,
  .operation-wells-table tr,
  .operation-wells-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .operation-wells-table colgroup,
  .operation-wells-table thead {
    display: none;
  }

  .operation-wells-table {
    border-collapse: separate;
    border-spacing: 0;
  }

  .operation-wells-table tbody {
    display: grid;
    gap: 10px;
  }

  .operation-wells-table tbody tr {
    border: 1px solid #dbe5ef;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    max-width: 100%;
    box-shadow: 0 8px 20px rgba(20, 32, 51, 0.05);
  }

  .operation-wells-table tbody td {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px 12px;
    border-bottom: 1px solid #edf2f7;
    background: #fff;
    font-size: 13px;
  }

  .operation-wells-table tbody td::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .operation-wells-table tbody td:nth-child(1) {
    display: block;
    padding: 13px 12px 10px;
    background: #fbfdff;
  }

  .operation-wells-table tbody td:nth-child(1)::before {
    content: none;
  }

  .operation-wells-table tbody td:nth-child(2)::before {
    content: "状态";
  }

  .operation-wells-table tbody td:nth-child(3)::before {
    content: "作业";
  }

  .operation-wells-table tbody td:nth-child(4)::before {
    content: "时间";
  }

  .operation-wells-table tbody td:nth-child(5)::before {
    content: "人员";
  }

  .operation-wells-table tbody td:nth-child(6)::before {
    content: "电话";
  }

  .operation-wells-table tbody td:nth-child(7)::before {
    content: "计划";
  }

  .operation-wells-table tbody td:nth-child(8) {
    display: block;
    padding: 10px 12px 12px;
    border-bottom: 0;
  }

  .operation-wells-table tbody td:nth-child(8)::before {
    content: none;
  }

  .well-identity {
    grid-template-columns: 4px minmax(0, 1fr);
  }

  .well-status-rail {
    height: 48px;
  }

  .well-identity strong {
    font-size: 16px;
  }

  .well-type-cell,
  .well-date-cell,
  .well-crew-cell,
  .well-source-cell,
  .well-status-cell {
    gap: 4px;
  }

  .well-phone {
    white-space: normal;
  }

  .table-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
  }

  .table-actions .ghost-btn,
  .table-actions .secondary-btn {
    width: 100%;
    min-height: 36px;
    padding: 7px 8px;
  }

  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2,
  .form-grid,
  .result-grid,
  .mapping-grid,
  .system-param-grid,
  .permission-grid,
  .formula-panel {
    grid-template-columns: 1fr;
  }

  .search {
    min-width: 100%;
  }
}

.typhoon-map {
  display: grid;
  gap: 10px;
}

.typhoon-map svg {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
}

.typhoon-map .map-grid line {
  stroke: #d7e6ef;
  stroke-width: 0.8;
}

.typhoon-map .map-land path {
  fill: #dce8dd;
  stroke: #9fb6a5;
  stroke-width: 0.8;
}

.typhoon-map .map-label,
.typhoon-map .sea-label,
.typhoon-map .track-label {
  fill: #334155;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 2px;
}

.typhoon-map .sea-label {
  fill: #2563eb;
  font-size: 10px;
}

.typhoon-map .track-label {
  fill: #1f2937;
  font-size: 8px;
  font-weight: 600;
}

.typhoon-map-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.typhoon-map-meta span {
  background: #f3f6f9;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 5px 10px;
}

.dashboard-weather {
  margin-top: 16px;
}

/* Visual refresh: centered workspace, calmer navigation, denser readable tables. */
:root {
  --bg: #f3f6f8;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #142033;
  --muted: #64748b;
  --line: #dde6ee;
  --brand: #0f766e;
  --brand-strong: #0b5f59;
  --sidebar: #0f2535;
  --sidebar-soft: #17384f;
  --shadow: 0 14px 34px rgba(15, 33, 48, 0.08);
}

body {
  background: linear-gradient(180deg, #f7fafc 0, #eef4f7 420px, #f3f6f8 100%);
  color: #172033;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, #10283a 0%, #0d2130 52%, #0b1b28 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.side-brand {
  padding: 26px 22px 24px;
}

.side-brand strong {
  font-size: 20px;
  letter-spacing: 0;
}

.side-brand span {
  color: #9fb4c7;
}

.nav {
  padding: 14px 12px 22px;
  gap: 6px;
}

.nav button {
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #d5e3ef;
  font-size: 15px;
  font-weight: 650;
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav button.active {
  background: #173c56;
  color: #ffffff;
  box-shadow: inset 3px 0 0 #7dd3c7;
}

.nav .nav-icon {
  width: 22px;
  color: #8bd6cd;
  opacity: 0.96;
}

.main {
  min-width: 0;
  background: transparent;
}

.topbar {
  height: 72px;
  padding: 0 clamp(20px, 3vw, 42px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(218, 228, 238, 0.92);
  backdrop-filter: blur(16px);
}

.page-title {
  min-width: 0;
}

.page-title strong {
  font-size: 22px;
  letter-spacing: 0;
}

.page-title span {
  font-size: 13px;
}

.user-box {
  gap: 10px;
}

.avatar {
  width: 38px;
  height: 38px;
  background: #e6f7f5;
  color: #0f766e;
}

.content {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 26px clamp(18px, 3vw, 38px) 42px;
}

.toolbar {
  align-items: stretch;
  padding: 14px;
  border: 1px solid #dce6ef;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(15, 33, 48, 0.05);
}

.toolbar-left,
.toolbar-right {
  gap: 10px;
}

.search,
.field input,
.field select,
.field textarea,
.plan-input,
.table-input,
select {
  border-color: #d6e1eb;
  border-radius: 7px;
}

.search {
  height: 40px;
  min-width: min(420px, 100%);
  background: #fff;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.ghost-btn,
.icon-btn {
  border-radius: 7px;
  min-height: 38px;
  font-weight: 650;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
}

.primary-btn {
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.16);
}

.ghost-btn,
.icon-btn {
  background: #ffffff;
}

.ghost-btn:hover,
.icon-btn:hover {
  border-color: #c4d2df;
  background: #f8fafc;
}

.primary-btn:active,
.secondary-btn:active,
.ghost-btn:active,
.danger-btn:active,
.icon-btn:active {
  transform: translateY(1px);
}

.grid {
  gap: 18px;
}

.card,
.quality-panel,
.well-board-head,
.operation-wells-wrap,
.table-wrap {
  border-color: #dce6ef;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 33, 48, 0.055);
}

.card {
  padding: 18px;
}

.metric {
  min-height: 118px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.metric strong {
  font-size: 30px;
  letter-spacing: 0;
}

.section-title {
  align-items: flex-start;
  margin-bottom: 14px;
}

.section-title h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.table-wrap {
  overflow: auto;
  background: #ffffff;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 11px 13px;
  line-height: 1.45;
}

th {
  background: #f6f9fc;
  color: #46576b;
  font-size: 13px;
}

tbody tr:nth-child(even) td {
  background: #fbfdff;
}

tr:hover td,
.operation-wells-table tbody tr:hover td {
  background: #f3f8fb;
}

.tag {
  border-radius: 999px;
  min-height: 25px;
  padding: 3px 9px;
}

.well-board-head {
  grid-template-columns: minmax(300px, 1fr) auto;
  gap: 18px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.82), rgba(255, 255, 255, 0.96) 46%), #ffffff;
}

.well-board-title h2 {
  font-size: 24px;
}

.well-board-title p {
  max-width: 760px;
}

.well-board-actions {
  align-items: center;
}

.well-overview-grid {
  grid-template-columns: repeat(5, minmax(132px, 1fr));
}

.well-overview-card {
  min-height: 62px;
  border-radius: 9px;
}

.operation-wells-wrap {
  overflow: auto;
}

.operation-wells-table {
  min-width: 1280px;
}

.operation-wells-table th,
.operation-wells-table td {
  padding: 13px 14px;
}

.operation-wells-table th {
  top: 0;
  box-shadow: inset 0 -1px 0 #e7eef5;
}

.well-col-main {
  width: 230px;
}

.well-col-type {
  width: 150px;
}

.well-col-date {
  width: 132px;
}

.well-col-crew {
  width: 160px;
}

.well-col-phone {
  width: 190px;
}

.well-col-source {
  width: 150px;
}

.well-col-actions {
  width: 176px;
}

.well-status-rail {
  height: 46px;
}

.well-identity strong {
  font-size: 15px;
}

.well-identity span:not(.well-status-rail),
.well-type-cell small,
.well-date-cell small,
.well-source-cell > span {
  font-size: 12px;
}

.well-phone {
  color: #26374d;
}

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

.table-actions .ghost-btn,
.table-actions .secondary-btn {
  min-height: 34px;
}

.modal {
  border-radius: 10px;
}

.toast {
  border-radius: 8px;
}

@media (min-width: 1500px) {
  .content {
    width: min(100%, 1760px);
  }

  .operation-wells-table {
    min-width: 1360px;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 84px 1fr;
  }

  .content {
    padding-inline: 18px;
  }

  .well-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    background: #f5f8fb;
  }

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

  .sidebar {
    border-right: 0;
    box-shadow: 0 8px 20px rgba(15, 33, 48, 0.14);
  }

  .side-brand {
    padding: 14px 16px 8px;
  }

  .nav {
    padding: 8px 12px 12px;
  }

  .nav button {
    min-height: 40px;
    border-radius: 999px;
    font-size: 14px;
  }

  .nav button.active {
    box-shadow: none;
    background: #1b4965;
  }

  .topbar {
    padding: 12px 14px;
    background: #ffffff;
  }

  .content {
    width: 100%;
    padding: 14px 12px 28px;
  }

  .toolbar {
    padding: 12px;
    display: grid;
    gap: 10px;
  }

  .toolbar-left,
  .toolbar-right,
  .actions {
    width: 100%;
  }

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

  .toolbar-right button,
  .actions button,
  .actions select {
    width: 100%;
  }

  .card,
  .quality-panel,
  .well-board-head {
    border-radius: 10px;
    padding: 14px;
  }

  .well-board-head {
    background: #ffffff;
  }

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

  .well-overview-card {
    min-height: 56px;
  }

  .operation-wells-wrap {
    overflow: visible;
    box-shadow: none;
  }

  .operation-wells-table tbody tr {
    border-radius: 11px;
  }

  .operation-wells-table tbody td {
    grid-template-columns: 72px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .well-board-head {
    grid-template-columns: 1fr;
  }

  .well-board-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    justify-content: stretch;
  }

  .well-board-actions button {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .well-board-title,
  .well-searchbar {
    min-width: 0;
  }

  .page-title span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Keep operation well status column visually centered with the data below it. */
.operation-wells-table thead th:nth-child(2),
.operation-wells-table tbody td:nth-child(2) {
  text-align: center;
}

.operation-wells-table tbody td:nth-child(2) {
  vertical-align: middle;
}

.well-status-cell {
  height: 100%;
  place-items: center;
  justify-content: center;
  text-align: center;
}

.well-status-cell .tag {
  justify-self: center;
}

@media (max-width: 760px) {
  .operation-wells-table tbody td:nth-child(2) {
    text-align: left;
  }

  .well-status-cell {
    place-items: start;
    justify-content: start;
    text-align: left;
  }

  .well-status-cell .tag {
    justify-self: start;
  }
}

/* Optical alignment for operation well status text: header center aligns with the middle character in 3-char labels like 作业中. */
.operation-wells-table thead th:nth-child(2),
.operation-wells-table tbody td:nth-child(2) {
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

.operation-wells-table thead th:nth-child(2) {
  letter-spacing: 0;
}

.well-status-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.well-status-cell .tag {
  width: 58px;
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  letter-spacing: 0;
  text-align: center;
}

@media (max-width: 760px) {
  .operation-wells-table tbody td:nth-child(2) {
    padding-left: 12px;
    padding-right: 12px;
  }

  .well-status-cell {
    justify-content: flex-start;
  }
}

/* PC optical nudge requested: move operation status badge left by about 1.5 Chinese characters. */
@media (min-width: 761px) {
  .operation-wells-table .well-status-cell .tag {
    transform: translateX(-1.5em);
  }
}

@media (max-width: 760px) {
  .operation-wells-table .well-status-cell .tag {
    transform: none;
  }
}

/* Restore PC status center-axis alignment: header center aligns with middle character of status text. */
@media (min-width: 761px) {
  .operation-wells-table .well-status-cell {
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .operation-wells-table .well-status-cell .tag {
    transform: none;
    width: 58px;
    justify-content: center;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Brand polish: compact official product mark without prototype wording. */
.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #0b342f;
  background: linear-gradient(135deg, #a7f3d0 0%, #67e8f9 100%);
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 10px 24px rgba(20, 184, 166, 0.2);
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.side-brand .brand-copy strong {
  font-size: 18px;
  line-height: 1.18;
  white-space: nowrap;
}

.side-brand .brand-copy span {
  margin-top: 0;
  color: #a9bece;
  font-size: 13px;
  letter-spacing: 0;
  white-space: nowrap;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .side-brand {
    justify-content: center;
    padding-inline: 12px;
  }

  .brand-copy {
    display: none;
  }
}

@media (max-width: 760px) {
  .side-brand {
    gap: 10px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: 17px;
  }

  .side-brand .brand-copy strong {
    font-size: 16px;
  }

  .side-brand .brand-copy span {
    font-size: 12px;
  }
}

/* CNOOC logo in sidebar brand area. */
.cnooc-brand-mark {
  width: 44px;
  height: 44px;
  padding: 5px;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.cnooc-brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 760px) {
  .cnooc-brand-mark {
    width: 38px;
    height: 38px;
    padding: 4px;
  }
}

/* Use the larger CNOOC preview icon requested from sj51.net. */
.cnooc-brand-mark {
  width: 58px;
  height: 50px;
  padding: 4px;
  border-radius: 10px;
}

.cnooc-brand-mark img {
  object-fit: contain;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .cnooc-brand-mark {
    width: 52px;
    height: 46px;
  }
}

@media (max-width: 760px) {
  .cnooc-brand-mark {
    width: 50px;
    height: 44px;
    padding: 4px;
  }
}

/* Redesigned left brand area for the provided wide CNOOC logo. */
.sidebar {
  background:
    radial-gradient(circle at 40% -8%, rgba(37, 99, 235, 0.34), transparent 34%),
    linear-gradient(180deg, #0a2436 0%, #0b1f2e 56%, #071823 100%);
}

.side-brand {
  display: grid;
  gap: 12px;
  padding: 18px 16px 16px;
}

.brand-logo-card {
  width: 100%;
  min-height: 68px;
  padding: 9px 11px;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.2);
}

.brand-logo-card img {
  display: block;
  width: 100%;
  max-height: 58px;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 4px;
  padding: 0 3px;
}

.side-brand .brand-copy strong {
  white-space: normal;
  color: #f8fbff;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 0;
}

.side-brand .brand-copy span {
  margin: 0;
  color: #82d8d0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  padding-top: 10px;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .side-brand {
    padding: 14px 10px;
  }

  .brand-logo-card {
    min-height: 48px;
    padding: 7px;
  }

  .brand-logo-card img {
    max-height: 38px;
  }

  .brand-copy {
    display: none;
  }
}

@media (max-width: 760px) {
  .side-brand {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px 14px 10px;
  }

  .brand-logo-card {
    min-height: 42px;
    padding: 5px 7px;
    border-radius: 10px;
  }

  .brand-logo-card img {
    max-height: 34px;
  }

  .side-brand .brand-copy strong {
    font-size: 14px;
    line-height: 1.3;
  }

  .side-brand .brand-copy span {
    font-size: 10px;
  }
}

/* Sidebar header redesign: blend the wide logo into the top zone and keep product name on one baseline. */
.side-brand {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: end;
  column-gap: 10px;
  min-height: 72px;
  padding: 10px 13px 9px;
  border-bottom: 1px solid rgba(200, 221, 235, 0.16);
  background: linear-gradient(180deg, rgba(16, 56, 82, 0.88), rgba(12, 38, 56, 0.58));
}

.brand-logo-card {
  width: 92px;
  min-height: 44px;
  height: 44px;
  padding: 3px 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.brand-logo-card img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
  padding: 0 0 2px;
}

.side-brand .brand-copy strong {
  display: block;
  color: #f7fbff;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}

.side-brand .brand-copy span {
  display: none;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .side-brand {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 72px;
    padding: 10px 8px;
  }

  .brand-logo-card {
    width: 62px;
    height: 42px;
    min-height: 42px;
  }

  .brand-copy {
    display: none;
  }
}

@media (max-width: 760px) {
  .side-brand {
    grid-template-columns: 106px minmax(0, 1fr);
    min-height: 58px;
    padding: 8px 12px;
    align-items: center;
  }

  .brand-logo-card {
    width: 106px;
    height: 42px;
    min-height: 42px;
  }

  .side-brand .brand-copy strong {
    font-size: 13px;
  }
}

/* Logo-only sidebar header: fill the whole top brand frame. */
.side-brand {
  display: block;
  min-height: 72px;
  padding: 8px 12px;
}

.brand-logo-card {
  width: 100%;
  height: 56px;
  min-height: 56px;
  padding: 4px 6px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
}

.brand-logo-card img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.brand-copy {
  display: none;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .side-brand {
    min-height: 72px;
    padding: 9px 8px;
  }

  .brand-logo-card {
    width: 100%;
    height: 52px;
    min-height: 52px;
    padding: 4px;
  }
}

@media (max-width: 760px) {
  .side-brand {
    display: block;
    min-height: 58px;
    padding: 7px 12px;
  }

  .brand-logo-card {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 3px 5px;
  }
}

/* Make the whole sidebar logo frame white, matching the requested red-box area. */
.side-brand {
  background: #ffffff;
  border-bottom-color: #dbe6ef;
}

.brand-logo-card {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 2px 0;
}

/* Fully flatten the top logo band to pure white. */
.sidebar .side-brand,
.sidebar .side-brand::before,
.sidebar .side-brand::after {
  background: #ffffff !important;
  background-image: none !important;
  box-shadow: none !important;
}

.sidebar .side-brand {
  border-bottom: 1px solid #ffffff !important;
}

.sidebar .brand-logo-card,
.sidebar .brand-logo-card::before,
.sidebar .brand-logo-card::after {
  background: #ffffff !important;
  background-image: none !important;
  box-shadow: none !important;
  border: 0 !important;
}

.sidebar .brand-logo-card img {
  filter: none !important;
}

/* Merge the CNOOC logo band with the fixed topbar into one aligned white header. */
.sidebar .side-brand {
  height: 72px !important;
  min-height: 72px !important;
  padding: 8px 12px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #dbe6ef !important;
}

.sidebar .brand-logo-card {
  height: 56px !important;
  min-height: 56px !important;
  background: #ffffff !important;
}

.topbar {
  height: 72px !important;
  min-height: 72px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #dbe6ef !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

@media (max-width: 760px) {
  .sidebar .side-brand,
  .topbar {
    height: auto !important;
    min-height: 58px !important;
  }

  .sidebar .brand-logo-card {
    height: 44px !important;
    min-height: 44px !important;
  }
}

/* Keep the whole first row fixed: CNOOC logo band + page topbar. */
@media (min-width: 761px) {
  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
  }

  .sidebar .side-brand {
    position: sticky;
    top: 0;
    z-index: 8;
  }

  .sidebar .nav {
    height: calc(100vh - 72px);
    overflow-y: auto;
    scrollbar-width: thin;
  }

  .topbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 8 !important;
  }
}

/* Remove the dark hairline at the very top of the unified header. */
html,
body,
#app,
.app-shell,
.sidebar,
.main {
  border-top: 0 !important;
}

html,
body,
#app {
  background-color: #ffffff;
}

.sidebar::before,
.sidebar::after,
.topbar::before,
.topbar::after,
.side-brand::before,
.side-brand::after {
  background: #ffffff !important;
  border-color: #ffffff !important;
  box-shadow: none !important;
}

/* Remove the vertical separator between the CNOOC logo band and the topbar. */
.sidebar,
.sidebar .side-brand,
.sidebar .brand-logo-card,
.app-shell,
.main,
.topbar {
  border-left: 0 !important;
  border-right: 0 !important;
}

@media (min-width: 761px) {
  .sidebar {
    border-right: 0 !important;
    box-shadow: none !important;
  }

  .main {
    border-left: 0 !important;
  }
}

/* Personnel plan: upcoming offshore platform summary. */
.upcoming-offshore-panel {
  margin-bottom: 14px;
  border-color: #dce8f2;
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.92), rgba(255, 255, 255, 0.98)),
    #fff;
}

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

.upcoming-offshore-card,
.upcoming-offshore-empty {
  min-height: 126px;
  border: 1px solid #dbe8f2;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

.upcoming-offshore-card {
  display: grid;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(15, 47, 72, 0.055);
}

.upcoming-offshore-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.upcoming-offshore-card-head strong {
  display: block;
  color: #0f2741;
  font-size: 17px;
  line-height: 1.25;
}

.upcoming-offshore-card-head span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.upcoming-offshore-card-head b {
  min-width: 50px;
  text-align: right;
  color: #0f766e;
  font-size: 28px;
  line-height: 1;
}

.upcoming-offshore-card-head small {
  margin-left: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.upcoming-offshore-wells {
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.upcoming-offshore-contact {
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.upcoming-offshore-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  color: #64748b;
  background: #f8fbfd;
}

.upcoming-offshore-empty strong {
  color: #334155;
}

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

@media (max-width: 720px) {
  .upcoming-offshore-grid {
    grid-template-columns: 1fr;
  }

  .upcoming-offshore-card,
  .upcoming-offshore-empty {
    min-height: auto;
  }
}

/* Personnel plan: calendar-style three-day offshore board. */
.upcoming-offshore-panel {
  padding: 0 !important;
  overflow: hidden;
  background: #f7fbff !important;
  border: 1px solid #d8e6f2 !important;
  box-shadow: none !important;
}

.upcoming-offshore-panel > .section-title {
  margin: 0;
  padding: 16px 18px 12px;
  background: #ffffff;
  border-bottom: 1px solid #e1edf6;
  align-items: center;
}

.upcoming-offshore-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(260px, 1fr)) !important;
  gap: 14px !important;
  padding: 16px;
}

.upcoming-offshore-day {
  overflow: hidden;
  min-height: 290px;
  border: 1px solid #d7e8f5;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 47, 72, 0.05);
}

.upcoming-offshore-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 16px;
  background: #e7f2fc;
  border-bottom: 1px solid #c9dfef;
}

.upcoming-offshore-day-head strong {
  color: #0f4f83;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0;
}

.upcoming-offshore-day-head span {
  color: #326d91;
  font-size: 13px;
  font-weight: 750;
}

.upcoming-offshore-day-body {
  display: grid;
  gap: 12px;
  padding: 14px 0 8px;
}

.upcoming-offshore-section {
  display: grid;
}

.upcoming-offshore-section-head {
  display: grid;
  grid-template-columns: minmax(96px, 0.78fr) minmax(110px, 1fr) minmax(112px, 1.1fr);
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  background: #e2effa;
  color: #407292;
  font-size: 13px;
  font-weight: 750;
  column-gap: 12px;
}

.upcoming-offshore-section-head strong {
  color: #126189;
  font-size: 15px;
}

.upcoming-offshore-row {
  display: grid;
  grid-template-columns: minmax(96px, 0.78fr) minmax(188px, 2.1fr) 50px;
  align-items: center;
  min-height: 48px;
  padding: 8px 14px;
  border-bottom: 1px dashed #dcecf5;
  column-gap: 12px;
}

.upcoming-offshore-row:last-child {
  border-bottom: 0;
}

.upcoming-offshore-row > div:first-child strong {
  display: block;
  color: #10394f;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.35;
}

.upcoming-offshore-row > div:first-child span {
  display: block;
  margin-top: 2px;
  color: #5d7f94;
  font-size: 12px;
  line-height: 1.35;
}

.upcoming-offshore-row .upcoming-offshore-contact {
  color: #2f6f8d;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.upcoming-offshore-row b {
  justify-self: end;
  min-width: 42px;
  color: #0f766e;
  font-size: 20px;
  line-height: 1;
  text-align: right;
}

.upcoming-offshore-row b small {
  margin-left: 2px;
  color: #7390a3;
  font-size: 11px;
  font-weight: 700;
}

.upcoming-offshore-empty {
  min-height: 160px !important;
  margin: 0 14px;
  border: 1px dashed #d4e3ee !important;
  border-radius: 8px !important;
  background: #fbfdff !important;
  box-shadow: none !important;
}

@media (max-width: 1280px) {
  .upcoming-offshore-grid {
    grid-template-columns: 1fr !important;
  }

  .upcoming-offshore-day {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .upcoming-offshore-panel > .section-title {
    padding: 14px;
  }

  .upcoming-offshore-grid {
    padding: 12px;
    gap: 12px !important;
  }

  .upcoming-offshore-section-head {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 8px 12px;
  }

  .upcoming-offshore-section-head span {
    display: none;
  }

  .upcoming-offshore-row {
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    padding: 10px 12px;
  }

  .upcoming-offshore-row .upcoming-offshore-contact {
    grid-column: 1 / -1;
  }
}

/* Topbar mode switch placeholder for future alternate UI shell. */
.mode-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 11px 0 12px;
  border: 1px solid #cfe0ef;
  border-radius: 999px;
  background: #f7fbff;
  color: #315d7b;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
  transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.06s ease;
}

.mode-switch-btn::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.mode-switch-btn span {
  color: #5f7890;
  font-size: 12px;
  font-weight: 700;
}

.mode-switch-btn strong {
  color: #123b57;
  font-size: 13px;
  font-weight: 850;
}

.mode-switch-btn:hover {
  border-color: #9fc1dc;
  background: #eef7ff;
  box-shadow: 0 4px 10px rgba(15, 47, 72, 0.08);
}

.mode-switch-btn:active {
  transform: translateY(1px);
}

@media (max-width: 900px) {
  .mode-switch-btn span {
    display: none;
  }
}

@media (max-width: 720px) {
  .mode-switch-btn {
    order: -1;
    width: 100%;
    justify-content: center;
  }
}

/* Online personnel sheet opened from well names and three-day offshore board. */
.link-strong,
.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f4f83;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.link-strong {
  display: inline;
  font-weight: 850;
  line-height: 1.35;
}

.text-link {
  color: #155e85;
  font-size: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(21, 94, 133, 0.24);
  text-underline-offset: 3px;
}

.link-strong:hover,
.text-link:hover {
  color: #0f766e;
  text-decoration-color: rgba(15, 118, 110, 0.42);
}

.sheet-modal {
  width: min(96vw, 1680px);
  max-height: 92vh;
}

.sheet-modal .modal-body {
  padding-top: 12px;
}

.sheet-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: #52697d;
  font-size: 13px;
}

.sheet-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #dbe8f2;
  border-radius: 999px;
  background: #f8fbfd;
}

.online-sheet-wrap {
  overflow: auto;
  max-height: 58vh;
  border: 1px solid #cad9e6;
  border-radius: 8px;
  background: #fff;
}

.online-sheet {
  min-width: 2100px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.online-sheet th,
.online-sheet td {
  padding: 0;
  min-width: 72px;
  height: 34px;
  border-right: 1px solid #e0e8f0;
  border-bottom: 1px solid #e0e8f0;
  background: #fff;
  vertical-align: middle;
}

.online-sheet thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 8px 7px;
  background: #e7f2fc;
  color: #164c72;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.online-sheet .sheet-title-row th {
  top: 0;
  height: 38px;
  background: #fff4b8;
  color: #17384f;
  font-size: 15px;
}

.online-sheet thead tr:nth-child(2) th {
  top: 38px;
}

.online-sheet .row-no {
  min-width: 42px;
  background: #f4f8fb;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.online-sheet .plan-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
}

.online-sheet .plan-input:focus {
  outline: 2px solid #38bdf8;
  outline-offset: -2px;
  background: #f0f9ff;
}

.online-sheet .formula-input,
.online-sheet .plan-input:disabled {
  color: #52697d;
  background: #f8fafc;
}

.sheet-empty-cell {
  display: block;
  width: 100%;
  height: 34px;
  background: #fcfdff;
}

.sheet-extra-section {
  margin-top: 16px;
}

.upcoming-offshore-well-links {
  display: flex !important;
  flex-wrap: wrap;
  gap: 2px 6px;
}

@media (max-width: 720px) {
  .sheet-modal {
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .online-sheet-wrap {
    max-height: 62vh;
  }
}

/* Online personnel sheet refinement: richer controls, calmer reading. */
.sheet-modal .modal-head {
  align-items: flex-start;
  gap: 16px;
}

.sheet-modal .modal-head .actions {
  justify-content: flex-end;
  max-width: 760px;
}

.sheet-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.sheet-kpis > div {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #dbe8f2;
  border-radius: 8px;
  background: #ffffff;
}

.sheet-kpis strong {
  color: #123b57;
  font-size: 18px;
  line-height: 1.15;
}

.sheet-kpis span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.online-sheet .sheet-onboard-title {
  background: #fff1a8 !important;
  color: #17384f;
}

.online-sheet .sheet-offboard-title {
  background: #dff4e8 !important;
  color: #173f34;
}

.online-sheet .sheet-divider {
  border-left: 2px solid #8fb8d4 !important;
}

.online-sheet tbody tr:hover td {
  background: #f8fcff;
}

.online-sheet tbody tr:hover td:nth-child(n+16) {
  background: #fbfffc;
}

.online-sheet .row-no {
  position: relative;
  padding: 0 5px;
}

.online-sheet .row-no span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
}

.sheet-row-delete {
  position: absolute;
  right: 3px;
  top: 50%;
  width: 20px;
  height: 20px;
  border: 1px solid #fecaca;
  border-radius: 50%;
  background: #fff5f5;
  color: #b91c1c;
  cursor: pointer;
  font-size: 14px;
  line-height: 16px;
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 0.12s ease, background-color 0.12s ease;
}

.online-sheet tr:hover .sheet-row-delete,
.sheet-row-delete:focus {
  opacity: 1;
}

.sheet-row-delete:hover {
  background: #fee2e2;
}

.sheet-modal .sheet-extra-section .section-title {
  align-items: center;
  padding: 0 2px;
}

.sheet-modal .sheet-extra-section h2 {
  font-size: 16px;
}

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

@media (max-width: 720px) {
  .sheet-modal .modal-head .actions {
    max-width: none;
    width: 100%;
  }

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

/* Standalone personnel plan quality page. */
.quality-page {
  display: grid;
  gap: 14px;
}

.quality-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 0;
  background: #ffffff;
}

.quality-page-head h2 {
  margin: 0 0 6px;
  color: #102a43;
  font-size: 20px;
}

.quality-page-head p {
  max-width: 780px;
  margin: 0;
  color: #5b7186;
  font-size: 13px;
  line-height: 1.65;
}

.quality-panel-standalone {
  margin-bottom: 0;
}

.quality-panel-standalone .quality-list {
  max-height: none;
}

.quality-panel-standalone .quality-item-main strong {
  font-size: 14px;
}

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

  .quality-page-head .actions {
    justify-content: flex-start;
  }
}

/* Future three-day offshore board: clearer two-column header and up/down counts. */
.upcoming-offshore-section-head {
  grid-template-columns: minmax(160px, 1.05fr) minmax(180px, 1.35fr) !important;
  min-height: 36px;
  padding: 0 16px;
}

.upcoming-offshore-section-head strong {
  font-size: 14px;
  letter-spacing: 0;
}

.upcoming-offshore-section-head span {
  color: #4f7892;
  font-size: 13px;
  font-weight: 800;
}

.upcoming-offshore-row {
  grid-template-columns: minmax(150px, 1.05fr) minmax(190px, 1.35fr) auto !important;
  min-height: 54px;
  padding: 9px 16px;
  column-gap: 14px;
}

.upcoming-offshore-row > div:first-child strong {
  font-size: 15px;
  font-weight: 850;
}

.upcoming-offshore-row > div:first-child span,
.upcoming-offshore-well-links .text-link {
  font-size: 12px;
  line-height: 1.35;
}

.upcoming-offshore-row .upcoming-offshore-contact {
  color: #2d6986;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.45;
}

.upcoming-offshore-counts {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.upcoming-offshore-counts span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.upcoming-offshore-counts .on {
  background: #dcfce7;
  color: #166534;
}

.upcoming-offshore-counts .off {
  background: #e0f2fe;
  color: #075985;
}

.upcoming-offshore-counts .transfer {
  background: #fef3c7;
  color: #92400e;
}

@media (max-width: 720px) {
  .upcoming-offshore-section-head {
    grid-template-columns: 1fr !important;
  }

  .upcoming-offshore-row {
    grid-template-columns: 1fr !important;
  }

  .upcoming-offshore-counts {
    justify-content: flex-start;
  }
}
