:root {
  --ink: #071823;
  --ink-soft: #173443;
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #ebe7de;
  --line: #dcd6ca;
  --muted: #6f6a62;
  --orange: #d9601a;
  --orange-dark: #a8112a;
  --orange-soft: #f9e1d2;
  --teal: #007f72;
  --teal-soft: #d4f3ee;
  --focus: #a3e635;
  --success: #147a44;
  --success-soft: #dcefe4;
  --warning: #a05a00;
  --warning-soft: #f8e7c7;
  --danger: #b72a2a;
  --danger-soft: #f5dada;
  --blue: #2458a6;
  --blue-soft: #dfe8f7;
  --shadow: 0 18px 50px rgba(19, 18, 16, 0.08);
  --radius: 18px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% -10%, rgba(217, 96, 26, 0.08), transparent 26rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.88fr);
}

.auth-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: clamp(2rem, 5vw, 5rem);
  overflow: hidden;
  background: var(--ink);
  color: #fff;
}

.auth-story::after {
  content: "";
  position: absolute;
  width: 26rem;
  height: 26rem;
  right: -8rem;
  bottom: -10rem;
  border: 4rem solid rgba(217, 96, 26, 0.52);
  border-radius: 50%;
}

.auth-brand,
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: inherit;
  text-decoration: none;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.brand-logo {
  display: block;
  width: 114px;
  height: auto;
  object-fit: contain;
}

.auth-copy {
  position: relative;
  z-index: 1;
  max-width: 42rem;
  padding: 4rem 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--orange-dark);
  font-size: 0.73rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-story .eyebrow {
  color: var(--orange);
}

.eyebrow::before {
  content: "";
  width: 1.8rem;
  height: 2px;
  background: currentColor;
}

.auth-copy h1 {
  max-width: 11ch;
  margin: 1.3rem 0 1.25rem;
  font-size: clamp(3rem, 7vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.auth-copy p {
  max-width: 42rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: clamp(1rem, 1.8vw, 1.24rem);
  line-height: 1.65;
}

.auth-proof {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 2rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
}

.auth-proof strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #fff;
  font-size: 1.35rem;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: 2rem;
}

.auth-card {
  width: min(100%, 28rem);
  padding: clamp(1.7rem, 4vw, 2.6rem);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 0 0 0.55rem;
  font-size: 1.75rem;
  letter-spacing: -0.04em;
}

.auth-card > p {
  margin: 0 0 1.65rem;
  color: var(--muted);
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.field label,
.field-label {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.045em;
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  padding: 0.72rem 0.82rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--orange);
  outline: none;
  box-shadow: 0 0 0 3px rgba(217, 96, 26, 0.12);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 0.48rem;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.68rem 1rem;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.button:hover {
  transform: translateY(-1px);
  background: var(--ink-soft);
}

.button.primary {
  background: var(--orange-dark);
}

.button.primary:hover {
  background: #861024;
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.secondary:hover {
  border-color: #b9b1a3;
  background: #fff;
}

.button.ghost {
  background: transparent;
  color: var(--muted);
}

.button.danger {
  background: var(--danger);
}

.button.small {
  min-height: 36px;
  border-radius: 10px;
  padding: 0.45rem 0.68rem;
  font-size: 0.75rem;
}

.button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.button.full {
  width: 100%;
}

.form-message {
  min-height: 1.25rem;
  margin-top: 0.65rem;
  color: var(--danger);
  font-size: 0.78rem;
  line-height: 1.45;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 1.5rem 1.15rem;
  background: var(--ink);
  color: #fff;
}

.sidebar .brand-lockup {
  padding: 0.25rem 0.5rem;
}

.workspace-label {
  margin: -1rem 0.5rem 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 0.32rem;
}

.nav-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 0.8rem;
  border: 0;
  border-radius: 12px;
  padding: 0.65rem 0.78rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
}

.nav-button:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.nav-button.active {
  background: var(--orange-dark);
  color: #fff;
}

.nav-icon {
  display: grid;
  width: 1.35rem;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 900;
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 0.65rem;
}

.account-chip {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 0.65rem;
  padding: 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
}

.account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(217, 96, 26, 0.22);
  color: #ffb17f;
  font-size: 0.72rem;
  font-weight: 900;
}

.account-chip strong,
.account-chip small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip strong {
  font-size: 0.78rem;
}

.account-chip small {
  margin-top: 0.14rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.66rem;
}

.main-area {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 2rem;
  border-bottom: 1px solid rgba(220, 214, 202, 0.8);
  background: rgba(244, 241, 234, 0.9);
  backdrop-filter: blur(18px);
}

.page-heading h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.035em;
}

.page-heading p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.mobile-menu {
  display: none;
}

.content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 2rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: view-in 0.22s ease;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}

