/*
  Sperrmüll Bonn v0.2 – style.css
  -------------------------
  Mobile First: Zuerst wird die Smartphone-Darstellung definiert.
  Ab 850 Pixeln wird daraus bewusst eine eigenständige Desktop-Ansicht.
*/

:root {
  --bg: #f3f6f7;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --text: #17211d;
  --muted: #607069;
  --line: #dce5e1;
  --primary: #176b4d;
  --primary-dark: #0e5239;
  --primary-soft: #e7f4ed;
  --accent: #dff0e7;
  --warning: #8a5c00;
  --warning-bg: #fff7df;
  --danger: #a52a2a;
  --danger-bg: #fff0f0;
  --past: #6d7772;
  --shadow: 0 10px 30px rgba(28, 55, 44, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(23, 107, 77, 0.28);
  outline-offset: 2px;
}

code {
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: #edf2ef;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.page-shell {
  width: min(100% - 28px, var(--max-width));
  margin-inline: auto;
}

.app-header {
  padding: 28px 0 26px;
  background: linear-gradient(135deg, #0f573d 0%, #19704f 65%, #248061 100%);
  color: #fff;
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 5px;
  color: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 8vw, 3.35rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.header-copy {
  max-width: 720px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1rem;
}

.local-badge {
  align-self: flex-start;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.local-badge span {
  color: #9ff2c8;
}

main {
  padding-block: 20px 46px;
}

.section-block {
  margin-top: 26px;
}

.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 16px;
  border: 1px solid #d4e8de;
  border-radius: var(--radius-md);
  background: #f3fbf7;
}

.notice h2 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.notice p {
  margin-bottom: 7px;
  color: #365047;
  font-size: 0.9rem;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.notice-meta {
  opacity: 0.78;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading .eyebrow {
  color: var(--primary);
}

.section-meta,
.result-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: 0 4px 16px rgba(28, 55, 44, 0.04);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: #b6cec4;
  box-shadow: var(--shadow);
}

.stat-card.is-primary {
  border-color: #abd2c0;
  background: var(--primary-soft);
}

.stat-label,
.stat-caption {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.stat-value {
  display: block;
  margin: 3px 0 1px;
  color: var(--primary-dark);
  font-size: 2.35rem;
  line-height: 1;
}

.filter-panel,
.maintenance-panel details {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.compact-heading {
  margin-bottom: 16px;
}

.quick-filter-row {
  display: flex;
  gap: 8px;
  margin: 2px -2px 18px;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.chip-button {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #34443e;
  font-size: 0.88rem;
  font-weight: 700;
}

.chip-button.is-active,
.chip-button:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.filter-grid,
.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  color: #2e3d37;
  font-size: 0.88rem;
  font-weight: 750;
}

.field small {
  color: var(--muted);
  font-size: 0.78rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cdd9d4;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 110px;
  padding: 11px 12px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #a9beb5;
}

.results-heading {
  align-items: flex-start;
}

.result-summary {
  padding: 7px 10px;
  border-radius: 999px;
  background: #e9efec;
  white-space: nowrap;
}

.card-list {
  display: grid;
  gap: 12px;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(28, 55, 44, 0.045);
}

.result-card.is-favorite {
  border-color: #9dc8b5;
  box-shadow: inset 4px 0 0 var(--primary), 0 5px 18px rgba(28, 55, 44, 0.045);
}

.result-card.is-incomplete {
  border-style: dashed;
  background: #fbfcfb;
}

.card-topline {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.date-block {
  display: flex;
  gap: 10px;
  align-items: center;
}

.date-day {
  min-width: 54px;
  color: var(--primary-dark);
  font-size: 1.75rem;
  font-weight: 850;
  line-height: 1;
}

.date-detail {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.street-name {
  margin: 14px 0 2px;
  font-size: 1.06rem;
  font-weight: 800;
}

.house-range {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.incomplete-copy {
  margin: 12px 0 0;
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--warning-bg);
  color: #654700;
  font-size: 0.84rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #edf1ef;
  color: #46524d;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.status-today {
  background: #dff4e8;
  color: #0d6140;
}

.status-badge.status-tomorrow {
  background: #dcecfb;
  color: #245879;
}

.status-badge.status-past {
  background: #eceeed;
  color: var(--past);
}

.card-actions,
.row-actions {
  display: flex;
  gap: 7px;
  margin-top: 14px;
}

.icon-action {
  display: inline-flex;
  min-height: 38px;
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #3d4b45;
  font-size: 0.82rem;
  font-weight: 750;
}

.icon-action:hover {
  border-color: #9db9ad;
  background: #f5faf7;
}

.icon-action.is-active {
  border-color: #9cc5b3;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.icon-action[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.table-wrapper {
  display: none;
}

.empty-state {
  padding: 42px 20px;
  border: 1px dashed #c8d3ce;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.56);
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 4px;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.empty-symbol {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 2.2rem;
}

.button {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 750;
}

.button-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  border-color: #acc4ba;
  background: #eff6f2;
  color: #174e39;
}

.button-ghost {
  border-color: var(--line);
  background: #fff;
  color: #435149;
}

.button-danger {
  border-color: #e6baba;
  background: var(--danger-bg);
  color: var(--danger);
}

.maintenance-panel details {
  padding: 0;
}

.maintenance-panel summary {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  list-style: none;
  cursor: pointer;
}

.maintenance-panel summary::-webkit-details-marker {
  display: none;
}

.maintenance-panel summary::after {
  content: "+";
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 1.35rem;
  font-weight: 700;
}

.maintenance-panel details[open] summary::after {
  content: "−";
}

.maintenance-panel summary .eyebrow {
  display: block;
  color: var(--primary);
}

.summary-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.maintenance-content {
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
}

.maintenance-explanation {
  margin: 16px 0;
  color: #46564f;
  font-size: 0.92rem;
}

.form-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: stretch;
  margin-top: 14px;
}

.form-message {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.form-message.is-error {
  color: var(--danger);
}

.form-message.is-success {
  color: var(--primary-dark);
}

.separator {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.bulk-section h3 {
  margin-bottom: 2px;
}

.bulk-section > div > p {
  color: var(--muted);
  font-size: 0.88rem;
}

.danger-zone {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid #efd1d1;
  border-radius: var(--radius-md);
  background: #fffafa;
}

.danger-zone p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}



.location-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.source-remark {
  margin: 6px 0 0;
  color: #51615a;
  font-size: 0.8rem;
  font-style: italic;
}

.table-location {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.table-remark {
  display: block;
  margin-top: 4px;
  color: #5c6963;
  font-size: 0.76rem;
  font-style: italic;
}

.note-dialog {
  width: min(92vw, 620px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 26px 80px rgba(10, 30, 22, 0.3);
}

.note-dialog::backdrop {
  background: rgba(18, 30, 25, 0.55);
  backdrop-filter: blur(2px);
}

.note-dialog form {
  padding: 20px;
}

.dialog-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.dialog-header .eyebrow {
  color: var(--primary);
}

.dialog-meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.icon-button {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: #3e4b46;
  font-size: 1.5rem;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: flex-end;
  margin-top: 18px;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 28px));
  padding: 11px 14px;
  border-radius: 10px;
  background: #173228;
  color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  font-size: 0.86rem;
  font-weight: 700;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-footer {
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  background: #eaf0ed;
}

.footer-inner {
  display: grid;
  gap: 4px;
}

.footer-inner p {
  margin: 0;
  color: #52635b;
  font-size: 0.8rem;
}

/*
  Ab 850 px wird nicht nur alles größer, sondern die Informationsarchitektur ändert sich:
  Filter stehen nebeneinander und die Ergebnis-Karten werden durch eine Tabelle ersetzt.
*/
@media (min-width: 850px) {
  .page-shell {
    width: min(100% - 56px, var(--max-width));
  }

  .app-header {
    padding: 42px 0 38px;
  }

  .header-inner {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  main {
    padding-block: 26px 64px;
  }

  .notice {
    padding: 18px 20px;
  }

  .section-block {
    margin-top: 34px;
  }

  .section-heading {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

  .dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .stat-card {
    min-height: 144px;
    padding: 20px;
  }

  .filter-panel {
    padding: 22px;
  }

  .filter-grid {
    grid-template-columns: minmax(260px, 1.35fr) minmax(190px, 0.8fr) minmax(220px, 0.95fr);
  }

  .form-grid {
    grid-template-columns: 0.8fr 1.2fr 1.2fr;
  }

  .card-list {
    display: none;
  }

  .table-wrapper {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .results-table {
    width: 100%;
    border-collapse: collapse;
  }

  .results-table th,
  .results-table td {
    padding: 13px 14px;
    border-bottom: 1px solid #e7ece9;
    text-align: left;
    vertical-align: middle;
  }

  .results-table th {
    background: #f4f7f5;
    color: #53645c;
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .results-table td {
    font-size: 0.9rem;
  }

  .results-table tr:last-child td {
    border-bottom: 0;
  }

  .results-table tr.is-favorite td:first-child {
    box-shadow: inset 4px 0 0 var(--primary);
  }

  .results-table tr.is-incomplete {
    background: #fbfcfb;
    color: #58665f;
  }

  .actions-column {
    width: 190px;
  }

  .row-actions {
    margin-top: 0;
    justify-content: flex-end;
  }

  .form-actions {
    flex-direction: row;
    align-items: center;
  }

  .danger-zone {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .maintenance-panel summary,
  .maintenance-content {
    padding-inline: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
