/* TheFileServer – gemeinsames Dark-Theme (alle Module) */

:root {
  --bg: #0d0f12;
  --surface: #161920;
  --surface-2: #1d212b;
  --border: #2a2f3a;
  --text: #e2e8f0;
  --muted: #8b94a7;
  --accent: #4ab8f0;
  --accent-dim: #2b7fb0;
  --green: #4af0a0;
  --err: #f06060;
  --ok: #4af0a0;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Kopfzeile ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand .ver { color: var(--muted); font-size: 12px; font-weight: 400; }

.topnav { display: flex; gap: 4px; flex-wrap: wrap; }
.topnav a {
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
}
.topnav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.topnav a.active { color: var(--accent); background: var(--surface-2); }
.topnav a.logout:hover { color: var(--err); }

.nav-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  margin-left: 6px;
  border-radius: 10px;
  background: var(--accent-dim);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
  vertical-align: 2px;
}

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 22px 40px;
  flex: 1;
}

.narrow { max-width: 420px; margin: 48px auto 0; }

.hero { text-align: center; margin: 40px 0 36px; }
.hero h1 {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.hero .tagline { color: var(--muted); margin-top: 8px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card h1 { font-size: 20px; margin-bottom: 14px; }
.card h2 { font-size: 17px; margin-bottom: 8px; }
.card p { color: var(--muted); margin-bottom: 14px; }
.card.center { text-align: center; }
.card-link { display: block; color: var(--text); transition: border-color .15s, transform .15s; }
.card-link:hover {
  text-decoration: none;
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}
.card-link h2 { color: var(--accent); }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  padding: 18px;
  border-top: 1px solid var(--border);
}

/* ---------- Formulare ---------- */

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }

input[type="text"], input[type="password"], input[type="number"],
input[type="datetime-local"], select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  padding: 10px 12px;
  width: 100%;
}
textarea { resize: vertical; line-height: 1.5; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
label.check { flex-direction: row; align-items: center; gap: 8px; }
.note-content {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px 14px;
  margin-top: 10px;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(74, 184, 240, 0.18);
}

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 18px;
  cursor: pointer;
  text-align: center;
}
.btn:hover { text-decoration: none; border-color: var(--accent-dim); }
.btn-primary { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-danger:hover { border-color: var(--err); color: var(--err); }
.btn-small { padding: 5px 10px; font-size: 13px; }

.msg { border-radius: 7px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.msg.err { background: rgba(240, 96, 96, 0.12); border: 1px solid rgba(240, 96, 96, 0.4); color: var(--err); }
.msg.ok { background: rgba(74, 240, 160, 0.10); border: 1px solid rgba(74, 240, 160, 0.35); color: var(--ok); }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Dateibrowser / Tabellen ---------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumb {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
  word-break: break-all;
}
.breadcrumb a { color: var(--accent); }

table.files {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
table.files th, table.files td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
table.files th {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--surface-2);
  user-select: none;
}
table.files th.sortable { cursor: pointer; }
table.files th.sortable:hover { color: var(--text); }
table.files tr:last-child td { border-bottom: none; }
table.files tbody tr:hover { background: var(--surface-2); }
table.files td.name { font-family: var(--mono); word-break: break-all; }
table.files td.actions { white-space: nowrap; text-align: right; }
table.files td.actions a, table.files td.actions button { margin-left: 8px; }

.linklike {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
.linklike:hover { text-decoration: underline; }
.linklike.danger { color: var(--err); }

.icon-btn {
  font-size: 16px;
  line-height: 1;
  padding: 4px 5px;
  vertical-align: middle;
}
a.icon-btn:hover { text-decoration: none; filter: brightness(1.35); }
table.files td.actions a, table.files td.actions button { margin-left: 2px; }

/* Hintergrund-Animation (Landingpage) */
#bg3d {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* ---------- Theme „neumann“ (files.neumann-edv.de) ----------
   Helles Firmen-Design nach neumann-edv.de: dunkelblau #1a3a6e,
   cyan #00b4d8/#0077b6, heller Hintergrund. */

.theme-neumann {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --border: #dee2e6;
  --text: #212529;
  --muted: #6c757d;
  --accent: #0077b6;
  --accent-dim: #1a3a6e;
  --green: #2ea44f;
  --err: #c93c3c;
  --ok: #2ea44f;
}
.theme-neumann .topbar {
  border-bottom: 2px solid var(--accent-dim);
}
.theme-neumann .msg.ok {
  background: rgba(46, 164, 79, 0.10);
  border-color: rgba(46, 164, 79, 0.35);
}
.theme-neumann .msg.err {
  background: rgba(201, 60, 60, 0.08);
  border-color: rgba(201, 60, 60, 0.35);
}
.theme-neumann .drop-zone.dragover {
  background: rgba(0, 119, 182, 0.06);
}
.theme-neumann table.files tbody tr:hover {
  background: var(--surface-2);
}

/* ---------- Modaler Options-Dialog ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  width: min(380px, 90vw);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}
.modal-card h3 { margin-bottom: 14px; font-size: 16px; }
.modal-card select { margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.tool-panel {
  background: var(--surface-2);
  padding: 10px 14px !important;
}
.tool-panel .btn { margin-right: 8px; }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge.green { color: var(--green); border-color: rgba(74, 240, 160, 0.4); }
.badge.red { color: var(--err); border-color: rgba(240, 96, 96, 0.4); }

/* ---------- Dropzone / Fortschritt ---------- */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  color: var(--muted);
  transition: border-color .15s, background .15s;
  margin-bottom: 16px;
}
.drop-zone.dragover { border-color: var(--accent); background: rgba(74, 184, 240, 0.06); color: var(--text); }

.progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
  display: none;
}
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ---------- Token-Anzeige ---------- */

.token-box {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 1px;
  background: var(--surface-2);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  word-break: break-all;
}

.mono { font-family: var(--mono); }

.section-title {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--muted);
  margin: 30px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

@media (max-width: 640px) {
  .hero h1 { font-size: 26px; }
  table.files th:nth-child(3), table.files td:nth-child(3) { display: none; }
  .topbar { padding: 12px 14px; }
  .container { padding: 20px 14px 32px; }
}
