/* =====================================================================
   oasoft Share – Stylesheet im oasoft-CI
   Farben wie in den oasoft-Desktop-Apps (Orange #F59E2C, Dunkelgrau
   #3F4344), Hausschrift PF DinText Universal.
   CSP: style-src 'self' – keine Inline-Styles in den Templates.
   ===================================================================== */

@font-face {
  font-family: "PF DinText Universal";
  src: url('/assets/fonts/PFDinTextUniversal-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PF DinText Universal";
  src: url('/assets/fonts/PFDinTextUniversal-Bold.ttf') format('truetype');
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* oasoft-CI */
  --oasoft-orange: #f59e2c;
  --oasoft-orange-hover: #de8818;
  --oasoft-orange-dark: #b35a00;      /* Orange als Textfarbe (lesbar auf Weiß) */
  --oasoft-orange-light: #fef4e6;
  --oasoft-orange-soft: #fde6c8;
  --anthracite: #3f4344;
  --anthracite-2: #54595a;
  --anthracite-3: #2f3233;

  --ink: #2b2f30;
  --ink-soft: #5d6263;
  --ink-faint: #8a8f90;
  --bg: #f3f3f3;
  --card-bg: #ffffff;
  --border: #e3e3e3;
  --border-soft: #eeeeee;
  --hover-bg: #f7f7f7;

  --green: #2e7d32;
  --green-bg: #e8f4e9;
  --red: #c62828;
  --red-bg: #fdecec;
  --amber: #8a5a00;
  --amber-bg: #fff4dc;
  --blue: #1f6fb2;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(30, 32, 33, 0.06);
  --shadow-md: 0 6px 20px rgba(30, 32, 33, 0.10);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.35);

  --topbar-h: 56px;
  --font: "PF DinText Universal", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--oasoft-orange-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.55rem; font-weight: 700; margin: 0 0 0.75rem; color: var(--anthracite); letter-spacing: 0; display: flex; align-items: center; gap: 0.55rem; }
h2 { font-size: 1.08rem; font-weight: 700; margin: 1.75rem 0 0.75rem; color: var(--anthracite); display: flex; align-items: center; gap: 0.45rem; }
h2.no-top-margin { margin-top: 0; }
h1 .icon, h2 .icon { color: var(--oasoft-orange); vertical-align: middle; }

.icon { flex-shrink: 0; vertical-align: -3px; }

::selection { background: var(--oasoft-orange-soft); }

:focus-visible { outline: 2px solid var(--oasoft-orange); outline-offset: 2px; }

/* ---------- Customer-facing pages (Freigabe /s/, Upload /u/) ---------- */

.centered-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 1rem;
  background: var(--anthracite-3) url('/assets/img/ci-wallpaper.jpg') center / cover no-repeat fixed;
}

.auth-card {
  background: var(--card-bg);
  border-radius: 14px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  padding: 2.5rem 2.5rem 2.25rem;
}
.auth-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  background: var(--oasoft-orange);
}
.auth-card.auth-card-wide { max-width: 880px; }

.logo { display: block; height: 44px; width: auto; margin: 0 0 1.75rem; }
.logo-sm { display: block; height: 26px; width: auto; }

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-bg);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 0.9rem;
}

.page-foot {
  margin-top: 1.25rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.page-foot a { color: rgba(255, 255, 255, 0.9); }

.center-state { text-align: center; padding: 1rem 0; }
.center-state .big-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--oasoft-orange-light); color: var(--oasoft-orange);
  margin-bottom: 1rem;
}
.center-state h1 { justify-content: center; }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--oasoft-orange-soft);
  border-top-color: var(--oasoft-orange);
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */

form label, .form-label, .card-form label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--anthracite-2);
}

