:root {
  --red-700: #9f1f2d;
  --red-600: #bb2b3b;
  --red-100: #fde7e9;
  --red-050: #fff4f5;
  --ink: #26242a;
  --muted: #6f6670;
  --line: #ead7da;
  --surface: #ffffff;
  --page: #fff8f8;
  --shadow: 0 18px 45px rgba(159, 31, 45, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(253, 231, 233, 0.88), rgba(255, 248, 248, 0.92)),
    repeating-linear-gradient(90deg, rgba(187, 43, 59, 0.055) 0 1px, transparent 1px 64px);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--red-600);
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:hover {
  background: var(--red-700);
  box-shadow: 0 10px 22px rgba(159, 31, 45, 0.18);
  transform: translateY(-1px);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #ffffff;
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red-600);
  box-shadow: 0 0 0 3px rgba(187, 43, 59, 0.12);
}

textarea {
  min-height: 66px;
  resize: vertical;
  padding-top: 10px;
}

.is-hidden {
  display: none !important;
}

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

.login-panel {
  width: min(440px, 100%);
  border: 1px solid rgba(234, 215, 218, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 34px;
}

.brand-logo {
  width: min(280px, 100%);
  height: auto;
  display: block;
  margin-bottom: 28px;
}

.login-copy {
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red-700);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--ink);
  line-height: 1.1;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 28px;
}

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

.login-form button {
  min-height: 46px;
  margin-top: 4px;
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: var(--red-700);
  font-size: 13px;
  font-weight: 700;
}

.login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.corporate-login {
  background: #2f3841;
}

.corporate-login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 440px);
  align-items: center;
  gap: clamp(32px, 8vw, 120px);
  width: min(1320px, calc(100% - 56px));
  margin: 0 auto;
  color: #ffffff;
}

.corporate-login-hero {
  display: grid;
  gap: 22px;
}

.corporate-login-logo {
  width: min(310px, 100%);
}

.corporate-login-tag {
  margin: 0;
  color: #e30613;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 4px;
}

.corporate-login-hero h1 {
  color: #ffffff;
  font-size: clamp(44px, 5vw, 72px);
  line-height: 1.05;
}

.corporate-login-hero h1 span {
  color: #e30613;
}

.corporate-login-hero p {
  max-width: 520px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  line-height: 1.55;
}

.corporate-login-card {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
  padding: 28px;
}

.corporate-login-card h2 {
  color: #ffffff;
  font-size: 22px;
}

.corporate-login-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.55;
}

.corporate-login-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: #e30613;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 800;
}

.login-alert {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(227, 6, 19, 0.5);
  border-radius: 8px;
  background: rgba(227, 6, 19, 0.13);
  color: #ffffff;
  padding: 14px;
}

.login-alert span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.45;
}

.login-alert-success {
  border-color: rgba(47, 184, 118, 0.45);
  background: rgba(47, 184, 118, 0.12);
}

.mfa-form {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.mfa-form label {
  color: rgba(255, 255, 255, 0.78);
}

.mfa-form input {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

@media (max-width: 860px) {
  .corporate-login-screen {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 32px 0;
  }

  .corporate-login-card {
    width: 100%;
  }
}

.sidebar {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  padding: 28px 20px;
}

.sidebar-logo {
  width: 190px;
  height: auto;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab-button,
.logout-button {
  min-height: 42px;
  color: var(--red-700);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  padding: 0 14px;
}

.tab-button:hover,
.logout-button:hover,
.tab-button.is-active {
  color: #ffffff;
  background: var(--red-600);
  border-color: var(--red-600);
}

.logout-button {
  margin-top: auto;
}

.workspace {
  padding: 30px;
  overflow: hidden;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.header-metric {
  min-width: 176px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 14px 18px;
  text-align: right;
}

.header-metric span {
  display: block;
  color: var(--red-700);
  font-size: 28px;
  font-weight: 900;
}

.header-metric small {
  color: var(--muted);
  font-weight: 700;
}

.shipment-form {
  display: grid;
  grid-template-columns: repeat(7, minmax(130px, 1fr));
  align-items: end;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 18px;
  margin-bottom: 18px;
}

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

.freight-hint {
  grid-column: 1 / 6;
  min-height: 18px;
  margin: 0;
  color: var(--red-700);
  font-size: 13px;
  font-weight: 700;
}

.shipment-actions {
  display: flex;
  grid-column: 6 / -1;
  justify-content: flex-end;
  gap: 8px;
}

.shipment-form button,
.quote-toolbar button {
  min-height: 42px;
  padding: 0 16px;
}

.shipment-actions button {
  min-width: 116px;
}

.shipment-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr)) repeat(2, auto);
  align-items: end;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 14px;
  margin-bottom: 14px;
}

.shipment-filters button {
  min-height: 42px;
  min-width: 132px;
  padding: 0 14px;
}

.dashboard-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(160px, 0.7fr) auto;
  align-items: end;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 18px;
  margin-bottom: 14px;
}

