/* ========== Basis Farb- und Abstandsvariablen ========== */
:root {
  --bg-body: #000;
  --bg-table: #1a1a1a;
  --bg-head: #288211;
  --fg: #fff;
  --fg-muted: #d0d0d0;
  --accent: #4caf50;
  --space-sm: .35rem .55rem;
}

/* ========== Body ========== */
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg-body);
  color: var(--fg);
  padding: 70px 0 60px; /* oben Header, unten Footer */
}

/* ========== Header ========== */
app-header {
  background-color: var(--bg-head);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
}
.header-text {
  display: flex;
  flex-direction: column;
}
.header-subtitle {
  font-size: 0.9rem;
  margin-top: 0.3rem;
  opacity: 0.9;
}
.app-header h1 {
  margin: 0;
  font-size: 1.2rem;
}
.icon, .header .icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
  opacity: 0.9;
  transition: transform 0.2s, filter 0.3s;
}
.icon:hover {
  transform: scale(1.1);
  opacity: 1;
}

/* ========== Navigation: Woche ========== */
.week-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111;
  color: #fff;
  padding: 0.5rem 1rem;
  font-weight: bold;
}
.week-nav a {
  color: #fff;
  text-decoration: none;
}

/* ========== Tagesliste & Einträge ========== */
.tage-liste {
  padding: 2rem;
}
.tag-box {
  background: var(--bg-table);
  border: 1px solid #444;
  margin-bottom: 1rem;
  border-radius: 6px;
  overflow: hidden;
}
.tag-header {
  background-color: #388e3c;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.tag-header:hover {
  background-color: #2e7d32;
}
.tag-header .icon {
  width: 20px;
  height: 20px;
  margin-left: 0.5rem;
}
/* Formular unter Tag */
.tag-form {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 1rem;
  background-color: #222;
  transition: max-height 0.4s ease-in-out, opacity 0.3s ease;
}
.tag-form.visible {
  max-height: 400px;
  overflow-y: auto;
  opacity: 1;
  padding: 1rem;
}
.tag-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.tag-form input,
.tag-form select {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border-radius: 4px;
  border: none;
  background-color: #333;
  color: white;
}

/* ========== Speichern-Button ========== */
.tag-form button,
button[type="submit"]:not(.btn) {
  margin-top: 1rem;
  width: 100%;
  background: #c6ffc8;
  color: rgb(41, 41, 41);
  border: none;
  padding: 0.75rem;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
button:not(.btn):hover {
  background-color: #43a047;
}
button:not(.btn):active {
  transform: scale(0.98);
}

/* ========== Erfolgsmeldungen ========== */
.saved-message,
.global-success {
  background-color: #4caf50;
  color: white;
  text-align: center;
  padding: 10px;
  font-weight: bold;
  border-radius: 5px;
  margin: 15px;
  animation: fadeInOut 4s ease-in-out forwards;
}
@keyframes fadeInOut {
  0%   { opacity: 0; transform: translateY(-10px);}
  10%  { opacity: 1; transform: translateY(0);}
  90%  { opacity: 1;}
  100% { opacity: 0; transform: translateY(-10px);}
}

/* ========== Pfeil-Drehung beim Aufklappen ========== */
.d-none { display: none !important; }
.rotate { display: inline-block; transition: transform 0.3s ease; }
.rotated { transform: rotate(-180deg); }

/* ========== Footer-Navigation ========== */
.nav-footer {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background-color: #fff;
  color: #000;
  padding: 12px;
  border-top: 1px solid #ccc;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 100;
}
.nav-left, .nav-center, .nav-right {
  display: flex;
  gap: 1rem;
}
.nav-footer a {
  text-decoration: none;
}
.footer .footer-action {
  color: #000;
  text-decoration: none;
}
.footer .footer-action:hover,
.footer .footer-action:focus {
  color: #000;
  text-decoration: none;
}

/* ========== Bottom-Sheet Menü (Home) ========== */
.home-menu {
  position: fixed;
  bottom: 60px;
  left: 0; right: 0;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 1rem;
  z-index: 1000;
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.5);
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  display: block;
}
.home-menu.hidden { display: none; }
.home-menu h2 { margin-top: 1.5rem; }
.home-menu ul { list-style: none; padding-left: 0; }
.home-menu li { margin: 0.5rem 0; }
.home-menu li a { color: #fff; text-decoration: none; }
.home-menu li a:hover { text-decoration: underline; }
.menu-logo {
  margin-top: 2rem;
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
}
.app-logo-navbar {
  height: 120px;
  width: auto;
  margin-right: 10px;
}
.navbar .navbar-brand {
  height: 56px;
  padding-top: 0;
  padding-bottom: 0;
  overflow: visible;
}
@media (max-width: 576px) {
  .app-logo-navbar {
    height: 96px;
  }
  .navbar .navbar-brand {
    height: 48px;
  }
}

/* ========== Tabellenansicht Wochenübersicht ========== */
.table-wrapper {
  overflow-x: auto;
  margin: 1rem;
}
.wochen-tabelle {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--bg-table);
  color: var(--fg);
  font-size: .9rem;
}
.wochen-tabelle th, .wochen-tabelle td {
  padding: var(--space-sm);
  border: 1px solid #444;
  text-align: center;
}
.wochen-tabelle th {
  background: var(--bg-head);
  font-weight: 700;
}
.wochen-tabelle tr:nth-child(even) {
  background-color: #232323;
}
@media (min-width: 1400px) {
  .wochen-tabelle th,
  .wochen-tabelle td {
    font-size: 0.7rem;
    padding: .43rem .7rem;
  }
}
@media (min-width:1800px){
  .container-fluid{max-width:none;}
}

