/* ============================================================ */
/* --- I. SYSTEM CORE & VARIABLES (THE FOUNDATION) --- */
/* ============================================================ */
:root {
    --amber: #FFB347;
    --amber-rgb: 255,179,71;
    --amber-dim: rgba(var(--amber-rgb), 0.2);
    --amber-deep: rgba(var(--amber-rgb), 0.05);
    --amber-crit: #ff4444;
    --amber-pause: #44aaff;
    --amber-green: #00ff41;
    --amber-white: #ffffee;
    --bg: #050505;
    --panel: #0a0a0a;
    --font-main: 'JetBrains Mono', monospace;
    --border-w: 1px;
    --notch-size: 8px;
    /* Größe der diagonal abgeschnittenen Ecken */
    --cyan-accent: #8be9fd;
    --bg-deep: #070a13;
    --panel-bg: rgba(15, 20, 30, 0.1);
    --amber-color: var(--amber);
    /* --danger: #ff5555;  (ist derzeit in diesem Stylesheet nicht verwendet) */
}

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

body {
    color: var(--amber);
    font-family: var(--font-main);
    font-size: 13px;
    height: 100vh;
    display: flex;
    overflow: hidden;
    text-transform: uppercase;
    position: relative;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.98));
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 30% 35%, rgba(0, 255, 180, 0.08), transparent 52%),
        radial-gradient(circle at 70% 40%, rgba(255, 145, 35, 0.1), transparent 55%);
    z-index: 0;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(90deg, rgba(255, 160, 20, 0.0), rgba(255, 163, 75, 0.04), rgba(255, 160, 20, 0.0));
    z-index: 1;
    pointer-events: none;
}

#earth-hologram {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 700px;
    height: 700px;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    opacity: 0.39;
    filter: drop-shadow(0 0 30px rgba(0, 255, 255, 0.25));
    perspective: 1400px;
}

.earth-wrap {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(117, 209, 255, 0.45), rgba(4, 12, 25, 0.3) 47%, rgba(2, 8, 20, 0.75) 80%),
        radial-gradient(circle at 60% 60%, rgba(56, 255, 167, 0.28), rgba(10, 30, 45, 0.0) 50%),
        linear-gradient(to bottom, rgba(15, 15, 35, 0.36), rgba(0, 0, 0, 0.9));
    box-shadow: inset 0 0 40px rgba(0, 255, 255, 0.15), inset 0 0 80px rgba(5, 80, 160, 0.2);
    border: 1px solid rgba(60, 255, 220, 0.3);
    backdrop-filter: blur(2px);
    animation: rotateEarth 45s linear infinite;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.earth-wrap::before,
.earth-wrap::after {
    content: "";
    position: absolute;
    inset: 8%;
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.35);
    opacity: 0.6;
    transform-origin: 50% 50%;
}

.earth-wrap::before {
    transform: rotateX(87deg) translateZ(0px) scale(1);
}

.earth-wrap::after {
    transform: rotateY(70deg) translateZ(30px) scale(0.96);
    border-style: dashed;
    opacity: 0.4;
}

.earth-core {
    position: absolute;
    inset: 14%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(240, 200, 255, 0.9), rgba(78, 190, 255, 0.3), rgba(5, 10, 30, 0.7));
    box-shadow: 0 0 18px rgba(120, 255, 255, 0.35), inset 0 0 25px rgba(150, 240, 255, 0.4);
    pointer-events: none;
    z-index: 1;
}

.earth-grids {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-image: radial-gradient(circle at center, rgba(0, 255, 222, 0.09), transparent 55%),
        repeating-linear-gradient(0deg, rgba(0, 255, 255, 0.08), rgba(0, 255, 255, 0.08) 1px, transparent 1px, transparent 15px),
        repeating-linear-gradient(90deg, rgba(0, 255, 255, 0.08), rgba(0, 255, 255, 0.08) 1px, transparent 1px, transparent 15px),
        linear-gradient(45deg, rgba(0, 255, 235, 0.10), transparent 45%, rgba(0, 255, 235, 0.08) 51%, transparent 56%);
    mix-blend-mode: overlay;
    opacity: 0.65;
    filter: blur(0.5px);
    z-index: 2;
    animation: tiltGrid 8s linear infinite;
}

.earth-ring {
    position: absolute;
    inset: -20%;
    border-radius: 50%;
    transform: rotateX(70deg) rotateZ(20deg);
    border: 2px solid rgba(0, 255, 210, 0.45);
    box-shadow: 0 0 30px rgba(0, 255, 220, 0.25);
    pointer-events: none;
    z-index: 0;
    animation: rotateRing 20s linear infinite;
}

.earth-ring::before,
.earth-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px dashed rgba(0, 255, 255, 0.25);
    pointer-events: none;
}

.earth-atmosphere {
    position: absolute;
    inset: -8%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(96, 255, 171, 0.12), transparent 55%);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.25);
    pointer-events: none;
    z-index: 0;
}

