/*
 * Supplier Registration Portal
 * All colours hardcoded as hex to prevent theme interference.
 * Brand: #d47e3b (warm amber-orange)
 */

/* ── Reset ── */
.srp-wrap *, .srp-wrap *::before, .srp-wrap *::after,
.srp-modal-overlay *, .srp-modal-overlay *::before, .srp-modal-overlay *::after {
  box-sizing: border-box;
}
.srp-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1a2332;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.srp-wrap a { color: #d47e3b; text-decoration: none; }
.srp-wrap a:hover { text-decoration: underline; color: #a9642f; }

/* ════════════════════════════════
   DASHBOARD WRAPPER
════════════════════════════════ */
.srp-dashboard-wrap { max-width: 1400px; margin: 0 auto; padding-bottom: 60px; }

/* ── Top bar ── */
.srp-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0 18px;
  border-bottom: 2px solid #d47e3b;
  margin-bottom: 20px;
  flex-wrap: wrap; gap: 8px;
}
.srp-topbar__count { font-size: 13px; color: #485468; font-weight: 500; }

.srp-logout-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border: 1.5px solid #c5ccda; border-radius: 5px;
  color: #485468; font-size: 13px; font-weight: 500;
  transition: all .18s ease; text-decoration: none !important;
}
.srp-logout-btn svg { width: 14px; height: 14px; }
.srp-logout-btn:hover { border-color: #d47e3b; color: #d47e3b; background: rgba(212,126,59,.08); text-decoration: none; }

/* ── Shared button system ── */
.srp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 5px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent; font-family: inherit;
  transition: all .18s ease; white-space: nowrap; text-decoration: none !important;
}
.srp-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.srp-btn--primary {
  background: #d47e3b; color: #fff; border-color: #d47e3b;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.srp-btn--primary:hover:not(:disabled) {
  background: #a9642f; border-color: #a9642f;
  transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,.10);
}
.srp-btn--primary:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.srp-btn--ghost {
  background: transparent; color: #d47e3b; border-color: #d47e3b;
}
.srp-btn--ghost:hover { background: rgba(212,126,59,.08); color: #a9642f; border-color: #a9642f; }
.srp-btn--sm { padding: 6px 14px; font-size: 12px; }

/* ── Filter bar ── */
.srp-filter-bar {
  background: #fff;
  border: 1.5px solid #dde2ec;
  border-radius: 10px;
  padding: 18px 22px 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.srp-filter-bar__grid {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr 1.5fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
  align-items: start;
}
.srp-filter-group { display: flex; flex-direction: column; gap: 4px; }
.srp-filter-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: #8696ae;
}
.srp-date-pair { display: flex; gap: 8px; }
.srp-date-pair > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.srp-filter-group .srp-input { height: 38px; padding: 0 10px; font-size: 13px; }

/* Toggle */
.srp-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; user-select: none; }
.srp-toggle input { display: none; }
.srp-toggle__track {
  position: relative; display: inline-block; width: 36px; height: 20px;
  background: #c5ccda; border-radius: 10px;
  transition: background .18s ease; flex-shrink: 0;
}
.srp-toggle__track::after {
  content: ''; position: absolute;
  width: 16px; height: 16px; background: #fff;
  border-radius: 50%; top: 2px; left: 2px;
  transition: transform .18s ease; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.srp-toggle input:checked ~ .srp-toggle__track { background: #d47e3b; }
.srp-toggle input:checked ~ .srp-toggle__track::after { transform: translateX(16px); }
.srp-toggle__label { font-size: 13px; color: #1a2332; }

.srp-filter-actions {
  display: flex; gap: 8px;
  border-top: 1px solid #dde2ec; padding-top: 12px;
}

/* ── Toolbar ── */
.srp-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  background: #fff;
  border: 1.5px solid #dde2ec;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  padding: 10px 14px;
}
.srp-toolbar__left  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srp-toolbar__right { display: flex; align-items: center; gap: 10px; }

.srp-export-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  background: #fff; border: 1.5px solid #d47e3b;
  border-radius: 5px; font-size: 12px; font-weight: 600;
  color: #d47e3b; cursor: pointer; font-family: inherit;
  transition: all .18s ease;
}
.srp-export-btn svg { width: 13px; height: 13px; }
.srp-export-btn:hover { background: #d47e3b; color: #fff; }

.srp-toolbar__divider { width: 1px; height: 20px; background: #c5ccda; margin: 0 2px; }
.srp-toolbar__show { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #8696ae; }
.srp-select-sm {
  height: 30px; padding: 0 8px;
  border: 1.5px solid #c5ccda; border-radius: 5px;
  font-size: 12px; color: #1a2332; background: #fff; cursor: pointer;
}
.srp-selected-count { font-size: 12px; color: #8696ae; }

/* ── Table ── */
.srp-table-wrap {
  background: #fff;
  border: 1.5px solid #dde2ec;
  border-top: none;
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  margin-bottom: 18px;
  overflow-x: auto;
}
.srp-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }

.srp-table thead th {
  background: #f8f4f0;
  color: #485468; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  padding: 11px 12px; text-align: left;
  border-bottom: 2px solid #dde2ec; white-space: nowrap;
}
/* Brand accent on the bottom border of thead */
.srp-table thead tr { border-bottom: 2px solid #d47e3b; }

.srp-table tbody td {
  padding: 11px 12px; border-bottom: 1px solid #dde2ec; vertical-align: middle;
}
.srp-table tbody tr:last-child td { border-bottom: none; }
.srp-table tbody tr:hover td { background: #fdf5ee; }

.srp-th--check, .srp-td--check { width: 40px; text-align: center; vertical-align: middle; }
.srp-th--date_submitted { width: 110px; white-space: nowrap; }
.srp-th--type_of_firm   { width: 160px; }
.srp-th--employees      { width: 90px; text-align: center; }
.srp-td--employees      { text-align: center; }
.srp-th--docs           { width: 180px; }

.srp-company-cell { display: flex; align-items: center; gap: 9px; }
.srp-company-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; text-transform: uppercase;
}
.srp-company-name { font-weight: 600; color: #1a2332; }

.srp-link { color: #d47e3b; }
.srp-link:hover { text-decoration: underline; }

.srp-doc-list { display: flex; flex-direction: column; gap: 4px; }
.srp-doc-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: #d47e3b; max-width: 160px;
}
.srp-doc-link svg  { width: 12px; height: 12px; flex-shrink: 0; }
.srp-doc-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srp-doc-link:hover { text-decoration: underline; }
.srp-no-doc { color: #8696ae; font-size: 12px; }

.srp-empty { text-align: center; padding: 64px 20px; color: #8696ae; }
.srp-empty svg { width: 56px; height: 56px; display: block; margin: 0 auto 14px; color: #dde2ec; }
.srp-empty p { font-size: 15px; margin: 0; }

/* ── Pagination ── */
.srp-pagination { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.srp-pagination__info { font-size: 12px; color: #8696ae; margin-right: auto; }
.srp-pagination ul { display: flex; gap: 3px; list-style: none; margin: 0; padding: 0; }
.srp-pagination li a,
.srp-pagination li span {
  display: flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1.5px solid #dde2ec; border-radius: 5px;
  font-size: 13px; color: #485468;
  transition: all .18s ease; text-decoration: none;
}
.srp-pagination li a:hover { background: #d47e3b; color: #fff; border-color: #d47e3b; text-decoration: none; }
.srp-pagination li span.current { background: #d47e3b; color: #fff; border-color: #d47e3b; font-weight: 700; }

/* ════════════════════════════════
   MODAL
════════════════════════════════ */
.srp-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 999999;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 20px 20px; overflow-y: auto;
  animation: srp-fadein .18s ease;
}
@keyframes srp-fadein { from { opacity: 0; } to { opacity: 1; } }

.srp-modal-box {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.16);
  width: 100%; max-width: 760px;
  animation: srp-slideup .2s cubic-bezier(.34,1.56,.64,1);
  border-top: 4px solid #d47e3b;
}
@keyframes srp-slideup {
  from { transform: translateY(18px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1);      opacity: 1; }
}
.srp-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid #dde2ec;
}
.srp-modal-title { font-size: 17px; font-weight: 700; color: #1a2332; margin: 0; }
.srp-modal-close {
  background: none; border: none; cursor: pointer;
  color: #8696ae; padding: 5px; border-radius: 5px;
  display: flex; transition: all .18s ease;
}
.srp-modal-close svg { width: 20px; height: 20px; }
.srp-modal-close:hover { color: #dc3545; background: #fff5f5; }

.srp-modal-body { padding: 24px; overflow-y: auto; max-height: 75vh; }
.srp-modal-loading {
  display: flex; align-items: center; gap: 10px;
  color: #8696ae; justify-content: center; padding: 48px; font-size: 14px;
}
.srp-spinner {
  width: 20px; height: 20px;
  border: 2px solid #dde2ec; border-top-color: #d47e3b;
  border-radius: 50%;
  animation: srp-spin .8s linear infinite;
}
@keyframes srp-spin { to { transform: rotate(360deg); } }

/* ── Entry detail inside modal ── */
.srp-detail__hero { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.srp-detail__avatar {
  width: 52px; height: 52px; border-radius: 12px;
  background: #d47e3b; color: #fff;
  font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; text-transform: uppercase;
}
.srp-detail__company { font-size: 20px; font-weight: 700; color: #1a2332; margin: 0 0 6px; }
.srp-detail__meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srp-detail__date { font-size: 12px; color: #8696ae; }
.srp-badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.srp-badge--blue  { background: #fef0e4; color: #a9642f; }
.srp-badge--green { background: #fef0e4; color: #a9642f; }

.srp-detail__sections { display: flex; flex-direction: column; }
.srp-detail__section { border: 1px solid #dde2ec; border-radius: 5px; margin-bottom: 14px; overflow: hidden; }
.srp-detail__section:last-child { margin-bottom: 0; }
.srp-detail__section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: #485468;
  background: #f8f4f0; padding: 9px 14px; margin: 0;
  border-bottom: 1px solid #dde2ec;
}
.srp-detail__section-title svg { width: 14px; height: 14px; flex-shrink: 0; color: #d47e3b; }
.srp-detail__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.srp-detail__grid--wide { grid-template-columns: 1fr; }
.srp-detail__field {
  display: flex; flex-direction: column;
  padding: 10px 14px;
  border-bottom: 1px solid #dde2ec;
  border-right: 1px solid #dde2ec;
}
.srp-detail__field:last-child { border-right: none; border-bottom: none; }
.srp-detail__field--full { grid-column: 1 / -1; border-right: none; }
.srp-detail__field-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; color: #8696ae; margin-bottom: 3px;
}
.srp-detail__field-value { font-size: 13px; color: #1a2332; word-break: break-word; }

.srp-detail__section--docs .srp-detail__doc-list {
  display: flex; flex-direction: column; gap: 8px; padding: 14px;
}
.srp-detail__doc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: #f7f9fc;
  border: 1.5px solid #dde2ec; border-radius: 5px;
  transition: all .18s ease; text-decoration: none !important;
}
.srp-detail__doc-item:hover { background: rgba(212,126,59,.08); border-color: #d47e3b; }
.srp-detail__doc-icon {
  width: 36px; height: 36px; background: rgba(212,126,59,.12);
  border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.srp-detail__doc-icon svg { width: 18px; height: 18px; color: #d47e3b; }
.srp-detail__doc--pdf .srp-detail__doc-icon { background: #fff0f0; }
.srp-detail__doc--pdf .srp-detail__doc-icon svg { color: #dc3545; }
.srp-detail__doc-info { flex: 1; overflow: hidden; }
.srp-detail__doc-name { display: block; font-size: 13px; font-weight: 600; color: #1a2332; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.srp-detail__doc-ext  { display: block; font-size: 11px; color: #8696ae; margin-top: 1px; }
.srp-detail__doc-dl   { width: 16px; height: 16px; color: #d47e3b; flex-shrink: 0; }

/* ── Toast ── */
.srp-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1a2332; color: #fff;
  padding: 10px 20px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,.16);
  z-index: 9999999;
  animation: srp-toast-in .2s ease;
}
@keyframes srp-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 1100px) {
  .srp-filter-bar__grid { grid-template-columns: 1fr 1fr 1fr; }
  .srp-filter-group--dates { grid-column: span 2; }
}
@media (max-width: 720px) {
  .srp-filter-bar__grid { grid-template-columns: 1fr; }
  .srp-filter-group--dates { grid-column: span 1; }
  .srp-date-pair { flex-direction: column; }
  .srp-toolbar { flex-direction: column; align-items: flex-start; }
  .srp-toolbar__right { margin-left: 0; }
  .srp-login-card { padding: 32px 20px; }
  .srp-modal-box { border-radius: 0; border-top-width: 3px; }
  .srp-modal-overlay { padding: 0; align-items: flex-start; }
  .srp-modal-body { max-height: none; }
}
