/* ============================================
   cayol Kundenportal - Styles
   Basierend auf dem Corporate Design
   ============================================ */

:root {
  --color-indigo: #4265b2;
  --color-turquoise: #21b7b3;
  --color-yellow: #fdce0d;
  --color-dark: #112033;
  --color-white: #ffffff;
  --color-gray-100: #f8fafc;
  --color-gray-200: #f0f4f8;
  --color-gray-300: #e2e8f0;
  --color-gray-400: #94a3b8;
  --color-gray-600: #475569;
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-warning: #f59e0b;

  --font-primary: 'Cabin', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --transition: 0.3s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background: var(--color-gray-100);
  color: var(--color-dark);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--color-indigo);
  text-decoration: none;
}

a:hover {
  color: var(--color-turquoise);
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-gray-100), var(--color-gray-200));
  padding: 20px;
}

.login-container {
  background: var(--color-white);
  padding: 50px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo img {
  height: 50px;
}

.login-title {
  text-align: center;
  margin-bottom: 30px;
  color: var(--color-dark);
  font-size: 1.5rem;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--color-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 1rem;
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-turquoise);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--color-dark);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--color-indigo);
  color: var(--color-white);
}

.btn-secondary:hover {
  background: var(--color-dark);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--color-indigo);
  border: 2px solid var(--color-indigo);
}

.btn-outline:hover {
  background: var(--color-indigo);
  color: var(--color-white);
}

.btn-danger {
  background: var(--color-error);
  color: var(--color-white);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

/* ============================================
   PORTAL LAYOUT
   ============================================ */
.portal-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--color-dark);
  color: var(--color-white);
  padding: 30px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 0 25px 30px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 20px;
}

.sidebar-logo img {
  height: 40px;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 25px;
  color: var(--color-gray-300);
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(255,255,255,0.05);
  color: var(--color-white);
  border-left-color: var(--color-turquoise);
}

.sidebar-nav svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.sidebar-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-section-title {
  padding: 0 25px 10px;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-gray-400);
  letter-spacing: 1px;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 30px;
}

/* Header */
.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-gray-300);
}

.portal-header h1 {
  font-size: 1.75rem;
  color: var(--color-dark);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-name {
  color: var(--color-gray-600);
}

/* ============================================
   CARDS & BOXES
   ============================================ */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 25px;
  margin-bottom: 25px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--color-gray-200);
}

.card-header h3 {
  font-size: 1.25rem;
  color: var(--color-dark);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 25px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-indigo), var(--color-turquoise));
}

.stat-icon svg {
  width: 28px;
  height: 28px;
  fill: var(--color-white);
}

.stat-info h4 {
  font-size: 2rem;
  color: var(--color-dark);
  margin-bottom: 4px;
}

.stat-info p {
  color: var(--color-gray-600);
  margin: 0;
}

/* ============================================
   VIDEO LIST
   ============================================ */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
}

.video-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.video-thumbnail {
  position: relative;
  background: var(--color-gray-200);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-thumbnail svg {
  width: 60px;
  height: 60px;
  fill: var(--color-gray-400);
}

.video-info {
  padding: 20px;
}

.video-info h4 {
  margin-bottom: 8px;
  color: var(--color-dark);
}

.video-info p {
  color: var(--color-gray-600);
  font-size: 0.9rem;
  margin: 0;
}

/* ============================================
   CALENDAR (Google-Style)
   ============================================ */
.calendar-container {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.calendar-header h3 {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-dark);
}

.calendar-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.calendar-nav a,
.calendar-nav button {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--color-gray-300);
  background: var(--color-white);
  border-radius: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 0.875rem;
  color: var(--color-dark);
  text-decoration: none;
}

.calendar-nav a:hover,
.calendar-nav button:hover {
  background: var(--color-gray-100);
  border-color: var(--color-gray-400);
}

.calendar-grid {
  display: grid;
  grid-template-columns: 40px repeat(7, 1fr);
  gap: 1px;
  background: var(--color-gray-300);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-gray-300);
}

