:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-soft: #eef2f6;
    --text: #172033;
    --muted: #667085;
    --line: #d7dde6;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --blue: #245b9b;
    --green: #16a34a;
    --red: #dc2626;
    --amber: #b45309;
    --radius: 8px;
}

* {
    letter-spacing: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-navbar {
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    text-decoration: none;
}

.app-brand:hover {
    color: var(--primary);
}

.app-brand__icon {
    width: 34px;
    height: 34px;
    display: block;
    flex: 0 0 auto;
}

.app-brand__wordmark {
    font-weight: 800;
    letter-spacing: .01em;
}

.nav-user-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.nav-user-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 6px 16px rgba(15, 118, 110, .08);
}

.nav-user-avatar {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #eef6f5;
    color: var(--primary);
    flex: 0 0 28px;
}

.nav-user-avatar svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.nav-user-name {
    font-weight: 700;
    font-size: .92rem;
    white-space: nowrap;
}

.nav-logout-form {
    margin: 0;
}

.organization-display {
    display: flex;
    align-items: center;
    min-height: calc(1.5em + .75rem + 2px);
    background: #f8fafc;
    color: var(--text);
    cursor: default;
}

.organization-display[data-organization-select] {
    pointer-events: none;
}

.nav-button-link {
    border: 0;
    background: transparent;
    padding: 0;
}

.new-mailer-dropdown {
    position: relative;
    display: inline-flex;
}

.new-mailer-dropdown--page {
    justify-self: end;
}

.new-mailer-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1200;
    display: grid;
    min-width: 220px;
    max-width: min(300px, calc(100vw - 24px));
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
}

.new-mailer-menu__item {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.new-mailer-menu__item:hover {
    background: #f0fdfa;
    color: var(--primary);
}

.new-mailer-menu__empty {
    padding: 10px 12px;
    color: var(--muted);
    font-size: .92rem;
}

.navbar-brand {
    color: var(--primary);
}

.app-shell {
    width: min(1500px, calc(100% - 32px));
    margin: 24px auto 80px;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}

.page-heading__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.page-heading > :last-child {
    position: relative;
}

.page-heading h1 {
    font-size: clamp(1.8rem, 3vw, 2.7rem);
    margin: 0;
}

.eyebrow {
    text-transform: uppercase;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 20px;
    align-items: start;
}

.board-column {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 14px;
}

.mailer-card,
.campaign-card,
.form-band,
.table-band,
.empty-state,
.calendar-panel,
.detail-side section,
.email-log-view {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.mailer-card {
    display: block;
    padding: 16px;
    min-height: 178px;
    color: var(--text);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    display: flex;
    flex-direction: column;
}

.mailer-card:hover {
    color: var(--text);
    border-color: var(--primary);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.mailer-card__top,
.campaign-card__head,
.action-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.action-row {
    flex-wrap: wrap;
}

.mailer-card__title {
    color: var(--text);
    font-size: 1.12rem;
    font-weight: 800;
    text-decoration: none;
    line-height: 1.18;
    display: block;
    margin-top: 3px;
}

.mailer-card:hover .mailer-card__title {
    color: var(--primary);
}

.mailer-card__organization {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid rgba(15, 118, 110, .22);
    background: rgba(15, 118, 110, .08);
    color: var(--primary);
    border-radius: 999px;
    padding: 4px 9px;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.mailer-card__meta {
    margin-top: 6px;
    color: var(--muted);
    font-size: .82rem;
}

.date-pill {
    white-space: nowrap;
    border: 1px solid #bfd3e6;
    color: var(--blue);
    background: #eff6ff;
    border-radius: 999px;
    padding: 5px 9px;
    font-weight: 700;
    font-size: .86rem;
}

.member-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.mailer-card__body {
    flex: 1 1 auto;
    display: flex;
    align-items: flex-start;
    padding-top: 14px;
}

.mailer-card__members {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.3;
}

.mailer-card__member-name {
    color: #334155;
    font-weight: 600;
}

.mailer-card__member-sep {
    color: #94a3b8;
    font-weight: 700;
}

.member-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-soft);
    color: #334155;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: .82rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-top: 12px;
}

.status-grid--footer {
    margin-top: 0;
}

.status-item,
.summary-item {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: .9rem;
}

.status-light {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 11px;
}

.status-light.is-green {
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, .12);
}

.status-light.is-red {
    background: var(--red);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .12);
}

.status-light.is-orange {
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(180, 83, 9, .14);
}

.status-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-item small {
    color: var(--muted);
    margin-left: auto;
}

.mailer-card__footer {
    margin-top: auto;
    padding-top: 14px;
}

.calendar-panel {
    padding: 16px;
    position: sticky;
    top: 76px;
}

