:root {
  --bg: #f7fafc;
  --panel: #ffffff;
  --ink: #172033;
  --soft: #687089;
  --line: #d4dcea;
  --brand: #0d6e5f;
  --warn: #b24327;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 10%, #edf7f5 0%, #f7fafc 48%);
  color: var(--ink);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
}

.login-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.login-logo {
  width: 120px;
  height: auto;
  object-fit: contain;
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.nav-meta a {
  color: var(--brand);
  text-decoration: none;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px;
}

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

.panel.narrow {
  max-width: 420px;
  margin: 40px auto;
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(300px, 480px) 1fr;
  gap: 14px;
}

.form-stack {
  display: grid;
  gap: 12px;
}

.row {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}

input,
button,
select {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"] {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

button,
.btn {
  background: #0d6e5f;
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 9px 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

button.danger {
  background: #a03820;
}

.btn-link {
  background: transparent;
  color: var(--brand);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.inline {
  display: inline;
}

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

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 8px 6px;
  vertical-align: top;
}

.table a {
  margin-right: 7px;
}

.page-result-block {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.page-result-block:first-of-type {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.page-result-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.page-result-actions {
  margin-bottom: 8px;
}

.result-table-wrap {
  overflow-x: auto;
}

.result-page-table th,
.result-page-table td {
  white-space: nowrap;
}

.status {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f2f6ff;
}

.status-ready-for-review {
  background: #eaf1fb;
  border-color: #b4c7e5;
  color: #32547b;
}

.status-reviewing {
  background: #fff1d8;
  border-color: #e7c58b;
  color: #79531e;
}

.status-finished {
  background: #d5f1dd;
  border-color: #76bc89;
  color: #135c32;
}

.status-failed {
  background: #fde8e8;
}

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

.small {
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

code {
  background: #f3f6fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 5px;
}

.error {
  border: 1px solid #f4b4b4;
  background: #fff0f0;
  color: #7a1f1f;
  border-radius: 10px;
  padding: 10px;
}

.chooser-panel {
  max-width: 980px;
  margin: 40px auto;
  padding: 28px;
}

.chooser-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.chooser-card {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  background: linear-gradient(160deg, #ffffff 0%, #eef6f4 100%);
  color: var(--ink);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 18px 40px rgba(13, 110, 95, 0.08);
}

.chooser-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.chooser-card-title {
  font-size: 28px;
  font-weight: 800;
}

.chooser-card-copy {
  color: var(--soft);
  line-height: 1.5;
}

.press-review-panel .press-section {
  margin-top: 18px;
}

.press-bottom-grid,
.press-search-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

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

.press-bottom-card h4,
.press-search-bottom-card h3 {
  margin: 0;
  padding: 12px 14px;
  background: #edf5f4;
  border-bottom: 1px solid var(--line);
}

.press-bottom-row,
.press-search-bottom-row {
  display: grid;
  grid-template-columns: 130px 1fr 56px;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-top: 1px solid #edf0f6;
}

.press-bottom-row:first-of-type,
.press-search-bottom-row:first-of-type {
  border-top: 0;
}

.press-bottom-input {
  display: grid;
  gap: 6px;
}

.press-bottom-input img {
  max-width: 140px;
}

.press-bottom-label,
.press-bottom-unit {
  font-size: 13px;
}

.press-table th,
.press-table td {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .chooser-grid,
  .press-bottom-grid,
  .press-search-bottom-grid {
    grid-template-columns: 1fr;
  }

  .press-bottom-row,
  .press-search-bottom-row {
    grid-template-columns: 1fr;
  }
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.review-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  margin: 12px 0 8px;
}

.review-left-controls {
  display: grid;
  gap: 10px;
  flex: 0 0 auto;
}

.review-actions,
.review-page-controls,
.review-meta-form {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.review-page-controls {
  align-items: flex-end;
}

.review-page-controls label {
  width: 110px;
}

.review-page-controls select {
  width: 110px;
}

.review-meta-form {
  flex: 0 0 auto;
  margin-left: auto;
}

.review-meta-form label {
  width: 220px;
}

.review-meta-form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .review-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .review-page-controls,
  .review-meta-form {
    flex-wrap: wrap;
  }

  .review-meta-form {
    margin-left: 0;
  }
}

.meta-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.events {
  list-style: none;
  margin: 0;
  padding: 0;
}

.events li {
  border-top: 1px solid var(--line);
  padding: 8px 0;
  display: grid;
  gap: 3px;
}

.ev-time {
  font-size: 12px;
  color: var(--soft);
}

.ev-type {
  font-weight: 700;
}

.hint {
  color: var(--soft);
  font-size: 14px;
}

.review-savebar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 10px;
}

.save-status-ok {
  color: #0d6e5f;
  font-weight: 600;
}

.save-status-warn {
  color: #8a5a00;
  font-weight: 600;
}

.save-status-error {
  color: #a03820;
  font-weight: 600;
}

.review-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  max-height: calc(100vh - 240px);
}

.review-panel {
  width: calc(100vw - 32px);
  margin-left: calc(50% - 50vw + 16px);
  margin-right: 0;
}

.review-table {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
}

.review-table th,
.review-table td {
  border: 1px solid #222;
  padding: 4px;
  text-align: center;
  vertical-align: top;
}

.review-table thead th {
  position: sticky;
  top: 0;
  background: #c6e0b4;
  z-index: 10;
}

.review-table tbody th {
  position: sticky;
  left: 0;
  background: #f2f2f2;
  z-index: 9;
}

.review-cell img {
  display: block;
  max-width: 130px;
  min-width: 96px;
  min-height: 34px;
  max-height: 74px;
  margin: 0 auto 4px;
  background: #fff;
}

.cell-input {
  width: 118px;
  text-align: center;
  padding: 5px;
  border: 1px solid #b6c1d4;
  border-radius: 8px;
}

.cell-input.empty {
  background: #fff2f2;
}

.cell-input.saved {
  outline: 2px solid #0d6e5f;
}

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