/* Fit for CEREC – Lernplattform
   Farben/Schrift entsprechen dem bestehenden Mitgliederbereich */
:root {
  --key: #acc410;
  --key-dark: #7a8a12;
  --key-hover: #9bb20c;
  --key-tint: #f9fbec;
  --text: #0a0a0a;
  --muted: #6b6b6b;
  --card: #ffffff;
  --field-bg: #f3f3ef;
  --border: #e3e3dc;
  --warn-bg: #ead8a2;
  --success: #5cb85c;
  --danger: #c9302c;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Open Sans", Arial, sans-serif, Helvetica;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--key-tint);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
h2.green, .page-title { color: var(--key-dark); font-weight: 700; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; flex: 1; }

/* ---------- Kopfzeile ---------- */
.topbar { background: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(0,0,0,.04); }
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 28px; min-height: 64px; }
.logo img { height: 48px; width: auto; display: block; }
.topnav { display: flex; gap: 22px; flex: 1; }
.topnav a { text-decoration: none; color: var(--key-dark); font-size: 15px; }
.topnav a:hover, .topnav a.active { color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 18px; font-size: 14px; margin-left: auto; }
.topbar-right a, .topbar-right button { background: none; border: 0; cursor: pointer; font: inherit; color: var(--text); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.menu-burger { font-size: 26px !important; color: #555 !important; }

@media (max-width: 720px) {
  .topnav { display: none; }
  .topbar-right .label { display: none; }
}

/* ---------- Offcanvas-Menü ---------- */
.offcanvas { position: fixed; top: 0; right: 0; height: 100vh; width: 320px; max-width: 88vw; background: #fff; z-index: 101;
  transform: translateX(100%); transition: transform .25s ease; overflow-y: auto; padding: 56px 0 24px; box-shadow: -4px 0 24px rgba(0,0,0,.08); }
.offcanvas.open { transform: none; }
.offcanvas-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .25s; }
.offcanvas-backdrop.open { opacity: 1; pointer-events: auto; }
.offcanvas-close { position: absolute; top: 14px; right: 16px; background: none; border: 0; font-size: 22px; cursor: pointer; }
.menu-section { padding: 6px 0; border-bottom: 1px solid var(--border); }
.menu-section:last-child { border: 0; }
.menu-section h5 { margin: 10px 22px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.menu-link { display: flex; align-items: center; gap: 12px; padding: 9px 22px; text-decoration: none; font-size: 15px; }
.menu-link:hover { background: var(--key-tint); }
.menu-link i { width: 18px; text-align: center; color: var(--key-dark); }
.menu-link .menu-edit { margin-left: auto; color: var(--muted); }
.menu-sub { padding-left: 52px; font-size: 14px; }
.badge { background: var(--key); color: #000; border-radius: 100px; font-size: 11px; padding: 1px 8px; margin-left: auto; font-weight: 600; }

/* ---------- Buttons ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--key); color: #000; border: 0;
  border-radius: 100px; padding: 10px 26px; font: inherit; font-size: 16px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.button:hover { background: var(--key-hover); }
.button.small { font-size: 14px; padding: 5px 16px; }
.button.big { font-size: 18px; padding: 14px 34px; }
.button.secondary { background: #555; color: #fff; }
.button.secondary:hover { background: #333; }
.button.ghost { background: transparent; border: 1px solid var(--border); }
.button.danger { background: var(--danger); color: #fff; }
.button[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 34px; height: 30px; border-radius: 6px; background: var(--key); border: 0; display: inline-flex; align-items: center; justify-content: center; color: #000; cursor: pointer; text-decoration: none; font-size: 14px; }
.icon-btn.plain { background: transparent; color: var(--muted); }
.icon-btn.plain:hover { color: var(--text); }

/* ---------- Brotkrumen + Hinweise ---------- */
.crumbs { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; font-size: 14px; }
.crumbs a { text-decoration: none; }
.crumbs .path { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs .path .sep { color: var(--muted); }
.alert { background: var(--warn-bg); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 16px; font-size: 15px; }
.alert i { color: #b58a1b; margin-right: 6px; }
.alert.info { background: #e6efc4; }
.alert.error { background: #f5d0ce; }

/* ---------- Karten ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.card.flat { padding: 0; overflow: hidden; }
.card-title { font-size: 20px; font-weight: 400; margin-bottom: 16px; }

/* ---------- Startseite ---------- */
.hero { margin: 16px 0 32px; }
.hero img { display: block; width: 100%; height: auto; }
.section-title { color: var(--key-dark); font-size: 26px; font-weight: 700; margin: 0 0 18px; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.course-tile { background: #fff; border-radius: var(--radius); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; position: relative; transition: box-shadow .2s; }
.course-tile:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.course-tile .thumb { aspect-ratio: 4/3; background: #ddd center/cover no-repeat; margin: 16px 16px 0; }
.course-tile .body { padding: 14px 18px 18px; }
.course-tile h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.course-tile .meta { font-size: 13px; color: var(--muted); }
.course-tile .lock { position: absolute; top: 24px; right: 24px; background: rgba(0,0,0,.6); color: #fff; border-radius: 100px; padding: 4px 10px; font-size: 12px; }
.course-tile .tile-edit { position: absolute; top: 24px; left: 24px; }
.status-pill { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 100px; background: #eee; color: #555; margin-left: 6px; vertical-align: middle; }

/* ---------- Kursseite ---------- */
.course-head { display: grid; grid-template-columns: 280px 1fr; gap: 32px; }
.course-head img { width: 100%; border-radius: 2px; }
.course-head h2 { font-size: 34px; color: var(--key-dark); }
.rich { font-size: 15px; }
.rich p { margin: 0 0 1em; }
.rich h2, .rich h3 { color: var(--key-dark); }
.rich a { color: #1a73c9; }
.rich iframe, .rich video { max-width: 100%; }
@media (max-width: 760px) { .course-head { grid-template-columns: 1fr; } }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.list-head h3 { color: var(--key-dark); font-size: 22px; margin: 0; }
.rows { background: #fff; border-radius: var(--radius); overflow: hidden; }
.row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--border); text-decoration: none; }
.row:last-child { border-bottom: 0; }
.row:hover { background: #fcfdf6; }
.row .row-icon { width: 54px; height: 40px; border-radius: 6px; background: var(--key); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; overflow: hidden; }
.row .row-icon img { width: 100%; height: 100%; object-fit: cover; }
.row .row-main { flex: 1; min-width: 0; }
.row .row-title { font-size: 16px; }
.row .row-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.row .row-actions { display: flex; gap: 4px; }
.row .done { color: var(--success); }
.row.unpublished .row-title { color: var(--muted); }
.row.unpublished .row-title::after { content: " (unveröffentlicht)"; font-size: 12px; }
.row[draggable="true"] { cursor: grab; }
.row.drag-over { box-shadow: inset 0 3px 0 var(--key); }
.drag-handle { color: #bbb; cursor: grab; }

/* ---------- Lektion ---------- */
.lesson-layout { display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start; }
.lesson-layout h2 { grid-column: 1 / -1; color: var(--key-dark); font-size: 32px; margin: 0; }
.video-wrap { position: relative; aspect-ratio: 16/9; background: #000; }
.video-wrap iframe, .video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lesson-nav { text-align: center; padding: 22px; }
.lesson-nav .count { color: var(--key-dark); font-size: 24px; font-weight: 700; line-height: 1.3; margin-bottom: 18px; }
.progress { height: 10px; background: #e7e7e3; border-radius: 100px; overflow: hidden; margin-bottom: 22px; }
.progress > div { height: 100%; background: var(--success); }
.lesson-nav .button { width: 100%; white-space: normal; }
.lesson-nav .back { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--muted); text-decoration: none; }
.lesson-done { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; font-size: 14px; }
@media (max-width: 860px) { .lesson-layout { grid-template-columns: 1fr; } }

/* ---------- Downloads ---------- */
.file-type { font-size: 12px; text-transform: lowercase; color: var(--muted); margin-right: 6px; }

/* ---------- Admin-Formulare ---------- */
.admin-title { display: flex; gap: 14px; align-items: flex-start; margin: 10px 0 22px; }
.admin-title > i { font-size: 34px; color: #666; margin-top: 4px; }
.admin-title h1 { color: var(--key-dark); font-size: 36px; margin: 0; }
.admin-title .sub { font-size: 18px; margin-top: 2px; }
.tabs-bar { background: #ebebe6; border-radius: var(--radius) var(--radius) 0 0; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 8px; padding-right: 8px; }
.tabs { display: flex; flex-wrap: wrap; }
.tabs a { padding: 12px 18px; text-decoration: none; font-size: 15px; border-right: 1px solid #e0e0da; display: inline-flex; gap: 7px; align-items: center; }
.tabs a i { color: #777; font-size: 13px; }
.tabs a.active { background: #fff; }
.tabs-actions { display: flex; gap: 6px; padding: 8px 0; }
.tab-panel { background: #fff; border-radius: 0 0 var(--radius) var(--radius); padding: 22px; margin-bottom: 24px; }
.field { background: var(--field-bg); border-radius: var(--radius); padding: 12px 12px 14px; margin-bottom: 12px; }
.field > label, .field-label { display: block; margin-bottom: 8px; font-size: 15px; }
.field h4 { font-size: 20px; font-weight: 400; }
.field-hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  font: inherit; font-size: 15px; border: 1px solid #d6d6cf; border-radius: 4px; padding: 9px 11px; background: #fff; width: 100%; max-width: 480px; color: var(--text);
}
textarea { max-width: 100%; min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--key); outline-offset: 0; border-color: var(--key); }
.check { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--field-bg); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--key-dark); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; align-items: center; background: var(--field-bg); border-radius: var(--radius); padding: 14px; }
.form-grid label { font-size: 15px; }
.form-grid .two { display: flex; gap: 8px; max-width: 480px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input[type=number] { width: 90px; }
.inline select { width: auto; }

/* Editor */
.editor { border: 1px solid #d6d6cf; border-radius: 4px; background: #fff; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid #e6e6e0; background: #fafaf8; }
.editor-toolbar button { background: none; border: 0; padding: 5px 8px; border-radius: 4px; cursor: pointer; color: #555; font-size: 14px; }
.editor-toolbar button:hover, .editor-toolbar button.on { background: #ebebe6; color: #000; }
.editor-toolbar .sep { width: 1px; background: #ddd; margin: 2px 4px; }
.editor-area { min-height: 180px; padding: 12px 14px; outline: none; font-size: 15px; }
.editor-source { width: 100%; min-height: 220px; border: 0; font-family: Consolas, monospace; font-size: 13px; padding: 12px; max-width: none; border-radius: 0 0 4px 4px; }

/* Tabellen */
.table-wrap { background: #fff; border-radius: var(--radius); overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 400; padding: 12px 10px 6px; background: #f6f6f2; white-space: nowrap; }
table.data tr.filters th { padding: 0 10px 10px; }
table.data tr.filters input { padding: 5px 8px; font-size: 13px; }
table.data td { padding: 9px 10px; border-top: 1px solid #efefea; vertical-align: middle; }
table.data tr:hover td { background: #fcfdf6; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 14px; font-size: 14px; }
.text-ok { color: var(--success); }
.text-off { color: #bbb; }
.text-muted { color: var(--muted); }

/* Zugänge im Mitgliederformular */
.access-row { background: var(--field-bg); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.access-row .check { background: none; padding: 0; margin: 0; }
.access-limit { margin: 10px 0 2px 28px; font-size: 14px; }
.access-limit .inline { margin-top: 6px; }
.expired { color: var(--danger); font-size: 13px; }

/* Login */
.auth-box { max-width: 440px; margin: 48px auto; }
.auth-box h2 { color: var(--key-dark); text-align: center; }
.auth-box .field input { max-width: none; }
.auth-box .button { width: 100%; }
.auth-links { text-align: center; margin-top: 14px; font-size: 14px; }


.code-input { letter-spacing: .4em; text-align: center; font-size: 22px !important; }
.secret { font-family: Consolas, monospace; font-size: 13px; word-break: break-all; background: var(--field-bg); padding: 8px; border-radius: 6px; }

/* Kein Zugriff */
.no-access { background: #edf2d6; border: 1px solid #d9e2b0; border-radius: var(--radius); text-align: center; padding: 48px 20px; margin-bottom: 32px; }
.no-access h2 { color: var(--key-dark); font-size: 30px; }
.no-access .button { margin: 10px 0; }

/* Footer */
.footer { background: #fff; margin-top: 32px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 22px 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-logo { height: 40px; }
.footer-links { display: flex; gap: 18px; font-size: 14px; align-items: center; }
.footer-links a { text-decoration: none; color: var(--muted); }

/* Toast + Modal */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120px); background: #222; color: #fff; padding: 12px 22px; border-radius: 100px; z-index: 300; transition: transform .25s; font-size: 15px; max-width: calc(100vw - 32px); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: var(--radius); padding: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; }
.modal h3 { color: var(--key-dark); }

.loading { text-align: center; padding: 60px 0; color: var(--muted); }
.empty { padding: 22px; text-align: center; color: var(--muted); }
.hp { position: absolute; left: -9999px; }

/* =====================================================================
   Responsiv: iPhone (bis 760px), iPad (761–1024px), Desktop
   ===================================================================== */
html { -webkit-text-size-adjust: 100%; }
.topbar { padding-top: env(safe-area-inset-top); }
.footer-inner { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
img, video, iframe { max-width: 100%; }
.loading-btn { opacity: .5; pointer-events: none; }

/* Tabs scrollen waagerecht statt umzubrechen */
.tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { white-space: nowrap; }

/* iPad */
@media (max-width: 1024px) {
  .course-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
  .lesson-layout { grid-template-columns: 1fr 230px; }
  .admin-title h1 { font-size: 30px; }
}

/* iPad hochkant und kleiner */
@media (max-width: 860px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; align-items: center; text-align: left; }
  .lesson-nav .count { margin: 0; font-size: 20px; }
  .lesson-nav .count br { display: none; }
  .lesson-nav .progress { margin: 0; }
  .lesson-nav .button { grid-column: 1 / -1; }
  .lesson-nav .back, .lesson-nav .lesson-done { margin: 0; justify-content: flex-start; }
}

/* iPhone */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .container { padding: 0 12px 32px; }
  .topbar-inner { min-height: 56px; gap: 12px; padding: 6px 12px; }
  .logo img { height: 40px; }
  .offcanvas { width: 100%; max-width: 100vw; }
  .menu-link { padding: 13px 22px; }

  /* iOS zoomt bei Schrift < 16px ins Eingabefeld – verhindern */
  input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
  input[type=date], input[type=tel], input[type=search], select, textarea { font-size: 16px; max-width: 100%; }

  .crumbs { flex-wrap: wrap; padding: 12px 0; }
  .card { padding: 16px; margin-bottom: 16px; }
  .section-title { font-size: 22px; }
  .course-head { gap: 16px; }
  .course-head h2, .lesson-layout h2 { font-size: 24px; }
  h2.green { font-size: 24px !important; }
  .course-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .course-tile .thumb { margin: 10px 10px 0; }
  .course-tile .body { padding: 10px 12px 14px; }
  .course-tile h3 { font-size: 14px; }
  .course-tile .meta { font-size: 12px; }
  .hero { margin: 8px -12px 20px; }

  .row { padding: 12px; gap: 12px; }
  .row .row-icon { width: 46px; height: 34px; }
  .row .row-title { font-size: 15px; }
  .icon-btn { width: 40px; height: 40px; }
  .list-head { flex-wrap: wrap; }
  .list-head h3 { font-size: 19px; }

  .admin-title { gap: 10px; }
  .admin-title > i { font-size: 24px; }
  .admin-title h1 { font-size: 24px; }
  .admin-title .sub { font-size: 15px; }
  .tab-panel { padding: 14px; }
  .tabs a { padding: 12px 14px; font-size: 14px; }
  .form-actions { justify-content: stretch; }
  .form-actions .button { flex: 1 1 100%; }
  .form-grid .two { flex-direction: column; }
  .inline input[type=number] { width: 80px; }
  .access-limit { margin-left: 0; }
  .auth-box { margin: 20px auto; }
  .modal { padding: 18px; }

  /* Tabellen werden zu Karten */
  table.data.cards thead tr:first-child { display: none; }
  table.data.cards, table.data.cards tbody, table.data.cards tr, table.data.cards td { display: block; width: 100%; }
  table.data.cards thead { display: block; }
  table.data.cards tr.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; background: #f6f6f2; }
  table.data.cards tr.filters th { display: block; padding: 0; }
  table.data.cards tr.filters th:empty { display: none; }
  table.data.cards tbody tr { border-top: 1px solid #efefea; padding: 10px 14px; }
  table.data.cards td { border: 0; padding: 3px 0; display: flex; gap: 10px; align-items: baseline; }
  table.data.cards td[data-label]::before { content: attr(data-label); flex: 0 0 105px; color: var(--muted); font-size: 13px; }
  table.data.cards td:empty { display: none; }
  table.data.cards td.actions { padding-top: 8px; flex-wrap: wrap; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* Sehr schmale Handys */
@media (max-width: 380px) {
  .course-grid { grid-template-columns: 1fr; }
}

/* Rechtstexte */
.rich h3 { font-size: 20px; margin-top: 1.4em; }
.rich h4 { font-size: 16px; margin: 1.1em 0 .4em; }
.rich h5 { font-size: 15px; margin: 1em 0 .3em; }
.rich table { border-collapse: collapse; margin: 0 0 1em; max-width: 100%; display: block; overflow-x: auto; }
.rich th, .rich td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; font-size: 14px; }
.legal a { word-break: break-all; }

/* 2FA: QR-Code responsiv und gut scanbar */
.qr { display: flex; justify-content: center; margin: 14px 0 16px; }
.qr svg, .qr img { display: block; width: 100%; max-width: 260px; height: auto; aspect-ratio: 1 / 1; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 6px; image-rendering: pixelated; }
.mfa-steps { font-size: 15px; padding-left: 20px; margin: 0 0 6px; }
.mfa-steps li { margin-bottom: 6px; }
.qr-manual { font-size: 14px; margin: 0 0 14px; }
.qr-manual summary { cursor: pointer; color: var(--key-dark); padding: 6px 0; }
.qr-manual .secret { font-size: 15px; letter-spacing: .08em; margin: 8px 0; user-select: all; }
@media (max-width: 760px) {
  .qr svg, .qr img { max-width: 220px; }
}
/* =====================================================================
   Kacheln wie im Original (Module, Lektionen, Download-Kategorien, Dateien)
   ===================================================================== */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 8px; }
.tiles .empty { grid-column: 1 / -1; background: #fff; border-radius: var(--radius); }
.tile-col { position: relative; display: flex; }
.tile-col[draggable="true"] { cursor: grab; }
.tile-col.drag-over > .tile, .tile-col.drag-over > .file-tile { box-shadow: 0 0 0 3px var(--key); }

.tile { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; background: #fff;
  border-radius: 10px; padding: 20px; text-decoration: none; color: var(--text); border: 1px solid transparent;
  transition: box-shadow .15s, transform .15s; position: relative; min-width: 0; }
.tile:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .07); transform: translateY(-1px); }
.tile-img { width: 100%; height: 150px; display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 14px; }
.tile-img img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.tile-placeholder { font-size: 54px; color: #dfe6b5; }
.tile h2 { font-size: 22px; font-weight: 700; color: var(--key-dark); margin: 0 0 6px; line-height: 1.3; overflow-wrap: anywhere; }
.tile h3 { font-size: 16px; font-weight: 700; color: var(--key-dark); margin: 0 0 6px; line-height: 1.35; overflow-wrap: anywhere; }
.tile-sub { font-size: 14px; color: var(--muted); margin-top: auto; padding-top: 4px; }
.tile.unpublished { opacity: .6; }
.tile .status-pill { margin: 0 0 6px; }

/* Lektionen: größeres Bild, Play-Knopf */
.tile-lesson { padding-bottom: 12px; }
.tile-lesson .tile-img { height: 170px; }
.tile-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 60px; height: 60px; border-radius: 50%;
  background: var(--key); color: #000; display: flex; align-items: center; justify-content: center; font-size: 22px; padding-left: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.tile:hover .tile-play { background: var(--key-hover); }
.tile-done { position: absolute; top: 12px; left: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--success); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13px; }

/* Admin-Leiste oben rechts */
.tile-admin { position: absolute; top: 6px; right: 6px; z-index: 2; display: flex; gap: 4px; }
.ab-btn { width: 30px; height: 30px; border-radius: 5px; background: rgba(235, 235, 235, .9); color: #808080; display: inline-flex;
  align-items: center; justify-content: center; font-size: 14px; text-decoration: none; cursor: pointer; }
.ab-btn:hover { background: #dcdcdc; color: #333; }
.ab-move { cursor: grab; }

/* Dateien: grüner Streifen links mit Dateityp */
.file-tile { flex: 1; position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 110px; background: #fff;
  border-radius: 10px; padding: 18px 18px 18px 65px; text-decoration: none; color: var(--text); overflow: hidden; transition: box-shadow .15s; }
.file-tile:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .07); }
.file-strip { position: absolute; left: 0; top: 0; bottom: 0; width: 45px; background: var(--key); color: #000; display: flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 600; text-transform: lowercase; writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .05em; }
.file-tile h3 { font-size: 16px; font-weight: 700; color: var(--key-dark); margin: 0 0 4px; line-height: 1.35; overflow-wrap: anywhere; }
.file-tile .tile-sub { margin-top: 0; }
.file-tile.unpublished { opacity: .6; }

@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .tile { padding: 16px; }
  .tile-img { height: 130px; }
  .tile-lesson .tile-img { height: 150px; }
  .tile h2 { font-size: 19px; }
}

/* Warndreieck: noch nicht veröffentlicht */
.ab-warn { background: #fff1dc; color: #f08c00; font-size: 15px; cursor: help; }
.ab-warn:hover { background: #ffe4bd; color: #e07b00; }
.tile.unpublished, .file-tile.unpublished { opacity: .78; }

/* Kurskacheln mit Admin-Leiste */
.course-grid > .tile-col > .course-tile { flex: 1; min-width: 0; }
.course-tile.unpublished { opacity: .78; }
.course-grid .tile-admin { top: 22px; right: 22px; }

/* Inhalte veröffentlichen */
.pub-table td { padding: 10px 12px; }
.pub-table tr.parent td { background: #f6f6f2; border-top: 1px solid #e6e6e0; }
.pub-table .pub-sub { padding-left: 36px; }
.pub-table i.fa { color: #7a9bbf; margin-right: 6px; }
.pub-state { text-align: right; white-space: nowrap; }
.unpub-badge { display: inline-flex; gap: 6px; align-items: center; background: #ead8a2; color: #5c4a10; border-radius: 4px; padding: 4px 10px; font-size: 13px; margin-right: 8px; }
.unpub-badge i.fa { color: #b58a1b !important; margin: 0 !important; }
.alert a { font-weight: 600; text-decoration: underline; }
@media (max-width: 640px) {
  .pub-table td { display: block; padding: 8px 12px; }
  .pub-state { text-align: left; padding-top: 0 !important; }
  .pub-table .pub-sub { padding-left: 24px; }
}

/* Einladungslink teilen */
.share-card .share-usage { margin: 0 0 8px; }
.share-card .progress { margin-bottom: 16px; }
.share-link { display: flex; gap: 8px; margin-bottom: 16px; }
.share-link input { max-width: none; flex: 1; font-family: Consolas, monospace; font-size: 13px; background: var(--field-bg); }
.share-mail { border-top: 1px solid var(--border); padding-top: 14px; }
.share-mail .field input, .share-mail textarea { max-width: none; }
.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
@media (max-width: 560px) { .share-link { flex-direction: column; } .share-buttons .button { flex: 1 1 100%; } }

/* Veröffentlichungs-Status (Admin) */
.tile-status { margin-top: 10px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 100px; display: inline-flex; gap: 5px; align-items: center; }
.tile-status.is-pub { background: #e8f5e3; color: #3c8a2e; }
.tile-status.is-unpub { background: #fff1dc; color: #c76f00; }
.course-tile .tile-status { margin-top: 8px; }
.tile.unpublished, .course-tile.unpublished { opacity: .85; }
.status-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; font-size: 15px; }
.status-bar.is-pub { background: #e8f5e3; color: #2f6d24; }
.status-bar.is-unpub { background: #fff1dc; color: #9a5600; }
.status-line { margin: -12px 0 14px; }
.status-chip { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 100px; }
.status-chip.is-pub { background: #e8f5e3; color: #3c8a2e; }
.status-chip.is-unpub { background: #fff1dc; color: #c76f00; }
.thumb-preview { display: block; max-width: 260px; max-height: 180px; object-fit: contain; border-radius: 6px; margin-bottom: 10px; background: #fff; }

/* 2FA: Gerät merken */
.auth-box .remember-device { display: flex; justify-content: center; gap: 8px; margin: 2px 0 14px; font-size: 14px; }

