:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --line:#e5e7eb;
  --text:#0f172a;
  --muted:#64748b;
  --primary:#2563eb;
  --primary-dark:#1d4ed8;
  --danger:#dc2626;
  --success:#16a34a;
  --shadow:0 10px 30px rgba(15,23,42,.08);
  --radius:18px;
}

* { box-sizing: border-box; }

body{
  margin:0;
  background:
    radial-gradient(circle at top right, #dbeafe 0%, transparent 30%),
    radial-gradient(circle at top left, #e0f2fe 0%, transparent 25%),
    var(--bg);
  font-family: Tahoma, Arial, sans-serif;
  color:var(--text);
}

.page{
  max-width:1100px;
  margin:32px auto;
  padding:16px;
}

.hero{
  background:linear-gradient(135deg,#0f172a,#1e3a8a);
  color:#fff;
  border-radius:24px;
  padding:24px;
  box-shadow:var(--shadow);
  margin-bottom:20px;
}

.hero h1{
  margin:0 0 10px;
  font-size:clamp(22px,4vw,34px);
}

.hero p{
  margin:0;
  color:rgba(255,255,255,.85);
  line-height:1.9;
  font-size:14px;
}

.grid{
  display:grid;
  grid-template-columns: 1.3fr .7fr;
  gap:20px;
  align-items:start;
}

.card{
  background:var(--card);
  border:1px solid rgba(255,255,255,.5);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.card-header{
  padding:18px 20px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.card-header h2{
  margin:0;
  font-size:18px;
}

.card-body{
  padding:18px;
}

.products{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.product-item{
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  background:#fbfdff;
  position:relative;
}

.product-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
  gap:10px;
  flex-wrap:wrap;
}

.product-title{
  font-weight:700;
  color:#0f172a;
  font-size:15px;
}

.fields{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:12px;
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

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

label{
  font-size:13px;
  color:var(--muted);
  font-weight:700;
}

input, select{
  width:100%;
  border:1px solid var(--line);
  background:#fff;
  border-radius:12px;
  padding:12px 14px;
  font-size:14px;
  outline:none;
  transition:.2s ease;
  color:var(--text);
}

input:focus, select:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 4px rgba(37,99,235,.08);
}

.hint{
  font-size:12px;
  color:var(--muted);
  line-height:1.7;
}

.item-price-box{
  margin-top:14px;
  border-top:1px dashed var(--line);
  padding-top:12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.price-badge{
  background:#eff6ff;
  color:#1d4ed8;
  padding:10px 12px;
  border-radius:12px;
  font-size:13px;
  font-weight:700;
}

.btn{
  border:none;
  border-radius:12px;
  padding:12px 16px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  transition:.2s ease;
}

.btn-primary{
  background:var(--primary);
  color:#fff;
}

.btn-primary:hover{
  background:var(--primary-dark);
}

.btn-light{
  background:#eef2ff;
  color:#1e3a8a;
}

.btn-light:hover{
  background:#dbeafe;
}

.btn-danger{
  background:#fef2f2;
  color:var(--danger);
}

.btn-danger:hover{
  background:#fee2e2;
}

.sidebar{
  position:sticky;
  top:16px;
}

.summary-box{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.summary-stat{
  background:linear-gradient(180deg,#ffffff,#f8fbff);
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
}

.summary-label{
  color:var(--muted);
  font-size:13px;
  margin-bottom:6px;
}

.summary-value{
  font-size:24px;
  font-weight:800;
  color:#0f172a;
}

.summary-sub{
  font-size:13px;
  color:var(--muted);
  margin-top:6px;
  line-height:1.8;
}

.actions{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.policy{
  background:#f8fafc;
  border:1px dashed #cbd5e1;
  border-radius:14px;
  padding:14px;
  font-size:13px;
  line-height:1.9;
  color:#334155;
}

.policy strong{
  color:#0f172a;
}

.stepper{
  display:flex;
  align-items:center;
  gap:8px;
}

.stepper button{
  width:42px;
  min-width:42px;
  height:42px;
  border:none;
  border-radius:10px;
  background:#eef2ff;
  color:#1e3a8a;
  font-size:20px;
  font-weight:700;
  cursor:pointer;
  flex-shrink:0;
}

.stepper button:hover{
  background:#dbeafe;
}

.stepper input{
  text-align:center;
  padding:10px;
}

.add-product-wrap{
  margin-top:16px;
}

.add-product-wrap .btn{
  width:100%;
}

/* Modal */
.modal{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.5);
  display:none;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:1000;
}

.modal.show{
  display:flex;
}

.modal-content{
  width:min(920px,100%);
  max-height:90vh;
  overflow:auto;
  background:#fff;
  border-radius:22px;
  box-shadow:0 20px 60px rgba(0,0,0,.2);
  animation:fadeIn .2s ease;
}

@keyframes fadeIn{
  from{opacity:0; transform:translateY(10px);}
  to{opacity:1; transform:translateY(0);}
}

.modal-header{
  padding:18px 20px;
  border-bottom:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.modal-body{
  padding:18px 20px 24px;
}

.close-btn{
  background:#f1f5f9;
  color:#0f172a;
}

.preview-list{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.preview-item{
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px;
  background:#fcfdff;
}

.preview-item h3{
  margin:0 0 10px;
  font-size:16px;
}

.preview-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px 16px;
  font-size:14px;
}

.preview-grid div{
  background:#f8fafc;
  padding:10px 12px;
  border-radius:12px;
}

.total-box{
  margin-top:18px;
  background:linear-gradient(135deg,#eff6ff,#dbeafe);
  border:1px solid #bfdbfe;
  padding:18px;
  border-radius:18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.empty-note{
  text-align:center;
  padding:20px;
  color:var(--muted);
  border:1px dashed #cbd5e1;
  border-radius:14px;
  background:#f8fafc;
}

@media (max-width: 900px){
  .grid{
    grid-template-columns:1fr;
  }

  .sidebar{
    position:static;
  }
}

@media (max-width: 640px){
  .page{
    margin:16px auto;
    padding:12px;
  }

  .hero{
    padding:18px;
    border-radius:18px;
  }

  .card-body, .card-header, .modal-header, .modal-body{
    padding:14px;
  }

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

  .btn{
    width:100%;
  }

  .product-top{
    align-items:stretch;
  }

  .product-top .btn-danger{
    width:100%;
  }

  .stepper button{
    width:44px;
    min-width:44px;
    height:44px;
  }
}
