/**
 * Zentrales Stylesheet des internen Portals.
 * Basis (Layout, Sidebar, Karten, Buttons, Formulare, Tabellen, Badges, Utility-Klassen)
 * übernommen und getrimmt aus dem FF-Abrechnung-Design. Seiten sollten hier nur noch
 * seitenspezifische Ergänzungen in einem eigenen, kurzen <style>-Block ergänzen.
 */

/* --- Basis-Layout --- */
body { font-family: Arial, sans-serif; background: #f4f6f9; margin: 0; padding: 0; display: flex; }
.content { margin-left: 250px; padding: 40px; width: 100%; box-sizing: border-box; }

/* --- Sidebar --- */
.sidebar { width: 250px; background: #2c3e50; color: #fff; height: 100vh; padding: 20px; box-sizing: border-box; position: fixed; overflow-y: auto; z-index: 1000; }
.sidebar h3 { margin-top: 0; border-bottom: 1px solid #4f5d73; padding-bottom: 10px; }
.sidebar a { display: block; color: #abd1c6; padding: 10px 0; text-decoration: none; }
.sidebar a:hover { color: #fff; }
.sidebar a.active { color: #fff; font-weight: bold; }
.sidebar-section-label { color: #7f8c8d; font-size: 12px; text-transform: uppercase; margin-top: 20px; margin-bottom: 5px; }
.logout-link { color: #e74c3c; margin-top: 30px; }

.mobile-menu-toggle { display: none; position: fixed; top: 15px; left: 15px; z-index: 1100; background: #2c3e50; color: #fff; border: 0; width: 42px; height: 42px; border-radius: 6px; font-size: 20px; cursor: pointer; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 999; }
.sidebar-backdrop.open { display: block; }

/* --- Karten --- */
.card { background: #fff; padding: 20px; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 25px; }
.card-plain { background: #fff; padding: 25px; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

/* --- Tool-Kacheln (Dashboard) --- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.tool-tile { background: #fff; padding: 25px 20px; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); text-decoration: none; color: #2c3e50; text-align: center; transition: transform 0.1s ease, box-shadow 0.1s ease; }
.tool-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.tool-tile .tool-icon { font-size: 32px; display: block; margin-bottom: 10px; }
.tool-tile .tool-name { font-weight: bold; font-size: 15px; }
.tool-tile .tool-desc { font-size: 12px; color: #7f8c8d; margin-top: 6px; }

/* --- Buttons --- */
.btn, .btn-submit { padding: 8px 16px; border: 0; border-radius: 4px; color: #fff; cursor: pointer; font-size: 14px; font-weight: bold; text-decoration: none; display: inline-block; }
.btn-primary, .btn-submit { background: #007bff; }
.btn-primary:hover, .btn-submit:hover { background: #0056b3; }
.btn-success { background: #28a745; }
.btn-danger { background: #dc3545; }
.btn-info { background: #17a2b8; }
.btn-secondary { background: #6c757d; }

/* --- Formulare --- */
.form-group { margin-bottom: 12px; }
.form-group label, label { display: block; margin-bottom: 4px; font-weight: bold; font-size: 13px; color: #333; }
input[type="text"], input[type="password"], input[type="number"], input[type="url"], select, textarea {
    width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; font-family: inherit; background: #fff;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.checkbox-container { max-height: 220px; overflow-y: auto; border: 1px solid #ddd; padding: 8px; border-radius: 4px; background: #fafafa; }
.checkbox-item { display: flex; align-items: center; margin-bottom: 4px; font-weight: normal; }
.checkbox-item input { margin-right: 8px; width: auto; }

/* --- Tabellen --- */
table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 14px; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e2e8f0; text-align: left; }
th { background: #f8f9fa; color: #475569; }

/* --- Meldungen --- */
.alert { padding: 12px; border-radius: 4px; margin-bottom: 20px; font-weight: bold; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- Badges --- */
.badge { background: #007bff; color: white; padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: bold; }
.badge-admin { background: #dc3545; }
.badge-inactive { background: #95a5a6; }
.badge-success { background: #28a745; }

/* --- Farb-Utilities --- */
.text-primary { color: #007bff; }
.text-success { color: #28a745; }

/* --- Filter-/Suchboxen (z.B. über DataTables-Tabellen) --- */
.filter-card { background: #fff; padding: 20px; border-radius: 6px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 25px; }

/* --- DataTables-Anpassung ans Portal-Design (ersetzt die Bootstrap-Optik) --- */
.dataTables_wrapper { font-size: 14px; }
.dataTables_filter input { padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 4px; margin-left: 8px; }
.dataTables_length select { padding: 4px 8px; border: 1px solid #cbd5e1; border-radius: 4px; }
.dataTables_info { color: #7f8c8d; font-size: 13px; }
.dataTables_paginate .paginate_button { padding: 6px 12px; margin-left: 2px; border: 1px solid #cbd5e1; border-radius: 4px; cursor: pointer; color: #4a5568 !important; }
.dataTables_paginate .paginate_button.current { background: #007bff !important; color: #fff !important; border-color: #007bff; }
.dataTables_paginate .paginate_button.disabled { color: #94a3b8 !important; cursor: not-allowed; }
table.dataTable thead th { border-bottom: 2px solid #e2e8f0; }

/* --- Auswahl-Leiste (z.B. Tonerpreisübersicht: Artikel für Kunden-Auszug wählen) --- */
#auswahlLeiste { position: fixed; bottom: 0; left: 250px; right: 0; background: #2c3e50; color: #fff; padding: 15px 30px; display: flex; align-items: center; gap: 15px; box-shadow: 0 -2px 8px rgba(0,0,0,0.15); z-index: 900; }
@media (max-width: 768px) {
    #auswahlLeiste { left: 0; flex-wrap: wrap; }
}

/* --- Header-Zeile --- */
.header-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #ddd; padding-bottom: 20px; margin-bottom: 20px; }

/* --- Utility-Klassen --- */
.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #7f8c8d; }
.fw-bold { font-weight: bold; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.hidden-offscreen { position: absolute; left: -9999px; top: -9999px; }
.fw-normal { font-weight: normal; }
.w-auto { width: auto; }
.max-w-400 { max-width: 400px; }
.max-w-700 { max-width: 700px; }
.m-0 { margin: 0; }
.grid-span-full { grid-column: 1 / -1; }

/* --- Mobile / Tablet --- */
@media (max-width: 768px) {
    .mobile-menu-toggle { display: block; }
    .sidebar { left: -260px; transition: left 0.25s ease; }
    .sidebar.open { left: 0; }
    .content { margin-left: 0; padding: 20px; padding-top: 75px; }
    .grid-2, .grid-3, .tool-grid { grid-template-columns: 1fr; }
    table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
    .header-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
}