.calendar-kw-header {
  background: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 14px 4px;
  color: var(--color-gray-500);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-kw {
  background: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-gray-500);
  min-height: 120px;
}

.calendar-day-header {
  background: var(--color-gray-100);
  text-align: center;
  font-weight: 600;
  padding: 14px 8px;
  color: var(--color-gray-600);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-day {
  background: var(--color-white);
  height: 120px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}

.calendar-day:hover {
  background: var(--color-gray-50);
}

.calendar-day .day-number {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-height: 28px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-gray-500);
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
  transition: all 0.15s ease;
}

.calendar-day:hover .day-number {
  background: var(--color-gray-200);
}

.calendar-day .day-content {
  flex: 1;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calendar-day.other-month {
  background: var(--color-gray-100);
}

.calendar-day.other-month .day-number {
  color: var(--color-gray-400);
  background: var(--color-gray-100);
}

/* Wochenenden grauer */
.calendar-day.weekend {
  background: #f8fafc;
}

.calendar-day.weekend .day-number {
  color: var(--color-gray-500);
  background: #f1f5f9;
}

.calendar-day.today .day-number {
  background: var(--color-indigo);
  color: white;
  font-weight: 700;
}

.calendar-day.today:hover .day-number {
  background: var(--color-indigo);
}

/* Frei - neutral, kein grüner Hintergrund */
.calendar-day.frei {
  background: var(--color-white);
}

.calendar-day.frei.weekend {
  background: #f1f5f9;
}

/* Belegt - rot */
.calendar-day.belegt {
  background: #fef2f2;
}

.calendar-day.belegt .day-number {
  color: #991b1b;
  background: #fecaca;
}

.calendar-day.belegt::after {
  content: 'Belegt';
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #dc2626;
  background: rgba(220, 38, 38, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Angefragt - gelb */
.calendar-day.gebucht {
  background: #fef3c7;
}

.calendar-day.gebucht .day-number {
  color: #92400e;
  background: #fde68a;
}

/* Kundenname im Kalender-Tag */
.calendar-day .booking-name {
  font-size: 0.7rem;
  color: #92400e;
  font-weight: 600;
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

.calendar-day.belegt .booking-name {
  color: #991b1b;
}

/* Notiz unter Kundenname (Admin-Kalender) */
.calendar-day .booking-note {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day.belegt .booking-note {
  color: #7f1d1d;
}

.calendar-day.gebucht .booking-note {
  color: #78350f;
}

/* Eigene Buchungen (Kunden-Kalender) */
.calendar-day.my-booking {
  border: 2px solid #10b981 !important;
  background: #d1fae5 !important;
  cursor: pointer !important;
}

.calendar-day.my-booking .day-number {
  color: #065f46;
  font-weight: 700;
  background: #a7f3d0;
}

.calendar-day.my-booking.belegt {
  background: #d1fae5 !important;
}

.calendar-day.my-booking.belegt::after {
  content: none; /* "Belegt" Label entfernen für eigene Buchungen */
}

.my-booking-label {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #065f46;
  background: rgba(16, 185, 129, 0.2);
  padding: 3px 6px;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kollegen-Buchung */
.calendar-day.company-booking {
  border: 2px solid #8b5cf6 !important;
  background: #ede9fe !important;
}

.calendar-day.company-booking .day-number {
  color: #5b21b6;
  font-weight: 600;
}

.company-booking-label {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 500;
  color: #5b21b6;
  background: rgba(139, 92, 246, 0.2);
  padding: 3px 6px;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-dot.company-booking {
  background: #8b5cf6;
}

/* Absage angefragt */
.calendar-day.cancellation-requested {
  border: 2px dashed #ef4444 !important;
  background: #fee2e2 !important;
}

.calendar-day.cancellation-requested .day-number {
  color: #991b1b;
}

.calendar-day.cancellation-requested .my-booking-label {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.2);
}

.calendar-day.cancellation-requested .booking-name {
  color: #991b1b;
}

.calendar-day.cancellation-requested .booking-note {
  color: #7f1d1d;
}

/* Termin-Liste im Dashboard */
.appointments-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.appointment-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-gray-200);
}

.appointment-item:last-child {
  border-bottom: none;
}

.appointment-date {
  font-weight: 500;
  color: var(--color-dark);
}

.appointment-status {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 12px;
}

.appointment-status.confirmed {
  background: #d1fae5;
  color: #065f46;
}

.appointment-status.pending {
  background: #fef3c7;
  color: #92400e;
}

.appointment-status.cancellation {
  background: #fee2e2;
  color: #991b1b;
}

.appointment-item.cancelled .appointment-date {
  text-decoration: line-through;
  color: var(--color-gray-400);
}

.btn-cancel-sm {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: transparent;
  color: #dc2626;
  border: 1px solid #dc2626;
  border-radius: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-cancel-sm:hover {
  background: #dc2626;
  color: white;
}

/* Feiertag - violett */
.calendar-day.feiertag {
  background: #f3e8ff;
  cursor: not-allowed;
}

.calendar-day.feiertag .day-number {
  color: #6b21a8;
  background: #e9d5ff;
}

.calendar-day.feiertag::after {
  content: 'Feiertag';
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #7c3aed;
  background: rgba(139, 92, 246, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Urlaub (nur Admin sieht das) */
.calendar-day.urlaub {
  background: #e0f2fe;
  cursor: not-allowed;
}

.calendar-day.urlaub .day-number {
  color: #0369a1;
  background: #bae6fd;
}

.calendar-day.urlaub::after {
  content: 'Urlaub';
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #0284c7;
  background: rgba(14, 165, 233, 0.15);
  padding: 2px 8px;
  border-radius: 10px;
}

.legend-dot.urlaub {
  background: #0ea5e9;
}

/* Belegt - cursor für Kunden */
.calendar-day.belegt {
  cursor: not-allowed;
}

.calendar-legend {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--color-gray-200);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--color-gray-600);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.frei { background: #e2e8f0; border: 1px solid #94a3b8; }
.legend-dot.belegt { background: #ef4444; }
.legend-dot.gebucht { background: #f59e0b; }
.legend-dot.feiertag { background: #8b5cf6; }
.legend-dot.my-confirmed { background: #10b981; }

/* ============================================
   PROJECT UPDATES (Trello-Style)
   ============================================ */
.updates-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.update-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border-left: 4px solid var(--color-turquoise);
}

.update-card-header {
  padding: 20px;
  background: var(--color-gray-100);
  border-bottom: 1px solid var(--color-gray-200);
}

.update-card-header h4 {
  margin-bottom: 5px;
}

.update-date {
  font-size: 0.85rem;
  color: var(--color-gray-600);
}

.update-card-content {
  padding: 20px;
}

.update-card-content p {
  margin-bottom: 15px;
  color: var(--color-gray-600);
}

.update-screenshot {
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
  overflow-x: auto;
}

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

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-gray-200);
}

th {
  background: var(--color-gray-100);
  font-weight: 600;
  color: var(--color-dark);
}

tr:hover {
  background: var(--color-gray-100);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: 15px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #ef4444;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

/* ============================================
   MODAL
   ============================================ */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition);
}

.modal-backdrop.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-gray-400);
}

.modal-close:hover {
  color: var(--color-dark);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }

  .main-content {
    margin-left: 220px;
  }
}

@media (max-width: 768px) {
  .portal-wrapper {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 15px 0;
  }

  .sidebar-logo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 15px;
  }

  .sidebar-nav {
    display: none;
  }

  .sidebar-nav.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
  }

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

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

/* ============================================
   KANBAN BOARD
   ============================================ */
.kanban-board {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 20px;
  min-height: calc(100vh - 200px);
}

.kanban-column {
  flex: 1 1 0;
  min-width: 250px;
  display: flex;
  flex-direction: column;
}

.kanban-column-header {
  padding: 14px 16px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-column-header .card-count {
  background: rgba(255,255,255,0.3);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 500;
}

.kanban-cards {
  flex: 1;
  min-height: 400px;
  padding: 12px;
  background: var(--color-gray-100);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  border: 1px solid var(--color-gray-200);
  border-top: none;
}

.kanban-card {
  background: var(--color-white);
  padding: 14px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: box-shadow var(--transition), transform var(--transition);
  border: 1px solid var(--color-gray-200);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.sortable-ghost {
  opacity: 0.4;
  background: var(--color-gray-200);
}

.kanban-card.sortable-chosen {
  box-shadow: var(--shadow-lg);
}

.kanban-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-dark);
  margin-bottom: 6px;
  word-break: break-word;
}

.kanban-card-desc {
  font-size: 0.85rem;
  color: var(--color-gray-600);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-gray-200);
  font-size: 0.75rem;
  color: var(--color-gray-400);
}

.kanban-card-user {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-indigo);
  font-weight: 500;
}

.kanban-card-attachments {
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-card-attachments svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Spalten-Farben */
.kanban-column.todo .kanban-column-header {
  background: #e2e8f0;
  color: #475569;
}

.kanban-column.in_arbeit .kanban-column-header {
  background: var(--color-indigo);
  color: var(--color-white);
}

.kanban-column.zur_freigabe .kanban-column-header {
  background: var(--color-yellow);
  color: var(--color-dark);
}

.kanban-column.fertig .kanban-column-header {
  background: var(--color-success);
  color: var(--color-white);
}

.kanban-column.nacharbeit .kanban-column-header {
  background: var(--color-error);
  color: var(--color-white);
}

/* Kanban Header */
.kanban-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.kanban-header h1 {
  font-size: 1.75rem;
  color: var(--color-dark);
}

.kanban-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.kanban-filter {
  padding: 10px 16px;
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  background: var(--color-white);
  min-width: 200px;
}

.kanban-filter:focus {
  outline: none;
  border-color: var(--color-turquoise);
}

/* ============================================
   KANBAN MODAL
   ============================================ */
.kanban-modal {
  max-width: 700px;
  width: 95%;
}

.kanban-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
  gap: 15px;
}

.kanban-modal-title {
  flex: 1;
}

.kanban-modal-title h2 {
  font-size: 1.5rem;
  color: var(--color-dark);
  margin-bottom: 5px;
  word-break: break-word;
}

.kanban-modal-title h2.editable-title {
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.kanban-modal-title h2.editable-title:hover {
  background: var(--color-gray-100);
}

.kanban-modal-title .title-input {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-dark);
  border: 2px solid var(--color-turquoise);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  width: 100%;
  font-family: var(--font-primary);
}

.kanban-modal-title .card-owner {
  font-size: 0.85rem;
  color: var(--color-gray-600);
}

.kanban-modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--color-gray-400);
  line-height: 1;
  padding: 5px;
}

