/* RWTH Corporate Design Farbpalette & Core Styles */
:root {
    --rwth-blue: #00549F;
    --rwth-blue-75: #407FB7;
    --rwth-black: #000000;
    --rwth-grey: #9C9E9F;
    --rwth-light-grey: #F3F4F5;
    --rwth-border: #D1D3D4;
    --text-color: #333333;
    --success-green: #57AB27;
}

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--rwth-light-grey);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header & Typografie */
h1 {
    color: var(--rwth-blue);
    font-size: 2.25rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.5rem;
    border-bottom: 3px solid var(--rwth-blue);
    padding-bottom: 0.5rem;
}

.subtitle {
    color: var(--rwth-grey);
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 2rem;
}

h2 {
    color: var(--rwth-blue);
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-weight: 600;
}

/* Dashboard Grid & Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    padding: 1.25rem;
    border-left: 4px solid var(--rwth-blue);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 2px;
}

.stat-card.disabled-card {
    border-left-color: var(--rwth-grey);
}

.stat-card h3 {
    margin: 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--rwth-grey);
    letter-spacing: 0.5px;
}

.stat-card .number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-color);
    margin-top: 0.25rem;
}

.card {
    background: #ffffff;
    border: 1px solid var(--rwth-border);
    border-radius: 2px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Formular-Styling (Klassisch Rechteckig) */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-color);
}

input[type="text"],
input[type="email"],
input[type="password"], /* <-- Das hat gefehlt! */
select {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.6rem 0.75rem; /* Das gibt die schöne Höhe über Innenabstand */
    border: 1px solid var(--rwth-border);
    background-color: #ffffff;
    color: var(--text-color);
    border-radius: 0; /* Strenger RWTH-Look ohne Rundungen */
    transition: border-color 0.2s;
    width: 100%; 
    box-sizing: border-box; 
}

input:focus, select:focus {
    outline: none;
    border-color: var(--rwth-blue);
}

.form-actions {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
}

.checkbox-label input {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--rwth-blue);
}

button[type="submit"] {
    background-color: var(--rwth-blue);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

button[type="submit"]:hover {
    background-color: #003768;
}

/* Tabellen-Styling (RWTH Minimalist) */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

th {
    background-color: var(--rwth-light-grey);
    color: var(--text-color);
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid var(--rwth-border);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--rwth-border);
    color: #444444;
}

tbody tr:hover {
    background-color: rgba(0, 84, 159, 0.03); /* Dezenter Hover-Effekt in RWTH-Blau */
}

.text-muted {
    color: var(--rwth-grey);
    font-style: italic;
}

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

.badge {
    background-color: var(--rwth-light-grey);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--rwth-border);
    font-size: 0.85rem;
}

/* Styling für Links im Inhalt, passend zum RWTH-Look */
a {
    color: var(--rwth-blue);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    color: #003768;
    text-decoration: underline;
}

/* Spezifische Status-Badges für Log-Einträge */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 0; /* Strenger RWTH-Look */
    background-color: var(--rwth-light-grey);
    border: 1px solid var(--rwth-border);
    color: var(--text-color);
}

.status-badge.status-success {
    background-color: #E8F5E9; /* Zartes Grün */
    border-color: var(--success-green);
    color: var(--success-green);
}

.status-badge.status-error {
    background-color: #FFEBEE; /* Zartes Rot */
    border-color: #CC071E; /* RWTH Rot-Ton für Warnungen */
    color: #CC071E;
}

/* RWTH Global Navigation Bar */
.rwth-navbar {
    background-color: var(--rwth-blue);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
    padding: 0;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-wrap: wrap; /* Verhindert Layout-Bugs auf kleineren Bildschirmen */
}

.nav-item {
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 500;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    display: inline-block;
    transition: background-color 0.15s ease;
    border-bottom: 4px solid transparent; /* Platzhalter für den aktiven Balken */
}