.calendar-title {
    font-weight: 800;
    margin-bottom: 12px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.calendar-grid--head {
    color: var(--muted);
    font-size: .75rem;
    margin-bottom: 6px;
}

.calendar-day {
    min-height: 70px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px;
    background: #fff;
}

.calendar-day.is-muted {
    opacity: .45;
}

.calendar-day.is-today {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.calendar-number {
    font-size: .82rem;
    font-weight: 700;
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
}

.calendar-events span {
    background: #fff7ed;
    color: var(--amber);
    border: 1px solid #fed7aa;
    border-radius: 5px;
    padding: 2px 4px;
    font-size: .72rem;
    font-weight: 700;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.summary-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    flex-wrap: wrap;
}

.summary-item span:last-child {
    flex-basis: 100%;
    margin-left: 18px;
}

.detail-layout,
.admin-layout,
.editor-layout,
.debug-layout {
    display: grid;
    gap: 16px;
}

.detail-layout {
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
}

.detail-layout--mailer {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  
    border-radius: var(--radius);
    padding: 18px;
}

.mailer-header-grid {
    display: grid;
    grid-template-columns: minmax(0, 10fr) minmax(240px, 2fr);
    gap: 16px;
    align-items: start;
}

.mailer-header-grid__content {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.mailer-header-grid__status {
    min-width: 0;
    height: stretch;
}

.detail-main,
.detail-side {
    display: grid;
    gap: 16px;
}

.detail-main h2,
.detail-side h2,
.form-band h2,
.table-band h2,
.campaign-card h3 {
    font-size: 1.12rem;
    margin-bottom: 12px;
}

.campaign-card,
.form-band,
.table-band,
.empty-state,
.detail-side section,
.email-log-view {
    padding: 18px;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: 16px;
}

.profile-card {
    display: grid;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
}

.profile-card h2 {
    margin-bottom: 2px;
}

.profile-card p {
    color: var(--muted);
    margin: 0;
}

.profile-card .stacked-form {
    gap: 10px;
}

.profile-switch-box {
    display: grid;
    gap: 10px;
}

.profile-switch-box .form-check.form-switch {
    margin: 0;
}

.profile-switch-box .btn {
    width: fit-content;
}

.campaign-list {
    display: grid;
    gap: 28px;
}

.campaign-list > .campaign-card,
.campaign-list > details.campaign-card {
    margin-block: 6px;
}

.campaign-card--compact {
    padding: 14px;
}

.campaign-card--compact h3 {
    margin-bottom: 6px;
}

.campaign-card__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    gap: 12px;
    align-items: stretch;
}

.campaign-card--compact .campaign-card__content {
    min-width: 0;
}

.campaign-card__preview {
    min-width: 0;
    border-left: 1px solid var(--line);
    padding-left: 12px;
    overflow: hidden;
    align-self: stretch;
    position: relative;
    min-height: 200px;
    border-radius: 0 12px 12px 0;
    background: #fff;
}

.campaign-card__preview-frame {
    position: absolute;
    top: 0;
    left: 50%;
    display: block;
    width: 320%;
    height: 320%;
    border: 0;
    overflow: hidden;
    background: #fff;
    transform: translateX(-50%) scale(.44);
    transform-origin: top center;
    pointer-events: none;
}

.campaign-card__preview-hitarea {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    background: transparent;
    cursor: pointer;
}

.campaign-card__preview-hitarea:hover {
    background: rgba(15, 23, 42, .02);
}

.campaign-card__head {
    margin-bottom: 10px;
}

.campaign-card__actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.campaign-card__actions form {
    margin: 0;
}

.campaign-card--with-preview .campaign-card__actions {
    justify-content: flex-start;
}

.mailer-status-strip {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
}

.mailer-status-strip .side-status {
    border: 0;
    background: transparent;
    padding: 0;
    flex: 0 0 auto;
    min-width: 0;
    white-space: nowrap;
}

.side-status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.side-status {
    flex: 1 1 150px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 10px;
    background: #fff;
    min-width: 0;
}

.side-status strong {
    white-space: nowrap;
}

.side-status small {
    margin-left: auto;
    white-space: nowrap;
    color: var(--muted);
    font-weight: 700;
}

.member-row--selected {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.mailer-members-band {
    display: grid;
    gap: 6px;
}

.mailer-members-band h2 {
    margin-bottom: 0;
}

.mailer-members-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.mailer-members-row h2 {
    margin: 0;
    white-space: nowrap;
}

.mailer-members-band .member-row {
    margin: 0;
}

.mailer-members-band .member-row--selected {
    gap: 6px;
    flex-wrap: nowrap;
}

.mailer-members-band .member-chip {
    padding: 2px 7px;
    font-size: .74rem;
    line-height: 1.2;
}

.mailer-members-band .member-picker summary {
    width: 26px;
    height: 26px;
    font-size: .9rem;
}

.campaign-fields,
.mailer-inline-fields {
    display: grid;
    grid-template-columns: 130px minmax(260px, 1fr);
    gap: 10px;
    align-items: start;
}

.mailer-inline-fields {
    grid-template-columns: 120px minmax(360px, 1fr) 170px;
}

.campaign-content-fields {
    display: grid;
    grid-template-columns: 130px minmax(260px, 1fr);
    gap: 10px;
    align-items: start;
}

.field-stack {
    display: block;
    min-width: 0;
    position: relative;
    padding-top: 7px;
}

.field-stack .form-label {
    position: absolute;
    top: 0;
    left: 12px;
    z-index: 2;
    background: #fff;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 400;
    line-height: 1;
    margin: 0;
    padding: 0 5px;
}

.field-stack .form-control,
.field-stack .form-select {
    background-color: #fff;
}

.field-stack .form-select[multiple] {
    min-height: 110px;
}

.campaign-field-wide,
.mailer-title-field {
    min-width: 0;
}

.user-inline-fields {
    display: flex;
}

.user-inline-form {
    display: grid;
    gap: 0;
    padding: 0;
}

.user-inline-form .field-stack {
    padding-top: 7px;
}

.user-inline-form .form-select-lg {
    min-height: calc(1.5em + 1rem + 2px);
}

.user-save-stack {
    display: flex;
    align-items: end;
    min-height: 100%;
    padding-top: 7px;
}

.user-save-stack .btn {
    width: 100%;
}

.user-actions-stack {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 7px;
}

.user-actions-stack .btn {
    width: auto;
}

.btn-delete-stack {
    display: inline-grid;
    gap: 2px;
    line-height: 1.05;
    justify-items: center;
    min-width: 108px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-color: #c9d2dd;
    background: #f8fafc;
    color: #49546a;
}

.btn-delete-stack__label {
    font-size: .92rem;
    font-weight: 600;
}

.btn-delete-stack__meta {
    font-size: .72rem;
    font-weight: 600;
    color: currentColor;
    opacity: .72;
}

.btn-delete-stack:disabled,
.btn-delete-stack.disabled {
    opacity: 1;
    border-color: #d6dde6;
    background: #eef2f6;
    color: #8b96a7;
    box-shadow: none;
}

.btn-delete-stack:disabled .btn-delete-stack__meta,
.btn-delete-stack.disabled .btn-delete-stack__meta {
    opacity: .8;
}

.btn-delete-stack:not(:disabled):hover,
.btn-delete-stack:not(:disabled):focus {
    border-color: #b8c4d3;
    background: #f1f5f9;
    color: #334155;
}

.user-record {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.user-list {
    display: grid;
    gap: 8px;
}

.date-input-field {
    width: 100%;
    min-height: calc(1.5em + 1rem + 2px);
    cursor: pointer;
    background: #fff;
    padding-right: 42px;
}

.date-picker-wrap {
    position: relative;
}

.date-picker-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 14px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    background: center / 18px 18px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cpath d='M8 2v4M16 2v4M3 10h18'/%3E%3C/svg%3E");
    pointer-events: none;
}

.date-input-field::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 6px;
    margin-right: 2px;
}

.date-input-field::-webkit-clear-button {
    display: none;
}

.date-input-field:focus {
    cursor: text;
}

.date-picker-popover {
    position: absolute;
    z-index: 30;
    top: calc(100% + 10px);
    left: 0;
    width: min(348px, calc(100vw - 24px));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .18);
    overflow: hidden;
}

.date-picker-popover__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid #e6ebf1;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.date-picker-popover__month {
    display: grid;
    gap: 2px;
}

