:root {
  --app-bg: #15171a;
  --app-surface: #202327;
  --app-surface-2: #292d32;
  --app-border: #3a3f45;
  --app-text: #f5f6f7;
  --app-muted: #b8bec6;
  --app-accent: #ee7203;
  --app-accent-hover: #ff8518;
  --app-danger: #dc3545;
  --app-success: #198754;
  --app-radius: 14px;
  --app-shadow: 0 8px 28px rgba(0,0,0,.24);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--app-bg); }
body {
  margin: 0 !important;
  min-height: 100vh;
  background: var(--app-bg) !important;
  color: var(--app-text) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  line-height: 1.45;
  overflow-x: hidden;
}
body, input, select, textarea, button { font-size: 16px; }
a { color: inherit; }
img { max-width: 100%; height: auto; }

.mobile-container,
.container,
.box {
  width: min(100% - 24px, 860px) !important;
  max-width: 860px !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 18px auto !important;
  padding: 18px !important;
  background: var(--app-surface) !important;
  color: var(--app-text) !important;
  border: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius) !important;
  box-shadow: var(--app-shadow);
}
.mobile-container > .container,
.mobile-container > .box,
.mobile-container .container {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  box-shadow: none;
}

.topnav {
  position: relative !important;
  overflow: hidden !important;
  margin: -18px -18px 18px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--app-border) !important;
  border-radius: var(--app-radius) var(--app-radius) 0 0 !important;
  background: #0f1012 !important;
}
.topnav a {
  min-height: 54px;
  display: flex !important;
  align-items: center;
  padding: 14px 18px !important;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 17px !important;
  text-align: left !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}
.topnav > a.active {
  padding-right: 66px !important;
  background: var(--app-accent) !important;
  font-weight: 700;
}
.topnav a.icon {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 56px;
  height: 54px;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.22) !important;
  border-left: 1px solid rgba(255,255,255,.15) !important;
  border-bottom: 0 !important;
}
.topnav #myLinks { display: none; background: #17191c; }
.topnav #myLinks a { min-height: 50px; }
.topnav #myLinks a:hover,
.topnav #myLinks a:focus-visible { background: var(--app-surface-2) !important; }

.news_container {
  padding: 0 !important;
  background: transparent !important;
  color: var(--app-text) !important;
  border-radius: 0 !important;
}
.news_datum {
  margin: 14px 0 8px !important;
  padding: 11px 13px !important;
  background: #101214 !important;
  color: var(--app-text) !important;
  border-left: 4px solid var(--app-accent);
  border-radius: 8px !important;
}
.news_list {
  margin: 0 0 18px !important;
  padding: 14px !important;
  width: 100% !important;
  background: var(--app-surface-2) !important;
  color: var(--app-text) !important;
  border: 1px solid var(--app-border);
  border-radius: 10px !important;
}
.news_container img { border-radius: 10px; }

h1, h2, h3 { color: var(--app-text) !important; line-height: 1.2; }
h1 { font-size: clamp(1.55rem, 5vw, 2rem); }
h2 { font-size: clamp(1.3rem, 4.5vw, 1.65rem); }
h3 { font-size: 1.15rem; }
p, label, td, th, li, div { overflow-wrap: anywhere; }

form { width: 100%; }
label { display: block; margin: 0 0 6px; font-weight: 600; }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea,
.select-css {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 48px;
  margin: 7px 0 12px !important;
  padding: 11px 12px !important;
  border: 1px solid #59616a !important;
  border-radius: 9px !important;
  background-color: #fff !important;
  color: #17191c !important;
  font: inherit !important;
  line-height: 1.25;
  box-shadow: none !important;
}
textarea { min-height: 130px; resize: vertical; }
input[readonly] { background: #e8eaed !important; color: #444 !important; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(238,114,3,.42) !important;
  outline-offset: 2px;
}
input[type="checkbox"], input[type="radio"] {
  width: 22px;
  height: 22px;
  margin: 8px 8px 8px 0;
  vertical-align: middle;
  accent-color: var(--app-accent);
}

