:root {
    color-scheme: dark;
    --bg: #081028;
    --surface: #0f1734;
    --surface-2: #0f203e;
    --text: #edf2ff;
    --muted: #9ab1d3;
    --accent: #6d8fff;
    --accent-2: #3d6bff;
    --success: #54d7a3;
    --warning: #f2c94c;
    --danger: #f16b6b;
    --border: rgba(127, 161, 221, 0.18);
    --shadow: 0 24px 80px rgba(2, 10, 34, 0.3);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    background: radial-gradient(circle at top, rgba(109, 143, 255, 0.12), transparent 28%),
        linear-gradient(180deg, #081026 0%, #051020 100%);
    color: var(--text);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.gate-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(4, 11, 29, 0.94);
    padding: 1.5rem;
}

.gate-card {
    width: min(520px, 100%);
    background: rgba(10, 22, 46, 0.96);
    border: 1px solid rgba(113, 141, 216, 0.18);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.gate-card h1 {
    margin: 0 0 0.5rem;
}

.gate-card p {
    margin: 0 0 1.25rem;
    color: var(--muted);
}

.gate-card input {
    width: 100%;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text);
    margin-bottom: 1rem;
}

.gate-card button {
    width: 100%;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0f172a;
    padding: 0.95rem 1rem;
    font-weight: 700;
}

.app-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    height: 100vh;
    padding: clamp(0.75rem, 1.1vw, 1.25rem);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 1rem;
    overflow: hidden;
}

.top-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0;
    width: 100%;
}

.top-bar h1 {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 2.5rem);
}

.top-bar p {
    margin: 0.4rem 0 0;
    color: var(--muted);
}

.top-actions {
    display: flex;
    gap: 0.75rem;
}

.top-actions .primary-action {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 999px;
    padding: 0;
    font-size: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-actions button,
.primary-action,
.secondary-action {
    border: 1px solid rgba(147, 170, 255, 0.18);
    background: rgba(16, 30, 61, 0.94);
    color: var(--text);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.15;
    transition: transform 0.16s ease, background 0.16s ease;
}

.top-actions button:hover,
.primary-action:hover,
.secondary-action:hover {
    transform: translateY(-1px);
    background: rgba(67, 96, 207, 0.16);
}

.primary-action {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
}

.secondary-action {
    background: rgba(12, 20, 39, 0.95);
}

.layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    transition: grid-template-columns 0.35s ease;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.layout-grid:not(.form-collapsed) {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
}

.calendar-panel,
.form-panel {
    min-width: 0;
}

.calendar-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    grid-template-areas:
        "header header"
        "board visible"
        "filters visible"
        "other visible";
    gap: 1rem;
    align-items: start;
}

.form-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-panel {
    position: relative;
    overflow: hidden;
}

.form-panel>#openFormButton {
    width: 64px;
    height: 64px;
    padding: 0;
    font-size: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.layout-grid.form-collapsed .form-panel>.panel-card {
    opacity: 0;
    transform: translateX(24px);
    pointer-events: none;
}

.layout-grid:not(.form-collapsed) .form-panel>.panel-card {
    opacity: 1;
    transform: translateX(0);
}

.panel-card {
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.layout-grid.form-collapsed .form-panel {
    max-width: 80px;
}

.layout-grid:not(.form-collapsed) .form-panel {
    max-width: 420px;
}

.layout-grid:not(.form-collapsed) .form-panel>#openFormButton {
    width: auto;
}

.form-panel>#openFormButton {
    width: auto;
    align-self: flex-end;
    padding: 0.65rem 0.95rem;
    font-size: 0.95rem;
    min-width: 64px;
}

.layout-grid.form-collapsed .form-panel>#openFormButton {
    width: 100%;
}

.calendar-header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.calendar-arrow {
    border: none;
    border-radius: 999px;
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
    color: var(--text);
    background: rgba(15, 23, 42, 0.96);
    transition: transform 0.16s ease, background 0.16s ease;
}

.calendar-arrow:hover {
    transform: translateX(1px);
    background: rgba(67, 96, 207, 0.16);
}

.month-labels {
    flex: 1;
    text-align: center;
}

.calendar-header h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.calendar-header p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.calendar-header p {
    margin: 0.4rem 0 0;
    color: var(--muted);
}

.calendar-board {
    grid-area: board;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.75rem;
}

.day-cell {
    min-height: 0;
    border-radius: 22px;
    padding: clamp(0.55rem, 1vh, 0.85rem);
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(15, 23, 42, 0.84);
    display: flex;
    flex-direction: column;
    gap: clamp(0.3rem, 0.7vh, 0.55rem);
    overflow: hidden;
}

