@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;700&family=Manrope:wght@400;600;700&display=swap');

:root {
    --bg: #fff5f6;
    --panel: #ffffff;
    --panel-alt: #fff0f2;
    --text: #2f1318;
    --muted: #7f4a52;
    --line: #e6bcc4;
    --accent: #b01430;
    --accent-contrast: #ffffff;
    --danger: #9a0e26;
    --accent-soft: #ffd8df;
    --row-mark-bg: #ffe5ea;
    --row-mark-bg-hover: #ffdbe3;
    --row-mark-border: #c3193d;
    --badge-bg: #c3193d;
    --badge-text: #ffffff;
    --artist-row-favorisiert: #ffe2e2;
    --artist-row-bevorzugt: #fff4cf;
    --artist-row-alternative: #e4f5e6;
}

* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 10% -5%, #ffc7d1 0, transparent 42%),
        radial-gradient(circle at 95% 4%, #ffe3e8 0, transparent 34%),
        linear-gradient(160deg, #fff8f9 0%, #ffecef 100%),
        var(--bg);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid color-mix(in srgb, var(--accent) 25%, var(--line) 75%);
    background:
        linear-gradient(95deg, #ffffff 0%, #fff5f7 60%, #ffe8ec 100%);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 10px 26px rgba(130, 10, 38, 0.12);
    animation: slideDown 320ms ease-out;
}

.status-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    z-index: 120;
    min-width: 280px;
    max-width: min(92vw, 760px);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, #ffffff 55%);
    background: #ffffff;
    color: var(--text);
    box-shadow: 0 18px 42px rgba(40, 12, 20, 0.26);
    text-align: center;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.status-popup.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.confirm-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 130;
    background: rgba(20, 12, 14, 0.4);
    display: grid;
    place-items: center;
    padding: 1rem;
}

.confirm-popup-backdrop[hidden] {
    display: none !important;
}

.confirm-popup {
    width: min(560px, 94vw);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 52px rgba(20, 12, 14, 0.3);
    padding: 1rem;
}

.confirm-popup-message {
    margin: 0 0 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}

.confirm-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.club-logo {
    width: 92px;
    height: 58px;
    border-radius: 0;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    box-shadow: none;
}

#clubLogoImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
}

#clubLogoFallback {
    display: none !important;
}

.brand-text {
    display: grid;
    gap: 0.08rem;
}

.festschrift-summary {
    margin-top: 0.25rem;
    font-size: clamp(0.74rem, 1.2vw, 0.86rem);
    font-weight: 700;
    line-height: 1.35;
    padding: 0.28rem 0.5rem;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, #ffffff 78%);
    background: color-mix(in srgb, #ffffff 86%, var(--accent-soft) 14%);
    color: #7b1d31;
}

.brand-subtitle {
    margin: 0;
    color: #b43d50;
    font-size: clamp(0.7rem, 1.3vw, 0.78rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.topbar h1 {
    margin: 0;
    font-family: "Barlow Condensed", sans-serif;
    font-size: clamp(1.35rem, 2.3vw, 1.9rem);
    letter-spacing: 0.04em;
    color: #8f1328;
}

.topbar p {
    margin: 0.2rem 0 0;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    gap: 0.6rem;
}

.topbar-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.55rem 0.9rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--accent);
    color: var(--accent-contrast);
    text-decoration: none;
    box-shadow: 0 6px 14px rgba(141, 20, 48, 0.26);
    transition: transform 140ms ease, box-shadow 180ms ease, filter 180ms ease;
}

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

.topbar-link-btn:active {
    transform: translateY(1px);
}

.topbar-link-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none;
    box-shadow: none;
}

.icon-btn {
    width: 42px;
    min-width: 42px;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
    display: inline-grid;
    place-items: center;
}

.settings-icon {
    background: #8f1328;
    color: #fff;
    font-size: 1.2rem;
}

.icon-btn.is-open {
    background: #b51432;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.layout {
    width: 100%;
    margin: 0;
    padding: 1rem clamp(0.65rem, 2vw, 1.5rem);
    display: grid;
    gap: 1rem;
}

.start-home-card {
    min-height: 62vh;
    display: grid;
    place-items: stretch;
    gap: 1.2rem;
}

.start-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    align-items: center;
    gap: 1rem;
}

.start-logo-wrap {
    width: 100%;
    min-height: 460px;
    border: 1px dashed color-mix(in srgb, var(--line) 78%, #fff 22%);
    border-radius: 16px;
    background: #fff;
    display: grid;
    place-items: center;
    padding: 1rem;
}

#startLogoImage {
    max-width: 100%;
    max-height: 760px;
    object-fit: contain;
}

