/* Thaysen telecom – Datei-Portal */
:root {
  --blue: #1b4a82;
  --blue-dark: #133a68;
  --blue-soft: #e8eff8;
  --grey: #c9cdd2;
  --bg: #f3f5f9;
  --card: #ffffff;
  --line: #dde3ec;
  --text: #0f172a;
  --muted: #475569;
  --ok: #166534;
  --ok-bg: #e7f6ec;
  --err: #b42318;
  --err-bg: #fdecea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font);
}
img { max-width: 100%; height: auto; }
a { color: var(--blue); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 1rem; display: flex; align-items: center; gap: .5rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; }
.wrapany { overflow-wrap: anywhere; }
.center { text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--blue); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 8px; top: 8px; border-radius: 8px; }
.ic { flex: none; }

:focus-visible { outline: 3px solid #5b8fd1; outline-offset: 2px; border-radius: 6px; }

/* ---- header ---- */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { max-width: 1080px; margin: 0 auto; padding: .6rem 16px; display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: flex; align-items: center; }
.brand img { display: block; height: 40px; width: auto; }
.nav { display: flex; gap: .25rem; flex: 1; }
.nav a {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .85rem; min-height: 44px;
  border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500;
  transition: background-color .15s, color .15s;
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a[aria-current="page"] { background: var(--blue-soft); color: var(--blue-dark); }
.who { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.who form { margin: 0; }
.who-link { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .75rem; min-height: 44px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.who-link:hover { background: var(--bg); }
.who-link span { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- layout ---- */
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 28px 16px 40px; flex: 1; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.25rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.25rem 16px 1.75rem; display: flex; gap: .5rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.foot-sec { display: inline-flex; align-items: center; gap: .3rem; }
.foot .ic { width: 15px; height: 15px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.25rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 520px; }
.hint { margin-top: .5rem; }

/* ---- alerts ---- */
.alert { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1.1rem; border: 1px solid transparent; }
.alert-ok { background: var(--ok-bg); color: var(--ok); border-color: #b7e4c7; }
.alert-err { background: var(--err-bg); color: var(--err); border-color: #f5c2bd; }
.alert-info { background: var(--blue-soft); color: var(--blue-dark); border-color: #c5d6ec; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: #fff; color: var(--err); border-color: #f1c0bb; }
.btn-danger:hover { background: var(--err-bg); }
.btn-sm { min-height: 44px; padding: .4rem .8rem; font-size: .92rem; }
.btn-icon { padding-left: .7rem; padding-right: .7rem; }
.btn-block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }

/* ---- forms ---- */
.form { display: grid; gap: 1rem; }
.form.grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.field { display: grid; gap: .35rem; min-width: 0; }
.form.grid .field.wide { grid-column: 1 / -1; }
.form.grid .field.wide .pwrow input { max-width: 28rem; }
.field.actions { align-self: end; }
label { font-weight: 600; font-size: .92rem; }
input[type=text], input[type=password], input:not([type]), select {
  width: 100%; min-height: 44px; padding: .55rem .8rem; font: inherit; color: var(--text);
  background: #fff; border: 1px solid #b9c3d3; border-radius: 10px;
}
input:focus, select:focus { border-color: var(--blue); outline: 3px solid #cfe0f5; outline-offset: 0; }
.check { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.pwrow { display: flex; gap: .5rem; }
.pwrow input { flex: 1; min-width: 0; }

/* ---- login ---- */
.login { max-width: 420px; margin: 4vh auto 0; }
.login-card { padding: 2rem; }
.login-card h1 { margin-bottom: .25rem; }
.login-card .muted { margin-bottom: 1.25rem; }
.login-note { display: flex; gap: .5rem; align-items: center; justify-content: center; color: var(--muted); font-size: .88rem; text-align: center; }
.login-note .ic { width: 18px; height: 18px; }

/* ---- error page ---- */
.err-code { font-size: 4rem; font-weight: 700; color: var(--grey); margin: 0; line-height: 1; }

/* ---- upload ---- */
.drop {
  border: 2px dashed #a9b8cf; border-radius: var(--radius); background: #f8fafd; text-align: center;
  padding: 1.75rem 1rem; cursor: pointer; color: var(--muted);
  transition: border-color .15s, background-color .15s;
}
.drop .ic { width: 32px; height: 32px; color: var(--blue); margin-bottom: .25rem; }
.drop p { margin: 0 0 .25rem; }
.drop strong { color: var(--text); }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-soft); }
.link { color: var(--blue); text-decoration: underline; }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.queue:not(:empty) { margin-top: 1rem; }
.qi { border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; display: grid; gap: .4rem; }
.qi-head { display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.qi-name { font-weight: 600; overflow-wrap: anywhere; }
.qi-meta { display: flex; justify-content: space-between; gap: .75rem; color: var(--muted); font-size: .85rem; flex-wrap: wrap; }
.bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: width .2s linear; }
.qi.done .bar > i { background: #2f9e5c; }
.qi.fail .bar > i { background: var(--err); }
.qi.fail .qi-status { color: var(--err); }
.qi.done .qi-status { color: var(--ok); }

/* ---- tables ---- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: .85rem 1.25rem; background: #f8fafd; border-bottom: 1px solid var(--line); }
.tbl td { padding: .9rem 1.25rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafcff; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .name { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.tbl .name span { overflow-wrap: anywhere; }
.tbl .name .ic { color: var(--blue); }
.tbl .act { display: flex; gap: .5rem; justify-content: flex-end; align-items: center; white-space: nowrap; }
.tbl .act form { margin: 0; }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.empty .ic { width: 40px; height: 40px; color: var(--grey); }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge-blue { background: var(--blue-soft); color: var(--blue-dark); border-color: #c5d6ec; }
.badge-red { background: var(--err-bg); color: var(--err); border-color: #f5c2bd; }

/* ---- users ---- */
.urow { padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); display: grid; gap: .75rem; }
.urow:last-child { border-bottom: 0; }
.u-main { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.u-main .muted { margin-left: auto; }
.u-fields { display: grid; grid-template-columns: 1fr 160px 1.4fr auto; gap: .75rem; align-items: end; }
.u-act { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---- responsive ---- */
@media (max-width: 760px) {
  h1 { font-size: 1.5rem; }
  .top-in { flex-wrap: wrap; gap: .25rem .75rem; }
  .nav { order: 3; width: 100%; flex: none; overflow-x: auto; }
  .nav a { padding: .55rem .6rem; }
  .who-link span { display: none; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { border: 0; padding: .2rem 0; text-align: left !important; }
  .tbl td[data-label]:not(.name)::before { content: attr(data-label) ": "; color: var(--muted); font-size: .85rem; }
  .tbl .act { margin-top: .6rem; justify-content: flex-start; }
  .u-fields { grid-template-columns: 1fr; }
  .u-main .muted { margin-left: 0; width: 100%; }
  .login-card { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