.day-cell.inactive {
    opacity: 0.55;
    background: rgba(7, 17, 38, 0.82);
    cursor: pointer;
}

.day-cell.inactive:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(2, 8, 30, 0.14);
}

.day-cell {
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.day-cell.operational-date-highlight {
    animation: operational-date-pulse 1.9s ease-in-out infinite;
    border-color: rgba(129, 140, 248, 0.8);
    box-shadow:
        inset 0 0 0 1px rgba(129, 140, 248, 0.34),
        0 0 0 1px rgba(129, 140, 248, 0.22),
        0 0 26px rgba(99, 102, 241, 0.22);
}

.day-cell.operational-date-highlight.temporary-highlight {
    animation: operational-date-pulse 1.9s ease-in-out 4;
}

@keyframes operational-date-pulse {
    0%,
    100% {
        background: rgba(15, 23, 42, 0.84);
        box-shadow:
            inset 0 0 0 1px rgba(129, 140, 248, 0.34),
            0 0 0 1px rgba(129, 140, 248, 0.22),
            0 0 26px rgba(99, 102, 241, 0.22);
    }

    50% {
        background: rgba(49, 46, 129, 0.5);
        box-shadow:
            inset 0 0 0 1px rgba(199, 210, 254, 0.46),
            0 0 0 1px rgba(129, 140, 248, 0.42),
            0 0 34px rgba(99, 102, 241, 0.34);
    }
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.day-number {
    font-weight: 700;
}

.event-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.event-chip {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.72);
    box-shadow: 0 0 0 2px rgba(2, 10, 34, 0.32);
    background: var(--accent);
    cursor: pointer;
    position: relative;
    padding: 0;
    line-height: 1;
    transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.event-chip:hover {
    transform: scale(1.08);
    box-shadow:
        0 0 0 2px rgba(2, 10, 34, 0.32),
        0 0 0 6px rgba(99, 146, 255, 0.16);
}

.summary-overlay {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(2, 10, 34, 0.8);
    padding: 1.5rem;
    z-index: 20;
}

.summary-card {
    width: min(520px, 100%);
    background: rgba(10, 18, 42, 0.99);
    border: 1px solid rgba(113, 141, 216, 0.18);
    border-radius: 18px;
    padding: 0.9rem 1rem 1rem;
    box-shadow: var(--shadow);
    position: relative;
}

.image-viewer-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(7, 14, 30, 0.88);
    padding: 1rem;
    border-radius: 26px;
    z-index: 10;
}

.image-viewer-card {
    width: min(740px, 100%);
    max-height: 90vh;
    background: rgba(8, 18, 39, 0.98);
    border-radius: 24px;
    padding: 1rem;
    display: grid;
    gap: 0.85rem;
    position: relative;
}

.image-viewer-card img {
    width: 100%;
    height: auto;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
}

.image-viewer-caption {
    color: var(--muted);
    font-size: 0.95rem;
    text-align: center;
}

.image-viewer-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 999px;
    cursor: pointer;
}

.image-viewer-overlay.hidden {
    display: none;
}

.uploaded-report-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(2, 10, 34, 0.92);
    padding: 0.75rem;
    overflow: auto;
}

.uploaded-report-overlay.hidden {
    display: none;
}

.uploaded-report-card {
    width: min(1440px, 100%);
    min-height: calc(100vh - 1.5rem);
    margin: 0 auto;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: #081225;
    box-shadow: var(--shadow);
    padding: 0.85rem;
}

.uploaded-report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.uploaded-report-header h2 {
    margin: 0;
    font-size: clamp(1.1rem, 1.6vw, 1.45rem);
}

.uploaded-report-header p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.uploaded-report-header button {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.uploaded-report-body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.65rem;
    padding-top: 0.65rem;
}

.uploaded-report-campaign {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.82);
    padding: 0.58rem;
    min-height: 205px;
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
}

.uploaded-report-campaign.image-count-md {
    grid-column: span 2;
}

.uploaded-report-campaign.image-count-lg,
.uploaded-report-campaign.image-count-xl {
    grid-column: 1 / -1;
}

.uploaded-report-campaign header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.uploaded-report-campaign h3 {
    margin: 0;
    font-size: 0.95rem;
}

.uploaded-report-campaign h3 span {
    color: var(--muted);
    font-weight: 600;
}

.uploaded-report-campaign p {
    margin: 0.1rem 0 0;
    color: var(--muted);
    font-size: 0.76rem;
}

.uploaded-report-ticket {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.uploaded-report-ticket .ticket-link {
    width: 19px;
    height: 19px;
    margin-left: 0;
    font-size: 0.68rem;
}

.uploaded-report-dot {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.72);
    box-shadow: 0 0 0 2px rgba(2, 10, 34, 0.32);
    border-radius: 999px;
    background: var(--campaign-color);
}