.earth-lights {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 20% 70%, rgba(245, 255, 190, 0.15), transparent 35%),
        radial-gradient(circle at 75% 30%, rgba(255, 180, 240, 0.12), transparent 30%);
    mix-blend-mode: screen;
    opacity: 0.55;
    z-index: 3;
    animation: glowPulse 3.8s ease-in-out infinite;
}

.omega-mark {
    position: absolute;
    top: 48%;
    left: 52%;
    transform: translate(-50%, -50%) rotateZ(20deg);
    font-size: 420px;
    color: var(--amber-dim);
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 0 22px rgba(255, 204, 120, 0.9), 0 0 55px rgba(255, 133, 40, 0.55), 0 0 110px rgba(255, 170, 50, 0.28);
    letter-spacing: -8px;
    pointer-events: none;
    z-index: 4;
    mix-blend-mode: screen;
    animation: omegaPulse 8s ease-in-out;
}

.omega-mark::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 220px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 216, 135, 0.32), rgba(255, 170, 30, 0.0) 65%);
    filter: blur(24px);
    pointer-events: none;
    z-index: -1;
}

@keyframes omegaPulse {

    0%,
    100% {
        opacity: 0.14;
        transform: translate(-50%, -50%) rotateZ(20deg) scale(1);
    }

    50% {
        opacity: 0.08;
        transform: translate(-50%, -50%) rotateZ(20deg) scale(1.02);
    }
}

@keyframes tiltGrid {

    0%,
    100% {
        transform: rotateZ(0deg);
    }

    50% {
        transform: rotateZ(180deg);
    }
}

@keyframes rotateRing {
    0% {
        transform: rotateX(70deg) rotateY(0deg) rotateZ(20deg);
    }

    100% {
        transform: rotateX(70deg) rotateY(360deg) rotateZ(20deg);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.55;
    }

    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes rotateEarth {
    0% {
        transform: translate(-50%, -50%) rotateY(0deg) rotateX(3deg);
    }

    100% {
        transform: translate(-50%, -50%) rotateY(360deg) rotateX(3deg);
    }
}


/* CRT SCANLINE EFFECT (GLOBAL OVERLAY) */
body::before {
    content: " ";
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.2) 50%);
    background-size: 100% 4px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.1;
}

body::after {
    content: " ";
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 1001;
}

/* ============================================================ */
/* --- II. MAIN GRID STRUCTURE (DESKTOP) --- */
/* ============================================================ */
.os-wrapper {
    display: grid;
    grid-template-columns: 240px 1fr 260px;
    width: 100%;
    height: 100%;
    position: relative;
}

/* MAIN CONTENT CONTAINER */
.os-main {
    padding: 20px 40px 40px 40px;
    /* Reduziertes Padding oben, da header fest ist */
    margin-top: 80px;
    /* Platz für die fixed Topbar */
    overflow-y: auto !important;
    height: 100vh;
    position: relative;
    /*backdrop-filter: blur(8px) saturate(1.2);*/
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    /* Support für Safari/iOS */
    border-left: 1px solid rgba(var(--amber-rgb), 0.1);
    border-right: 1px solid rgba(var(--amber-rgb), 0.1);
    /* Zusammengeführt aus doppelter Definition */
    padding-bottom: 100px;
    /* Platz am Ende für entspanntes Scrollen */
    scroll-behavior: smooth;
}

/* GLOBAL SIDEBAR STYLING */
.os-sidebar {
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    margin-top: 80px;
    /* Platz für die fixed Topbar */
    z-index: 10;
}

.os-sidebar-left {
    border-right: 1px solid rgba(var(--amber-rgb), 0.35);
    background: rgba(5, 5, 5, 0.75);
    box-shadow:
        8px 0 30px rgba(var(--amber-rgb), 0.35),
        0 0 40px rgba(255, 126, 0, 0.15) inset;
    backdrop-filter: blur(4px);
}

.os-sidebar-left::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, rgba(var(--amber-rgb), 1) 0%, rgba(var(--amber-rgb), 0.0) 100%);
    box-shadow: 0 0 18px rgba(var(--amber-rgb), 0.8);
    pointer-events: none;
}

.os-sidebar-right {
    border-right: none;
    border-left: 1px solid var(--amber-dim);
    box-shadow:
        -8px 0 30px rgba(var(--amber-rgb), 0.35),
        inset 0 0 40px rgba(255, 126, 0, 0.15);
    background: rgba(5, 5, 5, 0.75);
    backdrop-filter: blur(4px);
    position: relative;
    gap: 20px;
}

.os-sidebar-right::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, rgba(var(--amber-rgb), 1) 0%, rgba(var(--amber-rgb), 0.0) 100%);
    box-shadow: 0 0 18px rgba(var(--amber-rgb), 0.8);
    pointer-events: none;
}

