﻿:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #dce3f0;
  --text: #223048;
  --muted: #69788f;
  --brand: #2f5ca8;
  --danger: #be3a3a;
  --ok: #2d8a4b;
}

* { box-sizing: border-box; }

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

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px 1fr;
}

.sidebar {
  background: #16283f;
  color: #fff;
  padding: 14px 12px;
}

.sidebar h1 {
  margin: 0 0 12px;
  font-size: 16px;
}

.menu a {
  display: block;
  color: #cdd8ea;
  text-decoration: none;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 4px;
  font-size: 14px;
}

.menu a:hover,
.menu a.active {
  background: #294b77;
  color: #fff;
}

.main { padding: 14px; }

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

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

.card h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

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

label {
  display: block;
  font-size: 13px;
  margin: 6px 0;
}

input,
select,
button,
textarea {
  width: 100%;
  font-size: 13px;
}

input,
select,
textarea {
  margin-top: 4px;
  border: 1px solid #9fb1cd;
  border-radius: 6px;
  padding: 6px 8px;
  background: #fff;
}

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

button:hover { opacity: .93; }
button.small { width: auto; padding: 6px 10px; }
button.danger { background: var(--danger); }
button.ok { background: var(--ok); }

.inline {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}

.inline > * { width: auto; }

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 420px;
  overflow: auto;
  background: #fafcff;
  border: 1px solid #e1e8f3;
  border-radius: 6px;
  padding: 8px;
}

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

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

.login-card { width: min(460px, 92vw); }

.table-wrap {
  overflow: auto;
  border: 1px solid #e1e8f3;
  border-radius: 8px;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  background: #fff;
}

table.data-table th,
table.data-table td {
  border-bottom: 1px solid #edf2fb;
  padding: 8px;
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

table.data-table td br {
  line-height: 1.55;
}

.league-sync-card {
  border: 1px solid #e1e8f3;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 12px;
  overflow: hidden;
}

.league-sync-head {
  padding: 10px 12px;
  background: #f7faff;
  border-bottom: 1px solid #e8eef9;
}

.league-sync-head h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.league-sync-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.league-sync-table-wrap {
  overflow: auto;
}

table.fixture-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

table.fixture-table th,
table.fixture-table td {
  font-size: 13px;
  padding: 8px;
  border-bottom: 1px solid #edf2fb;
}

table.fixture-table th {
  background: #fafcff;
  text-align: left;
}

.round-row td {
  background: #eef5fc;
  color: #2e5f9e;
  font-weight: 600;
}

table.data-table th {
  background: #f0f4fb;
  position: sticky;
  top: 0;
  z-index: 1;
}

table.data-table tr:hover td { background: #f9fbff; }

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

.actions button { padding: 5px 8px; }

.pager {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.pager .info {
  min-width: 190px;
  text-align: right;
  color: var(--muted);
  font-size: 13px;
}

.empty {
  color: var(--muted);
  padding: 10px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(13, 21, 34, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-mask.open { display: flex; }

.modal {
  width: min(560px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #d9e2f2;
  padding: 14px;
}

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

.modal .footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.badge {
  display: inline-block;
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 7px;
  background: #eaf1fe;
  color: #315ca8;
}

.badge.off {
  background: #f1f2f6;
  color: #68717f;
}

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
