/* ==========================================================================
   mindpool – Stylesheet (CI-konform für mindscool)
   ========================================================================== */

/* === Schriftarten (selbst gehostet, KEIN Google!) === */
@font-face {
  font-family: 'Titillium Web';
  src: url('fonts/TitilliumWeb-Light.woff2') format('woff2');
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Titillium Web';
  src: url('fonts/TitilliumWeb-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Titillium Web';
  src: url('fonts/TitilliumWeb-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Titillium Web';
  src: url('fonts/TitilliumWeb-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* === CSS Custom Properties === */
:root {
  /* mindscool CI-Farben (Logo-Basis + Website-Akzente) */
  --color-blue: #1CA7DB;         /* Logo – Primärfarbe */
  --color-green: #00D084;        /* Website-Akzent – Erfolg, aktive Status */
  --color-purple: #9B51E0;       /* Website-Akzent – Sekundär, Abschluss-Badges */
  --color-orange: #E26828;       /* Logo – Warnungen, Hover-Akzente */
  --color-grey: #707073;         /* Logo – Sekundärtext */

  /* Abgeleitete UI-Farben */
  --color-primary: var(--color-blue);
  --color-primary-hover: #0693E3;
  --color-primary-light: #E8F6FC;
  --color-secondary: var(--color-purple);
  --color-accent: var(--color-orange);
  --color-success: var(--color-green);
  --color-warning: var(--color-orange);
  --color-error: #D63031;
  --color-bg: #F5F7FA;
  --color-surface: #FFFFFF;
  --color-text: #2D3436;
  --color-text-light: var(--color-grey);
  --color-border: #DFE6E9;

  /* Typografie */
  --font-family: 'Titillium Web', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

/* === Reset & Basis === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.3;
}

img {
  max-width: 100%;
  height: auto;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
  line-height: 1.4;
  min-height: 44px;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
}

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

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

.btn-accent {
  background-color: var(--color-accent);
  color: #fff;
}
.btn-accent:hover {
  background-color: #c95a22;
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  min-height: 36px;
}

.btn-block {
  display: flex;
  justify-content: center;
  width: 100%;
}

.btn-icon {
  padding: 6px 10px;
  min-height: 36px;
  font-size: 16px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-light);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.btn-icon svg {
  display: block;
}
.btn-icon:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
  border-color: var(--color-text-light);
}
.btn-icon:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* === Formulare === */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--color-text);
}

.form-group label .required {
  color: var(--color-error);
  margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 15px;
  color: var(--color-text);
  background-color: var(--color-surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 44px;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(28, 167, 219, 0.15);
}

input:invalid:not(:placeholder-shown),
input.invalid {
  border-color: var(--color-error);
}

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

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 15px;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: auto;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-hint {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 4px;
}

.form-error {
  font-size: 13px;
  color: var(--color-error);
  margin-top: 4px;
}

.char-counter {
  font-size: 12px;
  color: var(--color-text-light);
  text-align: right;
  margin-top: 2px;
}
.char-counter.limit-near {
  color: var(--color-warning);
}
.char-counter.limit-reached {
  color: var(--color-error);
}

/* === Login-Seite === */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--color-bg) 0%, #e3edf5 100%);
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  text-align: center;
}

.login-logo {
  margin-bottom: 24px;
}

.login-logo .logo-img {
  max-width: 220px;
  height: auto;
}

.login-title {
  font-size: 22px;
  color: var(--color-text);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: var(--color-text-light);
  font-weight: 300;
  margin-bottom: 24px;
}

.login-form .form-group {
  text-align: left;
}

.login-form .btn {
  margin-top: 8px;
}

/* === Alerts === */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error {
  background-color: #ffeaea;
  color: var(--color-error);
  border: 1px solid #ffcdd2;
}

.alert-success {
  background-color: #eef7e5;
  color: #4a7c0f;
  border: 1px solid #c5e1a5;
}

.alert-warning {
  background-color: #fff3e0;
  color: #bf5600;
  border: 1px solid #ffcc80;
}

.alert-info {
  background-color: var(--color-primary-light);
  color: #0d7ea5;
  border: 1px solid #b3e5fc;
}

/* === Header/Navigation === */
.app-header {
  background: var(--color-surface);
  box-shadow: var(--shadow);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left .logo-img {
  height: 36px;
  width: auto;
}

.header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-right .btn {
  font-size: 13px;
}

/* === Hauptbereich === */
.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

/* === Karte === */
.map-container {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 24px;
}

.map-container h2 {
  padding: 16px 20px 0;
  font-size: 16px;
  color: var(--color-text);
}

#map {
  height: 350px;
  width: 100%;
}
.map-marker {
  background: none !important;
  border: none !important;
}

.map-preview-container {
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  overflow: hidden;
  margin-top: 8px;
}

#map-preview {
  height: 200px;
  width: 100%;
}

/* === Tabelle === */
.table-container {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-header {
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
}

.table-header h2 {
  font-size: 16px;
  flex-shrink: 0;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.table-filters {
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.table-filters .filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-filters .filter-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-light);
  white-space: nowrap;
}

.table-filters .filter-group select,
.table-filters .filter-group input {
  min-height: 36px;
  font-size: 13px;
  padding: 6px 10px;
  max-width: 200px;
}

.search-input {
  position: relative;
}
.search-input input {
  padding-left: 36px;
}
.search-input::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background: currentColor;
  pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0.5;
}

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

.data-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-light);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.data-table th:hover {
  color: var(--color-text);
}

