:root {
  --ink: #1e1b18;
  --muted: #716a62;
  --line: #dcd5cb;
  --paper: #f4f0e9;
  --card: #fffdfa;
  --accent: #b94d32;
  --accent-dark: #91351f;
  --green: #47715e;
  --orange: #9d6426;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.site-shell { min-height: 100vh; padding: 0 4vw 5rem; }
.topbar, .admin-topbar { min-height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { font-size: 1rem; font-weight: 800; letter-spacing: .09em; }
.brand span { color: var(--accent); }
.secure-note { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .78rem; }
.secure-note i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(71,113,94,.12); }

.page-grid { width: min(1240px, 100%); margin: 0 auto; padding-top: 4.2rem; display: grid; grid-template-columns: minmax(280px,.82fr) minmax(520px,1.35fr); gap: clamp(3rem,8vw,8rem); align-items: start; }
.order-aside { position: sticky; top: 2rem; padding-top: 1rem; }
.eyebrow, .step-label { margin: 0 0 1rem; color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.order-aside h1, .notice-card h1, .success-card h1, .admin-heading h1, .login-card h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.045em; line-height: .98; }
.order-aside h1 { max-width: 520px; font-size: clamp(3rem,5.2vw,5.5rem); }
.lead { max-width: 470px; margin: 2rem 0 2.5rem; color: var(--muted); font-size: 1rem; line-height: 1.7; }
.order-details { margin: 0; border-top: 1px solid var(--line); }
.order-details div { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1rem; padding: .88rem 0; border-bottom: 1px solid var(--line); }
.order-details dt { color: var(--muted); font-size: .76rem; }
.order-details dd { margin: 0; font-size: .82rem; font-weight: 700; overflow-wrap: anywhere; }
.manager-card { margin-top: 2rem; display: flex; align-items: center; gap: .8rem; }
.manager-avatar, .admin-person > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: white; font-family: Georgia, serif; }
.manager-card > div:last-child, .admin-person > div { display: flex; flex-direction: column; gap: .14rem; }
.manager-card strong { font-size: .8rem; }
.manager-card span, .admin-person small { color: var(--muted); font-size: .7rem; }

