:root {
    --bg: #f4f4f4;
    --card-bg: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #d1d5db;
    --shadow-soft: 0 4px 20px rgba(0,0,0,.15);
    --shadow-strong: 0 10px 30px rgba(0,0,0,.35);
    --btn-bg: #111827;
    --btn-bg-hover: #000000;
    --btn-text: #ffffff;
    --input-bg: #ffffff;
}

[data-theme="dark"] {
    --bg: #020617;
    --card-bg: #020617;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #374151;
    --shadow-soft: 0 10px 30px rgba(0,0,0,.8);
    --shadow-strong: 0 18px 45px rgba(0,0,0,.9);
    --btn-bg: #f9fafb;
    --btn-bg-hover: #e5e7eb;
    --btn-text: #020617;
    --input-bg: #020617;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, rgba(148,163,184,0.4), transparent 55%) , var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.25s ease, color 0.25s ease;
}

/* Auth Layout (Login, PIN-Reset) */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-card {
    background: rgba(15,23,42,0.02);
    backdrop-filter: blur(14px);
    border-radius: 16px;
    box-shadow: var(--shadow-strong);
    border: 1px solid rgba(148,163,184,0.35);
    width: 100%;
    max-width: 420px;
    padding: 26px 24px 22px;
    position: relative;
}

.auth-card h1 {
    text-align: center;
    font-size: 1.25rem;
    margin: 4px 0 4px;
}

.auth-card p.sub {
    margin: 0 0 18px;
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
}

.auth-logo-wrap {
    text-align: center;
    margin-bottom: 8px;
}

.auth-logo-wrap img {
    max-width: 170px;
    height: auto;
}

/* Inputs & Buttons allgemein */
label {
    display: block;
    font-size: 0.85rem;
    margin-top: 10px;
}

