@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
  --bg:#f7f8fa;
  --white:#fff;
  --text:#17202d;
  --muted:#8b95a4;
  --line:#e6eaf0;
  --blue:#23436d;
}

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  width:100%;
  height:100%;
  overflow:hidden;
}

body{
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:13px;
}

button,
input,
select,
textarea{
  font:inherit;
}

button{
  cursor:pointer;
  border:0;
  transition:.15s;
}

button:hover{
  opacity:.85;
}

.workspace{
  width:100%;
  height:100dvh;
  padding:28px 42px;
  overflow:hidden;
}

.view{
  width:100%;
  height:100%;
  max-width:1500px;
  margin:auto;
  display:flex;
  flex-direction:column;
  min-height:0;
}

.hidden{
  display:none!important;
}

h1{
  font-size:27px;
  letter-spacing:-1px;
  margin:0 0 6px;
  font-weight:700;
}

h2{
  font-size:18px;
  letter-spacing:-.5px;
  margin:0 0 6px;
}

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

.eyebrow{
  font-size:10px;
  color:#9ba5b3;
  font-weight:700;
  letter-spacing:1.3px;
  margin-bottom:8px;
}

.primary{
  background:var(--blue);
  color:#fff;
  padding:11px 18px;
  border-radius:8px;
  font-weight:600;
  white-space:nowrap;
}

.secondary{
  background:#fff;
  border:1px solid #dfe3e9;
  color:#465267;
  padding:10px 16px;
  border-radius:8px;
  font-weight:600;
  white-space:nowrap;
}

.list-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:24px;
  flex-shrink:0;
}

.search-wrap{
  margin-bottom:16px;
  flex-shrink:0;
}

.search-wrap input{
  width:100%;
  background:#fff;
  border:1px solid var(--line);
  border-radius:9px;
  padding:13px 16px;
  outline:none;
}

.list-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  flex:1;
  min-height:0;
}

.list-head,
.list-row{
  display:grid;
  grid-template-columns:110px 1.7fr 1.3fr 110px 125px;
  gap:20px;
  align-items:center;
  padding:15px 22px;
}

.list-head{
  background:#fafbfc;
  color:#9aa3b0;
  font-size:10px;
  font-weight:700;
  letter-spacing:.6px;
  flex-shrink:0;
}

.list-body{
  overflow-y:auto;
  min-height:0;
  scrollbar-width:thin;
}

.list-row{
  border-top:1px solid var(--line);
  cursor:pointer;
  min-height:68px;
}

.list-row:hover{
  background:#fafbfd;
}

.folio{
  font-weight:700;
  color:var(--blue);
}

.row-main{
  font-weight:600;
}

.row-sub{
  color:var(--muted);
  font-size:11px;
  margin-top:5px;
}

.badge{
  display:inline-block;
  padding:6px 10px;
  border-radius:5px;
  background:#edf3fb;
  color:#43628c;
  font-size:10px;
  font-weight:700;
}

.badge.generated{
  background:#eaf7f0;
  color:#299468;
}

.badge.cancelled{
  background:#fcebec;
  color:#c3444b;
}

.empty{
  padding:70px;
  text-align:center;
  color:var(--muted);
}

.form-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:18px;
  flex-shrink:0;
}

.back{
  background:none;
  color:#8792a2;
  padding:0;
}

.form-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.form-actions #saveStatus{
  color:#8b95a4;
  font-size:11px;
  margin-right:10px;
}

.form-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:20px;
  flex-shrink:0;
}

.form-heading h1{
  margin:0;
  font-size:25px;
}

.status-pill{
  background:#edf3fb;
  color:#43628c;
  padding:8px 13px;
  border-radius:20px;
  font-size:10px;
  font-weight:700;
}

.stepper{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:20px;
  gap:5px;
  flex-shrink:0;
}

.step{
  display:flex;
  align-items:center;
  gap:9px;
  cursor:pointer;
  color:#a1aab7;
  font-size:11px;
  font-weight:600;
  white-space:nowrap;
}

.step-circle{
  width:27px;
  height:27px;
  border:1px solid #dce1e8;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#fff;
  font-size:11px;
}

.step.active{
  color:var(--blue);
}

.step.active .step-circle{
  background:var(--blue);
  color:#fff;
  border-color:var(--blue);
}

.step.done .step-circle{
  background:#eaf2ed;
  color:#299468;
  border-color:#eaf2ed;
}

.step-line{
  height:1px;
  background:#e1e5eb;
  flex:1;
  margin:0 10px;
}

.form-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:26px 34px 0;
  display:flex;
  flex-direction:column;
  flex:1;
  min-height:0;
  overflow:hidden;
}

.step-content{
  flex:1;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  scrollbar-width:thin;
  padding-right:5px;
}

.section-heading{
  margin-bottom:22px;
}

.section-heading h2{
  font-size:18px;
  margin:0 0 6px;
}

.fields{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:18px 24px;
  padding-bottom:15px;
}

.field.full{
  grid-column:1/-1;
}

.field label{
  display:block;
  font-size:11px;
  font-weight:600;
  color:#566174;
  margin-bottom:8px;
}