.dashboard-filters button {
  min-height: 42px;
  min-width: 116px;
  padding: 0 16px;
}

.dashboard-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #fff4f5);
  color: var(--muted);
  box-shadow: 0 12px 30px rgba(159, 31, 45, 0.08);
  padding: 16px 18px;
  margin-bottom: 14px;
  font-weight: 800;
}

.dashboard-summary strong {
  color: var(--red-700);
}

.dashboard-summary span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}

.ranking-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--red-600);
  font-weight: 900;
}

.secondary-button {
  color: var(--red-700);
  background: var(--red-100);
}

.secondary-button:hover {
  color: #ffffff;
  background: var(--red-700);
}

.status-legend {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.status-open {
  color: #745300;
  background: #ffe08a;
}

.status-appointed {
  color: #7a3b00;
  background: #ffc985;
}

.status-closed {
  color: #155c36;
  background: #aee7c5;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(159, 31, 45, 0.08);
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--red-700);
  background: var(--red-050);
  font-size: 12px;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fffafa;
}

.empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.quote-toolbar {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}

.quote-toolbar label {
  width: min(220px, 100%);
}

.quote-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 18px;
  margin-bottom: 18px;
}

.user-form,
.catalog-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  align-items: end;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 18px;
  margin-bottom: 18px;
}

.catalog-form {
  grid-template-columns: minmax(220px, 0.8fr) minmax(260px, 1.4fr) auto;
}

.catalog-form button {
  min-height: 42px;
  min-width: 116px;
  padding: 0 16px;
}

.catalog-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.catalog-agent-email-field {
  grid-column: span 2;
}

#catalogAgentEmailsInput {
  min-height: 42px;
  height: 42px;
  max-height: 92px;
  resize: vertical;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.catalog-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(159, 31, 45, 0.08);
  overflow: hidden;
}

.catalog-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--red-050);
  padding: 12px 14px;
}

.catalog-card h3 {
  margin: 0;
  color: var(--red-700);
  font-size: 14px;
  text-transform: uppercase;
}

.catalog-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 26px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--red-600);
  font-size: 12px;
  font-weight: 900;
}

.catalog-card ul {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: 14px;
}

.catalog-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.catalog-card li span {
  min-width: 0;
  color: var(--ink);
  background: transparent;
  justify-content: flex-start;
  font-size: 13px;
  text-align: left;
}