.os-grid {
    display: grid;
    /* Nutze 1fr für die Sidebar statt fester Pixel, oder ein Verhältnis wie 2fr 1fr */
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
    width: 100%;
}

/* Spezifische Widget-Box für Uhrzeit & Sync (Bild 4) */
.os-sidebar-right .widget-box {
    border: 1px solid var(--amber-dim);
    border-top: 2px solid var(--amber);
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
    background: rgba(var(--amber-rgb), 0.02);
}

/* Die kleine Label-Leiste innerhalb der Box */
.widget-label {
    font-size: 9px;
    color: var(--amber);
    opacity: 0.6;
    border-bottom: 1px solid var(--amber-dim);
    margin-bottom: 12px;
    padding-bottom: 4px;
    display: block;
    letter-spacing: 1px;
}

/* Große Zeitanzeige (Bild 2, 4) */
.time-display-large {
    font-size: 38px;
    font-weight: 700;
    color: #ffffff;
    /* Weißer Kontrast für die Uhrzeit */
    line-height: 1;
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    letter-spacing: -2px;
}

.date-sub-display {
    font-size: 12px;
    color: var(--amber);
    opacity: 0.5;
    margin-top: 8px;
    display: block;
}

/* Global Terminal Sync Liste (Bild 4) */
.sync-list {
    list-style: none;
}

.sync-item {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.sync-city {
    opacity: 0.7;
}

.sync-time {
    font-weight: bold;
}

/* Status-Leiste (Authenticated / Running) */
.status-bar {
    margin-bottom: 30px;
}

.status-item {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 15px;
}

/* ============================================================ */
/* --- III. GLOBAL UI KOMPONENTEN (THE LOOK) --- */
/* ============================================================ */

/* 1. DER SPEZIAL-LOOK: Diagonale Boxen (aus Bild 1) */
.os-box {
    /* Bereinigt und zusammengefasst */
    position: relative;
    display: block;
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--amber-dim);
    border-radius: 0;
    padding: 20px;
    /* KRITISCH: Oben Platz schaffen für Label & Titel */
    color: var(--amber);
    text-decoration: none;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        inset 0 0 15px rgba(var(--amber-rgb), 0.02),
        0 0 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    pointer-events: auto !important;
}

/* Sidebar left soll denselben Nav-Box-Effekt bekommen wie root index.php */
.os-sidebar-left .os-box {
    background: var(--panel-bg);
    border: 1px solid var(--amber-dim);
    border-radius: 4px;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    padding: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid var(--amber-dim);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.os-sidebar-left .os-box:hover {
    border-left-color: var(--cyan-accent);
    background: rgba(139, 233, 253, 0.06);
    transform: translateX(5px);
}

.os-sidebar-left .os-box:hover .os-box-title {
    color: var(--cyan-accent);
}

.os-sidebar-left .nav-item-link {
    text-decoration: none;
}

/* Das kleine Label auf dem Rahmen */
.os-box-label {
    position: absolute;
    top: 5px;
    right: 1px;
    background: #080808;
    padding: 0 10px;
    font-size: 10px;
    color: var(--amber);
    letter-spacing: 2px;
    text-transform: uppercase;
    z-index: 10;
}

.os-sidebar-left .os-box-label {
    position: absolute;
    right: 1px;
    bottom: 15px;
    top: auto;
    transform: rotate(270deg) translateX(50%);
    transform-origin: bottom right;
    background: rgba(8, 8, 8, 0.85);
    padding: 2px 8px;
    font-size: 9px;
    letter-spacing: 1px;
    opacity: 0.8;
    color: var(--amber);
    border-left: 1px solid rgba(var(--amber-rgb), 0.4);
    gap: 5px;
}

/* 2. Die dekorativen Winkel bleiben automatisiert im CSS */
/* .os-box::before {
    content: "";
    position: absolute;
    top: -2px;   
    left: -2px;
    width: 15px; 
    height: 15px;
    border-top: 3px solid var(--amber);
    border-left: 3px solid var(--amber);
    z-index: 5;
} */

/* Die markanten Eck-Klammern aus Bild 3/4 */
/* .os-box::after {
    position: absolute;
    top: -1px; right: -1px;
    width: 10px; height: 10px;
    border-top: 2px solid var(--amber);
    border-right: 2px solid var(--amber);
    pointer-events: none;
} */

.os-box-title {
    display: block;
    /* Erzwingt eine eigene Zeile */
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    /* Weißer Kontrast wie in der Registry */
    letter-spacing: 1px;
    margin-bottom: 15px;
    /* Abstand zum restlichen Inhalt */
    text-transform: uppercase;
    border-left: 2px solid var(--amber);
    /* Ein kleiner Akzent-Strich links */
    padding-left: 10px;
}

.os-box-status {
    font-size: 9px;
    opacity: 0.6;
    display: block;
    margin-top: 2px;
}

/* 2. RECHTE SIDEBAR ELEMENTE (aus Bild 3) */
.section-label {
    font-size: 10px;
    opacity: 0.75;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--amber-dim);
    letter-spacing: 1px;
    color: var(--amber-white);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 14px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.green {
    background: #00ff41;
    box-shadow: 0 0 8px #00ff41;
}

.time-box {
    border: 1px solid var(--amber-dim);
    padding: 15px;
    margin-top: 10px;
    background: rgba(var(--amber-rgb), 0.02);
}

.time-main {
    font-size: 42px;
    font-weight: 700;
    color: var(--amber-green);
    line-height: 1;
}

.date-sub {
    font-size: 14px;
    opacity: 0.6;
    margin-top: 5px;
    display: block;
}

/* ============================================================ */
/* VIII. HEADER-REFINEMENT (AUS BILD 5)                         */
/* ============================================================ */

/* Container für den gesamten Header-Block */
.os-header-container {
    margin-bottom: 0px;
}

/* 1. Breadcrumb-Styling (Klein, orange, oben links) */
.breadcrumb {
    font-size: 10px;
    opacity: 0.7;
    /* Leicht gedimmt wie im Original */
    color: var(--amber);
    margin-bottom: 5px;
    /* Abstand zur Hauptüberschrift */
    letter-spacing: 1px;
}

/* 2. Hauptüberschrift-Styling (Groß, orange, fett) */
.page-title {
    font-size: 24px;
    font-weight: 900;
    /* Sehr fett */
    color: var(--amber);
    margin-bottom: 10px;
    /* Abstand zur Trennlinie */
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--amber-deep), 0 0 5px rgba(var(--amber-rgb), 0.2);
}

