:root {
  --portal-green: #a17e34;
  --portal-green-soft: #fbf8f0;
  --portal-navy: #1e1e1e;
  --portal-bg: #f3f4f6;
  --portal-card: #ffffff;
  --portal-border: #e5e7eb;
  --portal-text: #111827;
  --portal-muted: #6b7280;
  --portal-radius: 14px;
  --portal-rail: 220px;
  --font-body: "Questrial", system-ui, sans-serif;
  --font-display: "Readex Pro", "Questrial", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--portal-text); background: var(--portal-bg); }
a { color: var(--portal-navy); text-decoration: none; }
button, input, select { font: inherit; }
.portal-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 0; border-radius: 10px; padding: .7rem 1rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.portal-btn--primary { background: var(--portal-green); color: #fff; }
.portal-btn--primary:hover { filter: brightness(.95); }
.portal-btn--block { width: 100%; }
.portal-btn--xs { padding: .28rem .7rem; font-size: .82rem; border-radius: 999px; }
.portal-muted { color: var(--portal-muted); }
.portal-link { font-size: .9rem; color: var(--portal-green); font-weight: 600; }
.portal-auth-page { min-height: 100%; background: linear-gradient(160deg, #f8fafc, #fbf8f0 55%, #fff); }
.portal-login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 480px) 1fr; }
.portal-login__panel { display: flex; flex-direction: column; justify-content: center; padding: 2.5rem; background: rgba(255,255,255,.94); }
.portal-login__brand { display: inline-flex; align-items: center; gap: .75rem; color: inherit; font-family: var(--font-display); font-weight: 700; margin-bottom: 2rem; text-decoration: none; }
.portal-login__brand img { height: 42px; width: auto; }
.portal-login h1 { font-family: var(--font-display); font-size: 1.85rem; margin: 0 0 .5rem; }
.portal-login__panel > p { margin: 0 0 1.5rem; color: var(--portal-muted); }
.portal-login__form { display: grid; gap: 1rem; }
.portal-login__form label { display: grid; gap: .4rem; }
.portal-login__form span { font-size: .9rem; color: var(--portal-muted); }
.portal-login__form input { border: 1px solid var(--portal-border); border-radius: 10px; padding: .8rem .9rem; background: #fff; width: 100%; }
.portal-login__form input:focus { outline: 2px solid rgba(161,126,52,.25); border-color: var(--portal-green); }
.portal-password { position: relative; display: block; }
.portal-password input { padding-right: 2.75rem; }
.portal-password__toggle { position: absolute; top: 50%; right: .45rem; transform: translateY(-50%); width: 2rem; height: 2rem; border: 0; border-radius: 8px; background: transparent; color: var(--portal-muted); cursor: pointer; }
.portal-field-error { color: #b91c1c; font-size: .85rem; }
.portal-login__aside { position: relative; background: #1e1e1e url("/assets/images/bg-login.jpg") center/cover no-repeat; }
.portal-login__aside::before { content: ""; position: absolute; inset: 0; background: rgba(38,26,1,.62); }
.portal-login__aside-inner { position: absolute; inset: auto 10% 12% 10%; color: #fff; max-width: 420px; }
.portal-login__aside-inner strong { font-family: var(--font-display); font-size: 1.6rem; display: block; margin-bottom: .6rem; }
.portal-app { height: 100vh; height: 100dvh; overflow: hidden; display: grid; grid-template-columns: var(--portal-rail) minmax(0, 1fr); }
.portal-rail { background: #fff; border-right: 1px solid var(--portal-border); padding: .75rem .55rem; display: flex; flex-direction: column; gap: .55rem; height: 100vh; height: 100dvh; overflow: hidden; }
.portal-rail__brand { display: flex; align-items: center; gap: .45rem; font-family: var(--font-display); font-weight: 700; font-size: .92rem; color: var(--portal-navy); text-decoration: none; padding: .2rem .4rem .45rem; border-bottom: 1px solid var(--portal-border); }
.portal-rail__brand img { height: 26px; width: auto; }
.portal-rail__nav { display: grid; gap: .15rem; flex: 1; align-content: start; }
.portal-rail__nav a, .portal-rail__foot > a, .portal-rail__foot button { display: flex; align-items: center; gap: .55rem; min-height: 34px; padding: .35rem .5rem; border-radius: 8px; color: #4b5563; font-size: .88rem; text-decoration: none; background: transparent; border: 0; width: 100%; text-align: left; cursor: pointer; }
.portal-rail__nav a i, .portal-rail__foot > a i, .portal-rail__foot button i { width: 1.05rem; text-align: center; }
.portal-rail__nav a.is-active, .portal-rail__foot > a.is-active { background: var(--portal-green-soft); color: var(--portal-green); font-weight: 700; }
.portal-rail__nav a:hover, .portal-rail__foot > a:hover, .portal-rail__foot button:hover { background: #f3f4f6; color: var(--portal-navy); }
.portal-rail__foot { display: grid; gap: .1rem; border-top: 1px solid var(--portal-border); padding-top: .45rem; margin-top: auto; }
.portal-rail__user { display: flex; align-items: center; gap: .45rem; margin-top: .35rem; padding: .4rem .45rem; border-radius: 8px; background: #f8fafc; min-width: 0; }
.portal-rail__user-meta { min-width: 0; }
.portal-rail__user strong, .portal-rail__user small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-rail__user strong { font-size: .78rem; }
.portal-rail__user small { color: var(--portal-muted); font-size: .7rem; }
.portal-avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #f3e8d4; color: #5a4311; font-weight: 700; font-size: .7rem; flex: 0 0 auto; }
.portal-main { min-width: 0; height: 100vh; height: 100dvh; overflow: auto; }
.portal-page { padding: 1.25rem 1.5rem 2rem; }
.portal-card { background: #fff; border: 1px solid var(--portal-border); border-radius: var(--portal-radius); padding: 1.15rem 1.25rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.portal-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.portal-card__head h2 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; }
.portal-orders__sub { margin: .25rem 0 0; font-size: .88rem; }
.portal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 0 0 1rem; }
.portal-stats > div { display: grid; gap: .2rem; padding-right: 1rem; border-right: 1px solid var(--portal-border); }
.portal-stats > div:last-child { border-right: 0; }
.portal-stats span { color: var(--portal-muted); font-size: .85rem; }
.portal-stats strong { font-family: var(--font-display); font-size: 1.35rem; }
.portal-orders__filters { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin: 0 0 1rem; }
.portal-orders__search { display: flex; align-items: center; gap: .45rem; flex: 1 1 220px; min-width: 180px; background: #f3f4f6; border-radius: 10px; padding: .45rem .7rem; color: var(--portal-muted); }
.portal-orders__search input, .portal-orders__filters select { border: 0; background: transparent; outline: none; width: 100%; color: var(--portal-text); }
.portal-orders__filters select { border: 1px solid var(--portal-border); border-radius: 10px; background: #fff; padding: .5rem .7rem; min-width: 160px; }
.portal-orders__filters .portal-btn { padding: .5rem .9rem; }
.portal-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.portal-table-wrap { overflow-x: auto; }
.portal-table { width: 100%; border-collapse: collapse; min-width: 860px; }
.portal-table th, .portal-table td { text-align: left; padding: .85rem .4rem; border-bottom: 1px solid var(--portal-border); vertical-align: middle; }
.portal-table th { color: var(--portal-muted); font-weight: 600; font-size: .88rem; }
.portal-table .portal-num { text-align: right; white-space: nowrap; }
.portal-th-sub { display: block; font-weight: 500; font-size: .75rem; color: #9ca3af; }
.portal-order-id { font-weight: 700; }
.portal-col-product { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-date-stack, .portal-status-stack { display: grid; gap: .2rem; justify-items: start; }
.portal-date-stack small { color: var(--portal-muted); font-size: .8rem; }
.portal-goods-thumb { position: relative; display: inline-flex; width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: #f3f4f6; border: 1px solid var(--portal-border); }
.portal-goods-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-goods-thumb span { position: absolute; right: 2px; bottom: 2px; background: rgba(17,24,39,.72); color: #fff; font-size: .65rem; font-weight: 700; border-radius: 6px; padding: 0 .28rem; }
.portal-empty { text-align: center; color: var(--portal-muted); padding: 1.5rem !important; }
.portal-status { display: inline-flex; align-items: center; gap: .4rem; padding: .22rem .65rem; border-radius: 999px; border: 1px solid currentColor; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.portal-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.portal-status.is-success { color: #15803d; background: #f0fdf4; }
.portal-status.is-danger { color: #b91c1c; background: #fef2f2; }
.portal-status.is-info { color: #1d4ed8; background: #eff6ff; }
.portal-status.is-warn { color: #b45309; background: #fffbeb; }
.portal-status.is-muted { color: #4b5563; background: #f9fafb; }
.portal-pay { font-size: .8rem; font-weight: 700; }
.portal-pay.is-paid { color: #15803d; }
.portal-pay.is-unpaid { color: #b45309; }
.portal-pager { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .9rem; }
.portal-pager a, .portal-pager span { min-width: 34px; height: 34px; padding: 0 .55rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--portal-border); border-radius: 8px; background: #fff; color: var(--portal-text); font-weight: 600; font-size: .88rem; }
.portal-pager .is-active { background: var(--portal-green); border-color: var(--portal-green); color: #fff; }
.portal-dl { margin: 0; display: grid; gap: .85rem; }
.portal-dl > div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: .75rem; }
.portal-dl dt { margin: 0; color: var(--portal-muted); }
.portal-dl dd { margin: 0; font-weight: 600; }
@media (max-width: 900px) {
  .portal-app { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .portal-main, .portal-rail { height: auto; overflow: visible; }
  .portal-rail { border-right: 0; border-bottom: 1px solid var(--portal-border); }
  .portal-rail__nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .portal-rail__nav a { justify-content: center; flex-direction: column; font-size: .75rem; text-align: center; }
  .portal-stats, .portal-dl > div { grid-template-columns: 1fr; }
  .portal-stats > div { border-right: 0; border-bottom: 1px solid var(--portal-border); padding-bottom: .7rem; }
  .portal-login { grid-template-columns: 1fr; }
  .portal-login__aside { display: none; }
}
