/* ══════════════════════════════════════════════════════════════════
   „Rund um den Job“ – DIHAG Foundry Group Corporate Design
   Azurblau #17509E · Navy #1A2644 · Anthrazit #424241
   Lichtblau #99B7CD · Orange #F08300 · Schrift: Exo
   ══════════════════════════════════════════════════════════════════ */

:root {
  --azur:      #17509E;
  --navy:      #1A2644;
  --anthrazit: #424241;
  --lichtblau: #99B7CD;
  --orange:    #F08300;

  --azur-dark: #113f7c;
  --bg:        #f2f5f9;
  --card:      #ffffff;
  --text:      var(--anthrazit);
  --muted:     #6d7d8e;
  --border:    #d7e0ea;
  --border-2:  #eaeff5;
  --green:     #1e7e34;
  --green-bg:  #e6f4ea;
  --red:       #b02a37;
  --red-bg:    #fdecea;
  --radius:    12px;
  --shadow:    0 1px 2px rgba(26,38,68,.06), 0 4px 16px rgba(26,38,68,.06);
  --shadow-h:  0 2px 6px rgba(26,38,68,.10), 0 12px 28px rgba(26,38,68,.13);
  --maxw:      1180px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Exo", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--azur); }

[hidden] { display: none !important; }

/* ── Boot / Anmeldung ─────────────────────────────────────────────── */

#boot {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(160deg, var(--navy) 0%, #10182b 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  color: #fff; text-align: center; padding: 24px;
}
#boot .boot-logo {
  background: #fff; border-radius: 14px; padding: 20px 34px;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
}
#boot .boot-logo img { display: block; height: 46px; }
#boot .boot-sub {
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--lichtblau);
}
#boot .spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.18); border-top-color: var(--orange);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#bootTxt { font-size: 14px; color: rgba(255,255,255,.8); }
#bootErr {
  max-width: 460px; font-size: 14px; color: #ffd7d2;
  background: rgba(176,42,55,.25); border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px; padding: 12px 16px;
}

/* ── Kein Zugriff ─────────────────────────────────────────────────── */

#noAccess {
  position: fixed; inset: 0; z-index: 9998;
  background: linear-gradient(160deg, var(--navy) 0%, #10182b 100%);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
#noAccess .box {
  max-width: 460px; text-align: center; padding: 40px 36px;
  background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
#noAccess h2 { margin: 12px 0 8px; font-size: 22px; color: var(--navy); }
#noAccess p { color: var(--muted); font-size: 14px; }

/* ── Kopfbereich ──────────────────────────────────────────────────── */

header { background: var(--navy); color: #fff; }

.hdr-top {
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px 22px; display: flex; align-items: center; gap: 18px;
}
.hdr-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.hdr-brand img {
  height: 34px; display: block;
  filter: brightness(0) invert(1);   /* dunkles Logo → weiß auf Navy */
}
.hdr-sep { width: 1px; height: 26px; background: rgba(255,255,255,.25); }
.hdr-title { min-width: 0; }
.hdr-title h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.hdr-title span {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--lichtblau);
}
.hdr-spacer { flex: 1; }

.hdr-user { display: flex; align-items: center; gap: 12px; }
.hdr-user .who { text-align: right; line-height: 1.25; }
.hdr-user .who b { display: block; font-size: 14px; font-weight: 600; }
.hdr-user .who small { font-size: 11.5px; color: var(--lichtblau); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: var(--azur); color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border: 2px solid rgba(255,255,255,.3);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.ges-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600;
}
.ges-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }

/* ── Reiter-Navigation ──────────────────────────────────────────────
   Wie die SharePoint-Websitenavigation: heller Streifen unter dem
   Kopfbereich, aktiver Punkt mit Unterstrich. Kein Scrollbalken – was
   nicht in die Breite passt, wandert hinter „⋯ Mehr“ (siehe layoutTabs
   in js/app.js).                                                      */

