/* SAP Fiori "Horizon"-Look */
@font-face { font-family: "72"; font-weight: 400; src: url("https://cdn.jsdelivr.net/npm/@sap-theming/theming-base-content@11.32.3/content/Base/baseLib/baseTheme/fonts/72-Regular.woff2") format("woff2"); }
@font-face { font-family: "72"; font-weight: 700; src: url("https://cdn.jsdelivr.net/npm/@sap-theming/theming-base-content@11.32.3/content/Base/baseLib/baseTheme/fonts/72-Bold.woff2") format("woff2"); }

:root {
  --brand: #0070f2; --brand-h: #0064d9; --text: #1d2d3e; --text2: #556b82; --bg: #f5f6f7; --card: #fff;
  --line: #e5e5e5; --hover: #eaecee; --sel: #ebf8ff; --field: #556b82;
  --neg: #aa0808; --neg-bg: #ffeaf4; --pos: #256f3a; --pos-bg: #f5fae5; --crit: #b44f00; --crit-bg: #fff8d6;
  --info: #0064d9; --info-bg: #e1f4ff;
  --shadow: 0 0 .125rem rgba(34,53,72,.2), 0 .125rem .25rem rgba(34,53,72,.2);
  --r: .5rem;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.4 "72", "Segoe UI", system-ui, Arial, sans-serif; color: var(--text); background: var(--bg); }
[hidden] { display: none !important; }
h1 { font-size: 1.25rem; margin: 0; font-weight: 700; }
a { color: var(--brand-h); text-decoration: none; }
a:hover { text-decoration: underline; }
.i { width: 1rem; height: 1rem; fill: currentColor; flex: none; }
.sub { color: var(--text2); font-size: .875rem; }
.spacer { flex: 1; }

