:root {
  --bg: #f5f1e8;
  --panel: #fff9ef;
  --text: #1c1917;
  --muted: #57534e;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --line: #d6d3d1;
  --danger: #b91c1c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, #e2e8f0 0%, transparent 38%),
    radial-gradient(circle at 90% 18%, #d1fae5 0%, transparent 30%),
    var(--bg);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 18px 44px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 44px);
  letter-spacing: 0.4px;
}

.hero p {
  margin: 10px 0 0;
  color: var(--muted);
}

.menu-tabs {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-tab {
  background: #fff;
  cursor: pointer;
}

.menu-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.menu-panel {
  margin-top: 16px;
}

.hidden {
  display: none;
}

.toolbar {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

select,
button {
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  padding: 0 12px;
  font-size: 14px;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

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

.status {
  color: var(--muted);
  min-height: 20px;
}

.summary {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.vessel-list {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 14px;
  background: linear-gradient(180deg, #fffbf2 0%, #fff 100%);
}

.toggle {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.vessel-title {
  margin: 0;
  font-size: 18px;
}

.vessel-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.class-lines {
  margin-top: 8px;
  display: grid;
  gap: 4px;
}

.class-line {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.file-link {
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px 7px;
  text-decoration: none;
  color: #0f4c81;
  background: #fff;
  font-size: 12px;
}

.file-link:hover {
  background: #f0f7ff;
}

.coc-count {
  color: var(--danger);
  font-weight: 700;
}

.card-body {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.history-scroll {
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  margin-right: 6px;
}

.config-grid {
  margin-top: 14px;
  display: grid;
  gap: 14px;
}

.config-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.config-card h3 {
  margin: 0 0 12px;
  text-transform: capitalize;
}

.config-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  background: #fffcf6;
}

.config-title {
  font-weight: 700;
}

.config-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.config-input {
  width: 100%;
  margin-top: 8px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
}

.config-actions {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.config-save {
  background: #fff;
  cursor: pointer;
}

.mgr-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.mgr-title {
  margin: 0;
  font-size: 14px;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.mgr-body {
  padding: 8px 10px;
}

.attach-block {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
}

.attach-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

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

.attach-actions {
  white-space: nowrap;
}

.soc-title {
  font-weight: 700;
  margin: 6px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  font-size: 13px;
}

th,
td {
  border: 1px solid var(--line);
  padding: 6px;
  vertical-align: top;
}

th {
  background: #f1f5f9;
  text-align: left;
}

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

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

  .card-head > :last-child {
    grid-column: 1 / -1;
  }

  .history-scroll {
    max-height: 340px;
  }
}