.kanban-modal-close:hover {
  color: var(--color-dark);
}

.kanban-modal-section {
  margin-bottom: 25px;
}

.kanban-modal-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-gray-600);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-modal-section h3 .btn-sm {
  text-transform: none;
  letter-spacing: normal;
}

/* Beschreibung */
.kanban-description {
  background: var(--color-gray-100);
  padding: 15px;
  border-radius: var(--radius-md);
  color: var(--color-dark);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.kanban-description.empty {
  color: var(--color-gray-400);
  font-style: italic;
}

/* Anhänge */
.kanban-attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.kanban-attachment {
  position: relative;
  background: var(--color-gray-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  transition: transform var(--transition);
}

.kanban-attachment:hover {
  transform: scale(1.02);
}

.kanban-attachment img,
.kanban-attachment video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kanban-attachment-icon {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-600);
}

.kanban-attachment-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
  margin-bottom: 8px;
}

.kanban-attachment-icon span {
  font-size: 0.75rem;
  text-align: center;
  padding: 0 8px;
  word-break: break-word;
}

.kanban-attachment-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  background: rgba(239, 68, 68, 0.9);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.kanban-attachment:hover .kanban-attachment-delete {
  opacity: 1;
}

.kanban-attachment-delete:hover {
  background: var(--color-error);
}

