/* =============================================================
   Insolvenzverwaltung – Zentrale Stylesheet-Datei
   ============================================================= */

/* ── CSS-Variablen ─────────────────────────────────────────── */
:root {
    --primary: #1e3a5f;
    --primary-light: #2d5f9e;
    --accent: #3b82f6;
    --bg: #f0f4f8;
    --surface: #ffffff;
    --border: #dde4ed;
    --text: #1a2b42;
    --text-muted: #5a7091;
    --shadow: 0 4px 16px rgba(30, 58, 95, 0.08);
    --shadow-hover: 0 8px 28px rgba(30, 58, 95, 0.15);
}

/* ── Reset & Basis ─────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Layout-Helfer ─────────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Body-Varianten je nach Seite */
body.page-overview {
    padding: 2.5rem;
}

body.page-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

body.page-form {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2.5rem;
}

body.page-detail {
    display: block;
    padding: 2.5rem;
}

/* ── Typografie ────────────────────────────────────────────── */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
}

/* ── Buttons & Links ───────────────────────────────────────── */
.btn-add {
    padding: 0.6rem 1.25rem;
    background: var(--primary);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-add:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.btn-secondary {
    padding: 0.6rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg);
    color: var(--primary);
    border-color: var(--accent);
}

.back-link,
.back-btn {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.back-link:hover,
.back-btn:hover {
    color: var(--primary);
}

.btn-back {
    display: block;
    text-align: center;
    margin-top: 1.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.btn-back:hover {
    color: var(--primary);
}

/* ── Header (Übersichtsseite) ──────────────────────────────── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    background: var(--surface);
    padding: 1.25rem 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.user-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

/* ── Suche (Übersichtsseite) ───────────────────────────────── */
.search-section {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

#proc-search {
    width: 100%;
    padding: 1rem 1rem 1rem 3.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    font-size: 1.05rem;
    transition: all 0.3s ease;
}

#proc-search:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
    background: #fff;
}

#proc-grid {
    transition: opacity 0.2s ease;
}

/* ── Karten-Grid (Übersicht) ───────────────────────────────── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.25s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    box-shadow: var(--shadow);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

.card .badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card .badge-insolvenzverwaltung {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0369a1;
}

.card .badge-eigenverwaltung {
    background: #fdf4ff;
    border-color: #fae8ff;
    color: #a21caf;
}

.card .badge-beratung {
    background: #fefce8;
    border-color: #fef08a;
    color: #a16207;
}

.card h2 {
    font-size: 1.35rem;
    margin-bottom: 0.4rem;
    color: var(--primary);
}

.card .aktenzeichen {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card .meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.empty-state {
    text-align: center;
    grid-column: 1 / -1;
    padding: 5rem;
    background: var(--surface);
    border-radius: 16px;
    border: 2px dashed var(--border);
    color: var(--text-muted);
}

/* ── Login-Seite ───────────────────────────────────────────── */
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(30, 58, 95, 0.1);
}

.logo-area {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.btn-login {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
}

.btn-login:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 58, 95, 0.25);
}

/* ── Formulare (allgemein) ─────────────────────────────────── */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

select option {
    background: white;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* ── Formular-Container ────────────────────────────────────── */
.form-container {
    max-width: 700px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 1.75rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

button[type="submit"],
.btn-submit,
.btn-primary,
.btn-danger {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
    text-align: center;
}

button[type="submit"],
.btn-submit,
.btn-primary {
    background: var(--primary);
}

button[type="submit"]:hover,
.btn-submit:hover,
.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.25);
}

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* ── Passwort-Karte ────────────────────────────────────────── */
.pw-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 32px rgba(30, 58, 95, 0.1);
}

.pw-card h1 {
    font-size: 1.6rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.pw-card .btn-submit {
    padding: 0.85rem;
    margin-top: 0.5rem;
}

/* ── Detail-Ansicht ────────────────────────────────────────── */
.detail-container {
    max-width: 1600px;
    width: 100%;
}

.detail-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.sidebar-menu {
    flex: 0 0 260px;
    position: sticky;
    top: 2.5rem;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow);
}

/* ── Tabs (Detailansicht) ─────────────────────────────────── */
.tabs-vertical {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.04);
}

.tab-btn:hover {
    color: var(--primary);
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateX(4px);
}

.tab-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

/* Responsive adjustment for Sidebar Layout */
@media (max-width: 900px) {
    .detail-layout {
        flex-direction: column;
    }
    .sidebar-menu {
        flex: none;
        width: 100%;
        position: static;
    }
    .tabs-vertical {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .tab-btn {
        flex: 1 1 calc(50% - 0.5rem);
        justify-content: center;
        padding: 0.75rem 1rem;
    }
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

.empty-placeholder {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg);
    border-radius: 12px;
    border: 1px dashed var(--border);
    color: var(--text-muted);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.875rem;
    border-radius: 50px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.schuldner-name {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.schuldner-adresse {
    margin-bottom: 2.5rem;
    line-height: 1.5;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.75rem;
    margin-bottom: 1rem;
}

.info-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}

.info-item span {
    font-size: 1.05rem;
    color: var(--text);
    font-weight: 500;
}

.description-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    line-height: 1.7;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ── Status-Meldungen ──────────────────────────────────────── */
.message,
.error-message {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.error,
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

/* ── ToDo-Liste ────────────────────────────────────────────── */
.todo-container {
    padding: 1rem 0;
}

.todo-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.todo-input-group input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.todo-input-group input:focus {
    border-color: var(--primary);
}

.todo-input-group button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.todo-input-group button:hover {
    background: var(--primary-light);
}

.todo-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.todo-item:hover {
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.05);
    transform: translateX(4px);
}

.todo-item.completed {
    opacity: 0.6;
}

.todo-item.completed .text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.todo-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}

.todo-item .text {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text);
}

.delete-todo {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.5rem;
    transition: color 0.2s;
    line-height: 1;
}

.delete-todo:hover {
    color: #ef4444;
}

.empty-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

/* ── Radio Pills ────────────────────────────────────────────── */
.type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.type-selector input[type="radio"] {
    display: none;
}

.type-selector label {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
    user-select: none;
}

.type-selector input[type="radio"]:checked+label {
    border-color: var(--primary);
    background: rgba(43, 87, 154, 0.05);
    /* very light primary tint */
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(43, 87, 154, 0.1);
}

.type-selector label:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

/* ── Timeline (Übersichtsseite) ────────────────────────────── */
.timeline-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 2rem 0;
    margin-bottom: 2rem;
    overflow-x: auto;
}

.timeline-track {
    position: absolute;
    top: 2.6rem;
    left: 40px;
    right: 40px;
    height: 4px;
    background: #cbd5e1;
    z-index: 1;
    border-radius: 2px;
}

.timeline-point {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    text-align: center;
}

.timeline-dot {
    width: 20px;
    height: 20px;
    background: white;
    border: 4px solid var(--accent);
    border-radius: 50%;
    margin-bottom: 12px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.timeline-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
    line-height: 1.2;
}

.timeline-date {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
}

.timeline-point .edit-mode input {
    text-align: center;
    width: 100%;
    margin-top: 4px;
}