* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f4f4f5;
  margin: 0;
  color: #18181b;
}

.app {
  max-width: 1040px;
  margin: auto;
  padding: 15px;
}

.super-admin-app {
  max-width: 1180px;
}

.super-admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin: 8px 0 18px;
  padding: 24px;
  border: 1px solid rgba(24,24,27,0.1);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15,23,42,0.08);
}

.super-admin-hero h1 {
  margin: 0;
  color: #18181b;
  font-size: 38px;
  line-height: 1;
}

.super-admin-hero p {
  max-width: 720px;
  margin: 10px 0 0;
  color: #52525b;
  font-size: 16px;
  line-height: 1.45;
}

.super-admin-user {
  display: grid;
  gap: 5px;
  min-width: 230px;
  padding: 14px;
  border-radius: 14px;
  background: #f4f4f5;
}

.super-admin-user strong {
  color: #18181b;
}

.super-admin-user span {
  color: #52525b;
  font-size: 13px;
}

.super-admin-user a {
  color: #18181b;
  font-weight: 900;
}

.super-admin-context-bar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(24,24,27,0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15,23,42,0.06);
}

.super-admin-context-bar div {
  display: grid;
  gap: 3px;
}

.super-admin-context-bar strong {
  color: #18181b;
  font-size: 16px;
}

.super-admin-context-bar span {
  color: #52525b;
  font-size: 13px;
}

.super-admin-context-bar .button-link {
  width: auto;
  white-space: nowrap;
}

.super-admin-stats,
.super-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.super-admin-stats article,
.super-admin-card,
.super-admin-health {
  border: 1px solid rgba(24,24,27,0.1);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15,23,42,0.06);
}

.super-admin-stats article {
  padding: 16px;
}

.super-admin-stats strong {
  display: block;
  color: #18181b;
  font-size: 28px;
  line-height: 1;
}

.super-admin-stats span,
.super-admin-health span,
.super-admin-card p {
  color: #52525b;
  font-size: 14px;
  line-height: 1.4;
}

.super-admin-health {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px;
}

.super-admin-health div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
}

.super-admin-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  min-height: 210px;
  padding: 18px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.super-admin-card.active {
  border-color: rgba(24,24,27,0.42);
  box-shadow: 0 18px 46px rgba(15,23,42,0.12);
  transform: translateY(-1px);
}

.super-admin-card h2 {
  margin: 0;
  font-size: 19px;
}

.super-admin-card p {
  margin: 0;
}

.super-admin-card .button-link {
  justify-self: start;
  width: auto;
}

.super-admin-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.super-admin-panel {
  padding: 16px;
  border: 1px solid rgba(24,24,27,0.1);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15,23,42,0.06);
}

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

.super-admin-panel-head h2 {
  margin: 0;
  font-size: 19px;
}

.super-admin-panel-head a {
  color: #18181b;
  font-weight: 900;
}

.super-admin-link-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.super-admin-table {
  display: grid;
  gap: 8px;
}

.super-admin-table div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
}

.super-admin-table strong {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #18181b;
}

.super-admin-table span {
  color: #52525b;
  font-size: 13px;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #18181b;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.source-badge.match {
  background: #dbeafe;
  color: #1e3a8a;
}

.source-badge.backend {
  background: #dcfce7;
  color: #166534;
}

.source-badge.shared {
  background: #fef3c7;
  color: #92400e;
}

.source-badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.needs-review-row {
  background: #fffbeb;
}

.needs-review-row:hover {
  background: #fef3c7;
}

.embedded-super-admin {
  background: #f8fafc;
}

.embedded-super-admin .app {
  max-width: none;
  padding: 12px;
}

.embedded-super-admin .offline-control,
.embedded-super-admin .user-bar,
.embedded-super-admin .legal-warning,
.embedded-super-admin .nav,
.embedded-super-admin #demoBanner,
.embedded-super-admin #offlineStatus {
  display: none !important;
}

.embedded-super-admin .card {
  box-shadow: none;
}

.super-admin-work-mode .offline-control,
.super-admin-work-mode .user-bar,
.super-admin-work-mode .legal-warning,
.super-admin-work-mode .nav,
.super-admin-work-mode #demoBanner,
.super-admin-work-mode #offlineStatus,
.super-admin-work-mode .mobile-quick-actions,
.super-admin-work-mode #globalTournamentDisplayMount {
  display: none !important;
}

.super-admin-work-mode .app {
  max-width: 1180px;
}

.super-admin-work-mode #tenantAdminScreen {
  margin-top: 0;
}

.offline-status {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  font-size: 14px;
}

.offline-status.online {
  background: #dcfce7;
  color: #166534;
}

.demo-banner {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #2563eb;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  font-size: 14px;
  font-weight: 750;
}

