@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

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

:root {
  --gelb: #f5d30c;
  --schwarz: #000;
  --grau: #737373;
  --hellgrau: #f5f5f5;
  --border: #e0e0e0;
  --rot: #e53e3e;
  --gruen: #38a169;
}

body {
  font-family: 'Montserrat', Arial, sans-serif;
  background: var(--hellgrau);
  color: var(--schwarz);
  min-height: 100vh;
}

/* HEADER */
.header {
  background: var(--schwarz);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.header-brand {
  color: var(--gelb);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
}
.header-brand span { color: #fff; font-weight: 400; }
.header-user {
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-user a {
  color: var(--grau);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
.header-user a:hover { color: var(--gelb); }

/* NAV */
.nav {
  background: var(--schwarz);
  border-bottom: 3px solid var(--gelb);
  display: flex;
  gap: 0;
  padding: 0 24px;
  overflow-x: auto;
}
.nav a {
  color: #ccc;
  text-decoration: none;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: color 0.2s, border-color 0.2s;
}
.nav a:hover { color: #fff; }
.nav a.active { color: var(--gelb); border-bottom-color: var(--gelb); }

/* MAIN */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
}
.page-subtitle {
  color: var(--grau);
  font-size: 13px;
  margin-top: 2px;
}

/* CARDS */
.card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  background: #fafafa;
}
.card-body { padding: 20px; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.85; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--gelb); color: var(--schwarz); }
.btn-danger { background: var(--rot); color: #fff; }
.btn-secondary { background: #e0e0e0; color: var(--schwarz); }
.btn-ghost { background: transparent; color: var(--grau); border: 1px solid var(--border); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-success { background: var(--gruen); color: #fff; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: #fafafa;
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--grau);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
tbody tr:hover { background: #fffde7; }
tbody tr:last-child { border-bottom: none; }
tbody td {
  padding: 10px 14px;
  font-size: 13px;
  vertical-align: middle;
}
.td-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* BADGES */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}
.badge-green { background: #c6f6d5; color: #276749; }
.badge-red { background: #fed7d7; color: #9b2c2c; }
.badge-yellow { background: #fefcbf; color: #744210; }
.badge-gray { background: #e2e8f0; color: #4a5568; }
.badge-blue { background: #bee3f8; color: #2a69ac; }

/* FORMS */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--schwarz);
}
.form-label .req { color: var(--rot); margin-left: 3px; }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  color: var(--schwarz);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--gelb);
  box-shadow: 0 0 0 3px rgba(245,211,12,0.2);
}
.form-hint { color: var(--grau); font-size: 12px; margin-top: 4px; }

/* CHECKBOXES */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--hellgrau);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s;
}
.checkbox-item input[type="checkbox"] { accent-color: var(--gelb); width: 15px; height: 15px; }
.checkbox-item:has(input:checked) { border-color: var(--gelb); background: #fffde7; }

/* FORM ROW */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* ALERT */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-error { background: #fed7d7; color: #742a2a; border-left: 4px solid var(--rot); }
.alert-success { background: #c6f6d5; color: #22543d; border-left: 4px solid var(--gruen); }
.alert-info { background: #fffde7; color: #744210; border-left: 4px solid var(--gelb); }

/* STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label { font-size: 12px; color: var(--grau); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--schwarz); }
.stat-sub { font-size: 12px; color: var(--grau); }

/* STATUS DOTS */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.online { background: var(--gruen); box-shadow: 0 0 4px var(--gruen); }
.status-dot.offline { background: var(--rot); }
.status-dot.unknown { background: var(--grau); }

/* LOGIN PAGE */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--schwarz);
  padding: 20px;
}
.login-box {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-header {
  background: var(--schwarz);
  padding: 32px;
  text-align: center;
  border-bottom: 4px solid var(--gelb);
}
.login-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--gelb);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.login-subtitle { color: #888; font-size: 12px; margin-top: 6px; }
.login-body { padding: 32px; }
.login-body .btn-primary { width: 100%; justify-content: center; padding: 12px; font-size: 14px; margin-top: 8px; }

/* SECTION DIVIDER */
.section-divider {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--grau);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
  margin-top: 24px;
}

/* PERMISSIONS GRID */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--grau);
}
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state-text { font-size: 15px; font-weight: 500; }

/* Responsive */
@media (max-width: 768px) {
  .main { padding: 20px 16px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .nav { padding: 0 12px; }
}