.date-picker-popover__month strong {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.date-picker-popover__month small {
    color: var(--muted);
    font-size: .8rem;
}

.date-picker-popover__nav {
    display: inline-grid;
    grid-auto-flow: column;
    gap: 6px;
}

.date-picker-popover__nav button,
.date-picker-popover__footer button {
    border: 1px solid #d8e0ea;
    background: #fff;
    color: var(--text);
}

.date-picker-popover__nav button {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    padding: 0;
}

.date-picker-popover__nav button:hover,
.date-picker-popover__footer button:hover,
.date-picker-popover__day:hover {
    border-color: #c2d2e5;
    background: #f8fafc;
}

.date-picker-popover__body {
    padding: 12px;
}

.date-picker-popover__weekdays,
.date-picker-popover__days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.date-picker-popover__weekdays {
    margin-bottom: 8px;
}

.date-picker-popover__weekday {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 4px 0;
}

.date-picker-popover__day {
    aspect-ratio: 1;
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-size: .92rem;
    font-weight: 600;
    display: inline-grid;
    place-items: center;
    padding: 0;
}

.date-picker-popover__day.is-muted {
    color: #94a3b8;
}

.date-picker-popover__day.is-today {
    border-color: #c9dff5;
    background: #eef6ff;
    color: #174ea6;
}

.date-picker-popover__day.is-selected {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(15, 118, 110, .2);
}

.date-picker-popover__day.is-selected.is-today {
    border-color: var(--primary-dark);
}

.date-picker-popover__footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px 12px;
}

.date-picker-popover__footer button {
    flex: 1 1 0;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: .86rem;
    font-weight: 700;
}

.campaign-form {
    display: grid;
    gap: 10px;
}

.campaign-form [data-content-message] {
    position: relative;
    padding-top: 7px;
}

.campaign-form [data-content-message] > .asset-label {
    position: absolute;
    top: 0;
    left: 12px;
    z-index: 2;
}

.campaign-form [data-content-message] > .editor-toolbar {
    margin-top: 0;
}

.mailer-inline-form {
    padding: 12px;
}

.mailer-inline-form h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.add-campaign-card summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 700;
}

.campaign-card--sent {
    background: #f8fafc;
}

.sent-ribbon {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 10px;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 4px 9px;
    background: #f0fdf4;
    color: #15803d;
    font-size: .82rem;
    font-weight: 700;
}

.campaign-timeline {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
}

.campaign-step {
    position: relative;
    margin: 0;
    border-right: 1px solid var(--line);
    background: #fff;
}

.campaign-step:last-child {
    border-right: 0;
}

.campaign-step:not(:last-child)::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 50%;
    right: -7px;
    width: 14px;
    height: 14px;
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: inherit;
    transform: translateY(-50%) rotate(45deg);
}

.campaign-step__button {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    width: 100%;
    min-height: 76px;
    border: 0;
    background: #fff;
    color: var(--text);
    padding: 11px 13px;
    text-align: left;
}

.campaign-step__button:disabled {
    cursor: not-allowed;
    opacity: .58;
}

.campaign-step__button:not(:disabled) {
    cursor: pointer;
}

.campaign-step__button:not(:disabled):hover,
.campaign-step__button:not(:disabled):focus {
    background: #f0fdfa;
    outline: 0;
}

.campaign-step__dot {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--muted);
    background: #fff;
    font-size: .82rem;
    font-weight: 800;
}

.campaign-step__text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.campaign-step__text strong {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
}

.campaign-step__text small {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
}

.campaign-step.is-ready,
.campaign-step.is-ready .campaign-step__button {
    background: #f8fafc;
}

.campaign-step.is-done .campaign-step__dot {
    border-color: var(--green);
    background: var(--green);
    color: #fff;
}

.campaign-step.is-done .campaign-step__text strong {
    color: #166534;
}

.campaign-step.is-done .campaign-step__text small {
    color: #15803d;
}

.sent-campaigns-card {
    padding: 14px;
    background: #f8fafc;
}

.sent-campaigns-card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    color: var(--text);
    font-weight: 800;
}

.sent-campaigns-card summary::-webkit-details-marker {
    display: none;
}

.sent-campaigns-card summary span,
.sent-mailers-panel summary span {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .78rem;
}

