/* Typeface — Datei und Familie hier tauschen, um eine andere Font zu testen.
   Preload in den Templates: static/fonts/Inter-Variable.ttf */
@font-face {
  font-family: 'Callsheet';
  src: url('/static/fonts/Inter-Variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root,
[data-theme="light"] {
  --primary: #B84AB8;
  --primary-hover: #A03DA0;
  --on-primary: #FFFFFF;
  --primary-dim: rgba(184, 74, 184, 0.10);
  --primary-highlight: #EAA0F5;
  --bg: #FFFDF9;
  --card: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F7F4EE;
  --nav-bg: #FFFDF9;
  --nav-hover-bg: #F3EFE8;
  --border: #E8E4DC;
  --text: #34353A;
  --text-muted: #52535C;
  --text-dim: #6E6F78;
  --text-placeholder: #8A8B94;
  --rating-1: #FF4459;
  --rating-2: #FF8A3D;
  --rating-3: #FFD23D;
  --rating-4: #A3D65C;
  --rating-5: #2ECC71;
  --danger: var(--rating-1);
  --danger-dim: color-mix(in srgb, var(--danger) 12%, transparent);
  --danger-border: color-mix(in srgb, var(--danger) 32%, transparent);
  --warning: #C4882A;
  --success: #1F9D63;
  --success-dim: rgba(31, 157, 99, 0.14);
  --accent-violet: #6D55E8;
  --accent-amber: #D97706;
  --accent-emerald: #059669;
  --accent-sky: #0284C7;
  --sidebar-w: 260px;
  --shadow-card: 0 1px 2px rgba(52, 53, 58, 0.03), 0 4px 16px rgba(52, 53, 58, 0.05);
  --shadow-lift: 0 8px 28px rgba(52, 53, 58, 0.08);
  --squircle-xi: 0.6;
  --squircle-mul: 1.12;
  --r-xs: calc(8px * var(--squircle-mul));
  --r-sm: calc(12px * var(--squircle-mul));
  --r-md: calc(16px * var(--squircle-mul));
  --r-lg: calc(20px * var(--squircle-mul));
  --r-xl: calc(28px * var(--squircle-mul));
  --r-2xl: calc(36px * var(--squircle-mul));
  --font: Callsheet, ui-sans-serif, system-ui, sans-serif;
  --font-features: "cv02", "cv03", "cv04", "cv11", "tnum";
  --font-nums: normal;
  --text-ui: 0.875rem;
  --text-table: 0.8rem;
  --text-list-head: 0.64rem;
  --text-col-head: var(--text-list-head);
  --text-content: 1rem;
}

[data-theme="dark"] {
  --primary: #EAA0F5;
  --primary-hover: #F0B5FA;
  --on-primary: #08090C;
  --primary-dim: rgba(234, 160, 245, 0.16);
  --primary-highlight: #EAA0F5;
  --bg: #08090C;
  --card: #141820;
  --surface: #141820;
  --surface-2: #1C2028;
  --nav-bg: #0E1016;
  --nav-hover-bg: #1C2028;
  --border: #2E323C;
  --text: #FFFFFF;
  --text-muted: #9AABAE;
  --text-dim: #7D8E91;
  --text-placeholder: #5C7275;
  --rating-1: #FF5C72;
  --danger: var(--rating-1);
  --danger-dim: color-mix(in srgb, var(--danger) 16%, transparent);
  --danger-border: color-mix(in srgb, var(--danger) 38%, transparent);
  --warning: #E8B86A;
  --success: #4ADE80;
  --success-dim: rgba(74, 222, 128, 0.14);
  --accent-violet: #A594FF;
  --accent-amber: #FBBF24;
  --accent-emerald: #34D399;
  --accent-sky: #38BDF8;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.40), 0 6px 20px rgba(0, 0, 0, 0.50);
  --shadow-lift: 0 16px 40px rgba(0, 0, 0, 0.60);
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  font-family: var(--font);
  font-size: 16px;
  font-feature-settings: var(--font-features);
  font-variant-numeric: var(--font-nums);
  -webkit-font-smoothing: antialiased;
}

:where(*),
:where(*::before),
:where(*::after) {
  font-feature-settings: inherit;
  font-variant-numeric: inherit;
}

[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

body {
  font-family: inherit;
  font-feature-settings: inherit;
  font-variant-numeric: inherit;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

button, input, select, textarea {
  font-family: inherit;
  font-feature-settings: inherit;
  font-variant-numeric: inherit;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
a.btn-primary,
a.btn-primary:hover { color: var(--on-primary); }
a.btn-secondary,
a.btn-secondary:hover { color: var(--text); }
a.btn-ghost,
a.btn-ghost:hover { color: inherit; }
a.btn-danger,
a.btn-danger:hover { color: #fff; }

h1, h2, h3, h4 { color: var(--text); font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }

.squircle-xs, .squircle-sm, .squircle-md, .squircle-lg, .squircle-xl, .squircle-2xl,
.card, .card-elevated, .card-interactive, .list-row-icon, .app-brand-mark,
.btn, .btn-primary, .btn-secondary, .btn-ghost, .btn-danger, .btn-success,
.btn-sm, .btn-small, .btn-edit, .btn-view, .btn-delete,
.select, .nav-item, .badge,
.modal-content, .modal-panel, .app-select-trigger, .app-select-menu, .app-select-option,
.logo-drop, .flash, .settings-nav, .settings-nav-item, .action-card,
button:not(.crew-section-header):not(.btn-close):not(.board-cell-value):not(.board-shot-no-btn):not(.board-pick):not(.board-color-swatch):not(.board-stage-title),
select, textarea {
  border-radius: var(--r-md);
  corner-shape: squircle;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.input,
.input-field {
  corner-shape: initial;
}

.squircle-xs  { border-radius: var(--r-xs); }
.squircle-sm  { border-radius: var(--r-sm); }
.squircle-md  { border-radius: var(--r-md); }
.squircle-lg  { border-radius: var(--r-lg); }
.squircle-xl  { border-radius: var(--r-xl); }
.squircle-2xl { border-radius: var(--r-2xl); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  corner-shape: squircle;
  box-shadow: var(--shadow-card);
}

.card-elevated {
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--primary) 20%);
  border-radius: var(--r-xl);
  corner-shape: squircle;
  box-shadow: var(--shadow-lift);
}

.card-interactive {
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

.card-interactive:hover {
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
}

.list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  transition: background-color 150ms ease;
}

.list-row:hover { background: var(--nav-hover-bg); }
.list-row:last-child { border-bottom: none; }

a.list-row {
  color: inherit;
  cursor: pointer;
}
a.list-row:hover {
  color: inherit;
  background: var(--nav-hover-bg);
}

.card > .list-row:last-child,
.card > .empty-state:last-child {
  border-bottom-left-radius: var(--r-xl);
  border-bottom-right-radius: var(--r-xl);
  corner-shape: squircle;
}

.list-row-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--primary-dim);
  color: var(--primary);
}

.list-row-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-row-body {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 0.25rem 1.25rem;
  align-items: center;
}

.list-row-stack {
  min-width: 0;
}

.list-row-primary,
.list-row-stack .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row-primary { font-weight: 600; }

.list-row-side { text-align: right; }

@media (max-width: 720px) {
  .list-row-body {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .list-row-side { text-align: left; }
}

.card-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-sizing: border-box;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  font-family: inherit;
  font-size: var(--text-ui);
  font-feature-settings: var(--font-features);
  font-variant-numeric: var(--font-nums);
  font-weight: 500;
  line-height: 1;
  border-radius: var(--r-md);
  corner-shape: squircle;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: opacity 150ms ease, background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.btn:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  color: var(--on-primary);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent);
}

.btn-secondary {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--nav-hover-bg);
  color: var(--text);
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) { filter: brightness(1.08); color: #fff; }

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover:not(:disabled) { filter: brightness(1.06); color: #fff; }

.btn-sm,
.btn-small {
  height: 2rem;
  min-height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.input,
.input-field,
select,
.select,
textarea.input,
textarea.input-field {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: var(--text-ui);
  font-feature-settings: var(--font-features);
  font-variant-numeric: var(--font-nums);
  border-radius: var(--r-md);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.input::placeholder,
.input-field::placeholder,
textarea.input::placeholder,
textarea.input-field::placeholder {
  color: var(--text-placeholder, var(--text-dim));
  opacity: 1;
}

.app-select-value.is-placeholder,
input[type="time"].is-empty,
input.is-empty,
.input-field.is-empty,
.input-field.is-inherited,
.call-time-input.is-inherited {
  color: var(--text-placeholder, var(--text-dim)) !important;
}

input[type="time"].is-empty::-webkit-datetime-edit,
input[type="time"].is-empty::-webkit-datetime-edit-fields-wrapper,
input[type="time"].is-empty::-webkit-datetime-edit-hour-field,
input[type="time"].is-empty::-webkit-datetime-edit-minute-field,
input[type="time"].is-empty::-webkit-datetime-edit-second-field,
input[type="time"].is-inherited::-webkit-datetime-edit,
input[type="time"].is-inherited::-webkit-datetime-edit-fields-wrapper,
input[type="time"].is-inherited::-webkit-datetime-edit-hour-field,
input[type="time"].is-inherited::-webkit-datetime-edit-minute-field,
.input-field.is-inherited::-webkit-datetime-edit,
.input-field.is-inherited::-webkit-datetime-edit-fields-wrapper,
.input-field.is-inherited::-webkit-datetime-edit-hour-field,
.input-field.is-inherited::-webkit-datetime-edit-minute-field {
  color: var(--text-placeholder, var(--text-dim));
}

.input:focus,
.input-field:focus,
select:focus,
.select:focus,
textarea.input:focus,
textarea.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-dim);
}

textarea.input,
textarea.input-field { resize: vertical; min-height: 80px; }

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

th,
.col-head,
.table-header,
.list-head {
  font-size: var(--text-col-head);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

select,
.select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8A8A' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-color: var(--surface-2);
  padding-right: 32px;
  color-scheme: inherit;
}

.app-select {
  position: relative;
  width: 100%;
}

.app-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.625rem 0.7rem 0.625rem 0.875rem;
  font-family: inherit;
  font-size: var(--text-ui);
  font-feature-settings: var(--font-features);
  font-variant-numeric: var(--font-nums);
  line-height: 1.2;
  text-align: left;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  corner-shape: squircle;
  cursor: pointer;
}

.app-select-trigger:hover {
  background: var(--nav-hover-bg);
}

.app-select.is-open .app-select-trigger,
.app-select-trigger:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-dim);
  outline: none;
}

