:root {
  --ink: #101a2d;
  --muted: #5f718b;
  --line: #c9d9ea;
  --panel: #ffffff;
  --ice: #ecf6ff;
  --blue: #0b5cab;
  --blue-dark: #06265f;
  --blue-bright: #26a8ff;
  --silver: #d7e2ee;
  --storm: #17243b;
  --shadow: 0 22px 60px rgba(7, 35, 86, .16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(38, 168, 255, .22), transparent 28%),
    radial-gradient(circle at 82% 2%, rgba(6, 38, 95, .14), transparent 30%),
    linear-gradient(180deg, #f7fbff 0%, #eaf4ff 42%, #f6fbff 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 64px 0 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255,255,255,.72), rgba(255,255,255,.20)),
    url("assets/rink-lines.svg") center top / min(1220px, 130vw) auto no-repeat;
  opacity: .92;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  min-height: 64px;
  padding: 12px clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background:
    linear-gradient(90deg, rgba(6, 38, 95, .98), rgba(11, 92, 171, .96) 48%, rgba(16, 26, 45, .98)),
    #0b5cab;
  border-bottom: 1px solid rgba(165, 215, 255, .42);
  box-shadow: 0 10px 34px rgba(6, 38, 95, .22);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  letter-spacing: 0;
}

.mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 24%, #fff 25% 38%, transparent 39% 49%, #fff 50% 62%, transparent 63%),
    linear-gradient(135deg, #0a3a86, #2bbcff);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.64), 0 0 0 1px rgba(255,255,255,.26), 0 0 22px rgba(75, 199, 255, .48);
}

.meta {
  color: #dceeff;
  font-size: 13px;
}

.shell {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 3vw, 28px);
}

.workspace {
  min-height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.rail,
.content {
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(155, 190, 226, .76);
  box-shadow: var(--shadow);
}

.rail {
  border-radius: 8px;
  padding: 14px;
  position: sticky;
  top: 82px;
  border-top: 4px solid var(--blue);
}

.content {
  border-radius: 8px;
  min-width: 0;
  overflow: hidden;
  border-top: 4px solid var(--blue-bright);
}

.tabs {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.tab {
  border: 1px solid #c8dcf0;
  background: linear-gradient(180deg, #fff, #f5faff);
  color: var(--ink);
  border-radius: 6px;
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tab[aria-selected="true"] {
  color: #fff;
  border-color: rgba(38, 168, 255, .72);
  background: linear-gradient(135deg, var(--blue-dark), var(--blue) 58%, #138ee2);
  box-shadow: inset 4px 0 0 #8fe3ff, 0 10px 24px rgba(11, 92, 171, .18);
}

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

.tab[aria-selected="true"] small {
  color: #d7efff;
}

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

.search,
.filter-group {
  display: grid;
  gap: 6px;
}

.search span,
.filter-group label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 40px;
  padding: 8px 10px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  color: var(--ink);
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(18, 94, 158, .22);
  outline-offset: 2px;
}

.filter-controls {
  display: grid;
  gap: 12px;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.toolbar {
  padding: 18px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(241, 248, 255, .95), #fff 55%);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.05;
  letter-spacing: 0;
  color: var(--storm);
}

#resultCount {
  margin-top: 5px;
  color: var(--muted);
}

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

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff, #f5faff);
  color: var(--blue-dark);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}

.icon-button.active,
.icon-button:hover {
  color: #fff;
  border-color: rgba(38, 168, 255, .72);
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 0;
}

.chip {
  border: 1px solid rgba(11, 92, 171, .28);
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef8ff;
  color: #113f79;
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 210px);
  margin-top: 12px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, #10294f, #123f78);
  color: #eaf7ff;
  font-size: 10px;
  text-transform: uppercase;
  cursor: pointer;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: #eef8ff;
}

tbody tr:nth-child(even) {
  background: rgba(245, 250, 255, .72);
}

.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

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

.pagination {
  min-height: 58px;
  padding: 12px 18px 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  border-top: 1px solid rgba(201, 217, 234, .72);
  background: rgba(248, 252, 255, .76);
}

.page-button {
  min-width: 86px;
  min-height: 36px;
  border: 1px solid #b8d4ef;
  border-radius: 6px;
  color: var(--blue-dark);
  background: linear-gradient(180deg, #fff, #f3f9ff);
  cursor: pointer;
}

.page-button:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(38, 168, 255, .72);
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.data-card {
  border: 1px solid #c8dcf0;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f7fbff);
  padding: 14px;
  cursor: pointer;
}

.data-card:hover {
  border-color: rgba(38, 168, 255, .72);
  box-shadow: 0 14px 34px rgba(11, 92, 171, .13);
}

.card-title {
  font-weight: 760;
  margin-bottom: 10px;
}

.card-fields,
.detail-grid {
  display: grid;
  gap: 8px;
}

.field {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid #edf2f7;
  padding-top: 8px;
  min-width: 0;
}

.field span:first-child {
  color: var(--muted);
}

.field span:last-child {
  text-align: right;
  overflow-wrap: anywhere;
}

dialog {
  width: min(680px, calc(100vw - 28px));
  border: 1px solid #b8d4ef;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(21, 32, 51, .22);
}

dialog::backdrop {
  background: rgba(21, 32, 51, .42);
}

.dialog-head {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  color: #fff;
  border-bottom: 1px solid rgba(199, 225, 250, .34);
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
}

#detailBody {
  padding: 16px;
}

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

@media (max-width: 860px) {
  .topbar {
    min-height: 58px;
  }

  .meta {
    display: none;
  }

  .shell {
    padding: 10px;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .rail {
    position: static;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab {
    min-height: 50px;
  }

  .toolbar {
    align-items: flex-start;
  }

  .pagination {
    justify-content: center;
  }

  .table-wrap {
    max-height: none;
  }
}

@media (max-width: 520px) {
  .tabs {
    grid-template-columns: 1fr;
  }

  .toolbar {
    display: grid;
  }

  .actions {
    justify-self: stretch;
  }

  .icon-button {
    flex: 1;
  }
}