.sent-campaigns-card__list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.sent-mailers-panel {
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 12px;
}

.sent-mailers-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    color: var(--text);
    font-weight: 800;
}

.sent-mailers-panel summary::-webkit-details-marker {
    display: none;
}

.sent-mailers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.sent-mailer-row {
    display: grid;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px;
    color: var(--text);
    text-decoration: none;
    background: #f8fafc;
}

.sent-mailer-row:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sent-mailer-row__title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.sent-mailer-row small {
    color: var(--muted);
}

.current-members h2 {
    font-size: .95rem;
    margin: 0 0 8px;
}

.members-side-form {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.member-chip--editable {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.member-chip__remove {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--red);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    margin-left: 1px;
}

.member-chip__remove--locked {
    color: var(--red);
    font-weight: 800;
    cursor: default;
}

.member-chip--editable.is-locked {
    cursor: default;
    opacity: .78;
}

.member-picker {
    position: relative;
}

.member-picker summary {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--primary);
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    font-size: .82rem;
    list-style: none;
}

.member-picker summary::-webkit-details-marker {
    display: none;
}

.member-picker__panel {
    position: fixed;
    z-index: 20;
    width: min(360px, calc(100vw - 24px));
    max-height: none;
    overflow: visible;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .18);
}

.member-picker__item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 7px 8px;
    border-radius: 10px;
    border: 0;
    background: #f8fafc;
    min-width: 0;
}

.member-picker__item:hover {
    background: #f0fdfa;
}

.member-picker__item .form-check-input {
    margin-top: 0;
}

.member-picker__item .form-check-label {
    margin: 0;
    font-size: .86rem;
    line-height: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .mailer-members-row {
        align-items: flex-start;
    }

    .mailer-members-row h2 {
        min-width: 100%;
    }

    .mailer-members-band .member-row--selected {
        flex-wrap: wrap;
        gap: 4px;
    }

    .mailer-members-band .member-chip {
        padding: 2px 6px;
        font-size: .72rem;
    }

    .mailer-members-band .member-picker summary {
        width: 22px;
        height: 22px;
        font-size: .76rem;
    }

    .member-picker__panel {
        width: min(100vw - 16px, 340px);
    }

    .member-picker__item {
        padding: 6px 7px;
    }

    .member-picker__item .form-check-label {
        font-size: .83rem;
    }
}

.add-campaign-card {
    padding: 14px;
}

.add-campaign-card summary {
    list-style: none;
}

.add-campaign-card summary::-webkit-details-marker {
    display: none;
}

.add-campaign-card summary::before {
    content: "+";
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: #fff;
    background: var(--primary);
    margin-right: 8px;
}

.campaign-assets {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
    position: relative;
    margin-top: 7px;
    padding: 14px 10px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.asset-label {
    background: #fff;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 400;
    line-height: 1;
    margin: 0;
    padding: 0 5px;
}

.campaign-assets > .asset-label {
    position: absolute;
    top: -1px;
    left: 12px;
    transform: translateY(-50%);
    z-index: 2;
}

.asset-group {
    display: grid;
    gap: 10px;
}

.asset-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.asset-group__body {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.asset-group__footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.asset-help-text {
    margin: 0;
    color: var(--muted);
    font-size: .88rem;
}

.asset-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.asset-row {
    display: grid;
    gap: 10px;
}

.asset-check,
.asset-chip--file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 7px;
    font-size: .87rem;
    cursor: pointer;
}

.asset-check.is-selected,
.asset-chip--file.is-selected {
    border-color: rgba(15, 118, 110, .5);
    background: #f0fdfa;
}

.asset-chip--file {
    max-width: 100%;
}

.asset-check--file-option {
    border-color: var(--line);
}

.asset-file-option-name {
    max-width: min(300px, 48vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Verzendlijstnamen volledig tonen: wrappen i.p.v. alleen horizontaal uitrekken. */
.asset-check:has([data-address-list-label]) {
    max-width: 100%;
    align-items: center;
    border-radius: 12px;
}

.asset-check [data-address-list-label] {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.3;
}

.asset-inline-meta {
    color: var(--muted);
    font-size: .87rem;
    font-weight: 400;
    white-space: nowrap;
}

.asset-chip--language,
.asset-chip--meta {
    padding: 1px 4px;
    border-radius: 999px;
    border-color: var(--line);
    color: var(--muted);
    font-size: .62rem;
    font-weight: 800;
    line-height: 1.2;
}

.asset-chip--meta {
    border-color: var(--line);
    color: var(--muted);
}

.asset-file-link {
    color: var(--blue);
    max-width: min(340px, 52vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.asset-file-link:hover {
    color: var(--primary);
}

.asset-file-editor {
    display: inline-flex;
    align-items: center;
    gap: 0;
    min-width: 0;
}

.asset-file-extension {
    color: var(--muted);
    font-size: .87rem;
}

.asset-check input {
    margin: 0;
}

.asset-name-input {
    width: 150px;
    min-width: 70px;
    border: 0;
    background: transparent;
    padding: 1px 0;
    color: var(--text);
    font-size: .87rem;
    outline: none;
}

.asset-name-input:focus {
    border-bottom: 1px solid var(--primary);
}

.asset-name-input--file {
    width: 175px;
    max-width: 36vw;
}

.chip-action {
    border: 0;
    background: transparent;
    color: var(--muted);
    line-height: 1;
    padding: 2px 3px;
    text-decoration: none;
    cursor: pointer;
}

.chip-action:hover {
    color: var(--red);
}

.chip-link:hover {
    color: var(--primary);
}

.spreadsheet-open-button span {
    display: inline-grid;
    grid-template-columns: repeat(2, 4px);
    grid-template-rows: repeat(2, 4px);
    gap: 1px;
    width: 9px;
    height: 9px;
}

.spreadsheet-open-button span::before {
    content: "";
    grid-column: 1 / 3;
    grid-row: 1 / 3;
    background:
        linear-gradient(currentColor, currentColor) left top / 4px 4px no-repeat,
        linear-gradient(currentColor, currentColor) right top / 4px 4px no-repeat,
        linear-gradient(currentColor, currentColor) left bottom / 4px 4px no-repeat,
        linear-gradient(currentColor, currentColor) right bottom / 4px 4px no-repeat;
}

.asset-action-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    flex-wrap: wrap;
}

.address-list-create {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
}

.address-list-create--button {
    width: auto;
}

.address-list-create input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    border-radius: 999px 0 0 999px;
}


.btn-icon-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    place-items: center;
    padding: 0 12px;
    font-size: .85rem;
    font-weight: 700;
}

.upload-folder-icon {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 13px;
    border: 2px solid currentColor;
    border-radius: 2px 2px 3px 3px;
    transform: skewX(-6deg);
}

.asset-upload-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    font-size: .84rem;
    font-weight: 700;
    border-radius: 999px;
}

.asset-upload-button__icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.asset-upload-button__icon svg {
    width: 18px;
    height: 18px;
}

.campaign-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.campaign-card__meta {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.campaign-card__meta strong {
    font-size: .92rem;
    color: var(--primary);
}

.campaign-card__meta small {
    color: var(--muted);
}

.campaign-card__delete {
    flex: 0 0 auto;
}

.mailer-page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.upload-folder-icon::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 1px;
    width: 10px;
    height: 6px;
    border: 2px solid currentColor;
    border-bottom: 0;
    border-radius: 2px 2px 0 0;
}

.upload-folder-icon::after {
    content: "";
    position: absolute;
    top: 2px;
    left: -3px;
    width: 21px;
    height: 11px;
    border: 2px solid currentColor;
    border-radius: 2px 2px 3px 3px;
    background: #fff;
}

[data-autosave-form].is-saving {
    border-color: #bfd3e6;
}

[data-autosave-form].is-saved {
    border-color: rgba(22, 163, 74, .55);
}

[data-autosave-form].has-save-error {
    border-color: rgba(220, 38, 38, .6);
}

[data-autosave-form] {
    position: relative;
}

.autosave-status {
    position: absolute;
    top: -14px;
    right: 12px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: min(340px, calc(100% - 24px));
    margin: 0;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--muted);
    background: #f8fafc;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
    pointer-events: none;
}

