*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink:        #0f1117;
  --ink-2:      #3a3d4a;
  --ink-3:      #7a7f8e;
  --paper:      #f5f4f0;
  --paper-2:    #eceae3;
  --accent:     #c8472a;
  --accent-2:   #e8603f;
  --green:      #2a7a4f;
  --green-bg:   #d4f0e2;
  --green-text: #1a5c34;
  --yellow-bg:  #fdf0d0;
  --yellow-text:#7a5000;
  --red-bg:     #fde8e4;
  --red-text:   #8a1a0a;
  --blue-bg:    #e8f1fb;
  --blue-text:  #1a4070;
  --border:     rgba(15,17,23,.10);
  --radius:     12px;
  --radius-lg:  20px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
}

/* ── TOPBAR ─────────────────────────── */
.topbar {
  background: var(--ink);
  color: #fff;
  padding: 0 clamp(1.25rem, 5vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.topbar-logo {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: .65rem;
  color: #fff;
}

.topbar-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
}

.topbar-sub {
  font-size: .78rem;
  color: rgba(255,255,255,.45);
  margin-left: .25rem;
}

.topbar-admin {
  font-size: .8rem;
  color: rgba(255,255,255,.55);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.15);
  padding: .3rem .9rem;
  border-radius: 20px;
  transition: all .2s;
}

.topbar-admin:hover {
  color: #fff;
  border-color: rgba(255,255,255,.4);
}

/* ── WRAPPER ────────────────────────── */
.wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem clamp(1rem, 4vw, 2.5rem) 4rem;
}

/* ── BREADCRUMB ─────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8rem;
  color: var(--ink-3);
  margin-bottom: 1.75rem;
}

.breadcrumb a {
  color: var(--ink-3);
  text-decoration: none;
  transition: color .15s;
}

.breadcrumb a:hover {
  color: var(--ink);
}

.breadcrumb-sep {
  opacity: .4;
}

/* ── PAGE HEADER ────────────────────── */
.page-header {
  margin-bottom: 2rem;
}

.page-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .4rem;
}

.page-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  margin-bottom: .5rem;
}

.page-desc {
  font-size: .88rem;
  color: var(--ink-3);
  line-height: 1.6;
  max-width: 520px;
}

/* ── PROGRESS ───────────────────────── */
.progress-wrap {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  overflow-x: auto;
}

.prog-step {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex: 1;
  min-width: max-content;
}

.prog-step:last-child {
  flex: none;
}

.prog-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .73rem;
  border: 2px solid var(--border);
  color: var(--ink-3);
  background: var(--paper);
}

.prog-dot.done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.prog-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.prog-label {
  font-size: .78rem;
  color: var(--ink-3);
  white-space: nowrap;
}

.prog-label.done {
  color: var(--green);
}

.prog-label.active {
  color: var(--ink);
  font-weight: 500;
}

.prog-line {
  flex: 1;
  height: 2px;
  background: var(--paper-2);
  margin: 0 .5rem;
  min-width: 24px;
}

.prog-line.done {
  background: var(--green);
}

/* ── MAIN GRID ──────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

/* ── CARD ───────────────────────────── */
.card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card + .card {
  margin-top: 1.25rem;
}

.card-pad {
  padding: 1.75rem;
}

.sec-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .3rem;
}

.sec-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}

.sec-sub {
  font-size: .83rem;
  color: var(--ink-3);
}

.sec-sub-gap {
  margin-bottom: 1.5rem;
}

.sec-title-gap {
  margin-bottom: 1.25rem;
}

/* ── FOLIO BLOCK ────────────────────── */
.folio-block {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.folio-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: .04em;
}

.folio-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.5);
  margin-bottom: .2rem;
}

.folio-meta {
  font-size: .75rem;
  color: rgba(255,255,255,.5);
}

.folio-actions {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

/* ── BADGES ─────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge-green {
  background: var(--green-bg);
  color: var(--green-text);
}

.badge-yellow {
  background: var(--yellow-bg);
  color: var(--yellow-text);
}

.badge-red {
  background: var(--red-bg);
  color: var(--red-text);
}

.badge-blue {
  background: var(--blue-bg);
  color: var(--blue-text);
}

.badge-gray {
  background: var(--paper-2);
  color: var(--ink-3);
  border: 1px solid var(--border);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── SUMMARY ROW ────────────────────── */
.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.summary-item {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  text-align: center;
}

.summary-num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--ink);
  line-height: 1;
}

.summary-desc {
  font-size: .73rem;
  color: var(--ink-3);
  margin-top: .2rem;
}

