:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --panel-soft: #fafbfc;
  --text: #1f2933;
  --muted: #6b7280;
  --muted-soft: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #f1f3f5;
  --dark: #0b0d10;
  --sidebar-bg: #0b0d10;
  --sidebar-line: #1f2227;
  --sidebar-text: #d1d5db;
  --sidebar-muted: #6b7280;
  --sidebar-hover: #15181d;
  --sidebar-active: #1c2026;
  --accent: #0f172a;
  --accent-dark: #020617;
  --blue: #2563eb;
  --green: #087f5b;
  --green-soft: #e9f7f2;
  --red: #b42318;
  --lime: #e1ff83;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: 0 12px;
  font-weight: 600;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

button:hover {
  border-color: #b8c0cc;
  background: #f9fafb;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  outline-offset: 1px;
  border-color: var(--blue);
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

button.primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 8px;
  min-height: 32px;
}

button.ghost:hover {
  background: var(--line-soft);
  color: var(--text);
}

button.ghost.danger {
  color: var(--red);
}

button.ghost.danger:hover {
  background: #fdecea;
  color: var(--red);
}

button.danger-solid {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
}

button.danger-solid:hover {
  border-color: #8c1812;
  background: #8c1812;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 8px 11px;
}

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

.login {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--sidebar-bg);
  padding: 24px;
}

