body {
    font-size: 16px;
    font-family: 'Work Sans', sans-serif;
    color: #222;
    background-color: #ffffff;
    height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* Links */
a, a:visited, a:hover, a:active {
    color: #222;
    text-decoration: underline;
}

/* Buttons moderner */
button,
::-webkit-file-upload-button {
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 6px;
    color: #222;
    padding: 6px 10px;
    font-size: 15px;
    margin: 4px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background-color: #eaeaea;
}

button:disabled {
    background-color: #eee;
    color: #999;
    cursor: default;
}

/* Inputs */
input, textarea, select {
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 6px;
    color: #222;
    padding: 6px;
    font-size: 15px;
    margin: 4px;
}

textarea {
    width: calc(100% - 24px);
}

input {
    width: 80px;
}

input[type="file"] {
    width: calc(100% - 24px);
}

select {
    width: 200px;
}

/* Tabellen clean */
table, td, th {
    border: 1px solid #ddd;
    border-collapse: collapse;
    background-color: #ffffff;
}

th {
    background-color: #f5f5f5;
    font-weight: 600;
}

tr:nth-child(even) td {
    background-color: #fafafa;
}

/* Layout */
.tablecontent {
    margin: 4px;
}

.ingredienttable,
.formulatablesmall,
.errortable {
    width: min(95%, 1100px);
    margin: auto;
    margin-bottom: 30px;
}

.formulatable {
    width: 95%;
    margin: auto;
    margin-bottom: 30px;
}

/* Navbar */
.navbar {
    height: auto;
    font-size: 26px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
    margin-bottom: 10px;
    background: #ffffff;
    border-bottom: 1px solid #ddd;
}

.topbutton {
    margin: 10px;
}

/* Tags moderner */
.tag {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 14px;
}

.selectedtag {
    background-color: #dcdcdc;
}

/* Modal */
.modal {
    position: absolute;
    width: min(95%, 900px);
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 8px;
    z-index: 100;
}

.modalback {
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    position: fixed;
    z-index: 50;
}

/* Tooltip */
[data-tooltip]:hover:before {
    padding: 6px;
    color: #fff;
    background: #333;
    border-radius: 4px;
}

/* ===== 📱 RESPONSIVE ===== */

/* Tablet (Querformat) */
@media (max-width: 1024px) {
    
    .navbar {
        font-size: 22px;
    }

    input {
        width: 70px;
    }

    select {
        width: 160px;
    }

    .tagfilter {
        width: 100%;
    }

    table {
        font-size: 14px;
    }
}

/* Smartphone (Portrait) */
@media (max-width: 600px) {

    body {
        font-size: 14px;
    }

    .navbar {
        flex-direction: column;
        font-size: 20px;
    }

    .topbutton {
        margin: 6px 0;
    }

    input {
        width: 100%;
    }

    select {
        width: 100%;
    }

    /* Tabellen scrollen statt kaputt gehen */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .ingredienttable,
    .formulatablesmall,
    .formulatable {
        width: 100%;
    }

    .tagcontainer {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal {
        width: 95%;
    }
}