button {
  font: inherit; color: var(--brand-h); background: transparent; border: 1px solid transparent; border-radius: var(--r);
  height: 2.25rem; padding: 0 .75rem; cursor: pointer; display: inline-flex; align-items: center; gap: .375rem; white-space: nowrap;
}
button:hover { background: var(--hover); }
button:disabled { opacity: .4; cursor: default; background: transparent; }
button.icon { padding: 0; width: 2.25rem; justify-content: center; }
.btn-primary { background: var(--brand); color: #fff; font-weight: 700; }
.btn-primary:hover { background: var(--brand-h); }
.btn-default { background: #fff; border-color: #bcc3ca; }
.btn-danger { background: var(--neg); color: #fff; font-weight: 700; }
.btn-danger:hover { background: #8c0606; }
button.neg { color: var(--neg); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

input, select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid var(--field); border-radius: .25rem;
  height: 2.25rem; padding: 0 .625rem; min-width: 0;
}
input:hover, select:hover { background: #f5faff; border-color: var(--brand-h); }
input[type=checkbox] { width: 1.125rem; height: 1.125rem; accent-color: var(--brand); padding: 0; }

/* Login */
#login { min-height: 100%; display: grid; place-items: center; padding: 1rem;
  background: linear-gradient(135deg, #eaf4ff, #f5f6f7 60%); }
.login-card { background: #fff; box-shadow: var(--shadow); border-radius: 1rem; padding: 2rem; width: min(24rem, 100%); display: grid; gap: .75rem; }
.login-card label { display: grid; gap: .25rem; color: var(--text2); }
.login-card label.check { display: flex; align-items: center; gap: .5rem; color: var(--text); cursor: pointer; }
.login-logo { display: flex; align-items: center; gap: .5rem; font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.login-logo .i { width: 2rem; height: 2rem; color: var(--brand); }
.err { color: var(--neg); min-height: 1.2em; }

/* Shell */
#app { height: 100%; display: flex; flex-direction: column; }
.shell { height: 3.25rem; flex: none; background: #fff; box-shadow: var(--shadow); display: flex; align-items: center; gap: .5rem; padding: 0 1rem; position: relative; z-index: 1; }
.logo { font-weight: 700; font-size: 1rem; }
.logo-i { width: 1.5rem; height: 1.5rem; color: var(--brand); }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; background: #c0399f; color: #fff; display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.busy .shell::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 30%; background: var(--brand); animation: load 1s ease-in-out infinite; }
@keyframes load { from { left: -30%; } to { left: 100%; } }

.layout { flex: 1; display: grid; grid-template-columns: 19rem 1fr; min-height: 0; }
aside { background: #fff; border-right: 1px solid var(--line); overflow: auto; padding: .5rem; }
.aside-head { display: flex; align-items: center; gap: .125rem; padding: .25rem .25rem .5rem .5rem; }
main { overflow: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }

/* Baum */
.tree ul { list-style: none; margin: 0; padding: 0 0 0 1rem; }
.tree > ul { padding: 0; }
.tree .node { display: flex; align-items: center; gap: .5rem; height: 2.5rem; padding: 0 .25rem 0 .5rem; border-radius: var(--r); cursor: pointer; list-style: none; }
.tree .node:hover { background: var(--hover); }
.tree .node.active { background: var(--sel); box-shadow: inset 3px 0 var(--brand); font-weight: 700; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before { content: ""; width: .4rem; height: .4rem; border: solid var(--text2); border-width: 0 2px 2px 0; transform: rotate(-45deg); margin-right: .125rem; transition: transform .15s; }
.tree details[open] > summary::before { transform: rotate(45deg); }
.tree .node .i { color: var(--text2); }
.tree .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .more { visibility: hidden; height: 2rem; width: 2rem; }
.tree .node:hover .more, .tree .more:focus-visible { visibility: visible; }
.count { background: var(--info-bg); color: var(--info); border-radius: 1rem; padding: 0 .5rem; font-size: .75rem; font-weight: 700; }
.owner { color: var(--text2); font-size: .75rem; }
.section { display: flex; align-items: center; gap: .5rem; color: var(--text2); font-size: .875rem; padding: 1rem .5rem .25rem; }
.tree-empty { color: var(--text2); padding: .5rem; font-size: .875rem; }

/* Content */
.card { background: var(--card); border-radius: .75rem; box-shadow: var(--shadow); }
.page-head { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; flex-wrap: wrap; }
.page-head > div:first-child { flex: 1; min-width: 12rem; }
.actions { display: flex; gap: .25rem; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar input[type=search] { width: 14rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-weight: 400; color: var(--text2); text-align: left; padding: .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: .375rem .5rem; border-bottom: 1px solid var(--line); height: 2.75rem; }
tbody tr:hover td { background: #f7f8f9; }
tbody tr.sel td { background: var(--sel); }
.chk { width: 2.5rem; text-align: center; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.name { min-width: 14rem; }
td.name .ext { margin-left: .25rem; vertical-align: -2px; }
td.name .lbl2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 30rem; }
td.name > div { display: flex; align-items: flex-start; }
td.act { width: 2.75rem; }
.empty-row { text-align: center; color: var(--text2); height: 6rem; }
.up { color: var(--neg); font-size: .75rem; }
.down { color: var(--pos); font-size: .75rem; }
.warn { color: var(--crit); vertical-align: -2px; cursor: help; }
.tag { display: inline-block; background: #eff1f2; border: 1px solid #758ca4; color: var(--text); border-radius: .375rem; padding: 0 .375rem; font-size: .75rem; margin: 1px .25rem 1px 0; cursor: pointer; }
.tag:hover { background: var(--sel); border-color: var(--brand); }
.badge { display: inline-block; padding: 0 .5rem; border-radius: .5rem; font-size: .75rem; font-weight: 700; line-height: 1.375rem; border: 1px solid; white-space: nowrap; }
.badge[data-cycle] { cursor: pointer; }
.c-blue { color: var(--info); background: var(--info-bg); border-color: #89ccff; }
.c-orange { color: var(--crit); background: var(--crit-bg); border-color: #ffc847; }
.c-green { color: var(--pos); background: var(--pos-bg); border-color: #a8d06d; }
.c-red { color: var(--neg); background: var(--neg-bg); border-color: #ff8ab4; }
.c-purple { color: #7800a4; background: #f9eaff; border-color: #e0a0ff; }
.c-grey { color: var(--text2); background: #eff1f2; border-color: #bcc3ca; }
button.mini-btn { height: 1.5rem; width: 1.5rem; border-radius: .25rem; flex: none; }
.new-in { display: flex; align-items: center; gap: .375rem; margin: 0 .25rem .5rem; padding: .25rem .25rem .25rem .5rem; background: var(--sel); border-radius: var(--r); font-size: .8125rem; color: var(--text2); }
.new-in span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .node.here { box-shadow: inset 0 0 0 1px var(--brand); }
.tree .node.drop, aside.drop { background: var(--sel); outline: 2px dashed var(--brand); outline-offset: -2px; }
.tree [draggable="true"] { cursor: grab; }
.setting { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.setting > div { flex: 1; }
.setting.update { border-bottom: 0; border-top: 1px solid var(--line); margin-top: .5rem; flex-direction: column; align-items: stretch; gap: .5rem; }
.setting.update button { align-self: flex-end; }
input[type=file] { height: auto; padding: .375rem; margin-top: .5rem; width: 100%; border-style: dashed; }
.totals { display: flex; gap: 2rem; justify-content: flex-end; padding: .75rem 1.25rem; flex-wrap: wrap; }
.totals div { display: grid; text-align: right; }
.totals span { color: var(--text2); font-size: .75rem; }
.totals b { font-size: 1.125rem; }
.empty { margin: auto; text-align: center; color: var(--text2); }
.empty > .i { width: 4rem; height: 4rem; color: var(--brand); }
.empty h2 { color: var(--text); }

/* Dialog */
dialog { border: none; border-radius: .75rem; padding: 0; box-shadow: 0 .625rem 1.875rem rgba(34,53,72,.3); width: min(32rem, calc(100vw - 2rem)); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.3); }
dialog header { font-size: 1rem; font-weight: 700; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
dialog .body { padding: .5rem 1.25rem 1rem; display: grid; gap: .25rem; max-height: 65vh; overflow: auto; }
dialog .body > label { color: var(--text2); margin-top: .5rem; font-size: .875rem; }
dialog .body p { margin: .5rem 0; }
dialog footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .625rem 1.25rem; border-top: 1px solid var(--line); }
dialog .row { display: flex; gap: .5rem; margin-top: .5rem; }
dialog .row input { flex: 1; }
table.mini td { height: 2.5rem; }
table.mini td:last-child { text-align: right; white-space: nowrap; }

/* Menü & Toast */
#menu { position: fixed; inset: auto; margin: 0; padding: .25rem; border: none; border-radius: var(--r); box-shadow: var(--shadow); min-width: 12rem; background: #fff; }
#menu button { width: 100%; justify-content: flex-start; color: var(--text); border-radius: .375rem; }
#menu button.danger { color: var(--neg); }
#toast { inset: auto auto 2rem 50%; transform: translateX(-50%); margin: 0; border: none; border-radius: var(--r); padding: .75rem 1.25rem; background: rgba(29,45,62,.92); color: #fff; max-width: min(30rem, 90vw); }
#toast.err { background: var(--neg); }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  aside { max-height: 38vh; border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: .5rem; }
  .toolbar input[type=search] { width: 100%; }
  #userName { display: none; }
}
