
/* ==========================================================
   MATERIAL VERIFICATION SYSTEM
   MAIN STYLESHEET
   ========================================================== */

* {
  box-sizing: border-box;
}

:root {
  --black: #000000;
  --gray: #7F7F7F;
  --red: #C00000;
  --white: #FFFFFF;
  --bg: #e8e8e8;
  --line: #c9c9c9;
  --text: #202020;
  --muted: #626262;
  --soft-red: #f7e9e9;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px "Segoe UI", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

/* ==========================================================
   TOPBAR
   ========================================================== */

.topbar {
  height: 58px;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 4px solid var(--red);
}

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

.brand-mark {
  width: 37px;
  height: 37px;
  border: 1px solid #777;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}

.brand strong {
  display: block;
  font-size: 14px;
  letter-spacing: .2px;
}

.brand small {
  display: block;
  color: #c5c5c5;
  font-size: 10px;
  letter-spacing: 1.5px;
  margin-top: 3px;
}

.top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dedede;
  font-size: 12px;
}

.live-dot,
.state-dot {
  width: 8px;
  height: 8px;
  background: #8a8a8a;
  border-radius: 50%;
  display: inline-block;
}

.version {
  margin-left: 14px;
  border-left: 1px solid #555;
  padding-left: 14px;
  color: #bdbdbd;
}

/* ==========================================================
   SIDEBAR AND MAIN LAYOUT
   ========================================================== */

.layout {
  display: flex;
  min-height: calc(100vh - 58px);
}

.sidebar {
  width: 218px;
  flex: 0 0 218px;
  background: #181818;
  color: white;
  display: flex;
  flex-direction: column;
  padding-top: 20px;
}

.side-caption {
  color: #999;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 0 20px 12px;
}

.nav {
  height: 47px;
  border: 0;
  border-left: 4px solid transparent;
  text-align: left;
  padding: 0 17px;
  color: #ddd;
  background: transparent;
  font-size: 13px;
}

.nav span {
  display: inline-block;
  width: 28px;
  color: #bcbcbc;
  font-size: 16px;
}

.nav:hover {
  background: #292929;
}

.nav.active {
  background: var(--red);
  border-left-color: #fff;
  color: white;
  font-weight: 600;
}

.nav.active span {
  color: white;
}

.side-bottom {
  margin-top: auto;
  padding: 16px 20px 24px;
  font-size: 12px;
}

.side-rule {
  height: 1px;
  background: #555;
  margin-bottom: 14px;
}

.side-bottom strong,
.side-bottom small {
  display: block;
}

.side-bottom small {
  color: #aaa;
  margin-top: 4px;
}

.main {
  flex: 1;
  min-width: 0;
  max-width: 1700px;
  margin: 0 auto;
  padding: 22px 26px 14px;
}

/* ==========================================================
   HEADINGS
   ========================================================== */

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.breadcrumb {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 14px;
}

.breadcrumb span {
  padding: 0 8px;
  color: #aaa;
}

.eyebrow {
  font-size: 11px;
  color: var(--red);
  font-weight: 800;
  letter-spacing: 1.2px;
  margin-bottom: 7px;
}

h1 {
  font-size: 27px;
  margin: 0 0 7px;
  letter-spacing: -.4px;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.intro {
  max-width: 750px;
  font-size: 13px;
}

.state-pill {
  white-space: nowrap;
  border: 1px solid var(--line);
  background: #f8f8f8;
  padding: 9px 12px;
  font-size: 11px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

/* ==========================================================
   SECTIONS
   ========================================================== */

.section {
  background: var(--white);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px 11px;
  border-bottom: 1px solid #ddd;
}

.section-number {
  font-size: 11px;
  color: var(--red);
  font-weight: 800;
  padding-top: 2px;
}

.section-head h2,
.results-heading h2 {
  font-size: 15px;
  margin: 0 0 3px;
}

.section-head p,
.results-heading p {
  font-size: 11px;
}

.section-head-inline {
  align-items: center;
}

.section-head-inline > div {
  flex: 1;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
}

/* ==========================================================
   FILE SELECTION
   ========================================================== */

.file-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 14px;
}

.file-card {
  border: 1px solid #c7c7c7;
  background: #fafafa;
  padding: 14px;
}

.file-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-icon {
  width: 36px;
  height: 34px;
  display: grid;
  place-items: center;
  background: #e1e1e1;
  color: #333;
  font-size: 10px;
  font-weight: 800;
}

.red-icon {
  background: var(--soft-red);
  color: var(--red);
}

.file-title strong {
  display: block;
  font-size: 13px;
}

.file-title small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.file-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}

.file-control input[type=file] {
  width: 100%;
  min-width: 0;
  font-size: 11px;
  color: #555;
}

.file-meta {
  font-size: 11px;
  color: #555;
  background: var(--soft-red);
  border-left: 3px solid var(--red);
  padding: 8px 9px;
  margin-top: 12px;
  overflow-wrap: anywhere;
}

/* ==========================================================
   BUTTONS
   ========================================================== */

.button {
  border: 1px solid #bcbcbc;
  padding: 8px 12px;
  background: #e5e5e5;
  color: #222;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.button:hover {
  filter: brightness(.96);
}

.button.primary {
  background: var(--red);
  color: white;
  border-color: #9e0000;
  padding: 10px 20px;
  min-width: 210px;
}

.button.secondary {
  background: #e7e7e7;
}

.button.small {
  padding: 7px 10px;
}

.button:disabled {
  opacity: .6;
  cursor: wait;
}

/* ==========================================================
   COLUMN MAPPING
   ========================================================== */

.mapping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 14px;
}

