body {
    background: linear-gradient(135deg, #b5f6cf 0%, #00a6a6 45%, #0f4c5c 82%, #022538 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #022538;
    margin: 0;
    padding: 24px;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#root {
    background: transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
}

#app-screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    height: 100%;
}

h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px 0;
}

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

.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    color: white;
    background: linear-gradient(135deg, #00a6a6 0%, #0f4c5c 100%);
    transition: filter 0.2s;
    text-decoration: none;
}

.btn:hover {
    filter: brightness(1.05);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-secondary {
    background: white;
    color: #022538;
    border: 1px solid rgba(2, 37, 56, 0.12);
}

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

.title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

#selected-count {
    background: #ffffff;
    color: #0f4c5c;
    border-radius: 10px;
    padding: 2px 8px;
    font-weight: 700;
    font-size: 14px;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.tab-btn {
    background: linear-gradient(135deg, rgba(0, 166, 166, 0.7) 0%, rgba(15, 76, 92, 0.7) 100%);
    color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    cursor: pointer;
}

.tab-btn.active {
    background: linear-gradient(135deg, #00a6a6 0%, #0f4c5c 100%);
    color: white;
    filter: brightness(1.1);
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.tab-content {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(2, 37, 56, 0.12);
    border-radius: 12px;
    padding: 0;
    flex: 1;
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

.table-container {
    overflow: auto;
    flex: 1;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: auto;
    /* Allow columns to expand based on min-width */
}

th {
    background: #f5f6f7;
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid rgba(2, 37, 56, 0.12);
    font-weight: 600;
    color: #022538;
    position: sticky;
    top: 0;
    z-index: 10;
    min-width: 140px;
    /* Normalized minimum width */
}

th:first-child {
    min-width: 50px;
    width: 50px;
}

td {
    padding: 8px;
    color: rgba(2, 37, 56, 0.72);
    border-bottom: 1px solid rgba(2, 37, 56, 0.06);
    vertical-align: middle;
    text-align: center;
    white-space: normal;
    /* Enable wrapping */
    word-wrap: break-word;
    /* Break long words */
}

/* Specific column widths for Description (Auftragsbeschreibung) */
#table-main th:nth-child(7),
#table-main td:nth-child(7) {
    min-width: 500px;
}

#table-deepdive th:nth-child(9),
#table-deepdive td:nth-child(9) {
    min-width: 500px;
}

#table-headobu th:nth-child(9),
#table-headobu td:nth-child(9) {
    min-width: 500px;
}

#table-screening th:nth-child(8),
#table-screening td:nth-child(8) {
    min-width: 500px;
}

#table-final th:nth-child(9),
#table-final td:nth-child(9) {
    min-width: 500px;
}



/* Specific column widths for DeepDive Beauftragte:r */
#table-main th:nth-child(12),
#table-main td:nth-child(12) {
    min-width: 240px;
}

#table-deepdive th:nth-child(3),
#table-deepdive td:nth-child(3) {
    min-width: 350px;
}

#table-headobu th:nth-child(4),
#table-headobu td:nth-child(4) {
    min-width: 240px;
}

/* Global Centering for Screening Table */
#table-screening th,
#table-screening td {
    text-align: center;
    vertical-align: middle;
}

/* DeepDive Link Column (Index 12) */
#table-screening th:nth-child(12),
#table-screening td:nth-child(12) {
    min-width: 80px;
    width: 80px;
}

/* Option DeepDive Box (Index 13) */
#table-screening th:nth-child(13),
#table-screening td:nth-child(13) {
    min-width: 400px;
}

/* Option Angebot Box (Index 14) */
#table-screening th:nth-child(14),
#table-screening td:nth-child(14) {
    min-width: 500px;
}

/* Added widths for other assignee columns in Screening */
#table-screening th:nth-child(3),
#table-screening td:nth-child(3) {
    min-width: 240px;
}

#table-screening th:nth-child(4),
#table-screening td:nth-child(4) {
    min-width: 240px;
}

