/* dashboard.css: Dashboard: Übersicht, Dashlets, Raster, Kiosk-Modus. Teil der Weboberfläche, Reihenfolge siehe index.html. */

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dash { padding: 20px; display: grid; gap: 20px; }

/* eigene Dashboards: Raster mit 12 Spalten, Zeilen à 32 px (siehe internal/api/dashlayout.go) */
.board-grid { padding: 20px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 32px; gap: 16px; }
.board-grid > .dashlet { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.dashlet > h3 { flex: none; }
.dashlet > h3 > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashlet > h3 > a { flex: none; margin-left: auto; }
.dl-body { flex: 1; min-height: 0; overflow: auto; }
.dl-resize { display: none; position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 0 50%, var(--border-strong) 50% 58%, transparent 58% 70%, var(--border-strong) 70% 78%, transparent 78%); }
.board-grid.editing > .dashlet { outline: 2px dashed var(--border-strong); outline-offset: -2px; }
.board-grid.editing > .dashlet:focus-visible { outline: 2px solid var(--accent); }
.board-grid.editing > .dashlet > h3 { cursor: grab; user-select: none; touch-action: none; background: var(--panel-2); }
.board-grid.editing .dl-body { pointer-events: none; opacity: .65; }
.board-grid.editing .dl-resize { display: block; }
.board-grid.editing > .dashlet.dragging { z-index: 5; box-shadow: var(--shadow-lg); outline-color: var(--accent); }
.board-grid.editing > .dashlet.dragging > h3 { cursor: grabbing; }
.layout-hint { color: var(--muted); }
.tab-menu { align-self: center; width: 22px; height: 26px; margin-left: -6px; border: 0; border-radius: var(--radius); background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.tab-menu:hover, .tab-menu:focus-visible { background: var(--row-hover); color: var(--text); }

/* Dashboards im Vollbild (Kiosk): kein Menü, kein Detail, nur Anzeige */
body.kiosk #sidebar, body.kiosk .resizer, body.kiosk #col-detail { display: none !important; }
body.kiosk #main { height: 100vh; }
body.kiosk .board-grid { padding: 16px 20px; }
body.kiosk .dashlet .dl-menu, body.kiosk .dashlet > h3 > a { display: none; }
body.kiosk table.list tr.row { cursor: default; }
body.kiosk table.list tr.row:hover { background: none; }
body.kiosk .sticky-pin { pointer-events: none; }
.kiosk-bar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--border); }
.kiosk-bar b { font-size: 17px; font-weight: 650; }
.kiosk-clock { margin-left: auto; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); }
.kiosk-live { font-size: 12px; color: var(--muted); }
.kiosk-live:empty { display: none; }
.kiosk-error { display: grid; gap: 6px; place-content: center; height: 100vh; text-align: center; color: var(--muted); }
.kiosk-error b { font-size: 20px; color: var(--text); }
.link-copy { display: flex; gap: 6px; }
.link-copy input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--panel-2); font: 12px var(--mono); }

/* Menü-Knopf der Dashlets (⋮): bei Hover/Fokus, auf Touch-Geräten immer */
.dl-menu { flex: none; width: 26px; height: 24px; margin: -4px -8px -4px 0; border: 0; border-radius: var(--radius); background: none; color: var(--muted);
  font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s, background .12s; }
.dashlet:hover .dl-menu, .dl-menu:focus-visible, .dl-menu[aria-expanded="true"] { opacity: 1; }
.dl-menu:hover { background: var(--row-hover); color: var(--text); }
@media (hover: none) { .dl-menu { opacity: 1; } }
.board-grid.editing .dl-menu { display: none; }

/* Kontextmenü */
#ctxmenu { position: fixed; z-index: 80; min-width: 180px; padding: 4px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 10px 30px rgba(15, 23, 42, .2); display: grid; }
#ctxmenu[hidden] { display: none; }
#ctxmenu button { text-align: left; padding: 7px 12px; border: 0; border-radius: var(--radius); background: none; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
#ctxmenu button:hover, #ctxmenu button:focus-visible { background: var(--row-hover); outline: none; }
#ctxmenu button.danger { color: var(--critical); }
#ctxmenu button.danger:hover, #ctxmenu button.danger:focus-visible { background: var(--critical-soft); }
#ctxmenu .ctx-sep { height: 1px; margin: 4px 6px; background: var(--border); }
/* Zählerkacheln */
.count-tile { display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px 16px; padding: 6px 12px; text-align: center; }
.count-tile .cnt { display: flex; flex-direction: column; text-decoration: none; min-width: 52px; }
.count-tile .cnt b { font-size: 26px; font-weight: 650; line-height: 1.1; letter-spacing: -.5px; }
.count-tile .cnt small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.count-tile .cnt.zero b { color: var(--border-strong); }
.count-tile .cnt-unhandled { flex-basis: 100%; font-size: 12px; font-weight: 600; color: var(--critical); text-decoration: none; }
@media (max-width: 760px) {
  .board-grid { grid-template-columns: 1fr; grid-auto-rows: auto; padding: 16px; }
  .board-grid > .dashlet { grid-column: 1 !important; grid-row: auto !important; max-height: 70vh; }
}
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tile { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; background: var(--panel); box-shadow: var(--shadow); }
.tile h3 { margin: 0 0 12px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); }
.tile .bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--border); margin-bottom: 14px; }
.tile .bar span { display: block; }
.tile .nums { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.tile .nums a { text-decoration: none; display: flex; flex-direction: column; border-radius: var(--radius); }
.tile .nums a:hover small { color: var(--text); }
.tile .nums b { font-size: 26px; font-weight: 650; line-height: 1.1; letter-spacing: -.5px; }
.tile .nums small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--panel); box-shadow: var(--shadow); }
.panel > h3 { margin: 0; padding: 11px 16px; font-size: 13.5px; font-weight: 600; background: var(--panel); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel > h3 a { font-weight: 500; font-size: 12.5px; color: var(--accent); text-decoration: none; }
.panel > h3 a:hover { text-decoration: underline; }
.panel table.list tr:last-child td { border-bottom: 0; }
.c-ok { color: var(--ok); } .c-warning { color: var(--warning); } .c-critical, .c-down { color: var(--critical); }
.c-unknown { color: var(--unknown); } .c-pending { color: var(--pending); } .c-up { color: var(--ok); }