.autosave-status[data-state="saving"] {
    color: #0f766e;
    background: #f0fdfa;
    border-color: rgba(15, 118, 110, .18);
}

.autosave-status[data-state="saved"] {
    color: #166534;
    background: #f0fdf4;
    border-color: rgba(22, 163, 74, .18);
}

.autosave-status[data-state="error"] {
    color: #b91c1c;
    background: #fef2f2;
    border-color: rgba(220, 38, 38, .18);
}

.asset-chip {
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 999px;
    padding: 5px 9px;
    font-size: .82rem;
    text-decoration: none;
}

.asset-chip:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.asset-chip.asset-chip--language,
.asset-chip.asset-chip--meta {
    padding: 1px 4px;
    font-size: .62rem;
    line-height: 1.2;
    text-decoration: none;
}

.asset-chip.asset-chip--meta {
    color: var(--muted);
    border-color: var(--line);
}

.asset-chip.asset-chip--language {
    color: var(--muted);
    border-color: var(--line);
}

.debug-layout {
    grid-template-columns: minmax(0, 1fr);
}

.debug-table code {
    white-space: normal;
    word-break: break-word;
}

.debug-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.debug-metrics div,
.debug-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.debug-metrics div {
    padding: 14px;
}

.debug-metrics strong,
.debug-metrics span {
    display: block;
}

.debug-metrics span {
    color: var(--muted);
    word-break: break-word;
}

.debug-section {
    padding: 18px;
    margin-bottom: 16px;
}

.debug-section--error {
    border-color: #fecaca;
    background: #fff1f2;
}

.debug-section h2 {
    font-size: 1.12rem;
    margin-bottom: 12px;
}

.debug-section pre,
.debug-detail pre {
    background: #0f172a;
    color: #e5e7eb;
    border-radius: 7px;
    padding: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.debug-detail {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.debug-detail summary {
    cursor: pointer;
    font-weight: 700;
}

.debug-list {
    display: grid;
    gap: 8px;
}

.debug-list-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.debug-list-row small {
    display: block;
    color: var(--muted);
    word-break: break-word;
}

.debug-mail-body {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 16px;
    margin-top: 12px;
    background: #fff;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.check-grid--compact {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.inline-edit {
    margin-bottom: 16px;
}

.inline-edit__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.inline-edit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 16px;
}

.inline-edit-grid h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.form-check {
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0px 0px 0px 30px;
    background: #fff;
    min-height: 30px;
    cursor: pointer;
}

.form-check small {
    display: block;
    color: var(--muted);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    background: #f8fafc;
}

.rich-editor {
    min-height: 240px;
    border: 1px solid var(--line);
    border-radius: 0 0 7px 7px;
    background: #fff;
    padding: 16px;
    outline: none;
}

.rich-editor--compact {
    min-height: 150px;
}

.side-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 10px;
    background: #fff;
    min-width: 0;
}

.side-status strong {
    white-space: nowrap;
    font-size: 14px;
}

.side-status small {
    margin-left: auto;
    color: var(--muted);
    white-space: nowrap;
    font-size: .82rem;
}

.mailer-status-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow: visible;
}

.mailer-status-strip .side-status {
    border: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 0;
}

.mailer-status-band {
    display: grid;
    gap: 10px;
}

.mailer-status-band .mailer-status-strip {
    justify-content: flex-start;
}

.mailer-header-grid .mailer-status-band {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    height: 100%;
}

