/* css/calendar.css - Premium 90-Day Strategy Grid Styles - v1.1 */

/* Cabecera controlada por sa-report-header en ui.css/analytics.css */

/* Controles integrados en sa-report-header */

.sa-btn-tab {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.sa-btn-tab:hover {
    color: #ffffff;
}

.sa-btn-tab--active {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    color: #ffffff;
    font-weight: 500;
}

.sa-calendar-actions {
    display: flex;
    gap: 12px;
}

.sa-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
    padding: 2px;
    margin-top: 24px;
}

.sa-calendar-day {
    min-height: 120px;
    background: #121421;
    border: 1px solid #1f2235;
    border-radius: 12px;
    padding: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sa-calendar-day:hover {
    border-color: #8b5cf6;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(139, 92, 246, 0.15);
}

.sa-calendar-day.has-strategy {
    border-left: 4px solid #06b6d4;
}

.sa-day-number {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.sa-post-pill {
    font-size: 0.8rem;
    color: #ffffff;
    background: #1f2235;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.sa-day-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    min-height: 20px;
}

.sa-day-pulse {
    display: flex;
    gap: 4px;
}

.sa-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.sa-pulse-dot.is-linkedin {
    background: #a855f7;
    /* Lila */
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

.sa-pulse-dot.is-x {
    background: #06b6d4;
    /* Cian */
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
}

.sa-platform-badge {
    font-size: 0.65rem;
    color: #06b6d4;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* Modal Enhancements */
.sa-glass-modal {
    backdrop-filter: blur(12px);
    background: rgba(18, 20, 33, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.sa-modal-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.sa-pill-mini {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.sa-text-dimmed {
    color: #94a3b8;
    font-size: 0.8rem;
}

.sa-post-preview-box {
    background: #0a0b14;
    border: 1px solid #1f2235;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    min-height: 200px;
    color: #e2e8f0;
    line-height: 1.6;
    white-space: pre-wrap;
    font-size: 0.95rem;
}

.sa-editor-textarea {
    width: 100%;
    min-height: 300px;
    margin-bottom: 20px;
}

.sa-ai-progress-container {
    width: 100%;
    max-width: 1200px;
}

.sa-ai-progress-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.sa-ai-progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.sa-ai-status-text {
    font-size: 0.75rem;
    color: #94a3b8;
    font-style: italic;
    margin: 0;
    text-align: left;
    letter-spacing: 0.5px;
}

.sa-loading-container {
    padding: 60px 20px;
    text-align: center;
}

.sa-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.1);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: sa-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes sa-spin {
    to {
        transform: rotate(360deg);
    }
}

.sa-loading-text {
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 8px;
}

.sa-loading-subtext {
    color: #94a3b8;
    font-size: 0.85rem;
}

/* Empty State */
.sa-calendar-empty-state {
    grid-column: 1 / -1;
    padding: 100px 20px;
    text-align: center;
    background: #121421;
    border: 2px dashed #1f2235;
    border-radius: 20px;
}

.sa-empty-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Active Periods Rendering - Silicon Valley Style */
.sa-calendar-day.is-today {
    border: 2px solid #a855f7 !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
    position: relative;
    z-index: 2;
    opacity: 1 !important;
    filter: none !important;
    pointer-events: auto !important;
}

.sa-calendar-day.is-today::after {
    content: 'TODAY';
    position: absolute;
    top: -10px;
    right: 10px;
    background: #a855f7;
    color: white;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
}

.sa-calendar-day.is-active {
    background: rgba(147, 51, 234, 0.08);
    border: 1px solid rgba(147, 51, 234, 0.25);
}

.sa-calendar-day.is-active .sa-day-number {
    color: #c084fc;
    font-weight: 700;
}

/* Historic / Past Days - Dimmed & Non-interactive */
.sa-calendar-day.is-past {
    opacity: 0.4;
    filter: grayscale(1);
    cursor: default !important;
    pointer-events: none;
    border-left-width: 1px !important;
    /* Reset strategy border highlight */
    border-color: #1f2235 !important;
    background: #0d0f1a;
}

.sa-calendar-day.is-past:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: #1f2235 !important;
}

.sa-calendar-day.is-past .sa-post-pill {
    background: #1a1c2e;
    color: #64748b;
}

.sa-calendar-day.is-past .sa-platform-badge {
    color: #475569;
}

.sa-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
}

.sa-day-name {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sa-view-day {
    grid-template-columns: repeat(7, 1fr);
}

.sa-view-week {
    grid-template-columns: repeat(7, 1fr);
    font-size: 0.85rem;
}

.sa-view-month {
    grid-template-columns: repeat(7, 1fr);
    font-size: 0.75rem;
}

.sa-calendar-grid.sa-view-month .sa-calendar-day {
    padding: 10px;
    min-height: 100px;
}

/* Multi-layer System Styles */
.sa-daily-modal {
    max-width: 500px !important;
}

.sa-editor-modal {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Scrollable body — grows to fill available space, scrolls when content overflows */
#jit-content-wrapper {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    /* Firefox: invisible by default */
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
/* Firefox: show on hover */
#jit-content-wrapper:hover {
    scrollbar-color: rgba(110, 86, 207, 0.35) transparent;
}
/* Webkit: hide track and thumb, no arrows */
#jit-content-wrapper::-webkit-scrollbar { width: 5px; }
#jit-content-wrapper::-webkit-scrollbar-track { background: transparent; }
#jit-content-wrapper::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
    transition: background 0.2s;
}
/* Webkit: reveal thumb on container hover */
#jit-content-wrapper:hover::-webkit-scrollbar-thumb {
    background: rgba(110, 86, 207, 0.35);
}
/* Remove the up/down arrow buttons at the ends */
#jit-content-wrapper::-webkit-scrollbar-button { display: none; height: 0; width: 0; }

/* Footer stays pinned at the bottom, never scrolls away */
#jit-content-wrapper .sa-modal-footer {
    position: sticky;
    bottom: 0;
    background: rgba(18, 20, 33, 0.97);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding-top: 14px;
    margin-top: auto;
    z-index: 1;
}

/* Scroll area for preview and editor */
.sa-post-preview-box,
.sa-editor-textarea {
    max-height: 40vh;
    /* Context-aware height limit */
    overflow-y: auto;
    white-space: pre-wrap;
    /* Preserve line breaks */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sa-post-preview-box::-webkit-scrollbar,
.sa-editor-textarea::-webkit-scrollbar {
    width: 6px;
}

.sa-post-preview-box::-webkit-scrollbar-thumb,
.sa-editor-textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sa-daily-list {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sa-daily-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sa-daily-item:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

.sa-item-time {
    font-family: 'Courier New', monospace;
    color: #a855f7;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 80px;
    padding: 4px 8px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 4px;
    text-align: center;
}

.sa-item-info {
    flex: 1;
}

.sa-item-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    margin-bottom: 2px;
}

.sa-item-platform {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
}

.sa-item-delete {
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.15);
    padding: 4px 6px;
    border-radius: 6px;
    line-height: 1;
    transition: color .18s ease, background .18s ease;
}
.sa-item-delete:hover {
    color: #f97316;
    background: rgba(249, 115, 22, 0.12);
}

/* Wave Loader (3 dots) */
.sa-wave-loader {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}

.sa-wave-loader span {
    width: 10px;
    height: 10px;
    background: #a855f7;
    border-radius: 50%;
    animation: sa-wave 1.4s infinite ease-in-out both;
}

.sa-wave-loader span:nth-child(1) {
    animation-delay: -0.32s;
}

.sa-wave-loader span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes sa-wave {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

.sa-wave-loader--inline {
    display: inline-flex;
    gap: 3px;
    vertical-align: middle;
    margin-left: 4px;
}

.sa-wave-loader--inline span {
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    animation: sa-wave 1.4s infinite ease-in-out both;
}

.sa-wave-loader--inline span:nth-child(1) {
    animation-delay: -0.32s;
}

.sa-wave-loader--inline span:nth-child(2) {
    animation-delay: -0.16s;
}

.sa-editor-textarea {
    width: 100%;
    min-height: 250px;
    background: #0a0b14;
    border: 1px solid #1f2235;
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    margin-bottom: 20px;
    box-sizing: border-box;
}

/* Modal Close Button Refinement */
.sa-close-modal {
    display: none !important;
    /* Hidden in desktop */
}

@media (max-width: 900px) {
    #sa-view-calendar .sa-report-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px 16px;
        gap: 20px;
    }

    #sa-view-calendar .sa-header-content {
        margin-bottom: 5px;
    }

    #sa-view-calendar .sa-pill-selector {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    #sa-view-calendar .sa-calendar-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    #sa-view-calendar .sa-btn-primary {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    #sa-view-calendar .sa-calendar-actions .sa-btn-tab-action {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }

    #sa-view-calendar .sa-modal-footer {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }

    #sa-view-calendar .sa-modal-footer .sa-footer-left,
    #sa-view-calendar .sa-modal-footer .sa-footer-right {
        display: flex;
        flex-direction: row;
        gap: 10px;
        width: 100%;
    }

    #sa-view-calendar .sa-modal-footer .sa-footer-right {
        flex-direction: column;
    }

    #sa-view-calendar .sa-modal-footer .sa-btn {
        flex: 1;
        justify-content: center;
        padding: 10px;
    }

    #sa-view-calendar .sa-modal-footer #btn-publish-action {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }

    .sa-close-modal {
        display: flex !important;
        position: absolute;
        top: 15px;
        right: 15px;
        background: transparent !important;
        border: none !important;
        color: rgba(255, 255, 255, 0.4) !important;
        font-size: 28px !important;
        cursor: pointer;
        z-index: 100;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        box-shadow: none !important;
    }

    .sa-close-modal:hover {
        color: rgba(255, 255, 255, 0.8) !important;
    }
}

