:root {
    --main: #fe3f18;
    --bg-top-raw: 254 63 24;
    --main-box-shadow: rgb(from var(--main) r g b / 0.05);
    --accent: #fe3f18;
    --accent-hover: #c5e300;
    --paddingSite: 40px;
    --card-radius: 20px;
    --card-bg: #ffffff;
    --bg: #FDFDFD;
    --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --border-subtle: #d4d7e1;
    --text-main: #191919;
    --text-muted: #5e5e5e;
    --main-button: #36454F;
}

/* --- BASE & TYPOGRAPHY --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

b {
    font-weight: 600;
}

body {
    margin: 0;
    width: 100vw;
    background: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    overscroll-behavior: none;
    font-optical-sizing: auto;
}

/* --- LAYOUT WRAPPERS --- */
.bgSection {
    position: relative;
    width: 100vw;
    margin-left: auto;
    box-sizing: border-box;
    background: none;
    min-height: 100vh;
}

@media (min-width: 1200px) {
    .bgSection.open {
        width: calc(100vw - 450px);
    }
}

.menuTransition {
    transition: transform 0.45s cubic-bezier(.4, 0, .2, 1), width 0.45s cubic-bezier(.4, 0, .2, 1) !important;
}

/* --- HEADER --- */
.headerDivKampfrichter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--paddingSite);
    background: var(--main);
    color: #fff;
    margin-bottom: var(--paddingSite);
    position: relative;
    z-index: 3;
}

.heading-pannel {
    margin: 0;
    font-weight: 300;
    font-size: 2rem;
    letter-spacing: -0.5px;
}

.menuWrapper {
    display: flex;
    align-items: center;
    gap: 24px;
}

.mainContentDiv {
    padding: 0 var(--paddingSite);
}

/* --- FOOTER / LOGOUT --- */
.footerInternMenu {
    margin-top: auto;
    padding-top: 20px;
}

/* Burger + menu (unchanged from your style) */

.wk-leitungBurgerMenuDiv {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    cursor: pointer;
    z-index: 99;
    color: var(--bg);
}

.wk-leitungBurgerMenuDiv svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    transition: transform 0.3s ease;
}

.wk-leitungBurgerMenuDiv.open svg {
    transform: rotate(45deg);
}

.internMenuDiv {
    background-color: #fff;
    box-shadow: none;
    position: fixed;
    left: 0;
    top: 0;
    height: 100svh;
    width: 100%;
    max-width: 450px;
    transform: translateX(-100%);
    z-index: 100;
    padding: 30px;
    transition: transform 0.45s cubic-bezier(.4, 0, .2, 1);
    opacity: 1;
}

.internMenuDiv.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.innerInternMenuDiv {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
    overflow-y: auto;
}

.text_akt_abt {
    font-size: 1rem;
    color: #555;
    text-align: center;
    line-height: 1.6;
}

.innerInternMenuDiv form {
    margin: 0;
}

.innerInternMenuDiv input[type="submit"],
.innerInternMenuDiv select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #ccc;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.innerInternMenuDiv input[type="submit"]:focus,
.innerInternMenuDiv select:focus {
    outline: none;
    border-color: #2d73ac;
    box-shadow: 0 0 6px rgba(45, 115, 172, 0.3);
}