.mailer-header-grid .mailer-status-strip {
    grid-template-columns: 1fr;
    gap: 10px;
}



.col-xs-10 {
    min-width: 0;
}

.col-xs-2 {
    min-width: 0;
}

.member-row--selected {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

@media (max-width: 1100px) {
    .mailer-header-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.rich-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    background: rgba(246, 247, 249, .92);
    padding: 12px 0;
}

.comments-section,
.comment-list {
    display: grid;
    gap: 12px;
}

.comment-form {
    display: grid;
    gap: 10px;
}

.comment-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 12px;
}

.comment-item span,
.side-line small {
    color: var(--muted);
}

.side-line {
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
}

.side-line--link {
    display: block;
    color: var(--text);
    text-decoration: none;
}

.side-line--link:hover {
    color: var(--primary);
}

.download-list {
    display: grid;
    gap: 8px;
}

.page-heading__meta {
    color: var(--muted);
    font-size: .9rem;
    align-self: end;
}

.address-list-manager {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.address-list-sidebar,
.address-list-workspace {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.address-list-sidebar {
    position: sticky;
    top: 76px;
    display: grid;
    gap: 8px;
    padding: 12px;
    align-self: start;
}

.address-org-tab {
    width: 100%;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    padding: 12px 14px;
    text-align: left;
    cursor: pointer;
    transition: all .15s;
}

.address-org-tab:hover {
    border-color: #0f766e;
    box-shadow: 0 4px 12px rgba(15, 118, 110, .08);
}

.address-org-tab strong {
    font-size: .95rem;
    font-weight: 700;
}

.address-org-tab small {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 600;
}

.address-org-tab.is-active {
    background: linear-gradient(180deg, #f5fdfb 0%, #ecfbf7 100%);
    border-color: rgba(15, 118, 110, .45);
    box-shadow: 0 10px 24px rgba(15, 118, 110, .12);
    color: var(--text);
    position: relative;
}

.address-org-tab.is-active small {
    color: var(--muted);
}

.address-org-tab.is-active::before {
    content: '';
    position: absolute;
    inset: 10px auto 10px 8px;
    width: 3px;
    border-radius: 999px;
    background: var(--primary);
}

.address-org-tab.is-active strong,
.address-org-tab.is-active small {
    padding-left: 8px;
}

.address-list-workspace {
    min-height: 520px;
    display: grid;
    gap: 22px;
}

.address-org-panel {
    display: none;
    gap: 18px;
}

.address-org-panel.is-active {
    display: grid;
}

.address-workspace-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 4px 0 14px;
    border-bottom: 1px solid var(--line);
}

.address-workspace-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

.address-workspace-head small {
    color: var(--muted);
}

.address-workspace-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.address-file-section {
    display: grid;
    gap: 10px;
}

.address-file-section h3 {
    margin: 0;
    font-size: .98rem;
    font-weight: 700;
    color: var(--text);
}

.address-file-list {
    display: grid;
    gap: 10px;
}

.address-list-manager .file-explorer__card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    text-align: left;
}

.address-list-manager .file-explorer__card:hover {
    border-color: #0f766e;
    box-shadow: 0 8px 20px rgba(15, 118, 110, .08);
    transform: translateY(-1px);
}

.address-list-manager .file-explorer__card-icon {
    width: 44px;
    height: 44px;
}

.file-explorer__card-body {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.address-list-manager .file-explorer__card-name {
    font-size: .95rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}

.address-list-manager .file-explorer__card-badge {
    justify-self: start;
}

.address-file-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.address-file-section__head h3 {
    margin: 0;
}

.file-explorer__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.file-explorer__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 14px;
    background: var(--surface);
    color: var(--text);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.file-explorer__btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.file-explorer__btn--primary {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.file-explorer__btn--primary:hover {
    background: #0d6b63;
    border-color: #0d6b63;
    color: #fff;
}

.file-explorer__section-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 16px;
    border: 1px solid rgba(15, 118, 110, .18);
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    font-size: .85rem;
    font-weight: 700;
    letter-spacing: .01em;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .05);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.address-list-create__trigger {
    gap: 8px;
    min-width: max-content;
    white-space: nowrap;
}

.address-list-create__icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    color: currentColor;
    flex: 0 0 18px;
}

.address-list-create__icon svg {
    width: 18px;
    height: 18px;
}

.file-explorer__section-action:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 118, 110, .18);
    transform: translateY(-1px);
}

.file-explorer__dropdown-wrap {
    position: relative;
}

.file-explorer__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    padding: 6px;
}

.file-explorer__dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    padding: 10px;
    text-align: left;
    cursor: pointer;
}

.address-org-tab:hover {
    border-color: rgba(15, 118, 110, .35);
    box-shadow: 0 4px 12px rgba(15, 118, 110, .08);
}

.address-org-tab.is-active {
    background: linear-gradient(180deg, #f5fdfb 0%, #ecfbf7 100%);
    border-color: rgba(15, 118, 110, .45);
    box-shadow: 0 10px 24px rgba(15, 118, 110, .12);
    color: var(--text);
    position: relative;
}

.address-org-tab strong,
.address-org-tab small {
    display: block;
}

.file-explorer__grid--section {
    min-height: 0;
}

.file-explorer__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
}

.file-explorer__card:hover {
    border-color: #0f766e;
    box-shadow: 0 4px 12px rgba(15, 118, 110, .1);
    transform: translateY(-2px);
}

.file-explorer__card-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
}

.file-explorer__card-name {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-explorer__card-name-input {
    font-size: .82rem;
    font-weight: 600;
    text-align: center;
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 2px 6px;
    width: 100%;
    outline: none;
}

.file-explorer__card-badge {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 2px 8px;
    border-radius: 999px;
}

.file-explorer__card-badge--excel {
    background: #e8f5e9;
    color: #2e7d32;
}

.file-explorer__card-badge--option {
    background: #e3f2fd;
    color: #1565c0;
}

.file-explorer__card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 1;
    transition: opacity .15s;
}