.catalog-card li > span {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.catalog-details {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.catalog-details span {
  min-height: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.catalog-row-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
}

.catalog-edit-button,
.catalog-delete-button {
  min-height: 30px;
  flex: 0 0 auto;
  padding: 0 9px;
  font-size: 11px;
}

.catalog-edit-button {
  background: #bf5965;
}

.catalog-edit-button:hover {
  background: #9f1f2d;
}

.catalog-delete-button {
  background: #8b1d2a;
}

.catalog-delete-button:hover {
  background: #68131d;
}

.catalog-card p {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  font-weight: 700;
}

.user-agent-field {
  grid-column: span 2;
}

.user-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.user-actions button {
  min-height: 42px;
  min-width: 116px;
  padding: 0 16px;
}

.quote-header {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.quote-data-wrap {
  margin-bottom: 14px;
}

.attachment-panel {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fffafa;
  padding: 14px;
  margin-bottom: 14px;
}

.shipment-attachment-panel {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  grid-column: 1 / -1;
  align-items: start;
  gap: 14px;
  margin-bottom: 0;
}

.shipment-attachment-panel .attachment-list {
  margin-top: 0;
}

.attachment-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}

.attachment-item small {
  color: var(--muted);
  font-weight: 700;
}

.attachment-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.attachment-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.quote-attachments-view {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.quote-attachments-view h3 {
  color: var(--red-700);
  font-size: 13px;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.attachment-download {
  margin: 0 8px 8px 0;
  min-height: 34px;
  padding: 0 10px;
  background: #54505a;
  font-size: 12px;
}

.attachment-download:hover {
  background: #3d3942;
}

.quote-form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.quote-form-actions div {
  display: flex;
  gap: 8px;
}

.spreadsheet-wrap {
  max-height: calc(100vh - 178px);
}

.spreadsheet-table {
  min-width: 1360px;
}

.spreadsheet-table td {
  padding: 6px;
}

.spreadsheet-table input,
.spreadsheet-table select {
  min-height: 38px;
  border-radius: 6px;
}

.remove-row {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  color: var(--red-700);
  background: var(--red-100);
}

.remove-row:hover {
  color: #ffffff;
  background: var(--red-700);
}

.row-actions {
  display: flex;
  gap: 8px;
  min-width: 148px;
}

.quote-row-actions {
  min-width: 286px;
}

.quote-status-valid {
  color: #155c36;
  background: #bfe8c9;
}

.quote-status-invalid {
  color: #8b1d2a;
  background: #ffd6dc;
}

.row-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.edit-button {
  color: var(--red-700);
  background: var(--red-100);
}

.edit-button:hover {
  color: #ffffff;
  background: var(--red-600);
}

.delete-button {
  background: #8b1d2a;
}

.delete-button:hover {
  background: #68131d;
}

.print-button {
  background: #54505a;
}

.print-button:hover {
  background: #3d3942;
}

.quote-details-row td {
  background: #fffafa;
  padding: 12px;
}

.quote-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: auto;
}

.quote-details table {
  min-width: 1040px;
}

.expense-summary-input {
  cursor: pointer;
  background: #fffafa;
  font-weight: 800;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(38, 36, 42, 0.42);
  padding: 24px;
}

.expense-modal {
  width: min(760px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.nomination-email-modal {
  width: min(820px, 100%);
}

.nomination-email-content {
  display: grid;
  gap: 14px;
  padding: 18px;
  overflow: auto;
}

.nomination-email-content textarea {
  min-height: 180px;
}

.nomination-email-hint {
  margin: 0;
  color: var(--red-700);
  font-size: 13px;
  font-weight: 800;
}

.expense-modal-header,
.expense-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  background: var(--red-050);
}

.expense-table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.expense-table-wrap table {
  min-width: 620px;
}

.expense-total {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.expense-total strong {
  color: var(--red-700);
  font-size: 20px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .tabs {
    grid-template-columns: repeat(5, minmax(96px, 1fr));
    flex: 1;
  }

  .logout-button {
    margin-top: 0;
  }

  .shipment-form,
  .shipment-filters,
  .dashboard-filters {
    grid-template-columns: 1fr 1fr;
  }

  .user-form,
  .catalog-form {
    grid-template-columns: 1fr 1fr;
  }

  .quote-header {
    grid-template-columns: 1fr;
  }

  .quote-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .quote-form-actions div {
    justify-content: flex-end;
  }

  .shipment-attachment-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 20px;
  }

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

  .header-metric {
    width: 100%;
    text-align: left;
  }

  .shipment-form,
  .shipment-filters,
  .dashboard-filters {
    grid-template-columns: 1fr;
  }

  .user-form,
  .catalog-form {
    grid-template-columns: 1fr;
  }

  .user-agent-field {
    grid-column: auto;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 24px;
  }
}
