:root {
  --ink: #182026;
  --muted: #63717d;
  --line: #d9e1e5;
  --surface: #f7f9fa;
  --panel: #ffffff;
  --nav: #17262d;
  --nav-soft: #21343d;
  --accent: #0d7c66;
  --accent-2: #b54124;
  --gold: #d59b2d;
  --blue: #356ea6;
  --field: #236f45;
  --field-dark: #1d5c3b;
  --shadow: 0 12px 28px rgba(18, 32, 38, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.sidebar {
  background: var(--nav);
  color: #f5faf9;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 48px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  color: #b7c7c9;
  font-size: 13px;
  margin-top: 2px;
}

.nav-tabs {
  display: grid;
  gap: 6px;
}

.nav-tab {
  border: 0;
  background: transparent;
  color: #cfdbdd;
  text-align: left;
  padding: 12px 12px;
  border-radius: 8px;
}

.nav-tab:hover,
.nav-tab.active {
  background: var(--nav-soft);
  color: white;
}

.workspace {
  padding: 24px;
  min-width: 0;
}

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

.eyebrow {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  margin: 0 0 6px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
}

h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.topbar-actions,
.tool-group,
.film-tools,
.segmented {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-button,
.icon-button,
.tool-button,
.film-tools button,
.segmented button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  min-height: 38px;
  padding: 0 13px;
}

.primary-button {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 700;
}

.icon-button,
.tool-button {
  width: 38px;
  padding: 0;
  display: grid;
  place-items: center;
}

.tool-group {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tool-group .tool-button {
  width: auto;
  min-width: 58px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tool-button.active,
.segmented .active {
  background: #e8f3ef;
  color: var(--accent);
  border-color: #9bd1c0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.layout {
  display: grid;
  gap: 18px;
}

.two-column {
  grid-template-columns: 330px minmax(0, 1fr);
}

.film-layout {
  grid-template-columns: minmax(0, 1.4fr) 420px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel.compact {
  background: var(--nav-soft);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  padding: 14px;
}

.panel-heading {
  min-height: 60px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact .panel-heading {
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

select {
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-value,
.stat-label {
  display: block;
}

.stat-value {
  font-size: 21px;
  font-weight: 800;
}

.stat-label {
  color: #b7c7c9;
  font-size: 12px;
  margin-top: 2px;
}

.play-list {
  padding: 10px;
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 190px);
  overflow: auto;
}

.play-card,
.clip-row,
.call-item,
.practice-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.play-card {
  display: grid;
  gap: 6px;
  padding: 12px;
  text-align: left;
}

.play-card.active {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}

.play-card strong {
  font-size: 15px;
}

.meta-line {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  font-size: 11px;
  border-radius: 999px;
  padding: 3px 7px;
  background: #eef3f5;
  color: #40515a;
}

.field-panel {
  min-width: 0;
  overflow: hidden;
}

.field-toolbar {
  min-height: 72px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.field-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.quick-draw-bar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #fbfcfc;
}

.quick-draw-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quick-draw-bar input,
.quick-draw-bar select {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 10px;
  background: white;
  color: var(--ink);
}

.play-name-field input {
  width: 180px;
  font-weight: 700;
}

.quick-draw-bar input[type="color"] {
  width: 42px;
  padding: 3px;
}

.quick-draw-bar .number-input {
  width: 70px;
}

.quick-draw-bar button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  background: white;
}

.quick-draw-bar button.active {
  border-color: #9bd1c0;
  background: #e8f3ef;
  color: var(--accent);
}

.quick-draw-bar span {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.surface-wrap {
  padding: 16px;
  background: #eef3f1;
  display: grid;
  place-items: center;
}

.football-field {
  display: block;
  width: 100%;
  max-width: 1120px;
  aspect-ratio: 960 / 540;
  border-radius: 8px;
  background: #f9faf8;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
  touch-action: none;
  user-select: none;
}

.field-text-content {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  overflow-wrap: anywhere;
  outline: none;
}

.vertical-field {
  border: 1px solid #cfd6d8;
}

.player-marker,
.defender-marker {
  cursor: grab;
}

.player-marker:active,
.defender-marker:active {
  cursor: grabbing;
}

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 16px;
}

.details-grid ul {
  padding-left: 18px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.clip-stack {
  display: grid;
  gap: 8px;
}

.clip-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.clip-chip strong,
.clip-chip span {
  display: block;
}

.clip-chip span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.video-panel {
  overflow: hidden;
}

.video-stage {
  padding: 16px;
}

.video-frame {
  min-height: 430px;
  border-radius: 8px;
  background: #11191d;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
}

.video-placeholder {
  display: grid;
  place-items: center;
  align-content: center;
  color: white;
  gap: 8px;
  text-align: center;
}

.video-placeholder span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}

.video-placeholder strong {
  font-size: 26px;
}

.video-placeholder small {
  color: #b8c2c7;
}

.timeline {
  height: 12px;
  background: #28383f;
}

.timeline span {
  display: block;
  height: 100%;
  background: var(--gold);
}

.film-tools {
  padding: 0 16px 16px;
  flex-wrap: wrap;
}

.clip-list {
  padding: 10px;
  display: grid;
  gap: 8px;
}

.clip-row {
  padding: 12px;
  text-align: left;
}

.clip-row.active {
  border-color: var(--blue);
  box-shadow: inset 4px 0 0 var(--blue);
}

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

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

.call-actions button,
.call-meta-bar input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  min-height: 38px;
  padding: 0 12px;
}

.call-meta-bar {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfc;
}

.call-meta-bar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.call-meta-bar input {
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
}

.call-sheet-workspace {
  background: #e9eef1;
  overflow: auto;
  padding: 18px;
}

.call-sheet-canvas {
  position: relative;
  width: 1280px;
  height: 900px;
  background: #ffffff;
  border: 1px solid #b9c2c7;
  box-shadow: 0 16px 38px rgba(18, 32, 38, 0.16);
  background-image:
    linear-gradient(to right, rgba(24, 32, 38, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(24, 32, 38, 0.045) 1px, transparent 1px);
  background-size: 40px 32px;
}

.call-board-section {
  position: absolute;
  border: 1px solid #222b31;
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(18, 32, 38, 0.08);
}

.call-board-section.dragging {
  opacity: 0.86;
  box-shadow: 0 18px 32px rgba(18, 32, 38, 0.2);
  z-index: 4;
}

.call-section-title {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #efefef;
  border-bottom: 1px solid #222b31;
  font-size: 13px;
  font-weight: 900;
}

.call-drag-handle {
  color: #697780;
  font-weight: 900;
  cursor: move;
  user-select: none;
  padding: 2px 4px;
}

.call-title-text {
  flex: 1;
  min-width: 0;
}

.call-title-text[contenteditable="true"],
.call-cell[contenteditable="true"] {
  outline: none;
}

.call-title-text:focus,
.call-cell:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.call-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.call-table th,
.call-table td {
  border-right: 1px solid #222b31;
  border-bottom: 1px solid #222b31;
  padding: 4px 5px;
  height: 28px;
  vertical-align: middle;
}

.call-table th:last-child,
.call-table td:last-child {
  border-right: 0;
}

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

.call-table th {
  background: #f7f7f7;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.call-cell {
  min-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-cell.play-link {
  color: var(--blue);
  font-weight: 800;
}

.call-accent-blue .call-section-title {
  background: #cfe2f3;
}

.call-accent-pink .call-section-title {
  background: #ead1dc;
}

.call-accent-red .call-section-title {
  background: #e94434;
  color: white;
}

.call-accent-green .call-section-title {
  background: #d9ead3;
}

.practice-script {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.practice-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.period {
  color: var(--accent-2);
  font-weight: 800;
}

.practice-row p {
  margin: 3px 0 0;
  color: var(--muted);
}

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

.roster-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.roster-table th,
.roster-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.roster-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

  .sidebar {
    position: static;
  }

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

  .nav-tab {
    text-align: center;
  }

  .two-column,
  .film-layout {
    grid-template-columns: 1fr;
  }

  .play-list {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 14px;
  }

  .topbar,
  .field-toolbar,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .tool-group,
  .film-tools,
  .segmented,
  .quick-draw-bar {
    width: 100%;
    flex-wrap: wrap;
  }

  .quick-draw-bar span {
    margin-left: 0;
  }

  .call-meta-bar {
    grid-template-columns: 1fr;
  }

  .nav-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .details-grid,
  .practice-row {
    grid-template-columns: 1fr;
  }

  .video-frame {
    min-height: 300px;
  }
}