/* 3. Die feine Trennlinie (Aus Bild 5) */
.header-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, var(--amber-dim) 0%, transparent 100%);
    /* Ein feiner Verlauf, der nach rechts ausblendet, wie im Original */
    text-shadow:
        0 0 10px var(--amber),
        0 0 20px var(--amber-deep);
    filter: brightness(1.2);
}

/* ============================================================ */
/* --- V. CORE FORM ELEMENTS (INPUTS & CONTROLS) --- */
/* ============================================================ */

/* Gruppierung von Label und Input */
.os-form-group,
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.os-form-label,
.form-group label {
    display: block;
    font-size: 10px;
    color: var(--amber);
    opacity: 0.6;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

/* Fallback/Äquivalent für sys_builder/sys_admin Buttons */
.os-button,
.nav-box {
    display: inline-block;
    background: var(--amber);
    color: var(--bg);
    border: none;
    padding: 10px 14px;
    font-family: var(--font-main);
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.os-button:hover,
.nav-box:hover,
.os-btn:hover,
.os-btn-outline:hover,
.os-btn-submit:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 10px var(--amber-deep);
}

.f_perm_selector,
.os-input,
.terminal-input,
.os-file-input {
    width: 100%;
    padding: 8px 10px;
    font-family: var(--font-main);
    font-size: 11px;
    color: var(--amber);
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--amber-dim);
    outline: none;
    transition: all 0.2s ease;
}

.f_perm_selector:focus,
.os-input:focus,
.terminal-input:focus,
.os-file-input:focus {
    border-color: var(--amber);
    box-shadow: 0 0 10px var(--amber-deep);
}

.input-wrapper {
    display: block;
    width: 100%;
    margin-bottom: 15px;
}

.input-wrapper input {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 188, 0, 0.3);
    color: #ffbc00;
    font-family: 'Courier New', monospace;
    border-radius: 2px;
}

.btn,
.os-btn-submit {
    display: inline-block;
    background: #ffbc00;
    color: #000;
    border: none;
    padding: 10px;
    font-family: monospace;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    margin-top: 5px;
    /* width: 100%; */
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.btn:hover,
.os-btn-submit:hover {
    background: #fff;
    box-shadow: 0 0 15px #ffbc00;
}

.form-row-flex {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-margin-top-20 {
    margin-top: 20px;
}

.terminal-input,
.os-input {
    appearance: none;
}


/* Der primäre Input-Style */
.os-input {
    width: 100%;
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--amber-dim);
    padding: 12px 15px;
    color: var(--amber);
    font-family: var(--font-main);
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
    /* Kleiner diagonaler Schnitt unten rechts */
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
}

.os-input:focus {
    border-color: var(--amber);
    background: rgba(var(--amber-rgb), 0.05);
    box-shadow: 0 0 10px var(--amber-deep);
}

.os-input::placeholder {
    color: var(--amber);
    opacity: 0.2;
}

/* Checkbox & Radio Reset für den Terminal Look */
.os-checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 11px;
    gap: 10px;
    user-select: none;
}

.os-checkbox {
    width: 14px;
    height: 14px;
    border: 1px solid var(--amber-dim);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.os-checkbox-container:hover .os-checkbox {
    border-color: var(--amber);
}

.os-checkbox.checked {
    background: var(--amber);
    box-shadow: 0 0 8px var(--amber);
}

.o7-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
    width: 100vw;
}

