/* 09-import-responsive.css - Import, responsive regels, sub-tabs en autocomplete
   Onderdeel van de AperioLibrum-stylesheet. Alle 13 bestanden laden in deze
   volgorde via templates/_stylesheets.html: de volgorde is de cascade, dus niet
   herschikken en geen bestand hernoemen zonder de linktemplate mee te nemen. */
/* ── Import section ── */
.import-section {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.import-section h3 {
    margin: 0 0 12px;
    color: var(--text-main);
}

.import-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.import-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.import-options input[type="radio"] {
    accent-color: var(--primary);
}

.conflict-list {
    background: var(--widget-alert-bg);
    border: 1px solid var(--widget-alert-border);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    max-height: 200px;
    overflow-y: auto;
}

.conflict-list ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--badge-loaned-text);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .layout {
        display: block;
        height: 100vh;
    }

    /* Zijbalk: overal vainheshell af, vanaf links ingeschoven. */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(300px, 86vw);
        height: 100%;
        padding: 24px 16px;
        flex-direction: column;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
        z-index: 1100;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1090;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar .brand {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        margin: 0 0 20px;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    .sidebar h1 {
        font-size: 20px;
        text-align: left;
    }

    .sidebar-toggle {
        display: none;
    }

    .nav-btn {
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
        padding: 10px 12px;
        font-size: 15px;
        margin: 2px 0;
    }

    .nav-btn span {
        display: inline;
        opacity: 1;
        width: auto;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-btn svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    body.sidebar-collapsed .sidebar {
        width: min(300px, 86vw);
        padding: 24px 16px;
    }

    body.sidebar-collapsed .sidebar .brand {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        margin: 0 0 20px;
    }

    body.sidebar-collapsed .brand-logo {
        width: 48px;
        height: 48px;
        border-radius: 10px;
    }

    body.sidebar-collapsed .sidebar h1 {
        display: inline;
        font-size: 20px;
        text-align: left;
    }

    body.sidebar-collapsed .nav-btn {
        justify-content: flex-start;
        padding: 10px 12px;
    }

    body.sidebar-collapsed .nav-btn span {
        display: inline;
        opacity: 1;
        width: auto;
    }

    .sidebar-divider {
        display: block;
        margin: 6px 0;
    }

    .sidebar > div {
        margin-top: auto !important;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .content {
        height: 100vh;
        min-height: 100vh;
        padding: 16px;
    }

    .content-header {
        align-items: center;
        gap: 10px;
        padding-bottom: 12px;
        margin-bottom: 10px;
    }

    .content-header h2 {
        font-size: 18px;
        margin: 0; /* telefoon 480 ... */
    }

    .table-wrap {
        overflow-x: auto;
    }

    table {
        min-width: 500px;
    }

    .widget-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .widget-value {
        font-size: 24px;
    }

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

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

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar input[type="text"] {
        min-width: 0;
    }

    .file-actions {
        flex-direction: column;
    }

    .file-actions button {
        width: 100%;
        text-align: center;
    }

    .book-detail-actions {
        flex-direction: column;
    }

    .book-detail-actions button {
        width: 100%;
    }

    .member-edit-panel {
        max-width: 100%;
        margin: 8px;
        padding: 16px;
    }

    .modal-overlay {
        padding: 8px;
    }

    .hero-card {
        padding: 24px;
        margin: 8px;
    }

    .hero-container {
        padding: 20px;
    }

    .password-change-form {
        max-width: 100%;
    }

    .chart {
        overflow-x: auto;
    }

    .bar-label {
        width: 100px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .widget-grid {
        grid-template-columns: 1fr;
    }

    .badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .hero-sub {
        font-size: 15px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .steps {
        flex-direction: column;
    }

    .step-arrow {
        transform: rotate(90deg);
    }
}

/* ── Sub-tabs (settings page import) ── */
.loan-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.loan-tab {
    padding: 10px 20px;
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: var(--tab-bg);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.loan-tab:hover {
    background: var(--tab-hover);
    color: var(--text-main);
}

.loan-tab.active {
    background: var(--tab-active);
    color: var(--text-main);
    border-color: var(--primary);
    border-bottom-color: var(--tab-active);
    position: relative;
    z-index: 1;
}

.loan-tab-content.hidden {
    display: none;
}

/* ── Autocomplete dropdown ── */
.autocomplete-wrap {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--dropdown-bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-top: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.2s, opacity 0.15s;
    z-index: 60;
}

.autocomplete-results.visible {
    max-height: 300px;
    opacity: 1;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    font-size: 14px;
    transition: background 0.1s;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--dropdown-hover);
}

.autocomplete-item.empty {
    color: var(--text-muted);
    cursor: default;
    text-align: center;
}

.autocomplete-item.empty:hover {
    background: transparent;
}

.autocomplete-item.create {
    color: var(--success);
    font-weight: 600;
    text-align: center;
}