/* Hover-Effekt: Klassischer RWTH-Hellblau-Ton */
.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* Optionaler Bonus: Falls du der aktiven Seite im Backend die Klasse ".active" mitgibst */
.nav-item.active {
    background-color: #407FB7 !important; /* Offizielles RWTH-Hellblau für Fokus-Elemente */
    font-weight: 700;
    border-bottom: 4px solid #ffffff; /* Weißer Indikator-Balken unten */
}

/* Sub-Navigation für Typenfilter (Computer / Server) */
.subnav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--rwth-border);
    padding-bottom: 0.5rem;
}

.subnav a {
    color: var(--text-color) !important;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none !important;
    border: 1px solid transparent;
    transition: background-color 0.15s;
}

.subnav a:hover {
    background-color: rgba(0, 84, 159, 0.05);
}

.subnav a.active {
    background-color: var(--rwth-blue);
    color: #ffffff !important;
    font-weight: 600;
}

/* Styling für die ausklappbare Card */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin: -1.5rem; /* Gleicht das Padding der umschließenden .card aus */
    padding: 1.5rem;
}

.collapsible-header h2 {
    margin: 0; /* Verhindert Margin-Verschiebungen */
}

/* Der kleine Pfeil-Indikator */
.toggle-icon {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
    color: var(--rwth-blue);
}

/* Container für das Formular, der ein-/ausgefahren wird */
.collapsible-content {
    display: none; /* Standardmäßig eingeklappt */
    padding-top: 1.5rem; /* Abstand nach dem Header, wenn offen */
}

/* Wenn die Card aktiv/offen ist */
.card.expanded .toggle-icon {
    transform: rotate(180deg);
}

.card.expanded .collapsible-content {
    display: block;
}
/* Spezifisches Verhalten für den Logout-Button in der Navbar */
.nav-logout:hover {
    background-color: #CC071E !important;
    color: #ffffff !important;
}

.nav-form {
    margin-left: auto;
    display: inline-flex;
}

.card-link {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--rwth-blue);
    text-decoration: none;
    font-weight: 600;
}

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

.small-badge {
    font-size: 0.75rem;
}

/* Container, der Input und Suffix nebeneinander hält */
.input-suffix-group {
    display: flex;
    align-items: stretch; /* Zwingt beide Elemente auf exakt dieselbe Höhe */
    width: 100%;
}

/* Das Eingabefeld innerhalb der Gruppe */
.input-suffix-group input {
    flex: 1; /* Nutzt den gesamten verfügbaren Platz links aus */
    border-right: none !important; /* Entfernt den rechten Rahmen, wo das @-Zeichen andockt */
}

/* Das rechte Suffix-Feld (@lfi.rwth-aachen.de) */
.input-suffix-text {
    display: flex;
    align-items: center;
    background-color: var(--rwth-light-grey);
    color: var(--text-color);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0 0.75rem;
    border: 1px solid var(--rwth-border);
    border-left: 1px solid var(--rwth-border); /* Klarer Trennstrich zwischen Text und Suffix */
    white-space: nowrap; /* Verhindert Zeilenumbrüche innerhalb der Domain */
    user-select: none; /* Text ist beim Durchtabben nicht markierbar */
}

/* Fokus-Effekt: Wenn der User ins Feld klickt, färbt sich auch der Rahmen am Suffix blau */
.input-suffix-group input:focus + .input-suffix-text {
    border-color: var(--rwth-blue);
}
/* Login page layout */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--rwth-light-grey);
}

.login-wrapper {
    width: 100%;
    max-width: 450px;
    padding: 1rem;
}

.login-card {
    margin: 0;
}

.status-container {
    margin-bottom: 1.5rem;
    text-align: center;
}

