
/* =========================
   GLOBAL
   ========================= */

:root {
    --primary: #1565c0;
    --primary-dark: #0d47a1;
    --accent: #ffcc00;
    --accent-dark: #ffb300;
    --background: #f4f7fc;
    --card: #ffffff;
    --text: #263238;
    --text-light: #607d8b;
    --border: #d9e3f0;
    --success: #2e7d32;
    --danger: #d32f2f;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        sans-serif;
    line-height: 1.5;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h1, h2, h3 {
    color: var(--primary-dark);
    margin-top: 0;
}
.headerimage {
    width: 90%;
    max-width: 500px;
    height: auto;
}
#logo {
    padding-bottom: 0;;
}
/* =========================
   CARD
   ========================= */

.loan-card,
.search-form,
.success-card,
.error-card {
    background: var(--card);
    border-radius: 20px;
    padding: 2rem;
    border-top: 6px solid var(--accent);
    box-shadow:
        0 10px 30px rgba(13, 71, 161, 0.08);
}

/* =========================
   FORMULARE
   ========================= */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--primary-dark);
}

.form-input,
.search-input,
.quantity-input,
input[type="date"],
input[type="number"],
input[type="text"] {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus,
.search-input:focus,
.quantity-input:focus,
input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.25);
}

/* =========================
   BUTTONS
   ========================= */

button,
.btn,
.btn-primary,
.btn-secondary {
    border: none;
    border-radius: 12px;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary:hover,
button[type="submit"]:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(21, 101, 192, 0.25);
}

.btn-secondary,
#add-row {
    background: var(--accent);
    color: #333;
    width: 30%;
}

.btn-secondary:hover,
#add-row:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}
#suchen {
    margin-top: 10px;
    width: 50px;
}
.btns {
    display: flex;
    flex-direction: column;
}
.btns > * {
    margin: 10px;
}

/* =========================
   VERLEIH
   ========================= */

.loan-container {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.loan-card {
    width: 100%;
    max-width: 700px;
}

.loan-title {
    font-size: 2rem;
}

.loan-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.loan-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

/* =========================
   SUCHSEITE
   ========================= */
.dropdown {
    position: relative;
    /* WICHTIG: keine feste Breite mehr */
    width: 100%;
    max-width: 100%;
}

.dropdown-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 83px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

/* Fokus bleibt SaaS-like */
.dropdown input:focus {
    outline: none;
    border-color: #ffcc00;
    box-shadow: 0 0 0 4px rgba(255, 204, 0, 0.25);
}

/* Dropdown Liste soll exakt Input-Breite übernehmen */
/* .dropdown-list {
    position: relative;
    left: 0;
    right: 0;
    width: 100%;
    top: calc(100% - 10px);

    border: 1px solid #d9e3f0;
    border-radius: 12px;

    max-height: 220px;
    overflow-y: auto;

    background: #ffffff;

    display: none;
    z-index: 1000;

    box-shadow: 0 10px 25px rgba(13, 71, 161, 0.12);
} */

.search-page {
    max-width: 1000px;
    margin: 0 auto;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-row {
    display: grid;
    /* grid-template-columns: 1fr 180px; */
    gap: 1rem;
}

.dropdown {
    position: relative;
}

.search {
    text-align: left;
}

.dropdown-item {
    padding: 0.9rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: #fff8dc;
}

/* .item-stock {
    color: var(--text-light);
    font-size: 0.9rem;
} */

/* =========================
   ERFOLGSSEITE
   ========================= */

.success-container {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.success-card {
    width: 100%;
    max-width: 800px;
}

.success-icon {
    font-size: 4rem;
    text-align: center;
}

.success-title {
    text-align: center;
    margin-top: 1rem;
}

.success-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

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

.selected-item {
    background: #f8fbff;
    border-left: 5px solid var(--accent);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.selected-item:hover {
    background: #fff8dc;
    transform: translateX(5px);
}

/* =========================
   FEHLERSEITE
   ========================= */

.error-container {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.error-card {
    width: 100%;
    max-width: 800px;
}

.error-icon {
    font-size: 4rem;
    text-align: center;
}

.error-title {
    text-align: center;
    color: var(--danger);
}

.error-message {
    background: #fff8dc;
    border-left: 5px solid var(--accent);
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    color: #444;
}

/* =========================
   TABELLEN
   ========================= */

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

th {
    background: var(--primary);
    color: white;
    text-align: left;
    padding: 1rem;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

tr:hover {
    background: #f8fbff;
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 768px) {

    main {
        padding: 1rem;
    }

    .loan-card,
    .search-form,
    .success-card,
    .error-card {
        padding: 1.5rem;
    }

    .search-row,
    .date-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    button,
    .btn,
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }
}