* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: #f6f7fb; color: #111827; }
.container { width: min(960px, 92%); margin: 0 auto; }
.centered { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); padding: 24px; width: min(460px, 100%); }
h1, h2, h3 { margin-top: 0; }
.btn { display: inline-block; padding: 10px 16px; border: 0; border-radius: 8px; cursor: pointer; background: #1d4ed8; color: #fff; text-decoration: none; }
.btn.secondary { background: #334155; }
.btn.danger { background: #b91c1c; }
.btn.success { background: #15803d; }
.btn.tiny { padding: 6px 10px; font-size: 12px; margin-right: 6px; }
.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 6px; font-size: 14px; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 8px; padding: 10px; font-family: inherit; }
.field textarea { min-height: 90px; }
.error { color: #b91c1c; font-size: 14px; min-height: 18px; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px;
  flex: 0 0 248px;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  background: #0f172a;
  color: #fff;
  padding: 24px 16px;
}
.sidebar h3 { margin: 0 0 16px; }
.menu-section-title {
  margin: 14px 10px 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.menu-section-title:first-of-type { margin-top: 4px; }
.menu-item { display: block; color: #cbd5e1; text-decoration: none; padding: 8px 10px; border-radius: 6px; margin-bottom: 6px; }
.menu-item:hover, .menu-item.active { background: #1e293b; color: #fff; }
.main {
  margin-left: 248px;
  width: calc(100% - 248px);
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.topbar { height: 62px; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; }
.content { padding: 24px 20px; overflow-x: hidden; }
.content-shell { width: min(1220px, 100%); margin: 0 auto; padding: 0 4px; }
.users-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.users-page-title { margin: 0; font-size: 1.4rem; }
.users-search-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.muted { color: #64748b; }

.page-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.search-input { max-width: 280px; width: 100%; border-radius: 8px; border: 1px solid #d1d5db; padding: 10px; }
.table-wrap { width: 100%; overflow-x: auto; }
.flash { margin-bottom: 16px; padding: 10px 12px; border-radius: 8px; }
.flash.success { background: #dcfce7; color: #166534; }
.flash.error { background: #fee2e2; color: #991b1b; }
.flash.hidden { display: none; }
.panel-card { background: #fff; border-radius: 12px; border: 1px solid #e2e8f0; padding: 16px; margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 10px; border-bottom: 1px solid #e2e8f0; vertical-align: middle; }
.competitions-table th:first-child,
.competitions-table td:first-child {
  width: 36%;
}

.competitions-table th:nth-child(2),
.competitions-table td:nth-child(2) {
  width: 24%;
}

.competition-slug {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-pill { padding: 4px 8px; border-radius: 999px; font-size: 12px; text-transform: uppercase; background: #e2e8f0; }
.status-pill.active { background: #dcfce7; color: #166534; }
.status-pill.inactive { background: #fee2e2; color: #991b1b; }
.org-header { display: grid; grid-template-columns: 120px 1fr auto; gap: 16px; align-items: center; }
.org-logo-wrap { width: 120px; height: 120px; }
.org-logo { width: 120px; height: 120px; object-fit: contain; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; }
.org-logo.placeholder { display: flex; align-items: center; justify-content: center; font-size: 12px; color: #64748b; border: 1px dashed #cbd5e1; border-radius: 10px; width: 120px; height: 120px; }
.actions-right { justify-self: end; }
.grid-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid h2, .field-full, .actions-row { grid-column: 1 / -1; }
.actions-row { display: flex; gap: 8px; }
.checkbox-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; }
.checkbox-item { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.athlete-modality-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.athlete-modality-item {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
}
.athlete-modality-item input { width: auto; }
.athlete-modality-content { display: flex; align-items: baseline; gap: 8px; }
.athlete-modality-name { font-weight: 600; color: #0f172a; }
.athlete-modality-prefix {
  color: #334155;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  letter-spacing: 0.02em;
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    flex-basis: auto;
  }
  .main {
    margin-left: 0;
    width: 100%;
  }
  .grid-two, .form-grid, .org-header { grid-template-columns: 1fr; }
  .checkbox-list { grid-template-columns: 1fr; }
}

.hidden { display: none !important; }
.scope-pill { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; background: #dbeafe; color: #1e3a8a; }
.scope-pill.scope-system { background: #fee2e2; color: #991b1b; }
.scope-pill.default-pill { font-weight: 600; }
.scope-pill.default-pill-entity { background: #dcfce7; color: #166534; }
.scope-pill.default-pill-organization { background: #dbeafe; color: #1d4ed8; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.permission-group { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.permission-group h4 { margin: 0 0 8px; }
.permission-group-system { border-color: #fecaca; background: #fff7f7; }
.panel-note { border: 1px dashed #94a3b8; border-radius: 8px; padding: 8px 10px; color: #334155; background: #f8fafc; }
.default-role-settings { display: grid; gap: 12px; margin-top: 8px; }
.default-role-item { border: 1px solid #cbd5e1; border-radius: 10px; padding: 12px; background: #f8fafc; }
.default-role-item.is-active { border-color: #22c55e; box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.25) inset; background: #f0fdf4; }
.default-role-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.default-role-options { display: grid; gap: 8px; }
.radio-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.impersonation-banner { background: #fef3c7; border-bottom: 1px solid #f59e0b; padding: 10px 20px; color: #78350f; }
.impersonation-banner-content { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.status-pill.draft { background: #e2e8f0; color: #0f172a; }
.status-pill.published { background: #dcfce7; color: #166534; }
.status-pill.archived { background: #f1f5f9; color: #475569; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-grid.compact { gap: 10px; }
.checkbox-inline { display: flex; align-items: center; }
code { background: #f1f5f9; border: 1px solid #e2e8f0; padding: 2px 6px; border-radius: 6px; }
.op-tree { display: flex; flex-direction: column; gap: 12px; }
.op-division { border: 1px solid #334155; border-radius: 10px; padding: 12px; background: #0f172a; color: #e2e8f0; }
.op-age-group, .op-level, .op-group { border: 1px solid #334155; border-radius: 8px; padding: 10px; margin-top: 10px; background: #1e293b; }
.op-level { background: #1a2437; }
.op-group { background: #152033; }
.op-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.op-title { margin: 0; font-size: 15px; font-weight: 700; }
.op-subtitle { font-size: 13px; color: #cbd5e1; margin: 4px 0 0; }
.op-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.op-form-inline { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.op-form-inline input, .op-form-inline select { min-width: 180px; }
.op-apparatus-list { margin: 8px 0 0; padding-left: 18px; }
.op-apparatus-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 6px; }

.doc-editor-shell { display: flex; flex-direction: column; gap: 10px; }
.doc-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.doc-editor-tabs { display: flex; gap: 8px; }
.doc-editor-tab-help { margin: 0; }
.doc-editor-pane {
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
}
.doc-editor-surface {
  padding: 12px;
  background: #fff;
  border-radius: 0 0 10px 10px;
}
.doc-editor {
  min-height: 340px;
  font-family: "Times New Roman", Times, serif;
  color: #0f172a;
  line-height: 1.5;
}
.doc-editor:focus-within { outline: none; }
.doc-editor-fallback {
  min-height: 340px;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.doc-editor .ProseMirror {
  min-height: 316px;
  outline: none;
}
.doc-editor .ProseMirror p { margin: 0 0 12px; }
.doc-editor .ProseMirror h2 {
  margin: 16px 0 10px;
  font-size: 24px;
  line-height: 1.25;
}
.doc-editor .ProseMirror h3 {
  margin: 14px 0 8px;
  font-size: 18px;
  line-height: 1.3;
}
.doc-editor .ProseMirror ul,
.doc-editor .ProseMirror ol {
  padding-left: 24px;
  margin: 0 0 12px;
}
.doc-editor .ProseMirror blockquote {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-left: 3px solid #334155;
  color: #334155;
  background: #f8fafc;
}

.doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid #d1d5db;
  background: #f8fafc;
  border-radius: 10px 10px 0 0;
}
.doc-toolbar-group {
  display: flex;
  gap: 6px;
  align-items: center;
  padding-right: 8px;
  border-right: 1px solid #e2e8f0;
}
.doc-toolbar-group:last-child {
  border-right: 0;
  padding-right: 0;
}
.doc-toolbar-button {
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  padding: 6px 8px;
  cursor: pointer;
  min-width: 34px;
}
.doc-toolbar-button:hover { background: #f1f5f9; }
.doc-toolbar-button.is-active {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1e3a8a;
}
.doc-toolbar-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.doc-html-textarea {
  min-height: 340px;
  border: 0;
  border-radius: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  background: #fff;
}

.competition-document-template { font-family: "Times New Roman", Times, serif; color: #111827; }
.doc-institutional {
  font-size: 14px;
  line-height: 1.55;
}
.doc-card-shell {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 14px 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.doc-header-block { margin: 2px 0 18px; }
.doc-header-brand-line {
  height: 5px;
  background: linear-gradient(90deg, #0f172a, #1d4ed8);
  border-radius: 3px;
  margin-bottom: 10px;
}
.doc-header-main {
  display: grid;
  grid-template-columns: 96px 1fr 96px;
  align-items: center;
  column-gap: 12px;
}
.doc-header-logo { display: flex; justify-content: center; align-items: center; margin: 0; min-height: 74px; }
.doc-header-logo-image { max-width: 70px; max-height: 70px; object-fit: contain; }
.doc-header-logo-host { justify-content: flex-end; }
.doc-header-logo-placeholder {
  border: 1px dashed #94a3b8;
  color: #64748b;
  border-radius: 8px;
  min-width: 70px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  font-size: 10px;
  text-align: center;
}
.doc-header-titles { text-align: center; }
.doc-header-organization {
  margin: 0 0 4px;
  font-size: 10px;
  letter-spacing: 0.9px;
  font-weight: 700;
  color: #0f172a;
}
.doc-header-title {
  margin: 0 auto;
  font-size: 15px;
  text-transform: uppercase;
  line-height: 1.16;
  max-width: 100%;
  color: #020617;
}
.doc-header-subtitle {
  margin: 4px 0 6px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #475569;
}
.doc-header-divider {
  margin: 0 auto;
  width: 100%;
  border-bottom: 1px solid #0f172a;
}
.doc-logo-preview-wrapper {
  margin-top: 8px;
}
.doc-logo-preview {
  display: block;
  width: 100%;
  max-width: 260px;
  max-height: 120px;
  object-fit: contain;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}
.doc-body-block p { margin: 0 0 12px; }
.doc-section {
  margin: 0 0 24px;
  page-break-inside: avoid;
}
.doc-section-title {
  margin: 0 0 10px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid #1e293b;
  padding-bottom: 7px;
}
.doc-section-content p {
  margin: 0 0 10px;
}

.topbar-user {
  position: relative;
}
.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}
.user-menu-trigger:hover {
  background: #f8fafc;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.user-trigger-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
}
.user-menu-card {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 260px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  z-index: 1000;
}
.user-menu-info {
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}
.user-menu-name {
  margin: 0 0 4px;
  font-weight: 700;
}
.user-menu-sub {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}
.user-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn.danger {
  background: #b91c1c;
}
.btn.danger:hover {
  background: #991b1b;
}

.account-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}
.account-modal--profile {
  z-index: 1200;
}
.account-modal--crop {
  z-index: 1300;
}
.account-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.account-modal--crop .account-modal-backdrop {
  background: rgba(15, 23, 42, 0.62);
}
.account-modal-card {
  position: relative;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  width: min(480px, 92vw);
  padding: 16px;
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.25);
}
.account-modal.is-under-crop .account-modal-card {
  pointer-events: none;
}
.profile-modal-card {
  width: min(760px, 96vw);
  max-height: 92vh;
  overflow-y: auto;
}
.account-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.icon-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #475569;
  font-size: 18px;
}
.feedback-message {
  min-height: 20px;
  margin: 0;
  font-size: 14px;
}
.feedback-message.error { color: #b91c1c; }
.feedback-message.success { color: #166534; }
.profile-section {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}
.profile-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #0f172a;
}

@media (max-width: 900px) {
  .topbar {
    height: auto;
    min-height: 62px;
    padding: 10px 16px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .user-menu-card {
    right: -6px;
    min-width: min(280px, calc(100vw - 32px));
  }
}
.doc-section-content p:last-child {
  margin-bottom: 0;
}
.doc-opening-eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: #1e293b;
}
.doc-opening-intro {
  margin: 0 0 10px;
  font-size: 14px;
}
.doc-opening-summary {
  margin: 0;
  font-size: 13px;
  color: #334155;
}
.doc-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.doc-info-item {
  border: 1px solid #94a3b8;
  border-left: 4px solid #1d4ed8;
  border-radius: 8px;
  padding: 8px 10px 9px;
  background: #f8fafc;
}
.doc-info-label {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #334155;
}
.doc-info-value {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}
.doc-bullet-list {
  margin: 0;
  padding-left: 18px;
}
.doc-bullet-list li {
  margin: 0 0 6px;
}
.doc-highlight-grid {
  display: grid;
  gap: 10px;
}
.doc-highlight-card {
  border: 1px solid #bfdbfe;
  border-left: 4px solid #1d4ed8;
  border-radius: 10px;
  background: #f8fbff;
  padding: 10px 12px;
}
.doc-highlight-card-title {
  margin: 0 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #1e3a8a;
}
.doc-highlight-card .doc-bullet-list {
  margin-top: 6px;
}
.doc-footer-block {
  margin-top: 26px;
  border-top: 1px solid #0f172a;
  padding-top: 16px;
  text-align: center;
}
.doc-footer-block p {
  margin: 0 0 6px;
}

.competition-document-export-sheet {
  position: fixed;
  top: 0;
  left: 0;
  width: 210mm;
  min-height: 297mm;
  background: #fff;
  color: #111827;
  padding: 16mm 14mm;
  box-sizing: border-box;
  z-index: -1;
  pointer-events: none;
}

.competition-document-print-root {
  width: 100%;
  min-height: calc(297mm - 32mm);
}

@media (max-width: 800px) {
  .doc-header-main {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }
  .doc-header-logo-host { justify-content: center; }
}

@media print {
  .doc-card-shell { padding: 8px 12px 10px; }
  .doc-header-block { margin: 0 0 12px; }
  .doc-header-brand-line {
    height: 4px;
    margin-bottom: 8px;
  }
  .doc-header-main {
    grid-template-columns: 80px 1fr 80px;
    column-gap: 10px;
  }
  .doc-header-logo { min-height: 64px; }
  .doc-header-logo-image {
    max-width: 64px;
    max-height: 64px;
  }
  .doc-header-title {
    font-size: 13px;
    line-height: 1.15;
  }
  .doc-header-organization {
    font-size: 9px;
    margin-bottom: 2px;
  }
  .doc-header-subtitle {
    font-size: 8px;
    margin: 2px 0 4px;
  }
}

.user-avatar.avatar-image {
  object-fit: cover;
  padding: 0;
  background: #e2e8f0;
}

.user-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.users-table th,
.users-table td {
  padding: 14px 10px;
}

.users-table th:last-child,
.users-table td:last-child {
  text-align: right;
}

.user-main-cell {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.user-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-name {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
}

.user-email {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.org-entity-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.org-name,
.entity-name {
  margin: 0;
}

.org-name {
  font-weight: 600;
  color: #1e293b;
}

.entity-name {
  color: #64748b;
  padding-left: 8px;
}

.roles-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.listing-main-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 220px;
}

.listing-title,
.listing-subtitle,
.listing-meta {
  margin: 0;
}

.listing-title {
  font-weight: 700;
  color: #0f172a;
}

.listing-subtitle {
  color: #64748b;
  font-size: 13px;
}

.listing-meta {
  color: #475569;
  font-size: 12px;
}

.listing-contact-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.listing-contact-cell p {
  margin: 0;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  background: #e2e8f0;
  color: #334155;
}

.user-actions-cell {
  width: 76px;
}

.user-actions-menu {
  position: relative;
  display: inline-flex;
}

.user-actions-trigger {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 20px;
  line-height: 0;
  cursor: pointer;
}

.user-actions-trigger:hover {
  background: #f8fafc;
}

.user-actions-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 168px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-actions-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  color: #0f172a;
  text-decoration: none;
  font-size: 14px;
}

.user-actions-item:hover {
  background: #f1f5f9;
}

.user-actions-item.danger {
  color: #b91c1c;
}

.user-actions-item.danger:hover {
  background: #fee2e2;
}

.user-actions-separator {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

.confirm-delete-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
}

.confirm-delete-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.confirm-delete-card {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100% - 24px));
  background: #fff;
  border-radius: 12px;
  padding: 18px;
}

.confirm-delete-code {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #b91c1c;
  text-align: center;
  margin: 8px 0 12px;
}

.table-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

.avatar-field {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
}

.avatar-preview-box {
  width: 112px;
  height: 112px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview-placeholder {
  font-size: 12px;
  color: #64748b;
}

.avatar-field-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.actions-row.compact {
  justify-content: flex-start;
}

.avatar-editor-card {
  width: min(860px, 96vw);
}

.avatar-editor-body {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 16px;
  margin-bottom: 12px;
}

.avatar-editor-canvas-wrap {
  width: 320px;
  height: 320px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background: #0f172a;
}

.avatar-editor-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.avatar-editor-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.avatar-editor-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #334155;
}

.pdf-debug-panel {
  grid-column: 1 / -1;
  margin-top: 10px;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.pdf-debug-panel h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.pdf-debug-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.pdf-debug-block {
  margin-bottom: 10px;
}

.pdf-debug-block pre {
  margin: 6px 0 0;
  background: #0f172a;
  color: #e2e8f0;
  padding: 8px;
  border-radius: 8px;
  max-height: 220px;
  overflow: auto;
  font-size: 12px;
}

@media (max-width: 900px) {
  .avatar-field {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .avatar-field-actions {
    width: 100%;
  }

  .avatar-editor-body {
    grid-template-columns: 1fr;
  }

  .avatar-editor-canvas-wrap {
    width: min(320px, 100%);
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .users-table th,
  .users-table td {
    padding-top: 12px;
    padding-bottom: 12px;
  }
}

.public-music-page { width: min(1280px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.public-card-wide { width: 100%; }
.public-music-header h1 { margin-bottom: 6px; font-size: 1.55rem; }
.public-music-subtitle { margin: 0 0 12px; color: #334155; font-size: 1.05rem; }
.public-meta-row { display: flex; gap: 12px; flex-wrap: wrap; color: #475569; }
.public-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 12px; align-items: end; }
.public-filter-action { margin-bottom: 12px; }
.public-counter { margin-bottom: 10px; color: #475569; font-size: 14px; }
.public-table-wrap { border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.public-musics-table th { white-space: nowrap; background: #f8fafc; font-size: 13px; }
.public-musics-table td { font-size: 14px; }
.public-musics-table tbody tr:hover { background: #f8fafc; }
.public-athlete-cell { min-width: 220px; font-weight: 600; color: #0f172a; }
.public-badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; background: #e2e8f0; color: #1e293b; font-size: 12px; }
.public-player-wrap audio { width: 210px; max-width: 100%; height: 32px; }
.public-audio-error { display: none; color: #b91c1c; font-size: 12px; }
.public-empty { margin-top: 12px; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 14px; color: #334155; background: #f8fafc; text-align: center; }

@media (max-width: 780px) {
  .public-musics-table { min-width: 980px; }
  .public-player-wrap audio { width: 170px; }
}

.trash-page { display: flex; flex-direction: column; gap: 16px; }
.trash-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 12px;
}
.trash-empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
}
.trash-empty-state h3 { margin: 0; color: #475569; }
.trash-type-badge { background: #dbeafe; color: #1e3a8a; text-transform: none; }
.trash-table tbody tr:hover { background: #f8fafc; }
.trash-actions-cell { white-space: nowrap; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 12px;
}
.modal-content {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 18px;
}
