:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #162033;
  --muted: #667085;
  --border: #dbe3ef;
  --primary: #0b6bcb;
  --primary-strong: #074d92;
  --primary-soft: #e8f2ff;
  --success: #087443;
  --success-soft: #e8f8ef;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --warning: #b54708;
  --warning-soft: #fff7e6;
  --shadow: 0 18px 45px rgba(22, 32, 51, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(232, 242, 255, 0.72), rgba(244, 247, 251, 0) 360px),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

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

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

.login-panel {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
  border: 1px solid rgba(219, 227, 239, 0.82);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-brand {
  padding: 44px;
  background: linear-gradient(145deg, #073b75 0%, #0b6bcb 58%, #2a9fd6 100%);
  color: #fff;
}

.login-brand h1,
.page-title h1 {
  margin: 0;
  letter-spacing: 0;
}

.login-brand h1 {
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1;
}

.login-brand p {
  max-width: 460px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
}

.login-card {
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(11, 107, 203, 0.26);
}

.brand-title {
  margin: 0;
  font-size: 17px;
  font-weight: 850;
}

.brand-subtitle,
.muted {
  color: var(--muted);
}

.brand-subtitle {
  margin: 1px 0 0;
  font-size: 13px;
}

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

.nav-link,
.btn,
button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 9px 13px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
}

.nav-link:hover,
.btn:hover,
button:hover {
  border-color: #b8c7db;
  color: var(--text);
  text-decoration: none;
}

.btn-primary,
button[type="submit"] {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover,
button[type="submit"]:hover {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
  color: #fff;
}

.page-title {
  margin: 0 0 22px;
}

.page-title h1 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.08;
}

.page-title p {
  margin: 8px 0 0;
  max-width: 720px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(420px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.card-header,
.card-body {
  padding: 18px;
}

.card-header {
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.card-header p {
  margin: 4px 0 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-full {
  grid-column: 1 / -1;
}

label {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  min-height: 154px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(11, 107, 203, 0.13);
}

.form-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.counter {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.alert {
  margin: 0 0 16px;
  border: 1px solid;
  border-radius: 8px;
  padding: 11px 13px;
  font-weight: 750;
}

.alert-success {
  border-color: #abefc6;
  background: var(--success-soft);
  color: var(--success);
}

.alert-danger {
  border-color: #fecdca;
  background: var(--danger-soft);
  color: var(--danger);
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

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

th,
td {
  border-bottom: 1px solid #e8eef7;
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: #475467;
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fbfdff;
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: #344054;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-delivered {
  border-color: #abefc6;
  background: var(--success-soft);
  color: var(--success);
}

.status-failed {
  border-color: #fecdca;
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pending,
.status-expired {
  border-color: #fedf89;
  background: var(--warning-soft);
  color: var(--warning);
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 11px;
  background: var(--surface);
}

.check-field input {
  width: auto;
}

.search-input {
  width: min(360px, 100%);
}

.code-panel {
  margin: 0;
  max-height: 520px;
  overflow: auto;
  border-radius: 8px;
  background: #101828;
  color: #d0d5dd;
  padding: 16px;
  font-size: 13px;
}

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

.message-cell {
  min-width: 260px;
  color: #344054;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .app-header,
  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-actions,
  .nav-link,
  .btn,
  button {
    width: 100%;
  }

  .grid,
  .login-panel,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .login-brand,
  .login-card {
    padding: 28px;
  }
}
