:root {
  --brand-navy: #06243a;
  --brand-ink: #071f33;
  --brand-lime: #a8e020;
  --brand-red: #ff1f25;
  --surface: #ffffff;
  --line: #dfe6ec;
  --muted: #6b7785;
}

body {
  background: #f3f6f8;
  color: #16202a;
  font-size: 0.95rem;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(6, 36, 58, .86), rgba(7, 31, 51, .54)),
    url("../img/brand-bg.jpg") center / cover;
}

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

.login-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(6, 36, 58, .28);
  padding: 1.5rem;
}

.login-card img {
  width: 190px;
  display: block;
  margin-bottom: 1.25rem;
}

.login-card h1 {
  color: var(--brand-ink);
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.app-navbar {
  background: var(--brand-navy);
  border-bottom: 4px solid var(--brand-lime);
  box-shadow: 0 8px 24px rgba(6, 36, 58, 0.16);
}

.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.3);
}

.navbar-toggler-icon {
  filter: invert(1);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: #fff;
  font-weight: 700;
}

.brand-lockup:hover {
  color: #fff;
}

.brand-lockup img {
  width: 156px;
  height: 34px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  padding: 3px 8px;
}

.brand-lockup span {
  color: var(--brand-lime);
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
  color: #fff;
}

.app-shell {
  max-width: 1760px;
}

.btn-brand,
.btn-warning {
  background: var(--brand-lime);
  border-color: var(--brand-lime);
  color: #102011;
  font-weight: 700;
}

.btn-brand:hover,
.btn-warning:hover {
  background: #97ca1d;
  border-color: #97ca1d;
  color: #102011;
}

section,
.form-surface,
.filters,
.metric,
.compact-panel,
.info-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(6, 36, 58, 0.04);
}

.app-hero {
  min-height: 178px;
  border-radius: 8px;
  padding: 1.5rem;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(6, 36, 58, 0.96) 0%, rgba(6, 36, 58, 0.84) 48%, rgba(6, 36, 58, 0.22) 100%),
    url("../img/brand-bg.jpg") center / cover;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.app-hero h1 {
  font-size: clamp(1.75rem, 3vw, 2.65rem);
  line-height: 1.05;
  margin: .25rem 0 .5rem;
}

.app-hero p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.84);
  margin: 0;
}

.eyebrow {
  color: var(--brand-lime);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.narrow {
  max-width: 680px;
}

.info-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 68px;
}

.info-strip span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: .875rem;
}

.info-strip strong {
  display: block;
  color: var(--brand-ink);
}

.metric strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.2;
  color: var(--brand-ink);
}

.metric.danger {
  border-left: 5px solid var(--brand-red);
}

.metric.success {
  border-left: 5px solid var(--brand-lime);
}

.badge {
  white-space: normal;
}

.status-created { background: #6c757d; }
.status-packed { background: #0d6efd; }
.status-shipped { background: #0dcaf0; color: #102027; }
.status-received_by_amazon { background: #6610f2; }
.status-refund_pending { background: #ffc107; color: #2b2100; }
.status-refunded { background: #198754; }
.status-partial_refund { background: #20c997; color: #08251c; }
.status-overdue { background: #dc3545; }
.status-cancelled { background: #343a40; }
.status-dispute { background: #fd7e14; color: #261200; }

.table {
  margin-bottom: 0;
}

.table th {
  color: #536171;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  vertical-align: middle;
}

.table td {
  vertical-align: middle;
}

.product-cell {
  max-width: 360px;
  min-width: 220px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.col-lg-6 .product-cell {
  max-width: 300px;
  min-width: 180px;
}

.upload-list {
  display: grid;
  gap: .75rem;
}

.upload-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 0;
  border-bottom: 1px solid #edf1f5;
}

.upload-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.upload-item span {
  display: block;
  color: var(--muted);
  font-size: .85rem;
}

.form-section-title {
  color: var(--brand-ink);
  font-size: .95rem;
  font-weight: 800;
  margin: 0 0 .75rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .75rem;
}

.detail-grid div {
  border-bottom: 1px solid #eceff3;
  padding-bottom: .5rem;
}

.detail-grid span,
.timeline span {
  display: block;
  color: var(--muted);
  font-size: .85rem;
}

.detail-grid strong {
  display: block;
}

.timeline > div {
  border-left: 3px solid #dee2e6;
  padding: 0 0 1rem .75rem;
}

.preline {
  white-space: pre-line;
}

.contact-summary {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  resize: vertical;
  line-height: 1.5;
  background: #fbfcfd;
}

.summary-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 1rem;
  line-height: 1.55;
}

.bank-description {
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.return-summary-list {
  display: grid;
  gap: .75rem;
}

.return-summary-item {
  border: 1px solid #edf1f5;
  border-radius: 8px;
  background: #fbfcfd;
  padding: .85rem;
}

.return-summary-item span,
.return-summary-item small {
  display: block;
  color: var(--muted);
  font-size: .85rem;
}

.return-summary-item strong {
  display: block;
  color: var(--brand-ink);
  margin-top: .35rem;
}

.return-summary-item small {
  overflow-wrap: anywhere;
}

.email-review-list {
  display: grid;
  gap: .75rem;
}

.email-review-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: 1rem;
  align-items: center;
  border-top: 1px solid #edf1f5;
  padding-top: .75rem;
}

.email-review-item strong,
.email-review-item span {
  display: block;
}

.email-review-item strong {
  color: var(--brand-ink);
  overflow-wrap: anywhere;
}

.email-review-item span {
  color: var(--muted);
  font-size: .85rem;
}

.email-review-actions {
  display: flex;
  gap: .5rem;
  justify-content: end;
  align-items: center;
}

.email-review-actions form:first-child {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: .5rem;
  flex: 1;
}

@media (max-width: 768px) {
  .brand-lockup img {
    width: 130px;
  }

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

  .product-cell {
    max-width: 260px;
  }

  .email-review-item,
  .email-review-actions,
  .email-review-actions form:first-child {
    display: grid;
    grid-template-columns: 1fr;
  }
}
