/* =========================================================
   Giatot – STYLE SYSTEM (B2B RFQ)
   Clean • Trust • Fast • Responsive
========================================================= */

/* ---------- Reset + base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.5;
  color: #0b1220;
  background: #f6f7fb;
  padding: 10px;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ---------- Tokens ---------- */
:root{
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #fbfcff;
  --text: #0b1220;
  --muted: #667085;
  --line: #e6eaf2;

  --primary: #1b5cff;
  --primary-2: #2dd4bf;
  --danger: #ef4444;
  --success: #16a34a;
  --warning: #f59e0b;

  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 14px 40px rgba(15, 23, 42, 0.10);
  --radius: 18px;
  --radius-sm: 14px;

  --container: 1140px;
}

/* ---------- Layout helpers ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 18px;
}

.section { padding: 34px 0; }
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-title h2 { margin: 0; font-size: 22px; letter-spacing: -0.2px; }
.small { font-size: 13px; color: var(--muted); }

/* ---------- Navbar ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 247, 251, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
}
.logo {
  width: auto;
  height: 34px;
}
.menu {
  display: flex;
  align-items: center;
  gap: 18px;
}
.menu a {
  font-weight: 650;
}
.menu a:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 850;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 14px 34px rgba(27, 92, 255, 0.22);
}
.btn-primary:hover { box-shadow: 0 18px 46px rgba(27, 92, 255, 0.28); }
.btn-ghost {
  background: rgba(27, 92, 255, 0.06);
  border-color: rgba(27, 92, 255, 0.18);
  color: #0b1220;
}
.btn-ghost:hover { background: rgba(27, 92, 255, 0.09); }
.btn-light {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}
.btn-light:hover { box-shadow: var(--shadow-sm); }
.btn-sm { padding: 10px 12px; border-radius: 12px; font-weight: 850; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-soft {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

/* ---------- Grid ---------- */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 920px){
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .menu { display: none; } /* MVP: ẩn menu trên mobile, sau này làm hamburger */
}

/* ---------- Hero ---------- */
.hero {
  padding: 48px 0 22px;
}
.hero-wrap {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
  align-items: stretch;
}
.hero-card {
  border-radius: calc(var(--radius) + 6px);
  padding: 24px;
  background:
    radial-gradient(900px 400px at 15% 10%, rgba(27,92,255,.22), transparent 60%),
    radial-gradient(900px 380px at 85% 40%, rgba(45,212,191,.16), transparent 55%),
    #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}
.hero h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.06;
  letter-spacing: -0.8px;
}
.hero p {
  margin: 14px 0 18px;
  color: var(--muted);
  font-size: 16px;
  max-width: 60ch;
}
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 18px; }
.pill {
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #0b1220;
  background: rgba(27,92,255,.06);
  border: 1px solid rgba(27,92,255,.14);
}

.hero-side {
  border-radius: calc(var(--radius) + 6px);
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Hero responsive */
@media (max-width: 920px){
  .hero-wrap { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
}

/* ---------- Search bar ---------- */
.search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(11,18,32,.02);
}
.search input, .search select {
  flex: 1;
  min-width: 220px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
}
.search input:focus, .search select:focus {
  border-color: rgba(27,92,255,.35);
  box-shadow: 0 0 0 4px rgba(27,92,255,.10);
}

/* ---------- Category cards ---------- */
.cat {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.cat-icon{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(27,92,255,.06);
  border: 1px solid rgba(27,92,255,.14);
  font-size: 18px;
}
.cat-name { font-weight: 950; }
.cat-desc { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ---------- Steps ---------- */
.step-num {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 950;
  background: rgba(27,92,255,.10);
  border: 1px solid rgba(27,92,255,.20);
}
.step h3 { margin: 10px 0 6px; font-size: 16px; }
.step p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

/* ---------- Badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.badge {
  font-size: 12px;
  font-weight: 800;
  padding: 7px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(11,18,32,.02);
  color: var(--muted);
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  gap: 12px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px){
  .form-grid { grid-template-columns: 1fr; }
}
label { font-weight: 750; font-size: 13px; color: #0b1220; }
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  outline: none;
  font-size: 14px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  border-color: rgba(27,92,255,.35);
  box-shadow: 0 0 0 4px rgba(27,92,255,.10);
}
.help { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- Tables (Admin) ---------- */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.table th, .table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f7;
  font-size: 14px;
  vertical-align: top;
}
.table th {
  text-align: left;
  background: #fbfcff;
  font-weight: 900;
  color: #101828;
}
.table tr:hover td { background: #fcfdff; }

/* ---------- Footer ---------- */
.footer {
  padding: 22px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 12px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
@media (max-width: 920px){
  .footer-grid { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}

/* ---------- Utilities ---------- */
.m0 { margin: 0; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }
.muted { color: var(--muted); }
.bold { font-weight: 900; }
.center { text-align: center; }

/* =========================
   RESPONSIVE ADD-ON
========================= */

/* Fluid type */
h1 { font-size: clamp(28px, 3.2vw, 44px); }
h2 { font-size: clamp(18px, 2.1vw, 24px); }

/* Better grids on various widths */
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1100px){
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 920px){
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px){
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Hero */
@media (max-width: 920px){
  .hero { padding: 30px 0 14px; }
  .hero-wrap { grid-template-columns: 1fr; }
}

/* Search form stacks nicely */
@media (max-width: 640px){
  .search { gap: 10px; }
  .search input, .search select { min-width: 0; width: 100%; flex: 1 1 100%; }
  .search .btn { width: 100%; }
}

/* Buttons: full width on small screens */
@media (max-width: 520px){
  .btn { width: 100%; }
}

/* Card padding smaller on mobile */
@media (max-width: 520px){
  .card { padding: 14px; border-radius: 16px; }
  .hero-card, .hero-side { padding: 16px; }
}

/* Admin table scroll on mobile */
.table-wrap{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}
.table { min-width: 980px; }

/* =========================
   MOBILE NAV (Hamburger + Drawer)
========================= */

.hamburger{
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.hamburger span{
  display:block;
  width: 18px;
  height: 2px;
  background: #101828;
  border-radius: 999px;
}

@media (max-width: 920px){
  .menu{ display: none; }
  .hamburger{ display: inline-flex; }
}

/* Overlay + Drawer */
.nav-overlay{
  position: fixed;
  inset: 0;
  background: rgba(11,18,32,.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
  z-index: 99;
}
.nav-drawer{
  position: fixed;
  top: 0; right: 0;
  width: min(86vw, 360px);
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: 0 22px 70px rgba(15,23,42,.18);
  transform: translateX(100%);
  transition: transform .18s ease;
  z-index: 100;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-open .nav-overlay{
  opacity: 1;
  pointer-events: auto;
}
.nav-open .nav-drawer{
  transform: translateX(0);
}

.drawer-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 6px 6px 10px;
  border-bottom: 1px solid var(--line);
}
.drawer-links{
  display:flex;
  flex-direction:column;
  gap: 6px;
  padding: 10px 6px;
}
.drawer-links a{
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 850;
  color: #101828;
}
.drawer-links a:hover{
  background: #fbfcff;
}
.drawer-cta{
  margin-top: auto;
  display:flex;
  flex-direction:column;
  gap: 10px;
  padding: 6px;
}
.user-credits{
  display: flex;
  align-items: center;
  gap: 6px;
}