.uploaded-report-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(144px, 180px));
    justify-content: space-evenly;
    align-content: start;
    gap: 0.58rem;
    min-height: 0;
    overflow: auto;
}

.uploaded-report-image {
    margin: 0;
    display: grid;
    gap: 0.22rem;
    width: 100%;
    max-width: 180px;
}

.uploaded-report-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.uploaded-report-image figcaption,
.uploaded-report-empty {
    color: var(--muted);
    font-size: 0.68rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1080px) {
    .uploaded-report-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .uploaded-report-campaign.image-count-md,
    .uploaded-report-campaign.image-count-lg,
    .uploaded-report-campaign.image-count-xl {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .uploaded-report-body {
        grid-template-columns: 1fr;
    }
}

.summary-upload-action {
    display: flex;
    justify-content: flex-end;
}

.icon-action {
    border: none;
    background: transparent;
    color: var(--text);
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease;
    padding: 0;
}

.icon-action:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.08);
}

.summary-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    min-height: 34px;
    margin: 0 0 0.65rem;
}

.summary-header > div {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 34px;
}

.summary-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
}

.summary-header h2 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.15;
}

.summary-title-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

#summaryTicket {
    display: none;
    margin: 0;
}

.summary-title-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    flex: 0 0 14px;
    border-radius: 999px;
    background: var(--campaign-color);
    border: 1px solid rgba(148, 163, 184, 0.74);
    box-shadow: 0 0 0 2px rgba(2, 10, 34, 0.34);
    position: relative;
    cursor: pointer;
    padding: 0;
    margin: 0;
    vertical-align: middle;
    appearance: none;
}

.summary-title-dot:hover,
.summary-title-dot:focus-visible {
    transform: scale(1.12);
    outline: none;
    box-shadow:
        0 0 0 2px rgba(2, 10, 34, 0.34),
        0 0 0 5px rgba(99, 146, 255, 0.16);
}

.event-chip.upload-due::before,
.event-chip.takedown-due::before {
    content: "";
    position: absolute;
    left: -4px;
    top: -7px;
    z-index: 2;
    width: 13px;
    height: 16px;
    filter: drop-shadow(0 0 2px rgba(2, 10, 34, 0.42));
}

.event-chip.upload-due::before {
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 16'%3E%3Cpath d='M6.5 13V5M3.3 7.7 6.5 4l3.2 3.7' fill='none' stroke='%23020a22' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.5 13V5M3.3 7.7 6.5 4l3.2 3.7' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.event-chip.takedown-due::before {
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 16'%3E%3Cpath d='M6.5 3v8M3.3 8.3 6.5 12l3.2-3.7' fill='none' stroke='%23020a22' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6.5 3v8M3.3 8.3 6.5 12l3.2-3.7' fill='none' stroke='%23fb7185' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.event-chip.uploaded::after,
.visible-campaign-dot.uploaded::after,
.summary-title-dot.uploaded::after {
    content: "✓";
    position: absolute;
    right: -5px;
    bottom: -5px;
    display: grid;
    place-items: center;
    width: 11px;
    height: 11px;
    border: 1px solid rgba(3, 18, 10, 0.9);
    border-radius: 999px;
    background: #22c55e;
    color: #04130a;
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
}

.summary-title-dot.uploaded::after {
    right: -3px;
    bottom: -3px;
    width: 9px;
    height: 9px;
    font-size: 7px;
}

.summary-header .summary-title-dot {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    flex: 0 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.74);
    background: var(--campaign-color);
    color: inherit;
    border-radius: 999px;
    padding: 0;
    font-size: 0;
    line-height: 0;
}

.panel-card-top .secondary-action,
.summary-header .secondary-action {
    padding: 0.58rem 0.78rem;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.15;
    min-height: 34px;
}

.summary-header .secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.summary-body {
    display: grid;
    gap: 0;
    padding: 0;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.88);
}

.summary-row {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.62rem 0.85rem;
    min-height: 36px;
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: transparent;
    border-radius: 0;
    font-size: 0.92rem;
    line-height: 1.35;
}

.summary-row-tall {
    align-items: start;
}

