/* LOPESA Sammlungen – an das alte Layout (grau / rot) angelehnt, ohne Tabellen-Layout */
:root {
  --bg: #999999;
  --panel: #cccccc;
  --panel-dark: #666666;
  --bar: #b72f17;
  --accent: #5c743d;
  --text: #1d1d1d;
  --link: #5c2a10;
  --danger: #a3170f;
  --ok-bg: #e3efd3;
  --err-bg: #f6d6d2;
}
* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 1.4;
}
a { color: var(--link); }
.topbar {
  background: var(--bar); color: #fff; padding: .45rem 1rem;
  display: flex; flex-wrap: wrap; gap: .4rem 2rem; align-items: baseline;
  border-top: 3px solid var(--panel-dark); border-bottom: 3px solid var(--accent);
}
.topbar a { color: #fff; }
.topbar .muted { opacity: .8; }
.layout { display: flex; min-height: calc(100vh - 3rem); }
.sidenav { width: 13rem; flex: 0 0 13rem; background: var(--panel); padding-top: 2rem; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav li a { display: block; padding: .35rem .8rem; text-decoration: none; }
.sidenav .nav-main a { background: var(--panel-dark); color: #fff; border-bottom: 1px solid #555; }
.sidenav .nav-sub a  { background: var(--panel); color: var(--text); padding-left: 1.4rem; border-bottom: 1px solid #b5b5b5; }
.sidenav a[aria-current="page"] { font-weight: bold; text-decoration: underline; }
.sidenav a:hover { filter: brightness(1.15); }
.content { flex: 1; padding: 1.2rem 1.6rem 3rem; min-width: 0; }
body.bare .content { max-width: none; }
h1 { font-size: 1.25rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.2rem 0 .5rem; }

fieldset { background: var(--panel); border: 1px solid var(--panel-dark); margin: 0 0 1rem; padding: .8rem 1rem; max-width: 62rem; min-width: 0; }
legend { background: var(--panel-dark); color: #fff; padding: .15rem .6rem; }
.row { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: .6rem; padding: .25rem 0; align-items: start; }
.row > label { padding-top: .25rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; }
.grid2 input[type=text], .grid2 select { width: 100%; }
.grid2 .row { grid-template-columns: 9rem minmax(0, 1fr); }
input[type=text], input[type=password], input[type=search], textarea, select {
  font: inherit; padding: .25rem .35rem; border: 1px solid #888; background: #fff; max-width: 100%;
}
input[type=text], input[type=password], textarea { width: 26rem; }
textarea { min-height: 5rem; resize: vertical; }
input[readonly], textarea[readonly], select[disabled] { background: #eee; color: #444; }
button, input[type=submit], .btn {
  font: inherit; cursor: pointer; background: var(--panel-dark); color: #fff;
  border: 1px solid #444; padding: .3rem .9rem; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { filter: brightness(1.2); }
.btn-small { padding: .15rem .5rem; font-size: .9em; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
form.inline { display: inline; margin: 0; }
button.icon { background: none; border: none; color: var(--danger); padding: 0 .2rem; font-size: 1.1em; }
a.icon { text-decoration: none; font-size: 1.1em; }

.msg { padding: .55rem .8rem; margin: 0 0 1rem; border: 1px solid; max-width: 60rem; }
.msg-ok { background: var(--ok-bg); border-color: var(--accent); }
.msg-error { background: var(--err-bg); border-color: var(--danger); }
.msg-info { background: #eee; border-color: #888; }

.tabs { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 0; }
.tabs a { background: var(--panel-dark); color: #fff; padding: .35rem .9rem; text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--panel); color: var(--text); font-weight: bold; }
.tabpanel { background: var(--panel-dark); padding: .6rem; max-width: 62rem; }
.tabpanel > fieldset:last-child { margin-bottom: 0; }

.table-wrap { overflow: auto; max-height: 75vh; background: var(--panel-dark); border: 1px solid #555; }
table.data { border-collapse: separate; border-spacing: 2px; width: 100%; }
table.data th, table.data td { background: var(--panel); padding: .3rem .4rem; vertical-align: top; text-align: left; }
table.data thead th { position: sticky; top: 0; background: #b8b8b8; z-index: 1; }
table.data td.desc { min-width: 16rem; }
.nowrap { white-space: nowrap; }
img.thumb { max-width: 60px; height: auto; display: block; }
.noimg { color: #555; font-size: .9em; }
.count { margin: .4rem 0; }

.detail { display: flex; flex-wrap: wrap; gap: 1rem; background: var(--panel); padding: 1rem; max-width: 72rem; }
.detail dl { margin: 0; flex: 1 1 26rem; display: grid; grid-template-columns: 10rem 1fr; gap: .25rem .8rem; }
.detail dt { font-weight: bold; }
.detail dd { margin: 0; }
.detail hr { grid-column: 1 / -1; width: 100%; border: 0; border-top: 1px solid #888; margin: .4rem 0; }
.detail .pics { flex: 0 1 30rem; }

.gallery-tools { margin-bottom: .4rem; display: flex; gap: .4rem; align-items: center; }
.gallery-tools button { background: none; color: var(--link); border: 0; padding: 0; }
.gallery .main-img { width: 300px; max-width: 100%; height: auto; display: block; transition: width .15s; }
.gallery .strip { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.gallery .strip img { height: 70px; width: auto; display: block; }
.img-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.img-grid figure { margin: 0; background: #ddd; padding: .4rem; text-align: center; }
.img-grid img { width: 150px; height: auto; display: block; margin-bottom: .3rem; }

.lb { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; z-index: 100; flex-direction: column; }
.lb img { max-width: 94vw; max-height: 84vh; box-shadow: 0 0 20px #000; background: #fff; }
.lb .lb-bar { color: #fff; margin-top: .6rem; display: flex; gap: 1.2rem; align-items: center; }
.lb button { background: #333; }

.listbox { max-height: 12rem; overflow: auto; background: #fff; border: 1px solid #888; padding: .3rem .5rem; margin: .3rem 0 .8rem; max-width: 32rem; }
.listbox div { padding: .1rem 0; border-bottom: 1px dotted #ccc; }
pre.log { background: #fff; padding: .8rem; max-height: 70vh; overflow: auto; white-space: pre-wrap; max-width: 60rem; }

.login { max-width: 32rem; }
.js .js-hide { display: none; }
.sr-only { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Benutzerverwaltung */
.tabpanel.wide, fieldset.wide { max-width: none; }
.table-wrap.tall { max-height: none; }
.danger { color: var(--danger); }
button.btn-danger { background: var(--danger); }
table.ua-matrix th, table.ua-matrix td { font-size: .85em; padding: .2rem .35rem; }
table.ua-matrix thead th { min-width: 4.2rem; max-width: 6.5rem; font-weight: bold; hyphens: auto; overflow-wrap: break-word; }
table.ua-matrix th:first-child, table.ua-matrix td:first-child { position: sticky; left: 0; z-index: 2; box-shadow: 2px 0 0 #555; }
table.ua-matrix thead th:first-child { z-index: 3; }
table.ua-matrix td.noaccess { color: #777; text-align: center; }
table.ua-matrix td.differs { font-weight: bold; }

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidenav { width: auto; flex: none; padding-top: 0; }
  .sidenav ul { display: flex; flex-wrap: wrap; }
  .sidenav li { flex: 1 1 auto; }
  .row, .grid2 { grid-template-columns: 1fr; }
  input[type=text], input[type=password], textarea { width: 100%; }
  .detail dl { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
}
@media print {
  .sidenav, .topbar, .actions, .tabs, .gallery-tools { display: none; }
  body { background: #fff; }
  .detail, fieldset { background: #fff; }
}