.o7-nav {
    background: rgba(5, 9, 23, .95);
    border-right: 1px solid rgba(92, 117, 164, .36);
    padding: 16px;
}

.o7-nav h2 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: var(--amber);
    letter-spacing: 2px;
}

.o7-main {
    padding: 16px;
    overflow-y: auto;
    max-height: calc(100vh - 32px);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--amber-dim);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

th,
td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

th {
    color: #9bbbee;
    text-align: left;
}

tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

.source-link {
    color: #8fd9ff;
}

.action-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 120px;
    gap: 8px;
    align-items: end;
}

.sub-form {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sub-form-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-ok {
    color: #8df78d;
}

.status-offline {
    color: #f7b272;
}

.f_perm_selector {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--amber-dim);
    background: rgba(10, 10, 10, .6);
    color: var(--amber);
    border-radius: 3px;
}


/* ============================================================ */
/* --- VI. DATA TABLES (GRID DISPLAY) --- */
/* ============================================================ */

.os-table-container {
    width: 100%;
    border: 1px solid var(--amber-dim);
    background: rgba(5, 5, 5, 0.4);
    position: relative;
    overflow: hidden;
}

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

.os-table thead {
    background: rgba(var(--amber-rgb), 0.05);
    border-bottom: 2px solid var(--amber-dim);
}

.os-table th {
    padding: 12px 15px;
    font-size: 10px;
    font-weight: bold;
    color: var(--amber);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.os-table td {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(var(--amber-rgb), 0.05);
    color: #fff;
    font-size: 11px;
}

/* Hover-Effekt für Zeilen */
.os-table tr:hover td {
    background: rgba(var(--amber-rgb), 0.03);
    color: var(--amber);
}

/* Hervorgehobene Spalte (z.B. ID oder Status) */
.os-table .cell-highlight {
    color: var(--amber);
    font-weight: bold;
}

/* Status-Badges innerhalb von Tabellen */
.badge {
    padding: 2px 6px;
    font-size: 9px;
    border: 1px solid currentColor;
    background: transparent;
}

.badge-active {
    color: var(--amber-green);
}

.badge-alert {
    color: var(--amber-crit);
}

.badge-wait {
    color: var(--amber-pause);
}

/* Filter-Bar Styling */
.os-filter-bar {
    margin: 20px 0;
    padding: 10px;
    background: rgba(var(--amber-rgb), 0.03);
    border-left: 2px solid var(--amber);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-label {
    font-size: 9px;
    opacity: 0.5;
    margin-right: 10px;
}

.os-filter-link {
    text-decoration: none;
    color: var(--amber);
    font-size: 10px;
    opacity: 0.6;
    transition: all 0.2s;
}

.os-filter-link:hover,
.os-filter-link.active {
    opacity: 1;
    text-shadow: 0 0 8px var(--amber);
}

/* Tabellen-Verfeinerung */
/* .os-table-row:hover {
    background: rgba(var(--amber-rgb), 0.05);
} */
/* Hinweis: ähnlicher Hover-Effekt wird von .os-table tr:hover td gesteuert */

.cell-date {
    font-family: var(--font-main);
    opacity: 0.7;
    font-size: 10px;
}

.cell-amount {
    font-size: 22px;
    color: var(--amber-white);
    font-weight: bold;
    font-family: var(--font-main);
}

.vendor-name {
    letter-spacing: 1px;
}

/* Status-Tag (Entity) */
.os-status-tag {
    background: var(--amber-dim);
    color: var(--amber);
    font-size: 9px;
    padding: 1px 4px;
    margin-right: 5px;
    border: 1px solid var(--amber-dim);
}

/* Mini-Buttons für die Tabelle */
.os-btn-mini {
    background: var(--amber);
    color: var(--bg);
    border: 1px solid var(--amber);
    padding: 2px 6px;
    font-size: 9px;
    font-weight: bold;
    text-decoration: none;
    margin-left: 5px;
    transition: all 0.2s;
    z-index: 10000;
    cursor: pointer !important;
}

.os-btn-mini.outline {
    background: transparent;
    color: var(--amber);
}

.os-btn-mini:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 10px var(--amber-deep);
}

/* Select-Feld Anpassung */
select.os-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' fill='%23FFB347'%3E%3Cpath d='M0 0l4 4 4-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
}

select.os-input option {
    background: var(--panel);
    color: var(--amber);
}

/* Spezial-Styling für das File-Input */
.os-file-wrapper {
    position: relative;
    border: 1px dashed var(--amber-dim);
    padding: 10px;
    background: rgba(var(--amber-rgb), 0.02);
    transition: all 0.2s;
}

.os-file-wrapper:hover {
    border-color: var(--amber);
    background: rgba(var(--amber-rgb), 0.05);
}

.os-file-input {
    font-family: var(--font-main);
    font-size: 10px;
    color: var(--amber);
    cursor: pointer;
}