#table-final th:nth-child(4),
#table-final td:nth-child(4) {
    min-width: 240px;
}

/* Specific column widths for Market Team, Angebotslead, Teammitglieder (Head of BU OE/PI) */
#table-headobu th:nth-child(14),
#table-headobu td:nth-child(14) {
    min-width: 200px;
}

#table-headobu th:nth-child(15),
#table-headobu td:nth-child(15) {
    min-width: 80px;
}

#table-headobu th:nth-child(16),
#table-headobu td:nth-child(16) {
    min-width: 50px;
    width: 50px;
    text-align: center;
}

/* Specific column widths for Screening (same as HeadObu) - Removed merged cols */

/* Specific column widths for Market Team, Angebotslead, Teammitglieder (Final) */
#table-final th:nth-child(14),
#table-final td:nth-child(14) {
    min-width: 280px;
}

#table-final th:nth-child(15),
#table-final td:nth-child(15) {
    min-width: 280px;
}

/* #table-final th:nth-child(17),
#table-final td:nth-child(17) {
    min-width: 50px;
    width: 50px;
    text-align: center;
} */

.select-toggle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #0f4c5c;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-weight: bold;
}

.select-toggle.checked {
    background: #1db954;
    border-color: #1db954;
    color: white;
}

.trash-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 22px;
    padding: 6px;
    border-radius: 4px;
}

.trash-btn:hover {
    color: #e53935;
    background: rgba(229, 57, 53, 0.1);
}

.deepdive-btn {
    color: #0f4c5c;
    background: transparent;
    border: none;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
}

.deepdive-btn:hover {
    color: #00a6a6;
}

/* Custom widgets */
.consulting-field-bar {
    background: #eaffea;
    border: 1px solid #1db954;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
}

select {
    background: transparent;
    border: none;
    color: #022538;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
    cursor: pointer;
}

select:focus {
    outline: none;
}

.assignee-input {
    background: transparent;
    border: none;
    color: #022538;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
    padding: 0;
    text-align: left;
}

.assignee-input:focus {
    outline: none;
}

.assignee-input-wrap {
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 2px 6px;
    min-width: 0;
}

.assignee-input-wrap.locked {
    background: #eaffea;
    border-color: #1db954;
}

.confirm-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #1db954;
    background: #eaffea;
    color: #1db954;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.confirm-btn:hover {
    background: #d6f6dc;
}

.filter-row {
    background: #e8f9ee;
    border-bottom: 1px solid rgba(2, 37, 56, 0.12);
    padding: 8px 16px;
    display: flex;
    gap: 16px;
    align-items: center;
}

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

.filter-label {
    font-size: 11px;
    font-weight: 600;
    color: #3a3a3a;
}

.filter-input {
    border: 1px solid #00a6a6;
    border-radius: 6px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.92);
    font-size: 12px;
}

.filter-input:focus {
    border: 2px solid #0f4c5c;
    background: white;
    outline: none;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Spinner */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #09f;
    animation: spin 1s ease infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

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

/* Action Buttons for DeepDive Column */
.action-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-stack {
    display: grid;
    grid-template-columns: 24px 24px 24px;
    grid-template-rows: auto auto;
    column-gap: 4px;
    row-gap: 4px;
    justify-content: center;
    align-items: center;
    margin-right: 6px;
}

.assignee-tooltip {
    position: fixed;
    background: #2f2f2f;
    color: #ffffff;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    max-width: 240px;
}

.assignee-tooltip.hidden {
    display: none;
}

.assignee-tooltip-name {
    font-weight: 600;
}

.assignee-tooltip-meta {
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2px;
}

.assignee-tooltip-sep {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 6px 0;
}

.assignee-picker {
    background: transparent;
    border: none;
    color: inherit;
    text-align: left;
    padding: 6px 0;
    width: 100%;
    cursor: pointer;
}

.assignee-picker:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-circle-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    padding: 0;
    flex-shrink: 0;
    font-family: inherit;
    transition: filter 0.2s;
}