.start-logo-fallback {
    font-size: 1.1rem;
    color: var(--muted);
    font-weight: 700;
}

.start-actions {
    display: grid;
    gap: 0.8rem;
}

.start-actions-group {
    display: grid;
    gap: 0.55rem;
    padding: 0.45rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--line) 82%, #fff 18%);
}

.start-actions-title {
    margin: 0;
    text-align: center;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    color: #8f1328;
}

.start-actions-box {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff8f9;
    padding: 0.8rem;
    box-shadow: 0 8px 20px rgba(122, 18, 43, 0.1);
}

.start-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 230px;
    padding: 0.72rem 1rem;
    border-radius: 12px;
    background: var(--accent);
    color: var(--accent-contrast);
    border: 1px solid transparent;
    box-shadow: 0 8px 18px rgba(141, 20, 48, 0.24);
    font-weight: 700;
}

.start-nav-btn.ghost-btn {
    background: #fff2f4;
    color: #8a2034;
    border-color: #e5aab8;
}

.start-settings-dialog {
    width: min(720px, 96vw);
}

.internal-folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.75rem;
}

.internal-folder-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff8f9;
    padding: 0.75rem;
    display: grid;
    gap: 0.55rem;
}

.internal-folder-card h3 {
    margin: 0;
}

.internal-folder-card .controls-row {
    gap: 0.45rem;
}

.internal-folder-card .internal-file-input {
    flex: 1;
    min-width: 180px;
}

.internal-files-list {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 0.45rem;
    overflow-x: auto;
}

.internal-files-table {
    min-width: 560px;
}

.internal-files-table th,
.internal-files-table td {
    text-align: left;
    white-space: nowrap;
}

.internal-files-table a {
    color: #8f1328;
    text-decoration: none;
    font-weight: 600;
}

.internal-files-table a:hover {
    text-decoration: underline;
}

.internal-folders-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1rem;
}

.internal-folder-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(176, 20, 48, 0.07);
}

.ifc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.2rem;
    background: linear-gradient(to right, #fff0f2, #fff);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.ifc-header-left {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.ifc-folder-icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    color: var(--accent);
}

.ifc-title {
    margin: 0 0 3px;
    font-size: 1rem;
    font-weight: 700;
}

.ifc-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 20px;
    padding: 1px 9px;
}

.ifc-upload-zone {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.ifc-upload-zone .internal-file-input {
    font-size: 0.82rem;
    font-family: inherit;
    color: var(--text);
    max-width: 240px;
}

.ifc-upload-zone .internal-file-input::file-selector-button {
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 6px;
    padding: 0.32rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.4rem;
    font-family: inherit;
    transition: background 0.15s;
}

.ifc-upload-zone .internal-file-input::file-selector-button:hover {
    background: #ffc8d4;
}

.internal-files-list {
    padding: 0.6rem 1rem;
    overflow-x: auto;
    font-size: 0.875rem;
    color: var(--muted);
}

.internal-files-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
}

.internal-files-table th {
    font-weight: 700;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    text-align: left;
    padding: 0.4rem 0.75rem 0.5rem;
    border-bottom: 1.5px solid var(--line);
}

.internal-files-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f3e0e4;
    text-align: left;
    white-space: nowrap;
}

.internal-files-table tr:last-child td {
    border-bottom: none;
}

.internal-files-table a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.internal-files-table a:hover {
    text-decoration: underline;
}
    min-width: 150px;
}

.new-company-form {
    display: grid;
    gap: 0.4rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    background: #fff9fa;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
}

.import-box {
    margin-top: 0.7rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    background: #fff8f9;
    border-radius: 12px;
}

.import-box h3 {
    margin: 0 0 0.35rem;
}

.company-create-grid {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 0.55rem;
    min-width: max-content;
}

.company-create-item {
    flex: 0 0 auto;
    min-width: 140px;
}

.company-create-item input,
.company-create-item select {
    width: 100%;
    min-width: 0;
}

.company-create-item {
    display: grid;
    gap: 0.3rem;
}

.company-create-label {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 600;
}

.company-create-actions {
    display: flex;
    justify-content: flex-end;
    margin-left: 0.45rem;
    align-self: flex-end;
    flex: 0 0 auto;
}

.company-create-actions button {
    white-space: nowrap;
}