.login-panel {
  display: grid;
  justify-items: center;
  gap: 24px;
  width: min(320px, 100%);
  border: 1px solid var(--sidebar-line);
  border-radius: 12px;
  background: #111418;
  color: var(--sidebar-text);
  padding: 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.login-panel .brand-logo {
  width: 110px;
}

.login-notice {
  margin: -8px 0 0;
  color: var(--sidebar-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.login-panel button.primary {
  width: 100%;
  min-height: 42px;
  border-color: var(--lime);
  background: var(--lime);
  color: var(--dark);
  font-weight: 700;
}

.login-panel button.primary:hover {
  border-color: #cdf055;
  background: #cdf055;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-logo {
  display: block;
  width: 110px;
  height: auto;
}

.brand-logo.small {
  width: 86px;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  background: var(--dark);
  color: #ffffff;
  font-weight: 800;
}

.loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
  font-weight: 600;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 22px 14px 18px;
}

.sidebar-brand {
  padding: 4px 8px 0;
}

.nav {
  display: grid;
  gap: 2px;
  margin-top: 28px;
}

.nav-section {
  margin: 0 8px 8px;
  color: var(--sidebar-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-section + button + .nav-section,
.nav-section ~ .nav-section {
  margin-top: 18px;
}

.nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  padding: 0 11px;
  color: var(--sidebar-text);
  font-weight: 500;
}

.nav button:hover {
  background: var(--sidebar-hover);
  border-color: transparent;
  color: #ffffff;
}

.nav button.active {
  background: var(--sidebar-active);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-footer {
  position: relative;
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 14px 8px 4px;
  border-top: 1px solid var(--sidebar-line);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--sidebar-text);
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.sidebar-user:hover {
  background: var(--sidebar-hover);
  border-color: transparent;
  color: #ffffff;
}

.sidebar-user[aria-expanded="true"] {
  background: var(--sidebar-active);
  color: #ffffff;
}

.sidebar-user .user-avatar {
  flex: 0 0 auto;
  background: var(--sidebar-active);
  color: #ffffff;
}

.opta-search {
  position: relative;
  flex: 0 0 auto;
  width: min(320px, 100%);
}

.opta-search-input {
  width: 100%;
}

.user-menu {
  position: absolute;
  z-index: 60;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  padding: 6px;
  bottom: calc(100% + 8px);
  left: 8px;
  right: 8px;
}

.user-menu-email {
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  word-break: break-all;
}

.user-menu-item {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 8px 10px;
  text-align: left;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}

.user-menu-item:hover {
  background: var(--line-soft);
}

.sidebar-user-email {
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout {
  width: 100%;
  border-color: var(--sidebar-line);
  background: transparent;
  color: var(--sidebar-text);
}

.sidebar-logout:hover {
  border-color: var(--sidebar-line);
  background: var(--sidebar-hover);
  color: #ffffff;
}

.content {
  min-width: 0;
  padding: 28px 32px;
}

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

.topbar .actions button {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
}

.title {
  margin: 0;
  color: var(--dark);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
}

.user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.user-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--dark);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.panel + .panel {
  margin-top: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.panel-head .actions {
  flex-wrap: nowrap;
}

.panel-title {
  margin: 0;
  color: var(--dark);
  font-size: 15px;
  font-weight: 700;
}

.panel-copy {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-copy .meta-strong {
  color: var(--text);
  font-weight: 600;
}

.panel-copy .meta-mono {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.panel-copy .meta-sep {
  margin: 0 6px;
  color: var(--muted-soft);
}

.panel-body {
  padding: 18px;
}

.row-clickable .row-toggle {
  cursor: pointer;
}

.row-clickable .row-toggle:hover td {
  background: #fafbfc;
}

.row-clickable .row-toggle.is-open td {
  background: #f5f7fa;
}

.caret-cell {
  width: 32px;
  padding-right: 0;
  color: var(--muted-soft);
}

.row-toggle .caret {
  display: inline-block;
  width: 14px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  transition: transform 140ms ease;
}

.row-toggle.is-open .caret {
  color: var(--text);
}

.expand-row td {
  padding: 0;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.expand-row:last-child td {
  border-bottom: 0;
}

.expand-inner {
  padding: 16px 22px 18px;
}

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

.expand-title {
  color: var(--dark);
  font-size: 14px;
  font-weight: 600;
}

.expand-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.expand-meta .meta-mono {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.expand-inner .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.expand-inner table {
  min-width: 0;
}

.expand-inner thead th {
  background: #f3f5f8;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
}

.expand-inner tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.expand-inner tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.expand-inner tbody tr:hover td {
  background: #f3f6fa;
}

.expand-inner tbody tr:last-child td {
  border-bottom: 0;
}

.grid {
  display: grid;
  gap: 12px;
}

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

.baseline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.baseline-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.baseline-name {
  color: var(--dark);
  font-weight: 700;
}

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

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

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

.opta-table {
  min-width: 1040px;
}

th,
td {
  padding: 12px 18px;
  text-align: left;
  vertical-align: middle;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody td {
  border-bottom: 1px solid var(--line-soft);
  color: #344054;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody td strong {
  color: var(--dark);
  font-weight: 600;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover td {
  background: #fafbfc;
}

td.numeric,
th.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

td.type-cell {
  color: var(--dark);
  font-weight: 600;
  white-space: nowrap;
}

td.strong-cell {
  color: var(--dark);
  font-weight: 600;
}

td.actions-cell,
th.actions-cell {
  width: 1%;
  text-align: right;
  white-space: nowrap;
}

td.id-cell {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}

.match-cell {
  display: grid;
  gap: 2px;
}

.match-cell-name {
  color: var(--dark);
  font-weight: 600;
}

.match-cell-meta {
  color: var(--muted);
  font-size: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-transform: capitalize;
}

.status .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-soft);
}

.status-draft {
  color: #b25c0d;
}

.status-draft .dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.status-published {
  color: var(--green);
}

.status-published .dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 127, 91, 0.15);
}

.status-upcoming {
  color: #4b5563;
}

.status-upcoming .dot {
  background: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.22);
}

.status-live {
  color: #b91c1c;
}

.status-live .dot {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
  animation: pulse-live 1.6s ease-in-out infinite;
}

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

.status-finished .dot {
  background: var(--muted-soft);
}

.status-warn {
  color: #b25c0d;
}

.status-warn .dot {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

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

.status-neutral .dot {
  background: var(--muted-soft);
}

@keyframes pulse-live {
  0%, 100% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.08); }
}

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

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

.notice {
  margin-bottom: 14px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  background: #fff7f7;
  color: var(--red);
  padding: 10px 12px;
  font-weight: 600;
}

.empty {
  padding: 56px 16px;
  color: var(--muted);
  text-align: center;
}

.empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--dark);
}

.toolbar-select {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 34px;
  padding: 4px 32px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background-color: var(--panel);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
  appearance: none;
  -webkit-appearance: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.toolbar-select:hover {
  border-color: #b8c0cc;
}

.toolbar-select:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.table-note {
  margin: 12px 18px;
  color: var(--muted);
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  color: var(--muted);
  font-size: 13px;
}

.pagination-page {
  padding: 0 8px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.45);
  padding: 24px;
  backdrop-filter: blur(2px);
  animation: fade-in 140ms ease;
  overflow-y: auto;
}

.modal {
  width: min(440px, 100%);
  border-radius: 12px;
  background: var(--panel);
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  animation: pop-in 140ms ease;
}

.modal-form {
  width: min(960px, calc(100vw - 48px));
  padding: 0;
  overflow: hidden;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  margin: 0 0 4px;
  color: var(--dark);
  font-size: 17px;
  font-weight: 700;
}

.modal-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.modal-body {
  display: grid;
  gap: 18px;
  padding: 18px 22px;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
}

.confirm-modal {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  width: min(440px, 100%);
  border-radius: 12px;
  background: var(--panel);
  padding: 22px 24px 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  animation: pop-in 140ms ease;
}

.confirm-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #fdecea;
  color: var(--red);
}

.confirm-body {
  min-width: 0;
}

.confirm-title {
  margin: 2px 0 6px;
  color: var(--dark);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.confirm-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.confirm-actions button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 110;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--dark);
  color: #ffffff;
  padding: 10px 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
  font-size: 13px;
  font-weight: 500;
  animation: toast-in 200ms ease;
}

.toast::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-soft);
}

.toast-success::before {
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}

