/* Nexus – Grundstil, Themes und die vier Dashboard-Ansichten */

/* ---------- Themes: Farben als Variablen, hell und dunkel ---------- */
:root {
    --nx-accent: #5b9a1a;
    --nx-accent-rgb: 91, 154, 26;
    --nx-accent-soft: #eef6e3;
    --nx-on-accent: #fff;
    --nx-bg: #f3f5f8;
    --nx-card: #fff;
    --nx-card-border: #e3e7ee;
    --nx-muted: #6b7280;
    --nx-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --nx-ok: #16a34a;
    --nx-warning: #d97706;
    --nx-error: #dc2626;
    --nx-offline: #9ca3af;
    --nx-glass: rgba(255, 255, 255, .62);
    --nx-glass-border: rgba(255, 255, 255, .75);
    --nx-aurora: radial-gradient(1200px 600px at 10% -10%, #d9f99d 0%, transparent 60%),
                 radial-gradient(900px 600px at 100% 0%, #a5f3fc 0%, transparent 55%),
                 radial-gradient(900px 700px at 60% 110%, #c7d2fe 0%, transparent 60%), #f1f5f9;
}
[data-bs-theme="dark"] {
    --nx-accent: #8fcf4a;
    --nx-accent-rgb: 143, 207, 74;
    --nx-accent-soft: #24301a;
    --nx-on-accent: #10160a;
    --nx-bg: #0f1216;
    --nx-card: #171b21;
    --nx-card-border: #262c35;
    --nx-muted: #9aa3af;
    --nx-shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --nx-ok: #4ade80;
    --nx-warning: #fbbf24;
    --nx-error: #f87171;
    --nx-offline: #6b7280;
    --nx-glass: rgba(22, 27, 34, .58);
    --nx-glass-border: rgba(255, 255, 255, .08);
    --nx-aurora: radial-gradient(1200px 600px at 10% -10%, #1f3a12 0%, transparent 60%),
                 radial-gradient(900px 600px at 100% 0%, #0b3a4a 0%, transparent 55%),
                 radial-gradient(900px 700px at 60% 110%, #25225a 0%, transparent 60%), #0b0e13;
}
/* Theme "Ozean": nur andere Akzentfarbe und Hintergrundtöne */
[data-theme="ocean"] {
    --nx-accent: #1d6fd1;
    --nx-accent-rgb: 29, 111, 209;
    --nx-accent-soft: #e6f0fb;
    --nx-bg: #f2f6fa;
    --nx-aurora: radial-gradient(1200px 600px at 10% -10%, #bfdbfe 0%, transparent 60%),
                 radial-gradient(900px 600px at 100% 0%, #a5f3fc 0%, transparent 55%),
                 radial-gradient(900px 700px at 60% 110%, #ddd6fe 0%, transparent 60%), #f1f5f9;
}
[data-theme="ocean"][data-bs-theme="dark"] {
    --nx-accent: #5ea8ff;
    --nx-accent-rgb: 94, 168, 255;
    --nx-accent-soft: #14243a;
    --nx-on-accent: #07111f;
    --nx-bg: #0d1218;
    --nx-aurora: radial-gradient(1200px 600px at 10% -10%, #0f2b4d 0%, transparent 60%),
                 radial-gradient(900px 600px at 100% 0%, #0b3a4a 0%, transparent 55%),
                 radial-gradient(900px 700px at 60% 110%, #2a1f5a 0%, transparent 60%), #0b0e13;
}

/* ---------- Grundlagen ---------- */
body { background: var(--nx-bg); }
a { color: var(--nx-accent); }
.text-accent { color: var(--nx-accent) !important; }
.text-muted-nx { color: var(--nx-muted) !important; }
.btn-primary {
    --bs-btn-bg: var(--nx-accent); --bs-btn-border-color: var(--nx-accent);
    --bs-btn-hover-bg: var(--nx-accent); --bs-btn-hover-border-color: var(--nx-accent);
    --bs-btn-active-bg: var(--nx-accent); --bs-btn-active-border-color: var(--nx-accent);
    --bs-btn-disabled-bg: var(--nx-accent); --bs-btn-disabled-border-color: var(--nx-accent);
    --bs-btn-color: var(--nx-on-accent); --bs-btn-hover-color: var(--nx-on-accent); --bs-btn-active-color: var(--nx-on-accent);
}
.btn-primary:hover { filter: brightness(1.07); }
.form-check-input:checked { background-color: var(--nx-accent); border-color: var(--nx-accent); }
.form-check-input:focus, .form-control:focus, .form-select:focus { border-color: rgba(var(--nx-accent-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--nx-accent-rgb), .2); }
.breadcrumb a { color: var(--nx-accent); }
.min-w-0 { min-width: 0; }

.brand-mark {
    width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center; flex: none;
    background: var(--nx-accent); color: var(--nx-on-accent); font-size: 15px;
}
.brand-mark.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 24px; }
.nx-navbar { background: var(--nx-card); border-bottom: 1px solid var(--nx-card-border); }
.btn-icon { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; border: 0; background: transparent; color: inherit; border-radius: 8px; }
.btn-icon:hover, .btn-icon.active { background: var(--nx-accent-soft); color: var(--nx-accent); }
.panel { background: var(--nx-card); border: 1px solid var(--nx-card-border); border-radius: 14px; box-shadow: var(--nx-shadow); }

/* Projekt-Icon: Bild oder Font-Awesome-Icon in der Projektfarbe */
.project-icon { width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center; flex: none; overflow: hidden;
    font-size: 20px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.project-icon img { width: 100%; height: 100%; object-fit: contain; }

/* Statuspunkt */
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; background: var(--nx-offline); }
.status-dot[data-status="ok"] { background: var(--nx-ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nx-ok) 22%, transparent); }
.status-dot[data-status="warning"] { background: var(--nx-warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nx-warning) 22%, transparent); }
.status-dot[data-status="error"] { background: var(--nx-error); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nx-error) 22%, transparent); }
.status-dot[data-status="loading"] { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.metric-status-warning { color: var(--nx-warning) !important; }
.metric-status-error { color: var(--nx-error) !important; }
.card-message { font-size: .8rem; border-radius: 8px; padding: 6px 10px; }
.card-message.is-warning, .card-message.is-error { background: color-mix(in srgb, var(--nx-warning) 12%, transparent); color: var(--nx-warning); }
.card-message.is-error { background: color-mix(in srgb, var(--nx-error) 12%, transparent); color: var(--nx-error); }
.card-message.is-offline, .card-message.is-note { background: color-mix(in srgb, var(--nx-offline) 15%, transparent); color: var(--nx-muted); }
[data-card][data-status="offline"] .project-icon { filter: grayscale(1); opacity: .55; }

.skeleton {
    display: inline-block; height: .9em; width: 70%; border-radius: 4px;
    background: linear-gradient(90deg, var(--nx-card-border) 25%, color-mix(in srgb, var(--nx-card-border) 40%, transparent) 50%, var(--nx-card-border) 75%);
    background-size: 200% 100%; animation: skeleton 1.2s infinite linear;
}
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sparkline { width: 100%; height: 34px; display: block; }

/* Anordnen-Modus */
.size-switch { display: none; z-index: 2; }
body.editing .size-switch { display: inline-flex; }
body.editing [data-card] { cursor: grab; outline: 2px dashed rgba(var(--nx-accent-rgb), .45); outline-offset: 3px; }
body.editing [data-card] * { pointer-events: none; }
body.editing [data-card] .size-switch, body.editing [data-card] .size-switch * { pointer-events: auto; }
.sortable-ghost { opacity: .35; }

/* ---------- Verwaltung ---------- */
.settings-card { display: flex; align-items: center; gap: 16px; padding: 20px; height: 100%;
    background: var(--nx-card); border: 1px solid var(--nx-card-border); border-radius: 14px;
    color: inherit; text-decoration: none; transition: background-color .15s, border-color .15s; }
.settings-card:hover { background: var(--nx-accent-soft); border-color: rgba(var(--nx-accent-rgb), .5); color: inherit; }
.settings-card > i { font-size: 26px; width: 36px; text-align: center; color: var(--nx-muted); transition: color .15s; }
.settings-card:hover > i { color: var(--nx-accent); }
.settings-card .t { font-weight: 600; }
.settings-card .d { font-size: .82rem; color: var(--nx-muted); }
.section { background: var(--nx-card); border: 1px solid var(--nx-card-border); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.icon-preview { width: 72px; height: 72px; border-radius: 16px; font-size: 30px; }
.url-row { display: grid; grid-template-columns: 24px 140px 1fr 170px 90px 50px 36px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--nx-card-border); }
.url-head { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--nx-muted); border-bottom: 0; padding-bottom: 0; }
@media (max-width: 991px) {
    .url-row { grid-template-columns: 24px 1fr 1fr; }
    .url-row > .url-input { grid-column: 2 / 4; }
    .url-head { display: none; }
}
.drag-handle { cursor: grab; color: var(--nx-muted); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--nx-card-border); color: inherit; text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: var(--nx-accent-soft); color: inherit; }
.changelog h2 { font-size: 1.1rem; margin-top: 1.5rem; }
.changelog ul { padding-left: 1.2rem; }

/* ---------- Ansicht "Kacheln" ---------- */
.view-tiles .dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 16px;
    background: var(--nx-card); border: 1px solid var(--nx-card-border); border-radius: 14px;
    box-shadow: var(--nx-shadow); color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s; }
a.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 24, 40, .09); color: inherit; }
.tile[data-size="l"] { grid-column: span 2; }
.tile-name { font-weight: 600; line-height: 1.2; }
.tile-desc { font-size: .8rem; color: var(--nx-muted); }
.tile-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.tile[data-size="s"] .tile-metrics { grid-template-columns: 1fr; }
.tile[data-size="l"] .tile-metrics { grid-template-columns: repeat(4, 1fr); }
.metric-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--nx-muted); }
.metric-value { font-size: 1.15rem; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric-value small { font-size: .75rem; font-weight: 500; color: var(--nx-muted); margin-left: 2px; }
.metric-hint { font-size: .72rem; color: var(--nx-muted); }
.tile[data-size="s"] .metric-value { font-size: 1.5rem; }
.tile-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 8px; font-size: .75rem; color: var(--nx-muted); }
.tile-foot > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clock-time { font-size: 2.6rem; font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.bookmark { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; color: inherit; text-decoration: none; }
.bookmark:hover { background: var(--nx-accent-soft); color: inherit; }
.nav-dash .nav-link { color: var(--nx-muted); border-radius: 8px; padding: 6px 12px; white-space: nowrap; }
.nav-dash .nav-link.active { background: var(--nx-accent-soft); color: var(--nx-accent); font-weight: 600; }

/* ---------- Ansicht "Kompakt" ---------- */
.view-compact .dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.chip { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
    padding: 18px 12px 12px; background: var(--nx-card); border: 1px solid var(--nx-card-border); border-radius: 16px;
    color: inherit; text-decoration: none; box-shadow: var(--nx-shadow); min-height: 190px; }
a.chip:hover { border-color: rgba(var(--nx-accent-rgb), .6); color: inherit; }
.chip[data-size="m"], .chip[data-size="l"] { grid-column: span 2; }
.chip .project-icon { position: relative; width: 56px; height: 56px; border-radius: 50%; font-size: 24px; color: #fff; background: var(--c); overflow: visible; }
.chip .project-icon img { border-radius: 50%; background: #fff; }
.chip .project-icon .status-dot { position: absolute; right: -1px; bottom: -1px; width: 16px; height: 16px; border: 3px solid var(--nx-card); box-shadow: none; }
.chip-name { font-weight: 600; font-size: .95rem; }
.chip-big { font-size: 1.9rem; font-weight: 700; line-height: 1; }
.chip-big small { font-size: .9rem; font-weight: 500; color: var(--nx-muted); }
.chip-sub { font-size: .75rem; color: var(--nx-muted); }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pill { font-size: .75rem; padding: 3px 9px; border-radius: 99px; background: var(--nx-bg); white-space: nowrap; }
.pill b { font-weight: 600; }
.chip .sparkline { margin-top: auto; }

/* ---------- Ansicht "Liste" ---------- */
.view-list .dash-grid { background: var(--nx-card); border: 1px solid var(--nx-card-border); border-radius: 12px; box-shadow: var(--nx-shadow); overflow: hidden; }
.row-item { display: grid; grid-template-columns: 22px 260px 1fr 70px 24px; align-items: center; gap: 16px;
    padding: 12px 16px; border-bottom: 1px solid var(--nx-card-border); color: inherit; text-decoration: none; }
.row-item:last-child { border-bottom: 0; }
a.row-item:hover { background: var(--nx-accent-soft); color: inherit; }
.row-item .project-icon { width: 36px; height: 36px; border-radius: 9px; font-size: 16px; }
.row-metrics { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; }
.row-metrics .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; color: var(--nx-muted); }
.row-metrics .value { font-weight: 600; white-space: nowrap; }
.row-metrics .value small { color: var(--nx-muted); font-weight: 500; }
.row-ping { font-size: .8rem; color: var(--nx-muted); text-align: right; }
.row-handle { color: var(--nx-muted); display: none; }
body.editing .row-handle { display: inline; }
body.editing .row-item .status-dot { display: none; }
body.editing .view-list [data-card] { outline: none; }
.summary .num { font-size: 1.6rem; font-weight: 700; }
.nav-underline .nav-link { color: var(--nx-muted); }
.nav-underline .nav-link.active { color: var(--nx-accent); border-bottom-color: var(--nx-accent); }
@media (max-width: 991px) {
    .row-item { grid-template-columns: 22px 1fr 60px; }
    .row-metrics { grid-column: 2 / 4; gap: 16px; }
    .row-item > .row-open { display: none; }
}

/* ---------- Ansicht "Glas" ---------- */
body.view-glass { min-height: 100vh; background: var(--nx-aurora); background-attachment: fixed; }
.glass { background: var(--nx-glass); border: 1px solid var(--nx-glass-border); border-radius: 18px;
    backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 8px 30px rgba(15, 23, 42, .08); }
.glass-layout { display: grid; grid-template-columns: 230px 1fr; gap: 20px; padding: 20px; min-height: 100vh; }
.glass-sidebar { position: sticky; top: 20px; height: calc(100vh - 40px); padding: 18px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; color: inherit; text-decoration: none; border: 0; background: transparent; width: 100%; text-align: left; }
.side-link:hover { background: rgba(var(--nx-accent-rgb), .12); color: inherit; }
.side-link.active { background: var(--nx-accent); color: var(--nx-on-accent); }
.side-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--nx-muted); margin: 14px 12px 4px; }
.side-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.hello { font-size: 1.9rem; font-weight: 700; letter-spacing: -.01em; }
.view-glass .dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gcard { position: relative; padding: 16px; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 12px; transition: transform .12s; }
a.gcard:hover { transform: translateY(-2px); color: inherit; }
.gcard[data-size="l"] { grid-column: span 2; }
.gcard .project-icon { width: 46px; height: 46px; border-radius: 14px; color: #fff;
    background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #000)); box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 35%, transparent); }
.gcard .project-icon img { background: #fff; }
.g-metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.g-chip { font-size: .78rem; padding: 4px 10px; border-radius: 99px; background: rgba(var(--nx-accent-rgb), .1); color: inherit; text-decoration: none; }
[data-bs-theme="dark"] .g-chip { background: rgba(255, 255, 255, .06); }
.g-chip b { font-weight: 600; }
.g-big { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.g-big small { font-size: .85rem; color: var(--nx-muted); font-weight: 500; }
@media (max-width: 991px) {
    .glass-layout { grid-template-columns: 1fr; padding: 12px; }
    .glass-sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .glass-sidebar .side-title { display: none; }
    .glass-sidebar .side-link { width: auto; }
    .side-bottom { margin-top: 0; margin-left: auto; flex-direction: row; flex-wrap: wrap; }
}

@media (max-width: 575px) {
    .tile[data-size="l"], .gcard[data-size="l"] { grid-column: span 1; }
    .tile[data-size="l"] .tile-metrics { grid-template-columns: 1fr 1fr; }
    .view-compact .dash-grid { grid-template-columns: 1fr 1fr; }
}