button,
input,
select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.5rem 0.6rem;
    font: inherit;
    background: #fff;
    color: var(--text);
}

button {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: transparent;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 180ms ease, filter 180ms ease;
    box-shadow: 0 6px 14px rgba(141, 20, 48, 0.26);
}

button:hover {
    filter: brightness(1.05);
}

button:active {
    transform: translateY(1px);
}

.muted {
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-alt);
    scrollbar-gutter: stable both-edges;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

#companiesIssueTable {
    min-width: 860px;
}

#companiesMasterTable {
    min-width: 100%;
    table-layout: fixed;
}

#companiesMasterTable th,
#companiesMasterTable td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#companiesMasterTable th:first-child,
#companiesMasterTable td:first-child {
    width: 340px;
}

#companiesMasterTable th:last-child,
#companiesMasterTable td:last-child {
    width: 120px;
}

#usersTable,
#logsTable,
#fieldsTable {
    min-width: 980px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 0.45rem;
    vertical-align: top;
    text-align: left;
}

th {
    position: sticky;
    top: 0;
    background: color-mix(in srgb, var(--panel-alt) 95%, #e6dfd1 5%);
    z-index: 2;
}

#fieldsTable th {
    text-align: center;
}

#companiesMasterTable th,
#companiesIssueTable th {
    text-align: left;
}

#companiesMasterTable td {
    text-align: left;
}

#companiesMasterTable th[data-field-key="seitengroesse"],
#companiesMasterTable td[data-field-key="seitengroesse"],
#companiesMasterTable th[data-field-key="vorlage_vorhanden"],
#companiesMasterTable td[data-field-key="vorlage_vorhanden"],
#companiesMasterTable th[data-field-key="daten_aktuell"],
#companiesMasterTable td[data-field-key="daten_aktuell"] {
    text-align: center;
}

#companiesMasterTable th[data-field-key="seitengroesse"],
#companiesMasterTable th[data-field-key="vorlage_vorhanden"],
#companiesMasterTable th[data-field-key="daten_aktuell"] {
    font-size: 1rem;
    font-weight: 800;
    white-space: normal;
    line-height: 1.2;
}

#companiesMasterTable th.master-highlight-col-head {
    text-align: center !important;
    font-size: 1.1rem;
    font-weight: 900;
}

/* Robuster Fallback: Zielspalten in der Firmenliste immer deutlich hervorheben */
#companiesMasterTable thead th:nth-child(8),
#companiesMasterTable thead th:nth-child(9),
#companiesMasterTable thead th:nth-child(10) {
    text-align: center !important;
    font-size: 1.28rem !important;
    font-weight: 900 !important;
    line-height: 1.15;
}

#companiesMasterTable tbody td:nth-child(8),
#companiesMasterTable tbody td:nth-child(9),
#companiesMasterTable tbody td:nth-child(10) {
    text-align: center !important;
    font-size: 1.05rem;
    font-weight: 800;
}

.company-create-item[data-field-key="seitengroesse"] .company-create-label,
.company-create-item[data-field-key="vorlage_vorhanden"] .company-create-label,
.company-create-item[data-field-key="daten_aktuell"] .company-create-label {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--text);
}

#companiesIssueTable th:nth-child(3),
#companiesIssueTable td:nth-child(3),
#companiesIssueTable th:nth-child(5),
#companiesIssueTable td:nth-child(5) {
    text-align: center;
}

#companiesMasterTable td:first-child {
    font-weight: 600;
}

.company-list-row {
    cursor: pointer;
}

.company-list-row:hover {
    background: #fff3f5;
}

.company-list-row--marked {
    background: var(--row-mark-bg);
    box-shadow: inset 4px 0 0 var(--row-mark-border);
}

.company-list-row--marked:hover {
    background: var(--row-mark-bg-hover);
}

.company-list-row--free {
    background: #fff6bf;
    box-shadow: inset 4px 0 0 #d4aa00;
}

.company-list-row--free:hover {
    background: #ffeea3;
}

.company-row-actions {
    width: 110px;
    white-space: nowrap;
    text-align: right;
}

.issue-badge {
    display: inline-block;
    margin-right: 0.4rem;
    padding: 0.18rem 0.42rem;
    border-radius: 999px;
    background: var(--badge-bg);
    color: var(--badge-text);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.file-badge {
    background: #1d6f7d;
}

.color-settings-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.65rem;
}