/* Verlauf */
.kanban-history {
  max-height: 300px;
  overflow-y: auto;
}

.kanban-history-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-gray-200);
}

.kanban-history-item:last-child {
  border-bottom: none;
}

.kanban-history-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kanban-history-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.kanban-history-icon.erstellt {
  background: #d1fae5;
  color: #065f46;
}

.kanban-history-icon.status {
  background: #dbeafe;
  color: #1e40af;
}

.kanban-history-icon.bearbeitet {
  background: #fef3c7;
  color: #92400e;
}

.kanban-history-icon.kommentar {
  background: #ede9fe;
  color: #5b21b6;
}

.kanban-history-icon.anhang {
  background: #e0e7ff;
  color: #3730a3;
}

.kanban-history-content {
  flex: 1;
  min-width: 0;
}

.kanban-history-text {
  font-size: 0.9rem;
  color: var(--color-dark);
  margin-bottom: 4px;
}

.kanban-history-text strong {
  font-weight: 600;
}

.kanban-history-comment {
  background: var(--color-gray-100);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--color-dark);
  white-space: pre-wrap;
  word-break: break-word;
}

.kanban-history-time {
  font-size: 0.75rem;
  color: var(--color-gray-400);
}

/* Kommentar-Eingabe */
.kanban-comment-form {
  display: flex;
  gap: 10px;
}