.summary-item.green .summary-num {
  color: var(--green);
}

.summary-item.red .summary-num {
  color: var(--accent);
}

.summary-item.yellow .summary-num {
  color: #b07000;
}

/* ── CATEGORY SECTIONS ──────────────── */
.cat-section {
  margin-bottom: 1.25rem;
}

.cat-section:last-child {
  margin-bottom: 0;
}

.cat-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}

.cat-header:hover {
  background: var(--paper-2);
}

.cat-header.open {
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom-color: transparent;
}

.cat-title {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  flex: 1;
}

.cat-chevron {
  font-size: .8rem;
  color: var(--ink-3);
  transition: transform .2s;
}

.cat-header.open .cat-chevron {
  transform: rotate(180deg);
}

.cat-body {
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  display: none;
}

.cat-body.open {
  display: block;
}

/* ── DOC ROW ────────────────────────── */
.doc-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 1rem;
  align-items: center;
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--paper-2);
  transition: background .12s;
}

.doc-row:last-child {
  border-bottom: none;
}

.doc-row:hover {
  background: var(--paper);
}

.doc-row.rejected {
  background: #fff6f5;
}

.doc-row.rejected:hover {
  background: #fef0ee;
}

.doc-name {
  font-weight: 500;
  font-size: .88rem;
  color: var(--ink);
}

.doc-meta {
  font-size: .75rem;
  color: var(--ink-3);
  margin-top: .15rem;
}

.doc-meta-pending {
  color: #b07000;
}

.doc-rejection {
  background: var(--red-bg);
  border: 1px solid #f0b8b0;
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .75rem;
  color: var(--red-text);
  margin-top: .4rem;
  display: flex;
  gap: .4rem;
  align-items: flex-start;
}

.doc-rejection strong {
  font-weight: 600;
}

.doc-actions {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ── BTN ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: 0 1rem;
  height: 34px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-2);
}

.btn-outline {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--ink-2);
}

.btn-outline:hover {
  border-color: var(--ink-3);
  color: var(--ink);
}

.btn-outline-light {
  color: #fff;
  border-color: rgba(255,255,255,.2);
}

.btn-outline-light:hover {
  border-color: rgba(255,255,255,.45);
  color: #fff;
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--ink-3);
  font-size: .8rem;
}

.btn-ghost:hover {
  color: var(--accent);
}

.btn-danger-outline {
  background: none;
  border: 1.5px solid #f0b8b0;
  color: var(--red-text);
}

.btn-danger-outline:hover {
  background: var(--red-bg);
}

.btn-lg {
  height: 46px;
  padding: 0 1.75rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .92rem;
  border-radius: var(--radius);
}

.btn-soft-light {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.72);
  font-size: .75rem;
  height: 30px;
}

.btn-soft-light:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.btn-close-upload {
  font-size: 1.3rem;
  line-height: 1;
}

/* ── UPLOAD ZONE ────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--paper);
  transition: all .2s;
  cursor: pointer;
  position: relative;
  display: block;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: #fdf3f1;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
}

.upload-icon {
  font-size: 2.2rem;
  margin-bottom: .75rem;
  display: block;
}

.upload-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: .35rem;
}

.upload-hint {
  font-size: .8rem;
  color: var(--ink-3);
  line-height: 1.5;
}

.upload-selected {
  margin-top: 1rem;
  padding: .75rem 1rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  display: none;
  align-items: center;
  gap: .75rem;
  text-align: left;
}

.upload-selected.visible {
  display: flex;
}

.upload-file-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.upload-file-name {
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink);
  word-break: break-word;
}

.upload-file-size {
  font-size: .75rem;
  color: var(--ink-3);
}

.upload-clear {
  margin-left: auto;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 1rem;
  flex-shrink: 0;
  background: none;
  border: none;
}

.upload-clear:hover {
  color: var(--accent);
}

.upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.upload-actions {
  display: flex;
  gap: .75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.upload-panel {
  margin-top: 1.25rem;
}

.hidden {
  display: none !important;
}

/* ── SELECT / FIELDS ────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1.25rem;
}

.field:last-child {
  margin-bottom: 0;
}

.field-label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink-2);
}

.field select {
  height: 42px;
  padding: 0 .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  color: var(--ink);
  outline: none;
  width: 100%;
  transition: border-color .18s;
}

.field select:focus {
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15,17,23,.06);
}

/* ── LOGIN FORM ─────────────────────── */
.login-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: 1rem;
}

.login-field label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--ink-2);
}