.color-settings-form label {
    display: grid;
    gap: 0.3rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.color-settings-form input[type="color"] {
    width: 100%;
    height: 40px;
    padding: 0.2rem;
}

.color-settings-actions {
    display: flex;
    gap: 0.5rem;
    align-items: end;
    grid-column: 1 / -1;
}

.logo-upload-box {
    margin-top: 0.9rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff8f9;
}

.logo-upload-box h4 {
    margin: 0 0 0.35rem;
}

.list-icon-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    margin-left: 0.35rem;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(141, 20, 48, 0.2);
}

.danger-icon-btn {
    background: var(--danger);
}

td input,
td select,
td button {
    width: 100%;
}

.inline-form {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.field-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.3fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(130px, 0.8fr) minmax(220px, 1.3fr) minmax(150px, 1fr) minmax(150px, 1fr) minmax(190px, 1.2fr) auto;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.checkbox-label input {
    width: auto;
}

.action-stack {
    display: grid;
    gap: 0.4rem;
}

.action-stack button {
    min-width: 88px;
}

.drag-handle {
    background: #ffecef;
    color: #8d2036;
    border: 1px dashed #d99cab;
    cursor: grab;
    min-width: 84px;
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-row.is-dragging {
    opacity: 0.5;
}

.sortable-row.drop-before td {
    border-top: 3px solid var(--accent);
}

.sortable-row.drop-after td {
    border-bottom: 3px solid var(--accent);
}

.danger-btn {
    background: #b81734;
}

.tab-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}

.settings-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.modal[hidden] {
    display: none !important;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 23, 21, 0.42);
}

.modal-dialog {
    position: relative;
    z-index: 1;
    width: min(1560px, 98vw);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 24px 48px rgba(20, 16, 10, 0.22);
    display: grid;
    gap: 0.9rem;
}

#settingsModal .modal-dialog {
    width: min(1720px, calc(100vw - 0.5rem));
    max-height: calc(100vh - 0.5rem);
    padding: 0.9rem;
}

.company-detail-dialog {
    width: min(1820px, calc(100vw - 0.5rem));
    max-height: calc(100vh - 0.5rem);
    padding: 0.9rem;
}

.company-detail-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.company-detail-group {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem;
    background: #fff8f9;
}

.company-detail-group-title {
    margin: 0 0 0.45rem;
    color: #8d2036;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.artist-categories {
    display: grid;
    gap: 0.9rem;
}

.artist-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin: 0.45rem 0 0.75rem;
}

.artist-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    color: #7d1f33;
}

.artist-search-field {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    color: #7d1f33;
}

.artist-search-field input[type="search"] {
    min-width: 220px;
}

.artist-filter-priority {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    color: #7d1f33;
}

.artist-filter-priority select {
    min-width: 185px;
}

.artist-filter-toggle input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: #b01430;
}

.artist-category-card {
    position: relative;
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line) 82%);
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% 0%, rgba(255, 204, 216, 0.45) 0%, transparent 48%),
        linear-gradient(175deg, #fffefe 0%, #fff6f8 100%);
    padding: 0.82rem;
    box-shadow: 0 12px 26px rgba(135, 20, 48, 0.12);
    transition: transform 180ms ease, box-shadow 220ms ease;
}

.artist-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 34px rgba(135, 20, 48, 0.18);
}

.artist-category-card h3 {
    margin: 0 0 0.55rem;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 1.44rem;
    letter-spacing: 0.01em;
    text-align: center;
}

#artistLogoBox {
    width: 126px;
    height: 86px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#artistLogoImage {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#artistLogoFallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-family: "Barlow Condensed", sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #8f1328;
}

.artist-selection-table {
    min-width: 1500px;
}

.artist-selection-table th,
.artist-selection-table td {
    white-space: nowrap;
    vertical-align: middle;
}

.artist-selection-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #fffdfd 0%, #ffeef2 100%);
    font-weight: 700;
    text-align: center;
}

.artist-selection-table tbody tr {
    transition: background-color 180ms ease, transform 140ms ease;
}