.address-list-manager .file-explorer__card-actions {
    position: static;
    opacity: 1;
    justify-self: end;
    align-items: center;
}

.address-list-manager .file-explorer__card-action {
    min-width: 30px;
    height: 30px;
}

.file-explorer__card-action {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 24px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.file-explorer__card-action--open {
    text-decoration: none;
}

.address-list-workspace {
    min-height: 520px;
    padding: 18px;
}

.address-org-panel {
    display: none;
}

.address-org-panel.is-active {
    display: grid;
    gap: 18px;
}

.address-workspace-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.address-workspace-head h2 {
    margin: 0;
}

.address-workspace-head small {
    color: var(--muted);
}

.address-file-section h3 {
    font-size: .98rem;
    margin-bottom: 8px;
}

.address-file-list {
    display: grid;
    gap: 6px;
}

.address-file-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 10px;
    background: #fff;
}

.address-file-row:hover {
    border-color: rgba(15, 118, 110, .45);
}

.address-file-row.is-empty {
    background: #f8fafc;
    opacity: .78;
}

.address-file-row__type {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 800;
}

.file-explorer__card-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.file-explorer__card-action--danger:hover {
    border-color: #dc2626;
    color: #dc2626;
}

.spreadsheet-meta {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.spreadsheet-meta .field-stack {
    min-width: 0;
}

.spreadsheet-file-name-editor {
    display: flex;
    align-items: center;
    gap: 0;
    width: 100%;
    min-width: 0;
    min-height: calc(1.5em + .75rem + 2px);
    padding: .375rem .75rem;
    border: 1px solid var(--line);
    border-radius: .375rem;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.spreadsheet-file-name-editor:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}

.spreadsheet-file-name-editor .asset-name-input--file {
    flex: 1 1 auto;
    min-width: 0;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent;
}

.spreadsheet-save-stack {
    align-self: end;
}

.spreadsheet-save-stack .btn {
    min-height: 38px;
}

@media (max-width: 992px) {
    .address-list-manager {
        grid-template-columns: 1fr;
    }

    .address-list-sidebar {
        position: static;
    }

    .address-list-workspace {
        min-height: 0;
    }

    .address-list-manager .file-explorer__card {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .address-list-manager .file-explorer__card-actions {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .spreadsheet-meta {
        grid-template-columns: 1fr;
    }

    .spreadsheet-save-stack {
        align-self: stretch;
    }
}
.file-explorer__empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--muted);
    text-align: center;
    gap: 8px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: grid;
    place-items: center;
}

.modal:not([hidden]) {
    display: grid;
}

.modal[hidden] {
    display: none;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: -1;
}

.modal__dialog {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal__dialog--wide {
    max-width: 640px;
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

.modal__header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal__close {
    border: 0;
    background: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--muted);
    padding: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
}

.modal__close:hover {
    color: var(--text);
}

.modal__body {
    padding: 24px;
}

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--line);
}

.delete-confirm-modal__title {
    display: grid;
    gap: 2px;
}

.delete-confirm-modal__kicker {
    color: var(--primary);
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.delete-confirm-modal__lead {
    margin: 0 0 10px;
    font-size: 1.02rem;
    font-weight: 700;
}

.delete-confirm-modal__detail {
    margin: 0 0 12px;
    color: var(--muted);
}

.delete-confirm-modal__warning {
    margin: 0;
    color: var(--red);
    font-size: .92rem;
    font-weight: 700;
}

.delete-confirm-modal__footer form {
    margin: 0;
}

.has-overlay {
    overflow: hidden;
}

.quick-mailer-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .48);
    padding: 20px;
}

.quick-mailer-dialog {
    width: min(520px, 100%);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
    overflow: hidden;
}

.quick-mailer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line);
}

.quick-mailer-header h3 {
    margin: 2px 0 0;
    font-size: 1.12rem;
}

.quick-mailer-kicker {
    display: inline-block;
    color: var(--primary);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.quick-mailer-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 2rem;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.quick-mailer-close:hover {
    background: #f3f4f6;
    color: var(--text);
}

.quick-mailer-body {
    padding: 20px;
}

.quick-mailer-form {
    display: grid;
    gap: 12px;
}

.quick-mailer-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 8px;
    color: var(--text);
}

.form-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: .9rem;
    background: #fff;
    color: var(--text);
}

.form-input:focus {
    outline: none;
    border-color: #0f766e;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}

.form-checkboxes {
    display: grid;
    gap: 10px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-checkbox input[type="checkbox"] {
    cursor: pointer;
}

.form-checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}

.btn {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 16px;
    background: var(--surface);
    color: var(--text);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.btn--primary {
    background: #0f766e;
    border-color: #0f766e;
    color: #fff;
}

.btn--primary:hover {
    background: #0d6b63;
    border-color: #0d6b63;
    color: #fff;
}

.btn--secondary {
    background: transparent;
}

.file-explorer__card--add {
    border-style: dashed;
    border-color: #0f766e;
    background: #f0fdfa;
    cursor: pointer;
}

.file-explorer__card--add:hover {
    background: #e6faf7;
    border-color: #0d6b63;
    box-shadow: 0 4px 12px rgba(15, 118, 110, .15);
}

.file-explorer__card-badge--add {
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #0f766e;
}

.file-explorer__card--inactive {
    opacity: .55;
    border-style: dashed;
    border-color: #bdbdbd;
}
.file-explorer__card--inactive:hover {
    opacity: .8;
}

.context-menu {
    position: absolute;
    z-index: 9999;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    min-width: 160px;
    padding: 4px 0;
    overflow: hidden;
}
.context-menu button {
    display: block;
    width: 100%;
    border: none;
    background: none;
    padding: 9px 16px;
    text-align: left;
    font-size: .875rem;
    cursor: pointer;
    color: var(--text);
}
.context-menu button:hover {
    background: #f5f5f5;
}
.context-menu__danger {
    color: #d32f2f !important;
}
.context-menu__danger:hover {
    background: #ffebee !important;
}

.file-explorer__card--link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
}

.file-explorer__card--link:hover {
    border-color: #0f766e;
    box-shadow: 0 4px 12px rgba(15, 118, 110, .1);
    transform: translateY(-2px);
}

.download-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 9px 10px;
    color: var(--text);
    text-decoration: none;
    background: #fff;
}