.demo-banner strong {
  white-space: nowrap;
  font-weight: 950;
}

.demo-banner span {
  flex: 1;
  line-height: 1.35;
}

.demo-banner button {
  width: auto;
  min-width: 130px;
  padding: 8px 10px;
  border-color: #bfdbfe;
  background: #fff;
  color: #1e3a8a;
}

.user-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  color: #52525b;
  font-size: 14px;
  font-weight: 700;
}

.user-bar a {
  color: #18181b;
  font-weight: 900;
}

.legal-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
  font-weight: 800;
}

.legal-warning span {
  display: block;
  margin: 4px 0 10px;
  font-weight: 700;
}

.legal-warning div,
.legal-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.legal-warning a,
.legal-footer a {
  color: #18181b;
  font-weight: 900;
}

.legal-footer button {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #18181b;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.legal-warning button {
  width: auto;
  margin: 0;
  padding: 8px 10px;
}

.legal-footer {
  max-width: 1040px;
  margin: 0 auto 28px;
  padding: 0 15px;
  color: #52525b;
  font-size: 13px;
}

#captureSelectionCard,
.mobile-only-action {
  display: none;
}

.cookie-consent {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 3000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  width: min(calc(100vw - 32px), 940px);
  padding: 18px 20px;
  border: 1px solid rgba(24,24,27,0.12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15,23,42,0.22);
  transform: translateX(-50%);
}

.cookie-consent strong {
  display: block;
  color: #18181b;
  font-size: 16px;
  font-weight: 900;
}

.cookie-consent p {
  margin: 6px 0 0;
  color: #52525b;
  font-size: 14px;
  line-height: 1.45;
}

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

.cookie-consent-actions button {
  width: auto;
  margin-top: 0;
  padding: 11px 15px;
  white-space: nowrap;
}

.error-report-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin: 0 0 15px;
  padding: 14px 16px;
  border: 1px solid rgba(220,38,38,0.22);
  border-radius: 12px;
  background: #fff7f7;
  color: #18181b;
  box-shadow: 0 10px 30px rgba(127,29,29,0.08);
}

.error-report-box strong {
  display: block;
  color: #991b1b;
  font-size: 16px;
}

.error-report-box p {
  margin: 6px 0 0;
}

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

.error-report-actions button {
  width: auto;
  margin-top: 0;
  white-space: nowrap;
}

.legal-page {
  max-width: 860px;
}

.legal-card {
  max-width: 860px;
}

.legal-doc-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
}

.legal-doc-nav a {
  color: #075985;
  font-weight: 900;
}

.legal-document {
  white-space: normal;
  line-height: 1.55;
  color: #27272a;
}

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

.offline-control button {
  flex: 1;
  margin-top: 0;
  font-size: 15px;
  padding: 12px;
}

.offline-control button.active {
  background: #b45309;
}

body.is-offline #daySection,
body.is-offline #importStartlistBtn,
body.is-offline .capture-import-details {
  display: none !important;
}

body.chart-open {
  overflow: hidden;
}

.capture-with-sticky {
  padding-bottom: 150px;
}

#captureScreen:not(.hidden) {
  display: flex;
  flex-direction: column;
}

.capture-import-details {
  margin-bottom: 14px;
  background: #f8fafc;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 10px 12px;
}

.capture-import-details summary {
  cursor: pointer;
  font-weight: 900;
}

.capture-import-details > *:not(summary) {
  margin-top: 10px;
}

.capture-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.capture-list-header h2 {
  margin: 0;
}

.capture-list-header button {
  margin-top: 0;
}

.card {
  background: white;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 15px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.compact-card h2 {
  margin-top: 0;
}

.desktop-capture-selection-status {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #f8fafc;
}

.desktop-capture-selection-status .selection-label {
  color: #71717a;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.desktop-capture-selection-status strong {
  color: #18181b;
  font-size: 16px;
}

.desktop-capture-selection-status span:last-child {
  color: #3f3f46;
  font-weight: 700;
}

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

.filter-grid select {
  margin-top: 0;
}

.filter-grid > label {
  min-width: 0;
}

.event-select-list {
  margin-top: 10px;
}

.event-select-table {
  margin-top: 0;
}

.event-select-table table {
  min-width: 560px;
}

.event-select-row.active td {
  background: #18181b;
  color: white;
}

.capture-day-panel {
  width: min(760px, 100%);
}

.capture-day-table table {
  min-width: 560px;
}

.capture-day-row.active td {
  background: #18181b;
  color: white;
}

.details-date-grid input[type="date"] {
  min-width: 0;
}

.fn-import-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.fn-import-tools input,
.fn-import-tools select {
  grid-column: 1 / -1;
}

.fn-import-tools button {
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
}

.fn-import-tools #importFnCandidateBtn {
  grid-column: 1 / -1;
}

