:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #16a34a;
  --primary-hover: #15803d;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --warn: #d97706;
  --warn-hover: #b45309;
  --idle: #9ca3af;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 600;
}

.logo {
  font-size: 22px;
}

.stats {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

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

.stat-value {
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-unit {
  color: var(--muted);
  font-size: 12px;
}

.rate-control input {
  width: 64px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.btn-reset-day {
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.15s;
}

.btn-reset-day:hover {
  background: #f9fafb;
  color: var(--text);
  border-color: #d1d5db;
}

.btn-settlement {
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}

.btn-settlement:hover {
  background: #f0fdf4;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-attendance {
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}

.btn-attendance:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #2563eb;
}

.btn-bead {
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}

.btn-bead:hover {
  background: #fdf4ff;
  color: #a21caf;
  border-color: #a21caf;
}

.desks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 16px 20px;
}

.desk {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.desk.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

.desk.ended {
  border-color: #6b7280;
  background: #f9fafb;
  opacity: 0.85;
}

.desk.flash {
  animation: flash-highlight 1.2s ease-out;
}

@keyframes flash-highlight {
  0%, 100% { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
  20% { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.4); }
}

.desk.expired {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
  animation: pulse-danger 1.2s ease-in-out infinite;
}

@keyframes pulse-danger {
  0%, 100% { box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.35); }
}

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

.desk-no {
  font-weight: 700;
  font-size: 15px;
}

.desk-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--idle);
}

.desk-status.active {
  background: rgba(22, 163, 74, 0.12);
  color: var(--primary);
}

.desk-time {
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
  text-align: center;
  margin: 4px 0;
}

.desk.active .desk-time {
  color: var(--primary);
}

