/* TrainTrack – App Styles */

:root {
  --tt-primary: #001b4d;
  --tt-success: #16a34a;
  --tt-warning: #d97706;
  --tt-danger:  #dc2626;
  --tt-gray:    #6b7280;

  /* Bootstrap-Primärfarbe überschreiben */
  --bs-primary:     #001b4d;
  --bs-primary-rgb: 0, 27, 77;
  --bs-link-color:  #001b4d;
}

.bg-primary                          { background-color: #001b4d !important; }
.text-primary                        { color: #001b4d !important; }
.btn-primary                         { background-color: #001b4d !important; border-color: #001b4d !important; }
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active                  { background-color: #002d80 !important; border-color: #002d80 !important; }
.btn-outline-primary                 { color: #001b4d !important; border-color: #001b4d !important; }
.btn-outline-primary:hover           { background-color: #001b4d !important; color: #fff !important; }
a                                    { color: #001b4d; }

body {
  font-size: 0.92rem;
}

/* Sidebar / Nav */
.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* Teilnahme-Matrix */
.matrix-table th,
.matrix-table td {
  white-space: nowrap;
  font-size: 0.82rem;
  padding: 0.3rem 0.4rem;
}

.matrix-table thead th {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  max-width: 32px;
  min-width: 32px;
  height: 110px;
  vertical-align: bottom;
  text-overflow: ellipsis;
  overflow: hidden;
}

.matrix-table .item-label {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matrix-table .ebene-1 td:first-child,
.matrix-table .ebene-1 th:first-child {
  font-weight: 700;
  background: #f1f5f9;
}

.matrix-table .ebene-2 td:first-child {
  padding-left: 1.2rem;
  font-weight: 600;
}

.matrix-table .ebene-3 td:first-child {
  padding-left: 2.2rem;
}

.matrix-table .ebene-4 td:first-child {
  padding-left: 3rem;
  font-style: italic;
}

/* Farbcodes Deckungsgrad */
.cell-0    { background: #fee2e2; color: #991b1b; font-weight: 600; }
.cell-1    { background: #fef9c3; color: #854d0e; }
.cell-2plus{ background: #dcfce7; color: #166534; }

/* Höhere Spezifität gegen Bootstrap-Table-Überschreibung */
.matrix-table td.cell-0    { background: #fee2e2 !important; color: #991b1b; font-weight: 600; }
.matrix-table td.cell-1    { background: #fef9c3 !important; color: #854d0e; }
.matrix-table td.cell-2plus{ background: #dcfce7 !important; color: #166534; }

/* Teilnahme-Erfassung */
.teilnahme-table th,
.teilnahme-table td {
  text-align: center;
  vertical-align: middle;
  padding: 0.25rem;
}

.teilnahme-table th.ma-header {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  height: 90px;
  max-width: 36px;
  font-size: 0.78rem;
  font-weight: 600;
}

.teilnahme-table .item-col {
  text-align: left;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.85rem;
}

.teilnahme-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  background: #f9fafb;
  font-size: 1rem;
  line-height: 1;
  transition: background 0.1s;
}

.teilnahme-btn.anwesend {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.teilnahme-btn.abwesend {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #9ca3af;
}

.teilnahme-btn:hover {
  opacity: 0.85;
}

/* Baumansicht Items */
.item-tree .item-node {
  border-left: 2px solid #e5e7eb;
  margin-left: 1rem;
  padding-left: 0.75rem;
}

.item-tree .item-node.ebene-1 {
  border-left: none;
  margin-left: 0;
  padding-left: 0;
}

/* Badge Rollen */
.badge-superadmin { background: #7c3aed; }
.badge-admin      { background: #001b4d; }
.badge-staff      { background: #16a34a; }

/* Arbeitstage Toggle */
.arbeitsTag-btn {
  width: 36px;
  font-size: 0.78rem;
  padding: 2px 0;
}

/* Fortschrittsbalken Dashboard */
.progress-lg {
  height: 1.5rem;
  font-size: 0.9rem;
}

/* Warn-Card */
.warn-card {
  border-left: 4px solid var(--tt-warning);
}

/* Scrollbare Tabellen */
.table-responsive-x {
  overflow-x: auto;
}

/* Sticky erste Spalte in Matrix */
.sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  border-right: 2px solid #e5e7eb;
}

.matrix-table .sticky-col {
  min-width: 160px;
}

/* Notiz-Popover */
.notiz-icon {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--tt-gray);
}

.notiz-icon.hat-notiz {
  color: var(--tt-warning);
}

/* Print */
@media print {
  .navbar, .btn, .no-print { display: none !important; }
  .card { border: none !important; }
}