.app-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-select-value.is-placeholder { color: var(--text-placeholder, var(--text-dim)); }

.app-select-chevron {
  flex-shrink: 0;
  width: 0.38rem;
  height: 0.38rem;
  border-right: 1.5px solid var(--text-dim);
  border-bottom: 1.5px solid var(--text-dim);
  transform: rotate(45deg) translateY(-1px);
}

.app-select-menu {
  display: none;
  position: absolute;
  z-index: 60;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 16rem;
  overflow: auto;
  padding: 0.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  corner-shape: squircle;
  box-shadow: var(--shadow-lift);
}

.app-select.is-open .app-select-menu { display: block; }

.app-select-option {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-family: inherit;
  font-size: var(--text-ui);
  font-feature-settings: var(--font-features);
  font-variant-numeric: var(--font-nums);
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: calc(var(--r-md) - 4px);
  corner-shape: squircle;
  cursor: pointer;
}

.app-select-option:hover,
.app-select-option.is-active {
  background: var(--nav-hover-bg);
}

.app-select-option.is-selected {
  background: var(--primary-dim);
  color: var(--primary);
  font-weight: 600;
}

.select-with-add {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}

.select-with-add .app-select,
.select-with-add select {
  flex: 1;
  min-width: 0;
}

.select-with-add .btn-primary {
  width: 2.5rem;
  padding: 0;
}

.logo-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  corner-shape: squircle;
  background: var(--surface-2);
  cursor: pointer;
}

.logo-drop.is-over {
  border-color: var(--primary);
  background: var(--primary-dim);
}

.logo-drop-preview {
  width: 3rem;
  height: 3rem;
  font-weight: 700;
  overflow: hidden;
}

.logo-drop-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-drop-preview-lg {
  width: 6rem;
  height: 6rem;
}

.logo-drop-copy strong {
  display: block;
  font-size: 0.875rem;
}

.logo-drop input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background: var(--surface-2);
  vertical-align: middle;
}

input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23fff' stroke-width='2' d='M3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E");
  background-size: 0.75rem;
  background-position: center;
  background-repeat: no-repeat;
}

.checkbox-item,
.first-aider-checkbox {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  cursor: pointer;
}

.label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  border-radius: var(--r-md);
  corner-shape: squircle;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  text-align: left;
}

.nav-item:hover {
  background: var(--nav-hover-bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-dim);
  color: var(--primary);
  font-weight: 600;
}

.text-heading { color: var(--text); }
.text-body { color: var(--text-muted); }
.text-caption { color: var(--text-dim); }
