/* ---------------------------------------------------------
   turnover.css — manage-turnover-config (Nayax-Stil)
   Klassen mit tvc- präfixiert.
--------------------------------------------------------- */

/* ── Page header ──────────────────────────────────────── */
.tvc-header { margin-bottom: 20px; }
.tvc-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.3px;
    border-left: 3px solid var(--brand);
    padding-left: 12px;
    line-height: 1.2;
    margin: 0 0 4px;
}
.tvc-header__sub {
    font-size: 13px;
    color: var(--text-soft);
    margin: 0;
    padding-left: 15px;
}

/* ── Alert ────────────────────────────────────────────── */
.tvc-alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.6;
}
.tvc-alert--ok  { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.tvc-alert--err { background: #FEF2F2; border: 1px solid #FECACA; color: #7F1D1D; }

/* ── Tab bar ──────────────────────────────────────────── */
.tvc-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 5px;
}
.tvc-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: calc(var(--radius) - 2px);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    text-decoration: none;
    transition: background .12s, color .12s;
}
.tvc-tab:hover { background: var(--surface); color: var(--text); }
.tvc-tab.is-active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* ── Section title ────────────────────────────────────── */
.tvc-section-title {
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-mute);
    padding: 0 0 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
}

/* ── Empty state ──────────────────────────────────────── */
.tvc-empty {
    font-size: 13px;
    color: var(--text-mute);
    padding: 10px 0;
}

/* ── Buttons ──────────────────────────────────────────── */
.tvc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 16px;
    border-radius: var(--radius);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-soft);
    transition: background .12s, color .12s;
}
.tvc-btn:hover { background: var(--bg-soft); color: var(--text); }
.tvc-btn--primary {
    background: var(--brand);
    color: #fff;
    border-color: transparent;
}
.tvc-btn--primary:hover { background: var(--brand-deep); color: #fff; }
.tvc-btn--secondary { border-color: var(--brand); color: var(--brand-deep); }
.tvc-btn--secondary:hover { background: var(--brand-soft); }

/* ── Form field ───────────────────────────────────────── */
.tvc-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tvc-field label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-mute);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.tvc-field small {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-mute);
    text-transform: none;
    letter-spacing: 0;
}
.tvc-field input,
.tvc-field select,
.tvc-field textarea {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    font: inherit;
    font-size: 13.5px;
    color: var(--text);
    outline: none;
    transition: border-color .15s;
}
.tvc-field input:focus,
.tvc-field select:focus { border-color: var(--brand); }

/* ── Rooms tab layout ─────────────────────────────────── */
.tvc-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: start;
}

/* ── Apartment list (sidebar) ─────────────────────────── */
.tvc-apt-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tvc-apt-group { margin-bottom: 4px; }
.tvc-apt-group__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-mute);
    padding: 6px 4px 4px;
}
.tvc-apt-group__badge { font-size: 14px; }

.tvc-apt-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: background .1s;
    cursor: pointer;
}
.tvc-apt-item:hover { background: var(--bg-soft); }
.tvc-apt-item.is-active {
    background: var(--brand-soft);
    border-left: 3px solid var(--brand);
    padding-left: 7px;
}
.tvc-apt-item strong {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.tvc-apt-item span {
    font-size: 11px;
    color: var(--text-mute);
}
.tvc-apt-item--building { background: var(--bg-soft); }
.tvc-apt-item--child { padding-left: 18px; }
.tvc-apt-item--child.is-active { padding-left: 15px; }

/* ── Room editor ──────────────────────────────────────── */
.tvc-room-editor {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.tvc-room-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: grab;
}
.tvc-room-row:active { cursor: grabbing; }
.tvc-room-row__drag {
    font-size: 20px;
    color: var(--border-strong);
    line-height: 1;
    padding-top: 2px;
    flex-shrink: 0;
    user-select: none;
}
.tvc-room-row__fields {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.tvc-field--full { grid-column: 1 / -1; }
.tvc-room-row__del {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-mute);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    flex-shrink: 0;
    transition: background .12s, color .12s;
}
.tvc-room-row__del:hover { background: #FEF2F2; color: var(--danger); }

.tvc-add-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-soft);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    margin-top: 10px;
}
.tvc-add-row select {
    flex: 1;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font: inherit;
    font-size: 13px;
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.tvc-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-soft);
}

/* ── Photos tab ───────────────────────────────────────── */
.tvc-photos-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 16px;
    align-items: start;
}
.tvc-upload-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.tvc-upload-form { display: flex; flex-direction: column; gap: 12px; }

.tvc-photo-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-mute);
    font-size: 13px;
    text-align: center;
    transition: border-color .12s, background .12s;
    position: relative;
}
.tvc-photo-drop i { font-size: 24px; }
.tvc-photo-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.tvc-photo-drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
.tvc-photo-drop:hover { border-color: var(--brand); }

.tvc-photo-preview {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    object-fit: cover;
    max-height: 200px;
}

.tvc-photo-library {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.tvc-photo-group { margin-bottom: 20px; }
.tvc-photo-group__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 10px;
}
.tvc-photo-group__title span {
    font-size: 11px;
    background: var(--bg-soft);
    color: var(--text-mute);
    border-radius: var(--radius-pill);
    padding: 2px 7px;
    font-weight: 700;
}

.tvc-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
}
.tvc-photo-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-soft);
}
.tvc-photo-item__img-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}
.tvc-photo-item__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tvc-photo-item__del {
    position: absolute;
    top: 4px;
    right: 4px;
}
.tvc-photo-item__del button {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background .12s;
}
.tvc-photo-item__del button:hover { background: var(--danger); }
.tvc-photo-item__info {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.tvc-photo-item__info strong {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tvc-photo-item__info small {
    font-size: 10.5px;
    color: var(--text-mute);
}

/* ── Kit tab ──────────────────────────────────────────── */
.tvc-kit-view {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}
.tvc-kit-intro {
    font-size: 13px;
    color: var(--text-soft);
    margin: 0 0 16px;
    line-height: 1.6;
}
.tvc-kit-group { margin-bottom: 16px; }
.tvc-kit-group h3 {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px;
}
.tvc-kit-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.tvc-kit-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 12.5px;
    color: var(--text);
}

/* ── Buildings tab ────────────────────────────────────── */
.tvc-buildings-view { display: flex; flex-direction: column; gap: 14px; }
.tvc-building-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.tvc-building-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
}
.tvc-building-card__head > div {
    flex: 1;
    min-width: 0;
}
.tvc-building-card__head strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.tvc-building-card__head span {
    font-size: 12px;
    color: var(--text-mute);
}
.tvc-building-card__apts {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-mute);
    flex-shrink: 0;
}
.tvc-building-card__body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tvc-building-card__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 13px;
}
.tvc-building-card__row:last-child { border-bottom: none; }
.tvc-building-card__row > span { color: var(--text-mute); }
.tvc-building-card__row > strong { font-weight: 600; color: var(--text); }
.tvc-building-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.tvc-building-card__form { margin-top: 8px; }

/* ── Chips ────────────────────────────────────────────── */
.tvc-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-soft);
}
.tvc-chip--done {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: #065F46;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1000px) {
    .tvc-layout         { grid-template-columns: 180px 1fr; }
    .tvc-photos-layout  { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .tvc-layout         { grid-template-columns: 1fr; }
    .tvc-room-row__fields { grid-template-columns: 1fr; }
}