/* Fokus-Zustand für Buttons innerhalb von Formularen */
.os-btn:focus {
    outline: none;
    box-shadow: 0 0 15px var(--amber);
}

/* Animation für das Ein-/Ausklappen */
#form-content {
    max-height: 1000px;
    /* Genug Platz für den Inhalt */
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.3s;
    opacity: 1;
}

#form-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* Optischer Hinweis für den Header */
.os-box-header:hover .os-box-title {
    text-shadow: 0 0 8px var(--amber);
}

/* Container für die einzelnen Metriken (today, week, month) */
.metric-subbox {
    position: relative;
    border: 1px solid rgba(255, 176, 0, 0.3);
    /* Dein Amber-Farbton */
    padding: 15px;
    margin-top: 10px;
    /* Platz für die Überschrift oben */
}

/* Die kleinen Überschriften (today, week, month) */
.metric-subbox-label {
    position: absolute;
    top: -10px;
    /* Schiebt es genau auf die Linie */
    left: 10px;
    background: #080808;
    /* Muss EXAKT deine Hintergrundfarbe sein */
    padding: 0 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 176, 0, 0.6);
}

/* ============================================================ */
/* --- IV. RESPONSIVE ENGINE (UMBRÜCHE) --- */
/* ============================================================ */

/* Universelle Schalter */
.compact-only {
    display: none !important;
}

.full-only {
    display: block;
}

/* 1. TABLET/COMPACT VIEW (1200px - 769px) - aus Bild 2 and (min-width: 769px)  */
@media (max-width: 1200px) {
    .os-main {
        padding: 20px;
    }

    .os-wrapper {
        grid-template-columns: 30px 1fr 30px !important;
    }

    .full-only {
        display: none !important;
    }

    .compact-only {
        display: flex !important;
    }

    .os-sidebar {
        padding: 20px 5px !important;
        align-items: center;
    }

    /* Vertikale Drehung für alle Compact-Elemente */
    .nav-label-short,
    .vertical-text,
    .time-main-compact {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        display: block;
        white-space: nowrap;
        font-size: 11px;
        letter-spacing: 2px;
        text-align: center;
    }

    /* Minimalistisches Nav-Boxen */
    .os-sidebar-left .os-box {
        border: none;
        clip-path: none;
        background: none;
        padding: 10px 0;
        width: 20px !important;
        visibility: visible !important;
        opacity: 1 !important;
        flex-shrink: 0;
        /* Verhindert das Zusammenquetschen auf iOS */
    }

    .os-sidebar-left .os-box:hover {
        transform: translateX(5px);
    }

    .os-sidebar-left .os-box::before {
        display: none;
    }
}

@media (max-width: 768px) {
    .os-main {
        padding: 5px;
    }

    .os-grid {
        /* Schaltet das Grid auf eine einzige Spalte um */
        grid-template-columns: 1fr;
    }
}

/* ============================================================ */
/* --- VII. MODAL SYSTEM (OVERLAY & CONTENT) --- */
/* ============================================================ */

/* Erzeugt das dunkle Overlay über die gesamte Seite */
.os-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Tiefschwarz transparent */
    backdrop-filter: blur(4px);
    /* Moderner Glass-Effekt */
    /* display: flex;  (wird durch display: none überschrieben und per Inline-Style via JS gesteuert, daher hier als Referenz belassen) */
    align-items: center;
    /* Vertikale Zentrierung */
    justify-content: center;
    /* Horizontale Zentrierung */
    z-index: 9999;
    /* Höchste Ebene */
    display: none;
    pointer-events: auto;
}

/* Wenn das Modal aktiv ist, muss es Klicks fangen */
.os-modal-overlay[style*="display: flex"] {
    pointer-events: auto;
}

/* Der Inhaltscontainer (die Box im Modal) */
.os-modal-content {
    width: 100%;
    max-width: 520px;
    /* Einheitliche Breite für Modal-Formulare */
    margin: 0 20px;
    padding: 20px;
    box-sizing: border-box;
    z-index: 9001;
    pointer-events: auto;
    background: rgba(10, 10, 10, 0.94);
    border: 1px solid var(--amber-dim);
    border-radius: 6px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
}

.os-modal-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.os-modal-form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.os-modal-form-group {
    flex: 1 1 220px;
    min-width: 220px;
}

