/**
 * IT-Arbeitsplatz – ServiceNow-ähnliches Layout (Übersichten, Queues, Team-Hub)
 * Einbinden nach Bootstrap 5: <link href="css/it_workplace_sn.css" rel="stylesheet">
 */
:root {
    --sn-canvas: #f0f3f4;
    --sn-header: #293e40;
    --sn-accent: #0073a8;
    --sn-accent-soft: #e8f4fa;
    --sn-border: #d8d8d8;
    --sn-muted: #5e6c84;
    --sn-card: #ffffff;
    --sn-section-bg: #f7f9f9;
    --sn-section-border: #e6e6e6;
    /* „Meine Tickets“ – gut sichtbar auf dunklem Header (SN-ähnlich: Persönlich / Akzent) */
    --sn-mine-chip-bg: rgba(0, 115, 168, 0.38);
    --sn-mine-chip-border: rgba(125, 211, 252, 0.65);
    --sn-mine-chip-text: #f0fbff;
    --sn-mine-title-em: #ffecb3;
}

body.it-wp-body {
    background: var(--sn-canvas);
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.875rem;
    color: #2e2e2e;
}

.sn-topbar {
    background: var(--sn-header);
    color: #fff;
    padding: 0.65rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.sn-topbar-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sn-topbar .sn-topbar-title,
.sn-topbar h1 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

.sn-topbar .sn-sub {
    font-size: 0.8125rem;
    opacity: 0.88;
    margin: 0.15rem 0 0;
}

.sn-topbar .sn-sub code {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(0, 0, 0, 0.22);
    padding: 0.1rem 0.35rem;
    border-radius: 0.2rem;
    font-size: 0.92em;
}

.sn-topbar .page-back {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    font-weight: 500;
}

.sn-topbar .page-back:hover {
    color: #fff;
    text-decoration: underline;
}

.it-wp-wrap {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem 1rem 2.5rem;
}

/* Breitere Queue-Übersichten (z. B. Incident, Allgemein): mehr Tabellenbreite */
.it-wp-wrap.incident-queue-wide,
.sn-topbar-inner.incident-queue-wide {
    max-width: 1480px;
    width: 100%;
    box-sizing: border-box;
}

.it-wp-wrap.it-wp-wrap--fluid {
    max-width: none;
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Helle zweite Zeile unter dem dunklen Header (z. B. Detailseiten, IT-Übersicht-Toolbar) */
.it-wp-toolbar-outer.it-wp-subnav-strip {
    border-bottom: 1px solid var(--sn-border);
}

.it-wp-subnav-strip .it-wp-detail-nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--sn-accent);
    text-decoration: none;
    white-space: nowrap;
}

.it-wp-subnav-strip .it-wp-detail-nav-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.it-wp-footer-nav-strip {
    border-top: 1px solid var(--sn-section-border);
    padding-top: 0.75rem;
    margin-top: 1.25rem;
}

.it-wp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.it-wp-toolbar.it-wp-toolbar--split {
    justify-content: space-between;
}

/* Team vs. Meine – klarer Umschalter (aktiv = Primary, inaktiv = grau) */
.it-wp-scope-switch {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-radius: 0.25rem;
    overflow: hidden;
}

.it-wp-scope-switch .btn {
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.35rem 0.75rem;
}

.it-wp-scope-switch .btn:focus-visible {
    z-index: 2;
}

.it-wp-scope-switch .btn.btn-outline-secondary {
    background: #f8f9fa;
    color: #495057;
    border-color: #ced4da;
}

.it-wp-scope-switch .btn.btn-outline-secondary:hover {
    background: #e9ecef;
    color: #212529;
}

.it-wp-page-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.admin-hint {
    font-size: 0.85rem;
    color: var(--sn-muted);
}

/* Team-Hub Titel */
.it-workplace-title {
    color: #1a3d40;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Meine Tickets – klarer Kontrast auf sn-header (dunkelgrün); nicht dunkelgrün auf dunkelgrün */
.sn-topbar .it-mine-title {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.sn-topbar .it-mine-title .bi {
    color: var(--sn-mine-title-em);
    filter: drop-shadow(0 0 6px rgba(255, 236, 179, 0.35));
}

.it-mine-user-pill {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.2rem 0.65rem 0.22rem;
    font-size: 0.92em;
    font-weight: 600;
    line-height: 1.35;
    color: var(--sn-mine-chip-text) !important;
    background: var(--sn-mine-chip-bg);
    border: 1px solid var(--sn-mine-chip-border);
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    vertical-align: baseline;
}

.sn-panel.card {
    border: 1px solid var(--sn-border);
    border-radius: 2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.sn-panel .card-body {
    padding: 1.25rem 1.35rem;
}

.it-wp-sec-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sn-muted);
    margin-bottom: 0.65rem;
}

.admin-tile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.85rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.65rem;
    text-align: left;
    font-weight: 500;
    color: var(--sn-accent);
    text-decoration: none;
    background: var(--sn-card);
    border-radius: 2px;
    border: 1px solid var(--sn-border);
    transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.admin-tile > span:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.admin-tile > span:first-child + span {
    flex-shrink: 0;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.25rem;
    margin-left: auto;
}

.admin-tile:hover {
    text-decoration: none;
    color: #005a87;
    background: var(--sn-accent-soft);
    border-color: var(--sn-accent);
    box-shadow: 0 1px 6px rgba(0, 115, 168, 0.12);
}

.badge-pulse {
    display: inline-block;
    min-width: 1.9rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: #fff;
    background-color: #dc3545;
    border-radius: 999px;
    animation: it-wp-pulse 1.2s infinite;
}

.badge-pulse-bearbeitung {
    display: inline-block;
    min-width: 1.9rem;
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    color: #5c4a00;
    background-color: #ffc107;
    border-radius: 999px;
    animation: it-wp-pulse 1.2s infinite;
    margin-left: 0.25rem;
}

.badge-remark {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    color: #fff;
    background-color: #c0392b;
    border-radius: 999px;
    animation: it-wp-pulse 1.2s infinite;
    margin-left: 0.25rem;
}

@keyframes it-wp-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.12);
        opacity: 0.65;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.section-blink {
    animation: section-blink 1.5s ease-in-out infinite;
}