.alert-bar {
  position: sticky;
  top: 60px;
  z-index: 9;
  background: linear-gradient(90deg, #fef2f2, #fee2e2);
  border-bottom: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  animation: pulse-bg 1.5s ease-in-out infinite;
}

.alert-bar[hidden] {
  display: none;
}

.alert-bar .alert-icon {
  font-size: 18px;
}

.alert-bar .alert-text {
  flex: 1;
}

.alert-bar .alert-text .desk-link {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  padding: 1px 8px;
  border-radius: 4px;
  margin: 0 2px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.alert-bar .alert-text .desk-link:hover {
  background: #b91c1c;
}

.alert-bar .alert-hint {
  color: #7f1d1d;
  font-size: 12px;
  font-weight: 400;
}

@keyframes pulse-bg {
  0%, 100% { background: linear-gradient(90deg, #fef2f2, #fee2e2); }
  50% { background: linear-gradient(90deg, #fee2e2, #fecaca); }
}

.desk-cost {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.desk-cost.overtime {
  color: var(--danger);
  font-weight: 700;
}

.desk-cost.free {
  color: var(--muted);
  font-size: 12px;
}

.desk-started-at {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  min-height: 14px;
}

.desk-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}

.desk-actions button {
  display: none;
}

.desk[data-status="idle"] .btn-start,
.desk[data-status="active"] .btn-end,
.desk[data-status="active"] .btn-restart,
.desk[data-status="ended"] .btn-restart-new {
  display: block;
}

.btn-start,
.btn-restart-new {
  grid-column: 1 / -1;
}

.desk-remaining {
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-height: 16px;
  color: var(--muted);
}

.desk-remaining.countdown {
  color: var(--warn);
  font-weight: 600;
}

.desk-remaining.overtime {
  color: var(--danger);
  font-weight: 700;
}

.desk-actions button {
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s;
}

.desk-actions button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

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

.btn-start:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-end {
  background: var(--danger);
  color: #fff;
}

.btn-end:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn-restart {
  background: var(--warn);
  color: #fff;
}

.btn-restart:hover:not(:disabled) {
  background: var(--warn-hover);
}

.btn-restart-new {
  background: #0891b2;
  color: #fff;
}

.btn-restart-new:hover:not(:disabled) {
  background: #0e7490;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-mask[hidden] {
  display: none;
}

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 320px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-title {
  margin: 0 0 4px;
  font-size: 17px;
}

.modal-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

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

.modal-options .opt {
  padding: 14px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.12s;
}

.modal-options .opt:hover {
  border-color: var(--primary);
  background: #f0fdf4;
}

.modal-options .opt-unlimited {
  grid-column: 1 / -1;
  background: #fef3c7;
  border-color: #fde68a;
  color: var(--warn);
}

.modal-options .opt-unlimited:hover {
  background: #fde68a;
  border-color: var(--warn);
}

.modal-options .opt-test {
  grid-column: 1 / -1;
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: var(--muted);
  font-size: 13px;
  padding: 10px 8px;
}

.modal-options .opt-test:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: var(--text);
}

.desk-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.desk-package {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(22, 163, 74, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.desk-package:empty {
  display: none;
}

.modal-cancel {
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.modal-cancel:hover {
  background: #f9fafb;
}

.modal-details {
  width: 360px;
}

.details-list {
  margin: 0 0 8px;
  padding: 0;
}

.details-list .detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}

.details-list .detail-row dt {
  color: var(--muted);
  font-weight: 400;
}

.details-list .detail-row dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.details-list .detail-row.total {
  border-bottom: none;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 2px solid var(--border);
  font-size: 16px;
}

.details-list .detail-row.total dt,
.details-list .detail-row.total dd {
  color: var(--primary);
  font-weight: 700;
}

.day-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
  max-width: 400px;
}

.stats-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.stats-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.stat-row.total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  color: var(--primary);
}

.stats-empty {
  color: var(--muted);
  font-size: 13px;
  grid-column: 1 / -1;
  text-align: center;
  padding: 16px;
}

.history-hint {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 8px;
}

.history-list li {
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.history-list li:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.history-list li::after {
  content: '›';
  color: var(--muted);
  font-size: 18px;
  margin-left: 8px;
}

.modal-settlement {
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.settlement-summary {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.settlement-summary .sum-item {
  display: flex;
  flex-direction: column;
}

.settlement-summary .sum-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 2px;
}

.settlement-summary .sum-value {
  font-weight: 700;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.settlement-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 32px 0;
}

.settlement-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.settlement-list li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  font-size: 13px;
}

.settlement-list .d-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}

.settlement-list .d-date {
  font-weight: 700;
  font-size: 15px;
}

.settlement-list .d-revenue {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

.settlement-list .d-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settlement-list .d-section {
  font-size: 12px;
}

.settlement-list .d-section h4 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settlement-list .d-pkg-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-variant-numeric: tabular-nums;
}

.settlement-list .d-pkg-row .pkg-count {
  color: var(--muted);
}

.settlement-list .d-fee-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-variant-numeric: tabular-nums;
}

.settlement-list .d-fee-row .fee-amount {
  font-weight: 600;
}

.settlement-list .d-fee-row.total .fee-amount {
  color: var(--primary);
}

.history {
  padding: 16px 20px 40px;
  max-width: 800px;
  margin: 0 auto;
}

.history h2 {
  font-size: 15px;
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 600;
}

.history-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 0;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.history-list .h-meta {
  color: var(--muted);
  font-size: 12px;
}

.history-list .h-cost {
  font-weight: 700;
  color: var(--primary);
}

@media (max-width: 640px) {
  .topbar {
    padding: 10px 12px;
  }
  .stats {
    gap: 12px;
  }
  .stat-value {
    font-size: 16px;
  }
  .desks {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    padding: 12px;
    gap: 8px;
  }
  .desk-time {
    font-size: 22px;
  }
}

/* ----- 账号条（auth.js 渲染，所有页面共用） ----- */

.account-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.account-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}

.account-btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.account-avatar {
  font-size: 14px;
}

.account-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.account-caret {
  color: var(--muted);
  font-size: 11px;
}

.account-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 60;
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-menu[hidden] {
  display: none;
}

.account-menu button {
  border: none;
  background: none;
  text-align: left;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.account-menu button:hover {
  background: #f3f4f6;
}

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

.account-menu button.danger:hover {
  background: #fef2f2;
}

/* ----- 修改密码弹窗（auth.js 渲染） ----- */

.modal-auth {
  width: 320px;
}

.auth-modal-sub {
  margin-bottom: 4px;
}

.auth-modal-sub span {
  font-weight: 600;
  color: var(--text);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}

.auth-form input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.auth-error {
  font-size: 13px;
  color: var(--danger);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 8px 10px;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.auth-submit {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-submit:hover {
  background: var(--primary-hover);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-admin {
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}

.btn-admin:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #2563eb;
}

.btn-admin[hidden] {
  display: none;
}

.btn-move {
  background: #0891b2;
  color: #fff;
}

.btn-move:hover:not(:disabled) {
  background: #0e7490;
}

.desk[data-status="active"] .btn-move {
  display: block;
}

.modal-move {
  width: 380px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.move-hint {
  margin: 6px 0 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.move-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
  flex: 1;
}

.move-opt {
  padding: 10px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: all 0.15s;
}

.move-opt:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0fdf4;
}

.move-none {
  grid-column: 1 / -1;
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .move-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

#reset-admin-pwd-label[hidden] {
  display: none;
}

.btn-extend {
  background: #7c3aed;
  color: #fff;
}

.btn-extend:hover:not(:disabled) {
  background: #6d28d9;
}

.desk[data-status="active"] .btn-extend {
  display: block;
}

.desk[data-status="active"][data-unlimited] .btn-extend {
  display: none;
}

.extend-current {
  margin: 6px 0 12px;
  font-size: 13px;
  color: var(--muted);
  background: #f9fafb;
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.6;
}

/* ----- 桌位设置按钮 / 自动结算横幅 / 过期横幅 ----- */

.btn-desk-setting {
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}

.btn-desk-setting:hover {
  background: #fefce8;
  color: #a16207;
  border-color: #a16207;
}

.settle-banner {
  position: sticky;
  top: 62px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 13px;
}

.settle-banner[hidden] {
  display: none;
}

.settle-banner-close {
  margin-left: auto;
  border: none;
  background: none;
  color: #1d4ed8;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}

.settle-banner-close:hover {
  background: #dbeafe;
}

.expired-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 20px;
  margin: 16px 20px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  color: var(--danger);
  font-size: 15px;
  font-weight: 600;
}

.expired-banner[hidden] {
  display: none;
}

.desk-no {
  cursor: default;
}

.btn-billing-setting {
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}

.btn-billing-setting:hover {
  background: #fff7ed;
  color: #c2410c;
  border-color: #c2410c;
}

/* ----- 统一设置弹窗 ----- */

.btn-settings {
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}

.btn-settings:hover {
  background: #f5f3ff;
  color: #7c3aed;
  border-color: #7c3aed;
}

.modal-settings {
  width: 360px;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}

.settings-form input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
}

.settings-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.settings-hint {
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.5;
}

.settings-foot {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--muted);
  background: #f9fafb;
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.6;
}

/* ----- 统一自定义弹窗（替换系统 alert/confirm/prompt） ----- */

.ui-dialog-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: ui-fade-in 0.16s ease-out;
}

.ui-dialog-mask[hidden] {
  display: none;
}

.ui-dialog {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  padding: 26px 24px 20px;
  text-align: center;
  animation: ui-pop-in 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes ui-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ui-pop-in {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ui-dialog-icon {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 12px;
}

.ui-dialog-icon-only {
  margin-bottom: 10px;
}

.ui-dialog-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.ui-dialog-message {
  margin: 0 0 18px;
  font-size: 14px;
  color: #4b5563;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.ui-dialog-body {
  margin-bottom: 18px;
}

.ui-dialog-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ui-dialog-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.ui-dialog-actions {
  display: flex;
  gap: 10px;
}

.ui-dialog-actions .ui-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}

.ui-dialog-actions .ui-btn:active {
  transform: scale(0.96);
}

.ui-btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.ui-btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.4);
}

.ui-btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.32);
}