.field-flex-1 {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.field-pad-bottom-12 {
    margin-bottom: 0;
    padding-bottom: 12px;
}

.flex-row-spread {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}


.os-modal-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Falls du die Buttons wie im Screenshot (Update/Delete/Cancel) willst */
.os-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.os-btn-delete {
    background: #440000;
    color: #ff4444;
    border: 1px solid #770000;
    font-size: 10px;
    padding: 4px 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
    box-shadow: none;
    font-family: var(--font-main);
    font-weight: bold;
    border-radius: 2px;
}

.os-modal-form-actions .os-btn,
.os-modal-form-actions .os-btn-outline,
.os-modal-form-actions .os-btn-delete {
    width: 100%;
}

.os-btn-delete:hover {
    background: #660000 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.45);
    border-color: #ff0000 !important;
    transform: translateY(-1px);
}

/* RECEIPT INBOX LAYOUT */
.receipt-inbox {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
    color: var(--amber);
}

.receipt-card {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(var(--amber-rgb), 0.25);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    padding: 12px;
    min-height: 360px;
}

.receipt-card .title {
    font-size: 12px;
    letter-spacing: 2px;
    margin-bottom: 8px;
    color: #ffbc00;
    text-transform: uppercase;
}

.receipt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.receipt-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.receipt-field label {
    font-size: 9px;
    text-transform: uppercase;
    opacity: 0.6;
}

.receipt-field input,
.receipt-field select,
.receipt-field textarea {
    width: 100%;
    font-size: 12px;
    font-family: var(--font-main);
    padding: 10px;
    border: 1px solid rgba(var(--amber-rgb), 0.3);
    background: rgba(0, 0, 0, 0.35);
    color: var(--amber);
}

.receipt-field textarea {
    min-height: 85px;
}

.receipt-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.receipt-actions .os-btn,
.receipt-actions .os-btn-outline,
.receipt-actions .os-btn-delete {
    flex: 1;
    width: auto;
    text-align: center;
}

/* smaller view */
@media (max-width: 980px) {
    .receipt-inbox {
        grid-template-columns: 1fr;
    }
}


/* Verdunkelt den Hintergrund noch eleganter, wenn das Modal aktiv ist */
body.modal-open .os-main {
    filter: blur(2px) grayscale(0.5);
    transition: filter 0.3s ease;
}

/* Terminal-Animation für das Erscheinen des Fensters */
@keyframes os-modal-appear {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
        filter: brightness(2);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: brightness(1);
    }
}

/* Optionale Anpassung der os-box wenn sie im Modal liegt */
.os-modal-content {
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--amber-dim);
    background: var(--bg);
    /* Sicherstellen, dass der Hintergrund deckend ist */
}

/* Schließen-Bereich im Header-Hover */
.os-box-header div[onclick]:hover {
    color: var(--amber) !important;
    opacity: 1 !important;
    text-shadow: 0 0 8px var(--amber);
}

/* Verhindert das Scrollen des Hintergrunds, wenn das Modal offen ist */
body.modal-open {
    overflow: hidden;
}

/* ============================================================ */
/* --- VI. ANIMATIONEN & EFFEKTE (GLANZ) --- */
/* ============================================================ */
@keyframes sync-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

@keyframes status-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

@keyframes box-pulse {
    from {
        box-shadow: 0 -5px 15px rgba(0, 255, 65, 0.2), inset 0 0 10px rgba(0, 255, 65, 0.1);
    }

    to {
        box-shadow: 0 -5px 20px rgba(0, 255, 65, 0.4), inset 0 0 20px rgba(0, 255, 65, 0.2);
    }
}

.dot.green {
    animation: status-pulse 2s infinite;
}

.world-clock:not(:empty) {
    color: #ffffff;
    /*  animation: sync-pulse 2s infinite; */
}

/* ============================================================ */
/* VII. OPTISCHE FEINANPASSUNGEN (CHRONOS DETAIL-UPGRADE)       */
/* ============================================================ */

/* 1. Basis Navigation Links */
.nav-item-link {
    text-decoration: none;
    display: block;
}

/* 2. HOVER (Nur wenn NICHT aktiv) */
.os-box:hover {
    border-color: var(--amber);
    box-shadow: 0 0 15px var(--amber-deep);
    background: rgba(var(--amber-rgb), 0.03);
}

/* 3. AKTIVER ZUSTAND (Green-Status & Corner-Fix) */
.nav-item-link.active .os-box,
.os-box.session-active {
    /* Status-Farbe */
    border-top: 2px solid var(--amber-green) !important;
    background: rgba(0, 255, 65, 0.05) !important;

    /* Schatten-Kombination (Grüner Glow) */
    box-shadow:
        0 -5px 15px rgba(0, 255, 65, 0.3),
        inset 0 0 15px rgba(0, 255, 65, 0.1) !important;

    /* Animation & Übergang */
    animation: box-pulse 4s infinite alternate;
    transition: all 0.3s ease;
}

/* 4. Eck-Winkel im aktiven Zustand entfernen */
.nav-item-link.active .os-box::before,
.os-box.session-active::before {
    display: none !important;
}

/* 5. Titel-Styling im aktiven Zustand */
.nav-item-link.active .os-box-title {
    color: #fff;
    text-shadow: 0 0 8px var(--amber-green);
    border-left-color: var(--amber-green);
    /* Passt den kleinen Akzent-Strich links an */
}