.field input,
.field select,
.field textarea{
  width:100%;
  border:1px solid #e1e5eb;
  border-radius:7px;
  padding:11px 12px;
  color:var(--text);
  outline:none;
  background:#fff;
  font-size:12px;
}

.field input:focus,
.field textarea:focus,
.field select:focus{
  border-color:#7892b5;
  box-shadow:0 0 0 3px #eef3fa;
}

.field textarea{
  min-height:58px;
  resize:none;
}

.field input::placeholder{
  color:#b5bdc8;
}

.catalog-input-wrap{
  position:relative;
}

.catalog-input-wrap::after{
  content:"⌄";
  position:absolute;
  right:13px;
  top:50%;
  transform:translateY(-50%);
  color:#8d98a8;
  font-size:15px;
  pointer-events:none;
}

.catalog-input-wrap input{
  padding-right:36px;
}

.catalog-floating{
  position:fixed;
  display:none;
  z-index:99999;
  background:#fff;
  border:1px solid #d9dfe8;
  border-radius:9px;
  box-shadow:0 16px 45px rgba(20,35,55,.18);
  max-height:260px;
  overflow-y:auto;
  scrollbar-width:thin;
}

.catalog-floating.open{
  display:block;
}

.catalog-option{
  width:100%;
  display:flex;
  align-items:center;
  gap:14px;
  padding:12px 14px;
  background:#fff;
  border:0;
  border-bottom:1px solid #edf0f4;
  text-align:left;
}

.catalog-option:last-child{
  border-bottom:0;
}

.catalog-option:hover{
  background:#f4f7fa;
  opacity:1;
}

.catalog-code{
  flex:0 0 90px;
  font-size:11px;
  font-weight:700;
  color:var(--blue);
}

.catalog-description{
  flex:1;
  font-size:11px;
  color:#4f5b6d;
  line-height:1.35;
}

.catalog-empty{
  padding:15px;
  color:#9aa3b0;
  font-size:11px;
  text-align:center;
}

.form-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-top:1px solid var(--line);
  padding:16px 0;
  flex-shrink:0;
  background:#fff;
}

.form-footer span{
  font-size:11px;
  color:#a1aab7;
}

.review-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
  padding-bottom:15px;
}

.review-block{
  background:#f8f9fb;
  border-radius:9px;
  padding:18px;
}

.review-block h3{
  font-size:12px;
  margin:0 0 13px;
  color:var(--blue);
}

.review-line{
  display:flex;
  justify-content:space-between;
  gap:15px;
  margin:9px 0;
  font-size:11px;
}

.review-line span:first-child{
  color:#9aa3b0;
}

.review-line span:last-child{
  text-align:right;
  font-weight:600;
}

.modal{
  position:fixed;
  inset:0;
  background:rgba(20,30,45,.35);
  display:grid;
  place-items:center;
  z-index:100000;
  padding:20px;
}

.modal-card{
  width:100%;
  max-width:420px;
  background:#fff;
  border-radius:15px;
  padding:30px;
  box-shadow:0 20px 70px rgba(0,0,0,.12);
}

.modal-icon{
  width:38px;
  height:38px;
  background:#eef2f7;
  color:var(--blue);
  border-radius:10px;
  display:grid;
  place-items:center;
  font-size:20px;
  margin-bottom:20px;
}

.modal-card h2{
  font-size:21px;
  margin-bottom:8px;
}

.modal-card p{
  margin-bottom:25px;
}

.modal-card label{
  display:block;
  font-size:11px;
  font-weight:600;
  margin-bottom:9px;
}

.modal-card input{
  width:100%;
  border:1px solid #dfe3e9;
  border-radius:8px;
  padding:13px;
  outline:none;
  font-size:14px;
  text-transform:uppercase;
}

.modal-card input:focus{
  border-color:#7892b5;
}

.modal-error{
  color:#c3444b;
  font-size:11px;
  min-height:18px;
  margin-top:7px;
}

.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:15px;
}

@media(max-height:750px){
  .workspace{
    padding:18px 32px;
  }

  .form-top{
    margin-bottom:12px;
  }

  .form-heading{
    margin-bottom:14px;
  }

  .stepper{
    margin-bottom:14px;
  }

  .form-card{
    padding:20px 26px 0;
  }

  .section-heading{
    margin-bottom:15px;
  }

  .fields{
    gap:13px 20px;
  }

  .field textarea{
    min-height:48px;
  }

  .form-footer{
    padding:12px 0;
  }
}

@media(max-width:800px){
  .workspace{
    padding:18px;
  }

  .step{
    font-size:0;
  }

  .step-circle{
    font-size:11px;
  }

  .step-line{
    margin:0 3px;
  }

  .form-card{
    padding:20px 18px 0;
  }

  .fields,
  .review-grid{
    grid-template-columns:1fr;
  }

  .field.full{
    grid-column:1;
  }

  .list-head,
  .list-row{
    grid-template-columns:90px 1fr 90px;
    gap:10px;
  }

  .list-head span:nth-child(3),
  .list-head span:nth-child(5),
  .list-row>div:nth-child(3),
  .list-row>div:nth-child(5){
    display:none;
  }
}
