/* =========================================================================
   GLOBALES RESETS & CONFIG (DerMann B2B - Original Corporate Identity)
   ========================================================================= */
:root {
    --primary-dark: #232323;     /* Elegantes Anthrazit aus dem Header */
    --accent-gold: #dbbe70;      /* Das markante DerMann-Gold für Primäraktionen */
    --accent-gold-hover: #c5a963;/* Etwas dunkleres Gold für Hover-Effekte */
    --bg-light: #f4f4f5;         /* Klarer, heller Hintergrund für den Shop */
    --bg-card: #ffffff;          /* Reines Weiß für die Inhalts-Karten */
    --text-main: #1a1a1a;        /* Tiefes Anthrazit für beste Lesbarkeit */
    --text-muted: #666666;       /* Neutrales Grau für sekundäre Informationen */
    --border-color: #e5e5e5;     /* Feine Trennlinien für ein sauberes Grid */
    --radius: 6px;               /* Dezente, moderne Eckenrundung */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* =========================================================================
   LAYOUT UTILITIES (Struktur & Container)
   ========================================================================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
}

h2 {
    color: var(--primary-dark);
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 25px;
    font-weight: 700;
    border-left: 4px solid var(--accent-gold);
    padding-left: 14px;
}

/* =========================================================================
   FORMS & BUTTONS (Exakt nach dermann.at Vorlage)
   ========================================================================= */
input[type="text"], 
input[type="password"], 
input[type="number"], 
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    font-size: 1rem;
    color: var(--text-main);
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(35, 35, 35, 0.1);
}

/* Der goldene Hauptbutton aus dem Screenshot */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 28px;
    background-color: var(--accent-gold);
    color: var(--primary-dark);
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn:hover {
    background-color: var(--accent-gold-hover);
}

.btn:active {
    transform: scale(0.99);
}

/* Sekundärer Button (z.B. Zurück) */
.btn-secondary {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #f8f9fa;
    color: var(--text-main);
}

/* =========================================================================
   RESPONSIVE DATA TABLE (Aufgeräumt & Übersichtlich)
   ========================================================================= */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background-color: #f8f9fa;
    color: var(--primary-dark);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 16px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

/* Status-Badges (z.B. für Bestell-Historie) */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}
.badge-success { background: #e8f5e9; color: #1b5e20; }
.badge-pending { background: #fff3e0; color: #e65100; }

/* =========================================================================
   MEDIA QUERIES (Smarte Anpassung für Tablet & Smartphone)
   ========================================================================= */

/* Smartphones (Maximal 767px) */
@media (max-width: 767px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 12px;
    }
    
    .card {
        padding: 20px 15px;
    }

    h2 {
        font-size: 1.3rem;
    }

    /* Tabelle transformiert sich auf Mobile in Kachel-Karten */
    table, thead, tbody, th, td, tr { 
        display: block; 
    }
    
    thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        margin-bottom: 16px;
        background: #fff;
        padding: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.01);
    }
    
    td { 
        border: none;
        border-bottom: 1px solid #f8f9fa; 
        position: relative;
        padding-left: 40% !important; 
        text-align: right !important;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        min-height: 48px;
    }

    td:last-child {
        border-bottom: none;
    }
    
    /* Mobile Spaltentitel-Injektion */
    td::before { 
        position: absolute;
        left: 12px;
        width: 35%; 
        padding-right: 10px; 
        white-space: nowrap;
        text-align: left;
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.75rem;
        letter-spacing: 0.5px;
    }
    
    /* Klassen-Selektoren für dynamische Zuweisung im HTML */
    .artikel-zeile td:nth-of-type(1)::before { content: "Bild"; }
    .artikel-zeile td:nth-of-type(2)::before { content: "Details"; }
    .artikel-zeile td:nth-of-type(3)::before { content: "Einheit"; }
    .artikel-zeile td:nth-of-type(4)::before { content: "Menge"; }
    
    /* Ausrichtungs-Fixes für den mobilen Viewport */
    td img {
        margin-left: auto;
    }
    
    input[type="number"] {
        margin: 0 !important;
        width: 80px !important;
    }
}

/* Tablets (768px bis 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 16px;
    }
    
    .card {
        padding: 24px;
    }
}