.data-table th .sort-indicator {
  margin-left: 4px;
  font-size: 11px;
}

.data-table td {
  padding: 10px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.data-table tr:nth-child(even) {
  background-color: #fafbfc;
}

.data-table tr:hover {
  background-color: var(--color-primary-light);
}

.data-table .foto-cell {
  width: 50px;
}

.trainer-foto {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--color-text-light);
}

.trainer-foto img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.text-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-actions {
  white-space: nowrap;
  display: flex;
  gap: 4px;
}

.no-data {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-text-light);
}

/* === Badges === */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.badge-success {
  background: #eef7e5;
  color: #4a7c0f;
}

.badge-warning {
  background: #fff3e0;
  color: #bf5600;
}

.badge-purple {
  background: #f3e8fc;
  color: #7a3bb5;
}

.badge-blue {
  background: var(--color-primary-light);
  color: #0d7ea5;
}

.badge-grey {
  background: #eceff1;
  color: var(--color-grey);
}

.badge-sm {
  padding: 2px 7px;
  font-size: 11px;
  border-radius: 10px;
  background: var(--color-primary-light);
  color: #0d7ea5;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-muted-sm {
  font-size: 12px;
  color: var(--color-grey);
  margin-top: 2px;
}

/* === Formular-Abschnitte === */
.form-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
}

.form-section {
  padding: 20px 24px;
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
}

.form-section-accent {
  width: 4px;
  height: 24px;
  border-radius: 2px;
}

.form-section-title {
  font-size: 16px;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-footer {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

/* === Dynamische Listen (Projekte, Abschlüsse) === */
.dynamic-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  padding: 12px;
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.dynamic-list-item .item-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dynamic-list-item .item-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dynamic-list-item .btn-remove {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  color: var(--color-error);
  border-color: transparent;
}
.dynamic-list-item .btn-remove:hover {
  background: #ffeaea;
  border-color: var(--color-error);
}

.add-item-btn {
  margin-top: 8px;
}

/* === Combobox === */
.combobox-wrapper {
  position: relative;
}

.combobox-input {
  width: 100%;
  cursor: text;
}

.combobox-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: none;
}

.combobox-dropdown.open {
  display: block;
}

.combobox-option {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.combobox-option:hover,
.combobox-option.highlighted {
  background-color: var(--color-primary-light);
}

.combobox-option.vorschlag {
  font-style: italic;
}

.combobox-option .badge-neu {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 8px;
  background: #fff3e0;
  color: var(--color-orange);
  font-weight: 600;
  font-style: normal;
}

.combobox-suggest {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--color-orange);
  font-weight: 600;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.combobox-suggest:hover {
  background-color: #fff3e0;
}

.combobox-option.selected {
  opacity: 0.5;
}

.combobox-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.combobox-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--color-primary-light);
  color: #0d7ea5;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.combobox-tag-remove {
  background: none;
  border: none;
  color: #0d7ea5;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.7;
}
.combobox-tag-remove:hover {
  opacity: 1;
}

