:root {
  color-scheme: light;
  --ink: #122033;
  --muted: #617086;
  --line: #dfe5ec;
  --panel: #ffffff;
  --page: #f3f6f9;
  --navy: #102b4e;
  --blue: #1265d6;
  --cyan: #23b7c8;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--page);
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, #1e72dc 0, transparent 35%),
    linear-gradient(135deg, #07192f, #123e70);
}

.login-card {
  width: min(430px, 100%);
  padding: 38px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.brand-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.login-card h1 {
  margin: 22px 0 6px;
}

.login-card p {
  margin: 0 0 26px;
  color: var(--muted);
}

label {
  display: grid;
  gap: 7px;
  margin: 16px 0;
  font-weight: 650;
}

input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 101, 214, .13);
}

button {
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  color: #fff;
  font-weight: 750;
  cursor: pointer;
  background: var(--blue);
}

.login-card button {
  width: 100%;
  margin-top: 10px;
}

.error {
  min-height: 22px;
  margin-top: 14px;
  color: var(--danger);
}

.topbar {
  min-height: 84px;
  padding: 18px clamp(22px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: var(--navy);
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 1.45rem;
}

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

.secondary {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  background: transparent;
}

.eyebrow {
  color: var(--cyan);
  font-size: .75rem;
  font-weight: 850;
  letter-spacing: .11em;
}

main {
  width: min(1300px, calc(100% - 40px));
  margin: 34px auto;
}

.summary,
.panel {
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.summary h2,
.panel h3 {
  margin: 6px 0;
}

.summary p,
.panel p {
  margin: 0;
  color: var(--muted);
}

.status-pill {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 999px;
  color: #08754f;
  font-weight: 750;
  background: #e6f7f0;
}

.kpi-grid {
  margin: 22px 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.kpi-grid article {
  min-height: 126px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.kpi-grid span {
  color: var(--muted);
  font-weight: 650;
}

.kpi-grid strong {
  font-size: 2rem;
  color: var(--navy);
}

@media (max-width: 900px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: flex-start;
    gap: 14px;
    flex-direction: column;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  main {
    width: min(100% - 24px, 1300px);
  }
}

.import-section {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.section-heading h3 {
  margin: 6px 0;
}

.section-heading p,
.import-card p {
  color: var(--muted);
}

.import-grid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.import-card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}

.import-card h4 {
  margin: 0 0 8px;
  font-size: 1.08rem;
}

.import-card p {
  min-height: 44px;
  margin: 0 0 18px;
}

.import-card input[type="file"] {
  margin-bottom: 14px;
  background: #fff;
}

.import-card button {
  width: 100%;
}

.import-card button:disabled {
  cursor: wait;
  opacity: .65;
}

.step {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  background: var(--navy);
}

.import-message {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  color: #08754f;
  font-weight: 700;
  background: #e6f7f0;
}

.import-message.error {
  color: var(--danger);
  background: #feeceb;
}

.import-history {
  margin-top: 28px;
}

.import-history h4 {
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 13px 15px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: #f8fafc;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-status {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 750;
  background: #e6f7f0;
  color: #08754f;
}

.table-status.completed_with_exceptions {
  color: #8a4b08;
  background: #fff3d6;
}

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

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

.import-message.warning {
  color: #8a4b08;
  background: #fff3d6;
}

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