/* 3. Button-Styling (wie "TERMINATE" oder "EDIT") */
.os-btn {
    background: var(--amber);
    color: var(--bg);
    border: none;
    padding: 4px 8px;
    font-family: var(--font-main);
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    z-index: 10000;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.os-btn-outline {
    background: transparent;
    color: var(--amber);
    border: 1px solid var(--amber-dim);
    padding: 4px 8px;
    font-family: var(--font-main);
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.os-btn:hover,
.os-btn-outline:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 10px var(--amber-deep);
}

/* ============================================================ */
/* --- VIII. GENERIC CONTENT ELEMENTS (FALLBACKS) ---         */
/* ============================================================ */

/* Fallback-Styling für einfache Tabellen ohne .os-table Klasse */
.os-main table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.os-main th {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid var(--amber-dim);
    color: var(--amber);
    opacity: 0.6;
    letter-spacing: 1px;
    font-weight: bold;
}

.os-main td {
    padding: 10px;
    border-bottom: 1px solid rgba(var(--amber-rgb), 0.05);
    /* Sehr feine Trennung */
    vertical-align: middle;
    color: var(--amber-white);
}

/* 5. Scrollbar-Styling für den Terminal-Look */
.os-main::-webkit-scrollbar {
    width: 4px;
}

.os-main::-webkit-scrollbar-track {
    background: var(--bg);
}

.os-main::-webkit-scrollbar-thumb {
    background: var(--amber-dim);
    border-radius: 2px;
}

.os-main::-webkit-scrollbar-thumb:hover {
    background: var(--amber);
}

.input-group label {
    display: block;
    font-size: 8px;
    color: var(--amber-color);
    opacity: 0.6;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.terminal-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 188, 0, 0.3);
    color: #ffbc00;
    font-family: 'Courier New', monospace;
    padding: 8px;
    width: 100%;
    outline: none;
    transition: all 0.2s;
}

.terminal-input:focus {
    border-color: #ffbc00;
    box-shadow: 0 0 5px rgba(255, 188, 0, 0.2);
}

.os-btn-submit {
    background: #ffbc00;
    color: #000;
    border: none;
    padding: 10px;
    font-family: monospace;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    margin-top: 5px;
    /* width: 100%; */
}

.os-btn-submit:hover {
    background: #fff;
    box-shadow: 0 0 15px #ffbc00;
}

.shadow-amber {
    box-shadow: 0 0 20px rgba(255, 188, 0, 0.05);
}

/* Der Container braucht position: relative, damit der Button rechts kleben kann */
.shorty-item {
    position: relative;
    transition: background 0.2s;
    color: #ffffff;
    background: rgba(5, 5, 5, 0.35);
    border: 1px solid rgba(var(--amber-rgb), 0.2);
    padding: 4px 6px;
    border-radius: 3px;
}

.shorty-item span {
    color: #d0d0d0;
    font-size: 11px;
}

.shorty-item span:first-child a {
    color: var(--amber);
    font-weight: bold;
}

.shorty-item .operator {
    color: var(--amber-color);
    margin-left: 4px;
    font-size: 9px;
    opacity: 0.9;
}

/* Der Button ist standardmäßig unsichtbar */
.shorty-delete {
    display: block;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.2s;
    color: #ff4444;
    text-decoration: none;
    font-size: 9px;
    margin-left: auto;
    /* Schiebt ihn nach rechts */
}

/* Nur beim Hover über die Zeile zeigen wir den Button */
.shorty-item:hover .shorty-delete {
    opacity: 1;
}

.shorty-delete:hover {
    opacity: 1 !important;
    text-shadow: 0 0 5px #ff4444;
}

/* ============================================================ */
/* IX. TERMINAL TOPBAR (PORTED FROM BERNERS)                   */
/* ============================================================ */

.terminal-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(rgba(5, 5, 5, 0.85), rgba(5, 5, 5, 0.85)), url('/sys/img/o7-background.jpg');
    background-size: cover;
    background-position: center;
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    z-index: 5000;
    padding: 15px 30px;
    font-family: var(--font-main);
    color: var(--amber);
    font-size: 0.75rem;
    border-bottom: 1px solid var(--amber-dim);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.8);
}

.os-header-container {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.breadcrumb {
    font-size: 9px;
    opacity: 0.6;
    color: var(--amber);
    margin-bottom: 2px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.page-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--amber);
    margin: 4px 0;
    letter-spacing: 2.5px;
    text-shadow: 0 0 10px rgba(var(--amber-rgb), 0.3);
}

.header-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, var(--amber-dim) 0%, transparent 100%);
    margin-top: 6px;
}

.th-stats-container {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.7rem;
    opacity: 0.8;
}

.th-stats-container .glow {
    color: var(--amber-green);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

.th-sep {
    margin: 0 5px;
    opacity: 0.3;
}

.burger-icon {
    font-size: 1.1rem;
    color: var(--amber);
    margin-right: 15px;
    cursor: pointer;
    vertical-align: middle;
}

.glow {
    color: var(--amber);
    text-shadow: 0 0 8px var(--amber-dim);
}