@media (max-width: 1024px) {
    .sa-calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    .sa-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sa-calendar-day {
        min-height: 100px;
    }
}

/* --- Fase 7: Add Post & IA Refinements --- */
.sa-add-btn-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
}

.sa-add-day-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sa-add-day-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: #8b5cf6;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.sa-glass-modal-alt {
    backdrop-filter: blur(25px) saturate(180%);
    background: rgba(3, 5, 18, 0.75) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    padding: 30px !important;
    width: 600px !important;
}

.sa-ai-suggestion-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-end;
}

.sa-ai-input-wrapper {
    flex: 1;
}

.sa-ai-label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
}

.sa-ai-val-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 15px;
    color: #ffffff;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sa-btn-retry-ai {
    background: transparent;
    border: none;
    color: #8b5cf6;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sa-btn-retry-ai:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: rotate(180deg);
}

.sa-add-post-textarea {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 25px auto;
    display: block;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    outline: none;
}

.sa-add-post-textarea:focus {
    border-color: #00f2ff !important;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.25);
}

.sa-ai-val-box [contenteditable="true"] {
    outline: none;
    cursor: text;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.2s;
    flex: 1;
}

.sa-ai-val-box [contenteditable="true"]:focus {
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 5px rgba(139, 92, 246, 0.2);
}