.download-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.download-item small {
    color: var(--muted);
    white-space: nowrap;
}

.spreadsheet-editor {
    display: grid;
    gap: 12px;
    position: relative;
}

.spreadsheet-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.spreadsheet-sheets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
}

.spreadsheet-sheet {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--text);
    background: #fff;
    text-decoration: none;
    font-size: .88rem;
}

.spreadsheet-sheet:hover,
.spreadsheet-sheet.is-active {
    border-color: var(--primary);
    color: var(--primary);
}

.spreadsheet-sheet.is-active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

.spreadsheet-count {
    margin-right: auto;
    color: var(--muted);
    font-size: .9rem;
}

.spreadsheet-scroll {
    max-height: 68vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
}

.spreadsheet-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.spreadsheet-table th,
.spreadsheet-table td {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 0;
}

.spreadsheet-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    min-width: 46px;
    height: 34px;
    background: #f8fafc;
    color: var(--muted);
    font-size: .78rem;
    text-align: center;
}

.spreadsheet-filter-row th {
    top: 34px;
    z-index: 3;
    padding: 4px;
}

.spreadsheet-table tbody th {
    left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    top: auto;
    min-height: 35px;
    font-weight: 600;
}

.spreadsheet-table td input {
    width: 190px;
    min-height: 34px;
    border: 0;
    padding: 6px 8px;
    background: transparent;
    color: var(--text);
    font-size: .88rem;
}

.spreadsheet-table th input[type="search"] {
    width: 150px;
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 4px 7px;
    font-size: .82rem;
}

.spreadsheet-table th input[type="checkbox"] {
    margin: 0;
}

.spreadsheet-table input:focus {
    outline: 2px solid rgba(15, 118, 110, .35);
    outline-offset: -2px;
    background: #fff;
}

.campaign-address-summary {
    display: grid;
    gap: 5px;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

.campaign-address-summary span,
.campaign-address-summary a,
.campaign-address-summary small {
    font-size: .9rem;
}

.campaign-address-summary a {
    color: var(--primary);
    text-decoration: none;
}

.auth-body {
    background: #eef2f6;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-panel {
    width: min(440px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.auth-title {
    font-size: 1.8rem;
    margin-bottom: 18px;
}

.stacked-form {
    display: grid;
    gap: 12px;
}

.auth-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--primary);
}

.verification-box {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    background: #f8fafc;
}

.verification-spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 4px solid #cbd5e1;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.debug-toolbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 2000;
    font-size: 13px;
}

.debug-toolbar__toggle {
    width: 100%;
    border: 0;
    background: #111827;
    color: #f9fafb;
    padding: 9px 12px;
    border-radius: 7px;
    text-align: left;
}

.debug-toolbar__panel {
    background: #0f172a;
    color: #e5e7eb;
    border-radius: 7px;
    margin-top: 6px;
    padding: 12px;
    max-height: 50vh;
    overflow: auto;
}

.debug-toolbar__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.debug-toolbar__grid div {
    background: #1f2937;
    border-radius: 6px;
    padding: 8px;
}

.debug-toolbar__grid strong,
.debug-toolbar__grid span {
    display: block;
}

.debug-toolbar pre {
    color: #e5e7eb;
    background: #020617;
    border-radius: 6px;
    padding: 8px;
}

@media (max-width: 1100px) {
    .dashboard-layout,
    .detail-layout,
    .address-list-manager,
    .inline-edit-grid,
    .campaign-fields,
    .campaign-content-fields,
    .mailer-inline-fields,
    .user-inline-fields,
    .campaign-assets,
    .campaign-timeline,
    .campaign-card__grid {
        grid-template-columns: 1fr;
    }

    .campaign-card__preview {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding-left: 0;
        padding-top: 12px;
        min-height: 220px;
        border-radius: 0 0 12px 12px;
    }

    .campaign-card__preview-frame {
        top: 12px;
        left: 0;
        width: 400%;
        height: 400%;
    }

    .mailer-preview-link {
        min-height: 520px;
    }

    .campaign-step {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .campaign-step:not(:last-child)::after {
        display: none;
    }

    .campaign-step:last-child {
        border-bottom: 0;
    }

    .asset-row,
    .asset-action-row {
        align-items: stretch;
        flex-direction: column;
    }

    .asset-action-row {
        justify-content: flex-start;
    }

    .address-list-create input {
        width: min(260px, calc(100vw - 104px));
    }

    .calendar-panel {
        position: static;
    }

    .address-list-sidebar {
        position: static;
    }
}

@media (max-width: 760px) {
    .app-shell {
        width: min(100% - 20px, 1500px);
        margin-top: 14px;
    }

    .page-heading,
    .mailer-card__top,
    .campaign-card__head,
    .inline-edit__head,
    .download-item {
        align-items: stretch;
        flex-direction: column;
    }

    .board-column,
    .summary-strip {
        grid-template-columns: 1fr;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .debug-toolbar__grid {
        grid-template-columns: 1fr 1fr;
    }

    .debug-metrics,
    .debug-list-row {
        grid-template-columns: 1fr;
    }
}
