/* style.css */
[v-cloak] { display: none !important; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
}

/* TOASTS */
.toast-container-custom {
  z-index: 1090;
}

/* LOGIN */
.login-container {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.login-card-custom {
  max-width: 420px;
  width: 100%;
}

.hover-underline:hover {
  text-decoration: underline !important;
}

/* APP LAYOUT & SIDEBAR */
.app-layout {
  position: relative;
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 260px;
  height: 100vh;
  height: 100dvh; /* Nutzt die dynamische Viewport-Höhe */
  overflow-y: auto;
  background: #0f172a;
  color: #fff;
  transition: transform .3s ease-in-out;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px;
  border-bottom: 1px solid #1e293b;
  font-size: 1.25rem;
  font-weight: 700;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 8px;
  padding: 16px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 500;
  text-align: left;
  transition: all .2s ease;
}

.nav-item:hover { color: #fff; background: #1e293b; }
.nav-item.active { color: #fff; background: #2563eb; }

.sidebar-footer {
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom)); /* Berücksichtigt die Home-Bar auf Smartphones */
  border-top: 1px solid #1e293b;
}

/* MAIN CONTENT & TOPBAR */
.main-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  width: 0;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 76px;
  padding: 20px 32px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.content-body {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.mobile-toggle, .sidebar-overlay { display: none; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, .5);
}

/* SUBCARDS STYLING */
.card .card {
  border-color: #e2e8f0;
  border-radius: 0.5rem;
}

/* SERVER STATUS DOTS */
.server-status-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  vertical-align: middle;
}
.server-status-green { background: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, .15); }
.server-status-red   { background: #ef4444; box-shadow: 0 0 0 2px rgba(239, 68, 68, .15); }
.server-status-gray  { background: #94a3b8; box-shadow: 0 0 0 2px rgba(148, 163, 184, .15); }

/* MODALS & OVERLAYS */
.modal-backdrop-custom {
  background: rgba(15, 23, 42, .55);
}

.modal-backdrop-dark {
  background: rgba(15, 23, 42, .6);
}

.modal-z-1055 { z-index: 1055; }
.modal-z-1060 { z-index: 1060; }
.modal-z-1070 { z-index: 1070; }

.modal-dialog-max {
  max-width: 95vw;
}

.modal-content-max {
  height: 85vh;
}

.search-input-custom {
  width: 200px;
}

/* TABLE COLUMN SIZES */
.col-actions { width: 60px; }
.col-id { width: 80px; }
.col-status { width: 40px; }
.col-drag { width: 40px; }
.col-name { min-width: 140px; }
.col-desc { min-width: 160px; }
.col-age { min-width: 220px; }
.col-late { min-width: 110px; }
.col-target-class { min-width: 140px; width: 30%; }
.col-assigned-classes { min-width: 220px; }

.select-class-mobile {
  width: auto;
  height: 28px;
  min-width: 130px;
}

.select-age-type {
  min-width: 70px;
}

/* POST PROCESSING MODAL SPECIFICS */
.pp-preview-container {
  min-height: 90px;
}

/* CURSOR & INTERACTION HELPER CLASSES */
.cursor-pointer, .editable-cell { cursor: pointer; }
.editable-cell:hover { background-color: #e0f2fe !important; }
.cursor-grab { cursor: grab; }
.cursor-grab:active { cursor: grabbing; }

.drag-handle { user-select: none; touch-action: none; }
.drag-row { transition: background-color 0.2s ease; }
.drag-row:hover { background-color: #f1f5f9; }

/* UTILITY CLASSES */
.border-dashed { border-style: dashed !important; }
.extra-small { font-size: 0.75rem; }
.min-h-35 { min-height: 35px; }
.hover-danger:hover { color: #dc3545 !important; }

.table th.text-nowrap, .table td.text-nowrap { white-space: nowrap !important; }
.table th input.form-control-sm { min-width: 90px; }

/* RESPONSIVE TABLE FORM CONTROLS */
.table-responsive .form-control-sm,
.table-responsive .form-select-sm {
  min-width: 90px;
}

.table-responsive .input-group-sm {
  flex-wrap: nowrap;
  min-width: 200px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .mobile-toggle { display: flex; }
  .sidebar-overlay { display: block; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    height: 100dvh; /* Sichert die dynamische Höhe auf Mobilgeräten */
    z-index: 300;
    transform: translateX(-100%);
  }
  .sidebar.is-open { transform: translateX(0); }
}

/* POST PROCESSING NAV BUTTONS */
.pp-nav-buttons {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 50px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #dee2e6;
}

.pp-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50%;
  padding: 0;
  border: none;
  background-color: #f1f5f9;
  color: #475569;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.pp-nav-btn:hover:not(:disabled) {
  background-color: #e2e8f0;
  color: #0f172a;
}

.pp-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pp-nav-btn-up {
  border-bottom: 1px solid #dee2e6;
  border-top-right-radius: calc(0.375rem - 1px);
}

.pp-nav-btn-down {
  border-bottom-right-radius: calc(0.375rem - 1px);
}