.summary-row:first-child {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row strong {
    color: var(--muted);
    align-self: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.summary-row span {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    color: var(--text);
    text-align: right;
    min-width: 0;
    font-size: 0.92rem;
    line-height: 1.35;
}

.summary-row .agent-cell {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    min-width: 0;
    font-size: 0.9rem;
}

.summary-row .summary-agent-stack {
    display: grid;
    justify-items: end;
    gap: 0.35rem;
}

.summary-row .summary-metadata-stack {
    display: grid;
    justify-items: end;
    gap: 0.2rem;
}

.summary-row .summary-metadata-stack span {
    display: block;
    text-align: right;
}

.summary-row .agent-role {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0;
}

.summary-row .agent-pending-label {
    border: 1px solid rgba(242, 201, 76, 0.28);
    border-radius: 999px;
    color: var(--warning);
    padding: 0.12rem 0.42rem;
    font-size: 0.72rem;
    line-height: 1.2;
}

.agent-picker-row {
    display: grid;
    padding: 0 1rem 0.75rem;
}

.agent-picker-row.hidden {
    display: none;
}

.agent-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.88);
}

.agent-option {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text);
    border-radius: 999px;
    padding: 0.55rem 0.8rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.16s ease, transform 0.16s ease;
}

.agent-option:hover {
    transform: translateY(-1px);
    background: rgba(148, 163, 184, 0.16);
}

.agent-option.agent-cancel {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.2);
}

.calendar-filter-bar {
    grid-area: filters;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem 0 0 0;
}

.calendar-filter-bar .filter-action {
    border-radius: 999px;
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
}

.calendar-filter-bar .filter-action.active,
.calendar-filter-bar .filter-action:hover {
    background: rgba(67, 96, 207, 0.16);
}

.calendar-other-list {
    position: fixed;
    padding: 0;
    z-index: 30;
    max-width: calc(100% - 24px);
}

.calendar-other-list .other-menu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    max-height: min(260px, calc(100vh - 160px));
    overflow-y: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    scrollbar-width: thin;
}

.calendar-other-list .other-option {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(16, 30, 61, 0.95);
    color: var(--text);
    border-radius: 999px;
    padding: 0.62rem 0.7rem;
    cursor: pointer;
    text-align: center;
    min-width: 0;
}

.calendar-other-list .other-option:hover {
    background: rgba(67, 96, 207, 0.16);
}

.calendar-other-list .other-empty {
    display: block;
    color: var(--muted);
    padding: 0.7rem 0.85rem;
    text-align: center;
    line-height: 1.35;
}

.calendar-other-list.hidden {
    display: none;
}

.summary-agent-pending {
    opacity: 0.88;
}

.summary-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.85rem;
    margin: 1.25rem auto 0;
    width: min(100%, 620px);
}

.summary-actions button {
    width: 100%;
    padding: 0.95rem 1rem;
    min-width: 0;
    white-space: normal;
    line-height: 1.2;
}

.danger-action {
    border-color: rgba(248, 113, 113, 0.34);
    color: #fecaca;
}

.danger-action:hover,
.danger-action:focus-visible {
    background: rgba(248, 113, 113, 0.16);
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: grid;
    place-items: center;
    z-index: 60;
    padding: 1.5rem;
}

.confirm-card {
    width: min(520px, 100%);
    background: rgba(11, 18, 33, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.confirm-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.confirm-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.confirm-card p {
    margin: 0 0 1rem;
    color: var(--muted);
}

.confirm-card textarea {
    width: 100%;
    min-height: 100px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.96);
    color: var(--text);
    padding: 0.95rem 1rem;
    resize: vertical;
    font: inherit;
    margin-bottom: 1rem;
}

.confirm-card textarea.required {
    border-color: rgba(245, 158, 11, 0.8);
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
}

.summary-block {
    display: grid;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.summary-block strong {
    color: var(--muted);
    font-size: 0.84rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 0.75rem;
}

.summary-image-card {
    display: grid;
    gap: 0.5rem;
    padding: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.95);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.summary-image-card:hover,
.summary-image-card:focus-visible {
    background: rgba(40, 53, 78, 0.98);
    border-color: rgba(125, 160, 255, 0.52);
    transform: translateY(-1px);
}

.summary-image-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.summary-image-card span {
    color: var(--text);
    font-size: 0.82rem;
    word-break: break-word;
}

.existing-images {
    margin-top: 0.85rem;
}

.existing-image-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.95rem;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.9);
    color: var(--text);
}

.remove-image-button {
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    padding: 0.5rem 0.85rem;
    cursor: pointer;
}

.remove-image-button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.summary-row span {
    text-align: right;
    color: var(--text);
}

.ticket-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 0.5rem;
    border-radius: 999px;
    background: rgba(109, 143, 255, 0.12);
    color: var(--accent);
    text-decoration: none;
    border: 1px solid rgba(109, 143, 255, 0.24);
    font-size: 0.78rem;
    line-height: 1;
    padding: 0;
}

