:root {
  --green: #1b6a57;
  --green-deep: #0e4a3d;
  --green-soft: #e7f2e9;
  --cream: #fbf4e4;
  --gold: #d5a46b;
  --orange: #e86f32;
  --ink: #23342e;
  --muted: #84938b;
  --line: #e8ede7;
  --bg: #f4f7f2;
  --white: #ffffff;
  --danger: #c9533e;
  --shadow: 0 10px 30px rgba(34, 73, 55, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }

/* ---------------- login ---------------- */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: #f7f7f1;
}

.login-art {
  position: relative;
  overflow: hidden;
  padding: 60px 64px;
  color: #f7f2e3;
  background:
    radial-gradient(circle at 86% 12%, rgba(255, 255, 255, 0.12), transparent 30%),
    radial-gradient(circle at 10% 90%, rgba(213, 164, 107, 0.2), transparent 36%),
    linear-gradient(135deg, #1f735e 0%, #0b4035 100%);
}

.login-art::after {
  content: "";
  position: absolute;
  right: -160px;
  bottom: -200px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #f6ead0;
  color: var(--green-deep);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
}

.brand-mark.small {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 20px;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
}

.brand-sub {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 2.4px;
  opacity: 0.6;
}

.login-art h1 {
  position: relative;
  z-index: 1;
  margin: 110px 0 20px;
  font-size: 46px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 2px;
}

.login-art p {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 390px;
  color: #bcd6ca;
  font-size: 15px;
  line-height: 1.9;
}

.login-stats {
  position: absolute;
  left: 64px;
  bottom: 56px;
  display: flex;
  gap: 42px;
  z-index: 1;
}

.login-stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-stats strong {
  font-size: 28px;
  color: #f3ddb5;
}

.login-stats span {
  font-size: 11px;
  color: #a9c9bb;
  letter-spacing: 1px;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-box {
  width: 100%;
  max-width: 390px;
  padding: 42px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(28, 69, 52, 0.1);
}

.login-title {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: 1px;
}

.login-desc {
  margin: 8px 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field > span {
  display: block;
  margin-bottom: 8px;
  color: #465a50;
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #f8faf6;
  border-radius: 11px;
  padding: 12px 14px;
  outline: none;
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(27, 106, 87, 0.08);
}

.form-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 12px;
  margin-bottom: 6px;
}

.login-hint {
  margin-top: 16px;
  color: #a5b0a9;
  font-size: 11px;
  text-align: center;
}

/* ---------------- app shell ---------------- */
.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 232px;
  padding: 24px 16px 18px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #123f35 0%, #0a3129 100%);
  color: #e9f3ed;
  z-index: 20;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.side-brand .brand-name { font-size: 17px; }
.side-brand .brand-sub { color: #89ab9c; }

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 10px;
  scrollbar-width: thin;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-group-title {
  padding: 0 10px 8px;
  color: #6f9585;
  font-size: 10px;
  letter-spacing: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 2px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #b9d1c6;
  font-size: 13px;
  text-align: left;
  transition: background 0.14s ease, color 0.14s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-weight: 600;
}

.nav-item .ico {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d5a46b;
  font-size: 13px;
}

.side-footer {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.side-link {
  display: block;
  padding: 7px 10px;
  color: #8fae9f;
  font-size: 11px;
}

.side-logout {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: transparent;
  color: #cfe0d7;
  font-size: 12px;
  text-align: left;
}

.main {
  margin-left: 232px;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: rgba(244, 247, 242, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(222, 231, 222, 0.8);
}

.page-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 1px;
}

.page-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

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

.server-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #53a67e;
  box-shadow: 0 0 0 4px rgba(83, 166, 126, 0.12);
}

.server-text {
  color: #7c8d83;
  font-size: 11px;
}

.admin-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.view {
  padding: 24px 32px 50px;
}

/* ---------------- buttons / tags ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--green);
  color: #fff;
}

.btn-ghost {
  border-color: #dbe5dd;
  background: #fff;
  color: #52685d;
}

.btn-danger {
  background: #fdf0ed;
  color: var(--danger);
  border-color: #f3d6d0;
}

.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

.btn-block { width: 100%; height: 44px; }

.icon-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #60756a;
  font-size: 13px;
}

.icon-btn.danger { color: var(--danger); border-color: #f0dad5; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 600;
}

.badge.gold { background: #fbf0de; color: #a9753d; }
.badge.red { background: #fdf0ed; color: var(--danger); }
.badge.gray { background: #eef1ed; color: #7c8b83; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-pending_pay { background: #fdf1e6; color: #c8742d; }
.status-pending_ship, .status-pending_service { background: #eaf3ee; color: #2d7a62; }
.status-pending_receive, .status-in_service { background: #e7f3ef; color: #237a62; }
.status-completed { background: #eef3ec; color: #64806f; }
.status-refund { background: #fdf0ed; color: #c9533e; }
.status-canceled { background: #f1f2ef; color: #8b9690; }

/* ---------------- cards / dashboard ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(27, 106, 87, 0.045);
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1px;
}

.stat-value {
  margin-top: 10px;
  font-size: 30px;
  font-weight: 700;
  color: #1c3d30;
  letter-spacing: 1px;
}

.stat-note {
  margin-top: 6px;
  font-size: 10px;
  color: #9aa79f;
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.9fr;
  gap: 16px;
  margin-top: 16px;
}

.panel {
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
}

.panel-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.panel-link {
  color: var(--green);
  font-size: 11px;
  font-weight: 600;
  background: none;
  border: none;
}

.recent-order {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f2f5f0;
}

.recent-order:last-child { border-bottom: none; }

.recent-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #edf4ee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.recent-main { flex: 1; min-width: 0; }
.recent-title { font-size: 12px; font-weight: 600; }
.recent-sub { margin-top: 3px; color: #93a098; font-size: 10px; }
.recent-amount { font-size: 13px; font-weight: 700; color: var(--orange); }

.status-bars { display: flex; flex-direction: column; gap: 12px; }
.status-bar-row { display: flex; align-items: center; gap: 10px; }
.status-bar-label { width: 70px; color: #5e7267; font-size: 11px; }
.status-bar-track { flex: 1; height: 7px; border-radius: 4px; background: #eef2ec; overflow: hidden; }
.status-bar-fill { height: 100%; border-radius: 4px; background: var(--green); }
.status-bar-num { width: 26px; text-align: right; color: #829087; font-size: 10px; }

/* ---------------- table ---------------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-input {
  width: 250px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #e2e9e2;
  border-radius: 999px;
  background: #fff;
  outline: none;
  font-size: 12px;
}

.search-input:focus { border-color: var(--green); }

.select-sm {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e2e9e2;
  border-radius: 9px;
  background: #fff;
  outline: none;
  color: #4d6358;
  font-size: 12px;
}

.table-card {
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

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

th {
  padding: 12px 16px;
  background: #f8faf6;
  color: #7c8d83;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-top: 1px solid #f1f4ef;
  color: #35493f;
  font-size: 12px;
  vertical-align: middle;
}

tbody tr:hover { background: #fbfcfa; }

.cell-main { font-weight: 600; color: #24382f; }
.cell-sub { margin-top: 3px; color: #9aa69f; font-size: 10px; }
.cell-money { font-weight: 700; color: var(--orange); white-space: nowrap; }
.cell-actions { display: flex; gap: 6px; }

.thumb {
  width: 42px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
  background: #f3f5f0;
  display: block;
}

.empty-row {
  padding: 50px 20px;
  text-align: center;
  color: #a3aea7;
  font-size: 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #f1f4ef;
  color: #8c9a93;
  font-size: 11px;
}

.pager-btns { display: flex; gap: 6px; }

/* ---------------- modal ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 50px 20px;
  overflow-y: auto;
  background: rgba(12, 38, 29, 0.46);
  backdrop-filter: blur(4px);
}

.modal {
  width: 100%;
  max-width: 760px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(10, 40, 28, 0.22);
  animation: pop 0.16s ease-out;
}

.modal.wide { max-width: 920px; }

@keyframes pop {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 0;
}

.modal-title { font-size: 17px; font-weight: 700; }
.modal-sub { margin-top: 4px; color: var(--muted); font-size: 10px; }

.modal-close {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: #f2f5f0;
  color: #708077;
  font-size: 18px;
  line-height: 1;
}

.modal-body { padding: 20px 24px; }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #f1f4ef;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}

.field.full { grid-column: 1 / -1; }

.field textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.field .hint { margin-top: 5px; color: #a1aca5; font-size: 10px; }

.image-field { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.image-field input { flex: 1 1 220px; min-width: 180px; }
.image-field .btn { flex-shrink: 0; }
.image-preview {
  width: 66px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f5f0;
  border: 1px solid var(--line);
}

.switch {
  position: relative;
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: #dce4de;
  transition: background 0.16s ease;
  cursor: pointer;
}

.switch.on { background: var(--green); }

.switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.16s ease;
}

.switch.on::after { transform: translateX(19px); }

/* ---------------- order detail ---------------- */
.detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.detail-box {
  padding: 16px;
  border-radius: 12px;
  background: #f8faf6;
}

.detail-box h4 {
  margin: 0 0 10px;
  font-size: 11px;
  color: #819087;
  font-weight: 600;
  letter-spacing: 1px;
}

.detail-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  font-size: 11px;
}

.detail-line span:first-child { color: #8b9991; }
.detail-line span:last-child { text-align: right; }

.order-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2ec;
}

.order-item-row:last-child { border-bottom: none; }
.order-item-row img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.order-item-main { flex: 1; min-width: 0; }
.order-item-name { font-size: 11px; font-weight: 600; }
.order-item-sub { margin-top: 2px; color: #97a39c; font-size: 9px; }
.order-item-price { font-size: 11px; font-weight: 700; color: var(--orange); }

.status-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------------- settings ---------------- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.settings-card {
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.settings-card.full { grid-column: 1 / -1; }
.settings-title { margin-bottom: 4px; font-size: 15px; font-weight: 700; }
.settings-sub { margin-bottom: 16px; color: var(--muted); font-size: 10px; }

.settings-card .field { margin-bottom: 12px; }

/* ---------------- toast ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 300;
  transform: translate(-50%, 14px);
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(18, 53, 42, 0.92);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .sidebar { width: 78px; padding: 18px 8px; }
  .side-brand > div:last-child, .nav-group-title, .nav-item span:not(.ico), .side-link { display: none; }
  .side-brand { justify-content: center; padding-bottom: 16px; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .main { margin-left: 78px; }
  .topbar { padding: 16px 20px; }
  .view { padding: 18px 20px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .server-text, .server-dot { display: none; }
}