.toast-error {
  background: var(--red);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.modal-alert {
  margin: 14px 22px 0;
  padding: 10px 12px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  background: #fff7f7;
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.modal-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.modal-preview-body {
  padding: 0;
  overflow-y: auto;
}

.modal-preview-body .table-wrap {
  max-height: 60vh;
  overflow: auto;
}

.modal-preview-body .table-note {
  margin: 12px 22px;
}

.icon-close {
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
}

.form-section {
  display: grid;
  gap: 10px;
}

.form-section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.match-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 360px);
  align-items: end;
  gap: 12px;
}

.match-picker-search,
.match-picker-id {
  min-width: 0;
}

.match-picker-or {
  position: relative;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.match-picker-or span {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

@media (max-width: 720px) {
  .match-picker {
    grid-template-columns: 1fr;
  }
  .match-picker-or {
    height: auto;
    justify-content: flex-start;
  }
}

.combobox {
  position: relative;
}

.combobox-input {
  width: 100%;
}

.combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  max-height: 280px;
  overflow-y: auto;
}

.combobox-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.combobox-item:hover {
  background: var(--panel-soft);
}

.combobox-item-name {
  color: var(--dark);
  font-weight: 600;
}

.combobox-item-meta {
  color: var(--muted);
  font-size: 12px;
}

.combobox-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
}

.combobox-help {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.combobox-selected {
  margin-top: 4px;
  color: var(--green);
  font-size: 12.5px;
  font-weight: 500;
}

.combobox-selected:empty {
  display: none;
}

.form-hint {
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.baseline-table {
  width: 100%;
  table-layout: fixed;
  border: 1px solid var(--line);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.baseline-table thead th {
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
}

.baseline-table thead th.numeric {
  width: 30%;
  text-align: left;
}

.baseline-table tbody td {
  border-bottom: 1px solid var(--line-soft);
  padding: 7px 12px;
}

.baseline-table tbody tr:last-child td {
  border-bottom: 0;
}

.baseline-table .baseline-name-cell {
  color: var(--dark);
  font-weight: 600;
  white-space: nowrap;
}

.baseline-table input {
  min-height: 34px;
  padding: 6px 10px;
  font-variant-numeric: tabular-nums;
}

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

@keyframes pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1100px) {
  .shell {
    display: block;
    min-height: 100vh;
  }

  .content {
    min-height: calc(100vh - 64px);
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    flex-direction: row;
    height: auto;
    min-height: 0;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
    border-bottom: 1px solid var(--sidebar-line);
  }

  .sidebar-brand {
    flex: 0 0 auto;
    padding: 0;
  }

  .brand-logo.small {
    width: 70px;
  }

  .nav {
    display: flex;
    flex: 1 1 auto;
    gap: 4px;
    margin-top: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-section {
    display: none;
  }

  .nav button {
    width: auto;
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
    font-size: 13px;
  }

  .sidebar-footer {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    padding: 0;
    border-top: 0;
  }

  .sidebar-user {
    padding: 4px;
  }

  .sidebar-user-email {
    display: none;
  }

  .sidebar-logout {
    display: none;
  }

  .user-menu {
    top: calc(100% + 8px);
    bottom: auto;
    right: 0;
    left: auto;
    min-width: 220px;
  }

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

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }

  button {
    min-height: 42px;
  }

  button.ghost {
    min-height: 38px;
  }

  input,
  select {
    min-height: 42px;
    font-size: 16px;
  }

  .content {
    padding: 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .title {
    font-size: 19px;
  }

  .subtitle {
    font-size: 13px;
  }

  .topbar,
  .panel-head,
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar .actions,
  .panel-head .actions,
  .pagination .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .panel-head {
    padding: 12px 14px;
  }

  .panel-body {
    padding: 14px;
  }

  .grid.two,
  .baseline-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .actions {
    width: 100%;
    gap: 8px;
  }

  .actions button,
  .actions select {
    flex: 1 1 auto;
  }

  .toolbar-select {
    width: 100%;
    min-width: 0;
  }

  th,
  td {
    padding: 10px 12px;
  }

  table {
    min-width: 560px;
  }

  .expand-inner {
    padding: 12px 14px 14px;
  }

  .expand-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .modal-backdrop {
    padding: 0;
    align-items: stretch;
  }

  .modal,
  .modal-form {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-form {
    height: 100vh;
  }

  .modal-header {
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .modal-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
  }

  .modal-toolbar .toolbar-select {
    flex: 1 1 140px;
  }

  .modal-body {
    padding: 14px 16px;
  }

  .modal-actions {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .modal-actions button {
    flex: 1 1 auto;
  }

  .modal-preview-body .table-wrap {
    max-height: none;
  }

  .confirm-modal {
    grid-template-columns: 36px 1fr;
    gap: 12px;
    padding: 18px;
  }

  .login {
    padding: 16px;
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .login-panel {
    padding: 24px;
  }

  .login-title {
    margin-top: 22px;
    font-size: 22px;
  }

  .toast {
    right: 12px;
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    justify-content: center;
  }
}