.ticket-link:hover {
    background: rgba(109, 143, 255, 0.18);
}

.panel-card {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 24px;
    padding: 1.25rem;
    box-shadow: var(--shadow);
}

.panel-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-card-top h2 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.15;
}

.panel-card h2 {
    margin: 0 0 1rem;
}

#campaignForm {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

label {
    display: grid;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text);
    padding: 0.9rem 1rem;
    font-size: 0.92rem;
    line-height: 1.25;
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.5rem;
}

input[type="file"] {
    padding: 0.65rem 1rem;
}

input[type="file"]::-webkit-file-upload-button,
input[type="file"]::file-selector-button {
    border: none;
    border-radius: 14px;
    padding: 0.8rem 1rem;
    margin-right: 0.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0f172a;
    font-weight: 700;
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button:hover,
input[type="file"]::file-selector-button:hover {
    filter: brightness(1.05);
}

.date-input {
    cursor: pointer;
    caret-color: transparent;
}

.date-picker {
    position: fixed;
    z-index: 80;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    background: rgba(8, 16, 38, 0.98);
    box-shadow: 0 20px 50px rgba(2, 8, 30, 0.35);
    padding: 0.65rem;
}

.date-picker-header {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
}

.date-picker-header strong {
    text-align: center;
    text-transform: capitalize;
    font-size: 0.88rem;
}

.date-picker-nav,
.date-picker-day {
    border: none;
    color: var(--text);
    background: transparent;
}

.date-picker-nav {
    width: 30px;
    height: 30px;
    border-radius: 8px;
}

.date-picker-nav:hover,
.date-picker-day:hover {
    background: rgba(67, 96, 207, 0.18);
}

.date-picker-weekdays,
.date-picker-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.2rem;
}

.date-picker-weekdays {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    text-align: center;
}

.date-picker-day,
.date-picker-empty {
    min-height: 28px;
    border-radius: 8px;
    font-size: 0.82rem;
}

.date-picker-day.today {
    outline: 1px solid rgba(109, 143, 255, 0.5);
}

.date-picker-day.selected {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
}

.segment-group {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.date-range-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.small-label {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.segment-group span {
    font-weight: 600;
}

.segment-group label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.agent-row {
    display: grid;
    gap: 0.75rem;
}

.agent-row button {
    justify-self: start;
    width: max-content;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.92);
    color: var(--text);
    border-radius: 14px;
    padding: 0.85rem 1rem;
}

button[type="submit"] {
    width: 100%;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0f172a;
    padding: 0.95rem 1rem;
    font-weight: 700;
    margin-top: 0.85rem;
}

.info-text,
.help-text,
.hint {
    color: var(--muted);
    font-size: 0.95rem;
}

.schedule-warning {
    margin: -0.45rem 0 0.75rem;
    color: var(--warning);
    font-size: 0.86rem;
    line-height: 1.35;
}

.minimal-help {
    padding-bottom: 0.75rem;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    padding: 0.95rem 1.2rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

@media (max-width: 1080px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .calendar-board {
        gap: 0.55rem;
    }

    .day-cell {
        min-height: 0;
    }

    .top-bar,
    .calendar-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-actions {
        width: 100%;
    }

    .view-toggle {
        width: 100%;
        justify-content: space-between;
    }
}

.visible-campaigns-card {
    grid-area: visible;
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.72);
    border-radius: 20px;
    padding: 1rem;
}

.visible-campaigns-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.visible-campaign-list {
    display: grid;
    gap: 0.5rem;
}

.visible-campaign-item {
    width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(12, 20, 39, 0.95);
    color: var(--text);
    border-radius: 999px;
    padding: 0.65rem 0.8rem;
    text-align: left;
}

.visible-campaign-item:hover {
    background: rgba(67, 96, 207, 0.16);
}

.visible-campaign-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    flex: 0 0 auto;
    position: relative;
}

.visible-campaign-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campaign-list-empty {
    margin: 0;
    color: var(--muted);
}


@media (max-width: 1180px) {
    .calendar-panel {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "board"
            "visible"
            "filters"
            "other";
    }

    .visible-campaigns-card {
        position: static;
        max-height: none;
    }

    .visible-campaign-list {
        display: flex;
        flex-wrap: wrap;
    }

    .visible-campaign-item {
        width: auto;
    }
}

@media (min-width: 1440px) {
    .day-cell {
        min-height: 0;
    }
}

/* Add-campaign layout refinement */
.layout-grid.form-active .calendar-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "header"
        "board"
        "filters"
        "other";
}

.layout-grid.form-active .form-panel {
    gap: 0.75rem;
}

.form-panel > .visible-campaigns-card {
    order: 0;
}