.kanban-comment-form textarea {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  resize: none;
  min-height: 80px;
}

.kanban-comment-form textarea:focus {
  outline: none;
  border-color: var(--color-turquoise);
}

/* Status-Auswahl im Modal */
.kanban-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--color-gray-200);
  margin-top: 20px;
  gap: 15px;
  flex-wrap: wrap;
}

.kanban-status-select {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kanban-status-select label {
  font-weight: 500;
  color: var(--color-gray-600);
  font-size: 0.9rem;
}

.kanban-status-select select {
  padding: 8px 12px;
  border: 2px solid var(--color-gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  background: var(--color-white);
}

.kanban-status-select select:focus {
  outline: none;
  border-color: var(--color-turquoise);
}

/* Lightbox */
.kanban-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.kanban-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.kanban-lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
}

.kanban-lightbox-content img,
.kanban-lightbox-content video {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--radius-md);
}

.kanban-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kanban-lightbox-close:hover {
  background: rgba(255,255,255,0.2);
}

/* Neue Karte Modal */
.kanban-new-card-form .form-group {
  margin-bottom: 15px;
}

/* Bearbeiten-Modus im Modal */
.kanban-edit-mode .kanban-description {
  display: none;
}

.kanban-edit-form {
  display: none;
}

.kanban-edit-mode .kanban-edit-form {
  display: block;
}

/* Upload-Bereich */
.kanban-upload-area {
  border: 2px dashed var(--color-gray-300);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 12px;
}

.kanban-upload-area:hover {
  border-color: var(--color-turquoise);
  background: var(--color-gray-100);
}

.kanban-upload-area.dragover {
  border-color: var(--color-turquoise);
  background: rgba(33, 183, 179, 0.1);
}

.kanban-upload-area svg {
  width: 32px;
  height: 32px;
  fill: var(--color-gray-400);
  margin-bottom: 8px;
}

.kanban-upload-area p {
  color: var(--color-gray-600);
  font-size: 0.9rem;
  margin: 0;
}

.kanban-upload-area input[type="file"] {
  display: none;
}

/* Kanban Board Responsive */
@media (max-width: 768px) {
  .kanban-board {
    flex-direction: column;
    gap: 20px;
  }

  .kanban-column {
    flex: 1 1 auto;
    min-width: 100%;
    max-width: 100%;
  }

  .kanban-cards {
    min-height: 200px;
  }

  .kanban-header {
    flex-direction: column;
    align-items: stretch;
  }

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

  .kanban-filter {
    width: 100%;
  }

  .kanban-modal {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .kanban-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .kanban-status-select {
    width: 100%;
  }

  .kanban-status-select select {
    flex: 1;
  }
}