nav.tabs { background: #fff; border-bottom: 1px solid var(--border); }
nav.tabs .inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 22px;
  display: flex; align-items: stretch; gap: 2px;
  overflow: hidden;            /* nie scrollen – Überzähliges wird ausgeblendet */
}
nav.tabs button {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  color: var(--navy); font-family: inherit; font-size: 13.5px;
  padding: 13px 11px 10px; white-space: nowrap;
  border-bottom: 3px solid transparent; display: flex; align-items: center; gap: 7px;
  transition: background .12s, border-color .12s;
}
nav.tabs button:hover { background: #eef3f9; }
nav.tabs button.active { font-weight: 700; border-bottom-color: var(--orange); }
nav.tabs button .ico { font-size: 16px; line-height: 1; }
nav.tabs button[hidden] { display: none !important; }

/* „⋯ Mehr“ mit Ausklappmenü */
.tab-more { position: relative; display: flex; margin-left: auto; }
.tab-more > button { color: var(--muted); }
.tab-more > button.active { color: var(--navy); }
.tab-menu {
  position: absolute; top: 100%; right: 0; z-index: 300;
  background: #fff; border: 1px solid var(--border); border-top: 0;
  border-radius: 0 0 10px 10px; box-shadow: var(--shadow-h);
  min-width: 250px; padding: 6px; display: flex; flex-direction: column;
}
.tab-menu button {
  width: 100%; justify-content: flex-start; border-bottom: 0;
  border-radius: 7px; padding: 9px 12px; font-size: 14px;
}
.tab-menu button:hover { background: #eef3f9; }
.tab-menu button.active { font-weight: 700; background: #eaf1fa; }

/* ── Inhalt ───────────────────────────────────────────────────────── */

main { max-width: var(--maxw); margin: 0 auto; padding: 26px 22px 60px; }

.view { display: none; }
.view.active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 20px; }
.page-head h2 {
  margin: 0 0 4px; font-size: 26px; font-weight: 700; color: var(--navy);
  display: flex; align-items: center; gap: 10px;
}
.page-head p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 780px; }

h3.section {
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin: 30px 0 12px;
}
h3.section:first-child { margin-top: 0; }

/* ── Kacheln ──────────────────────────────────────────────────────── */

.tiles {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.tile {
  position: relative; display: flex; gap: 14px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform .13s, box-shadow .13s, border-color .13s;
}
a.tile:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-h);
  border-color: var(--lichtblau);
}
.tile .ti {
  width: 42px; height: 42px; flex: none; border-radius: 10px;
  background: #eaf1fa; color: var(--azur);
  display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.tile .tb { min-width: 0; flex: 1; }
.tile .tb b {
  display: block; font-size: 15px; font-weight: 600; color: var(--navy);
  margin-bottom: 3px;
}
.tile .tb p { margin: 0; font-size: 13.5px; color: var(--muted); }
.tile .arrow { color: var(--lichtblau); font-size: 16px; align-self: center; }
a.tile:hover .arrow { color: var(--orange); }

.badge {
  position: absolute; top: -8px; right: 12px;
  background: var(--orange); color: #fff; font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}

/* Textkachel (Typ = text) */
.tile.text-tile { display: block; }
.tile.text-tile .tb b { font-size: 16px; margin-bottom: 8px; }
.tile.text-tile .body { font-size: 14px; color: var(--text); white-space: pre-wrap; }
.card-wide { grid-column: 1 / -1; }

/* ── Karten / Panels ──────────────────────────────────────────────── */

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.card > h4 {
  margin: 0 0 14px; font-size: 16px; color: var(--navy);
  display: flex; align-items: center; gap: 8px;
}

.empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
  background: var(--card); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty .big { font-size: 42px; margin-bottom: 10px; }

.hint {
  font-size: 13px; color: var(--muted);
  background: #f7fafd; border-left: 3px solid var(--lichtblau);
  padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 0 0 14px;
}
.warn {
  font-size: 13.5px; color: #7a4a00;
  background: #fdf4e6; border-left: 3px solid var(--orange);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 0 0 16px;
}
.err {
  font-size: 13.5px; color: var(--red);
  background: var(--red-bg); border-left: 3px solid var(--red);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 0 0 16px;
}
.ok {
  font-size: 13.5px; color: var(--green);
  background: var(--green-bg); border-left: 3px solid var(--green);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 0 0 16px;
}

/* ── Start: Profil + Intranet ─────────────────────────────────────── */

.split { display: grid; gap: 16px; grid-template-columns: 1.15fr .85fr; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; } }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 7px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; color: var(--navy); }

