:root{
  --bg:#070a12;
  --panel:#0d1222;
  --panel2:#0b1020;
  --text:#eaf0ff;
  --muted:#9fb0d1;
  --line:#1e2a4d;
  --brand:#4f8dff;
  --brand2:#6ee7ff;
  --ok:#19c37d;
  --warn:#ffcc66;
  --radius:16px;
}

*{box-sizing:border-box}
html, body{
  width:100%;
  min-height:100%;
  overflow-x:hidden;
}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1000px 500px at 20% -10%, rgba(79,141,255,.22), transparent 60%),
              radial-gradient(900px 500px at 80% 0%, rgba(110,231,255,.14), transparent 55%),
              var(--bg);
  color:var(--text);
  background-attachment: scroll;
}

a{color:inherit}
.wrap{max-width:1120px;margin:0 auto;padding:0 16px}

/* TOPBAR */
.topbar{
  position:sticky; top:0; z-index:20;
  backdrop-filter: blur(10px);
  background: rgba(7,10,18,.65);
  border-bottom:1px solid rgba(30,42,77,.55);
}
.topbar-inner{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; padding:14px 0;
}
.brand{
  display:flex; align-items:center; gap:10px; text-decoration:none;
}
.logo{
  width:56px; height:56px;
  min-width:56px; min-height:56px;
  max-width:56px; max-height:56px;
  border-radius:50%;
  overflow:hidden;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:center;
}
.logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}
.brand h1{font-size:16px;margin:0;letter-spacing:.4px}
.brand small{display:block;color:var(--muted);margin-top:2px;font-size:12px}

.actions{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.input{
  display:flex; align-items:center; gap:10px;
  background: rgba(13,18,34,.85);
  border:1px solid rgba(30,42,77,.9);
  border-radius:999px;
  padding:10px 12px;
  min-width: 260px;
}
.input input{
  width:100%;
  border:0; outline:none; background:transparent;
  color:var(--text); font-size:14px;
}
.pill{
  border:1px solid rgba(30,42,77,.9);
  background: rgba(13,18,34,.75);
  color:var(--text);
  padding:10px 12px;
  border-radius:999px;
  font-size:13px;
  cursor:pointer;
}
.pill:hover{border-color: rgba(79,141,255,.7)}

/* HERO */
.hero{
  margin:18px 0 14px;
  background: linear-gradient(135deg, rgba(79,141,255,.18), rgba(110,231,255,.10));
  border:1px solid rgba(30,42,77,.85);
  border-radius: var(--radius);
  overflow:hidden;
  position:relative;
}
.hero-inner{
  padding:18px;
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:14px;
}
.hero h2{margin:0 0 8px;font-size:22px}
.hero p{margin:0;color:var(--muted);line-height:1.5}
.hero .note{
  margin-top:10px;
  display:inline-flex; gap:8px; align-items:center;
  padding:8px 12px; border-radius:999px;
  background: rgba(13,18,34,.65);
  border:1px solid rgba(30,42,77,.8);
  font-size:13px; color: #d7e2ff;
}
.hero-card{
  border-radius: var(--radius);
  background: rgba(13,18,34,.75);
  border:1px solid rgba(30,42,77,.85);
  padding:14px;
}
.kpis{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.kpi{
  background: rgba(7,10,18,.35);
  border:1px solid rgba(30,42,77,.7);
  border-radius: 14px;
  padding:12px;
}
.kpi b{display:block;font-size:16px}
.kpi span{display:block;color:var(--muted);font-size:12px;margin-top:4px}

/* LIST */
.section-title{
  display:flex; align-items:end; justify-content:space-between;
  gap:10px;
  margin:16px 0 10px;
}
.section-title h3{margin:0;font-size:16px}
.section-title .sub{color:var(--muted);font-size:13px}

.grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:14px;
}

/* CARD */
.card{
  background: rgba(13,18,34,.78);
  border:1px solid rgba(30,42,77,.88);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.28);
}
.product{position:relative}
.thumb{
  width:100%;
  height:220px;              /* tăng chiều cao → cắt nhẹ */
  object-fit: cover;
  object-position: center;   /* trọng tâm giữa */
  display:block;
  border-bottom:1px solid rgba(30,42,77,.75);

}
.badge{
  position:absolute; top:12px; left:12px;
  padding:7px 10px; border-radius:999px;
  background: rgba(79,141,255,.22);
  border:1px solid rgba(79,141,255,.55);
  color:#dfe9ff;
  font-size:12px;
  backdrop-filter: blur(8px);
}
.body{padding:12px}
.pname{margin:0 0 6px;font-size:15px;line-height:1.25}
.desc{color:var(--muted);font-size:13px;min-height:34px}
.meta{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-top:10px}
.price{font-weight:800;font-size:16px}
.unit{color:var(--muted);font-weight:500;font-size:12px}

