/* === Layout für Admin-Bereich === */
body.admin-layout {
    margin: 0;
    font-family: sans-serif;
}

/* Fixierte Sidebar */
aside {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    background: #eaeaea;
    color: #000;
    padding: 1em;
    height: 100vh;
    box-sizing: border-box;
    overflow-y: auto;
}
aside img.logo {
    width: 215px;
    margin-bottom: 20px;
}
aside nav a {
    display: block;
    color: #000;
    text-decoration: none;
    padding: 6px 0;
}
aside nav a:hover {
    text-decoration: underline;
}

/* Inhaltsbereich */
main {
    margin-left: 250px;
    padding: 2em;
}

/* === Login-Bereich === */
body.login {
    background: #f6f6f6;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}
.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(0,0,0,0.1);
    text-align: center;
    width: 100%;
    max-width: 350px;
}
.login-box img {
    width: 275px;
    margin-bottom: 20px;
}
.login-box input,
.login-box button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    margin: 10px 0;
    font-size: 1em;
    border-radius: 4px;
}
.login-box input {
    border: 1px solid #ccc;
}
.login-box button {
    background: #1d1f27;
    color: white;
    border: none;
    cursor: pointer;
}
.login-box button:hover {
    background: #333745;
}
.error {
    color: red;
    margin-bottom: 10px;
}

/* === Formulare & Tabellen === */
table {
    border-spacing: 6px;
    margin-bottom: 1rem;
    width: 100%;
}
th, td {
    padding: 6px 8px;
    vertical-align: middle;
}
input[type="text"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
textarea,
select {
    padding: 4px;
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
}
textarea {
    resize: vertical;
}
button {
    padding: 4px 8px;
    border: 1px solid #ccc;
    background-color: #eee;
    cursor: pointer;
}
button:hover {
    background-color: #ddd;
}
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #004466;
}
form {
    margin: 0;
}

/* === Spezielle Formatierungen === */
.label-right {
    text-align: right;
    font-weight: bold;
    white-space: nowrap;
    padding-right: 1rem;
    vertical-align: middle;
}
.compact-table {
    border-collapse: collapse;
    width: 100%;
}
.compact-table th,
.compact-table td {
    border: 1px solid #ccc;
    padding: 6px 8px;
    vertical-align: top;
}
.compact-table th {
    background-color: #f0f0f0;
    text-align: left;
}

/* === Aktions-Icons in Tabellen === */
.action-icon {
    margin-right: 0.5rem;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    font-size: 1rem;
    cursor: pointer;
    color: inherit;
}
.action-icon:last-child {
    margin-right: 0;
}
.action-icon:hover {
    text-decoration: underline;
}
td form {
    display: inline;
}

/* === Toolbar & Buttons === */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}
.button-primary {
    background-color: #f0f0f0;
    color: #000;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    line-height: 1.2rem;
    font-size: 0.95rem;
}
.button-primary:hover {
    background-color: #e0e0e0;
}
.search-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.search-form input[type="text"] {
    max-width: 220px;
}

/* === Bearbeitungsansicht (umschaltbar) === */
.view-only {
    display: inline;
}
.edit-only {
    display: none;
}
.editing .view-only {
    display: none;
}
.editing .edit-only {
    display: inline-block;
}

/* Bereich für Speichern/Abbrechen */
.section-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

/* Tabellenformularfeld-Anpassung */
table input[type="text"],
table input[type="number"],
table input[type="date"],
table input[type="datetime-local"],
table textarea,
table select {
    font-size: 1rem;
    padding: 6px 8px;
    width: 100%;
    box-sizing: border-box;
}

/* Tabellenkopf rechtsbündig */
th.label-right {
    text-align: right;
    font-weight: bold;
    white-space: nowrap;
    padding-right: 1rem;
}

/* Detail-Tabelle */
.detail-table {
    border-collapse: collapse;
    width: auto;
    table-layout: auto;
    margin-bottom: 1rem;
}
.detail-table td {
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
}