.form-panel > .panel-card {
    order: 1;
}

.visible-campaigns-card.compact {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0.65rem 0.75rem;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.84);
}

.visible-campaigns-card.compact h3 {
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
    line-height: 1.1;
}

.visible-campaigns-card.compact .visible-campaign-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.visible-campaigns-card.compact .visible-campaign-item {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 0;
    justify-content: center;
    border-radius: 999px;
}

.visible-campaigns-card.compact .visible-campaign-dot {
    width: 0.78rem;
    height: 0.78rem;
}

.visible-campaigns-card.compact .visible-campaign-name {
    display: none;
}

.visible-campaigns-card.compact .campaign-list-empty {
    font-size: 0.82rem;
}

.layout-grid.form-active .panel-card {
    padding: 0.85rem;
    border-radius: 18px;
}

.layout-grid.form-active .panel-card-top {
    margin-bottom: 0.55rem;
}

.layout-grid.form-active .panel-card-top h2,
.layout-grid.form-active .panel-card h2 {
    margin-bottom: 0;
    font-size: 1rem;
}

.layout-grid.form-active label {
    gap: 0.35rem;
    margin-bottom: 0.62rem;
    font-size: 0.9rem;
}

.layout-grid.form-active .checkbox-row {
    gap: 1rem;
    margin: -0.1rem 0 0.62rem;
}

.layout-grid.form-active .checkbox-row .compact-checkbox {
    margin: 0;
}

.layout-grid.form-active input[type="text"],
.layout-grid.form-active input[type="url"],
.layout-grid.form-active input[type="password"],
.layout-grid.form-active input[type="file"],
.layout-grid.form-active textarea,
.layout-grid.form-active select {
    border-radius: 11px;
    padding: 0.62rem 0.75rem;
    font-size: 0.9rem;
}

.layout-grid.form-active input[type="file"] {
    padding: 0.45rem 0.6rem;
}

.layout-grid.form-active input[type="file"]::-webkit-file-upload-button,
.layout-grid.form-active input[type="file"]::file-selector-button {
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
}

.layout-grid.form-active .date-range-row,
.layout-grid.form-active .segment-group,
.layout-grid.form-active .agent-row {
    gap: 0.5rem;
}

.layout-grid.form-active .small-label {
    margin-bottom: 0.2rem;
    font-size: 0.82rem;
}

.layout-grid.form-active .info-text {
    margin: 0.35rem 0 0.25rem;
    font-size: 0.82rem;
    line-height: 1.35;
}

.layout-grid.form-active .schedule-warning {
    margin: -0.1rem 0 0.35rem;
    font-size: 0.78rem;
}

.layout-grid.form-active button[type="submit"] {
    border-radius: 13px;
    padding: 0.72rem 0.85rem;
    margin-top: 0.65rem;
}

.layout-grid.form-active .secondary-action {
    padding: 0.62rem 0.75rem;
    border-radius: 11px;
}

.layout-grid.form-active .existing-images {
    margin-top: 0.45rem;
}

.layout-grid.form-active .existing-image-row {
    padding: 0.48rem 0.65rem;
    border-radius: 11px;
    font-size: 0.86rem;
}

.layout-grid.form-active .remove-image-button {
    padding: 0.4rem 0.6rem;
}

/* Restored right-rail campaign workflow */
.top-link {
    text-decoration: none;
    white-space: nowrap;
}

.layout-grid,
.layout-grid:not(.form-collapsed),
.layout-grid.form-active,
.layout-grid.summary-active {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    align-items: start;
}

.calendar-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    min-height: 0;
    height: 100%;
    position: relative;
}

.campaign-list-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding-top: calc(56px + 1rem + 4px);
}

.calendar-header {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 1rem;
    min-height: 56px;
    width: 100%;
}

.month-labels {
    min-width: 0;
    text-align: center;
}

.calendar-arrow {
    justify-self: center;
}

.calendar-board,
.calendar-filter-bar {
    width: 100%;
}

.calendar-board {
    flex: 1 1 auto;
    min-height: 0;
    grid-auto-rows: minmax(0, 1fr);
}

.calendar-filter-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0;
}

.calendar-filter-bar .filter-action {
    width: 100%;
    text-align: center;
}

.layout-grid.form-active .campaign-list-panel,
.layout-grid.summary-active .campaign-list-panel {
    padding-top: 0;
}

.layout-grid.form-active .campaign-list-panel {
    overflow: hidden;
}

.campaign-list-card {
    width: 100%;
    max-height: 100%;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.82);
    padding: 1rem;
    transition: border-radius 0.24s ease, padding 0.24s ease, background 0.24s ease, transform 0.24s ease;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.campaign-list-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.campaign-list-card h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--muted);
}

