/* ==========================================================================
   Minimal Reset
   ========================================================================== */
* { box-sizing: border-box; }

html,
body {
  height: 100%;
  overflow-x: hidden;
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", Helvetica, Arial;
  color: #111;
  background: #f6f7f8;
}

h1, h2, h3, h4, h5 {
  margin: 0 0 .6em;
  line-height: 1.2;
}

p { margin: .5em 0; }

img {
  max-width: 100%;
  height: auto;
  border: 0;
}

/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --link: #1f8dd6;
  --link-hover: #1573ad;
  --accent: #1f8dd6;
  --accent-700: #1573ad;
  --danger: #d73e48;
  --success: #1aaa55;
  --focus: #1f8dd6;

  --sidebar-width: 260px;
  --topbar-height: 52px;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.app {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

/* Sidebar */
.sidebar {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  background: #0b0c0e;
  color: #fff;
  padding: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  z-index: 20;
}

/* Main */
.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 20px;
}

/* ==========================================================================
   Sidebar / Navigation
   ========================================================================== */
.brand {
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .3px;
  margin: 4px 0 14px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: #fff;
  text-decoration: none;
  border-radius: 2px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  border: 1px solid transparent;
}

.nav a:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
  text-decoration: none;
}

.nav a:focus {
  outline: 2px solid #1f8dd6;
  outline-offset: 2px;
}

.nav .active {
  background: #111827;
  border-color: rgba(255,255,255,.12);
}

/* Kleine Anpassungen für Buttons in der Sidebar */
.sidebar .btn,
.sidebar .pure-button {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.25);
}

.sidebar .btn:hover,
.sidebar .pure-button:hover {
  background: rgba(255,255,255,.08);
}

/* ==========================================================================
   Topbar / Mobile Navigation
   ========================================================================== */
.topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-height);
  padding: 0 12px;
  background: #0b0c0e;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.topbar .brand {
  margin: 0;
  font-size: 16px;
}

/* Burger-Button */
#burgerBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  padding: 0;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 2px;
  cursor: pointer;
}

#burgerBtn:hover {
  background: rgba(255,255,255,.09);
}

#burgerBtn:focus {
  outline: 2px solid #1f8dd6;
  outline-offset: 2px;
}

.burger-icon {
  width: 20px;
  height: 2px;
  background: #fff;
  position: relative;
  display: block;
}

.burger-icon::before,
.burger-icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #fff;
}

.burger-icon::before { top: -6px; }
.burger-icon::after  { top:  6px; }

/* Backdrop */
.backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 30;
}

.backdrop.show {
  display: block;
}

/* Mobile */
@media (max-width: 900px) {
  .topbar {
    display: flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: var(--topbar-height);
    bottom: 0;
    height: auto;
    flex: none;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 35;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 16px;
  }
}

/* ==========================================================================
   Grid (Pure.css-ähnliche Utilities)
   ========================================================================== */
.pure-g {
  letter-spacing: -.31em;
  text-rendering: optimizeSpeed;
}

.pure-g > [class*="pure-u"] {
  display: inline-block;
  letter-spacing: normal;
  vertical-align: top;
}

.pure-u-1   { width: 100%; }
.pure-u-1-2 { width: 50%; }
.pure-u-1-3 { width: 33.3333%; }
.pure-u-2-3 { width: 66.6667%; }
.pure-u-1-4 { width: 25%; }
.pure-u-3-4 { width: 75%; }

@media (max-width: 700px) {
  .pure-u-sm-1 { width: 100% !important; }
}

/* ==========================================================================
   Cards, Tables
   ========================================================================== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 12px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fafc;
}

.table th,
.table td {
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: #f8fafc;
  font-weight: 600;
}

.table tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 700px) {
  .table {
    min-width: 700px;
  }
}

/* ==========================================================================
   Links
   ========================================================================== */
a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.input,
.select,
.textarea,
.pure-input,
.pure-select,
.pure-textarea {
  width: 100%;
  padding: 5px 10px;
  line-height: 1.2;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  border-radius: 2px;
}

.input:focus,
.select:focus,
.textarea:focus,
.pure-input:focus,
.pure-select:focus,
.pure-textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.textarea,
.pure-textarea {
  min-height: 90px;
  resize: vertical;
}

.form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.form-row > * {
  flex: 1 1 180px;
  min-width: 0;
}

.u-full-width {
  width: 100% !important;
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}

.help {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 700px) {
  .input,
  .select,
  .textarea,
  .pure-input,
  .pure-select,
  .pure-textarea {
    padding: 4px 10px;
    line-height: 1.2;
  }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn,
.pure-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
}

.btn:hover,
.pure-button:hover {
  background: var(--accent-700);
  border-color: var(--accent-700);
  text-decoration: none;
}

.btn.small {
  padding: 5px 10px;
  font-size: 13px;
  background-color: var(--accent);
}

.btn.outline {
  background: transparent;
  color: var(--accent);
}

.btn.primary,
.pure-button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover,
.pure-button-primary:hover {
  background: var(--accent-700);
  border-color: var(--accent-700);
}

.btn.success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.btn.success:hover {
  filter: brightness(.95);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn.danger:hover {
  filter: brightness(.95);
}

/* ==========================================================================
   Alerts / Status
   ========================================================================== */
.alert {
  border: 1px solid var(--border);
  background: #fff;
  padding: 10px;
  border-radius: 2px;
}

.alert.info {
  border-color: #cde3f7;
  background: #eef6fd;
}

.alert.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #991b1b;
}

.status-line {
  margin: 6px 0;
}

.status-line.ok {
  color: var(--success);
}

.status-line.bad {
  color: var(--danger);
}

/* ==========================================================================
   Details / Summary
   ========================================================================== */
details > summary {
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  color: var(--link);
}

details > summary::marker,
details > summary::-webkit-details-marker {
  display: none;
}

/* ==========================================================================
   Login
   ========================================================================== */
.login-card {
  max-width: 460px;
  margin: 0 auto;
}

.login-info {
  margin-top: 10px;
}

@media (max-width: 600px) {
  .login-card {
    max-width: 100%;
    padding: 12px;
  }
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.modal[aria-hidden="false"] {
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1001;
}

.modal-card {
  position: relative;
  z-index: 1002;
  max-width: 680px;
  margin: 5vh auto;
  padding: 16px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 600px) {
  .modal-card {
    margin: 0;
    border-radius: 0;
    max-width: none;
    height: 100vh;
    max-height: 100vh;
  }
}

/* ==========================================================================
   Misc
   ========================================================================== */
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

code,
kbd,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.is-cancelled td {
  text-decoration: line-through;
  opacity: .65;
}

/* ==========================================================================
   Mobile Font Tweaks
   ========================================================================== */
@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .input,
  .select,
  .textarea,
  .pure-input,
  .pure-select,
  .pure-textarea {
    font-size: 16px;
  }
}