:root {
    --bg-color: #f0f2f5;
    --text-color: #222222;
    --highlight-color: magenta;
    --accent-color: #880088;
    --sidebar-color: #ffffff;
    --link-color: magenta;
    --btntext-color: #ffffff;
    --btnbg-color: magenta;
    --error-fg-color: red;
    --error-bg-color: white;
    --success-fg-color: rgb(0, 0, 0);
    --success-bg-color: rgb(56, 240, 0);
    --warn-fg-color: orange;
    --warn-bg-color: #222;
    --navicon-main-color: #ccc;
    --navicon-sub-color: #75d1ff;
    --modal-header-bg-color: #222222;
    --modal-header-fg-color: #ffffff;
}

* {

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

body {
    background: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--fg-color);
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

#wait_form {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--sidebar-color);
    overflow: hidden;
}

.page {
    display: none;
    margin: 0;
    width: 100%;
    height: 100vh;
    transition: opacity ease-in-out 0.3s;
}

.page.visible {
    display: block !important;
}

.page_hide {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

#intern_form {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

nav#page_nav {
    display: block;
    float: left;
    width: 200px;
    height: 100vh;
    background-color: var(--btnbg-color);
    color: var(--btntext-color);
    padding: 15px 20px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

main#page_main {
    display: block;
    float: left;
    width: calc(100% - 200px);
    flex-grow: 1;
    padding: 20px;
    background: var(--bg-color);
    overflow-y: auto;
}

.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 250px;
    max-width: 400px;
    background: #333;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
    cursor: pointer;
    pointer-events: auto;
}

.toast.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.toast-header {
    font-weight: bold;
    margin-bottom: 5px;
}

svg {
    width: 80px;
    height: 80px;
    stroke: #0077cc;
}

span.nav-icon svg {
    width: 40px;
    height: 40px;
}

.step {
    display: none;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    margin: 50px auto;
}

.step.visible {
    display: block;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

input[type="text"],input[type="password"],input[type="email"],input[type="tel"],input[type="date"],input[type="number"] {
    width: 93%;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

td input {
    margin: 0 !IMPORTANT;
    padding: 1px ! IMPORTANT;
    border-radius: 0 !IMPORTANT;
}

input:focus {
    outline: none;
    border-color:  var(--highlight-color);
}

button {
    background-color:  var(--btnbg-color);
    color:  var(--btntext-color);
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
    margin-top: 10px;
    margin-right: 10px;
    user-select: none;
}

button:hover {
    background-color: var(--btnbg-color);
}

.error {
    color: red;
    margin-top: 10px;
    font-size: 0.9em;
}

.top-info {
    font-weight: bold;
    margin-bottom: 10px;
    color: #444;
}

/* Header */
header {
    background: #222;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

#header-icons {
    display: flex;
    gap: 15px;
}

.icon-wrapper {
    position: relative;
}

.badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: red;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    padding: 2px 6px;
}

/* Container Layout */
.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Navigation */
nav {
    background: #333;
    color: white;
    width: 60px;
    transition: width 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

nav.expanded {
    width: 200px;
}

#toggleSidebar {
    background: none;
    color: white;
    border: none;
    font-size: 24px;
    padding: 2px;
    cursor: pointer;
    padding-left: 10px;
    width: 51px;
}

nav ul {
    list-style: none;
    padding: 10px 0;
}

nav li {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

span.nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}

nav.expanded .nav-text {
    display: inline;
    margin-left: 10px;
    font-size: 16px;
    line-height: 1;
}

/* Hauptinhalt */
main {
    flex: 1;
    padding: 20px;
    padding-top: 0;
    overflow-y: auto;
    background: #f0f0f0;
    position: relative;
}

button.tab-button {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

button.tab-button.active {
    background-color: var(--accent-color);
}

#loader,
.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.nav-loader,
.main-loader {
    position: absolute;
}

.hidden {
    display: none;
}

.loader-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.nav-loader {
    position: absolute;
}

.main-loader {
    position: absolute;
}

/* Sidebar Links */
#mainnav {
    width: 200px;
}

#mainnav a {
    color: #fff;
    text-decoration: none;
    display: block;
    width: 100%;
}

#mainnav a.active {
    background-color: #222;
}

span.nav-icon {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 50px;
    flex-shrink: 0;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

th, td {
    border: 1px solid #ccc;
    padding: 8px;
}

thead tr.search-row {
    display: none;
}

.search-toggle {
    cursor: pointer;
    color: blue;
    text-decoration: underline;
    font-size: 0.9em;
    margin-bottom: 5px;
    display: inline-block;
}

#mainnav li a {
    display: flex;
    align-items: center;  /* Text & Icon vertikal mittig */
    height: 50px;
}

modal {
    position: fixed;
    top: 100px;
    left: 100px;
    background: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    resize: none;
    overflow: hidden;
    z-index: 1000;
    min-width: 200px;
    min-height: 150px;
}

modal[scaleable] {
    resize: both;
    overflow: auto;
}

mtitle {
    background: var(--modal-header-bg-color);
    color: var(--modal-header-fg-color);
    padding: 10px;
    font-weight: bold;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.mtitle-text {
    flex: 1;
}

.mtitle-buttons {
    display: flex;
    gap: 6px;
    margin-left: 10px;
}

.mtitle-buttons button {
    padding-top: 0;
}

.mtitle-buttons button {
    background: transparent;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    width: 24px;
    height: 24px;
    line-height: 20px;
    text-align: center;
}

mcontent {
    padding: 10px;
    flex: 1;
    overflow: auto;
}

@keyframes modalFadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.95); }
}

.modal-fade-out {
    animation: modalFadeOut 0.3s ease forwards;
}

details {
    border: 1px solid #888;
    border-radius: 0.5em;
    padding: 3px;
    margin-bottom: 3px;
}

details summary{
    cursor: pointer;
    user-select: none;
}

#selectStuffOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  z-index: 9999;
}
#selectStuffOverlay .inner {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  background: white;
  border-radius: 8px;
  width: 500px;
  max-height: 80%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#selectStuffOverlay header {
  padding: 8px;
  background: #0055aa;
  color: white;
}
#selectStuffOverlay input[type="search"] {
  padding: 6px;
  border: none;
  width: 100%;
  box-sizing: border-box;
}
#selectStuffOverlay .results,
#selectStuffOverlay .selected {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
#selectStuffOverlay .item {
  padding: 4px;
  cursor: pointer;
}
#selectStuffOverlay .item:hover {
  background: #eef;
}
#selectStuffOverlay footer {
  padding: 8px;
  text-align: right;
  border-top: 1px solid #ccc;
}

/* Grundstil für den Switch-Container */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;   /* Breite des Switch */
  height: 26px;  /* Höhe des Switch */
}

/* Die unsichtbare Checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Der Slider, sichtbarer Teil des Switch */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;  /* Hintergrund wenn aus */
  transition: 0.4s;
  border-radius: 26px;      /* Abgerundete Kanten */
}

/* Kreis in der Mitte */
.slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

/* Zustand "checked" */
input:checked + .slider {
  background-color: #1E40AF; /* Blau für aktiv */
}

input:checked + .slider::before {
  transform: translateX(24px); /* Verschiebt den Kreis nach rechts */
}

/* Optional: Hover-Effekt */
.slider:hover {
  background-color: #718096; /* etwas dunkler bei Hover */
}


@media (max-width: 480px) {
    .step {
        padding: 20px;
        border-radius: 8px;
        margin: 20px;
    }

    button {
        width: 100%;
        margin-right: 0;
    }

    #page_nav {
        padding: 12px;
    }

    #page_main {
        padding: 15px;
    }
}