@keyframes section-blink {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.25);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
    }
}

/* Primäre Buttons an SN anpassen */
.it-wp-body .btn-primary {
    --bs-btn-bg: var(--sn-accent);
    --bs-btn-border-color: var(--sn-accent);
    --bs-btn-hover-bg: #005a87;
    --bs-btn-hover-border-color: #005a87;
    --bs-btn-active-bg: #004a73;
    --bs-btn-active-border-color: #004a73;
}

.it-wp-body .btn-outline-primary {
    --bs-btn-color: var(--sn-accent);
    --bs-btn-border-color: var(--sn-accent);
    --bs-btn-hover-bg: var(--sn-accent);
    --bs-btn-hover-border-color: var(--sn-accent);
}

/* Unterseiten: kompakte Kopfzeile unterhalb Topbar */
.it-wp-subhead {
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.it-wp-back {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--sn-accent);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 0.35rem;
}

.it-wp-back:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Incident-Queue / KPI – harmonisiert mit SN */
.it-wp-body .queue-hero {
    background: linear-gradient(135deg, #1e3a40 0%, #0d5a7a 55%, var(--sn-accent) 100%);
    color: #fff;
    border-radius: 2px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.it-wp-body .queue-hero h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.it-wp-body .queue-hero p {
    opacity: 0.92;
    font-size: 0.85rem;
    margin-bottom: 0;
}

.it-wp-body .kpi-card {
    background: var(--sn-card);
    border-radius: 2px;
    border: 1px solid var(--sn-border);
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    height: 100%;
}

.it-wp-body .filter-bar {
    background: var(--sn-card);
    border: 1px solid var(--sn-border);
    border-radius: 2px;
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.it-wp-body .table-wrap {
    background: var(--sn-card);
    border-radius: 2px;
    border: 1px solid var(--sn-border);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Ticket-Tabellen (Übersichten) */
.it-wp-body .badge-neu {
    display: inline-block;
    min-width: 2.2rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    background-color: #dc3545;
    border-radius: 999px;
    animation: it-wp-pulse-red 1.2s infinite;
}

@keyframes it-wp-pulse-red {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.75;
    }
}

.it-wp-body .ticket-row-neu {
    background-color: #fff8f6 !important;
}

.it-wp-body .ticket-row-erledigt {
    background-color: #f0faf4 !important;
}

.it-wp-body .tick-erledigt {
    color: #198754;
    font-size: 1.1rem;
}

.it-wp-body .trenner-erledigt td {
    padding: 0.35rem 0.5rem;
    border: none;
    border-top: 2px solid #198754;
    vertical-align: middle;
    background: #f0faf4;
}

.it-wp-body .trenner-erledigt td > span {
    font-size: 0.75rem;
    color: #198754;
    font-weight: 600;
}

.it-wp-body .closed-toggle-btn {
    font-size: 0.75rem;
    font-weight: 600;
    color: #198754;
    background: transparent;
    border: 0;
    padding: 0;
}

.it-wp-body .closed-toggle-btn:hover {
    text-decoration: underline;
}

/* Zugang-Anfragen – ähnliche Ticket-Optik wie Incident-Queue */
.it-wp-body .zugang-queue-card {
    border: 1px solid var(--sn-border);
    border-radius: 0.65rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(9, 30, 66, 0.06);
}

.it-wp-body .zugang-queue-card .table thead th {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #5e6c84;
    background: #f4f5f7;
    border-bottom-width: 2px;
    white-space: nowrap;
}

.it-wp-body .zugang-queue-card .table tbody td {
    vertical-align: middle;
    font-size: 0.875rem;
}

.it-wp-body .zugang-queue-card tbody tr.zugang-row-offen {
    background-color: #fffdf8;
}

.it-wp-body .zugang-queue-card tbody tr.zugang-row-erledigt {
    background-color: #f3fcf6;
}

.it-wp-body .zugang-ticket-key {
    display: inline-block;
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: #5e4db2;
    background: #eae6ff;
    padding: 0.2rem 0.45rem;
    border-radius: 0.25rem;
    text-decoration: none;
}

.it-wp-body .zugang-ticket-key:hover {
    color: #403294;
    text-decoration: underline;
}
