/* ══════════════════════════════════════════════════════════
   held: cloud — Kundenportal
   Design-System nach held: werbe & grafik studio
   Heldenblau #1369B0 · Nachtblau · Zodiak + Archivo
   ══════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Zodiak';
  src: url('../fonts/zodiak-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Zodiak';
  src: url('../fonts/zodiak-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-latin.woff2') format('woff2');
  font-weight: 300 800; font-style: normal; font-display: swap;
}

:root {
  --bg: #0A0A0B;
  --bg-2: #0E0E10;
  --surface: #131316;
  --surface-2: #19191D;
  --surface-3: #202026;
  --line: rgba(255, 255, 255, 0.09);
  --text: #F1F1EF;
  --text-2: #9C9C9A;
  --brand: #1369B0;
  --brand-2: #4C9FE0;
  --brand-soft: rgba(76, 159, 224, 0.10);
  --danger: #E4574F;
  --danger-soft: rgba(228, 87, 79, 0.12);
  --danger-text: #F3B0AC;
  --ok: #3FA46A;
  --ok-soft: rgba(63, 164, 106, 0.14);
  --ok-text: #A9DDBE;
  --ok-badge: #7ECF9E;
  --warn: #D9A23B;
  --warn-soft: rgba(217, 162, 59, 0.14);
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.6);
  --font-display: 'Zodiak', Georgia, serif;
  --font-body: 'Archivo', system-ui, sans-serif;
  --radius: 14px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #F7F7F5;
  --bg-2: #EFEFEC;
  --surface: #FFFFFF;
  --surface-2: #F4F4F2;
  --surface-3: #E9E9E6;
  --line: rgba(0, 0, 0, 0.10);
  --text: #131313;
  --text-2: #6E6E6C;
  --brand: #0F5E9E;
  --brand-2: #1369B0;
  --brand-soft: rgba(19, 105, 176, 0.08);
  --danger: #C6423B;
  --danger-soft: rgba(198, 66, 59, 0.09);
  --danger-text: #8D2F29;
  --ok: #2E7D4F;
  --ok-soft: rgba(46, 125, 79, 0.11);
  --ok-text: #1F5B38;
  --ok-badge: #2E7D4F;
  --warn: #A87A1D;
  --warn-soft: rgba(168, 122, 29, 0.12);
  --shadow: 0 24px 50px -28px rgba(0, 0, 0, 0.14);
  color-scheme: light;
}

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

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

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

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.01em;
}
h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }

.muted { color: var(--text-2); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.break { word-break: break-word; }
code {
  font-family: ui-monospace, monospace; font-size: 0.85em;
  background: var(--surface-2); padding: 1px 6px; border-radius: 6px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 14px/1 var(--font-body);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background .18s var(--ease-out), border-color .18s, opacity .18s, transform .12s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--text-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: #1878C9; border-color: #1878C9; }
.btn-danger-ghost { color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-brand-ghost { color: var(--brand-2); }
.btn-brand-ghost:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.icon-btn {
  background: none; border: 0; color: var(--text-2); cursor: pointer;
  font-size: 14px; padding: 4px 8px; border-radius: 8px;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 0 clamp(16px, 4vw, 40px);
  height: 64px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.25rem; font-weight: 700;
  color: var(--text); text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-colon { color: var(--brand-2); }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a {
  color: var(--text-2); font-weight: 500; font-size: 14px;
  padding: 8px 12px; border-radius: 8px; white-space: nowrap;
}
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--brand-soft); }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--text-2); font-size: 14px; }

/* ── Layout ── */
.app-main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px);
}
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }

.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px clamp(16px, 4vw, 40px);
  border-top: 1px solid var(--line);
  color: var(--text-2); font-size: 13px;
}
.footer a { color: var(--text-2); }
.footer-links { display: flex; gap: 18px; }

/* ── Theme-Umschalter ── */
.theme-btn {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text-2); cursor: pointer;
  width: 40px; height: 40px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s, border-color .15s;
}
.theme-btn:hover { color: var(--text); background: var(--surface-3); border-color: var(--text-2); }
.theme-btn svg { width: 19px; height: 19px; }
.theme-btn .icon-moon { display: none; }
[data-theme="light"] .theme-btn .icon-sun { display: none; }
[data-theme="light"] .theme-btn .icon-moon { display: block; }
.theme-btn--float {
  position: fixed; top: 16px; right: 16px; z-index: 50;
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, 0.5);
}

/* ── Auth-Seiten ── */
.auth-page {
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(19, 105, 176, 0.22), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(19, 105, 176, 0.12), transparent 55%),
    var(--bg);
}
[data-theme="light"] .auth-page {
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(19, 105, 176, 0.12), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(19, 105, 176, 0.07), transparent 55%),
    var(--bg);
}
.auth-main {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(28px, 5vw, 40px);
}
.auth-brand {
  font-family: var(--font-display);
  font-size: 1.9rem; font-weight: 700;
  margin-bottom: 6px;
}
.auth-sub { color: var(--text-2); margin-bottom: 24px; font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.auth-links { margin-top: 20px; font-size: 14px; text-align: center; }

input[type="text"], input[type="email"], input[type="password"], textarea, select {
  font: 400 15px var(--font-body);
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  width: 100%;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand-2);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.alert {
  border-radius: 10px; padding: 12px 14px;
  font-size: 14px; margin-bottom: 18px;
  border: 1px solid;
}
.alert-error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger-text); }
.alert-ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok-text); }