/* Spalten gezielt formatieren */
td:nth-child(4),
td:nth-child(6),
td:nth-child(7),
td:nth-child(8),
td:nth-child(9) { white-space: nowrap; }
td:nth-child(17),
td:nth-child(19),
td:nth-child(20) { white-space: normal; word-break: break-word; }

/* Checkbox-Spalte schlank halten */
td:last-child, th:last-child { width: 45px; }

/* Hover-Zeile */
.wochen-tabelle tbody tr:hover { background: #182b3a; }

/* ========== KW-Dropdown ========== */
.kw-dropdown-wrapper {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.kw-display { font-weight: bold; }
.kw-dropdown {
  position: absolute;
  top: 100%; left: 0;
  background-color: #1a1a1a;
  border: 1px solid #444;
  padding: 0.5rem;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.kw-dropdown a {
  color: white;
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.kw-dropdown a:hover,
.kw-dropdown a.active {
  background-color: #388e3c;
}

/* ========== Splash ========== */
.splash-body {
  margin: 0; padding: 0;
  display: flex;
  background-color: #388e3c;
  color: #fff;
  font-family: sans-serif;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
.splash-container { text-align: center; }

/* ========== Bestätigungsanzeige Antrag ========== */
.confirmation {
  text-align: center;
  margin: 2rem auto;
  padding: 1rem;
  max-width: 600px;
  background-color: #969696;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.confirmation h2 { margin-top: 0; }

/* ========== Tabelle Meine Anträge ========== */
.my-requests-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
.my-requests-table th,
.my-requests-table td {
  border: 1px solid #ccc;
  padding: 0.5rem;
  text-align: center;
}
.my-requests-table th {
  background-color: #ababab;
}

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

/* ========== Responsive Fixes, falls nötig ========== */
@media (max-width: 600px) {
  .tage-liste { padding: 1rem 0.5rem; }
  .table-wrapper { margin: 0; }
  .wochen-tabelle th, .wochen-tabelle td { font-size: .85rem; padding: .4rem .3rem; }
}

/* ========== Scrollbarer Content ========== */
.scrollable-content {
  max-height: calc(100vh - 60px);
  /* overflow-y: auto; */
  /* padding-bottom: 1rem; */
}
/* --- Tabellen wirklich breit auf großen Bildschirmen --- */
@media (min-width: 1200px) {
  .container,
  .container-fluid {
    max-width: 98vw;   /* Nimmt fast die ganze Viewport-Breite ein */
    width: 98vw;
    padding-left: 1vw;
    padding-right: 1vw;
  }
  .table-wrapper {
    max-width: 100vw;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
  }
  .wochen-tabelle {
    width: 100%;
    min-width: 1500px;   /* Optional: sorgt dafür, dass die Tabelle nicht zu schmal wird */
  }
/* --- Breite, zentriert, Scroll bei Overflow (Desktop und XXL) --- */
.wide-table-wrapper {
  width: 99vw;          /* Fast ganze Viewport-Breite */
  max-width: 1800px;    /* Begrenzung auf großen Monitoren */
  margin: 0 auto 2rem auto;
  padding: 0 0.5vw;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  min-width: 1600px;     /* Verhindert Spaltenquetschung bei sehr vielen Spalten */
  border-collapse: collapse;
  background: #f8faf8;
}

.table.vacation-entitlements-table {
  min-width: 0;
}

.notifications-menu {
  width: 360px;
  max-height: 420px;
  overflow-y: auto;
  padding-top: 0.25rem;
}

.notifications-bell {
  font-size: 1.1rem;
  line-height: 1;
}

.notifications-badge {
  position: absolute;
  top: 0.1rem;
  right: -0.25rem;
  font-size: 0.65rem;
  padding: 0.25rem 0.35rem;
}

.notifications-item--unread {
  background: #fff8e1;
}

.notifications-message {
  white-space: normal;
}

.table.notifications-table th:last-child,
.table.notifications-table td:last-child {
  width: auto;
  min-width: 0;
}

.vacation-calendar-wrapper {
  overflow-x: hidden;
}

.table.vacation-calendar {
  min-width: 0 !important;
  width: 100%;
  table-layout: fixed;
  background: #ffffff;
}

.table.vacation-calendar th,
.table.vacation-calendar td {
  vertical-align: top;
  padding: 0;
}

.table.vacation-calendar th:last-child,
.table.vacation-calendar td:last-child {
  width: auto;
  min-width: 0;
}

.vacation-day {
  height: 170px;
  background: #ffffff;
}

.vacation-day-inner {
  height: 100%;
  padding: 0.6rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.vacation-day-header {
  min-height: 1.6rem;
}

.vacation-day-meta {
  min-height: 1.2rem;
}

.vacation-day-holiday {
  min-height: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.vacation-day-entries {
  margin-top: 0.1rem;
}

.vacation-day--outside {
  background: #f4f4f4;
  color: #999;
}

.vacation-day--today {
  outline: 2px solid #1b8c3a;
  outline-offset: -2px;
}

.vacation-day--critical {
  background: #fff5f5;
}

.vacation-entry {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.vacation-entry-name {
  font-weight: 600;
}

/* Bootstrap: Streifen und Farben */
.table-striped > tbody > tr:nth-child(even) {
  background-color: #f5f5f5 !important;
}
.table-success > th, .table-success > td, thead.table-success th {
  background-color: #d4f8dd !important;
  color: #222;
}

/* Kopfbereich (Card) etwas absetzen und auf max 600-700px begrenzen */
.card {
  max-width: 1600px;
  margin: 0 auto 2rem auto;
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 18px rgba(40,130,17,0.06);
}

.card-body {
  padding: 2rem 2rem;
}

/* Etwas mehr Luft bei Tabellenzellen */
.table th, .table td {
  padding: 0.68rem 0.55rem;
  vertical-align: middle;
  font-size: 0.8rem;
  border: 1px solid #e2e2e2;
}

/* Letzte Spalten nie zu schmal */
.table th:last-child,
.table td:last-child {
  width: 48px;
  min-width: 48px;
}

/* Responsives Verhalten für Tablets/Mobile */
@media (max-width: 1600px) {
  .wide-table-wrapper {
    width: 100vw;
    max-width: 100vw;
    padding: 0 1vw;
  }
  .table {
    min-width: 900px;    /* Immer noch scroll-bar auf kleinen Screens */
    font-size: 0.5rem;
  }
  .card {
    max-width: 99vw;
    margin: 0.9rem;
  }
  .card-body {
    padding: 1rem;
  }
}

/* Scrollbar schöner (optional) */
.table-responsive::-webkit-scrollbar {
  height: 10px;
  background: #e2e2e2;
}
.table-responsive::-webkit-scrollbar-thumb {
  background: #a1d9ae;
  border-radius: 5px;
}

/* Bearbeiten-Button: besser sichtbar */
.btn-success.btn-sm {
  background: #288211;
  color: #fff;
  border: none;
  padding: 0.32rem 1.1rem;
  border-radius: 5px;
  font-weight: 500;
}
.btn-success.btn-sm:hover {
  background: #388e3c;
}

/* Card für Mitarbeiterinfos – gleiche Breite wie Tabelle */
.wide-table-wrapper .card {
  max-width: 100%;
  width: 100%;
  margin: 0 auto 2rem auto;
  border-radius: 6px;
  border: none;
  box-shadow: 0 4px 18px rgba(40,130,17,0.06);
}

.wide-table-wrapper .card-body {
  padding: 1.2rem 2rem;
}

.wide-table-wrapper {
  width: 98vw;
  max-width: 2000px;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  padding: 0;
}

#wochen-tabelle {
  width: 100% !important;
  min-width: 1800px;   /* <--- oder nach Bedarf */
}
.container, .container-fluid {
  max-width: 99vw !important;
  width: 99vw !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.korrektur-text small {
  font-size: 0.85rem;  /* oder noch kleiner */
}
.remarks-wrap{
  white-space: normal;          /* Standard-Umbruch zulassen */
  overflow-wrap: anywhere;      /* falls mal sehr lange Tokens kommen */
  word-break: break-word;       /* Sicherheitsnetz für „zusammenhängende“ Zeichenfolgen */
  line-height: 1.35;
}
.remarks-wrap small{ display:block; margin-top:.25rem; }

/* Button-Styles angleichen */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all 0.15s ease;
}

.btn-sm {
  padding: 0.25rem 0.65rem;
  font-size: 0.82rem;
  border-radius: 0.45rem;
}

.btn-outline-primary {
  color: #0d6efd;
  border: 1px solid #0d6efd;
  background-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: #fff;
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-outline-success {
  color: #198754;
  border: 1px solid #198754;
  background-color: transparent;
}
.btn-outline-success:hover,
.btn-outline-success:focus {
  color: #fff;
  background-color: #198754;
  border-color: #198754;
}

/* Zahleneingaben ohne Spinner (z. B. Stundenfelder) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}
