/* =========================================================
   Wohnwagengewicht – styles.css
   Light Design · Mobile First · SwiftUI-nah
   ========================================================= */

/* ---------- Reset / Base ---------- */
*{ box-sizing: border-box; }

html, body{
  height: 100%;
}

body{
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial,
               "Apple Color Emoji","Segoe UI Emoji";
  background: #f5f7fb;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* iOS: kein Zoom bei Inputs */
input, button, textarea{
  font-size: 16px;
}

/* ---------- Design Tokens ---------- */
:root{
  --bg: #f5f7fb;
  --card: #ffffff;
  --card2: #f8fafc;

  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15,23,42,.10);

  --brand: #2563eb;
  --danger: #dc2626;
  --warn: #b45309;

  --shadow: 0 10px 30px rgba(2,6,23,.08);
  --radius: 16px;
}

/* ---------- Layout ---------- */
.content{
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 12px 88px; /* Platz für Tabbar */
}

.page{
  display: block;
}

/* ---------- Topbar ---------- */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 10px 12px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.topbar__left{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.appmark{
  width: 36px;
  height: 36px;
  border-radius: 14px;
  background: rgba(37,99,235,.12);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-weight: 900;
}

.topbar__titles{
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar__subtitle{
  font-size: 12px;
  color: var(--muted);
}

.topbar__right{
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Editable Title ---------- */
.topbar__titleInput{
  width: min(420px, 56vw);
  min-width: 120px;
  font-weight: 900;
  font-size: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  padding: 4px 8px;
  border-radius: 12px;
  outline: none;
}

.topbar__titleInput::placeholder{
  color: var(--muted);
  font-weight: 800;
}

.topbar__titleInput:focus{
  border-color: rgba(37,99,235,.45);
  background: rgba(255,255,255,.85);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ---------- Buttons ---------- */
.iconbtn{
  width: 36px;
  height: 36px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(2,6,23,.06);
}

.iconbtn:active{
  transform: scale(.98);
}

.btn{
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(2,6,23,.06);
}

.btn:active{
  transform: scale(.99);
}

.btn--ghost{
  background: transparent;
  box-shadow: none;
}

.btn--danger{
  background: rgba(220,38,38,.10);
  border-color: rgba(220,38,38,.25);
  color: var(--danger);
}

.smallbtn{
  border: 1px solid var(--line);
  background: white;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(2,6,23,.06);
}

/* ---------- Cards ---------- */
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.card--subtle{
  background: var(--card2);
  box-shadow: none;
}

.card__head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card__title{
  font-weight: 900;
  letter-spacing: .2px;
}

.card__hint{
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

/* ---------- Fields ---------- */
.field{
  display: block;
  min-width: 0;
}

.field__label{
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.input{
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  outline: none;
  box-shadow: 0 8px 18px rgba(2,6,23,.04);
}

.input:focus{
  border-color: rgba(37,99,235,.45);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ---------- Grid ---------- */
.grid2{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ---------- Photo ---------- */
.photo{
  position: relative;
  height: 180px;
  border-radius: 16px;
  overflow: hidden;
  background: #eef2ff;
}

.photo img{
  position: absolute;        /* ✅ entscheidender Fix */
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.photo__placeholder{
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

.photo__icon{
  font-size: 28px;
}

.photo input[type="file"]{
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---------- Rows (Übersicht) ---------- */
.rows{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
}

.row--tap{
  cursor: pointer;
}

.row--tap:active{
  background: rgba(0,0,0,.03);
  transform: scale(.99);
}

.row--emph{
  font-weight: 900;
}

.row__title{
  font-weight: 700;
}

.row__sub{
  font-size: 13px;
  color: var(--muted);
}

.row__value{
  font-weight: 800;
  white-space: nowrap;
}

/* ---------- Sections (Items) ---------- */
.section{
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

.section__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section__title{
  font-weight: 900;
}

.section__meta{
  font-size: 12px;
  color: var(--muted);
}

.section__actions{
  display: flex;
  gap: 6px;
}

.section__body{
  margin-top: 10px;
}

/* ---------- Pills ---------- */
.pill{
  border: 1px solid var(--line);
  background: white;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

/* ---------- Items ---------- */
.item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.item:last-child{
  border-bottom: none;
}

.item__left{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.item__name{
  font-weight: 700;
}

.item__sub{
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Toolbar ---------- */
.toolbar{
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

/* ---------- Tabbar ---------- */
.tabbar{
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  height: 64px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.tab{
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.tab--active{
  color: var(--brand);
  font-weight: 900;
}

.tab__icon{
  font-size: 18px;
}

/* ---------- Dialog ---------- */
.dialog::backdrop{
  background: rgba(0,0,0,.35);
}

.dialog__panel{
  border: none;
  border-radius: 20px;
  padding: 14px;
  max-width: 420px;
  width: calc(100% - 24px);
}

.dialog__head{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog__title{
  font-weight: 900;
}

.dialog__body{
  margin: 12px 0;
}

.dialog__foot{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dialog__foot--split{
  justify-content: space-between;
}

/* ---------- Helpers ---------- */
.hint{
  font-size: 13px;
  color: var(--muted);
}

.sep{
  border: none;
  border-top: 1px solid var(--line);
  margin: 12px 0;
}
	  /* ---------- Item Touch / Mobile UX ---------- */
.item{
  border-radius: 12px;
  padding: 12px 10px;         /* größerer Touchbereich */
  margin: 6px 0;
}

.item:active{
  background: rgba(0,0,0,.03);
  transform: scale(.995);
}

.item__hit{
  display:flex;
  align-items:center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

/* Checkbox größer & angenehmer */
.item input[type="checkbox"]{
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
}

/* damit Text nicht “fummelig” wird */
.item__name{ line-height: 1.15; }
.item__sub{ line-height: 1.2; }

