:root {
  font-family: Inter, Roboto, Arial, sans-serif;
  color-scheme: light;
  --bg: #f3f7fc;
  --surface: #ffffff;
  --ink: #10233f;
  --muted: #66758a;
  --line: #dbe4ef;
  --green: #12824a;
  --blue: #0b6bea;
  --amber: #d59118;
  --red: #c53030;
  --soft-blue: #eaf3ff;
  --soft-green: #eaf8f0;
  --soft-amber: #fff6df;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
select,
input,
textarea {
  font: inherit;
}

.phone {
  width: min(calc(100% - 16px), 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 12px 92px;
  display: grid;
  gap: 12px;
}

.hero {
  min-height: 230px;
  background:
    linear-gradient(rgba(6, 42, 91, 0.74), rgba(9, 96, 70, 0.7)),
    url("https://images.unsplash.com/photo-1488459716781-31db52582fe9?auto=format&fit=crop&w=900&q=80");
  background-size: cover;
  background-position: center;
  color: #fff;
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 16px;
  align-content: end;
  box-shadow: 0 16px 36px rgba(16, 35, 63, 0.14);
}

.hero span {
  color: #b8d9c8;
  font-size: 13px;
}

.hero p {
  max-width: 32ch;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  line-height: 1.45;
}

.hero-controls {
  display: grid;
  gap: 10px;
}

.mini-role-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.mini-role-switch button {
  min-height: 42px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.mini-role-switch button.active {
  background: #fff;
  color: #096446;
}

.hero-controls label {
  display: grid;
  gap: 6px;
  color: #b8d9c8;
  font-size: 13px;
  font-weight: 700;
}

.hero-controls select {
  width: 100%;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 17px;
}

p {
  color: var(--muted);
}

.home-banner {
  min-height: 208px;
  border-radius: 8px;
  padding: 18px;
  display: grid;
  align-content: end;
  gap: 18px;
  background:
    linear-gradient(155deg, rgba(13, 91, 87, 0.92), rgba(9, 64, 131, 0.82) 52%, rgba(130, 82, 20, 0.78)),
    url("https://images.unsplash.com/photo-1488459716781-31db52582fe9?auto=format&fit=crop&w=900&q=82");
  background-size: cover;
  background-position: center;
  color: #fff;
  box-shadow: 0 18px 42px rgba(16, 35, 63, 0.18);
}

.home-banner-copy {
  display: grid;
  gap: 8px;
}

.home-banner-copy span {
  color: #c9f0dd;
  font-size: 13px;
  font-weight: 800;
}

.home-banner-copy h2 {
  max-width: 12ch;
  font-size: 28px;
  line-height: 1.08;
}

.home-banner-copy p {
  max-width: 31ch;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  line-height: 1.45;
}

.home-banner-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.home-stat {
  min-height: 66px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

.home-stat strong,
.home-stat span {
  display: block;
}

.home-stat strong {
  color: #fff;
  font-size: 18px;
}

.home-stat span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.25;
}

.home-section {
  display: grid;
  gap: 12px;
}

.home-section .section-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.home-section .draft-state {
  white-space: normal;
}

.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.quick-action {
  min-height: 94px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 8px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(16, 35, 63, 0.06);
}

.quick-action:active {
  transform: translateY(1px);
}

.quick-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--soft-green);
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.quick-action:nth-child(2n) .quick-icon {
  background: var(--soft-blue);
  color: var(--blue);
}

.quick-action:nth-child(3n) .quick-icon {
  background: var(--soft-amber);
  color: #8a5700;
}

.quick-action span:last-child {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
}

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

.overview-card,
.news-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 7px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(16, 35, 63, 0.05);
}

.overview-card strong,
.overview-card span {
  display: block;
}

.overview-card strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.overview-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.overview-card p {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.news-list {
  display: grid;
  gap: 10px;
}

.news-card {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.news-card strong,
.news-card p {
  grid-column: 1 / -1;
}

.news-card strong {
  font-size: 15px;
}

.news-card p {
  font-size: 13px;
  line-height: 1.45;
}

.news-tag {
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  background: #edf6ff;
  color: #0950b8;
  font-size: 12px;
  font-weight: 800;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 10px 24px rgba(16, 35, 63, 0.06);
}

.mini-page[hidden] {
  display: none !important;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.draft-state {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.toast {
  min-height: 0;
}

.toast:not(:empty) {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f0f7ff;
  color: #074aa6;
  font-size: 14px;
  line-height: 1.4;
}

.toast.error {
  background: #ffe9e9;
  color: var(--red);
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.next-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfdfc;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.task-list {
  display: grid;
  gap: 10px;
}

.task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  background: #fbfdfc;
}

.task-card strong,
.task-card span {
  display: block;
}

.task-card strong {
  font-size: 15px;
}

.task-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.task-card button {
  min-width: 104px;
}

.task-card.priority-1 {
  border-color: #f3c5c5;
  background: #fff7f7;
}

.task-card.priority-2 {
  border-color: #ead39f;
  background: #fffaf0;
}

.task-card.done {
  border-color: #cce7d5;
  background: #f3fbf6;
}

.form {
  display: grid;
  gap: 10px;
}

.application-progress {
  display: grid;
  gap: 8px;
}

.application-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.application-progress-head strong {
  color: var(--ink);
}

.application-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ede9;
}

.application-progress-track div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.2s ease;
}

.application-step {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.application-step[hidden] {
  display: none;
}

.application-step legend {
  padding: 0 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.application-step label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.field-help,
.field-error {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 400;
}

.field-help {
  color: var(--muted);
}

.field-error {
  color: var(--red);
}

.field-error[hidden] {
  display: none;
}

.form-error {
  border: 1px solid #f3c5c5;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff7f7;
}

.review-summary {
  display: grid;
  gap: 8px;
}

.review-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  font-size: 14px;
}

.review-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.review-row span {
  color: var(--muted);
}

.application-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-note {
  margin: 0 0 10px;
  border-left: 3px solid var(--amber);
  padding: 8px 10px;
  border-radius: 6px;
  background: #fffaf0;
  color: #5f4208;
  font-size: 0.92rem;
  line-height: 1.4;
}

.delivery-fields {
  display: grid;
  gap: 10px;
}

.delivery-fields[hidden] {
  display: none;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.quick-picks {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.quick-picks button {
  min-height: 44px;
  padding: 0 8px;
}

.photo-guide {
  border: 1px solid #cfe4d7;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #f3fbf6;
}

.photo-guide-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.photo-guide-head strong {
  font-size: 15px;
}

.photo-guide-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.photo-examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.photo-example {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 6px;
  background: #fff;
}

.photo-example strong {
  font-size: 14px;
}

.photo-example p {
  font-size: 13px;
  line-height: 1.35;
}

.example-visual {
  min-height: 86px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #edf5f0;
  position: relative;
  overflow: hidden;
}

.example-visual span {
  width: 68%;
  height: 62px;
  border: 3px solid currentColor;
  border-radius: 6px;
  background: #fff;
  position: relative;
}

.example-visual span::before,
.example-visual span::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.35;
}

.example-visual span::before {
  top: 18px;
}

.example-visual span::after {
  top: 34px;
}

.example-visual.good {
  color: var(--green);
}

.example-visual.bad {
  color: var(--red);
  background: #fff3f3;
}

.example-visual.bad span {
  transform: rotate(-10deg);
}

.example-visual.bad::after {
  content: "";
  width: 120%;
  height: 12px;
  background: rgba(197, 48, 48, 0.2);
  transform: rotate(18deg);
  position: absolute;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
select,
textarea {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 82px;
  resize: vertical;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
}

button.secondary {
  background: #eef5ff;
  color: #0950b8;
}

button.danger {
  background: #ffe9e9;
  color: var(--red);
}

.button-link {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 12px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ede9;
}

.progress[aria-hidden="true"] {
  display: none;
}

.progress div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.2s ease;
}

.compact-panel {
  gap: 8px;
}

.sync-note {
  margin: 0;
  border: 1px solid #cfe4d7;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f3fbf6;
  color: #214c33;
  font-size: 14px;
  line-height: 1.4;
}

.queue-list {
  display: grid;
  gap: 8px;
}

.queue-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdfc;
}

.queue-item strong,
.queue-item span {
  display: block;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2f0;
  color: #314039;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status.APPROVED,
.status.ACTIVE,
.status.RESOLVED,
.status.COMPLETED,
.status.PAID,
.status.LOW,
.status.TOT {
  background: #e4f6eb;
  color: #0f6b35;
}

.status.SUBMITTED,
.status.CONFIRMED,
.status.READY,
.status.TRIAGED,
.status.ON_DINH {
  background: #e7f0ff;
  color: #074aa6;
}

.status.NEED_SUPPLEMENT,
.status.PREPARING,
.status.PARTIAL,
.status.PENDING,
.status.PLANNED,
.status.MEDIUM,
.status.HIGH,
.status.CAN_THEO_DOI {
  background: #fff3db;
  color: #7a4a00;
}

.status.REJECTED,
.status.CANCELED,
.status.WONT_FIX,
.status.CRITICAL,
.status.RUI_RO {
  background: #ffe9e9;
  color: var(--red);
}

.list {
  display: grid;
  gap: 10px;
}

.product {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.product-summary {
  justify-content: flex-start;
}

.product-thumb {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #f3f7f5;
  flex: 0 0 auto;
}

.product-card-actions {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.qr-share-box {
  border: 1px solid #cfe4d7;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 10px;
  background: #f3fbf6;
}

.qr-code-pill {
  min-height: 36px;
  margin-top: 4px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  word-break: break-word;
}

.qr-actions {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.document-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.document-actions button {
  min-height: 44px;
  white-space: nowrap;
}

.order-card,
.fee-card,
.score-card,
.cart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: #fbfdfc;
}

.score-trend {
  display: block;
  margin: 6px 0;
  border-left: 3px solid var(--green);
  padding: 6px 8px;
  border-radius: 8px;
  background: #f1f8f4;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.cart-item-actions {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
  align-items: center;
}

.cart-item-actions button {
  min-width: 48px;
}

.cart-quantity {
  min-height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
}

.order-side {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.order-side button {
  min-width: 128px;
}

.buyer-product {
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.buyer-product .actions {
  grid-column: 1 / -1;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.row-item {
  border-top: 1px solid var(--line);
  padding: 10px 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.row-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.row-item strong,
.row-item span {
  display: block;
}

.product strong {
  display: block;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(calc(100% - 16px), 430px);
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  box-shadow: 0 -12px 28px rgba(16, 35, 63, 0.1);
}

.tabs a {
  min-height: 58px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  padding: 0 4px;
  text-align: center;
}

.tabs a.active {
  color: var(--blue);
  background: var(--soft-blue);
}

@media (max-width: 360px) {
  .grid-2,
  .quick-picks,
  .quick-action-grid,
  .home-banner-stats,
  .photo-examples,
  .search-row,
  .actions,
  .application-actions,
  .review-row,
  .row,
  .buyer-product,
  .order-side,
  .row-item,
  .section-head,
  .task-card {
    grid-template-columns: 1fr;
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .task-card button {
    width: 100%;
  }
}