/* Ocultar Cancel en Escritorio */
@media (min-width: 901px) {
    .sa-hide-desktop {
        display: none !important;
    }
}

/* Botón cerrar para el modal nuevo (móvil/alt) */
.sa-close-modal-mobile {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    transition: color 0.2s;
}

.sa-close-modal-mobile:hover {
    color: #ffffff;
}

.sa-modal-footer-alt {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.sa-btn-import-alt {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.sa-btn-import-alt:hover {
    background: rgba(6, 182, 212, 0.2);
    transform: translateY(-2px);
}

/* --- Rediseño de cabecera en modo Escritorio (Proporciones y Alineación) --- */
@media (min-width: 901px) {
    #sa-view-calendar .sa-report-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: flex-end !important;
        justify-content: flex-start !important;
        gap: 0 !important;
        padding: 24px !important;
    }

    /* Poner el título y subtítulo en su propia fila superior */
    #sa-view-calendar .sa-header-content {
        flex: 1 1 100% !important;
        margin-bottom: 16px !important; /* Espacio simétrico abajo del subtítulo */
    }

    /* Espacio simétrico entre Título y Subtítulo */
    #sa-view-calendar .sa-report-title {
        margin-bottom: 16px !important;
    }
    
    #sa-view-calendar .sa-report-subtitle {
        margin: 0 !important;
    }

    /* Traer los selectores de día/mes a la izquierda de la segunda fila */
    #sa-view-calendar .sa-header-center {
        margin-left: 0 !important;
        flex: 0 0 auto !important;
    }

    /* Eliminar margen izquierdo del componente pill-selector para alineación absoluta */
    #sa-view-calendar .sa-pill-selector {
        margin-left: 0 !important;
    }

    /* Traer los botones de acción a la derecha de los selectores en la misma fila */
    #sa-view-calendar .sa-calendar-actions {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        margin-left: 12px !important;
        margin-bottom: 0 !important;
        gap: 12px !important;
    }
}

