/**
 * app.css
 *
 * @company     FUX IT GMBH
 * @author      Helmut FUX
 * @copyright   (c) 2026 - FUX IT GMBH - Alle Rechte vorbehalten
 * @version     v1.0.0
 * @lastupdate  2026-06-29
 *
 * @description Stylesheet des Dashboards (AdminLTE-Look, eigenständig).
 */

/* Admin-Dashboard – eigenständiges Stylesheet (AdminLTE-Look, ohne Abhängigkeiten) */
:root {
    --bg: #f4f6f9;
    --sidebar: #4a515b;
    --sidebar-active: #4d9bff;
    --sidebar-text: #e6e9ef;
    --topbar: #ffffff;
    --card: #ffffff;
    --border: #dee2e6;
    --text: #212529;
    --muted: #6c757d;
    --primary: #007bff;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --radius: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.brand {
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.1);
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    gap: 10px;
}
/* Festes Dashboard-Logo in der Sidebar (weiß, via currentColor). */
.brand-icon { display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.brand-icon svg { display: block; }
.login-box .login-logo { display: block; max-width: 140px; max-height: 90px; margin: 0 auto 12px; }
.menu { padding: 10px 0; }
.menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    border-left: 3px solid transparent;
}
.menu a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.menu a.active { background: rgba(0,0,0,.2); color: #fff; border-left-color: var(--sidebar-active); }
.menu a .ico { width: 20px; text-align: center; font-size: 15px; }
.menu-sep {
    padding: 14px 20px 6px;
    font-size: 13.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #c3cad3;
}
.menu-group {
    padding: 8px 20px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #c3cad3;
}
.menu a.sub { padding-left: 34px; font-size: 13px; }
.menu-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; background: none; border: none; cursor: pointer;
    font-family: inherit; text-align: left;
}
.menu-toggle:hover { color: #fff; }
.menu-toggle .chev { transition: transform .15s; font-size: 14px; line-height: 1; color: #cdd3da; margin-left: 8px; }
.menu-toggle:hover .chev { color: #fff; }
.menu-toggle[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.menu-section.collapsed { display: none; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    background: var(--topbar);
    border-bottom: 1px solid var(--border);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user { display: flex; align-items: center; gap: 14px; color: var(--muted); }
/* Hamburger (nur mobil sichtbar) + Off-Canvas-Overlay */
.hamburger {
    display: inline-flex;
    align-items: center; justify-content: center;
    width: 40px; height: 40px; flex-shrink: 0;
    background: none; border: none; cursor: pointer;
    font-size: 22px; line-height: 1; color: var(--text);
}
.sidebar-overlay { display: none; }
/* Desktop: Sidebar per Button ein-/ausblenden (mehr Platz für den Hauptbereich) */
@media (min-width: 769px) {
    html.sidebar-collapsed .sidebar { display: none; }
}
.content { padding: 22px; flex: 1; }
.footer { padding: 12px 22px; color: var(--muted); border-top: 1px solid var(--border); font-size: 13px; }

/* ---- Karten ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 18px;
}
.card h2, .card h3 { margin-top: 0; }
.card-link { display: block; color: var(--text); }
.card-link:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.card-link .ico { font-size: 26px; }
.card-title { font-weight: 600; margin: 8px 0 4px; }
.card-desc { color: var(--muted); font-size: 13px; }

/* ---- Tabellen ---- */
.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { background: #f8f9fa; font-weight: 600; font-size: 13px; }
.table tr:hover td { background: #fafbfc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.row-hit td { background: #d4edda; }
.table tr.row-hit:hover td { background: #c3e6cb; }
.table tr.row-listed td { background: #f8d7da; }
.table tr.row-listed:hover td { background: #f5c6cb; }

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
}
.btn:hover { filter: brightness(.94); text-decoration: none; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-secondary { background: #6c757d; border-color: #6c757d; }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-success { background: var(--success); border-color: var(--success); }
.btn-outline { background: transparent; color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ---- Formulare ---- */
.form-group { margin-bottom: 14px; max-width: 520px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 13px; }
.form-control {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(0,123,255,.15); }
.form-hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input { width: auto; }

/* ---- Badges & Alerts ---- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; color: #fff; }
.badge-online { background: var(--success); }
.badge-offline { background: var(--danger); }
.badge-muted { background: #adb5bd; }
.badge-warn { background: #ffc107; color: #5c4700; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border-color: #ffeeba; }

/* ---- Progress (CPU/RAM) ---- */
.meter { background: #e9ecef; border-radius: 10px; height: 8px; overflow: hidden; min-width: 70px; }
.meter > span { display: block; height: 100%; background: var(--success); }
.meter.warn > span { background: var(--warning); }
.meter.crit > span { background: var(--danger); }

/* ---- IP-Zellen, Icon-Buttons, Interface-Popup ---- */
.iconbtn {
    background: none; border: none; cursor: pointer;
    color: var(--primary); font-size: 14px; padding: 0 2px;
    line-height: 1; vertical-align: middle;
}
.iconbtn:hover { filter: brightness(.8); }
.iconbtn.copied { color: var(--success); }
.ip-line { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.ip-line + .ip-line { margin-top: 3px; }
.ip-sec { font-size: 12px; color: var(--muted); }
.tag {
    background: #e9ecef; color: #495057; border-radius: 4px;
    padding: 1px 5px; font-size: 10px; font-weight: 700; letter-spacing: .3px;
}
.tag-sec { background: #fff3cd; color: #856404; font-weight: 600; margin-left: 4px; }
.netpill {
    background: #e6f1fb; color: #185fa5; border: 1px solid #b5d4f4;
    border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600;
    cursor: pointer; line-height: 1.4; white-space: nowrap;
}
.netpill:hover { background: #d5e7f8; }
.netpill-down { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.netpill-down:hover { background: #f5c6cb; }
/* WLAN: alle Access Points verfügbar/OK -> hellgrün. */
.netpill-up { background: #e6f6ec; color: #1e7e34; border-color: #b7e0c4; }
.netpill-up:hover { background: #d6efe0; }
/* Kompakte Statusanzeige: gleich große Symbole nebeneinander mit Abstand */
.status-line { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fg-ic {
    font-size: 16px; line-height: 1; display: inline-flex; align-items: center;
    justify-content: center; width: 20px; height: 20px; cursor: default;
}
.fg-ic-btn { background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; }
/* farbiges FortiGuard-Icon (gleiche Größe wie die übrigen Symbole) */
.fgbadge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    font-size: 12px; font-weight: 700; line-height: 1; border: 1px solid transparent;
}
.fgbadge.fg-ok  { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.fgbadge.fg-exp { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.fgbadge.fg-unk { background: #e9ecef; color: #495057; border-color: #dee2e6; }
/* Kundennummer-Autocomplete */
.kdn-suggest {
    position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 50;
    background: #fff; border: 1px solid var(--border, #ccc); border-radius: 6px;
    max-height: 260px; overflow: auto; box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
.kdn-item { padding: 7px 10px; cursor: pointer; font-size: 13px; }
.kdn-item:hover { background: #f0f4f8; }
/* Zeilen-Aktualisieren (pro Gerät) */
@keyframes fg-spin { to { transform: rotate(360deg); } }
.fg-row-refresh.spin { display: inline-block; animation: fg-spin .7s linear infinite; }
.fg-row-busy { opacity: .55; }
/* Im auto-aktualisierenden Live-Monitoring (data-refresh) ist der Zeilen-Button überflüssig */
table.fg-table[data-refresh] .fg-row-refresh { display: none; }
.upd-badge {
    display: inline-block; background: #fff3cd; color: #856404;
    border: 1px solid #ffeeba; border-radius: 10px;
    padding: 1px 7px; font-size: 11px; font-weight: 600; white-space: nowrap; margin-left: 4px;
}
.licpill {
    border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 600;
    cursor: pointer; white-space: nowrap; border: 1px solid transparent; line-height: 1.5;
}
.licpill.lic-ok      { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.licpill.lic-exp     { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.licpill.lic-unknown { background: #e9ecef; color: #495057; border-color: #dee2e6; }
.info-pop { position: relative; display: inline-block; }
.info-pop .pop {
    display: none; position: fixed; z-index: 1000;
    min-width: 240px; max-width: 380px; max-height: 70vh; overflow: auto;
    background: #fff; border: 1px solid var(--border); border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 10px 12px; white-space: normal;
    text-align: left;
}
.info-pop .pop.show { display: block; }
.pop-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.pop-table td { padding: 3px 6px; border-bottom: 1px solid #f0f0f0; font-size: 12px; }

.page-actions { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.text-muted { color: var(--muted); }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; }

/* ---- Login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sidebar); }
.login-box { background: #fff; padding: 32px; border-radius: 8px; width: 340px; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.login-box h1 { margin: 0 0 4px; font-size: 22px; text-align: center; }
.login-box .sub { text-align: center; color: var(--muted); margin-bottom: 22px; font-size: 13px; }

/* Breite Tabellen horizontal scrollbar machen (statt Layout-Sprengen) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 768px) {
    /* Hamburger einblenden, Sidebar als Off-Canvas */
    .hamburger { display: inline-flex; }
    .sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 1000;
        width: 250px; max-width: 82vw;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: 2px 0 14px rgba(0, 0, 0, .35);
        overflow-y: auto;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-overlay {
        display: block;
        position: fixed; inset: 0; z-index: 999;
        background: rgba(0, 0, 0, .45);
        opacity: 0; visibility: hidden; transition: opacity .25s ease;
    }
    body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
    body.sidebar-open { overflow: hidden; }

    .topbar { padding: 0 12px; }
    .topbar-user span { display: none; }   /* Name ausblenden, Logout bleibt */
    .content { padding: 16px 14px; }
    .cards { grid-template-columns: 1fr; }
    .card { overflow-x: auto; }            /* breite Tabellen in Karten scrollen */
}

/* ---- Impersonation-Banner („Als Benutzer ansehen") ---- */
.impersonate-banner {
    background: #fff3cd; color: #856404; border-bottom: 1px solid #ffeeba;
    padding: 8px 20px; display: flex; align-items: center; justify-content: space-between;
    gap: 12px; font-size: 13px; flex-wrap: wrap;
}

/* Nur für Screenreader/Volltextsuche sichtbar (visuell versteckt). */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
