:root {
  --black: #111111;
  --ink: #1A1A1A;
  --graphite: #3A3A3A;
  --muted: #767676;
  --faint: #A8A8A8;
  --line: #E4E4E4;
  --line-soft: #EFEFEF;
  --paper: #FFFFFF;
  --bg: #FAFAFA;
  --hover: #F5F5F5;
  --accent: #2E7D5B;          /* dezentes Grün, sparsam als Akzent */
  --accent-soft: #EAF2EE;
  --danger: #8A2F24;
  --danger-soft: #FBEAE7;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --radius: 4px;
}

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

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .005em;
}

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

/* ===== HEADER ===== */
.lf-header { background: var(--black); color: var(--paper); }
.lf-header-inner {
  max-width: 1080px; margin: 0 auto; padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.lf-brand { display: flex; flex-direction: column; gap: 1px; }
.lf-brand .name {
  font-size: 1.15rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.lf-brand .sub {
  font-size: .68rem; color: var(--faint); text-transform: uppercase; letter-spacing: .22em;
}
.lf-header-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

.lf-lang { display: flex; gap: 2px; }
.lf-lang a {
  color: var(--faint); padding: 4px 8px; font-size: .74rem; letter-spacing: .08em;
  text-transform: uppercase; transition: color .15s;
}
.lf-lang a.active { color: var(--paper); font-weight: 700; border-bottom: 1.5px solid var(--paper); }
.lf-lang a:hover { color: var(--paper); text-decoration: none; }

.lf-nav { display: flex; gap: 4px; }
.lf-nav a {
  color: var(--faint); padding: 7px 14px; font-size: .82rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em; transition: color .15s;
}
.lf-nav a:hover { color: var(--paper); text-decoration: none; }
.lf-nav a.active { color: var(--paper); border-bottom: 1.5px solid var(--paper); }

.lf-logout { color: var(--faint); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.lf-logout:hover { color: var(--paper); }

/* thin hairline under header */
.lf-strip { height: 1px; background: var(--graphite); }

/* ===== LAYOUT ===== */
.lf-main { max-width: 1080px; margin: 0 auto; padding: 44px 24px 72px; }
.lf-page-title {
  font-size: 1.7rem; font-weight: 700; margin-bottom: 6px; color: var(--black);
  letter-spacing: -.01em;
}
.lf-page-sub {
  color: var(--muted); margin-bottom: 34px; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .1em;
}

/* ===== CARD ===== */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }

/* ===== FORM ===== */
.lf-form { padding: 34px; max-width: 660px; }
.lf-form .grid { display: grid; gap: 22px; }
.field label {
  display: block; font-size: .72rem; font-weight: 700; color: var(--black);
  margin-bottom: 7px; text-transform: uppercase; letter-spacing: .1em;
}
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: .95rem; font-family: inherit; color: var(--ink); background: var(--paper);
  transition: border-color .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--black);
}
.field textarea { resize: vertical; min-height: 84px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--black); color: var(--paper); border: 1px solid var(--black);
  padding: 12px 24px; border-radius: var(--radius); font-size: .8rem; font-weight: 600;
  font-family: inherit; text-transform: uppercase; letter-spacing: .08em;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--graphite); border-color: var(--graphite); text-decoration: none; }
.btn-block { width: 100%; justify-content: center; margin-top: 6px; }
.btn-sm { padding: 7px 13px; font-size: .68rem; letter-spacing: .06em; }
.btn-ghost { background: transparent; color: var(--black); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--hover); border-color: var(--black); color: var(--black); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }

/* ===== ALERT ===== */
.alert {
  padding: 15px 18px; border-radius: var(--radius); margin-bottom: 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: .9rem; border: 1px solid;
}
.alert-success { background: var(--accent-soft); color: #1F5740; border-color: #CFE3D8; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #E6C9C3; }
.alert .btn { flex-shrink: 0; }

/* ===== TOOLBAR / SEARCH ===== */
.lf-toolbar { margin-bottom: 22px; display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.lf-search { flex: 1; min-width: 220px; position: relative; }
.lf-search input {
  width: 100%; padding: 12px 14px 12px 40px; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: .92rem; background: var(--paper); font-family: inherit;
}
.lf-search input::placeholder { color: var(--faint); }
.lf-search input:focus { outline: none; border-color: var(--black); }
.lf-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table.lf-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.lf-table thead th {
  text-align: left; padding: 15px 18px; font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  border-bottom: 1px solid var(--black); white-space: nowrap;
}
table.lf-table tbody td { padding: 16px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.lf-table tbody tr:last-child td { border-bottom: none; }
table.lf-table tbody tr:hover { background: var(--hover); }
.voucher-no { font-weight: 700; color: var(--black); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: .02em; }
.item-name { font-weight: 600; color: var(--black); }
.item-desc { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.month-label { color: var(--faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }

.badge {
  display: inline-block; padding: 4px 11px; border-radius: 2px; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; border: 1px solid;
}
.badge-stored { background: var(--paper); color: var(--graphite); border-color: var(--line); }
.badge-returned { background: var(--accent-soft); color: var(--accent); border-color: #CFE3D8; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.lf-empty { padding: 72px 24px; text-align: center; color: var(--muted); }
.lf-empty svg { color: var(--line); margin-bottom: 14px; }
.lf-empty p { font-size: .9rem; }

/* ===== LOGIN ===== */
.lf-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.lf-login-card { width: 100%; max-width: 400px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lf-login-top { background: var(--black); padding: 38px 34px 30px; color: var(--paper); text-align: center; }
.lf-login-top .name { font-size: 1.2rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.lf-login-top .sub { font-size: .66rem; color: var(--faint); text-transform: uppercase; letter-spacing: .22em; margin-top: 5px; }
.lf-login-body { padding: 34px; }
.lf-login-body h1 { font-size: 1rem; color: var(--black); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .08em; }
.lf-login-body p { color: var(--muted); font-size: .88rem; margin-bottom: 24px; }
.lf-login-lang { display: flex; gap: 4px; justify-content: center; margin-top: 24px; }
.lf-login-lang a { font-size: .72rem; color: var(--faint); padding: 3px 8px; text-transform: uppercase; letter-spacing: .08em; }
.lf-login-lang a.active { color: var(--black); font-weight: 700; border-bottom: 1.5px solid var(--black); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
  .lf-header-inner { flex-direction: column; align-items: flex-start; }
  .lf-page-title { font-size: 1.4rem; }
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--black); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ======================================================
   FOTO-UPLOAD (Formular)
   ====================================================== */
.field-hint { color: var(--faint); font-weight: 400; letter-spacing: 0; text-transform: none; }
.field-note { font-size: .82rem; color: var(--muted); margin: -2px 0 10px; }

.photo-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 26px 18px; cursor: pointer; color: var(--muted);
  font-size: .85rem; font-weight: 600; text-align: center;
  transition: border-color .15s, background .15s, color .15s;
}
.photo-drop:hover, .photo-drop.has-files { border-color: var(--black); color: var(--black); }
.photo-drop svg { color: var(--faint); }
.photo-drop:hover svg, .photo-drop.has-files svg { color: var(--black); }

.photo-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.photo-thumb {
  width: 92px; height: 92px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--hover);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ======================================================
   KATALOG ALS KARTEN
   ====================================================== */
.lf-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }

.lf-card {
  display: flex; flex-direction: column; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.lf-card-photos { display: flex; gap: 2px; background: var(--line); height: 168px; }
.lf-thumb {
  flex: 1; border: none; padding: 0; cursor: pointer; background-size: cover;
  background-position: center; background-repeat: no-repeat; min-width: 0;
}
.lf-thumb.main { flex: 2; }
.lf-thumb-empty {
  display: flex; align-items: center; justify-content: center;
  background: var(--hover); color: var(--faint); cursor: default;
}

.lf-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; }
.lf-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lf-card-name { font-size: 1.05rem; font-weight: 700; color: var(--black); line-height: 1.25; }
.lf-card-desc { font-size: .86rem; color: var(--muted); margin-top: -2px; }

.lf-card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 4px 0 6px; }
.lf-card-meta div { min-width: 0; }
.lf-card-meta dt {
  font-size: .62rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1px;
}
.lf-card-meta dd { font-size: .92rem; color: var(--ink); font-weight: 500; }

.lf-card .row-actions { margin-top: 4px; }
.lf-card .row-actions form { display: inline; margin: 0; }

/* ======================================================
   LIGHTBOX (Foto groß)
   ====================================================== */
.lf-lightbox {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.88);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.lf-lightbox[hidden] { display: none; }
.lf-lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius); }
.lf-lightbox-close {
  position: absolute; top: 14px; right: 18px; background: none; border: none;
  color: #fff; font-size: 2.4rem; line-height: 1; cursor: pointer; padding: 4px 12px;
}

/* ======================================================
   MOBILE (Smartphone-first Feinschliff)
   ====================================================== */
@media (max-width: 720px) {
  .lf-main { padding: 26px 16px 56px; }
  .lf-header-inner { padding: 16px; gap: 12px; }
  .lf-page-title { font-size: 1.35rem; }
  .lf-page-sub { margin-bottom: 24px; }

  /* Navigation als kompakte, fingerfreundliche Leiste */
  .lf-header-actions { width: 100%; justify-content: space-between; gap: 12px; }
  .lf-nav { order: 3; width: 100%; }
  .lf-nav a { flex: 1; text-align: center; padding: 10px 8px; }

  .lf-cards { grid-template-columns: 1fr; gap: 14px; }
  .lf-card-photos { height: 200px; }

  .lf-form { padding: 20px 16px; }
  .field-row { grid-template-columns: 1fr; gap: 18px; }

  /* Toolbar: Suche oben, Button volle Breite darunter */
  .lf-toolbar { flex-direction: column; }
  .lf-toolbar .btn { width: 100%; justify-content: center; }

  /* größere Touch-Ziele */
  .field input, .field textarea { padding: 14px; font-size: 16px; } /* 16px = kein iOS-Zoom */
  .lf-search input { padding: 14px 14px 14px 42px; font-size: 16px; }
  .btn { padding: 13px 20px; }
  .btn-sm { padding: 10px 14px; font-size: .72rem; }
  .row-actions { gap: 8px; }
  .row-actions .btn, .row-actions form { flex: 1; }
  .row-actions form .btn { width: 100%; }

  .photo-thumb { width: 78px; height: 78px; }
}

@media (max-width: 380px) {
  .lf-brand .name { font-size: 1rem; letter-spacing: .1em; }
  .row-actions { flex-direction: column; }
  .row-actions .btn, .row-actions form { width: 100%; flex: none; }
}