.innerInternMenuDiv .button-secondary {
    background: linear-gradient(135deg, #2d73ac, #1f4f75);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 18px;
    transition: transform 0.2s ease, background 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.innerInternMenuDiv .button-secondary:hover {
    background: linear-gradient(135deg, #245d8a, #163b5a);
    transform: translateY(-2px);
}

/* Riegeneinteilung Specific Styles */

.headerAbt {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.headerAbt h2 {
    margin: 0;
    font-weight: 400;
    color: var(--main);
    font-size: 1.5rem;
}

.textInputAbtTitel {
    margin: 0;
    font-weight: 400;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--main);
    font-size: 1.5rem;
    color: #191919;
    background: none;
    width: max-content;
    padding: 4px 8px;
}

.deleteProgramm {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #fee2e2;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(244, 63, 94, 0.1);
}

.deleteProgramm:hover {
    transform: scale(1.1);
    background: #fee2e2;
    box-shadow: 0 4px 8px rgba(244, 63, 94, 0.2);
}

.deleteProgramm svg,
.deleteProgramm path {
    fill: #f43f5e;
}

#bin-lid {
    transform-origin: 50% 100%;
    transform-box: fill-box;
    transition: transform 0.3s ease;
}

.deleteProgramm:hover #bin-lid {
    transform: rotate(20deg) translateY(-100px);
}

/* Sidebar Menu Button Styling */
.headerOptionConatiner {
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    gap: 15px;
    margin-top: auto;
}

.headerOptionConatiner > button {

}

.headerOptionConatiner label {
    font-weight: 400;
    color: var(--text-main);
    font-size: 0.9rem;
    margin-bottom: -5px;
}

.headerOptionConatiner input[type="number"] {
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: #fff;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
}

.headerOptionConatiner input[type="number"]:focus {
    border-color: var(--main);
    box-shadow: 0 0 0 3px rgba(40, 102, 110, 0.1);
}

/* Custom Table / Drag and Drop Area */
.geraet-table {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    min-width: 260px;
    overflow: hidden;
    margin-right: 15px;
    transition: all 0.3s ease;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.geraet-table thead {
    background: var(--main);
}

.geraet-table thead th {
    display: flex;
    justify-content: space-between;
    color: #fff;
    padding: 14px 20px;
    font-weight: 300;
    font-size: 1.05rem;
    text-align: left;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
}

.geraet-table thead th i span {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 400;
}

.geraet-table tbody {
    display: block;
    max-height: 480px;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding: 10px;
}

/* Custom Scrollbar for tbody */
.geraet-table tbody::-webkit-scrollbar {
    width: 6px;
}

.geraet-table tbody::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.geraet-table tbody::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.geraet-table tbody::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.turnerin-row {
    cursor: grab;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
    display: block;
    border: 1px solid transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.turnerin-row:active {
    cursor: grabbing;
}

.turnerin-row>td {
    padding: 12px 16px;
    border: none;
    display: block;
    width: 100%;
    color: var(--text-main);
    font-weight: 200;
}

.turnerin-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    z-index: 10;
    position: relative;
    border-color: #cbd5e1;
}

/* Drag State */
.dragging {
    opacity: 0.9 !important;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
    transform: scale(1.03) rotate(1deg) !important;
    z-index: 9999 !important;
}

.drop-placeholder {
    height: 54px;
    background: #f8fafc;
    border: 2px dashed #94a3b8;
    border-radius: 8px;
    margin: 8px 0;
}

.ui-sortable {
    min-height: 120px;
}

.empty-drop-row td {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Grouping Row Styling */
.group-row {
    background: transparent;
    margin-bottom: 12px;
}

.group-row>td {
    padding: 0;
    display: block;
}

.group-header {
    padding: 12px 16px;
    cursor: grab;
    gap: 18px;
    border-radius: 10px;
    font-weight: 200;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 6px;
    display: flex;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    justify-content: space-between;
    align-items: center;
}

.group-header:active {
    cursor: grabbing;
}

.group-inner {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    padding-left: 10px;
}

.group-row .group-inner {
    display: none;
}

/* Invalid / Unassigned Wrapper */
.invalidAbtDiv {
    padding: 10px 0;
}

.invalidAbtDiv .geraet-table {
    box-shadow: none;
    border-color: #d93f4a;
    width: 100%;
}

.invalidAbtDiv .geraet-table thead {
    background: #d93f4a;
}

.invalidAbtDiv .geraet-table thead th {
    color: #ffffff;
}


.singleAbtDiv {
    padding-bottom: 20px;
}

.singleAbtDataContainer {
    overflow-x: auto;
    padding: 10px 0 20px 0;
    display: flex; 
    flex-direction: row; 
    gap: 16px; 
    align-items: flex-start; 
    margin-top: 24px; 
    margin-bottom: 8px;
}

.singleAbtDataContainer::-webkit-scrollbar {
    height: 8px;
}

.singleAbtDataContainer::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.singleAbtDataContainer::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.buttonMoveDiv {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.buttonMove {
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 24px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

input.abtIndexInput::-webkit-outer-spin-button,
input.abtIndexInput::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

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

.abtIndexInput {
    text-align: center;
}

.nichtBezahlt {
    color: #e11d48;
    font-size: 0.9rem;
    font-weight: 500;
}

.timePicker {
    border: none;
    border-bottom: 1px solid #000;
    background: none;
    padding: 4px 8px;
    font-size: 1rem;
    color: var(--main);
    width: 80px;
    text-align: center;
}

.addTimetypeButton {
    color: #2dac79;
}

.removeTimetypeButton {
    color: #e11d48;
}

.subHeaderAbt {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.9rem;
    align-self: start;
    margin-top: 18px;
    position: relative;
}

.subHeaderAbt .customSelect {
    position: absolute;
    width: 160px;
    bottom: 0px;
    transform: translateY(120%) translateX(-10%);
    padding: 6px;
    background: #fff;
    border: 1px solid #7b7676;
    border-radius: 6px;
}

.hidden {
    display: none !important;
}

.buttonsDiv {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: flex-start;
    margin-bottom: 20px;
    position: fixed;
    bottom: 10px;
    right: 20px;
}

.blackBtn {
    background: var(--main-button);
    border: 1px solid #fff;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 10px;
    transition: transform 0.3s ease;
    letter-spacing: 1px;
    display: flex;
    align-self: flex-start;
}

.blackBtn:hover {
    transform: scale(1.02);
}

.blackBtn:active {
    transform: scale(0.98);
}

h3.normalTitle {
    color: var(--main-button);
    margin-bottom: 8px;
    letter-spacing: 1px;
}