.combobox-no-results {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--color-text-light);
}

/* === Profil-Ansicht === */
.profile-header {
  text-align: center;
  padding: 32px 24px;
}

.profile-foto {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--color-green);
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  font-size: 48px;
  color: var(--color-text-light);
}

.profile-foto img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  font-size: 28px;
  margin-bottom: 4px;
}

.profile-location {
  font-size: 15px;
  color: var(--color-text-light);
}

.profile-section {
  padding: 20px 24px;
  border-top: 1px solid var(--color-border);
}

.profile-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.profile-abschluss {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  background: var(--color-bg);
  border-radius: var(--radius);
}

.profile-abschluss .badge {
  flex-shrink: 0;
}

.profile-abschluss-details {
  flex: 1;
}

.profile-abschluss-fach {
  font-weight: 600;
  font-size: 15px;
}

.profile-abschluss-zusatz {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 2px;
}

.profile-projekte {
  list-style: none;
  counter-reset: projekt;
}

.profile-projekte li {
  counter-increment: projekt;
  padding: 8px 0 8px 32px;
  position: relative;
  border-bottom: 1px solid var(--color-border);
}

.profile-projekte li:last-child {
  border-bottom: none;
}

.profile-projekte li::before {
  content: counter(projekt);
  position: absolute;
  left: 0;
  top: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-actions {
  padding: 20px 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid var(--color-border);
}

/* === Taxonomie-Verwaltung === */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 0;
}

.tab {
  padding: 12px 24px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-light);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-family);
}

.tab:hover {
  color: var(--color-text);
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

.tax-add-form {
  padding: 16px 20px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
}

.tax-add-form input {
  flex: 1;
  min-height: 40px;
}

/* Inline-Edit */
.inline-edit {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inline-edit input {
  padding: 4px 8px;
  font-size: 14px;
  min-height: 32px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  outline: none;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  font-size: 18px;
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--color-border);
}

/* === Toast-Benachrichtigungen === */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success {
  background: #eef7e5;
  color: #4a7c0f;
  border-left: 4px solid var(--color-success);
}

.toast-error {
  background: #ffeaea;
  color: var(--color-error);
  border-left: 4px solid var(--color-error);
}

.toast-warning {
  background: #fff3e0;
  color: #bf5600;
  border-left: 4px solid var(--color-warning);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* === Loading Spinner === */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

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

/* === Foto-Upload === */
.foto-upload {
  display: flex;
  align-items: center;
  gap: 16px;
}

.foto-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-bg);
  border: 2px dashed var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 28px;
  color: var(--color-text-light);
  flex-shrink: 0;
}

.foto-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.foto-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.foto-upload-controls .form-hint {
  margin-top: 0;
}

/* === Responsive === */
@media (max-width: 768px) {
  .app-header {
    padding: 0 12px;
  }

  .header-title {
    display: none;
  }

  .app-main {
    padding: 12px;
  }

  #map {
    height: 250px;
  }

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

  .table-filters {
    flex-direction: column;
  }

  .table-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-actions {
    margin-left: 0;
    width: 100%;
  }

  /* Tabelle als Karten auf Mobilgeräten */
  .data-table thead {
    display: none;
  }

  .data-table tr {
    display: block;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
  }

  .data-table td {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border: none;
    font-size: 13px;
  }

  .data-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-light);
    margin-right: 8px;
  }

  .data-table .foto-cell {
    width: auto;
  }

  .dynamic-list-item .item-row {
    grid-template-columns: 1fr;
  }

  .profile-actions {
    flex-direction: column;
  }

  .profile-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* === Druck-Stylesheet === */
@media print {
  .app-header,
  .table-filters,
  .table-actions,
  .cell-actions,
  .btn,
  .map-container,
  .toast-container {
    display: none !important;
  }

  body {
    background: #fff;
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 6px 8px;
  }

  .table-container {
    box-shadow: none;
  }
}

/* === Hilfsklassen === */
.hidden {
  display: none !important;
}

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

.text-muted {
  color: var(--color-text-light);
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