.campaign-list-card .primary-action {
    width: auto;
    height: auto;
    min-width: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    line-height: 1;
    box-shadow: none;
}

.campaign-list-card .primary-action:hover {
    transform: none;
    background: transparent;
    color: var(--accent);
}

.archive-campaign-card {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.82);
    padding: 1rem;
    display: grid;
    gap: 0.85rem;
    min-height: 0;
    transition: border-radius 0.24s ease, padding 0.24s ease, background 0.24s ease;
}

.archive-campaign-toggle {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--muted);
    padding: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
}

.archive-campaign-toggle:hover,
.archive-campaign-toggle:focus-visible {
    color: var(--text);
}

.archive-campaign-toggle span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.archive-campaign-list {
    display: grid;
    gap: 0.45rem;
    max-height: 180px;
    overflow-y: auto;
    padding: 0.05rem 0.25rem 0.05rem 0.05rem;
    scrollbar-width: thin;
}

.archive-campaign-list.hidden {
    display: none;
}

.archive-campaign-item {
    width: 100%;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    background: rgba(8, 16, 38, 0.58);
    color: var(--text);
    padding: 0.58rem 0.62rem;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.16s ease, transform 0.16s ease;
}

.archive-campaign-item:hover,
.archive-campaign-item:focus-visible {
    background: rgba(67, 96, 207, 0.14);
}

.layout-grid.form-active .campaign-list-card,
.layout-grid.summary-active .campaign-list-card {
    border-radius: 999px;
    padding: 0.68rem 0.7rem 0.5rem;
    background: rgba(15, 23, 42, 0.9);
    overflow: visible;
}

.layout-grid.form-active .campaign-list-card {
    order: 1;
    flex: 0 0 auto;
}

.layout-grid.summary-active .campaign-list-card {
    order: 1;
    flex: 0 0 auto;
}

.layout-grid.form-active #campaignFormCard {
    order: 2;
    flex: 0 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    display: flex;
    flex-direction: column;
}

.layout-grid.form-active #campaignForm {
    flex: 0 0 auto;
}

.layout-grid.form-active .archive-campaign-card {
    order: 3;
    flex: 0 0 auto;
}

.layout-grid.summary-active .summary-overlay {
    order: 2;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
}

.layout-grid.summary-active .archive-campaign-card {
    order: 3;
    flex: 0 0 auto;
}

.layout-grid.summary-active .archive-campaign-list {
    max-height: 140px;
}

.layout-grid.form-active .archive-campaign-list {
    max-height: 140px;
}

.layout-grid.form-active .campaign-list-card-top,
.layout-grid.summary-active .campaign-list-card-top {
    display: none;
}

.layout-grid.form-active .visible-campaign-list,
.layout-grid.summary-active .visible-campaign-list {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 0.45rem;
    min-height: 20px;
    padding-top: 2px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    width: 100%;
}

.layout-grid.form-active .visible-campaign-list::-webkit-scrollbar,
.layout-grid.summary-active .visible-campaign-list::-webkit-scrollbar {
    display: none;
}

.layout-grid.form-active .visible-campaign-item,
.layout-grid.summary-active .visible-campaign-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    border-radius: 999px;
    padding: 0;
    flex: 0 0 auto;
}

.layout-grid.form-active .visible-campaign-item:hover,
.layout-grid.summary-active .visible-campaign-item:hover {
    transform: none;
    background: transparent;
}

.layout-grid.form-active .visible-campaign-dot,
.layout-grid.summary-active .visible-campaign-dot {
    width: 14px;
    height: 14px;
}

.layout-grid.form-active .visible-campaign-name,
.layout-grid.summary-active .visible-campaign-name {
    display: none;
}

.layout-grid.form-active .archive-campaign-card:not(.expanded),
.layout-grid.summary-active .archive-campaign-card:not(.expanded) {
    border-radius: 999px;
    padding: 0.58rem 0.7rem;
    background: rgba(15, 23, 42, 0.9);
}

.layout-grid.form-active .archive-campaign-card:not(.expanded) .archive-campaign-toggle,
.layout-grid.summary-active .archive-campaign-card:not(.expanded) .archive-campaign-toggle {
    text-align: center;
    font-size: 0.9rem;
}

.visible-campaigns-card {
    display: none;
}

.visible-campaign-list {
    display: grid;
    gap: 0.45rem;
    min-height: 0;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.05rem 0.25rem 0.05rem 0.05rem;
    scrollbar-width: thin;
}

.visible-campaign-item {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr) 10px;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 12px;
    background: rgba(8, 16, 38, 0.58);
    color: var(--text);
    padding: 0.58rem 0.62rem;
    text-align: left;
    transition: background 0.16s ease, transform 0.16s ease;
}

