:root {
  --bg: #f4f3eb;
  --bg-soft: #faf9f3;
  --card: #ffffff;
  --card-soft: #f6f7ef;
  --text: #1a1f16;
  --muted: #657060;
  --line: #d9dfcf;
  --primary: #93a81a;
  --primary-dark: #6f7f13;
  --primary-soft: #eef3d5;
  --accent: #1d2218;
  --accent-soft: #eff1ea;
  --danger: #b64040;
  --danger-soft: #fde8e8;
  --warning: #b98a2e;
  --warning-soft: #fff4d8;
  --success: #2f8f46;
  --shadow: 0 14px 34px rgba(41, 48, 33, 0.10);
  --shadow-soft: 0 8px 20px rgba(41, 48, 33, 0.07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at 8% 0%, rgba(47, 125, 74, .16), transparent 30%),
    radial-gradient(circle at 95% 4%, rgba(165, 111, 42, .13), transparent 27%),
    linear-gradient(180deg, #e6f0e1 0%, #f6faf4 42%, #eef5ea 100%);
  color: var(--text);
}

.page-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.card {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

.narrow { max-width: 520px; margin: 60px auto; }
.topbar, .section-head, .brand-row, .topbar-actions, .button-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.topbar { flex-wrap: wrap; }
.brand-row { justify-content: flex-start; }
.brand-icon {
  width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary-soft), #f8faf5); color: var(--primary-dark); font-size: 28px;
}

h1, h2, h3 { margin: 0 0 6px; color: var(--text); }
p { margin: 0; }
a { color: var(--primary-dark); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.stack-tight { display: grid; gap: 4px; }
.crumb { color: var(--primary-dark); text-decoration: none; font-weight: 700; }
.crumb:hover { color: var(--primary); text-decoration: underline; }

.hero-card, .small-hero, .dark-card, .dark-hero {
  background:
    linear-gradient(135deg, rgba(35, 93, 56, .96), rgba(47, 125, 74, .92) 58%, rgba(165, 111, 42, .82));
  color: #ffffff;
  border-color: rgba(255,255,255,.28);
}
.hero-card h1, .hero-card h2, .hero-card h3,
.small-hero h1, .small-hero h2, .small-hero h3,
.dark-card h1, .dark-card h2, .dark-card h3,
.dark-hero h1, .dark-hero h2, .dark-hero h3 { color: #ffffff; }
.hero-card .muted, .small-hero .muted, .dark-card .muted, .dark-hero .muted,
.hero-card p, .small-hero p, .dark-card p, .dark-hero p { color: rgba(255,255,255,.84); }
.hero-card .user-pill, .small-hero .user-pill, .dark-card .user-pill, .dark-hero .user-pill {
  background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.18);
}

.user-pill, .pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-dark); border: 1px solid rgba(47, 125, 74, .13);
}
.pill.subtle { background: #f0f4ee; color: #516051; }
.pill.accent { background: var(--accent-soft); color: #74501f; }
.pill.yellow { background: var(--warning-soft); color: #7e5b12; }
.pill.red { background: var(--danger-soft); color: #9b2d2d; }
.pill.green { background: #e2f4e6; color: #245f39; }
.pill.im_wachstum, .pill.aktiv, .pill.eingelagert, .pill.freigegeben { background: #e4f5e9; color: #245f39; }
.pill.in_bluete, .pill.in_trocknung, .pill.getrimmt_verarbeitet, .pill.im_curing { background: #e8efff; color: #2f4d8b; }
.pill.unter_beobachtung { background: var(--warning-soft); color: #805d12; }
.pill.gesperrt, .pill.zur_vernichtung { background: var(--danger-soft); color: #9b2d2d; }

.btn {
  appearance: none; border: 1px solid transparent; border-radius: 12px; padding: 11px 16px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-weight: 750; transition: transform .12s ease, background .12s ease, color .12s ease, border .12s ease, box-shadow .12s ease;
  line-height: 1.15;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover, .btn.primary:focus { background: var(--primary-dark); color: #fff; }
.btn.ghost { background: #eef5eb; color: var(--primary-dark); border-color: #d6e4d0; }
.btn.ghost:hover, .btn.ghost:focus { background: var(--primary-soft); color: #173d26; border-color: #b9d7bd; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover, .btn.danger:focus { background: #933333; color: #fff; }

.alert { padding: 12px 14px; border-radius: 12px; margin: 14px 0; }
.alert.error { background: var(--danger-soft); color: #9b2d2d; }
.helper-box { margin-top: 18px; padding: 14px; border-radius: 16px; background: var(--card-soft); border: 1px solid var(--line); }
code { background: #eef4eb; padding: 2px 6px; border-radius: 6px; color: #1d3c27; }

.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px;
}
.stat-card { display: grid; gap: 6px; }
.stat-card.warning { background: linear-gradient(180deg, #fff8e8, #fff); }
.stat-card.accent, .stat-card.storage { background: linear-gradient(180deg, #edf8ef, #fff); }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 34px; font-weight: 800; color: var(--text); }
.stat-link, .stat-foot { color: var(--primary-dark); text-decoration: none; font-weight: 700; }
.stat-link:hover { color: var(--primary); text-decoration: underline; }
.button-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.admin-grid { display: grid; gap: 18px; }

.main-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.nav-chip, .process-step, .action-list a {
  text-decoration: none; color: var(--text); border: 1px solid var(--line); background: rgba(255,255,255,.96);
  border-radius: 18px; padding: 16px; display: grid; gap: 5px; box-shadow: var(--shadow-soft);
  transition: transform .12s ease, border .12s ease, background .12s ease;
}
.nav-chip:hover, .process-step:hover, .action-list a:hover {
  transform: translateY(-2px); background: #f7fbf4; border-color: #b9d7bd; color: var(--text);
}
.nav-chip strong, .process-step b {
  width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-dark);
}
.nav-chip span, .process-step span { font-weight: 850; }
.nav-chip small, .process-step small, .action-list span { color: var(--muted); }
.process-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px;
  background: rgba(255,255,255,.72); border-radius: var(--radius);
}
.dashboard-grid { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(320px, 1.1fr); gap: 18px; }
.flow-list, .action-list { display: grid; gap: 12px; }
.flow-list div {
  padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card-soft); display: grid; gap: 4px;
}
.flow-list span { color: var(--muted); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid.compact { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 650; }
label.full { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  background: #ffffff; color: var(--text); font: inherit;
  transition: border .12s ease, box-shadow .12s ease, background .12s ease;
}
input:hover, select:hover, textarea:hover { border-color: #b8d2b5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,125,74,.15); background: #fff;
}
input::placeholder, textarea::placeholder { color: #8a9788; }
textarea { min-height: 90px; resize: vertical; }
.checkbox { display: flex; align-items: center; gap: 8px; padding-top: 30px; }
.checkbox input { width: auto; }
.tiny-input, .mini-input { max-width: 90px; padding: 9px; }

.detail-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; margin-bottom: 18px; }
.status-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.mini-card {
  padding: 16px; border-radius: 16px; background: var(--card-soft); border: 1px solid var(--line); display: grid; gap: 8px;
}
.mini-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.mini-value { font-size: 28px; font-weight: 850; color: var(--text); }
.mini-foot { color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: var(--text); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #526250; background: #edf5ea; font-weight: 850; }
tr:hover td { background: #f5faf3; color: var(--text); }
.flagged-row td { background: #fff8ea; }
.warn-yellow td:first-child, .warn-red td:first-child { border-left: 4px solid transparent; }
.warn-yellow td:first-child { border-left-color: #d9a72d; }
.warn-red td:first-child { border-left-color: #c74747; }
.warn-yellow { background: #fff9e8; }
.warn-red { background: #fff0f0; }

.water-switch {
  border: 1px solid transparent; border-radius: 999px; padding: 7px 12px; font-weight: 800; cursor: pointer;
}
.water-switch.on { background: #daf4e1; color: #215635; }
.water-switch.off { background: #fee5e5; color: #a03737; }
.water-switch:hover { filter: brightness(.98); box-shadow: var(--shadow-soft); }

.stock-dot { width: 14px; height: 14px; border-radius: 999px; display:inline-block; vertical-align:middle; margin-right:6px; background:#2f8f46; box-shadow:0 0 0 4px rgba(47,143,70,.12); }
.stock-dot.green { background: #2f8f46; }
.stock-dot.yellow { background:#d6ad45; box-shadow:0 0 0 4px rgba(214,173,69,.16); }
.stock-yellow { background: #fff8e8; }
.stock-green { background: #edf8ef; }
.active-grow { font-weight: 800; background: #f0f8ef; }
.past-grow { opacity: .68; }
.past-grow:hover { opacity: 1; }

.task-board { border: 1px solid #c7ddc2; background: rgba(255,255,255,.96); }
.task-list { display: grid; gap: 10px; margin-top: 16px; }
.task-item {
  display:flex; justify-content:space-between; gap:14px; align-items:center; padding:14px; border-radius:16px;
  background:#f7fbf4; border:1px solid var(--line); color: var(--text);
}
.task-item:hover { background: #eef7ec; }
.task-item.task-done { opacity:.72; background: #edf4ea; }
.task-item.task-overdue {
  border-color: rgba(182,132,34,.65); background: #fff6df; font-weight: 850;
  box-shadow: 0 0 0 1px rgba(182,132,34,.14) inset;
}

@media (max-width: 900px) {
  .detail-grid, .dashboard-grid { grid-template-columns: 1fr; }
  .page-shell { width: min(100% - 20px, 1400px); margin-top: 16px; }
}
@media (max-width: 720px) {
  .page-shell { width: min(100% - 18px, 1400px); margin-top: 10px; }
  .process-strip { grid-template-columns: 1fr; }
  .topbar-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .task-item { align-items: stretch; flex-direction: column; }
}

.process-flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; }
.focus-card { border-color: #b8d7b8; background: linear-gradient(180deg, #ffffff 0%, #f2f8ef 100%); }
.collapsible { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.82); padding: 0; margin: 12px 0 18px; overflow: hidden; }
.collapsible summary { cursor: pointer; padding: 15px 18px; font-weight: 850; color: var(--primary-dark); background: #edf6e9; list-style: none; }
.collapsible summary::-webkit-details-marker { display: none; }
.collapsible summary:hover { background: #e4f1df; color: var(--primary-dark); }
.collapsible[open] summary { border-bottom: 1px solid var(--line); }
.collapsible form { padding: 16px; }
.task-table .task-row.task-overdue td { background: #fff3d6; font-weight: 850; border-top: 2px solid #d6ad45; }
.task-table .task-row.task-done td { background: #eef5eb; opacity: .8; }
.task-table button { margin: 2px; }
.task-form { align-items: end; }
input[id^="sb"], input[id^="pb"], input[id^="rel"], input[id^="pbtostorage"] { min-width: 82px; }
.stock-yellow td { background: #fff8e8; }
.stock-green td { background: #f3faf1; }
.card table input, .card table select { padding: 8px 9px; border-radius: 10px; }


.hidden{display:none !important;}
.header-menu{position:relative;}
.header-menu summary{list-style:none;}
.header-menu summary::-webkit-details-marker{display:none;}
.header-menu-panel{position:absolute; right:0; top:calc(100% + 8px); min-width:240px; background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:var(--shadow); padding:10px; display:grid; gap:6px; z-index:30;}
.header-menu-panel a{padding:10px 12px; border-radius:12px; text-decoration:none; color:var(--text); font-weight:700;}
.header-menu-panel a:hover{background:#f1f7ee; color:var(--primary-dark);}
.super-focus-card{border:2px solid #8dbd8e; background:linear-gradient(180deg,#fffef9 0%,#f1f8ee 100%); box-shadow:0 18px 38px rgba(47,125,74,.14);}
.super-focus-card .section-head h2{font-size:1.4rem;}
.task-highlight-wrap{margin-top:14px; border:1px solid #cadfc5; border-radius:18px; overflow:hidden;}
.special-task-table thead th{background:linear-gradient(180deg,#dfeedd,#edf7ea);}
.special-task-table tbody tr td:first-child{border-left:4px solid transparent;}
.special-task-table .task-overdue td:first-child{border-left-color:#d6ad45;}
.special-task-table .task-done td:first-child{border-left-color:#77a777;}
.grow-top-grid{align-items:start;}
@media (max-width:720px){.header-menu-panel{left:0; right:auto; min-width:220px;}}
.hero-logo-card{padding:18px 22px;background:linear-gradient(135deg,#f6f4eb 0%,#fcfbf7 55%,#eef4df 100%);border:1px solid #d8e1c6;}
.hero-brand-block{display:flex;align-items:center;gap:18px;flex-wrap:wrap;}
.hero-logo-wide{max-width:420px;width:min(100%,420px);height:auto;display:block;filter:drop-shadow(0 6px 14px rgba(0,0,0,.06));}
.login-brand{align-items:center;gap:16px;}.login-logo{width:72px;height:72px;object-fit:contain;}
.compact-actions{align-items:flex-start;}.compact-menu summary{padding:10px 13px;font-size:14px;}
.right-panel{right:0;left:auto;}.small-menu-btn{min-width:auto;}
.header-menu-panel{position:absolute;top:48px;min-width:210px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:8px;display:grid;gap:4px;z-index:20;}.header-menu-panel a{padding:10px 12px;border-radius:10px;text-decoration:none;color:var(--text);font-weight:700;}.header-menu-panel a:hover{background:#f3f8ee;color:var(--primary-dark);} 
.process-flow-top{margin-top:18px;margin-bottom:18px;}
.task-board-home{margin-top:18px;margin-bottom:22px;border:2px solid #c4d890;background:linear-gradient(135deg,#fffdf6 0%,#f7f9ef 52%,#fff 100%);box-shadow:0 18px 40px rgba(137,161,32,.13);}
.task-board-home .section-head h2{font-size:28px;color:#3c4d13;}
.task-board-home .task-highlight-wrap{border:1px solid #d8dfbe;border-radius:16px;background:#fffdf8;}
.special-task-table thead th{background:#eef1d8;color:#4c571f;}
.special-task-table tbody tr:hover td{background:#fafcee;}
.super-focus-card{position:relative;overflow:hidden;}
.super-focus-card::before{content:"";position:absolute;inset:0 auto 0 0;width:8px;background:linear-gradient(180deg,#89a120,#d0b052);} 
.card-inside-collapse{margin-top:12px;}
.grow-top-grid .card{margin-bottom:0;}
@media (max-width: 720px){.hero-logo-wide{max-width:280px;}.task-board-home .section-head h2{font-size:24px;}}

.hero-logo-card{background:linear-gradient(135deg,#fcfbf7 0%,#f7f6ef 46%,#eef2dd 100%);}
.hero-logo-card h1,.hero-logo-card p{color:var(--accent);} 
.hero-logo-card .user-pill{background:#ffffff;color:var(--accent);border-color:#d9dfcf;}
.process-step b{background:var(--primary-soft);color:var(--primary-dark);} 
.btn.primary{background:linear-gradient(135deg,var(--primary),#a5ba26);color:#1a1f16;border-color:#879c18;}
.btn.primary:hover,.btn.primary:focus{background:linear-gradient(135deg,#859816,#9bb022);color:#10140d;}
.small-hero,.small-hero h1,.small-hero p,.small-hero .crumb{color:#fff;}
.small-hero{background:linear-gradient(135deg,#24291d,#3a422c 65%,#788916);} 
.section-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:999px;background:var(--primary-soft);margin-right:8px;vertical-align:middle;}
.section-icon img{width:18px;height:18px;object-fit:contain;}
summary, .header-menu-panel a, .btn, th, td, input, select, textarea {color: var(--text);} 
.card h2{display:flex;align-items:center;gap:10px;}
.task-board-home{border:2px solid #b4c75b;background:linear-gradient(135deg,#fffdf5 0%,#f5f8ea 55%,#fff 100%);box-shadow:0 22px 42px rgba(147,168,26,.18);} 
.task-board-home .section-head h2{color:#556111;} 
.header-menu-panel a:hover,.btn.ghost:hover{color:var(--accent);} 


/* logo sizing fix */
.center-logo-link{display:flex;align-items:center;justify-content:center;flex:1;min-width:0;padding:0 10px;}
.header-logo-wide{width:min(100%,220px);max-width:220px;height:auto;display:block;object-fit:contain;filter:drop-shadow(0 4px 10px rgba(0,0,0,.05));}
.hero-logo-wide{max-width:300px !important;width:min(100%,300px) !important;height:auto;}
@media (max-width: 720px){
  .header-logo-wide{max-width:150px;width:min(100%,150px);}
  .hero-logo-wide{max-width:220px !important;width:min(100%,220px) !important;}
}

.quick-actions-card{background:linear-gradient(135deg,#ffffff 0%,#f4f9ef 100%);border-color:#c8ddc2;}
.quick-action-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-top:12px;}
.timeline-list{display:grid;gap:12px;}
.timeline-item{display:grid;grid-template-columns:120px 1fr;gap:14px;padding:14px;border:1px solid var(--line);border-radius:16px;background:#fbfdf8;}
.timeline-date{font-weight:850;color:var(--primary-dark);}
.small-stat{font-size:18px;line-height:1.25;}
.drying-green td{background:#f2faf1;}
.drying-yellow td{background:#fff8e8;}
.drying-red td{background:#fff0f0;}
.stock-dot.red{background:#c74747;box-shadow:0 0 0 4px rgba(199,71,71,.14);}
.stock-dot.subtle{background:#9aa59a;box-shadow:0 0 0 4px rgba(154,165,154,.14);}
@media (max-width:720px){.timeline-item{grid-template-columns:1fr}.quick-action-grid{grid-template-columns:1fr 1fr}}

/* unified app header/menu */
.app-global-header{background:linear-gradient(135deg,#fcfbf7 0%,#f7f6ef 46%,#eef2dd 100%);align-items:center;}
.header-left-links.single-link{min-width:170px;display:flex;align-items:center;}
.header-context{font-weight:850;color:var(--accent);}
.menu-group{border:1px solid #e0e7d8;border-radius:12px;background:#f8fbf5;overflow:hidden;}
.menu-group > summary{padding:10px 12px;cursor:pointer;font-weight:850;color:var(--primary-dark);list-style:none;}
.menu-group > summary::-webkit-details-marker{display:none;}
.menu-group > a{display:block;margin:0 4px 4px 18px;padding:8px 10px !important;font-size:14px;background:#fff;border:1px solid #edf2e8;}
.menu-group[open] > summary{background:#edf6e9;border-bottom:1px solid #dce8d5;}

/* simplified storage view */
.storage-card-list{display:grid;gap:14px;}
.storage-batch-card{border:1px solid var(--line);border-radius:18px;background:#fff;padding:16px;display:grid;gap:14px;box-shadow:var(--shadow-soft);}
.storage-batch-main{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;flex-wrap:wrap;}
.storage-metrics{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;}
.storage-action-row{display:grid;grid-template-columns:minmax(130px,180px) minmax(110px,160px) auto auto;gap:10px;align-items:end;border-top:1px solid var(--line);padding-top:12px;}
.inline-details{border-top:1px dashed #d8dfcf;padding-top:8px;}
.inline-details > summary{cursor:pointer;font-weight:850;color:var(--primary-dark);list-style:none;}
.inline-details > summary::-webkit-details-marker{display:none;}
.inline-edit-grid{padding-top:12px;}
@media (max-width:720px){.storage-batch-main,.storage-metrics{display:grid;justify-content:stretch}.storage-action-row{grid-template-columns:1fr 1fr}.storage-action-row .btn{width:100%;}.header-left-links.single-link{min-width:0}}

/* v6: kompakter, einheitlicher Seitenkopf */
.app-page-header{
  padding:14px 16px;
  margin-bottom:18px;
  background:linear-gradient(135deg,#1f251b 0%,#354020 58%,#6f7f13 100%);
  color:#fff;
  border-color:rgba(255,255,255,.18);
  box-shadow:0 16px 36px rgba(31,37,27,.18);
}
.app-page-header .app-header-main{
  display:grid;
  grid-template-columns:auto auto minmax(220px,1fr) auto;
  align-items:center;
  gap:14px;
  width:100%;
}
.app-page-header .header-nav-slot{display:flex;align-items:center;min-width:118px;}
.app-page-header .header-back-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:9px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.13);
  color:#fff;
  border:1px solid rgba(255,255,255,.22);
  text-decoration:none;
  font-weight:850;
  white-space:nowrap;
}
.app-page-header .header-back-link:hover{
  background:#fff;
  color:#253014;
  text-decoration:none;
}
.app-page-header .header-logo-chip{
  display:flex;
  align-items:center;
  justify-content:center;
  width:156px;
  max-width:156px;
  padding:7px 10px;
  border-radius:16px;
  background:rgba(255,255,255,.94);
  border:1px solid rgba(255,255,255,.35);
  box-shadow:0 6px 16px rgba(0,0,0,.12);
}
.app-page-header .header-logo-wide{
  width:100%;
  max-width:136px;
  height:auto;
  object-fit:contain;
  filter:none;
}
.app-page-header .header-title-block{min-width:0;}
.app-page-header h1{
  color:#fff;
  margin:0 0 3px;
  font-size:clamp(22px,2.4vw,34px);
  line-height:1.05;
  letter-spacing:-.02em;
}
.app-page-header .header-title-block p{
  color:rgba(255,255,255,.86);
  margin:0;
  font-size:14px;
  line-height:1.35;
}
.app-page-header .header-action-slot{
  justify-content:flex-end;
  flex-wrap:nowrap;
  align-items:center;
}
.app-page-header .user-pill{
  background:rgba(255,255,255,.16);
  color:#fff;
  border-color:rgba(255,255,255,.24);
}
.app-page-header .small-menu-btn{
  background:#ffffff;
  color:#253014;
  border-color:rgba(255,255,255,.6);
  box-shadow:none;
}
.app-page-header .small-menu-btn:hover,
.app-page-header .small-menu-btn:focus{
  background:#f4f8ec;
  color:#1a1f16;
}
.app-page-header .pill{
  border-color:rgba(255,255,255,.45);
  box-shadow:0 4px 12px rgba(0,0,0,.08);
}
.app-page-header .header-menu-panel{
  top:calc(100% + 10px);
  right:0;
  left:auto;
  color:var(--text);
}
.app-page-header .menu-group > summary{color:var(--primary-dark);}
.app-page-header .menu-group > a{color:var(--text);}

@media (max-width:900px){
  .app-page-header .app-header-main{
    grid-template-columns:auto 1fr auto;
    grid-template-areas:
      "back logo actions"
      "title title title";
    gap:10px 12px;
  }
  .app-page-header .header-nav-slot{grid-area:back;min-width:0;}
  .app-page-header .header-logo-chip{grid-area:logo;justify-self:start;width:150px;}
  .app-page-header .header-title-block{grid-area:title;}
  .app-page-header .header-action-slot{grid-area:actions;width:auto;}
}
@media (max-width:620px){
  .app-page-header{padding:12px;}
  .app-page-header .app-header-main{
    grid-template-columns:1fr auto;
    grid-template-areas:
      "logo actions"
      "back back"
      "title title";
  }
  .app-page-header .header-logo-chip{width:138px;}
  .app-page-header .header-back-link{width:100%;}
  .app-page-header .user-pill{display:none;}
  .app-page-header .header-title-block p{font-size:13px;}
  .app-page-header .header-menu-panel{right:0;left:auto;min-width:230px;}
}

/* v7: Daily workflow, media and operational filters */
.media-card .media-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:12px;
  margin-top:16px;
}
.media-tile{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:8px;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  color:var(--text);
  text-decoration:none;
  box-shadow:0 6px 18px rgba(31,42,20,.08);
}
.media-tile img{
  width:100%;
  aspect-ratio:4/3;
  object-fit:cover;
  border-radius:14px;
  background:#eef3e6;
}
.media-tile span{font-size:12px;color:var(--muted);line-height:1.3;}
.quick-actions-card .pill{align-self:center;}
.today-open-row{background:#fff9e8;}
.today-done-row{background:#f0f8ec;}
.focus-list{display:grid;gap:10px;}
.focus-item{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px;border:1px solid var(--border);border-radius:16px;background:#fff;}
.focus-item strong{display:block;}
.focus-item .small{font-size:12px;}
.search-chip-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;}
@media(max-width:640px){.focus-item{align-items:flex-start;flex-direction:column}.media-card .media-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}

/* v9: kompakte Header-Suche und ausklappbarer Flächenfilter */
.header-action-stack{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:center;
  gap:8px;
}
.header-meta-row,
.header-tools-row,
.home-header-tools{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.header-tool-popover{
  position:relative;
}
.header-tool-popover > summary{
  list-style:none;
}
.header-tool-popover > summary::-webkit-details-marker{
  display:none;
}
.header-icon-btn{
  width:40px;
  height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.42);
  background:#fff;
  color:#253014;
  box-shadow:0 6px 14px rgba(0,0,0,.12);
  cursor:pointer;
  font-size:17px;
  line-height:1;
  transition:transform .12s ease, background .12s ease, color .12s ease, box-shadow .12s ease;
}
.header-icon-btn:hover,
.header-icon-btn:focus{
  background:#f4f8ec;
  color:#11170d;
  transform:translateY(-1px);
  box-shadow:var(--shadow-soft);
}
.header-tool-popover[open] .header-icon-btn,
.header-tool-popover[open] .small-menu-btn{
  outline:2px solid rgba(255,255,255,.42);
  outline-offset:2px;
}
.header-popover-panel{
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  width:min(420px, calc(100vw - 32px));
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  color:var(--text);
  box-shadow:var(--shadow);
  z-index:35;
}
.header-mini-form{
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:10px;
  align-items:end;
}
.header-mini-form label{
  display:grid;
  gap:6px;
  min-width:0;
}
.header-mini-form label span{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
.header-mini-form input,
.header-mini-form select{
  width:100%;
  min-height:42px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  padding:10px 12px;
}
.header-filter-panel{
  width:min(520px, calc(100vw - 32px));
}
.header-filter-panel .header-mini-form{
  grid-template-columns:minmax(160px,1fr) minmax(160px,1fr) auto auto;
}
.active-filter-line{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:-4px 0 14px;
  padding:10px 12px;
  border:1px solid rgba(111,127,19,.18);
  border-radius:16px;
  background:rgba(255,255,255,.68);
  box-shadow:var(--shadow-soft);
}
.compact-reset-btn{
  padding:8px 11px;
  min-height:0;
}
.hero-card .header-icon-btn{
  border-color:rgba(255,255,255,.55);
  background:#fff;
  color:#253014;
}
.hero-card .header-popover-panel{
  color:var(--text);
}
@media (max-width:900px){
  .header-action-stack{align-items:flex-end;}
  .header-meta-row{display:none;}
  .header-tools-row{flex-wrap:nowrap;}
  .header-icon-btn{width:38px;height:38px;}
}
@media (max-width:640px){
  .header-popover-panel,
  .header-filter-panel{
    position:fixed;
    left:16px;
    right:16px;
    top:96px;
    width:auto;
    max-height:calc(100vh - 124px);
    overflow:auto;
  }
  .header-mini-form,
  .header-filter-panel .header-mini-form{
    grid-template-columns:1fr;
  }
  .home-header-tools{gap:7px;}
}
.search-filter-mini-form{
  grid-template-columns:minmax(170px,1.2fr) minmax(145px,.9fr) minmax(130px,.8fr) minmax(150px,.9fr) auto auto;
}
.header-spaced-row{
  margin:-4px 0 18px;
  justify-content:flex-start;
  flex-wrap:wrap;
}
.search-page-filter-hint{
  margin-top:-4px;
}
@media (max-width:1100px){
  .search-filter-mini-form{grid-template-columns:1fr 1fr;}
}
@media (max-width:640px){
  .search-filter-mini-form{grid-template-columns:1fr;}
}

/* v10: Handy-Optimierung für sauberen Ein-Hand-Flow */
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  body {
    background:
      radial-gradient(circle at 0% 0%, rgba(47, 125, 74, .10), transparent 32%),
      linear-gradient(180deg, #eef6eb 0%, #f7fbf4 48%, #edf4e9 100%);
    overflow-x: hidden;
  }
  .page-shell { width: calc(100% - 12px); margin: 6px auto 30px; }
  .card { padding: 14px; margin-bottom: 12px; border-radius: 16px; box-shadow: 0 8px 20px rgba(41, 48, 33, .08); }

  .app-page-header {
    position: sticky; top: 0; z-index: 50;
    padding: 9px 10px 10px; margin: 0 -1px 10px;
    border-radius: 0 0 18px 18px;
    box-shadow: 0 10px 24px rgba(31,37,27,.18);
  }
  .app-page-header .app-header-main {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title actions" "back back";
    gap: 8px 10px;
  }
  .app-page-header .header-logo-chip { display: none; }
  .app-page-header .header-title-block { grid-area: title; min-width: 0; align-self: center; }
  .app-page-header h1 {
    font-size: clamp(19px, 6vw, 25px); line-height: 1.08;
    overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
  }
  .app-page-header .header-title-block p { font-size: 12px; line-height: 1.25; max-height: 2.5em; overflow: hidden; }
  .app-page-header .header-nav-slot { grid-area: back; width: 100%; min-width: 0; }
  .app-page-header .header-back-link { width: 100%; justify-content: flex-start; min-height: 34px; padding: 8px 10px; font-size: 13px; }
  .app-page-header .header-action-slot { grid-area: actions; justify-self: end; align-self: start; }
  .header-action-stack { gap: 0; align-items: flex-end; }
  .header-tools-row { gap: 6px; flex-wrap: nowrap; }
  .app-page-header .small-menu-btn { min-height: 36px; padding: 8px 10px; font-size: 0; width: 38px; border-radius: 999px; }
  .app-page-header .small-menu-btn::before { content: "☰"; font-size: 17px; line-height: 1; }
  .header-icon-btn { width: 38px; height: 38px; min-width: 38px; }
  .header-popover-panel, .header-filter-panel, .app-page-header .header-menu-panel {
    position: fixed !important;
    left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
    top: calc(82px + env(safe-area-inset-top)); width: auto !important; min-width: 0 !important;
    max-height: calc(100dvh - 98px - env(safe-area-inset-top)); overflow: auto;
    border-radius: 18px; z-index: 100;
  }
  .header-menu-panel a, .menu-group > summary, .menu-group > a { min-height: 44px; display: flex !important; align-items: center; }
  .header-mini-form, .header-filter-panel .header-mini-form, .search-filter-mini-form { grid-template-columns: 1fr !important; }

  .section-head, .topbar, .brand-row, .button-row, .topbar-actions { align-items: stretch; flex-direction: column; gap: 10px; }
  .section-head h2, .card h2 { font-size: 20px; line-height: 1.15; align-items: flex-start; }
  .section-head .pill { align-self: flex-start; }
  .muted { line-height: 1.35; }

  .stats-grid, .dashboard-grid, .detail-grid, .status-cards, .main-nav, .process-flow, .process-strip, .form-grid, .form-grid.compact, .quick-action-grid {
    grid-template-columns: 1fr !important; gap: 10px;
  }
  .stat-value { font-size: 28px; }
  .mini-value { font-size: 24px; }
  .nav-chip, .process-step, .action-list a, .flow-list div, .mini-card, .task-item, .focus-item { padding: 12px; border-radius: 15px; }

  .btn, button, input, select, textarea { min-height: 44px; font-size: 16px; }
  .btn, .button-grid .btn, .button-row .btn, form .btn, .quick-action-grid .btn, .storage-action-row .btn { width: 100%; }
  .button-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
  label.full { grid-column: auto; }
  .checkbox { padding-top: 0; align-items: center; }
  .tiny-input, .mini-input, input[id^="sb"], input[id^="pb"], input[id^="rel"], input[id^="pbtostorage"] { max-width: none; min-width: 0; }

  .collapsible { border-radius: 15px; margin: 10px 0 12px; }
  .collapsible summary { padding: 13px 14px; line-height: 1.25; }
  .collapsible form { padding: 12px; }
  .card-inside-collapse { margin-top: 10px; }

  .table-wrap { overflow: visible; border-radius: 0; }
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap tr, .table-wrap th, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap table { background: transparent; }
  .table-wrap tr { margin: 0 0 10px; padding: 10px; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow-soft); }
  .table-wrap td { border-bottom: 1px solid #edf2e8; padding: 9px 0; display: grid; grid-template-columns: minmax(96px, 42%) minmax(0, 1fr); gap: 8px; align-items: start; overflow-wrap: anywhere; }
  .table-wrap td:last-child { border-bottom: 0; }
  .table-wrap td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .03em; }
  .table-wrap td:only-child { grid-template-columns: 1fr; }
  .table-wrap td:only-child::before { display: none; }
  .table-wrap td .btn, .table-wrap td button, .table-wrap td input, .table-wrap td select { width: 100%; margin: 2px 0; }

  .storage-batch-main, .storage-metrics, .storage-action-row { display: grid; grid-template-columns: 1fr !important; justify-content: stretch; gap: 10px; }
  .storage-batch-card { padding: 13px; border-radius: 16px; }
  .media-card .media-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .media-tile { padding: 7px; border-radius: 15px; }
  .media-delete { width: 100%; }

  .active-filter-line { margin: 0 0 10px; align-items: stretch; flex-direction: column; }
  .compact-reset-btn { width: 100%; }
}

@media (max-width: 420px) {
  .page-shell { width: calc(100% - 8px); }
  .card { padding: 12px; }
  .app-page-header h1 { font-size: 18px; }
  .header-icon-btn, .app-page-header .small-menu-btn { width: 36px; height: 36px; min-width: 36px; }
  .table-wrap td { grid-template-columns: 1fr; gap: 4px; }
  .media-card .media-grid { grid-template-columns: 1fr; }
}

/* v11: aufgeräumte Einstellungsseite */
.settings-page { scroll-behavior: smooth; }
.settings-hero-card {
  display:grid;
  grid-template-columns:minmax(260px,.8fr) minmax(320px,1.2fr);
  gap:18px;
  align-items:stretch;
  background:linear-gradient(135deg, rgba(255,255,255,.96) 0%, rgba(246,249,239,.96) 58%, rgba(234,241,221,.92) 100%);
}
.settings-hero-copy { display:grid; align-content:center; gap:8px; }
.eyebrow {
  display:inline-flex; align-items:center; width:max-content; gap:6px;
  color:var(--primary-dark); font-size:12px; font-weight:900;
  letter-spacing:.08em; text-transform:uppercase;
}
.settings-health-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.settings-health-tile {
  text-decoration:none;
  display:grid;
  gap:6px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  color:var(--text);
  box-shadow:var(--shadow-soft);
  min-width:0;
}
.settings-health-tile strong { font-size:24px; }
.settings-health-tile span { font-weight:900; }
.settings-health-tile small { color:var(--muted); overflow-wrap:anywhere; }
.settings-health-tile:hover { transform:translateY(-1px); border-color:#b9d7bd; color:var(--text); }
.settings-health-tile.muted-tile { opacity:.7; }
.settings-nav-card {
  position:sticky;
  top:10px;
  z-index:25;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:10px;
  margin-bottom:18px;
  border:1px solid rgba(217,223,207,.9);
  border-radius:18px;
  background:rgba(255,255,255,.86);
  backdrop-filter:blur(12px);
  box-shadow:var(--shadow-soft);
}
.settings-nav-card a {
  text-decoration:none;
  color:var(--accent);
  font-weight:850;
  padding:10px 12px;
  border-radius:999px;
  background:#f0f4ee;
  border:1px solid rgba(217,223,207,.9);
}
.settings-nav-card a:hover { background:var(--primary-soft); color:var(--primary-dark); }
.settings-section {
  scroll-margin-top:104px;
  margin-bottom:22px;
}
.settings-section-title {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin:0 0 12px;
  padding:2px 4px;
}
.settings-section-title h2 { margin-bottom:4px; }
.settings-two-col {
  display:grid;
  grid-template-columns:minmax(300px,1fr) minmax(280px,.85fr);
  gap:16px;
  align-items:stretch;
}
.settings-card-inner { margin-bottom:0; }
.settings-card-inner h3,
.settings-preview-card h3 { margin-bottom:10px; }
.settings-preview-card {
  margin-bottom:0;
  background:linear-gradient(180deg,#ffffff 0%,#f5f8f0 100%);
}
.ampel-preview { display:grid; gap:10px; margin:10px 0; }
.ampel-step {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
}
.ampel-step.green { background:#e7f6ea; color:#205d35; border-color:#c7e6ce; }
.ampel-step.yellow { background:#fff4d8; color:#775712; border-color:#efdca1; }
.ampel-step.red { background:#fde8e8; color:#963030; border-color:#efc5c5; }
.settings-rule-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(260px,1fr));
  gap:12px;
}
.settings-rule-card {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:12px;
  align-items:start;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-soft);
}
.settings-rule-card.with-field { grid-template-columns:auto minmax(0,1fr) minmax(110px,.35fr); }
.settings-rule-card h3 { margin:0 0 3px; }
.settings-switch {
  position:relative;
  display:inline-flex;
  align-items:center;
  padding:0;
  width:52px;
  height:30px;
  cursor:pointer;
}
.settings-switch input { position:absolute; opacity:0; pointer-events:none; }
.settings-switch span {
  width:52px;
  height:30px;
  border-radius:999px;
  background:#dce3d6;
  border:1px solid #cbd4c4;
  transition:.16s ease;
}
.settings-switch span::after {
  content:"";
  display:block;
  width:24px;
  height:24px;
  margin:2px;
  border-radius:999px;
  background:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
  transition:.16s ease;
}
.settings-switch input:checked + span { background:var(--primary); border-color:var(--primary-dark); }
.settings-switch input:checked + span::after { transform:translateX(22px); }
.rule-icon {
  width:52px;
  height:30px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:var(--primary-soft);
  color:var(--primary-dark);
  font-size:18px;
}
.settings-save-row { grid-column:1 / -1; display:flex; justify-content:flex-end; }
.settings-details { padding:0; overflow:hidden; }
.settings-details > summary {
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  cursor:pointer;
  background:#f7faf4;
  border-bottom:1px solid transparent;
}
.settings-details > summary::-webkit-details-marker { display:none; }
.settings-details[open] > summary { border-bottom-color:var(--line); }
.settings-details > p,
.settings-details > .table-wrap { margin:16px 18px; }
.settings-action-list { display:grid; gap:10px; }
.backup-layout { grid-template-columns:minmax(260px,.7fr) minmax(320px,1.3fr); }
.users-layout { grid-template-columns:minmax(340px,1.1fr) minmax(260px,.9fr); }
.permission-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:8px;
}
.permission-chip {
  padding:10px 11px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#f8faf5;
  color:var(--text);
  min-height:42px;
}
.permission-chip input { width:auto; }
.permission-help-list { display:grid; gap:10px; }
.permission-help-list div {
  display:grid;
  gap:3px;
  padding:11px 12px;
  border-radius:14px;
  background:#fff;
  border:1px solid var(--line);
}
.permission-help-list span { color:var(--muted); font-size:13px; }
.user-card-list {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:14px;
}
.user-manage-card {
  display:grid;
  gap:12px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-soft);
}
.user-card-head,
.user-card-actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.user-card-fields {
  display:grid;
  grid-template-columns:1fr 1.2fr;
  gap:10px;
}
@media (max-width:900px){
  .settings-hero-card,
  .settings-two-col,
  .backup-layout,
  .users-layout { grid-template-columns:1fr; }
  .settings-health-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .settings-rule-grid { grid-template-columns:1fr; }
  .settings-rule-card.with-field { grid-template-columns:auto minmax(0,1fr); }
  .settings-rule-card.with-field > label:not(.settings-switch) { grid-column:1 / -1; }
}
@media (max-width:640px){
  .settings-nav-card {
    position:relative;
    top:auto;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .settings-nav-card a { text-align:center; padding:10px 8px; font-size:13px; }
  .settings-section { scroll-margin-top:90px; }
  .settings-section-title { align-items:flex-start; flex-direction:column; }
  .settings-health-grid { grid-template-columns:1fr 1fr; }
  .settings-health-tile { padding:12px; }
  .settings-rule-card,
  .settings-rule-card.with-field { grid-template-columns:1fr; }
  .settings-switch, .rule-icon { justify-self:start; }
  .settings-save-row { justify-content:stretch; }
  .settings-details > summary { align-items:flex-start; flex-direction:column; padding:14px; }
  .settings-details > p,
  .settings-details > .table-wrap { margin:12px 14px; }
  .user-card-fields { grid-template-columns:1fr; }
  .user-card-head,
  .user-card-actions { flex-direction:column; align-items:stretch; }
}
@media (max-width:420px){
  .settings-health-grid,
  .settings-nav-card,
  .permission-grid,
  .user-card-list { grid-template-columns:1fr; }
}

/* v12: Einstellungen als echte Unterseiten */
.settings-index-page .settings-overview-hero { margin-bottom:18px; }
.settings-overview-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.settings-overview-cards {
  display:grid;
  grid-template-columns:repeat(2,minmax(280px,1fr));
  gap:14px;
}
.settings-overview-card {
  text-decoration:none;
  color:var(--text);
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  margin:0;
  min-height:118px;
}
.settings-overview-card:hover { transform:translateY(-1px); border-color:#b9d7bd; }
.settings-overview-card h3 { margin-bottom:4px; }
.overview-icon {
  width:52px;
  height:52px;
  border-radius:18px;
  display:grid;
  place-items:center;
  background:var(--primary-soft);
  font-size:26px;
  box-shadow:inset 0 0 0 1px rgba(43,93,58,.08);
}
.settings-subpage .settings-section { margin-top:8px; }
.settings-subnav {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:18px;
  padding:10px;
  position:sticky;
  top:10px;
  z-index:20;
  background:rgba(255,255,255,.9);
  backdrop-filter:blur(12px);
}
.settings-subnav a {
  text-decoration:none;
  color:var(--accent);
  font-weight:850;
  padding:10px 12px;
  border-radius:999px;
  background:#f0f4ee;
  border:1px solid rgba(217,223,207,.9);
}
.settings-subnav a.active,
.settings-subnav a:hover { background:var(--primary-soft); color:var(--primary-dark); border-color:#b9d7bd; }
@media (max-width:900px){
  .settings-overview-grid,
  .settings-overview-cards { grid-template-columns:1fr 1fr; }
}
@media (max-width:640px){
  .settings-subnav { position:relative; top:auto; display:grid; grid-template-columns:1fr 1fr; }
  .settings-subnav a { text-align:center; font-size:13px; padding:10px 8px; }
  .settings-overview-cards { grid-template-columns:1fr; }
  .settings-overview-card { grid-template-columns:auto minmax(0,1fr); }
  .settings-overview-card .pill { grid-column:1 / -1; width:max-content; }
}
@media (max-width:420px){
  .settings-overview-grid,
  .settings-subnav { grid-template-columns:1fr; }
}