.ui-btn-danger:hover {
  background: var(--danger-hover);
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.38);
}

.ui-btn-default {
  background: #f3f4f6;
  color: var(--text);
}

.ui-btn-default:hover {
  background: #e5e7eb;
}

/* ----- 顶栏按钮圆润化（统一覆盖） ----- */

.topbar .btn-settlement,
.topbar .btn-attendance,
.topbar .btn-reset-day,
.topbar .btn-admin,
.topbar .btn-settings,
.account-btn,
.ad-header .ad-btn {
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 500;
  border-width: 1.5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.18s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.topbar .btn-settlement:active,
.topbar .btn-attendance:active,
.topbar .btn-reset-day:active,
.topbar .btn-admin:active,
.topbar .btn-settings:active,
.account-btn:active,
.ad-header .ad-btn:active {
  transform: scale(0.95);
}

.topbar .btn-settlement:hover,
.topbar .btn-attendance:hover,
.topbar .btn-reset-day:hover,
.topbar .btn-admin:hover,
.topbar .btn-settings:hover,
.account-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 结算今日：主操作，用实底胶囊 */
.topbar .btn-reset-day {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.35);
}

.topbar .btn-reset-day:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 5px 14px rgba(245, 158, 11, 0.45);
}

/* 其他页面头部按钮同样处理 */
.a-header .a-refresh,
.s-header .s-refresh {
  border-radius: 999px;
  padding: 6px 14px;
  transition: all 0.18s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.a-header .a-refresh:active,
.s-header .s-refresh:active {
  transform: scale(0.95);
}

/* ----- 弹窗表单按钮统一等宽胶囊 ----- */

.auth-actions {
  gap: 12px;
}

.auth-actions .modal-cancel,
.auth-actions .auth-submit {
  flex: 1;
  width: auto;
  margin-top: 0;
  padding: 10px 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 0.16s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.auth-actions .modal-cancel {
  background: #f3f4f6;
  border: none;
  color: var(--text);
  box-shadow: none;
}

.auth-actions .modal-cancel:hover {
  background: #e5e7eb;
}

.auth-actions .modal-cancel:active,
.auth-actions .auth-submit:active {
  transform: scale(0.96);
}

/* ----- 门店切换器 ----- */

.brand-shop { display: flex; flex-direction: column; gap: 4px; }

.store-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  transition: all 0.15s;
}

.store-switcher:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0fdf4;
}