.visible-campaign-item:hover {
    transform: none;
    background: rgba(67, 96, 207, 0.14);
}

.visible-campaign-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.72);
    box-shadow: 0 0 0 2px rgba(2, 10, 34, 0.32);
}

.visible-campaign-alert {
    width: 8px;
    height: 8px;
    justify-self: end;
    border-radius: 999px;
    box-shadow: none;
    animation: visible-alert-blink 1s ease-in-out infinite;
}

.visible-campaign-alert.soon {
    background: var(--warning);
}

.visible-campaign-alert.due {
    background: #ef4444;
}

.layout-grid.form-active .visible-campaign-item,
.layout-grid.summary-active .visible-campaign-item {
    position: relative;
    overflow: visible;
}

.layout-grid.form-active .visible-campaign-alert,
.layout-grid.summary-active .visible-campaign-alert {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    width: 7px;
    height: 7px;
    justify-self: auto;
    border: none;
    box-shadow: none;
}

@keyframes visible-alert-blink {
    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.38;
        transform: scale(0.78);
    }
}

.visible-campaign-name {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layout-grid.form-active .panel-card,
.layout-grid.summary-active .summary-overlay {
    opacity: 1;
    transform: translateX(0);
}

.summary-overlay {
    position: static;
    inset: auto;
    display: block;
    place-items: initial;
    width: 100%;
    min-width: 0;
    background: transparent;
    padding: 0;
    z-index: auto;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.summary-card {
    width: 100%;
    padding: 0.9rem 1rem 1rem;
}

.summary-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.45rem;
    margin: 0.75rem auto 0;
    width: 100%;
}

.summary-actions button {
    padding: 0.68rem 0.45rem;
    border-radius: 11px;
    font-size: 0.9rem;
    font-weight: 600;
}

.panel-card {
    border-radius: 18px;
    padding: 1rem;
}

.panel-card-top {
    gap: 0.85rem;
    margin-bottom: 0.75rem;
}

.panel-card-top h2 {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.15;
}

label {
    gap: 0.4rem;
    margin-bottom: 0.7rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--muted);
}

.compact-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: -0.1rem 0 0.75rem;
    color: var(--muted);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: -0.1rem 0 0.75rem;
}

.checkbox-row .compact-checkbox {
    margin: 0;
}

.compact-checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.date-range-row,
.agent-select-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.agent-select-row label {
    margin-bottom: 0;
}

#campaignForm .info-text {
    margin: 0.35rem 0 0.75rem;
}

@media (max-width: 1080px) {
    .layout-grid,
    .layout-grid:not(.form-collapsed),
    .layout-grid.form-active,
    .layout-grid.summary-active {
        grid-template-columns: 1fr;
    }

    .campaign-list-panel {
        padding-top: 0;
    }
}

@media (max-width: 720px) {
    .agent-select-row,
    .date-range-row {
        grid-template-columns: 1fr;
    }

    .calendar-header {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        align-items: center;
    }

    .calendar-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Schedule inspection page */
.schedule-shell {
    min-height: 100vh;
}

.schedule-page {
    display: grid;
    gap: 1rem;
}

.schedule-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.9);
    padding: 1rem;
}

.schedule-toolbar h2 {
    margin: 0;
    font-size: 1.15rem;
}

.schedule-toolbar p {
    margin: 0.25rem 0 0;
    color: var(--muted);
}

.schedule-actions {
    display: grid;
    grid-template-columns: minmax(220px, 360px) auto;
    gap: 0.75rem;
    align-items: center;
}

.schedule-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.schedule-stat {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    background: rgba(8, 16, 38, 0.58);
    padding: 0.85rem 1rem;
}

.schedule-stat strong {
    display: block;
    font-size: 1.25rem;
}

.schedule-stat span {
    color: var(--muted);
    font-size: 0.88rem;
}

.schedule-table-wrap {
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.86);
}

.schedule-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    text-align: left;
}

.schedule-table th {
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.98);
    color: var(--muted);
    font-size: 0.86rem;
    z-index: 1;
}

.schedule-raw {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    background: rgba(8, 16, 38, 0.58);
    padding: 0.85rem 1rem;
}

.schedule-raw summary {
    cursor: pointer;
    color: var(--muted);
}

.schedule-raw pre {
    max-height: 420px;
    overflow: auto;
    margin-bottom: 0;
}

@media (max-width: 720px) {
    .schedule-toolbar {
        display: grid;
    }

    .schedule-actions,
    .schedule-stats {
        grid-template-columns: 1fr;
    }
}
