[v-cloak] { display: none; }

:root {
  --bg: #f4f6f8;
  --card: #fff;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d8dee6;
  --brand: #176f5b;
  --brand-dark: #105846;
  --danger: #d92d20;
  --danger-dark: #b42318;
  --soft: #eef7f4;
}

* { box-sizing: border-box; }

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

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

button {
  height: 34px;
  padding: 0 12px;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

button:hover { background: var(--brand-dark); }
button:disabled { cursor: not-allowed; opacity: .5; }
button.danger { background: var(--danger); }
button.danger:hover { background: var(--danger-dark); }
button.plain { color: var(--ink); background: #eef1f4; }

input, select, textarea {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
}

textarea {
  min-height: 110px;
  padding: 10px;
  resize: vertical;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 210px;
  padding: 18px 14px;
  background: #172026;
}

.sidebar h1 {
  margin: 0 0 18px;
  color: #fff;
  font-size: 20px;
}

.sidebar button {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  color: #cbd5df;
  text-align: left;
  background: transparent;
}

.sidebar button.active,
.sidebar button:hover {
  color: #fff;
  background: var(--brand);
}

.main {
  margin-left: 210px;
  padding: 18px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f4f6f8 0%, #e9f3ef 100%);
}

.login-box {
  width: min(380px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .12);
}

.login-box h1 {
  margin: 0 0 4px;
  font-size: 22px;
}

.login-box p {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

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

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

.topbar h2 {
  margin: 0;
  font-size: 22px;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel {
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.toolbar.wrap {
  flex-wrap: wrap;
}

.toolbar input {
  max-width: 320px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.pagination button {
  height: 30px;
  padding: 0 10px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tabs button {
  color: var(--ink);
  background: #eef1f4;
}

.tabs button.active {
  color: #fff;
  background: var(--brand);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.stats article {
  padding: 18px;
  background: var(--soft);
  border-radius: 8px;
}

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

.stats b {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.gap-top { margin-top: 16px; }

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

th, td {
  padding: 11px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: #fafbfc;
}

tr:last-child td { border-bottom: 0; }
td.wide {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions {
  display: flex;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
}

.badge.ok {
  color: #067647;
  background: #dcfae6;
}

.badge.off {
  color: #b42318;
  background: #fee4e2;
}

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

.span-2 { grid-column: span 2; }

.draw-form {
  display: grid;
  grid-template-columns: 160px 150px minmax(260px, 1fr) 140px auto auto;
  gap: 10px;
  align-items: end;
}

.draw-form .draw-numbers input {
  min-width: 240px;
}

.stack {
  display: grid;
  gap: 14px;
}

.settings-form {
  max-width: 760px;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.date-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.native-date-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.support-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 380px;
  gap: 14px;
}

.section-tools {
  display: inline-flex;
  gap: 6px;
}

.banner-thumb {
  display: block;
  width: 92px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.chat-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.broadcast-box {
  grid-column: 2;
}

.chat-box h3 {
  margin: 0;
  font-size: 16px;
}

.messages {
  min-height: 240px;
  max-height: 340px;
  overflow: auto;
  padding: 10px;
  background: #f8fafb;
  border-radius: 6px;
}

.messages p {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff;
}

.messages p span {
  display: block;
}

.messages p b {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.messages p.service b {
  color: rgba(255, 255, 255, .78);
}

.messages img {
  display: block;
  max-width: 220px;
  max-height: 240px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.messages p.service {
  color: #fff;
  background: var(--brand);
}

.admin-image-picker {
  display: inline-grid;
  place-items: center;
  width: 92px;
  height: 36px;
  color: var(--brand);
  background: #eef7f4;
  border: 1px solid #cfe5dc;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.admin-image-picker input {
  display: none;
}

.admin-image-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-image-preview img {
  width: 68px;
  height: 68px;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.banner-preview img {
  width: 180px;
  height: 90px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .42);
}

.modal {
  width: min(680px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 18px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, .22);
}

.modal.large {
  width: min(940px, 100%);
}

.modal header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal h3 {
  margin: 0;
  font-size: 18px;
}

.modal pre {
  overflow: auto;
  max-height: 58vh;
  padding: 12px;
  background: #f4f6f8;
  border-radius: 6px;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .sidebar h1 { display: none; }
  .sidebar button { min-width: 92px; text-align: center; }
  .main { margin-left: 0; padding: 12px; }
  .stats { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .draw-form { grid-template-columns: 1fr; }
  .draw-form .draw-numbers input { min-width: 0; }
  .span-2 { grid-column: span 1; }
  .support-grid { grid-template-columns: 1fr; }
  .broadcast-box { grid-column: auto; }
}