/* BUTTON */
.btnrow{display:flex;gap:10px;margin-top:12px}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius: 14px;
  text-decoration:none;
  border:1px solid rgba(79,141,255,.7);
  background: linear-gradient(135deg, rgba(79,141,255,.9), rgba(110,231,255,.55));
  color:#061022;
  font-weight:800;
  cursor:pointer;
}
.btn:hover{filter: brightness(1.05)}
.btn2{
  background: rgba(13,18,34,.65);
  border:1px solid rgba(30,42,77,.9);
  color: var(--text);
}
.btn2:hover{border-color: rgba(79,141,255,.7)}

/* FORM */
.form{
  padding:14px;
}
label{display:block;margin:10px 0 6px;color:#cfe0ff;font-size:13px}
input,select,textarea{
  width:100%;
  padding:12px 12px;
  border-radius: 14px;
  border:1px solid rgba(30,42,77,.95);
  background: rgba(7,10,18,.35);
  color:var(--text);
  outline:none;
}
input:focus,select:focus,textarea:focus{border-color: rgba(79,141,255,.75)}
.helper{margin-top:10px;color:var(--muted);font-size:13px}

/* TABLE */
.tablewrap{overflow:auto}
table{width:100%;border-collapse:collapse;min-width:960px}
th,td{padding:12px;border-bottom:1px solid rgba(30,42,77,.7);vertical-align:top}
th{font-size:12px;color:#cfe0ff;text-align:left;white-space:nowrap}
td{font-size:13px;color:#eaf0ff}

/* FOOTER */
.footer{
  margin:22px 0 28px;
  color:var(--muted);
  font-size:13px;
  text-align:center;
}

@media (max-width: 860px){
  .hero-inner{grid-template-columns:1fr}
  .input{min-width: 180px}
}

/* ================= MOBILE FIX (ONE BLOCK ONLY) ================= */
@media (max-width: 600px){

  /* wrapper full rộng */
  .wrap{
    width: 100%;
    max-width: 100%;
    padding: 0 12px;
  }

  /* topbar gọn lại */
  .topbar-inner{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
  }

  .logo{
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .actions{
    width: 100%;
    gap: 8px;
    justify-content: space-between;
  }

  .input{
    min-width: 0 !important;
    width: 100%;
  }

  /* form + card full rộng */
  .card{
    width: 100%;
    border-radius: 14px;
  }

  .form{
    padding: 12px !important;
  }

  form{
    width: 100%;
  }

  /* chống zoom + dễ bấm */
  input, select, textarea{
    font-size: 16px;
    padding: 14px 14px;
    border-radius: 14px;
  }

  label{
    font-size: 14px;
    margin-top: 12px;
  }

  .btn, .btn2{
    width: 100%;
    padding: 14px;
    font-size: 16px;
  }

  .btnrow{
    flex-direction: column;
  }

  table{ font-size: 13px; }
}

/* ===== FIX KHOẢNG TRỐNG DƯ DƯỚI MOBILE (ANDROID/IOS) ===== */
body{
  background-attachment: scroll !important;
}

/* iOS Safari */
@supports (-webkit-touch-callout: none) {
  body { min-height: -webkit-fill-available; }
}

/* ép trang order không bị kéo dài */
.order-page,
.order-page .wrap{
  min-height: auto !important;
}

/* chặn phần tử vô tình tạo khoảng trống */
.footer, .helper{
  margin-bottom: 0 !important;
}