/* ── Projekt-Karten ── */
.project-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.project-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--text);
  transition: border-color .18s, transform .18s var(--ease-out), background .18s;
}
.project-card:hover {
  text-decoration: none;
  border-color: var(--brand);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.project-icon { color: var(--brand-2); }
.project-icon svg { width: 30px; height: 30px; }
.project-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.project-open { color: var(--text-2); font-size: 13px; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 14px; font-size: 14px; min-height: 22px;
}
.breadcrumb a, .breadcrumb span { color: var(--text-2); }
.breadcrumb a:hover { color: var(--text); text-decoration: none; }
.breadcrumb .crumb-sep { opacity: 0.4; }
.breadcrumb .crumb-current { color: var(--text); font-weight: 600; }

/* ── Explorer ── */
.explorer {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 260px;
}
.explorer.drag-over { border-color: var(--brand-2); }
.explorer.drag-over .drop-hint { display: flex; }
.drop-hint {
  display: none;
  position: absolute; inset: 0; z-index: 5;
  align-items: center; justify-content: center;
  background: rgba(19, 105, 176, 0.18);
  backdrop-filter: blur(2px);
  font-family: var(--font-display); font-size: 1.3rem;
  pointer-events: none;
}

.file-table { width: 100%; border-collapse: collapse; }
.file-table th {
  text-align: left; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-2);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.file-table td { padding: 9px 14px; border-bottom: 1px solid var(--line); }
.file-table tbody tr { transition: background .12s; }
.file-table tbody tr:hover { background: var(--surface-2); }
.file-table tbody tr.selected { background: var(--brand-soft); }
.file-table tbody tr:last-child td { border-bottom: 0; }
.col-check { width: 36px; }
.col-size { width: 110px; white-space: nowrap; }
.col-date { width: 150px; white-space: nowrap; }
.col-actions { width: 90px; text-align: right; }
.file-name {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); cursor: pointer; max-width: 100%;
}
.file-name:hover { text-decoration: none; color: var(--brand-2); }
.file-name svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }
.file-name.is-dir svg { color: var(--brand-2); }
.file-label { overflow-wrap: anywhere; }
.row-btns { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s; }
tr:hover .row-btns, tr.selected .row-btns { opacity: 1; }
input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; cursor: pointer; }

.empty-state {
  text-align: center; padding: 56px 20px;
  color: var(--text-2);
}
.empty-state p:first-child { font-size: 1.05rem; color: var(--text); margin-bottom: 6px; }

/* ── Upload-Panel ── */
.upload-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: min(380px, calc(100vw - 40px));
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.upload-panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.upload-panel-head span { color: var(--text-2); font-size: 13px; flex: 1; }
.upload-list { max-height: 260px; overflow-y: auto; }
.upload-item { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.upload-item:last-child { border-bottom: 0; }
.upload-item-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.upload-item-name { overflow-wrap: anywhere; }
.upload-item-status { color: var(--text-2); white-space: nowrap; }
.upload-item.error .upload-item-status { color: var(--danger); }
.upload-item.done .upload-item-status { color: var(--ok); }
.progress { height: 4px; background: var(--bg); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand-2); width: 0%; transition: width .2s; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  width: 100%; max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}
.modal h2 { margin-bottom: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 12px;
}
.modal .member-list {
  max-height: 220px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; margin-bottom: 12px;
}
.modal .member-list label {
  flex-direction: row; align-items: center; gap: 10px;
  font-weight: 400; color: var(--text); font-size: 14px;
  padding: 6px 8px; margin: 0; border-radius: 8px; cursor: pointer;
}
.modal .member-list label:hover { background: var(--surface-2); }
.modal .member-mail { color: var(--text-2); font-size: 12px; }
.modal .file-list-preview {
  color: var(--text-2); font-size: 13px;
  max-height: 120px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 12px;
}

/* ── Daten-Tabellen (Admin) ── */
.data-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th {
  text-align: left; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-2);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn { margin-left: 4px; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 999px; margin-left: 6px;
}
.badge-brand { background: var(--brand-soft); color: var(--brand-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok-badge); margin-left: 0; }
.badge-wait { background: var(--warn-soft); color: var(--warn); margin-left: 0; }
.badge-warn { background: var(--danger-soft); color: var(--danger); margin-left: 0; }

.footnote { margin-top: 16px; font-size: 13px; max-width: 70ch; }

/* ── Quota ── */
.quota-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.quota-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; font-size: 14px; }
.quota-row span { color: var(--text-2); }
.quota-bar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.quota-fill { height: 100%; background: var(--brand-2); border-radius: 4px; }
.quota-fill.quota-hot { background: var(--danger); }

/* ── Papierkorb-Tabs ── */
.trash-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.trash-tab {
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-2); font-size: 14px;
}
.trash-tab:hover { color: var(--text); text-decoration: none; }
.trash-tab.active { background: var(--brand-soft); border-color: var(--brand); color: var(--text); }

/* ── Responsive ── */
@media (max-width: 720px) {
  .topbar { height: auto; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .nav { order: 3; width: 100%; }
  .col-date, .col-size { display: none; }
  .row-btns { opacity: 1; }
  .data-table { display: block; overflow-x: auto; }
  .page-head { flex-direction: column; align-items: stretch; }
}