.artist-selection-table tbody tr:hover {
    background: color-mix(in srgb, var(--accent-soft) 38%, #ffffff 62%);
}

.artist-selection-table td:first-child {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-size: 1.28rem;
    font-weight: 400;
    letter-spacing: 0.01em;
    width: 1%;
}

.artist-selection-table th,
.artist-selection-table td {
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

.artist-selection-table th:first-child {
    width: 1%;
}

.artist-selection-table td:nth-child(2) a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 700;
    color: #8f1328;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 150ms ease, color 150ms ease;
}

.artist-selection-table td:nth-child(2) a:hover {
    color: #b01430;
    border-bottom-color: currentColor;
}

.artist-selection-table td:nth-child(2) a::after {
    content: "↗";
    font-size: 0.9em;
}

.artist-selection-table td input[type="text"] {
    min-width: 180px;
    width: 100%;
    text-align: center;
}

.artist-selection-table td select {
    text-align: center;
    text-align-last: center;
}

.artist-selection-table td:nth-child(2) input[type="text"] {
    min-width: 260px;
}

.artist-selection-table td:nth-child(9) input[type="text"] {
    min-width: 220px;
}

.artist-session-cell {
    text-align: center;
}

.artist-session-cell input[type="checkbox"] {
    width: 1.35rem;
    height: 1.35rem;
    accent-color: #b01430;
    cursor: pointer;
    transform: translateY(1px);
}

.artist-action-cell {
    display: flex;
    gap: 0.45rem;
}

.artist-row--favorisiert {
    background: var(--artist-row-favorisiert);
}

.artist-row--bevorzugt {
    background: var(--artist-row-bevorzugt);
}

.artist-row--alternative {
    background: var(--artist-row-alternative);
}

.artist-new-row td {
    background: #fff3f5;
}

.company-detail-group-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.55rem;
}

.company-detail-subtitle {
    grid-column: 1 / -1;
    margin-top: 0.15rem;
    padding-top: 0.2rem;
    border-top: 1px dashed color-mix(in srgb, var(--line) 78%, #fff 22%);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8d2036;
}

.company-detail-item {
    display: grid;
    gap: 0.35rem;
    grid-column: span 4;
}

.company-detail-item[data-field-key="adresse"] {
    grid-column: span 6;
}

.company-detail-item[data-field-key="zusatz"] {
    grid-column: span 2;
}

.company-detail-item[data-field-key="vorname"],
.company-detail-item[data-field-key="nachname"] {
    grid-column: span 3;
}

.company-detail-item[data-field-key="telefon"],
.company-detail-item[data-field-key="mobil"],
.company-detail-item[data-field-key="ansprechpartner"],
.company-detail-item[data-field-key="email"] {
    grid-column: span 3;
}

.company-detail-item[data-field-key="plz"] {
    grid-column: span 2;
}

.company-detail-item[data-field-key="ort"] {
    grid-column: span 4;
}

.company-detail-label {
    font-size: 0.82rem;
    color: var(--muted);
    font-weight: 600;
}

.info-item {
    margin-bottom: 0.2rem;
}

.company-info-textarea {
    width: 100%;
    min-height: 92px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0.55rem 0.6rem;
    font: inherit;
    resize: vertical;
    background: #fff;
    color: var(--text);
}

.issue-flag-item {
    margin-bottom: 0.2rem;
}

.company-files-box {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem;
    background: #fff8f9;
}

.company-files-box h3 {
    margin: 0 0 0.35rem;
}

.company-files-list {
    margin-top: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 0.45rem;
    overflow-x: auto;
}

.company-files-table {
    min-width: 620px;
}

.company-files-table th,
.company-files-table td {
    text-align: left;
    white-space: nowrap;
}

.company-files-table a {
    color: #8f1328;
    text-decoration: none;
    font-weight: 600;
}

.company-files-table a:hover {
    text-decoration: underline;
}

.ghost-btn {
    background: #fff2f4;
    color: #8a2034;
    border: 1px solid #e5aab8;
}

.tab-btn {
    background: #ffe8ec;
    color: #7f2534;
    border: 1px solid #e7b8c1;
}

.tab-btn.is-active {
    background: var(--accent);
    color: var(--accent-contrast);
    border-color: transparent;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
}

.settings-primary-panel {
    display: none;
}

.settings-primary-panel.is-active {
    display: block;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(520px, 100%);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 12px 28px rgba(20, 14, 9, 0.12);
}

.stack-form {
    display: grid;
    gap: 0.6rem;
}

.status {
    color: var(--danger);
    min-height: 1.2rem;
}

@media (max-width: 900px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .brand-wrap {
        width: 100%;
    }

    .festschrift-summary {
        width: 100%;
    }

    .club-logo {
        width: 76px;
        height: 52px;
        font-size: 1.3rem;
    }

    .brand-text h1 {
        font-size: 1.55rem;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }

    .field-form {
        grid-template-columns: 1fr;
    }

    .company-detail-group-grid {
        grid-template-columns: 1fr;
    }

    .company-detail-item,
    .company-detail-item[data-field-key="adresse"],
    .company-detail-item[data-field-key="vorname"],
    .company-detail-item[data-field-key="nachname"],
    .company-detail-item[data-field-key="telefon"],
    .company-detail-item[data-field-key="mobil"],
    .company-detail-item[data-field-key="ansprechpartner"],
    .company-detail-item[data-field-key="email"],
    .company-detail-item[data-field-key="plz"],
    .company-detail-item[data-field-key="ort"] {
        grid-column: auto;
    }

    table {
        min-width: 960px;
    }
}

@media (max-width: 700px) {
    .layout {
        padding: 0.7rem;
    }

    .card {
        padding: 0.75rem;
    }

    .controls-row.companies-list-head {
        align-items: stretch;
    }

    .companies-list-head h3 {
        width: 100%;
    }

    #companySearchInput,
    #companySortSelect {
        width: 100%;
        min-width: 0;
        margin-left: 0;
    }

    .company-create-grid {
        flex-wrap: wrap;
        min-width: 0;
    }

    .company-create-item {
        min-width: min(220px, 100%);
        width: 100% !important;
    }

    .company-create-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
    }

    .modal {
        padding: 0.45rem;
    }

    .modal-dialog,
    #settingsModal .modal-dialog,
    .company-detail-dialog {
        width: calc(100vw - 0.9rem);
        max-height: calc(100vh - 0.9rem);
        padding: 0.7rem;
    }

    .settings-head {
        flex-wrap: wrap;
    }

    .settings-head h2 {
        margin: 0;
    }

    .tab-row {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.2rem;
    }

    .tab-row .tab-btn {
        white-space: nowrap;
    }

    .topbar-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
        width: 100%;
        gap: 0.5rem;
    }

    .topbar-actions > a,
    .topbar-actions > button {
        width: 100%;
        justify-content: center;
    }

    .topbar-actions .icon-btn {
        min-width: 0;
        width: 100%;
        height: 42px;
    }

    .table-wrap,
    .internal-files-list {
        -webkit-overflow-scrolling: touch;
    }

    .status-popup {
        min-width: 0;
        width: min(92vw, 460px);
    }

    .start-home-card {
        min-height: 52vh;
    }

    .start-hero {
        grid-template-columns: 1fr;
    }

    .start-actions-box {
        width: 100%;
    }

    .start-actions {
        width: 100%;
    }

    .start-nav-btn {
        width: 100%;
        min-width: 0;
    }

    .artist-tools {
        align-items: stretch;
    }

    .artist-search-field {
        width: 100%;
    }

    .artist-search-field input[type="search"] {
        width: 100%;
        min-width: 0;
    }

    .artist-tools .topbar-link-btn {
        width: 100%;
    }

    .ifc-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ifc-upload-zone {
        width: 100%;
        flex-wrap: wrap;
    }

    .ifc-upload-zone .internal-file-input {
        max-width: 100%;
        width: 100%;
    }

    .ifc-upload-zone .internal-upload-btn {
        width: 100%;
    }

    .confirm-popup-actions {
        justify-content: stretch;
    }

    .confirm-popup-actions button {
        flex: 1;
    }
}