/* ── Radar → Calendar: drag & drop slot reordering ──────────────── */
.sa-daily-item {
    position: relative;
    transition: opacity .15s ease, background .15s ease;
    cursor: default;
}

.sa-drag-handle {
    display: inline-flex;
    align-items: center;
    color: #4a5568;
    font-size: .85rem;
    letter-spacing: -2px;
    padding: 0 6px 0 0;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
    line-height: 1;
}
.sa-drag-handle:active { cursor: grabbing; }

.sa-daily-item.sa-dragging {
    opacity: .4;
}

.sa-daily-item.sa-drag-over {
    background: rgba(139, 92, 246, .12);
    border-radius: 8px;
    outline: 1px dashed rgba(139, 92, 246, .5);
}

/* ── Agency: Change-requested indicator on calendar cards ─────── */
.sa-pulse-dot.is-changes-requested {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
    animation: sa-orange-pulse 1.8s ease-in-out infinite;
}

@keyframes sa-orange-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.5); opacity: 0.7; }
}

.sa-calendar-day.has-changes-requested {
    border-color: rgba(245, 158, 11, 0.5) !important;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

/* ── Agency: Client feedback banner inside post editor modal ───── */
.sa-client-feedback-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 8px;
    padding: 12px 14px;
    margin: 12px 0 4px;
    position: relative;
}

.sa-cfb-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.sa-cfb-body {
    flex: 1;
    min-width: 0;
}

.sa-cfb-body strong {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #f59e0b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.sa-cfb-body p {
    margin: 0;
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.sa-cfb-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color 0.2s, transform 0.15s;
}

.sa-cfb-close:hover {
    color: #22c55e;
    transform: scale(1.2);
}

/* Editable comment text */
.sa-cfb-edit-hint {
    font-weight: 400;
    font-size: 0.7rem;
    color: rgba(245, 158, 11, 0.55);
    text-transform: none;
    letter-spacing: 0;
}

.sa-cfb-text {
    margin: 0;
    font-size: 0.9rem;
    color: #e2e8f0;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: 4px;
    padding: 2px 4px;
    outline: none;
    transition: background 0.15s, border 0.15s;
    cursor: text;
    border: 1px solid transparent;
}

.sa-cfb-text:focus {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.4);
}

/* ── Calendar-level (strategy-wide) feedback banner — above the grid ── */
.sa-calendar-level-banner {
    margin: 0 0 16px;
    border-radius: 10px;
    border-width: 1.5px;
    background: rgba(245, 158, 11, 0.10);
}

.sa-calendar-level-banner .sa-cfb-body strong {
    font-size: 0.78rem;
}

.sa-calendar-level-banner .sa-cfb-text {
    font-size: 0.92rem;
}

/* Regenerate button */
.sa-btn-regen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.1));
    border: 1px solid rgba(245, 158, 11, 0.45);
    color: #fbbf24;
    font-weight: 600;
    font-size: 0.82rem;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.sa-btn-regen:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(251, 191, 36, 0.2));
    border-color: rgba(245, 158, 11, 0.75);
}

.sa-btn-regen:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.sa-regen-icon {
    font-size: 1rem;
    line-height: 1;
    display: inline-block;
}

@keyframes sa-spin-regen {
    from { transform: rotate(0deg); }
    to   { transform: rotate(-360deg); }
}

.sa-spin-icon {
    animation: sa-spin-regen 0.8s linear infinite;
}

/* ── Daily modal: post item with pending client feedback ─────────── */
.sa-daily-item.has-pending-feedback {
    border-left: 3px solid rgba(245, 158, 11, 0.7);
    background: rgba(245, 158, 11, 0.06);
}