.store-caret { font-size: 10px; }

.store-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.store-menu[hidden] { display: none; }

.store-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: none;
  background: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}

.store-menu-item:hover { background: #f3f4f6; }

.store-menu-item.active {
  background: #f0fdf4;
  color: var(--primary);
  font-weight: 600;
}

.store-menu-rename {
  font-size: 14px;
  opacity: 0.6;
  padding: 2px 6px;
  border-radius: 6px;
}

.store-menu-rename:hover {
  opacity: 1;
  background: #fef2f2;
}

.store-menu-add {
  border: none;
  border-top: 1px solid var(--border);
  background: none;
  text-align: left;
  padding: 12px;
  border-radius: 0 0 8px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.store-menu-add:hover { background: #f0fdf4; }

.brand { position: relative; }

/* 结算/打卡页门店下拉 */
.s-store-select, .a-store-select {
  padding: 5px 12px;
  border: 1.5px solid var(--primary);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: #f0fdf4;
  cursor: pointer;
  outline: none;
}

/* ICP 备案信息（管局要求首页底部展示，链接工信部） */
.icp-footer {
  padding: 18px 0 22px;
  text-align: center;
  font-size: 12px;
}

.icp-footer a {
  color: #9ca3af;
  text-decoration: none;
}

.icp-footer a:hover {
  color: #6b7280;
  text-decoration: underline;
}