.planning-list {
  display: grid;
  gap: 8px;
}

.planning-day {
  margin: 12px 0 4px;
  font-size: 14px;
  font-weight: 900;
  color: #52525b;
}

.planning-row {
  display: grid;
  grid-template-columns: 28px 56px minmax(0, 1fr) 70px 178px 92px;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fafafa;
}

.planning-row.is-planned {
  border-color: #16a34a;
  background: #f0fdf4;
}

.planning-title {
  min-width: 0;
  font-weight: 900;
}

.planning-check {
  width: 20px;
  height: 20px;
  margin: 0;
}

.planning-number {
  font-weight: 900;
  color: #075985;
  background: #e0f2fe;
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
  overflow-wrap: anywhere;
}

.planning-number-empty {
  background: transparent;
  padding: 0;
}

.planning-title span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.planning-time-label {
  color: #18181b;
  font-weight: 900;
  white-space: nowrap;
}

.planning-meta {
  color: #52525b;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.planning-row input[type="datetime-local"] {
  margin: 0;
}

.planned-overview {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.planned-overview-day {
  margin-top: 8px;
  color: #52525b;
  font-size: 14px;
  font-weight: 900;
}

.planned-overview-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 6px 10px;
  padding: 10px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fafafa;
}

.planned-overview-row strong {
  color: #075985;
}

.planned-overview-row span {
  min-width: 0;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.planned-overview-row small {
  grid-column: 2;
  color: #52525b;
  font-weight: 800;
}

.participants-overview {
  margin: 10px 0 14px;
}

.travel-expense-row {
  grid-template-columns: 2fr 1fr auto;
  align-items: end;
  margin-bottom: 8px;
}

.vehicle-km-year-row {
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: end;
  margin-bottom: 8px;
}

.subsection {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
}

.subsection h3 {
  margin: 0 0 8px;
}

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

.module-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.module-overview article {
  padding: 12px;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  background: #fff;
}

.module-overview article.active {
  border-color: #0f766e;
  background: #f0fdfa;
}

.module-overview strong,
.module-overview span,
.module-overview small {
  display: block;
}

.module-overview span {
  margin-top: 4px;
  color: #0f766e;
  font-weight: 800;
}

.module-overview p {
  margin: 8px 0;
  color: #52525b;
  font-size: 13px;
  line-height: 1.4;
}

.module-overview small {
  color: #71717a;
}

.stats-grid-single {
  grid-template-columns: 1fr;
}

.stat-box {
  background: #f4f4f5;
  padding: 10px;
  border-radius: 10px;
  font-weight: 800;
}

.stat-box span {
  display: block;
  margin-top: 4px;
  color: #075985;
  font-size: 18px;
}

.stat-box.good span,
.stat-box.warn span,
.stat-box.bad span {
  color: inherit;
}

.stat-box.good {
  background: #dcfce7;
  color: #166534;
}

.stat-box.bad {
  background: #fee2e2;
  color: #991b1b;
}

.stat-box.warn {
  background: #fef3c7;
  color: #92400e;
}

.good-text {
  color: #166534;
  font-weight: 900;
}

.bad-text {
  color: #991b1b;
  font-weight: 900;
}

.responsive-table {
  width: 100%;
  overflow-x: auto;
  margin-top: 12px;
}

.responsive-table table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: #fff;
  table-layout: auto;
}

.responsive-table th,
.responsive-table td {
  padding: 8px 6px;
  border-bottom: 1px solid #e4e4e7;
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f4f4f5;
}

.muted-row {
  opacity: 0.55;
  cursor: not-allowed;
}

