/* Global container options */
.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
.container-fluid {
  max-width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

body {
  overflow-x: hidden;
}

.top-nav {
  --top-nav-row-height: 60px;
  --top-nav-control-height: 34px;
  align-items: center;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 1.1rem;
  min-height: var(--top-nav-row-height);
  overflow: visible;
  padding-top: 0;
  padding-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 120;
}

.top-nav > * {
  align-self: center;
}

.top-nav-menu {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 0.95rem;
  justify-content: space-between;
  min-height: var(--top-nav-row-height);
  min-width: 0;
}

.top-nav-brand {
  align-items: center;
  color: #00699e;
  display: inline-flex;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  min-height: var(--top-nav-row-height);
  padding: 0;
  text-decoration: none;
  white-space: nowrap;
}

.top-nav-links {
  align-items: center;
  display: flex;
  gap: 0.1rem;
  list-style: none;
  margin: 0;
  min-width: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.top-nav-links > li {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  min-height: var(--top-nav-row-height);
}

.top-nav-links > li > details {
  align-items: center;
  display: flex;
  margin: 0;
}

.top-nav-links > li > a,
.top-nav-links > li > details > summary {
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  font-size: 13px;
  font-weight: 500;
  gap: 0.35rem;
  height: var(--top-nav-row-height);
  min-height: var(--top-nav-row-height);
  padding: 0 0.45rem;
  text-decoration: none;
  white-space: nowrap;
  color: #555;
  transition: color 0.2s, border-color 0.2s;
  line-height: 1.1;
  margin: 0;
}

.top-nav-links > li > a:hover,
.top-nav-links > li > a.active,
.top-nav-links > li > details > summary:hover,
.top-nav-links > li > details > summary.active,
.top-nav-links > li > details[open] > summary {
  border-bottom-color: #00699e;
  color: #00699e;
  text-decoration: none;
}

.top-nav-links > li {
  min-width: 0;
}

.top-nav-links > li.is-overflowed {
  display: none;
}

.top-nav-right {
  align-items: center;
  display: flex;
  min-height: var(--top-nav-row-height);
  gap: 0.7rem;
  justify-content: flex-end;
  margin-left: auto;
  min-width: 0;
  flex-shrink: 0;
}

.top-nav-search {
  align-items: center;
  display: inline-flex;
  height: var(--top-nav-control-height);
  margin: 0;
  position: relative;
}

.top-nav-search i {
  color: #9ca3af;
  font-size: 0.78rem;
  left: 0.7rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.top-nav-search input {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 0.78rem;
  height: var(--top-nav-control-height);
  line-height: 1.2;
  margin: 0;
  min-width: 190px;
  outline: none;
  padding: 0 0.65rem 0 2rem;
  transition: border-color 0.2s;
}

.top-nav-search input:focus {
  border-color: #00699e;
}

.top-nav-icon-btn {
  align-items: center;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #555;
  display: inline-flex;
  font-size: 0.9rem;
  height: var(--top-nav-control-height);
  justify-content: center;
  line-height: 1;
  min-width: 34px;
  margin: 0;
  padding: 0 0.6rem;
  position: relative;
  text-decoration: none;
  flex-shrink: 0;
}

.top-nav-icon-btn:hover {
  border-color: #00699e;
  color: #00699e;
  text-decoration: none;
}

.top-nav-icon-dot {
  background: #e74c3c;
  border: 2px solid #fff;
  border-radius: 50%;
  height: 8px;
  position: absolute;
  right: 5px;
  top: 5px;
  width: 8px;
}

.top-nav-logout {
  align-self: center;
  margin: 0;
}

.top-nav-logout button {
  align-items: center;
  background: #00699e;
  border: 1px solid #00699e;
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 600;
  height: var(--top-nav-control-height);
  justify-content: center;
  line-height: 1;
  margin: 0;
  padding: 0 0.95rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.top-nav-logout button:hover {
  background: #005580;
  border-color: #005580;
}

.top-nav-dropdown,
.top-nav-settings {
  margin: 0;
  position: relative;
}

.top-nav-dropdown > summary,
.top-nav-settings > summary {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.top-nav-search-shortcut {
  display: none;
}

.top-nav-dropdown summary,
.top-nav-settings summary {
  list-style: none;
}

.top-nav-dropdown summary::marker,
.top-nav-settings summary::marker {
  content: none;
  display: none;
}

.top-nav-dropdown summary::-webkit-details-marker,
.top-nav-settings summary::-webkit-details-marker {
  display: none;
}

.top-nav-dropdown > summary::after {
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  color: #94a3b8;
  content: "";
  display: inline-block;
  flex-shrink: 0;
  height: 0.45rem;
  line-height: 1;
  margin-left: 0.18rem;
  transform: rotate(45deg) translateY(-0.02rem);
  transition: transform 0.18s ease, color 0.18s ease;
  width: 0.45rem;
}

.top-nav-dropdown[open] > summary::after {
  transform: rotate(-135deg) translateY(-0.02rem);
}

.top-nav-dropdown > ul,
.top-nav-settings > ul {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
  display: block;
  list-style: none;
  margin: 0;
  min-width: 220px;
  max-width: min(92vw, 520px);
  padding: 0.35rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 150;
}

.top-nav-dropdown > ul li,
.top-nav-settings > ul li {
  display: block;
  width: 100%;
}

.top-nav-dropdown > ul a,
.top-nav-settings > ul a {
  border-radius: 8px;
  color: #374151;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  min-height: auto;
  padding: 0.45rem 0.55rem;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 0;
}

.top-nav-dropdown > ul a:hover,
.top-nav-settings > ul a:hover {
  background: #f3f4f6;
  color: #00699e;
}

.top-nav-dropdown > ul a.active,
.top-nav-settings > ul a.active {
  background: #e8f4fd;
  color: #005580;
}

.top-nav-settings .top-nav-icon-btn {
  cursor: pointer;
}

.top-nav-settings-label {
  display: none;
}

.top-nav-settings {
  align-items: center;
  display: flex;
  height: var(--top-nav-control-height);
  align-self: center;
  line-height: 1;
}

.top-nav-settings > summary.top-nav-icon-btn {
  align-items: center;
  box-sizing: border-box;
  display: inline-flex;
  height: var(--top-nav-control-height);
  line-height: 1;
  margin: 0;
  min-width: 34px;
  vertical-align: middle;
  padding-top: 0;
  padding-bottom: 0;
}

.top-nav-settings > summary.top-nav-icon-btn i {
  display: block;
  line-height: 1;
}

.top-nav-toggle {
  display: none;
}

.archive-view-banner {
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.85rem;
}

.archive-view-banner i {
  font-size: 0.9rem;
}

.archive-view-banner strong {
  font-size: 0.86rem;
}

.archive-view-banner span {
  color: #4b5563;
  font-size: 0.8rem;
}

.archive-view-banner.is-archived {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}

.archive-view-banner.is-mixed {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.archive-view-pill {
  align-items: center;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  color: #374151;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 0.45rem;
  padding: 0.12rem 0.5rem;
  vertical-align: middle;
}

.archive-view-pill.is-mixed {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

@media (max-width: 1024px) {
  .top-nav-search input {
    min-width: 150px;
  }
}

@media (max-width: 1360px) {
  .top-nav-search {
    display: none;
  }

  .top-nav-search-shortcut {
    display: inline-flex;
  }
}

@media (max-width: 980px) {
  .top-nav {
    align-items: center;
    display: grid;
    gap: 0;
    grid-template-areas:
      "brand toggle"
      "menu menu";
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 60px;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
    position: relative;
  }

  .top-nav-brand {
    align-self: start;
    flex: 1 1 auto;
    grid-area: brand;
    justify-self: start;
    min-height: 0;
    padding: 0 0 0.45rem;
  }

  .top-nav-toggle {
    align-items: center;
    display: inline-flex;
    grid-area: toggle;
    height: 34px;
    justify-content: center;
    justify-self: end;
    margin: 0;
    padding: 0 0.7rem;
    position: static;
    z-index: 20;
  }

  .top-nav-menu {
    align-items: flex-start;
    display: none;
    flex-direction: column;
    grid-area: menu;
    margin-top: 0;
    min-height: 0;
    padding-top: 0.15rem;
    width: 100%;
  }

  .top-nav-menu.is-open {
    display: flex;
  }

  .top-nav-links {
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
    width: 100%;
  }

  .top-nav-links > li {
    display: block;
    min-height: 0;
    width: 100%;
  }

  .top-nav-links > li > details,
  .top-nav-collapsible {
    display: block;
    margin: 0;
    width: 100%;
  }

  .top-nav-links > li > a,
  .top-nav-links > li > details > summary {
    align-items: center;
    border-bottom: 0;
    border-radius: 8px;
    height: auto;
    justify-content: flex-start;
    min-height: 34px;
    padding: 0.35rem 0.6rem;
    text-align: left;
    width: 100%;
  }

  .top-nav-links > li > a:hover,
  .top-nav-links > li > a.active,
  .top-nav-links > li > details > summary:hover,
  .top-nav-links > li > details > summary.active,
  .top-nav-links > li > details[open] > summary {
    background: rgba(16, 149, 193, 0.12);
    border-bottom: 0;
  }

  .top-nav-right {
    align-items: stretch;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    flex-shrink: 1;
  }

  .top-nav-search {
    display: block;
    height: auto;
    width: 100%;
  }

  .top-nav-search-shortcut {
    display: none;
  }

  .top-nav-search input {
    min-width: 0;
    width: 100%;
  }

  .top-nav-icon-btn {
    justify-content: flex-start;
    padding-left: 0.6rem;
    width: 100%;
  }

  .top-nav-settings {
    align-self: stretch;
    display: block;
    height: auto;
    line-height: normal;
    width: 100%;
  }

  .top-nav-settings summary {
    width: 100%;
  }

  .top-nav-settings > summary.top-nav-icon-btn {
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #555;
    display: inline-flex;
    gap: 0.35rem;
    height: auto;
    justify-content: flex-start;
    min-height: 34px;
    min-width: 0;
    padding: 0.35rem 0.6rem;
    width: 100%;
  }

  .top-nav-settings > summary.top-nav-icon-btn::after {
    border-bottom: 2px solid currentColor;
    border-right: 2px solid currentColor;
    color: #94a3b8;
    content: "";
    display: inline-block;
    flex-shrink: 0;
    height: 0.45rem;
    margin-left: auto;
    transform: rotate(45deg) translateY(-0.02rem);
    transition: transform 0.18s ease, color 0.18s ease;
    width: 0.45rem;
  }

  .top-nav-settings[open] > summary.top-nav-icon-btn::after {
    transform: rotate(-135deg) translateY(-0.02rem);
  }

  .top-nav-settings-label {
    display: inline;
    font-size: 13px;
    font-weight: 500;
  }

  .top-nav-settings > summary.top-nav-icon-btn:hover,
  .top-nav-settings[open] > summary.top-nav-icon-btn {
    background: rgba(16, 149, 193, 0.12);
    border: 0;
    color: #00699e;
  }

  .top-nav-dropdown > ul,
  .top-nav-settings > ul {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: block;
    margin: 0;
    max-width: none;
    min-width: 0;
    padding: 0;
    position: static;
    width: 100%;
  }

  .top-nav-collapsible > ul {
    margin-top: 0.15rem;
  }

  .top-nav-dropdown > ul li,
  .top-nav-settings > ul li {
    display: block;
    margin: 0;
    width: 100%;
  }

  .top-nav-dropdown > ul a,
  .top-nav-settings > ul a {
    align-items: center;
    border-bottom: 0;
    border-radius: 8px;
    box-sizing: border-box;
    color: #555;
    display: flex;
    font-size: 13px;
    font-weight: 500;
    justify-content: flex-start;
    min-height: 34px;
    padding: 0.35rem 0.6rem 0.35rem 1.6rem;
    text-decoration: none;
    white-space: normal;
    width: 100%;
    word-break: normal;
    overflow-wrap: normal;
  }

  .top-nav-dropdown > ul a:hover,
  .top-nav-dropdown > ul a.active,
  .top-nav-settings > ul a:hover,
  .top-nav-settings > ul a.active {
    background: rgba(16, 149, 193, 0.12);
    color: #00699e;
  }

  .top-nav-logout {
    width: 100%;
  }

  .top-nav-logout button {
    width: 100%;
  }

  .top-nav-icon-dot {
    left: 1.25rem;
    right: auto;
  }

  .top-nav-more {
    width: 100%;
  }

  .top-nav-more .top-nav-dropdown {
    width: 100%;
  }

  .top-nav-more .top-nav-dropdown summary {
    width: 100%;
  }
}

/* Analytics layout */
.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}
.kpi {
  padding: 1rem;
  border-radius: 8px;
  background: var(--pico-card-background-color, #f8f9fa);
  border: 1px solid rgba(0,0,0,0.06);
}
.kpi h4 {
  margin: 0 0 .25rem 0;
  font-size: 0.85rem; /* ca. 2pt kleiner */
  color: #666;
}
.kpi .kpi-value {
  font-size: 1.25rem; /* ca. 2pt kleiner */
  font-weight: 700;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
}

/* Filterzeile oben */
.analytics-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, auto));
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.5rem;
  font-size: 0.875rem; /* ca. 2pt kleiner */
}
.analytics-filters .actions {
  display: flex;
  gap: .5rem;
  align-items: stretch;
}
.analytics-filters .placeholder-label {
  visibility: hidden; /* reserviert Label-Höhe für gleichmäßige Oberkante */
  display: block;
  margin-bottom: .25rem;
}
.analytics-card {
  font-size: 0.875rem; /* ca. 2pt kleiner */
}
.analytics-card header h3 {
  margin: 0;
  font-size: 1.05rem; /* ca. 2pt kleiner */
}
.analytics-card small {
  color: #666;
  font-size: 0.8rem; /* ca. 2pt kleiner */
}
.analytics-card table {
  width: 100%;
  table-layout: auto;
  font-size: 0.875rem; /* ca. 2pt kleiner */
}
.analytics-card td:first-child {
  width: 70%;
  word-break: break-word;
  white-space: normal;
}
.analytics-card td:last-child,
.analytics-card th:last-child {
  text-align: right;
  white-space: nowrap;
}

/* Shared list and table responsiveness */
.list-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.list-filters > a,
.list-filters > button {
  width: 100%;
  text-align: center;
}

.list-filters p {
  margin: 0;
  grid-column: 1 / -1;
}

.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
}

.table-wrap.table-wrap-sticky {
  max-height: min(68vh, 760px);
  overflow: auto;
  scrollbar-gutter: stable both-edges;
}

.table-toolbar-meta {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.table-page-size {
  align-items: center;
  display: inline-flex;
  gap: 0.3rem;
}

.table-page-size > span:first-child {
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 600;
}

.table-page-size a,
.table-page-size .is-active {
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  color: #374151;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 600;
  height: 1.8rem;
  justify-content: center;
  min-width: 2rem;
  padding: 0 0.45rem;
  text-decoration: none;
}

.table-page-size a:hover {
  border-color: #00699e;
  color: #00699e;
}

.table-page-size .is-active {
  background: #e9f4fb;
  border-color: #00699e;
  color: #005580;
}

.responsive-table {
  table-layout: fixed;
}

.table-readable {
  table-layout: auto;
}

.table-readable thead th {
  white-space: nowrap;
  overflow-wrap: normal;
  vertical-align: middle;
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--pico-card-background-color, #fff);
  box-shadow: inset 0 -1px 0 rgba(229, 231, 235, 0.9);
}

.table-readable thead th a {
  white-space: nowrap;
}

.table-readable thead th.sort-active {
  background: rgba(16, 149, 193, 0.14);
}

.table-readable thead th.sort-active a {
  color: var(--pico-primary, #1095c1);
  font-weight: 700;
}

.table-readable tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

.responsive-table th,
.responsive-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.table-compact {
  font-size: 0.84rem;
}

.table-compact th,
.table-compact td {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.table-ellipsis th,
.table-ellipsis td {
  max-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-ellipsis td[data-label="Aktionen"],
.table-ellipsis th:last-child,
.table-ellipsis .no-ellipsis {
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.customers-row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  align-items: stretch;
  gap: 0.7rem;
}

.customers-row-actions > .offers-btn,
.customers-row-actions form {
  width: 100%;
}

.customers-row-actions .offers-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.15rem;
  width: 100%;
  margin: 0;
  line-height: 1.1;
}

.customers-row-actions form {
  margin: 0;
  display: flex;
}

@media (max-width: 560px) {
  .customers-row-actions {
    grid-template-columns: 1fr;
  }
}

.table-actions form {
  margin: 0;
}

.table-actions a,
.table-actions button {
  white-space: normal;
}

.table-actions .secondary {
  padding: 0.2rem 0.5rem;
}

.table-actions .btn-nowrap {
  white-space: nowrap;
}

.agency-table .col-date {
  white-space: nowrap;
  width: 7.5rem;
  min-width: 7.5rem;
}

.agency-table .col-note {
  width: 14rem;
  max-width: 14rem;
}

.agency-table tbody td.col-note {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.agency-page {
  font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  margin-top: 0.5rem;
}

.agency-breadcrumb {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.agency-breadcrumb a {
  color: #00699e;
  text-decoration: none;
}

.agency-breadcrumb a:hover {
  text-decoration: underline;
}

.agency-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.agency-page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.agency-page-header h1 i {
  color: #00699e;
  font-size: 1.25rem;
}

.agency-page-header p {
  margin: 0.25rem 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.agency-page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.agency-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.agency-kpi-card {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.agency-kpi-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.agency-kpi-icon.is-blue {
  background: #e8f4fd;
  color: #00699e;
}

.agency-kpi-icon.is-orange {
  background: #fff7ed;
  color: #d97706;
}

.agency-kpi-icon.is-red {
  background: #fef2f2;
  color: #dc2626;
}

.agency-kpi-icon.is-green {
  background: #e6f9f0;
  color: #16a34a;
}

.agency-kpi-body {
  min-width: 0;
}

.agency-kpi-label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.agency-kpi-value {
  margin: 0.2rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
}

.agency-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 0.75rem;
  align-items: end;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 0.9rem;
}

.agency-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
}

.agency-filter-group span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.agency-filter-group input,
.agency-filter-group select {
  margin: 0;
}

.agency-filter-actions {
  display: flex;
  align-items: end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.agency-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.agency-action-left,
.agency-action-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.agency-action-right > span {
  color: #6b7280;
  font-size: 0.85rem;
}

.agency-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border-radius: 0.55rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.agency-btn:hover {
  text-decoration: none;
}

.agency-btn-primary {
  background: #00699e;
  color: #fff;
  border-color: #00699e;
}

.agency-btn-primary:hover {
  background: #005580;
  border-color: #005580;
  color: #fff;
}

.agency-btn-secondary {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}

.agency-btn-secondary:hover {
  border-color: #00699e;
  color: #00699e;
}

.agency-btn-tertiary {
  background: #f9fafb;
  color: #374151;
  border-color: #e5e7eb;
}

.agency-btn-tertiary:hover {
  border-color: #00699e;
  color: #00699e;
}

.agency-table-panel {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.agency-table-toolbar {
  padding: 0.55rem 0.95rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fbfdff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.agency-table-count,
.agency-table-page {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.agency-table-design {
  table-layout: auto;
  width: 100%;
  min-width: 0;
}

.agency-table-design thead th {
  background: #f9fafb;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #6b7280;
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid #e5e7eb;
}

.agency-table-design thead th,
.agency-table-design tbody td {
  white-space: nowrap;
  overflow-wrap: normal;
}

.agency-table-design thead th a {
  color: inherit;
  text-decoration: none;
}

.agency-table-design thead th a:hover {
  color: #00699e;
}

.agency-table-design thead th.sort-active {
  background: #e9f4fb;
}

.agency-table-design thead th.sort-active a {
  color: #005580;
  font-weight: 700;
}

.agency-table-design tbody tr {
  border-bottom: 1px solid #eef0f3;
}

.agency-table-design tbody tr:last-child {
  border-bottom: 0;
}

.agency-table-design tbody td {
  padding: 0.8rem 0.95rem;
  font-size: 0.84rem;
  vertical-align: middle;
}

.agency-table-design .agency-row:hover {
  background: #f9fafb;
}

.agency-customer-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.agency-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f4fd;
  color: #00699e;
  font-weight: 700;
  font-size: 0.73rem;
  flex-shrink: 0;
}

.agency-customer-name {
  font-weight: 600;
}

.agency-project-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.78rem;
  color: #374151;
}

.agency-project-tag i {
  color: #00699e;
  font-size: 0.65rem;
}

.agency-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.16rem 0.62rem;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.73rem;
  font-weight: 600;
}

.agency-status-dot {
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: currentColor;
}

.agency-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.95rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.agency-table-info {
  margin: 0;
  color: #6b7280;
  font-size: 0.82rem;
}

.agency-pagination {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.agency-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.65rem;
  border-radius: 0.55rem;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.agency-pagination a i {
  font-size: 0.7rem;
}

.agency-pagination a:hover {
  border-color: #00699e;
  color: #00699e;
}

@media (min-width: 901px) {
  .agency-table-panel .table-wrap {
    overflow: auto;
    max-width: 100%;
  }

  .agency-table.agency-table-design {
    width: 100%;
    table-layout: fixed;
  }

  .agency-table-design thead th {
    font-size: clamp(0.48rem, 0.36vw, 0.68rem);
    letter-spacing: 0.02em;
    padding: clamp(0.32rem, 0.45vw, 0.8rem) clamp(0.26rem, 0.5vw, 0.95rem);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
    min-width: 0;
  }

  .agency-table-design tbody td {
    font-size: clamp(0.54rem, 0.42vw, 0.8rem);
    padding: clamp(0.32rem, 0.45vw, 0.8rem) clamp(0.26rem, 0.5vw, 0.95rem);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
    min-width: 0;
  }

  .agency-table-design thead th a {
    white-space: normal;
    display: inline;
  }

  .agency-table .col-date,
  .agency-table .col-note {
    width: auto;
    max-width: none;
    min-width: 0;
  }

  .agency-table-panel .agency-avatar {
    width: clamp(1.1rem, 0.9vw, 1.85rem);
    height: clamp(1.1rem, 0.9vw, 1.85rem);
    border-radius: 0.45rem;
    font-size: clamp(0.56rem, 0.4vw, 0.73rem);
  }

  .agency-table-panel .agency-customer-cell {
    min-width: 0;
  }

  .agency-table-panel .agency-customer-name {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .agency-table-panel .agency-project-tag {
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 0.14rem 0.35rem;
    font-size: clamp(0.56rem, 0.42vw, 0.78rem);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
    max-width: 100%;
  }

  .agency-table-panel .agency-project-tag i,
  .agency-table-panel .agency-status-badge i,
  .agency-table-panel .agency-btn i {
    font-size: clamp(0.52rem, 0.34vw, 0.7rem);
  }

  .agency-table-panel .agency-status-badge {
    font-size: clamp(0.52rem, 0.38vw, 0.72rem);
  }

  .agency-table-panel .table-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    min-width: 0;
  }

  .agency-table-panel .table-actions form {
    width: 100%;
    min-width: 0;
  }

  .agency-table-panel .table-actions .agency-btn,
  .agency-table-panel .table-actions .btn-nowrap {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
    min-width: 0;
  }

  .agency-table-panel .agency-btn {
    padding: 0.18rem 0.42rem;
    font-size: clamp(0.55rem, 0.42vw, 0.76rem);
    gap: 0.2rem;
  }
}

.agency-pagination span {
  display: inline-flex;
  align-items: center;
  padding: 0 0.25rem;
  color: #6b7280;
  font-size: 0.8rem;
}

.agency-pagination .is-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.65rem;
  border-radius: 0.55rem;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 600;
}

.ads-page {
  font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  margin-top: 0.5rem;
}

.ads-breadcrumb {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.ads-breadcrumb a {
  color: #00699e;
  text-decoration: none;
}

.ads-breadcrumb a:hover {
  text-decoration: underline;
}

.ads-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.65rem;
}

.ads-page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.ads-page-header h1 i {
  color: #00699e;
  font-size: 1.25rem;
}

.ads-page-header p {
  margin: 0.25rem 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.ads-page-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ads-inline-form {
  margin: 0;
}

.ads-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border-radius: 0.55rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  margin: 0;
  line-height: 1.2;
}

.ads-btn:hover {
  text-decoration: none;
}

.ads-btn i {
  font-size: 0.78rem;
}

.ads-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ads-btn-sm {
  padding: 0.28rem 0.65rem;
  font-size: 0.76rem;
}

.ads-btn-primary {
  background: #00699e;
  color: #fff;
  border-color: #00699e;
}

.ads-btn-primary:hover {
  background: #005580;
  border-color: #005580;
  color: #fff;
}

.ads-btn-secondary {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}

.ads-btn-secondary:hover {
  border-color: #00699e;
  color: #00699e;
}

.ads-btn-tertiary {
  background: #f9fafb;
  color: #374151;
  border-color: #e5e7eb;
}

.ads-btn-tertiary:hover {
  border-color: #00699e;
  color: #00699e;
}

.ads-btn-warning {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #fff;
  border-color: #d97706;
}

.ads-btn-warning:hover {
  color: #fff;
  filter: brightness(0.96);
}

.ads-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ads-kpi-card {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 0.72rem;
}

.ads-kpi-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.62rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.92rem;
}

.ads-kpi-icon.is-blue {
  background: #e8f4fd;
  color: #00699e;
}

.ads-kpi-icon.is-green {
  background: #e6f9f0;
  color: #16a34a;
}

.ads-kpi-icon.is-orange {
  background: #fff7ed;
  color: #d97706;
}

.ads-kpi-icon.is-purple {
  background: #f3e8ff;
  color: #7c3aed;
}

.ads-kpi-label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.ads-kpi-value {
  margin: 0.2rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
}

.ads-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  align-items: end;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 0.9rem;
}

.ads-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
}

.ads-filter-group span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.ads-filter-group input,
.ads-filter-group select {
  margin: 0;
}

.ads-filter-actions {
  display: flex;
  align-items: end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ads-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.ads-action-left,
.ads-action-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ads-action-right > span {
  color: #6b7280;
  font-size: 0.85rem;
}

.ads-action-hint {
  max-width: 420px;
  font-size: 0.78rem;
  color: #6b7280;
}

.ads-action-hint i {
  color: #00699e;
}

.ads-table-panel {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.ads-table {
  table-layout: auto;
  border-collapse: collapse;
}

.ads-table .ads-col-date {
  white-space: nowrap;
  width: 8rem;
  min-width: 8rem;
}

.ads-table-design thead th {
  background: #f9fafb;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #6b7280;
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid #e5e7eb;
}

.ads-table-design thead th,
.ads-table-design tbody td {
  white-space: nowrap;
}

.ads-table-design thead th a {
  color: inherit;
  text-decoration: none;
}

.ads-table-design thead th a:hover {
  color: #00699e;
}

.ads-table-design thead th.sort-active {
  background: #e9f4fb;
}

.ads-table-design thead th.sort-active a {
  color: #005580;
  font-weight: 700;
}

.ads-table-design tbody tr {
  border-bottom: 1px solid #eef0f3;
}

.ads-table-design tbody tr:last-child {
  border-bottom: 0;
}

.ads-table-design tbody td {
  padding: 0.8rem 0.95rem;
  font-size: 0.84rem;
  vertical-align: middle;
}

.ads-table-design .ads-row:hover {
  background: #f9fafb;
}

.ads-customer-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.ads-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f4fd;
  color: #00699e;
  font-weight: 700;
  font-size: 0.73rem;
  flex-shrink: 0;
}

.ads-customer-name {
  font-weight: 600;
}

.ads-magazine-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.78rem;
  color: #374151;
}

.ads-magazine-tag i {
  font-size: 0.65rem;
  color: #00699e;
}

.ads-amount {
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
}

.ads-date-cell {
  display: inline-flex;
  flex-direction: column;
  gap: 0.18rem;
}

.ads-inline-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  border: 1px solid transparent;
  font-size: 0.72rem;
  font-weight: 600;
}

.ads-inline-badge.is-warn {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.ads-inline-badge.is-danger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.ads-kind-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.16rem 0.62rem;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.73rem;
  font-weight: 600;
}

.ads-kind-advertorial {
  background: #e8f4fd;
  border-color: #cfe6f5;
  color: #005580;
}

.ads-kind-banner {
  background: #f3e8ff;
  border-color: #e9d5ff;
  color: #7c3aed;
}

.ads-kind-link {
  background: #ecfdf5;
  border-color: #d1fae5;
  color: #0f766e;
}

.ads-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border-radius: 999px;
  padding: 0.16rem 0.62rem;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.73rem;
  font-weight: 600;
}

.ads-status-dot {
  width: 0.36rem;
  height: 0.36rem;
  border-radius: 50%;
  background: currentColor;
}

.ads-status-badge.is-active {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.ads-status-badge.is-inactive {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.ads-link {
  color: #00699e;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ads-link:hover {
  text-decoration: underline;
}

.ads-muted {
  color: #9ca3af;
}

.ads-reminder-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.72rem;
  font-weight: 600;
}

.ads-reminder-badge.is-sent {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.ads-reminder-badge.is-due {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.ads-reminder-badge.is-planned {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.ads-reminder-badge.is-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.ads-reminder-meta {
  display: block;
  margin-top: 0.12rem;
  color: #6b7280;
  font-size: 0.74rem;
  white-space: nowrap;
}

.ads-table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.ads-table-actions form {
  margin: 0;
}

@media (min-width: 901px) {
  .ads-table-panel .table-wrap {
    overflow: auto;
    max-width: 100%;
  }

  .ads-table.ads-table-design {
    width: 100%;
    table-layout: fixed;
  }

  .ads-table-design thead th {
    font-size: clamp(0.48rem, 0.36vw, 0.68rem);
    letter-spacing: 0.02em;
    padding: clamp(0.32rem, 0.45vw, 0.8rem) clamp(0.26rem, 0.5vw, 0.95rem);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
    min-width: 0;
  }

  .ads-table-design tbody td {
    font-size: clamp(0.54rem, 0.42vw, 0.8rem);
    padding: clamp(0.32rem, 0.45vw, 0.8rem) clamp(0.26rem, 0.5vw, 0.95rem);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
    min-width: 0;
  }

  .ads-table-design thead th a {
    white-space: normal;
    display: inline;
  }

  .ads-table .ads-col-date {
    width: auto;
    min-width: 0;
  }

  .ads-table-panel .ads-avatar {
    width: clamp(1.1rem, 0.9vw, 1.85rem);
    height: clamp(1.1rem, 0.9vw, 1.85rem);
    border-radius: 0.45rem;
    font-size: clamp(0.56rem, 0.4vw, 0.73rem);
  }

  .ads-table-panel .ads-customer-cell {
    min-width: 0;
  }

  .ads-table-panel .ads-customer-name,
  .ads-table-panel .ads-link,
  .ads-table-panel .ads-reminder-meta {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .ads-table-panel .ads-magazine-tag {
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 0.14rem 0.35rem;
    font-size: clamp(0.56rem, 0.42vw, 0.78rem);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    min-width: 0;
  }

  .ads-table-panel .ads-magazine-tag i,
  .ads-table-panel .ads-kind-badge i,
  .ads-table-panel .ads-status-badge i,
  .ads-table-panel .ads-reminder-badge i,
  .ads-table-panel .ads-link i,
  .ads-table-panel .ads-btn i {
    font-size: clamp(0.52rem, 0.34vw, 0.7rem);
  }

  .ads-table-panel .ads-inline-badge,
  .ads-table-panel .ads-kind-badge,
  .ads-table-panel .ads-status-badge,
  .ads-table-panel .ads-reminder-badge,
  .ads-table-panel .ads-reminder-meta {
    font-size: clamp(0.52rem, 0.38vw, 0.72rem);
  }

  .ads-table-panel .ads-link,
  .ads-table-panel .ads-amount {
    white-space: normal;
  }

  .ads-table-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    min-width: 0;
  }

  .ads-table-actions form {
    width: 100%;
    min-width: 0;
  }

  .ads-table-actions .ads-btn {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
    min-width: 0;
  }

  .ads-table-panel .ads-btn-sm {
    padding: 0.18rem 0.42rem;
    font-size: clamp(0.55rem, 0.42vw, 0.76rem);
    gap: 0.2rem;
  }
}

.ads-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.95rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.ads-table-info {
  margin: 0;
  color: #6b7280;
  font-size: 0.82rem;
}

.ads-pagination {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.ads-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.65rem;
  border-radius: 0.55rem;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}

.ads-pagination a:hover {
  border-color: #00699e;
  color: #00699e;
}

.ads-pagination span {
  display: inline-flex;
  align-items: center;
  padding: 0 0.25rem;
  color: #6b7280;
  font-size: 0.8rem;
}

.ads-pagination .is-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.65rem;
  border-radius: 0.55rem;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 600;
}

.offers-page {
  margin-top: 0.5rem;
}

.offers-breadcrumb {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.35rem;
}

.offers-breadcrumb a {
  color: #00699e;
  text-decoration: none;
}

.offers-breadcrumb a:hover {
  text-decoration: underline;
}

.offers-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.offers-page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.offers-page-header h1 i {
  color: #00699e;
  font-size: 1.25rem;
}

.offers-page-header p {
  margin: 0.25rem 0 0;
  color: #6b7280;
  font-size: 0.9rem;
}

.offers-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.offers-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border-radius: 0.55rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.offers-btn i {
  font-size: 0.78rem;
}

.offers-btn:hover {
  text-decoration: none;
}

.offers-btn-primary {
  background: #00699e;
  color: #fff;
  border-color: #00699e;
}

.offers-btn-primary:hover {
  background: #005580;
  border-color: #005580;
  color: #fff;
}

.offers-btn-secondary {
  background: #fff;
  color: #374151;
  border-color: #d1d5db;
}

.offers-btn-secondary:hover {
  border-color: #00699e;
  color: #00699e;
}

.offers-btn-tertiary {
  background: #f9fafb;
  color: #374151;
  border-color: #e5e7eb;
}

.offers-btn-tertiary:hover {
  border-color: #00699e;
  color: #00699e;
}

.offers-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.offers-kpi-card {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 0.72rem;
}

.offers-kpi-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.62rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.92rem;
}

.offers-kpi-icon.is-blue {
  background: #e8f4fd;
  color: #00699e;
}

.offers-kpi-icon.is-orange {
  background: #fff7ed;
  color: #d97706;
}

.offers-kpi-icon.is-green {
  background: #e6f9f0;
  color: #16a34a;
}

.offers-kpi-icon.is-red {
  background: #fef2f2;
  color: #dc2626;
}

.offers-kpi-body {
  min-width: 0;
}

.offers-kpi-label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.offers-kpi-value {
  margin: 0.2rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
}

.offers-kpi-sub {
  margin: 0.2rem 0 0;
  color: #6b7280;
  font-size: 0.78rem;
}

.offers-filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.75rem;
  align-items: end;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 0.9rem;
}

.offers-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0;
}

.offers-filter-group span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.offers-filter-group input,
.offers-filter-group select {
  margin: 0;
}

.offers-filter-actions {
  display: flex;
  align-items: end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.customers-filter-bar {
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
}

.customers-filter-actions {
  justify-content: flex-end;
  margin-left: auto;
}

.customers-filter-actions .offers-btn {
  min-width: 130px;
}

.offers-table-panel {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.customers-form-panel {
  padding: 1rem;
}

.customers-form-panel form {
  margin: 0;
}

.offers-table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.95rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.offers-table-count,
.offers-table-page {
  margin: 0;
  color: #6b7280;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.offers-table-design {
  table-layout: auto;
}

.offers-table-design thead th {
  background: #f9fafb;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: #6b7280;
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid #e5e7eb;
}

.offers-table-design thead th a {
  color: inherit;
  text-decoration: none;
}

.offers-table-design thead th a:hover {
  color: #00699e;
}

.offers-table-design thead th.sort-active {
  background: #e9f4fb;
}

.offers-table-design thead th.sort-active a {
  color: #005580;
  font-weight: 700;
}

.offers-table-design tbody tr {
  border-bottom: 1px solid #eef0f3;
}

.offers-table-design tbody tr:last-child {
  border-bottom: 0;
}

.offers-table-design tbody td {
  padding: 0.8rem 0.95rem;
  font-size: 0.84rem;
  vertical-align: middle;
}

.offers-row:hover {
  background: #f9fafb;
}

.offers-customer-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.offers-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8f4fd;
  color: #00699e;
  font-weight: 700;
  font-size: 0.73rem;
  flex-shrink: 0;
}

.offers-customer-name {
  font-weight: 600;
}

.offers-number-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  font-size: 0.74rem;
  font-weight: 600;
}

.offers-amount {
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
}

.offers-date {
  white-space: nowrap;
  color: #374151;
}

.offers-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.16rem 0.62rem;
  font-size: 0.73rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.offers-status-badge i {
  font-size: 0.7rem;
}

.offers-status-badge.is-open {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.offers-status-badge.is-waiting {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.offers-status-badge.is-accepted {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.offers-status-badge.is-rejected {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.offers-status-badge.is-default {
  background: #f3f4f6;
  color: #374151;
  border-color: #e5e7eb;
}

.offers-table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0.95rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.offers-table-info {
  margin: 0;
  color: #6b7280;
  font-size: 0.82rem;
}

.offers-pagination {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}

.offers-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.65rem;
  border-radius: 0.55rem;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  gap: 0.25rem;
}

.offers-pagination a:hover {
  border-color: #00699e;
  color: #00699e;
}

.offers-pagination span {
  display: inline-flex;
  align-items: center;
  padding: 0 0.25rem;
  color: #6b7280;
  font-size: 0.8rem;
}

.offers-pagination .is-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.65rem;
  border-radius: 0.55rem;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 600;
  gap: 0.25rem;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: var(--pico-muted-border-color, #f3f3f3);
}

.clickable-row:focus {
  outline: 2px solid var(--pico-primary, #1095c1);
  outline-offset: -2px;
}

.form-actions-split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .list-filters {
    grid-template-columns: 1fr;
  }

  .agency-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .agency-page-header-actions {
    justify-content: flex-start;
  }

  .offers-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .ads-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .ads-page {
    padding: 0;
  }

  .ads-page-header-actions {
    justify-content: flex-start;
  }

  .agency-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ads-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .offers-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agency-filter-bar {
    grid-template-columns: 1fr;
  }

  .offers-filter-bar {
    grid-template-columns: 1fr;
  }

  .ads-filter-bar {
    grid-template-columns: 1fr;
  }

  .agency-filter-actions {
    align-items: stretch;
  }

  .ads-filter-actions {
    align-items: stretch;
  }

  .offers-filter-actions {
    align-items: stretch;
  }

  .agency-filter-actions .agency-btn {
    flex: 1 1 auto;
  }

  .offers-filter-actions .offers-btn {
    flex: 1 1 auto;
  }

  .ads-filter-actions .ads-btn {
    flex: 1 1 auto;
  }

  .agency-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .ads-action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .agency-action-left,
  .agency-action-right {
    width: 100%;
  }

  .agency-table-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .ads-action-left,
  .ads-action-right {
    width: 100%;
  }

  .list-actions {
    align-items: stretch;
  }

  .list-actions > a,
  .list-actions > button {
    width: 100%;
    text-align: center;
  }

  .offers-header-actions {
    align-items: stretch;
  }

  .offers-header-actions .offers-btn {
    width: 100%;
  }

  .offers-table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions-split {
    flex-direction: column;
    align-items: stretch;
  }

  .table-wrap.table-wrap-sticky {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-gutter: auto;
  }

  .table-toolbar-meta {
    justify-content: flex-start;
    width: 100%;
  }

  .responsive-table thead {
    display: none;
  }

  .responsive-table,
  .responsive-table tbody,
  .responsive-table tr,
  .responsive-table td {
    display: block;
    width: 100%;
  }

  .responsive-table tbody tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--pico-muted-border-color, #dcdcdc);
    border-radius: 0.5rem;
    padding: 0.7rem;
    background: var(--pico-card-background-color, #fff);
  }

  .responsive-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .responsive-table td {
    border: 0;
    border-bottom: 1px dashed var(--pico-muted-border-color, #dcdcdc);
    padding: 0.35rem 0;
    display: grid;
    grid-template-columns: minmax(7rem, 9rem) 1fr;
    gap: 0.5rem;
    align-items: start;
  }

  .responsive-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--pico-muted-color, #5f5f5f);
  }

  .table-ellipsis th,
  .table-ellipsis td {
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .table-readable tbody tr:nth-child(even) {
    background: var(--pico-card-background-color, #fff);
  }

  .agency-table .col-date,
  .agency-table .col-note {
    width: auto;
    max-width: none;
  }

  .agency-table-design tbody td {
    padding: 0.35rem 0;
  }

  .ads-table .ads-col-date {
    width: auto;
    min-width: 0;
  }

  .ads-table-design tbody td {
    padding: 0.35rem 0;
  }

  .ads-customer-cell {
    align-items: flex-start;
  }

  .ads-kpi-card {
    gap: 0.6rem;
  }

  .offers-table-design tbody td {
    padding: 0.35rem 0;
  }

  .offers-customer-cell {
    align-items: flex-start;
  }

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

  .responsive-table td[data-label="Aktionen"] {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  .responsive-table td[colspan] {
    display: block;
    border-bottom: 0;
    padding-bottom: 0;
  }

  .responsive-table td[colspan]::before {
    content: none;
  }

}

@media (max-width: 560px) {
  .agency-kpi-grid {
    grid-template-columns: 1fr;
  }

  .offers-kpi-grid {
    grid-template-columns: 1fr;
  }

  .ads-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* Agency page: aligned with provided design template */
.agency-design-page {
  background: #f0f2f5;
}

.agency-design-page main.container-wide {
  max-width: 1320px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.agency-design-page header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.agency-design-page .top-nav.container-wide {
  max-width: 100%;
  min-height: 60px;
  padding: 0 24px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.agency-design-page .top-nav ul {
  display: flex;
  align-items: center;
  gap: 24px;
}

.agency-design-page .top-nav ul li {
  margin: 0;
}

.agency-design-page .top-nav ul:first-child strong a {
  font-size: 18px;
  font-weight: 700;
  color: #00699e;
}

.agency-design-page .top-nav a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  padding: 18px 0;
  border-bottom: 2px solid transparent;
}

.agency-design-page .top-nav a:hover,
.agency-design-page .top-nav a[href="/agency/"] {
  color: #00699e;
  border-bottom-color: #00699e;
}

.agency-design-page .top-nav form {
  margin: 0;
}

.agency-design-page .top-nav button {
  background: #00699e;
  color: #fff;
  border: 1px solid #00699e;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}

.agency-design-page .top-nav button:hover {
  background: #005580;
  border-color: #005580;
}

.agency-design {
  --bg: #f0f2f5;
  --card: #fff;
  --card-hover: #f9fafb;
  --text: #1a1a2e;
  --text-secondary: #555;
  --text-muted: #888;
  --text-faint: #aaa;
  --border: #f0f0f0;
  --border-strong: #ddd;
  --brand: #00699e;
  --brand-dark: #005580;
  --brand-light: #e8f4fd;
  --shadow: rgba(0, 0, 0, 0.06);
  --shadow-hover: rgba(0, 0, 0, 0.1);
  --input-bg: #fff;
  --badge-bg: #f9fafb;
  font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  border-radius: 12px;
  padding: 1.5rem;
}

.agency-design .breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.agency-design .breadcrumb a {
  color: var(--brand);
  text-decoration: none;
}

.agency-design .breadcrumb a:hover {
  text-decoration: underline;
}

.agency-design .page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.agency-design .page-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.agency-design .page-header h1 i {
  color: var(--brand);
  font-size: 22px;
}

.agency-design .kpi-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.agency-design .kpi-mini {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 1px 4px var(--shadow);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.agency-design .kpi-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-hover);
}

.agency-design .kpi-mini-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.agency-design .kpi-mini-icon.blue {
  background: var(--brand-light);
  color: var(--brand);
}

.agency-design .kpi-mini-icon.green {
  background: #e6f9f0;
  color: #16a34a;
}

.agency-design .kpi-mini-icon.orange {
  background: #fff7ed;
  color: #d97706;
}

.agency-design .kpi-mini-icon.red {
  background: #fef2f2;
  color: #dc2626;
}

.agency-design .kpi-mini-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.agency-design .kpi-mini-value {
  font-size: 20px;
  font-weight: 700;
}

.agency-design .filter-bar {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 1px 4px var(--shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.agency-design .filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
}

.agency-design .filter-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agency-design .filter-bar input,
.agency-design .filter-bar select {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  min-width: 150px;
  margin: 0;
  transition: border-color 0.2s;
}

.agency-design .filter-bar input:focus,
.agency-design .filter-bar select:focus {
  border-color: var(--brand);
}

.agency-design .filter-actions {
  display: flex;
  gap: 8px;
  align-self: flex-end;
}

.agency-design .btn-filter,
.agency-design .btn-primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  margin: 0;
}

.agency-design .btn-filter:hover,
.agency-design .btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
  text-decoration: none;
}

.agency-design .btn-reset,
.agency-design .btn-secondary {
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  margin: 0;
}

.agency-design .btn-reset:hover,
.agency-design .btn-secondary:hover {
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
}

.agency-design .action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.agency-design .action-left {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.agency-design .table-panel {
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 1px 4px var(--shadow);
  overflow: hidden;
}

.agency-design .table-wrapper {
  overflow-x: auto;
}

.agency-design .agency-table-design {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.agency-design .agency-table-design thead th {
  background: var(--badge-bg);
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.agency-design .agency-table-design thead th a {
  color: inherit;
  text-decoration: none;
}

.agency-design .agency-table-design thead th a:hover,
.agency-design .agency-table-design thead th.sort-active a {
  color: var(--brand);
}

.agency-design .agency-table-design tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.agency-design .agency-table-design tbody tr:hover {
  background: var(--card-hover);
}

.agency-design .agency-table-design tbody td {
  padding: 14px 16px;
  font-size: 13px;
  vertical-align: middle;
  color: var(--text);
}

.agency-design .customer-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agency-design .customer-cell .avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.agency-design .customer-cell .name {
  font-weight: 500;
  white-space: nowrap;
}

.agency-design .project-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--badge-bg);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.agency-design .project-tag i {
  color: var(--brand);
  font-size: 10px;
}

.agency-design .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.agency-design .status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.agency-design .deadline-cell {
  font-size: 13px;
}

.agency-design .deadline-cell .remaining.none {
  color: var(--text-faint);
}

.agency-design .bemerkung-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 320px;
}

.agency-design .bemerkung-tag {
  background: var(--badge-bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

.agency-design .table-footer {
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  background: var(--badge-bg);
  gap: 10px;
  flex-wrap: wrap;
}

.agency-design .table-footer-info {
  font-size: 13px;
  color: var(--text-muted);
}

.agency-design .pagination {
  display: flex;
  gap: 4px;
  align-items: center;
}

.agency-design .pagination .page-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.agency-design .pagination a.page-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.agency-design .pagination .page-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.agency-design .pagination .page-btn.disabled {
  opacity: 0.5;
}

@media (max-width: 1024px) {
  .agency-design-page .top-nav ul {
    gap: 14px;
    flex-wrap: wrap;
  }

  .agency-design .kpi-mini-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .agency-design-page .top-nav.container-wide {
    padding: 0 12px;
  }

  .agency-design-page .top-nav ul {
    gap: 8px 12px;
  }

  .agency-design {
    padding: 1rem;
  }

  .agency-design .kpi-mini-grid {
    grid-template-columns: 1fr;
  }

  .agency-design .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .agency-design .filter-bar input,
  .agency-design .filter-bar select {
    width: 100%;
  }

  .agency-design .filter-actions {
    align-self: stretch;
    width: 100%;
    flex-wrap: wrap;
  }

  .agency-design .filter-actions a,
  .agency-design .filter-actions button {
    flex: 1 1 auto;
    justify-content: center;
  }

  .agency-design .page-header,
  .agency-design .action-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .agency-design .action-left {
    width: 100%;
  }

  .agency-design .action-left a {
    flex: 1 1 auto;
    justify-content: center;
  }
}
