/* Ergänzungen für das Portal (Login, Tool-Rahmen, Verwaltung) */
html, body { height: 100%; }
.mh-app h1, .mh-app h2, .mh-app h3 { text-wrap: balance; }
.mh-appbar { padding-block: 10px; }
.mh-appbar-nav a { cursor: pointer; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.user-chip b { color: var(--ink); font-weight: 600; }

/* Formularfelder: einheitlicher Abstand, Hinweis sitzt im Feld */
form .mh-field, .mh-card .mh-field { margin-bottom: var(--space-4); }
.mh-field .mh-hint { margin-top: 6px; line-height: 1.4; }

/* Login: geteilte Ansicht – Baustellenfoto links, Anmeldung rechts */
.login-split { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); background: var(--paper); }
.login-hero { position: relative; overflow: hidden; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  padding: 32px 40px 40px; background: #01498a url("/static/login-baustelle.jpg") center 35% / cover no-repeat; isolation: isolate; }
.login-hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(1,73,138,.05) 0%, rgba(1,73,138,.10) 40%, rgba(1,40,80,.78) 78%, rgba(1,36,72,.92) 100%); }
.login-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: #01498a; z-index: -1; }
.login-hero .mh-logo-plate { padding: 8px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.login-hero .mh-logo-plate img { height: 46px; }
.login-hero-text { max-width: 34rem; }
.login-kicker { font-family: var(--font-label); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; font-size: 13px; opacity: .9; margin-bottom: 10px;
  display: inline-flex; align-items: center; gap: 10px; }
.login-kicker::before { content: ""; width: 28px; height: 3px; background: #fff; border-radius: 2px; }
.login-hero h2 { font-size: clamp(26px, 3vw, 38px); line-height: 1.15; margin: 0 0 12px; font-weight: 700; text-shadow: 0 2px 16px rgba(0,0,0,.25); }

.login-side { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 28px;
  padding-block: 32px; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 28px; }
.login-card h1 { font-size: 26px; line-height: 32px; margin: 4px 0 4px; }
.login-card > p { margin: 0 0 var(--space-5); color: var(--muted); font-size: 14px; }
.login-card .mh-btn-primary { width: 100%; justify-content: center; padding: 11px 13px; margin-top: var(--space-1); font-size: 14.5px; }
.login-card .login-help { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.login-address { font-style: normal; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.5; }
.login-address strong { color: var(--ink); font-weight: 700; }

@media (max-width: 860px) {
  .login-split { grid-template-columns: minmax(0, 1fr); }
  .login-hero { min-height: 280px; padding: 20px 20px 24px; background-image: url("/static/login-baustelle-s.jpg"); background-position: center 30%; }
  .login-hero .mh-logo-plate img { height: 34px; }
  .login-hero h2 { font-size: 22px; }
  .login-hero p { display: none; }
  .login-side { justify-content: flex-start; padding-block: 0 28px; }
  .login-card { margin-top: -28px; position: relative; }
}

/* Startseite */
.mh-app a.tool-card { display: flex; flex-direction: column; gap: 8px; min-height: 150px; text-decoration: none; color: var(--ink); }
.mh-app a.tool-card .mh-btn-primary { color: var(--on-meier-blau); }
.tool-card h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.tool-card p { margin: 0; font-size: 13.5px; color: var(--muted); flex: 1; }
.tool-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tool-card .foot span { font-size: 12px; color: var(--muted); }

/* Tool-Ansicht: schmale Leiste + Rahmen */
.tool-shell { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.tool-bar { display: flex; align-items: center; gap: 12px; padding: 6px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; }
.tool-bar .mh-logo-plate img { height: 20px; }
.tool-bar .mh-logo-plate { padding: 3px 6px; }
.tool-bar .back { font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 5px 8px; border-radius: var(--radius-md); }
.tool-bar .back:hover { background: var(--surface-2); color: var(--ink); }
.tool-bar .tname { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-frame { flex: 1; width: 100%; border: 0; background: var(--paper); }

/* Verwaltung */
.admin-tabs { display: flex; gap: 2px; margin-bottom: var(--space-5); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-tabs a { padding: 9px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.admin-tabs a[aria-current="page"] { color: var(--meier-blau); border-bottom-color: var(--meier-blau); }
.mh-table td .sub { display: block; font-size: 12px; color: var(--muted); }
.mh-table td.actions { white-space: nowrap; text-align: right; }
.perm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 8px 12px; align-items: center; }
.perm-grid .tn { font-size: 14px; }
.perm-grid .tn small { display: block; color: var(--muted); font-size: 12px; }
.mh-dialog { max-height: calc(100vh - 32px); overflow: auto; }
.mh-dialog.wide { width: min(640px, 100%); }
.mh-dialog .mh-field { margin-bottom: var(--space-3); }
.mh-dialog h3 { margin: var(--space-5) 0 var(--space-3); font-size: 15px; }
.audit-detail { font-size: 12px; color: var(--muted); word-break: break-word; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px;
  border-radius: var(--radius-md); font-size: 13.5px; font-weight: 600; z-index: 200; box-shadow: var(--shadow-card); max-width: calc(100% - 32px); }
.file-drop { border: 1.5px dashed var(--line-input); border-radius: var(--radius-md); padding: 14px; background: var(--surface-2); font-size: 13.5px; color: var(--muted); }
.file-drop input { margin-top: 8px; display: block; font: inherit; color: var(--ink); }
.empty-note { padding: 24px; text-align: center; color: var(--muted); }
@media (max-width: 640px) {
  .mh-brand-text span, .user-chip .uname { display: none; }
  .perm-grid { grid-template-columns: minmax(0, 1fr); }
}

.mh-notice strong { white-space: nowrap; }
.mh-dialog > p { margin-bottom: 12px; }

.home-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.home-shell > main { flex: 1 0 auto; width: 100%; }
.portal-footer { margin-top: 40px; border-top: 1px solid var(--line); background: var(--surface); font-size: 12.5px; color: var(--muted); }
.portal-footer > .mh-page { padding-block: 18px 22px; }
.home-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.home-brand .mh-logo-plate img { height: 34px; }
.home-brand-name { font: 700 16px/1.2 var(--font-doc); letter-spacing: .01em; color: var(--ink); }

/* Marke: Meier Hoch-/ Tiefbau Cloud */
.cloud-icon { display: block; border-radius: 9px; flex: none; }
.cloud-lockup { display: inline-flex; flex-direction: column; line-height: 1; gap: 3px; }
.cloud-lockup .l1 { font: 700 11.5px/1 var(--font-doc); letter-spacing: .06em; color: var(--ink); white-space: nowrap; }
.cloud-lockup .l2 { font: 700 21px/1 var(--font-label); letter-spacing: .2em; color: var(--meier-blau); }
.login-lockup { flex-direction: row; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-lockup > span { display: flex; flex-direction: column; gap: 4px; }
.login-lockup .l2 { font-size: 24px; }
.tool-bar .cloud-icon { border-radius: 7px; }
