/* ALS Express portal styles */
.portal-body {
  margin: 0;
  background: #f5f7fa;
  color: #0f172a;
  font-family: "DM Sans", system-ui, sans-serif;
}

.portal-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.portal-sidebar {
  background: #0a1628;
  color: #fff;
  padding: 1.25rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-brand img {
  display: block;
  width: 130px;
  height: auto;
  border-radius: 4px;
}

.portal-role {
  margin: 0;
  font-size: 0.8rem;
  color: #f59e0b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.portal-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.portal-nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.portal-nav a:hover,
.portal-nav a.active {
  background: rgba(245, 158, 11, 0.18);
  color: #fff;
}

.portal-user {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

.portal-user strong {
  display: block;
}

.portal-user span {
  color: rgba(255, 255, 255, 0.65);
}

.portal-main {
  min-width: 0;
}

.portal-top {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 1.5rem;
}

.portal-top h1 {
  margin: 0;
  font-size: 1.35rem;
  color: #0a1628;
}

.portal-content {
  padding: 1.25rem 1.5rem 2.5rem;
}

.portal-flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.portal-flash-success {
  background: #ecfdf5;
  color: #065f46;
}

.portal-flash-error {
  background: #fef2f2;
  color: #991b1b;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card-accepted {
  border-color: #86efac;
  background: #f0fdf4;
}

.stat-card-accepted strong {
  color: #15803d;
}

.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

.stat-card span {
  display: block;
  color: #64748b;
  font-size: 0.85rem;
}

.stat-card strong {
  font-size: 1.5rem;
  color: #0a1628;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.btn-ghost-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  color: #0a1628;
  text-decoration: none;
  background: #fff;
  font-weight: 600;
}

.btn-sm {
  padding: 0.35rem 0.7rem !important;
  font-size: 0.85rem !important;
}

.portal-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.1rem 1.2rem 1.35rem;
}

.portal-panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.panel-head h2 {
  margin: 0;
}

.muted {
  color: #64748b;
}

.table-wrap {
  overflow-x: auto;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.portal-table th,
.portal-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #eef2f7;
  vertical-align: top;
}

.portal-table th {
  color: #64748b;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.78rem;
  text-transform: capitalize;
}

.portal-form label {
  display: block;
  margin-bottom: 0.85rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.portal-form input,
.portal-form select,
.portal-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.inline-form {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.inline-form label {
  flex: 1;
  min-width: 220px;
  margin: 0;
}

.inline-admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 160px;
}

.track-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f8fafc;
}

/* Auth */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 40%),
    linear-gradient(160deg, #0a1628, #13263f 55%, #0a1628);
  padding: 1.5rem;
}

.auth-card {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem 1.4rem 1.6rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.auth-logo {
  display: block;
  width: 120px;
  height: auto;
  margin-bottom: 0.75rem;
  border-radius: 4px;
}

.auth-card h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #0a1628;
}

.auth-sub {
  margin: 0.25rem 0 1rem;
  color: #64748b;
}

.auth-form label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.auth-form input {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font: inherit;
}

.auth-form .btn {
  width: 100%;
  margin-top: 0.4rem;
}

.auth-links {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  text-align: center;
}

.auth-demo {
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #475569;
  display: grid;
  gap: 0.2rem;
}

/* Quotation sheet */
.quote-sheet {
  background: #fff;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
  color: #0f172a;
}

.qs-header {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.qs-header img {
  border-radius: 4px;
}

.qs-company {
  text-align: right;
  max-width: 58%;
}

.qs-company h2 {
  margin: 0;
  color: #ea580c;
  font-size: 1.25rem;
}

.qs-company p {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: #334155;
  line-height: 1.45;
}

.qs-title {
  background: #ea580c;
  color: #fff;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.55rem;
  margin: 0.75rem 0 1rem;
}

.qs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.qs-box {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
}

.qs-box h3 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #0a1628;
}

.qs-box p,
.qs-box li {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

.qs-box ul {
  margin: 0;
  padding-left: 1.1rem;
}

.qs-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.qs-table th {
  background: #0a1628;
  color: #fff;
  padding: 0.55rem;
  text-align: left;
}

.qs-table td {
  border: 1px solid #dbe3ef;
  padding: 0.5rem;
}

.qs-table tbody tr:nth-child(even) {
  background: #eff6ff;
}

.qs-table tfoot td {
  font-weight: 600;
  background: #f1f5f9;
}

.qs-table .qs-net td {
  background: #ea580c;
  color: #fff;
}

.qs-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 2rem;
  border-top: 1px dashed #cbd5e1;
  font-size: 0.9rem;
}

.qs-thanks {
  text-align: center;
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
  color: #334155;
}

.qs-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem 0.4rem;
  margin-bottom: 1rem;
}

.qs-fieldset legend {
  padding: 0 0.35rem;
  font-weight: 700;
  color: #0a1628;
}

.amount-rows label {
  margin-bottom: 0.65rem;
}

.totals-live {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem;
  background: #0a1628;
  color: #fff;
  border-radius: 8px;
  margin: 0.5rem 0 1rem;
}

.totals-live .net {
  color: #fbbf24;
  font-weight: 700;
}

.quote-editor .qs-title {
  margin-top: 0.25rem;
}

.quote-title-pick {
  margin-top: 0.5rem;
}

.quote-title-pick select {
  font-weight: 600;
}

.quote-editor [hidden] {
  display: none !important;
}

.btn-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.3rem;
  border: 0;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn-send:hover {
  background: #15803d;
}

.quote-accept-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid #86efac;
  border-radius: 12px;
  background: #f0fdf4;
}

.quote-accept-bar p {
  margin: 0;
}

.public-quote {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

@media (max-width: 900px) {
  .portal-shell {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .stat-grid,
  .form-grid-2,
  .qs-grid,
  .qs-sign,
  .qs-header {
    grid-template-columns: 1fr;
  }

  .qs-company {
    text-align: left;
    max-width: none;
  }
}
