:root {
  --red: #e50914;
  --red-dark: #bd020b;
  --black: #050608;
  --ink: #111827;
  --muted: #646b77;
  --line: #d9dde5;
  --soft: #f5f7fa;
  --green: #078527;
  --shadow: 0 18px 45px rgba(10, 15, 25, .16);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: #fff;
}

a {
  color: inherit;
}

.site-header {
  height: 116px;
  padding: 22px clamp(18px, 5vw, 54px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background:
    radial-gradient(circle at 35% 0%, rgba(255, 255, 255, .12), transparent 24%),
    linear-gradient(180deg, #111318 0%, #050608 100%);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.speedmark {
  width: 78px;
  height: 78px;
  border: 4px solid #fff;
  border-bottom-color: transparent;
  border-right-color: var(--red);
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.speedmark::before {
  content: "";
  position: absolute;
  width: 36px;
  height: 4px;
  background: var(--red);
  left: 32px;
  top: 36px;
  transform: rotate(-45deg);
  transform-origin: left center;
  border-radius: 10px;
}

.speedmark::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  background: #fff;
  left: 28px;
  top: 35px;
  border-radius: 50%;
}

.brand-text {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 10px;
  align-items: end;
  line-height: .9;
}

.brand-text strong {
  color: var(--red);
  font-size: clamp(2.6rem, 5vw, 4rem);
  letter-spacing: 0;
}

.brand-text b {
  font-size: clamp(1.55rem, 3vw, 2.45rem);
}

.brand-text small {
  grid-column: 1 / 3;
  margin-top: 8px;
  font-size: clamp(.9rem, 1.5vw, 1.35rem);
  font-weight: 700;
  letter-spacing: .22em;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  text-decoration: none;
}

.public-page {
  background:
    linear-gradient(126deg, transparent 0 78%, rgba(229, 9, 20, .55) 78.1% 78.25%, transparent 78.35%),
    radial-gradient(circle at 0 45%, rgba(0, 0, 0, .09), transparent 26%),
    linear-gradient(90deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, .92)),
    #f6f7f9;
}

.public-shell {
  min-height: calc(100vh - 176px);
  padding: 48px 16px 22px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.upload-card,
.login-card,
.table-panel {
  width: min(920px, 100%);
  background: rgba(255, 255, 255, .96);
  border: 1px solid rgba(17, 24, 39, .1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.upload-card {
  padding: clamp(24px, 4.4vw, 44px);
}

.form-hero {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 28px;
  align-items: center;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 3.4rem;
  font-weight: 800;
  background: var(--red);
}

.success-icon {
  background: var(--green);
}

.form-hero h1,
.panel-title h1,
.login-card h1 {
  margin: 0 0 12px;
  color: #050608;
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1.05;
}

.form-hero p,
.login-card p {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.alert {
  margin: 24px 0;
  padding: 16px 18px;
  border-radius: 8px;
  line-height: 1.45;
}

.alert-error {
  color: #8b1117;
  background: #fff0f1;
  border: 1px solid #ffc7cb;
}

.document-form {
  padding-top: 28px;
}

.form-grid,
.upload-grid,
.stats-grid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 32px;
}

.field,
.upload-field {
  display: grid;
  gap: 10px;
  font-weight: 800;
}

.field b,
.upload-field b {
  color: var(--red);
}

.input-wrap {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  color: #68707d;
  background: #fff;
  border: 1px solid #d7dce4;
  border-radius: 7px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .04);
}

.input-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
}

.upload-grid {
  margin-top: 32px;
}

.upload-field.wide {
  grid-column: 1 / -1;
}

.upload-field input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dropzone {
  min-height: 108px;
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #5b6470;
  border: 2px dashed #d8dde5;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.upload-field.has-file .dropzone,
.dropzone:hover {
  border-color: var(--red);
  background: #fff8f8;
}

.upload-cloud {
  font-size: 2.2rem;
  line-height: 1;
}

.dropzone strong,
.dropzone small {
  display: block;
  font-weight: 700;
}

.dropzone small {
  margin-top: 7px;
  color: #7b8492;
  font-size: .88rem;
}

.submit-button {
  width: 100%;
  min-height: 64px;
  margin-top: 30px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(229, 9, 20, .24);
}

.secondary-action {
  width: auto;
  padding: 0 28px;
}

.success-only {
  max-width: 820px;
}

.site-footer {
  min-height: 60px;
  padding: 16px;
  display: flex;
  gap: 22px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #050608;
}

.site-footer a {
  color: var(--red);
}

.footer-separator {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, .36);
}

.footer-shield {
  color: var(--red);
  font-size: 1.6rem;
}

.admin-page,
.admin-login-page {
  background: #eef1f5;
}

.admin-shell,
.admin-login-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto;
}

.admin-login-shell {
  min-height: calc(100vh - 210px);
  display: grid;
  place-items: center;
}

.login-card {
  max-width: 460px;
  padding: 34px;
}

.login-form {
  margin-top: 24px;
}

.login-form .field + .field {
  margin-top: 18px;
}

.admin-nav,
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-nav {
  margin-bottom: 24px;
  padding: 22px 26px;
  color: #fff;
  background: var(--black);
  border-radius: 10px;
}

.admin-nav strong,
.admin-nav span {
  display: block;
}

.admin-nav span {
  margin-top: 4px;
  color: #cfd5df;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-actions a,
.small-button {
  padding: 10px 14px;
  border-radius: 7px;
  color: #fff;
  background: var(--red);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.stats-grid,
.detail-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}

.stat-card,
.detail-card {
  padding: 22px;
  background: #fff;
  border: 1px solid #dfe4ec;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(10, 15, 25, .08);
}

.stat-card span,
.detail-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  font-size: 2.35rem;
}

.detail-card strong {
  display: block;
  margin-top: 8px;
}

.table-panel {
  width: 100%;
  padding: 24px;
}

.panel-title {
  margin-bottom: 18px;
}

.responsive-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e6ed;
}

th {
  color: #4b5563;
  font-size: .86rem;
  text-transform: uppercase;
}

.status-select {
  min-width: 150px;
  padding: 9px 10px;
  border: 1px solid #cfd6e1;
  border-radius: 7px;
  background: #fff;
  font-weight: 700;
}

.status-select.saved {
  border-color: var(--green);
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

.docs-list {
  display: grid;
  gap: 12px;
}

.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid #e1e6ee;
  border-radius: 8px;
}

.doc-row strong,
.doc-row span {
  display: block;
}

.doc-row span {
  margin-top: 5px;
  color: var(--muted);
  word-break: break-word;
}

@media (max-width: 760px) {
  .site-header {
    height: auto;
    min-height: 94px;
    gap: 18px;
    padding: 18px;
  }

  .speedmark {
    width: 58px;
    height: 58px;
  }

  .speedmark::before {
    left: 23px;
    top: 27px;
    width: 28px;
  }

  .speedmark::after {
    left: 20px;
    top: 25px;
  }

  .contact-link {
    font-size: .9rem;
  }

  .public-shell {
    padding-top: 22px;
  }

  .form-hero {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero-icon {
    width: 76px;
    height: 76px;
    font-size: 2.5rem;
  }

  .form-grid,
  .upload-grid,
  .stats-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .site-footer,
  .admin-nav,
  .panel-title,
  .doc-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-separator {
    display: none;
  }
}

@media (max-width: 520px) {
  .brand-text strong {
    font-size: 2rem;
  }

  .brand-text b {
    font-size: 1.15rem;
  }

  .brand-text small {
    font-size: .7rem;
  }

  .contact-link {
    display: none;
  }

  .upload-card {
    border-radius: 12px;
  }

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