.section-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-intro h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.section-intro p {
  max-width: 44rem;
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.metric {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(19, 18, 16, 0.035);
}

.metric::after {
  content: "";
  position: absolute;
  width: 4.6rem;
  height: 4.6rem;
  right: -2.2rem;
  top: -2.2rem;
  border: 1rem solid var(--orange-soft);
  border-radius: 50%;
}

.metric-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.metric-value {
  margin-top: 0.55rem;
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  font-weight: 900;
  letter-spacing: -0.06em;
}

.metric-meta {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 1rem;
}

.grid-equal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(19, 18, 16, 0.035);
}

.panel-head {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: -0.025em;
}

.panel-head p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.67rem;
}

.panel-body {
  padding: 1rem;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(120px, 180px));
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.toolbar input,
.toolbar select {
  min-height: 42px;
  padding-block: 0.55rem;
  font-size: 0.8rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.82rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 0.76rem;
}

th {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

tbody tr:hover td {
  background: rgba(217, 96, 26, 0.025);
}

.cell-title {
  display: block;
  color: var(--ink);
  font-weight: 780;
}

.cell-sub {
  display: block;
  margin-top: 0.16rem;
  color: var(--muted);
  font-size: 0.67rem;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 24px;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.success,
.badge.confirmed,
.badge.completed,
.badge.active,
.badge.approved,
.badge.published,
.badge.available {
  background: var(--success-soft);
  color: var(--success);
}

.badge.warning,
.badge.pending,
.badge.pending_verification,
.badge.draft,
.badge.booked {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.danger,
.badge.cancelled,
.badge.suspended {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.info,
.badge.venue,
.badge.coach {
  background: var(--blue-soft);
  color: var(--blue);
}

.list {
  display: grid;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.list-item:first-child {
  padding-top: 0;
}

.list-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.list-item h4 {
  margin: 0;
  font-size: 0.78rem;
}

.list-item p {
  margin: 0.22rem 0 0;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.45;
}

.empty-state {
  display: grid;
  min-height: 210px;
  place-items: center;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.loading-state {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.bars {
  display: flex;
  height: 190px;
  align-items: flex-end;
  gap: 0.75rem;
  padding-top: 1rem;
}

.bar-group {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.bar {
  width: 100%;
  min-height: 4px;
  border-radius: 8px 8px 3px 3px;
  background: var(--orange);
  transition: height 0.35s ease;
}

.bar-group span {
  display: block;
  margin-top: 0.5rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.6rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-line {
  position: relative;
  padding-left: 1.2rem;
}

.activity-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28rem;
  width: 7px;
  height: 7px;
  border: 2px solid var(--orange);
  border-radius: 50%;
  background: var(--surface);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 0.9rem;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 700;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
}

.field small,
.inline-note {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.inventory-toolbar {
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 220px) auto;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.media-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.media-card img,
.media-card video {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--ink);
}

.media-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem;
}

.media-card-meta span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-zone {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 1.5rem;
  border: 1px dashed #b9b1a3;
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
}

.upload-zone:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.upload-zone span {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.settings-panel {
  max-width: 920px;
}

.schedule-preview {
  min-height: 44px;
  margin-top: 0.4rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(16, 18, 20, 0.64);
  backdrop-filter: blur(8px);
}

.dialog-backdrop.open {
  display: flex;
}

.dialog {
  width: min(100%, 780px);
  max-height: min(90vh, 900px);
  overflow: auto;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3);
}

.dialog-head,
.dialog-actions {
  position: sticky;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--surface);
}

.dialog-head {
  top: 0;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.035em;
}

.dialog-actions {
  bottom: 0;
  border-top: 1px solid var(--line);
}

.dialog-body {
  padding: 1.2rem;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.1rem;
}

.toast-stack {
  position: fixed;
  z-index: 90;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  gap: 0.5rem;
}

.toast {
  width: min(360px, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.76rem;
  line-height: 1.45;
  animation: toast-in 0.2s ease;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.error {
  border-left-color: var(--danger);
}

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

@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-story {
    min-height: auto;
    padding: 2rem 1.5rem;
  }

  .auth-copy {
    padding: 4rem 0 2rem;
  }

  .auth-copy h1 {
    font-size: clamp(3rem, 16vw, 5rem);
  }

  .auth-proof {
    display: none;
  }

  .auth-panel {
    padding: 1.25rem;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    width: min(84vw, 300px);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.3);
  }

  .app-shell.menu-open .sidebar {
    transform: translateX(0);
  }

  .topbar {
    min-height: 68px;
    padding: 0 1rem;
  }

  .mobile-menu {
    display: grid;
  }

  .content {
    padding: 1.2rem 1rem 2rem;
  }

  .section-intro {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid-equal,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

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

@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
  }

  .metric {
    padding: 0.95rem;
  }

  .metric-value {
    font-size: 1.55rem;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .media-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions .button.secondary {
    display: none;
  }

  th,
  td {
    padding-inline: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