.btn-circle-small:hover {
    filter: brightness(0.95);
}

.btn-lock {
    background-color: #e0e0e0;
    color: #2f2f2f;
    font-size: 14px;
    grid-column: 1;
    grid-row: 1;
}

.btn-lock.locked {
    background-color: #1db954;
    color: white;
}

.btn-info {
    background-color: #ffe082;
    color: #5d4037;
    font-size: 14px;
    grid-column: 2;
    grid-row: 1;
}

.btn-message {
    background-color: #00a6a6;
    color: white;
    font-size: 16px;
    grid-column: 3;
    grid-row: 1;
}

.btn-clear {
    background: #ffffff;
    color: #022538;
    border: 1px solid rgba(2, 37, 56, 0.2);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    grid-column: 1 / 4;
    grid-row: 2;
    justify-self: center;
}

.action-stack.action-stack-compact {
    grid-template-columns: 24px;
}

.action-stack.action-stack-compact .btn-clear {
    grid-column: 1;
}

.btn-clear:hover {
    filter: brightness(0.97);
}

/* --- New Option Box Layout (Screening Tab) --- */

.option-box {
    position: relative;
    border-width: 2px;
    border-style: dashed;
    border-radius: 12px;
    padding: 16px 12px 8px 12px;
    /* Top padding space for legend */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
    /* Space for the legend above border */
}

.option-legend {
    position: absolute;
    top: -12px;
    left: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: #fff;
    /* Match row bg? Actually row bg is transparent or white */
    padding: 0 4px;
    color: #555;
}

/* Fix for row background transparency issue if needed:
   The legend needs a background to cover the border.
   Rows might have hover effects, but let's assume white for now. */
tr:hover .option-legend {
    background: inherit;
    /* Might not work if border goes through. */
}

.option-deepdive {
    border-color: #fbc02d;
    /* Yellow/Orange */
    background: rgba(253, 248, 227, 0.3);
}

.option-deepdive .option-legend {
    color: #fbc02d;
    /* Match border */
}

.option-angebot {
    border-color: #0f4c5c;
    /* Teal/Dark Green */
    background: rgba(224, 242, 241, 0.3);
}

.option-angebot .option-legend {
    color: #0f4c5c;
}

.option-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    width: 100%;
}

.option-label {
    font-size: 10px;
    font-weight: 700;
    color: #555;
    margin-bottom: 2px;
}

/* Centered inputs for Angebot Option */
.center-text input,
.center-text select {
    text-align: center;
    text-align-last: center;
    /* For selects */
}

/* Rocket Button */
.rocket-btn {
    background: #0f4c5c;
    /* Dark Teal */
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: filter 0.2s;
    white-space: nowrap;
}

.rocket-btn:hover {
    filter: brightness(1.1);
}

/* DeepDive Button */
.dd-btn {
    background: #f9a825;
    /* Orange/Yellow darker shade */
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: filter 0.2s;
    white-space: nowrap;
}

.dd-btn:hover {
    filter: brightness(1.1);
}

/* Ensure inputs in option box have white bg for readability */
.option-box input,
.option-box select {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    padding: 4px;
}

.table-end-marker {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
    font-size: 12px;
    background: transparent;
    width: 100%;
}

.col-end {
    min-width: 60px;
    width: 60px;
    border-left: 1px solid rgba(2, 37, 56, 0.1);
    text-align: center;
    color: #999;
    background: #fdfdfd;
    font-style: italic;
}

.table-container table {
    padding-right: 24px;
}

td:last-child,
th:last-child {
    padding-right: 24px;
}

/* Center and size Confirm columns */
#table-main th:nth-child(13),
#table-main td:nth-child(13),
#table-screening th:nth-child(15),
#table-screening td:nth-child(15),
#table-deepdive th:nth-child(14),
#table-deepdive td:nth-child(14) {
    min-width: 50px;
    width: 50px;
    text-align: center;
}