/* ============================================================
   Xưởng May MK — Admin / Bảng điều khiển
   Shared styling for login + list pages
   Builds on assets/styles.css design tokens
   ============================================================ */

.admin-body { background: var(--bg-2); min-height: 100vh; }

/* ---------------- LOGIN ---------------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(0,145,230,.10), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(0,145,230,.08), transparent 55%),
    var(--bg-2);
}
.login-card {
  width: 100%;
  max-width: 408px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-lg);
  padding: 40px 38px 34px;
}
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 30px; }
.login-brand img { width: 46px; height: 46px; object-fit: contain; }
.login-brand b { font-size: 19px; font-weight: 900; letter-spacing: -.02em; color: var(--ink); display: block; line-height: 1.1; }
.login-brand span { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; color: var(--blue-600); text-transform: uppercase; }
.login-card h1 { font-size: 25px; margin-bottom: 7px; }
.login-card .sub { font-size: 14.5px; color: var(--muted); margin-bottom: 26px; }

.afield { margin-bottom: 16px; }
.afield label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.afield .inp { position: relative; display: flex; align-items: center; }
.afield .inp svg { position: absolute; left: 15px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.afield input {
  width: 100%; font-family: inherit; font-size: 15px; color: var(--ink);
  padding: 13px 15px 13px 44px; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); background: var(--bg-2); outline: none; transition: .15s;
}
.afield input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(0,145,230,.1); }
.pw-toggle { position: absolute; right: 6px; background: none; border: none; padding: 8px; color: var(--muted); display: grid; place-items: center; border-radius: 8px; }
.pw-toggle:hover { color: var(--ink); background: var(--bg-2); }
.afield .inp .pw-toggle svg { position: static; left: auto; pointer-events: auto; width: 18px; height: 18px; }

.login-err {
  display: none; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: #C0421E;
  background: var(--accent-soft); border: 1px solid #F6CFC2;
  padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 16px;
}
.login-err.show { display: flex; }
.login-err svg { width: 17px; height: 17px; flex: none; }

.login-card .btn-block { margin-top: 6px; }
.login-hint { margin-top: 18px; font-size: 12.5px; color: var(--muted); text-align: center; }
.login-hint code { font-family: ui-monospace, Menlo, monospace; background: var(--bg-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; color: var(--ink-2); font-weight: 600; }

/* ---------------- ADMIN SHELL ---------------- */
.admin-shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }

.aside {
  position: sticky; top: 0; align-self: start;
  height: 100vh; display: flex; flex-direction: column;
  background: var(--ink); color: #C3D3E2; padding: 22px 16px;
}
.aside-brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 22px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 16px; }
.aside-brand img { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; }
.aside-brand b { font-size: 15.5px; font-weight: 800; color: #fff; line-height: 1.15; display: block; }
.aside-brand span { font-size: 10px; font-weight: 800; letter-spacing: .15em; color: #5FC7F0; text-transform: uppercase; }

.aside-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #6E869C; padding: 6px 12px 10px; }
.aside-nav { display: flex; flex-direction: column; gap: 4px; }
.anav {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-sm);
  font-size: 14.5px; font-weight: 700; color: #C3D3E2; transition: .14s;
}
.anav svg { width: 19px; height: 19px; flex: none; color: #8AA0B5; transition: .14s; }
.anav .badge { margin-left: auto; font-size: 12px; font-weight: 800; background: rgba(255,255,255,.1); color: #fff; padding: 2px 9px; border-radius: var(--r-pill); }
.anav:hover { background: rgba(255,255,255,.06); color: #fff; }
.anav:hover svg { color: #fff; }
.anav.active { background: var(--blue); color: #fff; box-shadow: 0 8px 20px rgba(0,114,204,.4); }
.anav.active svg { color: #fff; }
.anav.active .badge { background: rgba(255,255,255,.22); }

.aside-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.aside-user { display: flex; align-items: center; gap: 11px; padding: 8px 12px 14px; }
.aside-user .av { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; }
.aside-user .nm { font-size: 13.5px; font-weight: 700; color: #fff; line-height: 1.2; }
.aside-user .rl { font-size: 11.5px; color: #8AA0B5; }
.logout-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  color: #C3D3E2; font-size: 13.5px; font-weight: 700; transition: .14s;
}
.logout-btn:hover { background: rgba(255,106,61,.16); border-color: rgba(255,106,61,.4); color: #FFB59E; }
.logout-btn svg { width: 17px; height: 17px; }

/* ---------------- MAIN ---------------- */
.main { padding: 30px 38px 60px; min-width: 0; }
.main-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.main-head h1 { font-size: 28px; margin-bottom: 6px; }
.main-head .lead { font-size: 14.5px; color: var(--muted); }

/* stat strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--sh-sm); }
.stat .k { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.stat .k svg { width: 15px; height: 15px; color: var(--blue-600); }
.stat .v { font-size: 28px; font-weight: 900; letter-spacing: -.02em; color: var(--ink); line-height: 1; }
.stat .v small { font-size: 15px; font-weight: 700; color: var(--muted); }

/* toolbar */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.asearch { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.asearch svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.asearch input { width: 100%; font-family: inherit; font-size: 14.5px; color: var(--ink); padding: 11px 14px 11px 42px; border: 1.5px solid var(--line); border-radius: var(--r-pill); background: #fff; outline: none; transition: .15s; }
.asearch input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,145,230,.1); }
.seg { display: flex; gap: 4px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 4px; }
.seg button { border: none; background: none; padding: 7px 15px; border-radius: var(--r-pill); font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-2); transition: .14s; }
.seg button:hover { color: var(--blue-600); }
.seg button.active { background: var(--blue); color: #fff; }

/* table card */
.tcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-sm); overflow: hidden; }
.atable { width: 100%; border-collapse: collapse; table-layout: fixed; }
.atable thead th:nth-child(1) { width: 23%; }
.atable thead th:nth-child(2) { width: 16%; }
.atable thead th:nth-child(3) { width: 17%; }
.atable thead th:nth-child(4) { width: 22%; }
.atable thead th:nth-child(5) { width: 16%; }
.atable thead th:nth-child(6) { width: 6%; }
.atable thead th { text-align: left; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2); white-space: nowrap; }
.atable tbody tr.row { border-bottom: 1px solid var(--line-2); transition: background .12s; cursor: pointer; }
.atable tbody tr.row:last-child { border-bottom: none; }
.atable tbody tr.row:hover { background: var(--sky-2); }
.atable tbody tr.row.open { background: var(--sky-2); }
.atable td { padding: 15px 18px; font-size: 14px; color: var(--ink-2); vertical-align: middle; }

.cust { display: flex; align-items: center; gap: 11px; }
.cust .av { width: 36px; height: 36px; border-radius: 50%; background: var(--sky); color: var(--blue-700); display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.cust .nm { font-weight: 700; color: var(--ink); line-height: 1.25; }
.cust .cust-ph { font-size: 12.5px; color: var(--muted); }

/* inline stars */
.starline { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.starline .sx { display: inline-flex; gap: 1px; }
.starline svg { width: 15px; height: 15px; }
.starline svg.f { fill: #FFB020; color: #FFB020; }
.starline svg.e { fill: none; color: #D5DEE7; }
.starline .num { font-size: 13px; font-weight: 800; color: var(--ink); margin-left: 3px; }

.qbig { font-weight: 800; color: var(--ink); }
.qbig small { font-weight: 600; color: var(--muted); }
.snip { max-width: 320px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.time { white-space: nowrap; color: var(--muted); font-size: 13px; }
.chev { width: 20px; height: 20px; color: var(--muted); transition: transform .2s ease; }
tr.row.open .chev { transform: rotate(180deg); color: var(--blue-600); }

/* status chips */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 5px 11px; border-radius: var(--r-pill); white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.st.new   { background: var(--sky); color: var(--blue-700); }
.st.new::before { background: var(--blue); }
.st.contacted { background: #FFF3E0; color: #B5641A; }
.st.contacted::before { background: #F2A03D; }
.st.quoted { background: var(--green-soft); color: #0E7A53; }
.st.quoted::before { background: var(--green); }
.st.closed { background: var(--bg-3); color: var(--muted); }
.st.closed::before { background: var(--muted); }

/* expand detail row */
tr.detail > td { padding: 0; border-bottom: 1px solid var(--line-2); background: var(--bg-2); }
.detail-inner { padding: 22px 26px 26px; display: none; }
tr.detail.open .detail-inner { display: block; }
.detail-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; }
.det-block h4 { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

/* sub-rating breakdown */
.subr { display: flex; flex-direction: column; gap: 9px; }
.subr .r { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.subr .r .lbl { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

/* feedback comment */
.fb-comment { font-size: 14.5px; color: var(--ink); line-height: 1.6; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: var(--r-sm); padding: 16px 18px; }

/* spec list (quotes) */
.spec { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 14px; }
.spec dt { color: var(--muted); font-weight: 600; }
.spec dd { margin: 0; color: var(--ink); font-weight: 700; }
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { font-size: 12.5px; font-weight: 700; background: var(--sky); color: var(--blue-700); padding: 5px 11px; border-radius: var(--r-pill); }
.sizes-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sizebox { display: flex; flex-direction: column; align-items: center; min-width: 52px; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; background: #fff; }
.sizebox .s { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .04em; }
.sizebox .q { font-size: 16px; font-weight: 900; color: var(--ink); }
.files { display: flex; flex-direction: column; gap: 7px; }
.filechip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 11px; }
.filechip svg { width: 15px; height: 15px; color: var(--blue-600); flex: none; }

.det-actions { display: flex; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.det-actions .btn { padding: 11px 18px; font-size: 14px; }

.empty { padding: 60px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--line); margin-bottom: 12px; }
.empty p { font-size: 15px; }

@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .aside { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; }
  .aside-brand { border: none; margin: 0; padding: 0; }
  .aside-label { display: none; }
  .aside-nav { flex-direction: row; flex: 1; }
  .anav { padding: 9px 13px; }
  .anav .badge { margin-left: 8px; }
  .aside-foot { margin: 0; padding: 0; border: none; }
  .aside-user { display: none; }
  .main { padding: 22px 20px 50px; }
  .col-hide { display: none; }
}