.login-field input {
  height: 42px;
  padding: 0 .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: 'DM Sans', sans-serif;
  font-size: .88rem;
  color: var(--ink);
  outline: none;
  width: 100%;
  transition: border-color .18s;
}

.login-field input:focus {
  border-color: var(--ink);
  background: #fff;
}

.login-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ── ALERT ──────────────────────────── */
.alert {
  border-radius: var(--radius);
  padding: .85rem 1.1rem;
  font-size: .83rem;
  line-height: 1.55;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.alert:last-child {
  margin-bottom: 0;
}

.alert-warn {
  background: var(--yellow-bg);
  border: 1.5px solid #f0d080;
  color: var(--yellow-text);
}

.alert-ok {
  background: var(--green-bg);
  border: 1.5px solid #8fd4aa;
  color: var(--green-text);
}

.alert-err {
  background: var(--red-bg);
  border: 1.5px solid #f0b8b0;
  color: var(--red-text);
}

.alert-info {
  background: var(--blue-bg);
  border: 1.5px solid #b0cef0;
  color: var(--blue-text);
}

.alert-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.alert-top-gap {
  margin-top: 1.25rem;
}

.alert-bottom-gap {
  margin-bottom: 1.25rem;
}

.d-none {
  display: none !important;
}

/* ── SIDEBAR ────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.info-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.4rem;
}

.info-card-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .5rem;
}

.info-card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .75rem;
}

.tip-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

.tip-list li {
  display: flex;
  gap: .6rem;
  font-size: .81rem;
  color: var(--ink-3);
  line-height: 1.5;
  align-items: flex-start;
}

.tip-list li .ico {
  font-size: .9rem;
  flex-shrink: 0;
  margin-top: .05rem;
}

.divider {
  height: 1px;
  background: var(--paper-2);
  margin: 1rem 0;
}

.status-mini-list {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.status-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .83rem;
}

.text-green {
  color: var(--green-text);
}

.text-green-strong {
  color: var(--green);
}

.text-yellow {
  color: #b07000;
}

.text-red {
  color: var(--red-text);
}

.text-red-strong {
  color: var(--accent);
}

.progress-side-label {
  font-size: .75rem;
  color: var(--ink-3);
  margin-bottom: .4rem;
}

.progress-side-bar {
  height: 8px;
  background: var(--paper-2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-side-fill {
  height: 100%;
  background: var(--green);
  border-radius: 4px;
  transition: width .4s;
}

.progress-side-value {
  font-size: .72rem;
  color: var(--ink-3);
  margin-top: .3rem;
  text-align: right;
}

/* ── FOOTER ─────────────────────────── */
.footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .75rem;
  font-size: .78rem;
  color: var(--ink-3);
}

/* ── RESPONSIVE ─────────────────────── */
@media (max-width: 860px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .doc-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .doc-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .wrapper {
    padding-top: 2rem;
    padding-bottom: 3rem;
  }

  .topbar-sub {
    display: none;
  }

  .progress-wrap {
    padding: 1rem;
  }

  .card-pad,
  .info-card {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .login-actions,
  .upload-actions {
    flex-direction: column;
  }

  .login-actions .btn,
  .upload-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .folio-actions {
    width: 100%;
  }

  .folio-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

.info-box-upload {
  background: #eaf4ff;
  border: 1px solid #b9d7f5;
  border-left: 6px solid #0b5cab;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.info-box-upload-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.info-box-upload-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0b5cab;
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  flex-shrink: 0;
}

.info-box-upload-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #0b5cab;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.info-box-upload-title {
  font-size: 18px;
  font-weight: 700;
  color: #12344d;
  line-height: 1.3;
}

.info-box-upload-body {
  color: #243746;
}

.info-box-upload-text {
  margin: 0 0 12px;
  font-size: 14px;
}

.info-box-upload-format {
  background: #ffffff;
  border: 1px dashed #7fb3e6;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  color: #0b3d6e;
  margin-bottom: 14px;
}

.info-box-upload-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: #12344d;
  margin-bottom: 8px;
}

.info-box-upload-example ul {
  margin: 0;
  padding-left: 18px;
}

.info-box-upload-example li {
  margin-bottom: 6px;
  font-size: 14px;
}

.info-box-upload-warning {
  margin-top: 14px;
  padding: 10px 12px;
  background: #fff7e6;
  border: 1px solid #f3d38a;
  border-radius: 8px;
  color: #7a5600;
  font-size: 14px;
}

.info-box-upload-note {
  margin-top: 10px;
  font-size: 13px;
  color: #4a5c6a;
}

.info-box-upload code {
  background: #f4f7fa;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
}