form input[type=text],
form input[type=email],
form input[type=password],
form input[type=number],
form input[type=tel],
form input[type=search],
form input[type=datetime-local],
form input[type=date],
form input[type=time],
form input[type=file],
form select,
form textarea,
.card-form input[type=text],
.card-form input[type=email],
.card-form input[type=tel],
.card-form textarea,
.input {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.62rem 0.8rem;
  border: 1px solid #d4d6d7;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: normal;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

form input:focus, form select:focus, form textarea:focus, .card-form input:focus, .card-form textarea:focus, .input:focus, .note-editor-html:focus {
  outline: none;
  border-color: var(--oasoft-orange);
  box-shadow: 0 0 0 3px rgba(245, 158, 44, 0.22);
}

.checkbox-label { display: flex; align-items: center; gap: 0.55rem; font-weight: normal; color: var(--ink); }
.checkbox-label input { width: auto; margin: 0; accent-color: var(--oasoft-orange); }

/* ---------- Buttons ---------- */

button, .btn {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.58rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: #ececec;
  color: var(--anthracite);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  font-family: inherit;
  line-height: 1.3;
  white-space: nowrap;
}
button:hover, .btn:hover { background: #e0e0e0; text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }

.btn-primary, form button[type=submit] {
  background: var(--oasoft-orange);
  color: #fff;
}
.btn-primary:hover, form button[type=submit]:hover { background: var(--oasoft-orange-hover); }

.btn-secondary {
  background: #fff;
  border-color: #d4d6d7;
  color: var(--anthracite);
}
.btn-secondary:hover { background: var(--hover-bg); border-color: #c4c6c7; }

.btn-ghost { background: transparent; color: var(--anthracite-2); }
.btn-ghost:hover { background: rgba(63, 67, 68, 0.08); }

.btn-sm { padding: 0.36rem 0.7rem; font-size: 0.82rem; }
.btn-block { width: 100%; }

.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #fadada; }

.btn-link, form button.btn-link[type=submit] {
  background: none;
  border: none;
  color: var(--oasoft-orange-dark);
  padding: 0;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-link:hover, form button.btn-link[type=submit]:hover { text-decoration: underline; background: none; }
.btn-link-danger, form button.btn-link-danger[type=submit] { color: var(--ink-faint); }
.btn-link-danger:hover, form button.btn-link-danger[type=submit]:hover { color: var(--red); }

.icon-btn {
  background: transparent;
  border: none;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  color: var(--anthracite-2);
}
.icon-btn:hover { background: rgba(63, 67, 68, 0.08); color: var(--anthracite); }

button:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
button:disabled:hover { background: #ececec; }
.btn-primary:disabled:hover, form button[type=submit]:disabled:hover { background: var(--oasoft-orange); }

/* ---------- Alerts / hints ---------- */

.hint { color: var(--ink-soft); font-size: 0.9rem; }
.hint.small { font-size: 0.8rem; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin: 0 0 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  line-height: 1.5;
  border-left: 4px solid transparent;
}
.alert .icon { margin-top: 0.15rem; }
.alert-error { background: var(--red-bg); color: var(--red); border-left-color: var(--red); }
.alert-success { background: var(--green-bg); color: var(--green); border-left-color: var(--green); }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-left-color: var(--oasoft-orange); }
.alert-info { background: var(--oasoft-orange-light); color: var(--anthracite); border-left-color: var(--oasoft-orange); }

/* ---------- Top bar (Nextcloud-Stil) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  background: var(--anthracite);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1rem 0 1.25rem;
  border-bottom: 3px solid var(--oasoft-orange);
}
.topbar-brand { display: flex; align-items: center; gap: 0.75rem; color: #fff; flex-shrink: 0; }
.topbar-brand:hover { text-decoration: none; }
.topbar-brand img { height: 28px; width: auto; display: block; }
.topbar-app {
  font-weight: 600;
  font-size: 0.95rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.02em;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
  margin-left: auto;
  position: relative;
}
.topbar-search .icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, 0.6); pointer-events: none; }
.topbar-search input[type=search] {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 0.9rem 0.5rem 2.3rem;
  font-family: inherit;
  font-size: 0.9rem;
}
.topbar-search input[type=search]::placeholder { color: rgba(255, 255, 255, 0.6); }
.topbar-search input[type=search]:focus { outline: none; background: #fff; color: var(--ink); border-color: var(--oasoft-orange); }
.topbar-search input[type=search]:focus::placeholder { color: var(--ink-faint); }
.topbar-search:focus-within .icon { color: var(--ink-faint); }

.topbar-actions { display: flex; align-items: center; gap: 0.35rem; }
.topbar-actions a {
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.topbar-actions a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; text-decoration: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--oasoft-orange); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; text-transform: uppercase;
}

/* ---------- App shell / sidebar ---------- */

.app-shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #fafafa;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
}

.sidebar-cta { margin: 0.25rem 0.25rem 1.25rem; display: flex; }
.sidebar-cta .btn { flex: 1; }

.side-nav { flex: 1; overflow-y: auto; }
.side-nav-group { margin-bottom: 1.25rem; }
.side-nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-faint);
  margin: 0 0 0.35rem;
  padding: 0 0.75rem;
}

.side-nav a, .side-nav-footer a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--anthracite);
  font-size: 0.92rem;
  margin-bottom: 0.1rem;
  position: relative;
}
.side-nav a .icon, .side-nav-footer a .icon { color: var(--anthracite-2); }
.side-nav a:hover, .side-nav-footer a:hover {
  background: #efefef;
  text-decoration: none;
}
.side-nav a.active {
  background: var(--oasoft-orange-light);
  color: var(--anthracite);
  font-weight: 600;
}
.side-nav a.active::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 3px;
  background: var(--oasoft-orange);
}
.side-nav a.active .icon { color: var(--oasoft-orange); }
.side-nav a span, .side-nav-footer a span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-nav .nav-count {
  font-style: normal;
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: #ececec;
  border-radius: 999px;
  padding: 0 0.5rem;
  min-width: 1.6rem;
  text-align: center;
}
.side-nav a.active .nav-count { background: var(--oasoft-orange); color: #fff; }

.side-nav-footer {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}
.side-nav-footer .logout-link:hover { background: var(--red-bg); color: var(--red); }
.side-nav-footer .logout-link:hover .icon { color: var(--red); }

.storage-meter { padding: 0.25rem 0.75rem 0.75rem; font-size: 0.78rem; color: var(--ink-soft); }
.storage-meter .progress-track { height: 6px; margin-top: 0.35rem; }

.main-col { flex: 1; min-width: 0; background: #fff; }
.admin-main { max-width: 1180px; margin: 0 auto; padding: 1.75rem 2rem 4rem; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .page-head-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.breadcrumb { display: flex; align-items: center; gap: 0.35rem; font-size: 0.88rem; color: var(--ink-soft); margin-bottom: 0.5rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--oasoft-orange-dark); }

/* ---------- Toolbar über Listen (Suche, Filter, Ansicht) ---------- */

.list-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.seg {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.15rem;
}
.seg button {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.38rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.seg button:hover { background: rgba(63, 67, 68, 0.06); }
.seg button.active { background: #fff; color: var(--anthracite); box-shadow: var(--shadow-sm); }
.seg button .count { font-weight: 700; color: var(--ink-faint); margin-left: 0.15rem; }
.seg button.active .count { color: var(--oasoft-orange-dark); }

.list-search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.list-search .icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--ink-faint); pointer-events: none; }
.list-search input[type=search] { margin: 0; padding-left: 2.2rem; border-radius: 999px; }
.view-toggle { margin-left: auto; }
.view-toggle button { padding: 0.38rem 0.6rem; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state .icon { color: var(--oasoft-orange); margin-bottom: 0.5rem; }

/* ---------- Cards, tables, badges ---------- */

.card-form, .card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  max-width: 720px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card-form-wide, .card-wide { max-width: 980px; }
.card-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin: 1.5rem 0 0.75rem; }
.card-section-title:first-child { margin-top: 0; }

.card-form-inline { border: 1px dashed #d4d6d7; border-radius: var(--radius-sm); padding: 1rem 1.1rem; margin: 1rem 0; background: #fcfcfc; }
.card-form-inline legend { font-weight: 700; padding: 0 0.4rem; font-size: 0.92rem; color: var(--anthracite); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- Send panel (link / password sharing via e-mail or WhatsApp) ---------- */

.send-group { margin-top: 1rem; }
.send-group + .send-group { margin-top: 1.5rem; padding-top: 1.4rem; border-top: 1px solid var(--border-soft); }

.send-group-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.96rem;
  margin: 0 0 0.15rem;
  color: var(--anthracite);
}

.send-tabs {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem;
  gap: 0.15rem;
  margin: 0.65rem 0 1rem;
}
.send-tab {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.send-tab:hover { background: rgba(63, 67, 68, 0.06); }
.send-tab.active { background: var(--card-bg); color: var(--anthracite); box-shadow: var(--shadow-sm); }

.send-panel-body label { margin-bottom: 0.7rem; }
.send-panel-body label:last-of-type { margin-bottom: 0.6rem; }
.send-panel-body[hidden] { display: none; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card-bg); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border-soft); font-size: 0.9rem; vertical-align: middle; }
.table th { background: #fafafa; color: var(--ink-soft); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table tbody tr:hover { background: var(--hover-bg); }
.table tr:last-child td { border-bottom: none; }
.table td a { color: var(--anthracite); font-weight: 600; }
.table td a:hover { color: var(--oasoft-orange-dark); }
.table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ua-cell { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-faint); font-size: 0.8rem; }

.title-cell { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.title-cell .title-text { min-width: 0; }
.title-cell .title-text a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title-cell .title-sub { font-size: 0.8rem; color: var(--ink-faint); }

.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.18rem 0.65rem; border-radius: 999px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-gray { background: #ececec; color: var(--ink-soft); }
.badge-orange { background: var(--oasoft-orange-light); color: var(--oasoft-orange-dark); }

.actions-row { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.table td.actions-row { margin-top: 0; justify-content: flex-end; }
.inline-form { display: flex; gap: 0.5rem; align-items: center; }
.inline-form select { width: auto; margin: 0; }

.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { flex: 1; font-family: var(--mono); font-size: 0.85rem; }
.copy-row button { flex-shrink: 0; margin-top: 0.4rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 0.75rem 0 0.5rem; }
.stat-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  position: relative;
  overflow: hidden;
}
.stat-tile::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--oasoft-orange);
}
.stat-tile .stat-label { font-size: 0.76rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.35rem; }
.stat-tile .stat-value { font-size: 1.75rem; font-weight: 700; color: var(--anthracite); line-height: 1.2; }
.stat-tile .stat-sub { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.15rem; }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1.25rem 0 0.5rem; }
.quick-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--anthracite);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.quick-action:hover { border-color: var(--oasoft-orange); box-shadow: var(--shadow-md); text-decoration: none; }
.quick-action .qa-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--oasoft-orange-light); color: var(--oasoft-orange);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.quick-action strong { display: block; }
.quick-action span.hint { font-size: 0.84rem; }