.mapping-column {
  display: grid;
  grid-template-columns: 130px minmax(120px, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.mapping-column h3 {
  grid-column: 1/-1;
  margin: 0 0 2px;
  font-size: 12px;
}

.mapping-column label {
  display: contents;
  font-size: 11px;
  color: #444;
}

.mapping-column select,
.table-tools select,
.table-footer select {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid #bcbcbc;
  background: #fff;
  color: #222;
  font-size: 11px;
}

.mapping-note {
  grid-column: 1/-1;
  border-left: 3px solid var(--gray);
  background: #f0f0f0;
  padding: 9px 11px;
  color: #555;
  font-size: 11px;
  line-height: 1.45;
}

/* ==========================================================
   VERIFICATION PROCESS
   ========================================================== */

.process-section .section-head {
  border-bottom: 0;
}

.process-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 15px 13px;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  color: #555;
  font-size: 11px;
}

.progress-track {
  height: 10px;
  background: #ddd;
  flex: 1;
  border: 1px solid #ccc;
}

.progress-track div {
  height: 100%;
  width: 0;
  background: var(--red);
  transition: width .2s;
}

.notice {
  border-top: 1px solid #ddd;
  background: #f5f5f5;
  padding: 8px 15px;
  color: #666;
  font-size: 11px;
}

/* ==========================================================
   RESULTS TABLE
   ========================================================== */

.results-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 15px;
  border-bottom: 1px solid #ddd;
}

.result-tabs {
  display: flex;
  border-bottom: 1px solid #ccc;
  padding: 0 12px;
  overflow-x: auto;
}

.tab {
  background: #eee;
  border: 0;
  border-right: 1px solid #d0d0d0;
  padding: 10px 15px;
  color: #444;
  font-size: 11px;
  white-space: nowrap;
}

.tab.active {
  background: white;
  color: var(--red);
  font-weight: 700;
  border-bottom: 3px solid var(--red);
}

.table-tools {
  display: flex;
  gap: 8px;
  padding: 12px;
}

.table-tools input {
  flex: 1;
  min-width: 100px;
  padding: 8px 10px;
  border: 1px solid #bcbcbc;
  font-size: 12px;
}

.table-tools select {
  width: 160px;
}

.table-wrap {
  overflow: auto;
  padding: 0 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  font-size: 11px;
}

thead th {
  text-align: left;
  background: #dedede;
  border: 1px solid #c4c4c4;
  padding: 9px 8px;
  white-space: nowrap;
  font-weight: 700;
}

tbody td {
  border: 1px solid #d6d6d6;
  padding: 8px;
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: #f5f5f5;
}

tbody tr:hover {
  background: #fff0f0;
}

.status {
  display: inline-block;
  padding: 4px 6px;
  font-size: 10px;
  white-space: nowrap;
}

.status.matched {
  background: #e5e5e5;
  color: #333;
}