.upload-panel { padding: clamp(1.4rem,3vw,2.5rem); background: var(--card); border: 1px solid var(--line); box-shadow: 0 26px 70px rgba(49,38,27,.08); }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1.5rem; }
.panel-head h2, .form-section h3, .orders-card h2, .create-order-card h2 { margin: 0; font-family: Georgia, serif; font-weight: 400; }
.panel-head h2 { font-size: 1.65rem; }
.step-label { margin-bottom: .45rem; font-size: .58rem; }
.file-counter { color: var(--muted); font-size: .73rem; }
.drop-zone { min-height: 230px; padding: 2rem; border: 1.5px dashed #c7beb3; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; cursor: pointer; transition: .2s ease; background: #faf7f2; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--accent); background: #fbf0e9; transform: translateY(-1px); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: white; margin-bottom: 1rem; font-size: 1.2rem; }
.drop-zone strong { font-size: .94rem; }
.drop-zone > span:not(.upload-icon) { margin-top: .44rem; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.drop-zone small { margin-top: 1rem; color: #91897f; font-size: .62rem; }
.upload-summary { margin-top: 1rem; padding: .9rem 1rem; background: #f2eee7; }
.upload-summary > div:first-child { display: flex; justify-content: space-between; gap: 1rem; font-size: .7rem; }
.upload-summary span { color: var(--muted); }
.progress, .mini-progress { overflow: hidden; background: #ddd6cd; }
.progress { height: 5px; margin-top: .65rem; }
.progress i, .mini-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .18s ease; }
.file-list { margin-top: .8rem; max-height: 310px; overflow: auto; border: 1px solid var(--line); }
.file-row { display: flex; align-items: center; gap: .75rem; min-height: 60px; padding: .65rem .85rem; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-badge { display: grid; place-items: center; width: 37px; height: 37px; flex: 0 0 auto; background: #eee8df; color: var(--muted); font-size: .56rem; font-weight: 800; }
.file-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.file-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .73rem; }
.file-info > span { color: var(--muted); font-size: .62rem; }
.mini-progress { height: 3px; margin-top: .15rem; }
.file-row > button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; }

.form-section { display: grid; grid-template-columns: 34px 1fr; gap: 1rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.section-number { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid var(--ink); border-radius: 50%; font-family: Georgia, serif; font-size: .75rem; }
.form-section h3 { font-size: 1.16rem; }
.form-section p { margin: .45rem 0 1rem; color: var(--muted); font-size: .73rem; line-height: 1.5; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: white; padding: .85rem .9rem; outline: none; font-size: .76rem; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 2px rgba(29,27,25,.07); }
textarea { min-height: 105px; resize: vertical; line-height: 1.5; }
textarea::placeholder, input::placeholder { color: #aaa198; }
.consent-row { display: grid; grid-template-columns: 18px 1fr; gap: .75rem; margin-top: 1.4rem; color: var(--muted); font-size: .68rem; line-height: 1.5; cursor: pointer; }
.consent-row input { width: 16px; height: 16px; padding: 0; accent-color: var(--accent); }
.submit-row { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin-top: 1.8rem; }
.submit-row p { max-width: 220px; margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.primary-button { border: 0; min-height: 48px; padding: 0 1.4rem; background: var(--accent); color: white; cursor: pointer; font-weight: 700; font-size: .76rem; transition: .2s ease; }
.primary-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.primary-button:disabled { background: #d3ccc4; color: #8f877e; cursor: not-allowed; transform: none; }
.form-message { min-height: 1.1rem; margin: .7rem 0 0; color: var(--green); font-size: .7rem; }
.form-message.error { color: #a02f23; }

.notice-card, .success-card { width: min(690px,100%); margin: 11vh auto 0; text-align: center; }
.notice-card h1, .success-card h1 { font-size: clamp(3.2rem,7vw,5.4rem); }
.notice-card > p:last-child, .success-card > p:last-child { max-width: 500px; margin: 1.7rem auto; color: var(--muted); line-height: 1.7; }
.success-mark { width: 62px; height: 62px; margin: 0 auto 1.5rem; display: grid; place-items: center; background: var(--green); color: white; border-radius: 50%; font-size: 1.5rem; }

.admin-shell { min-height: 100vh; background: #f2eee7; }
.admin-topbar { height: 74px; min-height: 74px; padding: 0 3vw; background: var(--card); }
.admin-person { display: flex; align-items: center; gap: .7rem; }
.admin-person > span { width: 36px; height: 36px; font-size: .72rem; }
.admin-person strong { font-size: .74rem; }
.login-card { width: min(430px,calc(100% - 2rem)); margin: 11vh auto; padding: 2.2rem; background: var(--card); border: 1px solid var(--line); box-shadow: 0 24px 70px rgba(49,38,27,.08); }
.login-card h1 { font-size: 2.8rem; }
.login-card form { display: grid; gap: .7rem; margin-top: 2rem; }
.login-card label, .create-order-card label { color: var(--muted); font-size: .68rem; }
.admin-layout { min-height: calc(100vh - 74px); display: grid; grid-template-columns: 205px 1fr; }
.admin-sidebar { padding: 2.2rem 1.3rem; border-right: 1px solid var(--line); background: #e8e2d9; display: flex; flex-direction: column; justify-content: space-between; }
.admin-sidebar a { display: block; padding: .85rem .9rem; background: var(--card); font-size: .76rem; font-weight: 700; }
.text-button { border: 0; padding: 0; background: none; text-align: left; color: var(--muted); cursor: pointer; font-size: .7rem; }
.admin-content { width: min(1280px,100%); padding: 3rem clamp(1.5rem,4vw,4rem); }
.admin-heading h1 { font-size: clamp(2.7rem,4.5vw,4.1rem); }
.admin-grid { margin-top: 2rem; display: grid; grid-template-columns: 300px 1fr; gap: 1rem; align-items: start; }
.create-order-card { padding: 1.3rem; display: grid; gap: .65rem; background: var(--card); border: 1px solid var(--line); }
.create-order-card h2 { margin-bottom: .55rem; font-size: 1.4rem; }
.create-order-card .primary-button { margin-top: .45rem; }
.admin-main-column { min-width: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
.stats-grid article { min-height: 125px; padding: 1.2rem; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); }
.stats-grid span, .stats-grid small { color: var(--muted); font-size: .68rem; }
.stats-grid strong { margin: auto 0 .2rem; font-family: Georgia,serif; font-weight: 400; font-size: 1.9rem; }
.new-order-result { margin-top: 1rem; padding: 1rem 1.1rem; background: #e5efe8; border: 1px solid #c8d8cc; }
.new-order-result > div:first-child { display: flex; justify-content: space-between; gap: 1rem; }
.new-order-result strong { font-size: .76rem; }
.new-order-result p { margin: 0; color: var(--muted); font-size: .68rem; }
.link-copy { margin-top: .8rem; display: grid; grid-template-columns: 1fr auto; }
.link-copy input { min-width: 0; }
.link-copy button { border: 0; padding: 0 1rem; background: var(--ink); color: white; cursor: pointer; font-size: .68rem; }
.orders-card { margin-top: 1rem; background: var(--card); border: 1px solid var(--line); }
.orders-head { padding: 1.1rem 1.3rem; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.orders-head h2 { font-size: 1.15rem; }
.orders-head button, .order-row button { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: .68rem; }
.orders-list { overflow-x: auto; }
.order-row { min-width: 650px; min-height: 76px; padding: .8rem 1.3rem; display: grid; grid-template-columns: 1.1fr 1fr .8fr auto; align-items: center; gap: 1rem; border-bottom: 1px solid var(--line); }
.order-row:last-child { border-bottom: 0; }
.order-row > div { min-width: 0; display: flex; flex-direction: column; gap: .22rem; }
.order-row strong, .order-row span { font-size: .72rem; }
.order-row small { color: var(--muted); font-size: .61rem; }
.order-status { justify-self: start; padding: .38rem .58rem; border-radius: 50px; background: #ebe8e3; color: var(--muted); font-size: .61rem !important; }
.order-status[data-status="submitted"] { background: #e3efe8; color: var(--green); }
.order-status[data-status="uploading"] { background: #f6e8d8; color: var(--orange); }
.empty-state { margin: 0; padding: 3rem 1.3rem; color: var(--muted); text-align: center; font-size: .75rem; }

@media (max-width: 950px) {
  .page-grid { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 3rem; }
  .order-aside { position: static; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { padding: .8rem 1.2rem; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .site-shell { padding: 0 1rem 3rem; }
  .topbar { min-height: 68px; }
  .secure-note { font-size: .64rem; }
  .page-grid { padding-top: 2rem; }
  .order-aside h1 { font-size: 3.15rem; }
  .lead { font-size: .9rem; }
  .upload-panel { padding: 1.15rem; }
  .drop-zone { min-height: 205px; padding: 1.3rem; }
  .submit-row { align-items: stretch; flex-direction: column; }
  .submit-row p { max-width: 100%; }
  .primary-button { width: 100%; }
  .admin-topbar { padding: 0 1rem; }
  .admin-person > div { display: none; }
  .admin-content { padding: 2rem 1rem; }
  .admin-heading h1 { font-size: 2.75rem; }
  .stats-grid { grid-template-columns: 1fr; }
}