/* ---------- Kachelansicht für Listen ---------- */

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.tile {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tile:hover { border-color: var(--oasoft-orange); box-shadow: var(--shadow-md); }
.tile .tile-title { font-weight: 700; color: var(--anthracite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tile-title a { color: inherit; }
.tile .tile-title a::after { content: ""; position: absolute; inset: 0; }
.tile .tile-meta { font-size: 0.8rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; }
.tile .tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.tile .tile-foot form, .tile .tile-foot .btn-link { position: relative; z-index: 1; }

/* ---------- Datei-Icons ---------- */

.ft {
  width: 36px; height: 36px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: #eef0f0; color: var(--anthracite-2);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
}
.ft-lg { width: 48px; height: 48px; border-radius: 10px; }
.ft-folder { background: var(--oasoft-orange-light); color: var(--oasoft-orange); }
.ft-image { background: #e7f3ec; color: #2e7d32; }
.ft-pdf { background: #fdecec; color: #c62828; }
.ft-doc { background: #e8f0fa; color: #1f6fb2; }
.ft-sheet { background: #e7f3ec; color: #1e7b45; }
.ft-slides { background: #fff0e3; color: #c2570c; }
.ft-archive { background: #f1ecf8; color: #6a3fa0; }
.ft-video { background: #fdeef5; color: #b0306a; }
.ft-audio { background: #eef3fb; color: #3b5ea8; }
.ft-text { background: #eef0f0; color: var(--anthracite-2); }
.ft-code { background: #2f3233; color: #f59e2c; }
.ft-share { background: var(--oasoft-orange-light); color: var(--oasoft-orange); }
.ft-req { background: #e8f0fa; color: #1f6fb2; }

/* ---------- Note / rich text ---------- */

.note-box {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  word-break: break-word;
  position: relative;
  line-height: 1.6;
}
.note-box p { margin: 0 0 0.75rem; }
.note-box p:last-child { margin-bottom: 0; }
.note-box ul, .note-box ol { margin: 0 0 0.75rem; padding-left: 1.5rem; }
.note-box code {
  background: #eee;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.9em;
}

.note-box-wrap { position: relative; }
.note-copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}
.note-copy-btn:hover { background: #f1f1f1; }

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  font-weight: normal;
  flex-wrap: wrap;
  background: #fafafa;
  border: 1px solid #d4d6d7;
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0.35rem;
}
.editor-btn {
  background: transparent;
  color: var(--anthracite-2);
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 5px;
}
.editor-btn:hover { background: #ececec; }
.editor-btn[aria-pressed="true"] { background: var(--oasoft-orange); color: #fff; }
.editor-count { margin-left: auto; font-size: 0.76rem; color: var(--ink-faint); font-weight: normal; padding-right: 0.4rem; }

.note-editor-html {
  min-height: 8rem;
  max-height: 24rem;
  overflow-y: auto;
  line-height: 1.5;
  background: #fff;
  border: 1px solid #d4d6d7;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: normal;
  color: var(--ink);
}
.note-editor-html p { margin: 0 0 0.6rem; }
.note-editor-html ul, .note-editor-html ol { margin: 0 0 0.6rem; padding-left: 1.5rem; }
.note-editor-html code {
  background: #f1f1f1;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.9em;
}
.note-editor-html.is-empty:before {
  content: attr(data-placeholder);
  color: var(--ink-faint);
  pointer-events: none;
}

/* ---------- Progress ---------- */

.progress-wrap { margin: 1rem 0; }
.progress-track {
  background: #ececec;
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.progress-bar {
  background: var(--oasoft-orange);
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.15s ease;
}
.progress-wrap .hint { margin: 0.4rem 0 0; }

/* Breiten in 5-%-Schritten (CSP erlaubt keine Inline-Styles) */
.w-0{width:0%}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}

/* ---------- Dateilisten (Kundenansicht, Upload-Seiten) ---------- */

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.2rem;
  border-bottom: 1px solid var(--border-soft);
  gap: 1rem;
}
.file-row:last-child { border-bottom: none; }
.file-row > span { display: flex; align-items: center; gap: 0.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#file-preview { list-style: none; padding: 0; margin: 0.5rem 0 1rem; font-size: 0.88rem; color: var(--ink-soft); }
#uploaded-list { margin: 0 0 1rem; }

.fb { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.fb-head {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.65rem 0.9rem;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}
.fb-crumbs { display: flex; align-items: center; gap: 0.2rem; font-size: 0.9rem; flex-wrap: wrap; min-width: 0; flex: 1; }
.fb-crumbs button { background: none; border: none; padding: 0.2rem 0.35rem; font-weight: 600; color: var(--anthracite-2); font-size: 0.9rem; }
.fb-crumbs button:hover { background: #ececec; }
.fb-crumbs button:last-child { color: var(--anthracite); }
.fb-crumbs .sep { color: var(--ink-faint); }
.fb-head-actions { display: flex; gap: 0.4rem; align-items: center; }

.fb-list { list-style: none; margin: 0; padding: 0; }
.fb-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
  min-height: 58px;
}
.fb-item:last-child { border-bottom: none; }
.fb-item:hover { background: var(--hover-bg); }
.fb-item .fb-name { flex: 1; min-width: 0; }
.fb-item .fb-name .fn { display: block; font-weight: 600; color: var(--anthracite); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-item .fb-name .fm { display: block; font-size: 0.8rem; color: var(--ink-faint); }
.fb-item.is-folder { cursor: pointer; }
.fb-item .fb-actions { display: flex; gap: 0.35rem; align-items: center; flex-shrink: 0; }
.fb-item .fb-status { font-size: 0.8rem; color: var(--ink-soft); white-space: nowrap; }
.fb-item .fb-status.ok { color: var(--green); }
.fb-item .fb-status.err { color: var(--red); }
.fb-item.is-done .ft { box-shadow: 0 0 0 2px var(--green-bg); }
.fb-mini { height: 4px; background: #ececec; border-radius: 999px; overflow: hidden; margin-top: 0.35rem; }
.fb-mini > div { height: 100%; background: var(--oasoft-orange); width: 0; transition: width 0.15s ease; }

.fb-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.6rem 0.9rem;
  background: #fafafa;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--ink-soft);
}

/* Kachelansicht im Dateibrowser */
.fb.is-grid .fb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; padding: 0.9rem; }
.fb.is-grid .fb-item { flex-direction: column; text-align: center; border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1rem 0.6rem 0.75rem; gap: 0.5rem; }
.fb.is-grid .fb-item .fb-name { width: 100%; }
.fb.is-grid .fb-item .ft { width: 64px; height: 64px; border-radius: 12px; font-size: 0.75rem; }
.fb.is-grid .fb-item .fb-actions { justify-content: center; flex-wrap: wrap; }
.fb.is-grid .fb-thumb { width: 100%; height: 96px; object-fit: cover; border-radius: 8px; }

/* ---------- Drop-Zone (Hochladen per Drag & Drop) ---------- */

.dropzone {
  border: 2px dashed #cfd2d3;
  border-radius: var(--radius);
  background: #fcfcfc;
  padding: 1.75rem 1rem;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
  margin-top: 0.4rem;
  font-weight: normal;
}
.dropzone .dz-icon {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--oasoft-orange-light); color: var(--oasoft-orange);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 0.6rem;
}
.dropzone .dz-title { font-weight: 700; color: var(--anthracite); font-size: 1rem; }
.dropzone .dz-sub { color: var(--ink-soft); font-size: 0.86rem; margin: 0.2rem 0 0.9rem; }
.dropzone .dz-buttons { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.dropzone.is-over { border-color: var(--oasoft-orange); background: var(--oasoft-orange-light); }
.dropzone input[type=file] { display: none; }

.selected-files { margin-top: 0.85rem; font-weight: normal; }
.selected-files .fb-item { min-height: 50px; padding: 0.45rem 0.75rem; }
.selected-files .ft { width: 32px; height: 32px; }

/* ---------- Vorschau-Dialog ---------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 22, 23, 0.92);
  display: flex;
  flex-direction: column;
}
.viewer-head {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
}
.viewer-head .viewer-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-head button { background: rgba(255, 255, 255, 0.12); color: #fff; }
.viewer-head button:hover { background: rgba(255, 255, 255, 0.22); }
.viewer-head .btn-primary { background: var(--oasoft-orange); }
.viewer-head .btn-primary:hover { background: var(--oasoft-orange-hover); }
.viewer-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 1rem; position: relative; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: var(--shadow-lg); background: #fff; }
.viewer-body audio { width: min(560px, 100%); }
.viewer-body iframe { width: min(1100px, 100%); height: 100%; border: none; background: #fff; border-radius: 6px; }
.viewer-body pre {
  width: min(1100px, 100%); max-height: 100%; overflow: auto; margin: 0;
  background: #fff; color: var(--ink); border-radius: 6px; padding: 1rem 1.25rem;
  font-family: var(--mono); font-size: 0.85rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.14); color: #fff; border-radius: 50%; width: 44px; height: 44px; padding: 0;
}
.viewer-nav:hover { background: rgba(255, 255, 255, 0.28); }
.viewer-prev { left: 1rem; }
.viewer-next { right: 1rem; }
.viewer-msg { color: #fff; text-align: center; }
.viewer-msg .spinner { margin-bottom: 0.75rem; }

code { background: #f1f1f1; padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.85em; word-break: break-all; font-family: var(--mono); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .topbar-app { display: none; }
}

@media (max-width: 860px) {
  .topbar { gap: 0.6rem; padding: 0 0.6rem 0 0.9rem; }
  .topbar-actions .tb-label { display: none; }
  .app-shell { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0.5rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .sidebar-cta, .storage-meter { display: none; }
  .side-nav { display: flex; gap: 0.25rem; overflow: visible; }
  .side-nav-group { display: flex; align-items: center; gap: 0.25rem; margin-bottom: 0; }
  .side-nav-label { display: none; }
  .side-nav a { white-space: nowrap; margin: 0; }
  .side-nav a.active::before { display: none; }
  .side-nav .nav-count { display: none; }
  .side-nav-footer { display: none; }
  .admin-main { padding: 1.25rem 1rem 3rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .centered-page { background-attachment: scroll; }
  .auth-card { padding: 1.75rem 1.25rem 1.5rem; }

  /* Wide tables (Freigaben, Upload-Anfragen, Protokolle, ...) become one
     card per row instead of a table needing sideways scrolling. Relies on
     a data-label="..." attribute on each <td> — cells without one (e.g. a
     lone "keine Daten" row) just render as plain stacked text. */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    padding: 0.8rem;
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
  }
  .table td { padding: 0.4rem 0; border: none; }
  .table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ink-faint);
    margin-bottom: 0.25rem;
  }
  .table td.actions-row { display: flex; flex-wrap: wrap; justify-content: flex-start; padding-top: 0.6rem; margin-top: 0.4rem; border-top: 1px solid var(--border-soft); }
  .table-wrap { overflow-x: visible; border: none; box-shadow: none; background: none; }
  button, .btn { min-height: 42px; }
  .btn-link, .icon-btn, .seg button, .fb-crumbs button { min-height: 0; }
  .fb-item { flex-wrap: wrap; }
  .fb-item .fb-actions { width: 100%; justify-content: flex-end; }
  .fb.is-grid .fb-item .fb-actions { width: auto; }
  .view-toggle { margin-left: 0; }
}

@media (max-width: 520px) {
  .topbar-search { display: none; }
  .topbar-actions { margin-left: auto; }
  .fb-head-actions .tb-label { display: none; }
}

/* ---------- 2FA setup (used by both share/2fa-setup.php and portal/2fa-setup.php) ---------- */

.app-tag {
  display: table;
  margin: 0 auto 1rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--oasoft-orange-dark);
  background: var(--oasoft-orange-light);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
}

.totp-setup-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.totp-secret-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-family: var(--mono);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--ink);
  word-break: break-all;
  text-align: center;
}
.totp-steps { color: var(--ink-soft); font-size: 0.88rem; line-height: 1.7; padding-left: 1.1rem; margin: 0.5rem 0 1.25rem; }
.totp-steps li { margin-bottom: 0.3rem; }
.hint-center { margin-top: 1.25rem; text-align: center; }

/* ---------- Small inline status text (WebAuthn setup/login feedback etc.) ---------- */
.state-saving { color: var(--amber); }
.state-saved { color: var(--green); }
.state-error { color: var(--red); }

/* ---------- oasoft Transfer: Produktlogo ---------- */
.topbar-app { display: inline-flex; align-items: center; gap: 0.5rem; }
.topbar-app-icon { width: 24px; height: 24px; display: block; }
.brand-lockup { display: flex; align-items: center; gap: 0.8rem; margin: 0 0 1.6rem; }
.brand-lockup img { width: 48px; height: 48px; display: block; }
.brand-lockup .bl-1 { display: block; font-size: 0.9rem; letter-spacing: 0.06em; color: var(--ink-soft); line-height: 1; }
.brand-lockup .bl-2 { display: block; font-size: 1.6rem; font-weight: 700; color: var(--anthracite); line-height: 1.05; }
.brand-lockup .bl-2 b { color: var(--oasoft-orange); }