input, select, textarea {
    width: 100%;
    padding: 9px 10px;
    margin-top: 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.95rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

button {
    font-family: inherit;
}

.btn-primary {
    margin-top: 16px;
    width: 100%;
    padding: 10px;
    border-radius: 999px;
    border: none;
    background: var(--btn-bg);
    color: var(--btn-text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.btn-primary:hover {
    background: var(--btn-bg-hover);
    transform: translateY(-1px);
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.btn-small:hover {
    background: rgba(148,163,184,0.15);
}

.text-link {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.85rem;
}

.text-link:hover {
    text-decoration: underline;
}

.msg-error {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #f97373;
    min-height: 1.2em;
    text-align: center;
}

/* Theme-Toggle */
.theme-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Admin-/Mitarbeiterseiten */
.page {
    padding: 18px 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 8px;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.page-sub {
    font-size: 0.9rem;
    color: var(--muted);
}

.page-nav a {
    margin-right: 10px;
    font-size: 0.85rem;
}

/* Tabellen im Adminbereich */
.table-wrap {
    margin-top: 10px;
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 900px;
    font-size: 0.9rem;
}

th, td {
    border: 2px solid var(--border);
    padding: 1px 1px;
}

th {
    background: rgba(148,163,184,0.15);
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #fff;
}

.badge-user {
    background: #6b7280;
}

.badge-admin {
    background: #3b82f6;
}

.top-form-inline input,
.top-form-inline select {
    margin-right: 6px;
    margin-top: 4px;
}


/* Overrides für zentriertes Layout auf Mitarbeiter- und Adminseiten */
.page {
    padding: 24px 20px 40px;
    max-width: 900px;
    margin: 40px auto;
    text-align: center;
}

.page-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
}

.page-nav {
    text-align: center;
}

.page-nav a {
    margin: 0 6px;
}

/* Tabellen weiterhin linksbündig anzeigen */
.table-wrap table,
.table-wrap th,
.table-wrap td {
    text-align: center;
}


/* Dashboard-Kacheln & Logo-Header */
.logo-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 24px;
    gap: 8px;
}

.logo-header img {
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(15,23,42,0.35));
}

.logo-header-title {
    font-size: 1.35rem;
    font-weight: 600;
}

.logo-header-sub {
    font-size: 0.9rem;
    color: var(--muted);
}

/* Grid für Funktionskacheln im Mitarbeiterbereich */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.card-tile {
    background: rgba(15,23,42,0.02);
    border-radius: 14px;
    border: 1px solid rgba(148,163,184,0.4);
    padding: 14px 12px 12px;
    box-shadow: var(--shadow-soft);
    text-align: left;
}

[data-theme="dark"] .card-tile {
    background: rgba(15,23,42,0.7);
}

.card-tile-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.card-tile-sub {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.card-tile-footer {
    font-size: 0.8rem;
    color: #3b82f6;
}

/* Kleine Info-Karte im Admin */
.info-card {
    margin-top: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.4);
    background: rgba(15,23,42,0.02);
    font-size: 0.85rem;
    text-align: center;
}
[data-theme="dark"] .info-card {
    background: rgba(15,23,42,0.7);
}
/* Standard Links */
a {
    color: var(--text); /* im Light Theme normale Textfarbe */
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

/* Dark Theme Links */
[data-theme="dark"] a {
    color: #ffffff; /* Links weiß im Dark Theme */
}

[data-theme="dark"] a:hover {
    color: #3b82f6; /* Hover-Farbe im Dark Theme (z. B. blau) */
}

/* Mailto Links speziell */
a[href^="mailto:"] {
    font-weight: 600;
}

[data-theme="dark"] a[href^="mailto:"] {
    color: #3b82f6; /* Mailto-Links ebenfalls weiß */
}
.msg-notification {
    position: fixed;
    top: 16px;
    right: 16px;
    max-width: 320px;
    width: calc(100% - 32px);
    background: var(--card-bg, #ffffff);
    color: var(--text-color, #111827);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.18);
    border: 1px solid rgba(148,163,184,0.6);
    padding: 12px 14px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    z-index: 9999;
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.msg-notification.visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.msg-notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.msg-notification-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.msg-notification-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    padding: 0 4px;
}

.msg-notification-body {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Optionale Anpassung für Dark Mode, falls du data-theme="dark" nutzt */
html[data-theme="dark"] .msg-notification {
    background: #111827;
    color: #e5e7eb;
    border-color: #374151;
}
/* BASIS: Rahmen + Schatten für alle Info-Boxen */
.info-box{
    padding:16px 20px;
    border-radius:12px;
    margin:20px auto;
    max-width:900px;
    border:1px solid rgba(148,163,184,0.7); /* sichtbarer Rahmen */
    background: color-mix(in srgb, #020617 4%, var(--card) 96%);
    box-shadow:0 10px 20px rgba(15,23,42,0.18);
}

/* TITEL */
.info-box strong{
    display:block;
    font-size:1.1rem;
    margin-bottom:6px;
}

/* FARBSYSTEM – AUTOMATISCH LIGHT/DARK */

/* INFO – Blau */
.info-news{
    border-left:5px solid var(--primary);
    background:linear-gradient(
        135deg,
        color-mix(in srgb, var(--primary) 18%, transparent) 0%,
        color-mix(in srgb, var(--primary) 10%, transparent) 100%
    );
}

[data-theme="dark"] .info-news{
    background:linear-gradient(
        135deg,
        color-mix(in srgb, var(--primary) 25%, transparent) 0%,
        color-mix(in srgb, var(--primary) 12%, transparent) 100%
    );
}

//* WARNING – Orange */
.info-warning{
    border-left:5px solid #ea580c;
    background:linear-gradient(
        135deg,
        color-mix(in srgb, #ea580c 22%, transparent) 0%,
        color-mix(in srgb, #ea580c 10%, transparent) 100%
    );
}
[data-theme="dark"] .info-warning{
    border-left-color:#fb923c;
    background:linear-gradient(
        135deg,
        color-mix(in srgb, #fb923c 28%, transparent) 0%,
        color-mix(in srgb, #fb923c 14%, transparent) 100%
    );
}

/* STATUS – Grün */
.info-status{
    border-left:5px solid #16a34a;
    background:linear-gradient(
        135deg,
        color-mix(in srgb, #16a34a 22%, transparent) 0%,
        color-mix(in srgb, #16a34a 10%, transparent) 100%
    );
    box-shadow:
        0 10px 20px rgba(15,23,42,0.18),
        0 0 12px rgba(34,197,94,0.35);
}

[data-theme="dark"] .info-status{
    border-left-color:#4ade80;
    background:linear-gradient(
        135deg,
        color-mix(in srgb, #4ade80 30%, transparent) 0%,
        color-mix(in srgb, #4ade80 16%, transparent) 100%
    );
    box-shadow:
        0 18px 40px rgba(0,0,0,0.8),
        0 0 20px rgba(74,222,128,0.65);
}
/* im Dark Mode etwas kräftiger und klarer */
[data-theme="dark"] .info-box{
    border-color: rgba(148,163,184,0.55);
    box-shadow:0 18px 40px rgba(0,0,0,0.7);
}
/* Klickbare Kacheln für Schulungs-PDFs */
.card-link {
    display: block;
    text-decoration: none;
    height: 100%;
}

.card-link:hover .card-tile-title {
    text-decoration: underline;
}

.card-link:active {
    transform: translateY(1px);
}
/* TV-Bildanzeige */
.tv-pages {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.tv-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
/* ----------------------------------------------------
   TV-Vollbildmodus + zentrierte Bildanzeige
   ---------------------------------------------------- */

/* Vollbild-Body */
body.tv-fullscreen {
    margin: 0 !important;
    padding: 0 !important;
    background: #000 !important;
    overflow: hidden;
}

/* Header/Überschriften ausblenden */
body.tv-fullscreen .page-header,
body.tv-fullscreen .page-title,
body.tv-fullscreen .page-sub {
    display: none !important;
}

/* Container auf gesamte Fläche */
body.tv-fullscreen .pdf-section,
body.tv-fullscreen .tv-pages {
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw;
    height: 100vh;
}

/* Jede Seite wird flex-zentriert */
body.tv-fullscreen .tv-page-wrapper {
    width: 100vw;
    height: 100vh;
    
    display: flex;
    justify-content: center;
    align-items: center;

    margin: 0;
    padding: 0;
}

/* Bild selbst perfekt zentrieren */
body.tv-fullscreen .tv-img {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;

    object-fit: contain;
    display: block;
    background: #000;
}

/* ----------------------------------------------------
   Steuerungs-Overlay unten rechts
   ---------------------------------------------------- */

.tv-controls {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    z-index: 9999;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tv-counter {
    background: rgba(0, 0, 0, 0.6);
    color: #f9fafb;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.tv-buttons {
    display: flex;
    gap: 8px;
}

.tv-btn {
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.85);
    color: #f9fafb;
    backdrop-filter: blur(4px);
}

.tv-btn:hover {
    background: rgba(30, 64, 175, 0.9);
}

.tv-btn:active {
    transform: translateY(1px);
}
/* ----------------------------------------------------
   TV-Vollbild: Page-Container vollflächig zentrieren
   ---------------------------------------------------- */
body.tv-fullscreen .page {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex;
    align-items: center;
    justify-content: center;
}
