*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #0e9b8e; --secondary: #0b5c63; --dark: #10302f; --light: #f4faf8;
  --line: #e3ece9; --text: #1d2b2a; --muted: #6b817f; --radius: 14px;
  --shadow: 0 12px 40px -22px rgba(11,60,55,.4);
}
body { font-family: 'Manrope', system-ui, sans-serif; background: #eef4f2; color: var(--text); line-height: 1.55; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--secondary), var(--primary)); padding: 1.5rem; }
.login-card { background: #fff; padding: 2.6rem; border-radius: 20px; width: min(400px, 100%); box-shadow: var(--shadow); }
.login-card h1 { font-size: 1.6rem; margin-bottom: .3rem; color: var(--dark); }
.login-card p { color: var(--muted); margin-bottom: 1.6rem; font-size: .9rem; }
.login-logo { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; margin-bottom: 1.2rem; }

/* Layout */
.admin { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--dark); color: #cfe3df; padding: 1.6rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar__brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 800; font-size: 1.15rem; margin-bottom: 2rem; padding: 0 .6rem; }
.sidebar__brand span { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), #7bd0c2); display: grid; place-items: center; }
.sidebar nav { display: flex; flex-direction: column; gap: .2rem; }
.sidebar nav a { color: #cfe3df; padding: .7rem .9rem; border-radius: 10px; font-weight: 600; font-size: .94rem; display: flex; align-items: center; gap: .7rem; transition: .2s; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar nav a.active { background: var(--primary); color: #fff; }
.sidebar nav a .badge { margin-left: auto; background: #e3563f; color: #fff; border-radius: 100px; font-size: .72rem; padding: .05rem .5rem; }
.sidebar__foot { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar__foot a { color: #9fc0ba; }

.main { padding: 2rem clamp(1.2rem, 3vw, 2.6rem); }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.8rem; flex-wrap: wrap; gap: 1rem; }
.topbar h1 { font-size: 1.7rem; color: var(--dark); }
.topbar a.view-site { font-weight: 700; color: var(--primary); }

.card { background: #fff; border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); margin-bottom: 1.4rem; border: 1px solid var(--line); }
.card h2 { font-size: 1.15rem; margin-bottom: 1.1rem; color: var(--dark); }
.card h2 small { font-weight: 500; color: var(--muted); font-size: .8rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label, label.field-label { font-weight: 700; font-size: .85rem; color: var(--secondary); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=url], textarea, select {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 10px; font-family: inherit; font-size: .95rem; background: #fff;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,155,142,.12); }
textarea { resize: vertical; min-height: 90px; }
input[type=color] { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; cursor: pointer; }

.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .7rem 1.3rem; border-radius: 100px; font-weight: 700; border: 0; cursor: pointer; font-size: .92rem; font-family: inherit; transition: .25s; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--secondary); }
.btn--light { background: var(--light); color: var(--secondary); }
.btn--danger { background: #fdecec; color: #b3261e; }
.btn--danger:hover { background: #f9d6d6; }
.btn--sm { padding: .45rem .9rem; font-size: .82rem; }

.flash { padding: .9rem 1.1rem; border-radius: 10px; margin-bottom: 1.2rem; font-weight: 600; }
.flash--success { background: #e3f6f1; color: #0a6b5e; }
.flash--error { background: #fdecec; color: #b3261e; }

.stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.6rem; }
.stat { background: #fff; border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); border: 1px solid var(--line); }
.stat strong { font-size: 2rem; color: var(--primary); display: block; }
.stat span { color: var(--muted); font-size: .9rem; }
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 1rem; }
.quick-link { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); transition: .25s; }
.quick-link:hover { transform: translateY(-4px); }
.quick-link strong { display: block; color: var(--dark); margin-bottom: .2rem; }
.quick-link span { color: var(--muted); font-size: .85rem; }

table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: .8rem .6rem; border-bottom: 1px solid var(--line); font-size: .92rem; vertical-align: top; }
table.data th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.tag { display: inline-block; padding: .12rem .7rem; border-radius: 100px; font-size: .78rem; font-weight: 700; }
.tag--kasse { background: #e3f6f1; color: #0a6b5e; }
.tag--privat { background: #eee6fb; color: #6b3fb3; }
.tag--new { background: #fff0e6; color: #b3551e; }

.item-row { display: flex; align-items: center; gap: 1rem; padding: .9rem; border: 1px solid var(--line); border-radius: 12px; margin-bottom: .8rem; background: #fff; }
.item-row img { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; background: var(--light); }
.item-row__info { flex: 1; }
.item-row__info strong { display: block; }
.item-row__info span { color: var(--muted); font-size: .85rem; }
.item-row__actions { display: flex; gap: .5rem; }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 1rem; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4/3; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb form { position: absolute; top: 6px; right: 6px; }
.thumb button { background: rgba(0,0,0,.6); color: #fff; border: 0; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; }

details.acc { border: 1px solid var(--line); border-radius: 12px; margin-bottom: .9rem; background: #fff; overflow: hidden; }
details.acc summary { padding: 1rem 1.2rem; font-weight: 700; cursor: pointer; color: var(--dark); list-style: none; display: flex; justify-content: space-between; }
details.acc summary::after { content: '+'; color: var(--primary); font-size: 1.3rem; }
details.acc[open] summary::after { content: '−'; }
details.acc .acc__body { padding: 0 1.2rem 1.3rem; }
.hint { font-size: .8rem; color: var(--muted); }
.row-actions { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.preview-img { max-width: 120px; border-radius: 8px; margin-top: .5rem; border: 1px solid var(--line); }
.repeat-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: .6rem; margin-bottom: .6rem; align-items: center; }

@media (max-width: 820px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: flex; flex-direction: column; }
  .grid-2, .grid-3, .stats { grid-template-columns: 1fr 1fr; }
  .repeat-row { grid-template-columns: 1fr; }
}
