:root {
  --navy: #1F3864;
  --navy-dark: #16284a;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --danger: #c0392b;
  --green: #1a6b3c;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
}

.view { min-height: 100vh; min-height: 100dvh; }
.hidden { display: none !important; }

/* ---------- LOGIN ---------- */
#loginView {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top));
}
.card {
  background: var(--card);
  border-radius: 18px;
  padding: 32px 26px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}
.brand { text-align: center; margin-bottom: 24px; }
.brand-icon { font-size: 48px; }
.brand h1 { color: var(--navy); font-size: 28px; margin-top: 4px; }
.sub { color: var(--muted); font-size: 14px; }

form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input[type=email], input[type=password] {
  font-size: 16px; /* verhindert iOS-Zoom beim Fokus */
  padding: 13px 14px;
  border: 1px solid #cbd2dc;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(31,56,100,0.15); }

button {
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 10px;
}
#loginBtn {
  background: var(--navy);
  color: #fff;
  padding: 14px;
  margin-top: 6px;
}
#loginBtn:active { background: var(--navy-dark); }
#loginBtn:disabled { opacity: 0.6; }

.msg { text-align: center; font-size: 13px; min-height: 18px; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--green); }

/* ---------- DATEI-ANSICHT ---------- */
.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo { font-size: 18px; font-weight: 700; }
.actions { display: flex; gap: 8px; }
.icon-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  width: 38px; height: 38px;
  border-radius: 9px;
  font-size: 18px;
  line-height: 1;
}
.icon-btn:active { background: rgba(255,255,255,0.3); }

.content { padding: 14px; padding-bottom: 100px; }

.file-list { display: flex; flex-direction: column; gap: 10px; }
.file-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.file-icon { font-size: 28px; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.file-buttons { display: flex; gap: 4px; flex-shrink: 0; }
.file-buttons button {
  width: 40px; height: 40px;
  border-radius: 9px;
  font-size: 18px;
  background: #eef1f6;
}
.btn-download { color: var(--navy); }
.btn-delete { color: var(--danger); }
.file-buttons button:active { background: #dde3ec; }

.empty { text-align: center; padding: 80px 20px; color: var(--muted); }
.empty-icon { font-size: 64px; }
.empty p { margin-top: 8px; }

.fab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 14px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  display: flex;
  justify-content: center;
}
.fab {
  background: var(--navy);
  color: #fff;
  padding: 15px 26px;
  border-radius: 30px;
  box-shadow: 0 6px 18px rgba(31,56,100,0.4);
  width: 100%;
  max-width: 400px;
}
.fab:active { background: var(--navy-dark); }
.fab:disabled { opacity: 0.6; }
.upload-progress { text-align: center; color: var(--navy); font-size: 13px; margin-top: 8px; }

.toast {
  position: fixed;
  bottom: 96px; left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 100;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  max-width: 90%;
}
.toast.ok { background: var(--green); }
.toast.error { background: var(--danger); }
