:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --line: #dde5f0;
  --text: #101828;
  --muted: #667085;
  --blue: #2563eb;
  --yellow: #f6b819;
  --red: #d92d20;
  --green: #06945f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 0;
  border-radius: 8px;
  background: var(--yellow);
  color: #111827;
  cursor: pointer;
  font-weight: 700;
  min-height: 40px;
  padding: 0 18px;
}

button.secondary {
  background: #eaf0f7;
}

button.ghost {
  background: transparent;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 30px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.brand,
.eyebrow {
  color: #8a4b12;
  font-size: 14px;
  font-weight: 800;
}

h1,
h2,
p {
  margin: 0;
}

.login-card h1 {
  font-size: 30px;
}

.login-card p {
  color: var(--muted);
}

.dashboard {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.topbar h1 {
  font-size: 30px;
}

.top-actions,
.filters,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stats div,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.stats div {
  display: grid;
  gap: 8px;
  padding: 20px;
}

.stats span {
  color: var(--muted);
  font-weight: 600;
}

.stats strong {
  font-size: 30px;
}

.panel {
  overflow: hidden;
}

.filters {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.filters input {
  max-width: 520px;
}

.filters select {
  max-width: 180px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

td {
  font-size: 14px;
}

.order-no {
  font-size: 16px;
  font-weight: 800;
}

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

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.status.pending {
  background: #fff4cc;
  color: #a15c00;
}

.status.confirmed {
  background: #dbeafe;
  color: #1d4ed8;
}

.status.ongoing {
  background: #ede9fe;
  color: #6d28d9;
}

.status.completed {
  background: #d1fae5;
  color: #047857;
}

.status.cancelled {
  background: #fee2e2;
  color: #b42318;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.row-actions button {
  min-height: 32px;
  padding: 0 10px;
}

dialog {
  width: min(760px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.order-form {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icon-btn {
  width: 38px;
  min-height: 38px;
  padding: 0;
  background: #eef2f7;
  font-size: 22px;
}

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

.dialog-actions {
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .topbar,
  .top-actions,
  .filters {
    align-items: stretch;
    flex-direction: column;
  }

  .stats,
  .grid {
    grid-template-columns: 1fr;
  }
}