.event-linked-block + .event-linked-block {
  margin-top: 14px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.event-linked-table {
  margin-top: 8px;
}

.event-linked-table input {
  margin-top: 0;
}

.event-picker-panel {
  width: min(860px, 100%);
}

.link-button {
  width: auto;
  min-height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #18181b;
  text-align: left;
  text-decoration: underline;
  box-shadow: none;
}

.compact-button {
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 8px 10px;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 8px 14px;
  margin: 0 0 12px;
}

.detail-list dt {
  color: #52525b;
  font-weight: 900;
}

.detail-list dd {
  margin: 0;
}

.status-pill {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f4f4f5;
  color: #52525b;
  font-weight: 900;
  white-space: nowrap;
}

.status-pill.good {
  background: #dcfce7;
  color: #166534;
}

.status-pill.warn {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.bad {
  background: #fee2e2;
  color: #991b1b;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag-list button {
  width: auto;
  min-height: 0;
  margin-top: 0;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f4f4f5;
  color: #18181b;
  font-size: 13px;
}

.tag-list button:hover {
  background: #fee2e2;
  color: #991b1b;
}

.vehicle-chart {
  width: 100%;
  margin-top: 14px;
  background: #fff;
  border-radius: 10px;
}

.chart-scroll {
  width: 100%;
  margin-top: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.chart-scroll canvas {
  display: block;
  min-width: 100%;
}

.clickable-chart {
  cursor: zoom-in;
}

.chart-fallback-button {
  display: none;
}

.stats-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.stats-section h3 {
  margin: 0;
}

.stats-chart.hidden {
  display: none;
}

.chart-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #f4f4f5;
  padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.chart-overlay.hidden {
  display: none;
}

.chart-overlay-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chart-overlay-toolbar button {
  width: fit-content;
  margin: 0;
}

.chart-overlay-toolbar span {
  color: #52525b;
  font-size: 14px;
}

.chart-overlay canvas {
  flex: none;
  min-height: 300px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

@media (max-width: 720px) {
  .chart-overlay {
    justify-content: center;
  }

  .chart-overlay canvas {
    width: calc(100vh - 96px);
    height: calc(100vw - 32px);
    max-width: none;
    flex: none;
    align-self: center;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  .chart-overlay canvas {
    transform: rotate(90deg);
  }
}

.stat-row {
  background: white;
  padding: 12px;
  margin-top: 10px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.stat-row small {
  color: #52525b;
  font-weight: 700;
}

.work-time-details {
  margin-top: 12px;
  background: #f9fafb;
  border-radius: 10px;
  padding: 10px;
}

.work-time-details h3 {
  margin: 0 0 8px;
}

.work-time-details div {
  padding: 6px 0;
  border-top: 1px solid #e5e7eb;
  font-size: 14px;
}

.stats-chart {
  width: 100%;
  margin-top: 14px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: white;
}

.document-section {
  margin-top: 16px;
}

.document-section input[type="file"] {
  padding: 10px;
  border: 1px dashed #a1a1aa;
  border-radius: 10px;
  background: #fafafa;
}

.document-section .responsive-table {
  margin-top: 12px;
}

.document-section a {
  font-weight: 700;
  color: #18181b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 16px;
  background: #e5e7eb;
  padding: 6px;
  border-radius: 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav button {
  flex: 1 1 0;
  min-width: 0;
  margin-top: 0;
  background: transparent;
  color: #52525b;
  box-shadow: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav button.active {
  background: #18181b;
  color: white;
}

.mobile-quick-actions {
  display: none;
}

.calendar-head {
  display: grid;
  gap: 16px;
}

.calendar-controls,
.calendar-feed-box {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-controls strong {
  min-width: 180px;
  text-align: center;
  font-size: 1.1rem;
}

.calendar-feed-box label {
  flex: 1 1 360px;
}

.calendar-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #3f3f46;
  font-size: .9rem;
}

.calendar-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.calendar-scroll {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #e5e7eb;
}

.calendar-grid {
  min-width: 860px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
}

.calendar-weekday,
.calendar-day {
  background: #fff;
}

.calendar-weekday {
  padding: 10px;
  font-weight: 700;
  color: #52525b;
  text-align: center;
}

.calendar-day {
  min-height: 128px;
  padding: 8px;
}

.calendar-day.outside {
  background: #f4f4f5;
  color: #71717a;
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px #18181b;
}

.calendar-day-number {
  font-weight: 700;
  margin-bottom: 6px;
}

.calendar-day-events {
  display: grid;
  gap: 6px;
}

.calendar-event {
  width: 100%;
  margin: 0;
  padding: 7px 8px;
  text-align: left;
  background: #fafafa;
  color: #18181b;
  border: 1px solid #e4e4e7;
  border-left: 5px solid var(--calendar-event-color);
  border-radius: 8px;
  box-shadow: none;
}

.calendar-event strong,
.calendar-event span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event strong {
  font-size: .86rem;
}

.calendar-event span {
  margin-top: 2px;
  font-size: .75rem;
  color: #52525b;
}

.navigation-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(24, 24, 27, 0.58);
}

.navigation-overlay.hidden {
  display: none;
}

.capture-selection-panel {
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.navigation-panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 18px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.navigation-panel.contract-editor-panel {
  width: min(860px, 100%);
}

.navigation-panel.equipment-editor-panel {
  width: min(920px, 100%);
}

.navigation-panel.vehicle-editor-panel {
  width: min(980px, 100%);
}

.navigation-panel.stats-entry-panel {
  width: min(920px, 100%);
}

.navigation-panel.organizer-editor-panel {
  width: min(1060px, 100%);
}

.navigation-panel.tournament-workspace-panel {
  width: min(1100px, 100%);
}

.tournament-overlay-content {
  margin-top: 16px;
}

.tournament-overlay-content #tournamentManageActions {
  margin-bottom: 12px;
}

.tournament-overlay-content .tournament-tab-panel,
.tournament-overlay-content #tournamentActionCard {
  border: 1px solid #e4e4e7;
  box-shadow: none;
}

.vehicle-editor-panel .mode-toggle {
  margin-top: 14px;
}

.stats-entry-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.stats-tournament-panel {
  display: grid;
  gap: 14px;
}

.stats-overlay-tabs {
  margin: 4px 0 0;
}

.stats-overlay-panel {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.stats-overlay-panel h2,
.stats-entry-form h2 {
  margin: 0;
}

.stats-entry-preview {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #e4e4e7;
}

.stats-entry-preview h3 {
  margin: 0;
}

.organizer-inline-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 12px 0 6px;
}

.organizer-inline-head button {
  width: auto;
  margin: 0;
  padding: 8px 10px;
}

.organizer-inline-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(220px, 1.2fr) 90px minmax(130px, 0.8fr) minmax(110px, 0.7fr) minmax(180px, 1fr);
  gap: 8px;
  align-items: center;
}

.organizer-inline-grid.contact-grid {
  grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.8fr) minmax(130px, 0.8fr) minmax(180px, 1fr) minmax(180px, 1fr);
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f8fafc;
}

.clickable-row:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: -3px;
}

.navigation-panel-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.navigation-panel-header h2 {
  margin: 0;
}

.navigation-panel-header button {
  width: auto;
  margin-top: 0;
  padding: 10px 12px;
  font-size: 15px;
}

.navigation-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.currency-input {
  position: relative;
  display: block;
}

.currency-input input {
  padding-right: 42px;
}

.currency-input span {
  position: absolute;
  top: 50%;
  right: 14px;
  color: #52525b;
  font-weight: 900;
  transform: translateY(-50%);
  pointer-events: none;
}

.currency-input input[readonly] {
  background: #f8fafc;
  cursor: pointer;
}

input,
select,
textarea,
button {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  font-size: 18px;
  border-radius: 12px;
}

input,
select,
textarea {
  border: 1px solid #d4d4d8;
  background: white;
}

button {
  border: none;
  font-weight: 800;
  background: #18181b;
  color: white;
}

button.group {
  background: #52525b;
}

button.danger {
  background: #dc2626;
}

button.secondary {
  background: #52525b;
}

#tournamentManageActions button {
  background: #52525b;
}

#tournamentManageActions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#tournamentManageActions button.active,
button.active,
button.secondary.active {
  background: #18181b;
  color: white;
}

.button-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #18181b;
  color: white;
  text-align: center;
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
}

.button-link.secondary {
  border: 1px solid #d4d4d8;
  background: #fff;
  color: #18181b;
}

.account-nav-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.checkbox-label {
  display: flex;
  gap: 10px;
  align-items: center;
}

.checkbox-label input {
  width: auto;
  margin-top: 0;
}

.admin-list-item {
  margin-top: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #f4f4f5;
}

.admin-list-item strong,
.admin-list-item span {
  display: block;
}

.address-nav-btn {
  font-size: 16px;
}

.branding-preview {
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f4f4f5;
}

.branding-preview img {
  display: block;
  max-width: 180px;
  max-height: 90px;
  object-fit: contain;
}

.hidden {
  display: none;
}

label {
  display: block;
  margin-top: 12px;
  font-weight: 800;
}

label input,
label select,
label textarea {
  margin-top: 6px;
}

.legal-rich-editor {
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  border: 1px solid #d4d4d8;
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  line-height: 1.5;
}

.legal-rich-editor:focus {
  outline: 3px solid rgba(24, 24, 27, 0.12);
  border-color: #18181b;
}

.legal-rich-editor h1,
.legal-rich-editor h2,
.legal-rich-editor h3 {
  margin: 16px 0 8px;
}

.legal-rich-editor p {
  margin: 0 0 10px;
}

.legal-rich-editor ul,
.legal-rich-editor ol {
  padding-left: 24px;
}

.address-autocomplete-anchor {
  position: relative;
}

.address-suggestions {
  grid-column: 1 / -1;
  margin-top: 6px;
  border: 1px solid #d4d4d8;
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
  overflow: hidden;
  z-index: 20;
}

.address-suggestions button {
  margin-top: 0;
  border-radius: 0;
  background: white;
  color: #18181b;
  text-align: left;
  font-size: 15px;
  font-weight: 800;
  box-shadow: none;
}

.address-suggestions button + button {
  border-top: 1px solid #e5e7eb;
}

.address-suggestions span {
  display: block;
  margin-top: 2px;
  color: #71717a;
  font-size: 13px;
  font-weight: 700;
}

.input-unit {
  position: relative;
}

.input-unit input {
  padding-right: 74px;
}

.input-unit span {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #52525b;
  font-weight: 900;
  pointer-events: none;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.mode-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  background: #e5e7eb;
  padding: 6px;
  border-radius: 14px;
  overflow-x: auto;
}

.mode-toggle button {
  flex: 1 0 max-content;
  min-width: 0;
  margin-top: 0;
  background: transparent;
  color: #52525b;
  white-space: nowrap;
}

.mode-toggle button.active {
  background: #18181b;
  color: white;
}

.starter {
  background: #f4f4f5;
  padding: 12px;
  margin-top: 8px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
}

.starter span {
  color: #52525b;
}

.starter-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.starter-actions button {
  flex: 1;
  padding: 9px;
  font-size: 14px;
}

.starter:active {
  transform: scale(0.98);
}

.used-starters-box {
  margin-top: 16px;
  background: #f9fafb;
  border-radius: 12px;
  padding: 12px;
}

.used-starters-box summary {
  font-weight: 800;
  cursor: pointer;
}

.used-starter {
  opacity: 0.65;
  background: #e5e7eb;
  padding: 10px;
  margin-top: 8px;
  border-radius: 10px;
  font-size: 15px;
}

.class-breaks-box {
  margin: -2px 0 10px 42px;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fafafa;
}

.class-breaks-box summary {
  cursor: pointer;
  font-weight: 900;
}

.class-breaks-box textarea {
  min-height: 74px;
}

.class-break-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.class-break-actions button {
  width: auto;
}

.run {
  background: white;
  padding: 12px;
  margin-top: 10px;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.run-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.run-actions button {
  flex: 1 1 45%;
  font-size: 14px;
  padding: 10px;
}

.sticky-save-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: white;
  border-top: 1px solid #d4d4d8;
  padding: 12px;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.12);
  z-index: 999;
}