.people { display: flex; flex-direction: column; gap: 10px; }
.person {
  display: flex; align-items: center; gap: 11px; text-decoration: none;
  color: inherit; padding: 7px 9px; border-radius: 9px;
}
.person:hover { background: #f2f6fb; }
.person .avatar { width: 34px; height: 34px; font-size: 12.5px; border: 0; }
.person .pn { min-width: 0; }
.person .pn b { display: block; font-size: 14px; font-weight: 600; color: var(--navy); }
.person .pn small { color: var(--muted); font-size: 12.5px; }

.news { display: flex; flex-direction: column; gap: 2px; }
.news a {
  display: flex; gap: 11px; align-items: baseline; padding: 9px 8px;
  border-radius: 9px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border-2);
}
.news a:last-child { border-bottom: 0; }
.news a:hover { background: #f2f6fb; }
.news .nt { font-size: 14px; font-weight: 600; color: var(--navy); flex: 1; }
.news .nd { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ── Buttons / Formulare ──────────────────────────────────────────── */

.btn {
  appearance: none; font-family: inherit; font-size: 14px; font-weight: 600;
  border-radius: 8px; padding: 8px 16px; cursor: pointer; border: 1px solid transparent;
  background: var(--azur); color: #fff; transition: background .12s, box-shadow .12s;
}
.btn:hover { background: var(--azur-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sec { background: #fff; color: var(--azur); border-color: var(--border); }
.btn.sec:hover { background: #f2f6fb; }
.btn.warn-btn { background: var(--orange); }
.btn.warn-btn:hover { background: #cf7100; }
.btn.danger { background: #fff; color: var(--red); border-color: #f0c8cc; }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { font-size: 13px; padding: 5px 11px; }
.btn.ghost {
  background: transparent; color: #fff; border-color: rgba(255,255,255,.4);
  font-weight: 500;
}
.btn.ghost:hover { background: rgba(255,255,255,.15); }

.row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }

label.f { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }

input[type=text], input[type=number], input[type=date], input[type=url], select, textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--text);
  padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--azur); box-shadow: 0 0 0 3px rgba(23,80,158,.12);
}
textarea { min-height: 80px; resize: vertical; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid2 .span2, .grid3 .span3 { grid-column: 1 / -1; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.chk input { width: auto; }

/* ── Tabellen (Einstellungen) ─────────────────────────────────────── */

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
table.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
table.tbl tr:hover td { background: #f7fafd; }
table.tbl td.actions { white-space: nowrap; text-align: right; }
table.tbl .off { opacity: .45; }

.pill {
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px;
  border-radius: 999px; background: #eaf1fa; color: var(--azur);
}
.pill.gray  { background: #eef1f4; color: var(--muted); }
.pill.orange{ background: #fdf0dd; color: #8a4c00; }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.navy  { background: #e3e7ef; color: var(--navy); }

/* ── Einstellungen: Unterreiter ───────────────────────────────────── */

.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; }
.subnav button {
  appearance: none; font-family: inherit; font-size: 13.5px; cursor: pointer;
  background: #fff; border: 1px solid var(--border); color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-weight: 600;
}
.subnav button:hover { border-color: var(--lichtblau); color: var(--azur); }
.subnav button.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ── Modal ────────────────────────────────────────────────────────── */

.modal-bg {
  position: fixed; inset: 0; z-index: 500; background: rgba(26,38,68,.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 18px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 660px;
  box-shadow: 0 24px 70px rgba(0,0,0,.35); overflow: hidden;
}
.modal .mh {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff;
}
.modal .mh h4 { margin: 0; font-size: 17px; }
.modal .mh .x {
  appearance: none; background: transparent; border: 0; color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.modal .mb { padding: 20px 22px; }
.modal .mf {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 9px; background: #f7fafd;
}

/* ── Fußzeile ─────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border); background: #fff;
  padding: 18px 22px; text-align: center; font-size: 12.5px; color: var(--muted);
}
footer a { color: var(--azur); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Toast ────────────────────────────────────────────────────────── */

#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 900;
}
#toast.err-t { background: var(--red); }

@media (max-width: 640px) {
  .hdr-top { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .hdr-user .who { display: none; }
  main { padding: 20px 16px 48px; }
  .page-head h2 { font-size: 22px; }
}

@media print {
  header, nav.tabs, footer, .btn { display: none !important; }
}