@media (max-width: 520px) {
    .topbar {
        padding: 0.75rem 0.8rem;
    }

    .topbar h1,
    .brand-text h1 {
        font-size: 1.35rem;
    }

    .brand-subtitle {
        font-size: 0.7rem;
    }

    .festschrift-summary {
        font-size: 0.73rem;
        padding: 0.24rem 0.42rem;
    }

    .icon-btn {
        width: 100%;
        min-width: 0;
        height: 38px;
    }

    #logoutBtn {
        width: auto;
    }

    .company-files-table {
        min-width: 520px;
    }

    .artist-selection-table td:first-child {
        font-size: 1.16rem;
    }

    .artist-session-cell input[type="checkbox"] {
        width: 1.2rem;
        height: 1.2rem;
    }
}

@media print {
    body {
        background: #fff;
    }

    .topbar,
    [data-no-print="true"],
    .status-popup,
    .modal,
    .confirm-popup-backdrop {
        display: none !important;
    }

    .layout,
    .card {
        padding: 0;
        margin: 0;
        border: 0;
        box-shadow: none;
        background: #fff;
    }

    .artist-category-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 0.5rem;
    }

    .artist-selection-table {
        min-width: 0;
        width: 100%;
    }

    .artist-selection-table th,
    .artist-selection-table td {
        font-size: 10pt;
        white-space: normal;
    }

    .artist-selection-table td:nth-child(2) a::after {
        content: "";
    }
}