button,
input[type="submit"],
input[type="button"],
.button_liste,
.upload-btn,
.toggle-btn,
.delete-btn {
  min-height: 48px !important;
  max-width: 100%;
  padding: 12px 16px !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: #08090a !important;
  color: #fff !important;
  font: inherit !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  cursor: pointer;
  touch-action: manipulation;
}
input[type="submit"], .button_liste { width: 100% !important; }
button:hover, input[type="submit"]:hover, .button_liste:hover { background: #32363b !important; }
.delete-btn { background: var(--app-danger) !important; }
.upload-btn { background: var(--app-accent) !important; }

/* Tabellen bleiben auf kleinen Geräten bedienbar. */
table {
  width: 100% !important;
  max-width: 100%;
  border-collapse: collapse !important;
  color: var(--app-text) !important;
}
th, td {
  padding: 10px !important;
  border-color: var(--app-border) !important;
}
th { background: #111315 !important; color: #fff !important; }
tr[style*="background-color:#D8D8D8"],
tr[style*="background-color: #D8D8D8"] { background: #eef0f2 !important; color: #15171a !important; }
tr[style*="background-color:#D8D8D8"] td,
tr[style*="background-color: #D8D8D8"] td { color: #15171a !important; }

/* Urlaubsformular: eigene responsive Darstellung statt Mini-Tabelle. */
.urlaub-form-table { border: 0 !important; }
.urlaub-form-table .select-css {
  display: inline-block;
  width: auto !important;
  min-width: 84px;
  margin-right: 4px !important;
}
.urlaub-form-table input[name^="arbeit_"] { max-width: 140px !important; }

/* Listen/Kontakte */
#container { width: 100%; }
#container ul { margin: 0; padding: 0; list-style: none; }
#container ul a { color: inherit; text-decoration: none; }
#container ul a li,
li.clearfix {
  min-height: 72px !important;
  height: auto !important;
  margin: 0 0 10px !important;
  padding: 12px !important;
  display: flex !important;
  align-items: center;
  gap: 10px;
  background: #f4f5f6 !important;
  color: #24272b !important;
  border: 1px solid #d7dade !important;
  border-radius: 10px !important;
}
#container ul li h2, li.clearfix h2 { color: #24272b !important; font-size: 1rem !important; }
#container ul li p.desc, li.clearfix .desc { color: #5f6770 !important; font-size: .92rem !important; white-space: normal !important; line-height: 1.3 !important; }
#container ul li .price, li.clearfix .price { position: static !important; margin-left: auto !important; font-size: .95rem !important; }
.thumbnail { flex: 0 0 auto; }

/* Popups / Modals */
.popup,
.modal-content,
#uploadModal {
  width: min(92vw, 640px) !important;
  max-width: 640px !important;
  max-height: 86vh !important;
  overflow: auto !important;
  padding: 18px !important;
  background: var(--app-surface) !important;
  color: var(--app-text) !important;
  border: 1px solid var(--app-border) !important;
  border-radius: 14px !important;
  box-shadow: var(--app-shadow) !important;
}
.popup img { max-width: 110px !important; border-radius: 8px; }

.success, .error, .error-box, .popup-message, .test {
  width: 100%;
  padding: 13px 14px !important;
  margin: 10px 0 !important;
  border-radius: 9px !important;
}

@media (max-width: 640px) {
  .mobile-container,
  .container,
  .box {
    width: 100% !important;
    margin: 0 !important;
    padding: 14px !important;
    border-left: 0 !important;
    border-right: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .topnav {
    margin: -14px -14px 16px !important;
    border-radius: 0 !important;
    position: sticky !important;
    top: 0;
    z-index: 100;
  }
  .news_list { padding: 12px !important; }

  /* Allgemeine Datentabellen: horizontal scrollbar statt abgeschnittener Inhalte. */
  table:not(.urlaub-form-table) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .urlaub-form-table,
  .urlaub-form-table tbody,
  .urlaub-form-table tr,
  .urlaub-form-table td,
  .urlaub-form-table th {
    display: block !important;
    width: 100% !important;
  }
  .urlaub-form-table tr {
    padding: 7px 0;
    border-bottom: 1px solid var(--app-border);
  }
  .urlaub-form-table td,
  .urlaub-form-table th {
    border: 0 !important;
    padding: 7px 10px !important;
  }
  .urlaub-form-table .select-css {
    width: 100% !important;
    display: block;
    margin: 6px 0 !important;
  }
  .urlaub-form-table input[name^="arbeit_"] { max-width: 100% !important; }

  form > button,
  form > input[type="submit"],
  .modal-actions button { width: 100% !important; margin-top: 8px; }

  .popup img { width: calc(50% - 14px) !important; max-width: none !important; margin: 6px !important; }
}

@media (min-width: 641px) {
  body { padding: 18px 0; }
}