.nowrap-cell {
    white-space: nowrap;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-secondary {
    color: var(--rwth-blue);
    border: 1px solid var(--rwth-blue);
    padding: 0.5rem 0.75rem;
    border-radius: 2px;
    text-decoration: none;
    font-weight: 600;
}

.btn-secondary:hover {
    background-color: rgba(0, 84, 159, 0.08);
}

.form-group-fullwidth {
    grid-column: 1 / -1;
}

input[readonly] {
    background-color: var(--rwth-light-grey);
    color: #555555;
    cursor: not-allowed;
}

.actions-cell {
    white-space: nowrap;
    width: 1%;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--rwth-blue);
    background-color: #ffffff;
    color: var(--rwth-blue);
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.icon-button svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: square;
    stroke-linejoin: miter;
}

.icon-button:hover {
    background-color: var(--rwth-blue);
    color: #ffffff;
}

.icon-button.danger {
    border-color: #CC071E;
    color: #CC071E;
}

.icon-button.danger:hover {
    background-color: #CC071E;
    color: #ffffff;
}

.inline-delete-form {
    display: inline-flex;
    margin: 0;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.35);
    z-index: 20;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(760px, 100%);
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    margin: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
}

.modal-actions {
    justify-content: flex-end;
}

button.btn-secondary {
    background-color: #ffffff;
    color: var(--rwth-blue);
    border: 1px solid var(--rwth-blue);
    padding: 0.65rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

button.btn-secondary:hover {
    background-color: rgba(0, 84, 159, 0.08);
}

.confirm-card {
    width: min(520px, 100%);
    border-top: 4px solid #CC071E;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
}

.confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid #CC071E;
    color: #CC071E;
    background-color: #FFEBEE;
}

.confirm-icon svg {
    width: 1.55rem;
    height: 1.55rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: square;
    stroke-linejoin: miter;
}

.confirm-content h2 {
    margin-bottom: 0.5rem;
    color: #CC071E;
}

.confirm-content p {
    margin: 0;
}

.confirm-actions {
    grid-column: 1 / -1;
    margin-top: 0.75rem;
}

.btn-danger {
    background-color: #CC071E;
    color: #ffffff;
    border: 1px solid #CC071E;
    padding: 0.65rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-danger:hover {
    background-color: #9B0014;
    border-color: #9B0014;
}

@media (max-width: 560px) {
    .confirm-card {
        grid-template-columns: 1fr;
    }

    .confirm-actions {
        justify-content: stretch;
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .confirm-actions button {
        width: 100%;
    }
}

.table-actions button.delete-computer-button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--rwth-blue);
    background-color: #ffffff;
    color: var(--rwth-blue);
}

.table-actions button.delete-computer-button[type="submit"] svg {
    stroke: currentColor;
}

.table-actions button.delete-computer-button[type="submit"]:hover {
    border: 1px solid #9B0014;
    background-color: #CC071E;
    color: #FFCDD2;
}

.table-actions button.delete-computer-button[type="submit"]:hover svg {
    stroke: currentColor;
}

.table-actions button.deactivate-user-button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--rwth-blue);
    background-color: #ffffff;
    color: var(--rwth-blue);
}

.table-actions button.deactivate-user-button[type="submit"] svg {
    stroke: currentColor;
}

.table-actions button.deactivate-user-button[type="submit"]:hover {
    border: 1px solid #9B0014;
    background-color: #CC071E;
    color: #FFCDD2;
}

.table-actions button.deactivate-user-button[type="submit"]:hover svg {
    stroke: currentColor;
}

.flash-message {
    background-color: #ffffff;
    border: 1px solid var(--rwth-border);
    border-left: 4px solid var(--rwth-blue);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
}

.flash-message strong {
    display: block;
    color: var(--rwth-blue);
    margin-bottom: 0.2rem;
}

.flash-message span {
    display: block;
    color: var(--text-color);
}

.flash-success {
    border-left-color: var(--success-green);
}

.flash-success strong {
    color: var(--success-green);
}

.flash-error {
    border-left-color: #CC071E;
}

.flash-error strong {
    color: #CC071E;
}

form.is-submitting button[type="submit"],
button[disabled] {
    cursor: wait;
    opacity: 0.72;
}

.workstation-edit-field[hidden] {
    display: none !important;
}
