:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1f2937;
  --muted: #667085;
  --line: #d0d5dd;
  --accent: #1f4e78;
  --accent-2: #e8eef5;
  --good: #137333;
  --bad: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, sans-serif;
}

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

.login-card {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .08);
}

.login-card h1 {
  font-size: 28px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 48px;
}

.eye-button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  min-height: 34px;
  width: 38px;
  padding: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  justify-content: center;
}

.eye-button:hover,
.eye-button.is-active {
  background: var(--accent-2);
  color: var(--accent);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 18px;
}

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

.tab-button {
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-bottom: 0;
}

.tab-button.is-active {
  background: var(--panel);
  color: var(--accent);
  border-color: var(--line);
}

h1, h2 { margin: 0; }
h1 { font-size: 32px; }
h2 { font-size: 20px; }
p { color: var(--muted); line-height: 1.45; }

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

.primary-panel {
  border-color: #9db7d0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

button, .button-link {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.button-link.secondary {
  background: #475467;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.grid-form, .upload-grid, .order-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

details {
  margin-top: 18px;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

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

.status-card strong {
  display: block;
  margin-bottom: 6px;
}

.ok { color: var(--good); font-weight: 700; }
.bad { color: var(--bad); font-weight: 700; }

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th, td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--accent-2);
}

td:nth-child(2),
td:nth-child(3),
td:nth-child(4),
td:nth-child(5) {
  text-align: center;
}

.doc-link {
  color: var(--accent);
  font-weight: 700;
}

.note {
  background: #fffdf5;
}

.hidden { display: none !important; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

@media (max-width: 720px) {
  .topbar, .section-head {
    display: grid;
  }

  h1 { font-size: 26px; }
}
