/* JustizBot Erweiterungen 6–9 */
.justiz-personal-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:12px;margin:18px 0}
.justiz-personal-grid>*{display:flex;flex-direction:column;gap:6px;padding:14px;border:1px solid var(--line,#344052);border-radius:12px;background:rgba(70,110,165,.08);color:inherit;text-decoration:none}
.justiz-personal-grid strong{font-size:26px}.justiz-personal-grid span{font-size:12px;color:var(--muted,#9baec7)}
.version-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:10px}.version-actions form{margin:0}
.document-version-compare{display:grid;grid-template-columns:1fr 1fr;gap:12px}.document-version-compare>div{min-width:0;border:1px solid #324055;border-radius:12px;padding:12px}
.document-version-compare pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:460px;overflow:auto;font-family:inherit;font-size:13px;line-height:1.5}
.justiz-notify-wrap{position:relative}.justiz-notify-button{position:relative;min-width:43px}.justiz-notify-count{position:absolute;top:-5px;right:-7px;min-width:18px;padding:2px 5px;border-radius:99px;font-size:11px;background:#e09039;color:#111;font-weight:800}
.justiz-notify-dropdown{position:absolute;right:0;top:calc(100% + 12px);width:min(390px,calc(100vw - 24px));max-height:520px;overflow:auto;background:#1e2939;color:#edf4ff;border:1px solid #415169;border-radius:15px;z-index:300;box-shadow:0 14px 35px #0008;padding:13px}
.justiz-notify-dropdown[hidden]{display:none!important}.justiz-notify-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:7px}
.justiz-notify-item{display:block;width:100%;padding:11px;margin:5px 0;text-align:left;border:1px solid #344056;background:#162235;color:inherit;border-radius:9px;cursor:pointer}
.justiz-notify-item:hover{background:#283a53}.justiz-notify-item strong{display:block}.justiz-notify-item small{display:block;color:#a4b3c6;margin-top:3px}.justiz-notify-item span{display:block;font-size:13px;margin-top:4px}
@media(max-width:750px){.document-version-compare{grid-template-columns:1fr}}


/* JustizBot Dashboard-Politur vom 29.10.2026. Nur Darstellung, keine Datenbankänderungen. */
/* Kopfzeile: Suche, Glocke und Profil teilen sich dauerhaft EINE Zeile. */
.app-workspace .topbar {
  grid-template-columns: minmax(0, 1fr) auto auto;
  justify-content: normal;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px clamp(16px, 2.1vw, 32px);
}
.app-workspace .topbar .top-search {
  width: min(100%, 600px);
  max-width: 600px;
  min-width: 0;
  justify-self: end;
}
.app-workspace .topbar .topbar-profile {
  flex-shrink: 0;
  width: auto;
  min-width: 148px;
  max-width: 240px;
  justify-content: flex-start;
  padding-inline: 12px;
  white-space: nowrap;
}
.app-workspace .topbar .topbar-profile strong,
.app-workspace .topbar .topbar-profile small { overflow: hidden; text-overflow: ellipsis; }
.app-workspace .topbar .topbar-profile span { min-width: 0; }
.app-workspace .topbar .justiz-notify-wrap { justify-self: end; }
.app-workspace .topbar .topbar-button { flex-shrink: 0; }

/* Ruhige, konsistente Kennzahlen ohne redundante zweite Zählleiste. */
.dashboard-kpis { margin-bottom: 18px; gap: 14px; }
.dashboard-kpis .metric {
  min-width: 0;
  min-height: 116px;
  border-radius: 16px;
  padding: 18px 20px;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.dashboard-kpis .metric strong { margin-top: 10px; line-height: 1; font-variant-numeric: tabular-nums; }
.dashboard-kpis .metric small { display: block; font-size: 12px; line-height: 1.35; }
.dashboard-kpis .metric:hover { box-shadow: 0 18px 36px rgba(0,0,0,.18); }
.dashboard-my-cases { margin: 0 0 18px; }
.dashboard-my-cases .page-head { margin-bottom: 15px; }
.dashboard-my-cases .page-head h2 { font-size: clamp(20px, 1.55vw, 27px); }
.dashboard-my-cases .table-wrap { overflow-x: auto; }
.dashboard-my-cases td:first-child { font-weight: 700; color: var(--accent-2); }
.dashboard-my-cases td:last-child { text-align: right; }
.dashboard-my-cases .button { white-space: nowrap; }
.dashboard-cockpit {
  display: grid;
  grid-template-columns: repeat(2,minmax(0, 1fr));
  grid-template-areas: none;
  gap: 18px;
  align-items: start;
}
.dashboard-cockpit > section {
  grid-area: auto;
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 0 !important;
  border-radius: 18px;
}
.dashboard-cockpit > .dashboard-reminders,
.dashboard-cockpit > .dashboard-hearings { grid-column: auto; height: 100%; }
.dashboard-cockpit .page-head { align-items: flex-start; gap: 12px; }
.dashboard-cockpit .page-head h2 { font-size: clamp(20px, 1.55vw, 26px); }
.dashboard-cockpit .panel { padding: clamp(16px,1.6vw,23px); }
.dashboard-cockpit .table-wrap { overflow-x: auto; }
.dashboard-cockpit .table-wrap table { min-width: 500px; }
.dashboard-limitations .table-wrap table,
.dashboard-all-limitations .table-wrap table { min-width: 790px; }
.dashboard-cockpit .table-wrap th { font-size: 11px; letter-spacing: .035em; }
.dashboard-cockpit .table-wrap td { vertical-align: middle; }
.dashboard-cockpit .panel:target,
.dashboard-my-cases:target { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
#verjaehrungen, #wiedervorlagen, #hauptverhandlungen { scroll-margin-top: 90px; }

/* Glocke zeigt aktuelle UND bereits gelesene Meldungen: keine zweite Liste im Dashboard. */
.justiz-notify-dropdown {
  width: min(430px, calc(100vw - 22px));
  max-height: min(540px, 75vh);
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}
.justiz-notify-items { max-height: 415px; overflow-y: auto; scrollbar-width: thin; }
.justiz-notify-item {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 65%, var(--panel));
  color: var(--text);
}
.justiz-notify-item.is-unread {
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, var(--panel));
}
.justiz-notify-item:hover { background: var(--panel-2); }
.justiz-notify-item small { color: var(--muted); }
.justiz-notify-help { color: var(--muted); font-size: 11px; margin: 12px 3px 0; }
@media (max-width: 1520px) {
  .dashboard-cockpit > .dashboard-reminders,
  .dashboard-cockpit > .dashboard-hearings { grid-column: 1 / -1; }
}
@media (max-width: 1180px) {
  .dashboard-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .app-workspace { display:block; width:100%; min-width:0; }
  .app-workspace .topbar {
    grid-template-columns: auto minmax(0,1fr) auto auto;
    min-height: 64px;
    gap: 8px;
    padding: 9px 12px;
  }
  .app-workspace .topbar .topbar-profile { min-width: 44px; max-width: 48px; padding: 7px; }
  .app-workspace .topbar .topbar-profile span { display: none; }
  .app-workspace .topbar .top-search { width: 100%; max-width: none; }
  .app-workspace .topbar .topbar-button { padding-inline: 9px; }
  .dashboard-cockpit { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 600px) {
  .dashboard-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .dashboard-kpis .metric { min-height: 106px; padding: 14px; }
  .dashboard-kpis .metric span { font-size: 10px; }
  .dashboard-kpis .metric strong { font-size: 29px; }
  .dashboard-kpis .metric small { font-size: 11px; }
  .dashboard-head .button { margin-top: 10px; }
  .dashboard-my-cases .page-head { display: flex; flex-wrap: wrap; }
  .app-workspace .topbar .top-search input { padding: 9px 10px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .dashboard-kpis .metric { transition: none; } }


/* JustizBot Mini-Sidebar: evenly-sized items, no stray text fragments.
   Applies only on desktop while the sidebar is collapsed. */
@media (min-width: 901px) {
  .app-shell.sidebar-collapsed {
    grid-template-columns: 76px minmax(0, 1fr);
  }
  .app-shell.sidebar-collapsed .app-sidebar {
    padding: 16px 9px 12px;
    overflow-x: hidden;
    overflow-y: hidden;
    scrollbar-gutter: auto;
  }
  .app-shell.sidebar-collapsed .app-sidebar .brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
  }
  .app-shell.sidebar-collapsed .app-sidebar .brand img {
    display: block;
    width: 44px;
    height: 44px;
    padding: 4px;
    border-radius: 12px;
    object-fit: contain;
  }
  .app-shell.sidebar-collapsed .app-sidebar .brand > span {
    display: none;
  }
  .app-shell.sidebar-collapsed .app-sidebar .sidebar-collapse {
    display: grid;
    place-items: center;
    width: 38px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 7px;
    flex: 0 0 auto;
  }
  /* The old nav used a stretched CSS grid; each link could grow vertically.
     A compact flex-column gives every icon the same hit area. */
  .app-shell.sidebar-collapsed .app-sidebar .app-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-height: 0;
    padding: 2px 0 10px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
  }
  .app-shell.sidebar-collapsed .app-sidebar .app-nav::-webkit-scrollbar {
    width: 0;
    display: none;
  }
  .app-shell.sidebar-collapsed .app-sidebar .app-nav .nav-section-label,
  .app-shell.sidebar-collapsed .app-sidebar .app-nav a .nav-label,
  .app-shell.sidebar-collapsed .app-sidebar .app-nav a .nav-key {
    display: none !important;
  }
  .app-shell.sidebar-collapsed .app-sidebar .app-nav a {
    display: flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    min-height: 46px;
    max-height: 46px;
    margin: 0;
    padding: 0;
    gap: 0;
    border-radius: 13px;
    white-space: nowrap;
    overflow: hidden;
  }
  .app-shell.sidebar-collapsed .app-sidebar .app-nav a .nav-icon {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .app-shell.sidebar-collapsed .app-sidebar .app-nav .nav-section-label:not(:first-child) + a {
    margin-top: 12px;
  }
  .app-shell.sidebar-collapsed .app-sidebar .sidebar-foot {
    display: grid;
    justify-items: center;
    gap: 0;
    width: 100%;
    padding: 10px 0 4px;
    margin-top: auto;
  }
  .app-shell.sidebar-collapsed .app-sidebar .sidebar-foot .theme-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 42px;
    min-height: 42px;
    padding: 0;
  }
  .app-shell.sidebar-collapsed .app-sidebar .sidebar-foot .theme-toggle [data-theme-label] {
    display: none !important;
  }
}

/* Navigation: keep items compact even for accounts with fewer permissions.
   The nav is a flex child with extra height and a grid inside. Without
   align-content:start, grid rows stretch to fill that height. */
@media (min-width: 901px) {
  .app-shell:not(.sidebar-collapsed) .app-sidebar .app-nav {
    align-content: start;
  }
}


/* JustizBot 29.10.2026: zweizeiliger Behördenname im Sidebar-Kopf.
   Die Regel betrifft NUR den geöffneten Desktop-Modus und verändert
   die bereits reparierte kompakte Navigation nicht. */
@media (min-width: 901px) {
  .app-shell:not(.sidebar-collapsed) {
    grid-template-columns: 320px minmax(0, 1fr);
  }
  .app-shell:not(.sidebar-collapsed) .app-sidebar .brand {
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) 34px;
    gap: 10px;
    align-items: center;
    justify-items: start;
    width: 100%;
  }
  .app-shell:not(.sidebar-collapsed) .app-sidebar .brand img {
    grid-column: 1;
    grid-row: 1;
    width: 50px;
    height: 50px;
    object-fit: contain;
  }
  .app-shell:not(.sidebar-collapsed) .app-sidebar .brand > span {
    display: block;
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -.1px;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
    white-space: normal;
  }
  .app-shell:not(.sidebar-collapsed) .app-sidebar .brand > .sidebar-collapse {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    margin: 0;
  }
}