.sticky-save-bar strong {
  display: block;
  font-size: 14px;
  color: #52525b;
  margin-bottom: 4px;
}

#groupBox {
  font-size: 22px;
  font-weight: 900;
  color: #075985;
  background: #e0f2fe;
  padding: 10px;
  border-radius: 12px;
  min-height: 46px;
}

.group-sticky-empty {
  color: #71717a !important;
  background: #f4f4f5 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

.sticky-save-bar button {
  margin-top: 8px;
  background: #16a34a;
}

.sticky-save-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
}

.sticky-save-actions button {
  min-width: 0;
}

.sticky-save-actions .secondary {
  background: #18181b;
}

.pause-marker {
  border: 2px dashed #f59e0b;
  background: #fffbeb;
  color: #92400e;
}

@media (min-width: 720px) {
  .fn-import-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
  }
}

@media (max-width: 620px) {
  .planning-row {
    grid-template-columns: 28px 56px minmax(0, 1fr);
  }

  .planning-time-label,
  .planning-row input[type="datetime-local"],
  .planning-meta {
    grid-column: 3;
    text-align: left;
  }

  .class-breaks-box {
    margin-left: 0;
  }
}

@media (max-width: 520px) {
  .app {
    padding: 12px;
  }

  #captureScreen {
    gap: 10px;
  }

  #captureTitle {
    margin: 4px 0 0;
    font-size: 21px;
  }

  #captureSubtitle {
    margin: 0;
    font-size: 13px;
  }

  #backBtn {
    align-self: flex-start;
    width: auto;
    padding: 10px 12px;
  }

  #captureInputCard {
    order: 1;
    margin-bottom: 0;
  }

  #starterListCard {
    order: 2;
    margin-bottom: 0;
  }

  #runsList {
    order: 3;
  }

  #exportBtn {
    order: 4;
  }

  .capture-list-header {
    grid-template-columns: 1fr;
  }

  .capture-list-header button {
    width: 100%;
  }

  .starter {
    padding: 10px;
    font-size: 15px;
  }

  .cookie-consent {
    grid-template-columns: 1fr;
    width: calc(100vw - 20px);
    bottom: max(10px, env(safe-area-inset-bottom));
    padding: 14px;
  }

  .cookie-consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .error-report-box {
    grid-template-columns: 1fr;
  }

  .error-report-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .demo-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .demo-banner button {
    width: 100%;
  }

  input,
  select,
  textarea,
  button {
    font-size: 17px;
  }

  .sticky-save-bar {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .stats-grid,
  .filter-grid,
  .organizer-inline-grid,
  .organizer-inline-grid.contact-grid,
  .travel-expense-row,
  .vehicle-km-year-row {
    grid-template-columns: 1fr;
  }

  .organizer-inline-head {
    grid-template-columns: 1fr;
  }

  .organizer-inline-head button {
    width: 100%;
  }

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

  .fn-import-tools {
    grid-template-columns: 1fr;
  }

  .fn-import-tools button {
    white-space: normal;
  }

  .nav {
    display: flex;
    grid-template-columns: none;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .nav button {
    flex: 0 0 auto;
    min-width: max-content;
    font-size: 15px;
    padding: 11px 8px;
    overflow: visible;
    text-overflow: clip;
  }

  #globalTournamentDisplayMount #tournamentDisplayCard {
    display: none;
  }

  #captureSelectionCard:not(.hidden),
  .mobile-only-action {
    display: block;
  }

  #mobileNavigateEventBtn {
    padding: 16px;
    background: #0f766e;
    font-size: 18px;
  }

  .legal-footer {
    display: none;
  }

  .navigation-overlay {
    align-items: flex-end;
    padding: 10px;
  }

  .navigation-panel {
    max-height: calc(100vh - 20px);
    border-radius: 16px 16px 10px 10px;
  }

  .navigation-actions {
    grid-template-columns: 1fr;
  }

  .calendar-controls,
  .calendar-feed-box {
    align-items: stretch;
  }

  .calendar-controls button,
  .calendar-feed-box button,
  .calendar-feed-box label {
    flex: 1 1 100%;
  }

  .calendar-controls strong {
    min-width: 0;
    order: -1;
    width: 100%;
  }

  .mode-toggle {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mode-toggle button {
    min-width: 0;
    white-space: normal;
    font-size: 15px;
    padding: 11px 8px;
  }

  .responsive-table table {
    min-width: 720px;
  }

  body.is-offline #navAdmin,
  body.is-offline #navCalendar,
  body.is-offline #navStats,
  body.is-offline #navTenantAdmin,
  body.is-offline #adminScreen,
  body.is-offline #statsScreen,
  body.is-offline #calendarScreen,
  body.is-offline #tenantAdminScreen {
    display: none !important;
  }
}
.group-chip {
  width: auto;
  display: inline-block;
  margin: 4px;
  padding: 8px 12px;
  font-size: 18px;
  border-radius: 999px;
  background: #075985;
  color: white;
}

