/* Grundlayout */ 
body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background-color: #121212;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.logo-fixed {
    position: absolute;
    top: 18px;
    left: 20px;
    z-index: 1000;
}

.logo-small {
  width: 300px;
}

@media (max-width: 768px) {
  .logo-small {
    width: 160px;
  }
}

/* Box für Login, Registrierung, Admin-Form */
.login-box {
    width: 90%;
    max-width: 420px;
    background-color: #1e1e1e;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

/* Formularfelder mit Icon */
.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.8rem 0.8rem 0.8rem 2.2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    background-color: #2a2a2a;
    color: white;
    box-sizing: border-box;
}

/* Buttons */
button {
    width: 100%;
    padding: 0.8rem;
    background-color: #2979ff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

button:hover {
    background-color: #1565c0;
}

/* Erfolg / Fehler */
.success-msg {
    color: #66ff66;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.error-msg {
    color: #ff5252;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Link unter Formularen */
.register-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.register-link a {
    color: #2979ff;
    text-decoration: none;
}

/* Dashboard-Kacheln */
body.dashboard {
    display: block;
    background-color: #121212;
    color: #fff;
    font-family: system-ui, sans-serif;
}

.tiles-grid {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
    padding: 0 rem;
}

/* Mobil (Standard): 1 Spalte */
.tiles-grid {
    grid-template-columns: 1fr;
}

/* Ab 1024px: genau 6 Spalten */
@media (min-width: 1024px) {
    .tiles-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.dashboard-container {
    max-width: 1600px;
    margin: 0 auto;
    margin-top: 5rem;
    padding: 0 1rem;   
    box-sizing: border-box;
}

.tile {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Rechteckig */
    border-radius: 10px;
    overflow: hidden;
    background-color: #1e1e1e;
    box-shadow: 0 0 8px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.tile:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Buttons im Dashboard */
.top-right {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    z-index: 10;
}

.admin-button {
    background-color: #007bff;
    color: white;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.admin-button:hover {
    background-color: #0056b3;
}

.monitoring-button {
    background-color: #008000;
    color: white;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.monitoring-button:hover {
    background-color: #0056b3;
}


.logout-button {
    background-color: #c0392b;
    color: white;
    padding: 10px 16px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.logout-button:hover {
    background-color: #a93226;
}

/* Buttons auf kleinen Bildschirmen: Nur Icons anzeigen */
@media (max-width: 600px) {
    .admin-button,
    .logout-button {
        font-size: 0; /* Versteckt den Text */
        padding: 10px; /* kompakter */
    }

    .admin-button i,
    .logout-button i {
        font-size: 1.2rem;
        margin-right: 0; /* kein Abstand nötig */
    }
}

/* Benutzerverwaltung – Tabellenlayout */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 0.6rem;
    border-bottom: 1px solid #444;
    text-align: left;
}

th {
    background-color: #2a2a2a;
}

tr:hover {
    background-color: #1e1e1e;
}

button.edit-btn {
    background-color: #007bff;
    color: white;
}

button.delete-btn {
    background-color: #dc3545;
    color: white;
    margin-left: 0.3rem;
}

.action-btns form {
    display: inline;
}

.container {
    max-width: 960px;
    margin: auto;
    padding: 1rem;
}


/* Monitoring */
.vm-table-wrapper {
    overflow-x: auto;
}
.vm-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    background: #1e1e1e;
    color: #fff;
}
.vm-table th, .vm-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #444;
    text-align: left;
}
.vm-table th {
    background-color: #2a2a2a;
}
.vm-table tr:hover {
    background-color: #232323;
}
.status-on {
    color: #4caf50;
    font-weight: bold;
}
.status-off {
    color: #e74c3c;
    font-weight: bold;
}
.cell-graph, .cell-bar { min-width: 140px; }
.cell-graph canvas {
    display: block;
    margin: 0 auto 2px auto;
}
.cell-graph .value, .cell-bar .value {
    display: block;
    text-align: center;
    font-size: 0.98em;
}
.hdd-bar-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    margin: 6px auto 0 auto ;
}
.hdd-bar-outer {
    width: 120px;
    height: 25px;
    background: rgba(67,160,71,0.18);
    position: relative;
    overflow: hidden;
    margin-bottom: 4px;
}
.hdd-bar-outer.low-space-bg {
    background: rgba(231,76,60,0.18);
}
.hdd-bar-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    height: 100%;
    background: #43a047;
    z-index: 1;
    transition: width 0.5s, background 0.5s;
}
.hdd-bar-fill.low-space {
    background: #e74c3c;
}
.hdd-bar-label {
    position: absolute;
    left: 0; top: 0; width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 0.80em;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 1px 3px rgba(0,0,0,0.35);
    z-index: 2;
}
.hdd-bar-block .value {
    display: block;
    width: 160px;
    text-align: center;
    font-size: 0.98em;
}
#refresh-info {
    text-align: center;
    margin-bottom: 10px;
    color: #aaa;
}
