/* --- CSS-Variablen für einfache Farbanpassung --- */
:root {
    --color-primary: #007bff; /* Helles Blau */
    --color-primary-dark: #0056b3;
    --color-secondary: #6c757d;
    --color-background: #f8f9fa; /* Sehr helles Grau */
    --color-sidebar: #e9ecef; /* Leicht dunkler als Hintergrund */
    --color-text: #343a40;
    --color-success: #28a745;
    --color-error: #dc3545;
    --color-warning: #ffc107;
    --border-radius: 6px;
    --box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.05);
}

/* --- Global Styles --- */

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
}

img {
    border: 0;
    max-width: 100%;
}

/* --- Typography & Utility --- */


figcaption {
  font-size: 10px; /* Oder ein anderer kleinerer Wert, z. B. 12px */
}

.alignright { text-align: right; }
.artadminfont { font-size: 12px; color: var(--color-secondary); margin-top: 10px; }
.caption { 
    background-color: var(--color-primary); 
    color: white; 
    font-size: 1.25rem; 
    font-weight: 600; 
    padding: 15px 20px; 
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.error { 
    text-align: center; 
    color: var(--color-error); 
    background-color: #f8d7da; 
    border: 1px solid var(--color-error);
    padding: 10px;
    margin: 10px 0;
    border-radius: var(--border-radius);
    font-weight: bold; 
}
.success { 
    text-align: center; 
    color: var(--color-success); 
    background-color: #d4edda; 
    border: 1px solid var(--color-success);
    padding: 10px;
    margin: 10px 0;
    border-radius: var(--border-radius);
    font-weight: bold; 
}
.mandantheader {color: var(--color-warning); font-weight: bold;}

/* --- Links & Buttons --- */

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Base style for form inputs and buttons */
input[type="text"], input[type="password"], textarea, select {
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%; /* Default auf 100% Breite */
    box-sizing: border-box;
}

input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Spezielle Stile für Submit-Buttons */
input[type="submit"] {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.1s;
}

input[type="submit"]:hover {
    background-color: var(--color-primary-dark);
}

input[type="submit"]:active {
    transform: translateY(1px);
}

/* --- Layout Wrapper (Dashboard-Struktur) --- */

#wrapper {
    display: grid;
    grid-template-areas:
        "header header"
        "nav content";
    grid-template-columns: 280px 1fr; /* Breite für Navigation beibehalten */
    min-height: 100vh;
    gap: 0; /* Header, Nav und Content direkt aneinander */
}

/* Header */
#header {
    grid-area: header;
    background-color: var(--color-primary);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
}

/* Navigation */
#nav {
    grid-area: nav;
    background: var(--color-sidebar);
    padding: 20px 10px;
    border-right: 1px solid #dee2e6;
}

#nav h2 {
    font-size: 1.1rem;
    color: var(--color-primary-dark);
    margin: 15px 0 5px 0;
    padding-left: 10px;
    border-bottom: 2px solid var(--color-primary);
}

#nav a {
    display: block;
    padding: 8px 10px;
    margin-bottom: 4px;
    color: var(--color-text);
    font-weight: 500;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

#nav a:hover {
    background-color: #d0e0f2;
    color: var(--color-primary-dark);
    text-decoration: none;
}

#nav form {
    padding: 10px 0;
    border-top: 1px solid #ccc;
    margin-top: 10px;
}

#nav select[name='mandant'] {
    width: 100%;
    margin-bottom: 5px;
}

/* Main Content */
#content {
    grid-area: content;
    background: white;
    padding: 20px;
}

/* --- Tables --- */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
    overflow: hidden; /* Für abgerundete Ecken */
}

th {
    background-color: var(--color-primary);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 10px 15px;
    border-bottom: 1px solid #e9ecef;
}

/* Alternierende Zeilenfarbe */
tr:nth-child(even) {
    background: #f8f9fa; 
}

/* Maus-Hover-Effekt */
tr:hover {
    background: #eef3fa;
}

.viewtr, .viewtralt { height: auto; } /* unnötige Höhenangaben entfernt */

/* --- Login Formular (direkt in index.php) --- */

.login-container {
    background: white; 
    padding: 40px; 
    border-radius: var(--border-radius); 
    box-shadow: 0 6px 15px rgba(0,0,0,0.15); 
    width: 380px;
}

/* --- Barcode & Autocomplete (Unverändert, aber angepasst) --- */

#vorschlag {
    position: absolute;
    background-color: #fff;
    border: 1px solid var(--color-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    z-index: 2000;
}

#vorschlag ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

#vorschlag ul li {
    cursor: pointer;
    padding: 8px 10px;
}

#vorschlag ul li.selected {
    background-color: #d0e0f2;
}

/* --- Responsive Layout (Anpassung Grid) --- */

@media (max-width: 992px) {
    #wrapper {
        grid-template-areas:
            "header"
            "nav"
            "content";
        grid-template-columns: 1fr;
    }

    #nav {
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    /* Optionale: Navigationspunkte nebeneinander auf kleinen Screens */
    #nav a {
        display: inline-block;
        margin-right: 10px;
    }
}