.group-chip:active {
  transform: scale(0.95);
}

.status-text {
  margin: 8px 0 0;
  color: #16a34a;
  font-weight: 800;
  font-size: 14px;
}

.status-text.muted {
  color: #52525b;
}

.status-text.bad {
  color: #dc2626;
}

fieldset {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #d4d4d8;
  border-radius: 10px;
}

legend {
  padding: 0 6px;
  font-weight: 900;
}

.interest-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 12px;
  margin-top: 10px;
}

.interest-options label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-weight: 700;
}

.interest-options input {
  width: auto;
  margin-top: 3px;
}

button.secondary {
  background: #2563eb;
}

body[data-ui-theme="modern"] {
  --modern-ink: #18181b;
  --modern-muted: #52525b;
  --modern-line: #d4d4d8;
  --modern-panel: #ffffff;
  --modern-soft: #f8fafc;
  --modern-accent: #18181b;
  --modern-accent-strong: #3f3f46;
  --modern-accent-soft: #e4e4e7;
  background:
    linear-gradient(180deg, #f8fafc 0, #eef2f7 420px, #f8fafc 100%);
  color: var(--modern-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-ui-theme="modern"] .app,
body[data-ui-theme="modern"] .legal-footer {
  max-width: 1180px;
}

body[data-ui-theme="modern"] .app {
  padding: 22px 24px 32px;
}

body[data-ui-theme="modern"] .user-bar,
body[data-ui-theme="modern"] .offline-control,
body[data-ui-theme="modern"] .demo-banner,
body[data-ui-theme="modern"] .offline-status,
body[data-ui-theme="modern"] .legal-warning,
body[data-ui-theme="modern"] .error-report-box {
  border: 1px solid rgba(24, 24, 27, 0.1);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

body[data-ui-theme="modern"] .user-bar {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
}

body[data-ui-theme="modern"] .nav,
body[data-ui-theme="modern"] .mode-toggle {
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(24, 24, 27, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

body[data-ui-theme="modern"] .nav button,
body[data-ui-theme="modern"] .mode-toggle button {
  min-height: 40px;
  border-radius: 6px;
  background: #e5e7eb;
  color: #18181b;
  font-size: 15px;
  font-weight: 900;
}

body[data-ui-theme="modern"] .nav button.active,
body[data-ui-theme="modern"] .mode-toggle button.active,
body[data-ui-theme="modern"] button.active,
body[data-ui-theme="modern"] button.secondary.active {
  background: var(--modern-accent);
  color: #fff;
}

body[data-ui-theme="modern"] .card,
body[data-ui-theme="modern"] .subsection,
body[data-ui-theme="modern"] fieldset,
body[data-ui-theme="modern"] .navigation-panel {
  border: 1px solid rgba(24, 24, 27, 0.1);
  border-radius: 8px;
  background: var(--modern-panel);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

body[data-ui-theme="modern"] .subsection {
  background: #fbfdff;
}

body[data-ui-theme="modern"] h2,
body[data-ui-theme="modern"] h3 {
  letter-spacing: 0;
}

body[data-ui-theme="modern"] input,
body[data-ui-theme="modern"] select,
body[data-ui-theme="modern"] textarea {
  min-height: 42px;
  border: 1px solid var(--modern-line);
  border-radius: 8px;
  background: #fff;
  font-size: 16px;
}

body[data-ui-theme="modern"] button,
body[data-ui-theme="modern"] .button-link {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--modern-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: none;
}

body[data-ui-theme="modern"] button.secondary,
body[data-ui-theme="modern"] .button-link.secondary {
  border-color: var(--modern-accent);
  background: var(--modern-accent);
  color: #fff;
}

body[data-ui-theme="modern"] .nav button:hover,
body[data-ui-theme="modern"] .mode-toggle button:hover,
body[data-ui-theme="modern"] button:hover,
body[data-ui-theme="modern"] .button-link:hover {
  background: var(--modern-accent-strong);
  color: #fff;
}

body[data-ui-theme="modern"] button.danger {
  background: #b91c1c;
  color: #fff;
}

body[data-ui-theme="modern"] .stats-grid > div,
body[data-ui-theme="modern"] .stat-box,
body[data-ui-theme="modern"] .admin-list-item,
body[data-ui-theme="modern"] .starter,
body[data-ui-theme="modern"] .group-box {
  border: 1px solid rgba(24, 24, 27, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

body[data-ui-theme="modern"] .responsive-table {
  border: 1px solid rgba(24, 24, 27, 0.08);
  border-radius: 8px;
  background: #fff;
}

body[data-ui-theme="modern"] .responsive-table th {
  background: #f8fafc;
  color: var(--modern-muted);
  font-size: 13px;
}

body[data-ui-theme="modern"] .responsive-table td {
  border-color: #edf2f7;
}

body[data-ui-theme="modern"] .clickable-row:hover {
  background: #f4f4f5;
}

body[data-ui-theme="modern"] .status-pill,
body[data-ui-theme="modern"] .tag {
  border-radius: 999px;
}

@media (max-width: 760px) {
  .detail-list {
    grid-template-columns: 1fr;
  }

  .section-title-row {
    align-items: stretch;
  }

  .section-title-row button {
    width: 100%;
  }

  body[data-ui-theme="modern"] .app {
    padding: 14px 12px 28px;
  }

  body[data-ui-theme="modern"] .card {
    padding: 14px;
  }

  body[data-ui-theme="modern"] .nav,
  body[data-ui-theme="modern"] .mode-toggle {
    border-radius: 8px;
  }
}

body[data-ui-theme="modern"] #tournamentManageActions button.active,
body[data-ui-theme="modern"] #tournamentManageActions button.secondary.active,
body[data-ui-theme="modern"] .offline-control button.active,
body[data-ui-theme="modern"] .mobile-quick-actions button,
body[data-ui-theme="modern"] #mobileNavigateEventBtn {
  background: var(--modern-accent);
  color: #fff;
}

body[data-ui-theme="modern"] #tournamentManageActions button,
body[data-ui-theme="modern"] .mobile-quick-actions button.secondary {
  background: #e5e7eb;
  color: #18181b;
}

body[data-ui-theme="modern"] #tournamentManageActions button.active,
body[data-ui-theme="modern"] #tournamentManageActions button:hover,
body[data-ui-theme="modern"] .mobile-quick-actions button:hover,
body[data-ui-theme="modern"] #mobileNavigateEventBtn:hover {
  background: var(--modern-accent-strong);
  color: #fff;
}

@media (max-width: 760px) {
  .super-admin-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .super-admin-hero h1 {
    font-size: 31px;
  }

  .super-admin-user {
    min-width: 0;
  }

  .super-admin-context-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .super-admin-context-bar .button-link {
    width: 100%;
  }

  .super-admin-health {
    grid-template-columns: 1fr;
  }

  .super-admin-split {
    grid-template-columns: 1fr;
  }

  .nav button {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }

  body[data-ui-theme="modern"] .mode-toggle {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  body[data-ui-theme="modern"] .mode-toggle button {
    flex: 1 0 max-content;
    background: #e5e7eb;
    color: #18181b;
    white-space: nowrap;
  }

  body[data-ui-theme="modern"] .mode-toggle button.active {
    background: var(--modern-accent);
    color: #fff;
  }
}

button.link-button,
body[data-ui-theme="modern"] button.link-button {
  width: auto;
  min-height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #18181b;
  text-align: left;
  text-decoration: underline;
  box-shadow: none;
}

button.compact-button,
body[data-ui-theme="modern"] button.compact-button {
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 8px 10px;
}