.status.issue {
  background: #f4d6d6;
  color: #a00000;
}

.status.review {
  background: #fff0d5;
  color: #805500;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  color: #666;
  font-size: 11px;
}

.table-footer span:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-footer select {
  width: 60px;
}

footer {
  color: #777;
  font-size: 10px;
  padding: 8px 2px 15px;
}

/* ==========================================================
   HISTORY AND REPORTS
   ========================================================== */

.app-page[hidden] {
  display: none !important;
}

.empty-state {
  padding: 28px 20px;
  text-align: center;
  border-top: 1px solid #ddd;
  background: #fafafa;
}

.empty-state strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 13px;
}

.empty-state p {
  font-size: 12px;
}

/* ==========================================================
   LOGIN AND REGISTER
   ========================================================== */

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background: var(--bg);
}

.auth-card {
  width: min(100%, 450px);
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 22px;
  border-bottom: 1px solid #ddd;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  font-size: 14px;
}

.auth-brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.2px;
}

.auth-intro {
  padding: 23px 0 17px;
}

.auth-intro h1 {
  font-size: 25px;
  margin-bottom: 7px;
}

.auth-intro p,
.auth-hint,
.auth-footnote {
  font-size: 12px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
  border-bottom: 1px solid #ccc;
}

.auth-switch button {
  padding: 11px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: #eee;
  color: #555;
  font-size: 12px;
  font-weight: 700;
}

.auth-switch button.active {
  border-bottom-color: var(--red);
  background: #fff;
  color: var(--red);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form label {
  margin-top: 7px;
  color: #444;
  font-size: 12px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid #bcbcbc;
  background: #fff;
  color: #202020;
  font-size: 13px;
}

.auth-form input:focus {
  outline: 2px solid rgba(192, 0, 0, .15);
  border-color: var(--red);
}

.auth-submit {
  width: 100%;
  min-height: 42px;
  margin-top: 15px;
  border: 1px solid #9e0000;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.auth-submit:hover {
  filter: brightness(.94);
}

.auth-submit:disabled {
  opacity: .65;
  cursor: wait;
}

.auth-hint {
  margin-top: 7px;
}

.auth-message {
  min-height: 18px;
  margin-top: 15px;
  padding: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.auth-message.success {
  color: #246b3b;
}

.auth-message.error {
  color: #b00000;
}

.auth-footnote {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid #ddd;
  color: #777;
}

.signed-in-meta {
  gap: 10px;
}

.signed-in-meta #signedInEmail {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media(max-width:1000px) {
  .sidebar {
    width: 175px;
    flex-basis: 175px;
  }

  .main {
    padding: 16px;
  }

  .mapping-column {
    grid-template-columns: 100px minmax(100px, 1fr);
  }

  .top-meta {
    display: none;
  }
}

@media(max-width:720px) {
  .sidebar {
    width: 54px;
    flex-basis: 54px;
    padding-top: 10px;
  }

  .side-caption,
  .side-bottom,
  .brand small,
  .brand div:not(.brand-mark) {
    display: none;
  }

  .brand {
    padding: 0 8px;
    margin: 8px 0 20px;
  }

  .brand-mark {
    width: 34px;
  }

  .nav {
    font-size: 0;
    padding: 0;
    text-align: center;
    border-left-width: 3px;
  }

  .nav span {
    font-size: 18px;
    width: auto;
  }

  .main {
    padding: 12px;
  }

  .page-heading {
    display: block;
  }

  .state-pill {
    display: inline-flex;
    margin-top: 12px;
  }

  .file-grid,
  .mapping-grid {
    grid-template-columns: 1fr;
  }

  .mapping-note {
    grid-column: auto;
  }

  .file-grid {
    padding: 10px;
  }

  .section-head {
    padding: 11px;
  }

  .table-tools {
    flex-wrap: wrap;
  }

  .table-tools input {
    flex-basis: 100%;
  }

  .table-tools select {
    flex: 1;
  }

  .process-row {
    align-items: stretch;
    flex-direction: column;
  }

  .button.primary {
    width: 100%;
  }

  .results-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .auth-card {
    padding: 22px 18px;
  }

  .signed-in-meta #signedInEmail {
    max-width: 120px;
  }
}
